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 Tue Apr 1 20:39:33 EET DST 2003 [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 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
53 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
54 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
55 *** Please read the README.plan9 for further instructions.
56 *** Cannot continue, aborting.
62 : compute my invocation name
66 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
71 : Proper separator for the PATH environment variable
73 : On OS/2 this directory should exist if this is not floppy only system :-]
74 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
75 if test -n "$OS2_SHELL"; then
77 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
78 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
80 elif test -n "$DJGPP"; then
81 case "X${MACHTYPE:-nonesuchmach}" in
89 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
90 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
91 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
92 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
93 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
94 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
95 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
96 paths="$paths /sbin /usr/sbin /usr/libexec"
97 paths="$paths /system/gnu_library/bin"
101 case "$p_$PATH$p_" in
103 *) test -d $p && PATH=$PATH$p_$p ;;
110 : shall we be using ksh?
116 if (PATH=.; alias -x) >/dev/null 2>&1; then
119 if test -f /hp-ux -a -f /bin/ksh; then
120 needksh='to avoid sh bug in "here document" expansion'
122 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
123 if test X`/usr/bin/uname -v` = X4; then
124 avoidksh="to avoid AIX 4's /bin/sh"
128 if test -f /osf_boot -a -f /usr/sbin/setld; then
129 if test X`/usr/bin/uname -s` = XOSF1; then
130 avoidksh="to avoid Digital UNIX' ksh"
132 unset BIN_SH # if this is 'xpg4' sh will start up ksh
135 case "$inksh/$needksh" in
142 case "$inksh/$avoidksh" in
148 case "$inksh/$needksh-$avoidksh-" in
151 (I see you are using the Korn shell. Some ksh's blow up on $me,
152 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
159 echo "(Feeding myself to $newsh $reason.)"
161 Configure|*/Configure) exec $newsh $0 "$@";;
162 *) exec $newsh Configure "$@";;
167 : if needed set CDPATH to a harmless value that is not chatty
168 : avoid bash 2.02 problems with empty CDPATH.
172 *bash*) CDPATH='.' ;;
177 : Configure runs within the UU subdirectory
178 test -d UU || mkdir UU
385 endhostent_r_proto=''
391 endprotoent_r_proto=''
397 endservent_r_proto=''
447 gethostbyaddr_r_proto=''
449 gethostbyname_r_proto=''
451 gethostent_r_proto=''
463 getnetbyaddr_r_proto=''
465 getnetbyname_r_proto=''
479 d_getprotobyname_r=''
480 getprotobyname_r_proto=''
481 d_getprotobynumber_r=''
482 getprotobynumber_r_proto=''
484 getprotoent_r_proto=''
496 getservbyname_r_proto=''
498 getservbyport_r_proto=''
500 getservent_r_proto=''
576 d_old_pthread_create_joinable=''
577 old_pthread_create_joinable=''
616 sethostent_r_proto=''
633 setprotoent_r_proto=''
645 setservent_r_proto=''
689 d_stdio_ptr_lval_nochange_cnt=''
690 d_stdio_ptr_lval_sets_cnt=''
891 inc_version_list_init=''
910 ignore_versioned_solibs=''
969 d_perl_otherlibdirs=''
983 version_patchlevel_string=''
998 nv_preserves_uv_bits=''
1087 installsitescript=''
1102 d_stdio_stream_array=''
1103 stdio_stream_array=''
1113 ccflags_uselargefiles=''
1114 ldflags_uselargefiles=''
1115 libswanted_uselargefiles=''
1135 installvendorarch=''
1142 installvendorhtml1=''
1145 installvendorhtml3=''
1153 installvendorman1=''
1156 installvendorman3=''
1163 installvendorscript=''
1177 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1180 : We must find out about Eunice early
1182 if test -f /etc/unixtovms; then
1183 eunicefix=/etc/unixtovms
1185 if test -f /etc/unixtovms.exe; then
1186 eunicefix=/etc/unixtovms.exe
1189 : Set executable suffix now -- needed before hints available
1190 if test -f "/libs/version.library"; then
1193 elif test -f "/system/gnu_library/bin/ar.pm"; then
1196 elif test -n "$DJGPP"; then
1199 elif test -d c:/. -o -n "$is_os2" ; then
1205 : Possible local include directories to search.
1206 : Set locincpth to "" in a hint file to defeat local include searches.
1207 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1208 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1210 : no include file wanted by default
1216 : Trailing extension. Override this in a hint file, if needed.
1217 : Extra object files, if any, needed on this platform.
1221 : change the next line if compiling for Xenix/286 on Xenix/386
1222 xlibpth='/usr/lib/386 /lib/386'
1223 : Possible local library directories to search.
1224 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1225 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1227 : general looking path for locating libraries
1228 glibpth="/lib /usr/lib $xlibpth"
1229 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1230 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1231 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1233 : Private path used by Configure to find libraries. Its value
1234 : is prepended to libpth. This variable takes care of special
1235 : machines, like the mips. Usually, it should be empty.
1238 : default library list
1240 : some systems want to use only the non-versioned libso:s
1241 ignore_versioned_solibs=''
1242 : full support for void wanted by default
1248 : set useposix=false in your hint file to disable the POSIX extension.
1250 : set useopcode=false in your hint file to disable the Opcode extension.
1253 ccflags_uselargefiles=''
1254 ldflags_uselargefiles=''
1255 libswanted_uselargefiles=''
1256 : set usemultiplicity on the Configure command line to enable multiplicity.
1257 : set usesocks on the Configure command line to enable socks.
1259 : set usethreads on the Configure command line to enable threads.
1260 usereentrant='undef'
1261 : List of libraries we want.
1262 : If anyone needs -lnet, put it in a hint file.
1263 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1264 libswanted="$libswanted dld ld sun m c cposix posix"
1265 libswanted="$libswanted ndir dir crypt sec"
1266 libswanted="$libswanted ucb bsd BSD PW x util rt posix4"
1267 : We probably want to search /usr/shlib before most other libraries.
1268 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1269 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1270 glibpth="/usr/shlib $glibpth"
1271 : Do not use vfork unless overridden by a hint file.
1274 : Find the basic shell for Bourne shell scripts
1278 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1281 if test -f "$xxx"; then
1284 : Build up a list and do a single loop so we can 'break' out.
1285 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1286 for xxx in sh bash ksh pdksh ash; do
1288 try="$try ${p}/${xxx}"
1292 if test -f "$xxx"; then
1295 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1298 elif test -f "$xxx.exe"; then
1309 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1311 Usually it's in /bin/sh. How did you even get this far?
1312 Please contact me (Perl Maintainers) at perlbug@perl.org and
1313 we'll try to straighten this all out.
1319 : see if sh knows # comments
1320 if `$sh -c '#' >/dev/null 2>&1`; then
1324 test -f $xcat$_exe || xcat=/usr/bin/cat
1325 if test ! -f $xcat$_exe; then
1326 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1327 if test -f $p/cat$_exe; then
1332 if test ! -f $xcat$_exe; then
1333 echo "Can't find cat anywhere!"
1337 echo "#!$xcat" >sharp
1341 if test -s today; then
1344 echo "#! $xcat" > sharp
1348 if test -s today; then
1356 echo "Your $sh doesn't grok # comments--I will strip them later on."
1359 echo "exec grep -v '^[ ]*#'" >spitshell
1361 $eunicefix spitshell
1362 spitshell=`pwd`/spitshell
1364 echo "I presume that if # doesn't work, #! won't work either!"
1369 : figure out how to guarantee sh startup
1371 '') startsh=${sharpbang}${sh} ;;
1383 : echo "Yup, it does."
1385 echo "Hmm... '$startsh' does not guarantee sh startup..."
1386 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1391 : Save command line options in file UU/cmdline.opt for later use in
1392 : generating config.sh.
1393 cat > cmdline.opt <<EOSH
1394 # Configure command line arguments.
1403 cat >>cmdline.opt <<EOSH
1404 config_arg$argn='$arg'
1406 # Extreme backslashitis: replace each ' by '"'"'
1407 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1410 arg_exp=`cat cmdl.opt`
1411 args_exp="$args_exp$args_sep'$arg_exp'"
1412 argn=`expr $argn + 1`
1415 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1416 # used by ./hints/os2.sh
1419 : produce awk script to parse command line options
1420 cat >options.awk <<'EOF'
1422 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1424 len = length(optstr);
1425 for (i = 1; i <= len; i++) {
1426 c = substr(optstr, i, 1);
1427 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1438 if (substr(str, 1, 1) != "-") {
1439 printf("'%s'\n", str);
1443 for (i = 2; i <= len; i++) {
1444 c = substr(str, i, 1);
1446 printf("-%s\n", substr(str, i));
1452 printf("'%s'\n", substr(str, i + 1));
1465 : process the command line options
1466 set X `for arg in "$@"; do echo "X$arg"; done |
1467 sed -e s/X// | awk -f options.awk`
1472 : set up default values
1482 rm -f optdef.sh posthint.sh
1483 cat >optdef.sh <<EOS
1489 while test $# -gt 0; do
1491 -d) shift; fastread=yes;;
1492 -e) shift; alldone=cont;;
1496 if test -r "$1"; then
1499 echo "$me: cannot read config file $1." >&2
1504 -h) shift; error=true;;
1505 -r) shift; reuseval=true;;
1506 -s) shift; silent=true; realsilent=true;;
1507 -E) shift; alldone=exit;;
1508 -K) shift; knowitall=true;;
1509 -O) shift; override=true;;
1510 -S) shift; silent=true; extractsh=true;;
1515 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1516 echo "$me: ignoring -D $1" >&2
1519 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1520 *) echo "$1='define'" >> optdef.sh;;
1527 *=) echo "$1" >> optdef.sh;;
1529 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1530 echo "$me: ignoring -U $1" >&2
1532 *) echo "$1='undef'" >> optdef.sh;;
1543 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1547 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1548 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1554 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1555 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1556 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1557 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1558 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1559 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1565 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1567 echo "$yyy=''" >> posthint.sh ;;
1572 echo "$yyy='$zzz'" >> posthint.sh ;;
1574 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1576 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1581 echo "$yyy=$zzz" >> posthint.sh ;;
1582 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1586 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1589 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1597 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1598 [-U symbol] [-U symbol=] [-A command:symbol...]
1599 -d : use defaults for all answers.
1600 -e : go on without questioning past the production of config.sh.
1601 -f : specify an alternate default configuration file.
1602 -h : print this help message and exit (with an error status).
1603 -r : reuse C symbols value if possible (skips costly nm extraction).
1604 -s : silent mode, only echoes questions and essential information.
1605 -D : define symbol to have some value:
1606 -D symbol symbol gets the value 'define'
1607 -D symbol=value symbol gets the value 'value'
1608 -E : stop at the end of questions, after having produced config.sh.
1609 -K : do not use unless you know what you are doing.
1610 -O : let -D and -U override definitions from loaded configuration file.
1611 -S : perform variable substitutions on all .SH files (can mix with -f)
1612 -U : undefine symbol:
1613 -U symbol symbol gets the value 'undef'
1614 -U symbol= symbol gets completely empty
1615 -A : manipulate symbol after the platform specific hints have been applied:
1616 -A symbol=value append " "value to symbol
1617 -A append:symbol=value append value to symbol
1618 -A define:symbol=value define symbol to have value
1619 -A clear:symbol define symbol to be ''
1620 -A define:symbol define symbol to be 'define'
1621 -A eval:symbol=value define symbol to be eval of value
1622 -A prepend:symbol=value prepend value to symbol
1623 -A undef:symbol define symbol to be 'undef'
1624 -A undef:symbol= define symbol to be ''
1625 -V : print version number and exit (with a zero status).
1632 case "$fastread$alldone" in
1635 case "$extractsh" in
1638 if test ! -t 0; then
1639 echo "Say 'sh Configure', not 'sh <Configure'"
1649 true) exec 1>/dev/null;;
1652 : run the defines and the undefines, if any, but leave the file out there...
1655 : create the posthint manipulation script and leave the file out there...
1660 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1661 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1662 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1663 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1664 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1667 : Some greps do not return status, grrr.
1668 echo "grimblepritz" >grimble
1669 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1671 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1677 : the following should work in any shell
1681 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1682 cat >contains <<'EOSS'
1683 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1688 : Find the path to the source tree
1691 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1695 *) src=`cd ../$src && pwd` ;;
1708 if test -f $rsrc/Configure && \
1709 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1711 : found it, so we are ok.
1714 for src in . .. ../.. ../../.. ../../../..; do
1715 if test -f ../$src/Configure && \
1716 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1727 Sorry, I can't seem to locate the source dir for $package. Please start
1728 Configure with an explicit path -- i.e. /some/path/Configure.
1736 echo "Sources for $package found in \"$src\"." >&4
1740 : script used to extract .SH files with variable substitutions
1741 cat >extract <<'EOS'
1743 echo "Doing variable substitutions on .SH files..."
1744 if test -f MANIFEST; then
1745 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1747 echo "(Looking for .SH files under the source directory.)"
1748 set x `(cd "$src"; find . -name "*.SH" -print)`
1752 0) set x `(cd "$src"; echo *.SH)`; shift;;
1754 if test ! -f "$src/$1"; then
1760 while test $name; do
1761 if test ! -d "$name"; then
1762 create="$name $create";
1763 name=`echo $name | sed -e "s|^[^/]*$||"`;
1764 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1769 for file in $create; do
1778 dir=`expr X$file : 'X\(.*\)/'`
1779 file=`expr X$file : 'X.*/\(.*\)'`
1780 (cd "$dir" && . ./$file)
1790 dir=`expr X$file : 'X\(.*\)/'`
1791 file=`expr X$file : 'X.*/\(.*\)'`
1792 (set x $dir; shift; eval $mkdir_p)
1793 sh <"$src/$dir/$file"
1802 if test -f "$src/config_h.SH"; then
1803 if test ! -f config.h; then
1804 : oops, they left it out of MANIFEST, probably, so do it anyway.
1805 . "$src/config_h.SH"
1810 : extract files and exit if asked to do so
1811 case "$extractsh" in
1813 case "$realsilent" in
1817 case "$config_sh" in
1818 '') config_sh='config.sh';;
1821 echo "Fetching answers from $config_sh..."
1824 test "$override" && . ./optdef.sh
1828 echo "Extraction done."
1833 : Eunice requires " " instead of "", can you believe it
1836 echo "Beginning of configuration questions for $package."
1838 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1840 : first determine how to suppress newline on echo command
1842 echo "Checking echo to see how to suppress newlines..."
1843 (echo "hi there\c" ; echo " ") >.echotmp
1844 if $contains c .echotmp >/dev/null 2>&1 ; then
1855 echo $n "The star should be here-->$c"
1859 : Now test for existence of everything in MANIFEST
1861 if test -f "$rsrc/MANIFEST"; then
1862 echo "First let's make sure your kit is complete. Checking..." >&4
1863 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1866 for filelist in x??; do
1867 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1869 if test -s missing; then
1873 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1875 You have the option of continuing the configuration process, despite the
1876 distinct possibility that your kit is damaged, by typing 'y'es. If you
1877 do, don't blame me if something goes wrong. I advise you to type 'n'o
1878 and contact the author (perlbug@perl.org).
1881 echo $n "Continue? [n] $c" >&4
1885 echo "Continuing..." >&4
1889 echo "ABORTING..." >&4
1894 echo "Looks good..."
1897 echo "There is no MANIFEST file. I hope your kit is complete !"
1902 : Find the appropriate value for a newline for tr
1903 if test -n "$DJGPP"; then
1906 if test X"$trnl" = X; then
1907 case "`echo foo|tr '\n' x 2>/dev/null`" in
1911 if test X"$trnl" = X; then
1912 case "`echo foo|tr '\012' x 2>/dev/null`" in
1913 foox) trnl='\012' ;;
1916 if test X"$trnl" = X; then
1917 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1918 fooxy) trnl='\n\r' ;;
1921 if test X"$trnl" = X; then
1924 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1930 : compute the number of columns on the terminal for proper question formatting
1935 : set up the echo used in my read
1936 myecho="case \"\$xxxm\" in
1937 '') echo $n \"\$rp $c\" >&4;;
1939 '') echo $n \"[\$xxxm] $c\";;
1941 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1943 echo $n \"[\$xxxm] $c\" >&4
1945 echo $n \"\$rp [\$xxxm] $c\" >&4
1951 : now set up to do reads with possible shell escape and default assignment
1957 case "\$fastread" in
1958 yes) case "\$dflt" in
1961 case "\$silent-\$rp" in
1966 *) case "\$silent" in
1967 true) case "\$rp" in
1972 while expr "X\$ans" : "X!" >/dev/null; do
1976 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1984 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1993 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1998 echo "(OK, I'll run with -d after this question.)" >&4
2001 echo "*** Sorry, \$1 not supported yet." >&4
2011 echo "*** Substitution done -- please confirm."
2013 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2018 echo "*** Error -- try again."
2025 case "\$ans\$xxxm\$nostick" in
2037 : create .config dir to save info across Configure sessions
2038 test -d ../.config || mkdir ../.config
2039 cat >../.config/README <<EOF
2040 This directory created by Configure to save information that should
2041 persist across sessions for $package.
2043 You may safely delete it if you wish.
2046 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2048 $define|true|[yY]*) ;;
2049 *) case "$xversion" in
2052 *** WHOA THERE!!! ***
2054 This is an UNSTABLE DEVELOPMENT release.
2055 The version of this $package distribution is $xversion, that is, odd,
2056 (as opposed to even) and that signifies a development release.
2057 If you want a maintenance release, you want an even-numbered version.
2059 Do ***NOT*** install this into production use.
2060 Data corruption and crashes are possible.
2062 It is most seriously suggested that you do not continue any further
2063 unless you want to help in developing and debugging Perl.
2065 If you *still* want to build perl, you can answer 'y' now,
2066 or pass -Dusedevel to Configure.
2069 rp='Do you really want to continue?'
2073 [yY]) echo >&4 "Okay, continuing."
2074 usedevel="$define" ;;
2075 *) echo >&4 "Okay, bye."
2085 case "$versiononly" in
2086 '') versiononly="$define" ;;
2088 case "$installusrbinperl" in
2089 '') installusrbinperl="$undef" ;;
2094 : general instructions
2097 user=`(logname) 2>/dev/null`
2099 '') user=`whoami 2>&1`;;
2101 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2104 rp='Would you like to see the instructions?'
2115 This installation shell script will examine your system and ask you questions
2116 to determine how the perl5 package should be installed. If you get
2117 stuck on a question, you may use a ! shell escape to start a subshell or
2118 execute a command. Many of the questions will have default answers in square
2119 brackets; typing carriage return will give you the default.
2121 On some of the questions which ask for file or directory names you are allowed
2122 to use the ~name construct to specify the login directory belonging to "name",
2123 even if you don't have a shell which knows about that. Questions where this is
2124 allowed will be marked "(~name ok)".
2128 dflt='Type carriage return to continue'
2132 The prompter used in this script allows you to use shell variables and
2133 backticks in your answers. You may use $1, $2, etc... to refer to the words
2134 in the default answer, as if the default line was a set of arguments given to a
2135 script shell. This means you may also use $* to repeat the whole default line,
2136 so you do not have to re-type everything to add something to the default.
2138 Everytime there is a substitution, you will have to confirm. If there is an
2139 error (e.g. an unmatched backtick), the default answer will remain unchanged
2140 and you will be prompted again.
2142 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2143 the questions and use the computed defaults (or the previous answers if there
2144 was already a config.sh file). Type 'Configure -h' for a list of options.
2145 You may also start interactively and then answer '& -d' at any prompt to turn
2146 on the non-interactive behaviour for the remainder of the execution.
2152 Much effort has been expended to ensure that this shell script will run on any
2153 Unix system. If despite that it blows up on yours, your best bet is to edit
2154 Configure and run it again. If you can't run Configure for some reason,
2155 you'll have to generate a config.sh file by hand. Whatever problems you
2156 have, let me (perlbug@perl.org) know how I blew it.
2158 This installation script affects things in two ways:
2160 1) it may do direct variable substitutions on some of the files included
2162 2) it builds a config.h file for inclusion in C programs. You may edit
2163 any of these files as the need arises after running this script.
2165 If you make a mistake on a question, there is no easy way to back up to it
2166 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2167 files. Configure will offer to let you do this before it runs the SH files.
2170 dflt='Type carriage return to continue'
2172 case "$firsttime" in
2173 true) echo $user >>../.config/instruct;;
2177 : find out where common programs are
2179 echo "Locating common programs..." >&4
2192 if test -d \$dir/\$thing; then
2198 for thisthing in \$dir/\$thing; do
2199 : just loop through to pick last item
2201 if test -f \$thisthing; then
2204 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2207 elif test -f \$dir/\$thing.exe; then
2208 if test -n "$DJGPP"; then
2209 echo \$dir/\$thing.exe
2210 elif test "$eunicefix" != ":"; then
2211 : on Eunice apparently
2265 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2266 pth="$pth /lib /usr/lib"
2267 for file in $loclist; do
2271 if test -f "$xxx"; then
2274 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2275 xxx=`./loc $file $file $pth`
2278 '') xxx=`./loc $file $file $pth`;;
2279 *) xxx=`./loc $xxx $xxx $pth`;;
2281 eval $file=$xxx$_exe
2285 echo $file is in $xxx.
2288 echo $file is in $xxx.
2291 echo "I don't know where '$file' is, and my life depends on it." >&4
2292 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2298 echo "Don't worry if any of the following aren't found..."
2300 for file in $trylist; do
2304 if test -f "$xxx"; then
2307 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2308 xxx=`./loc $file $file $pth`
2311 '') xxx=`./loc $file $file $pth`;;
2312 *) xxx=`./loc $xxx $xxx $pth`;;
2314 eval $file=$xxx$_exe
2318 echo $file is in $xxx.
2321 echo $file is in $xxx.
2324 echo "I don't see $file out there, $say."
2331 echo "Substituting grep for egrep."
2338 echo "Substituting cp for ln."
2347 echo "I can't find make or gmake, and my life depends on it." >&4
2348 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2356 *) # We can't have osname yet.
2357 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2358 # Assume that gmake, if found, is definitely GNU make
2359 # and prefer it over the system make.
2360 echo "Substituting gmake for make."
2368 echo "Hopefully test is built into your sh."
2371 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2372 echo "Using the test built into your sh."
2380 echo "Hopefully echo is built into your sh."
2385 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2386 $echo $n "hi there$c" >foo1
2387 echo $n "hi there$c" >foo2
2388 if cmp foo1 foo2 >/dev/null 2>&1; then
2389 echo "They are compatible. In fact, they may be identical."
2396 They are not compatible! You are probably running ksh on a non-USG system.
2397 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2398 have echo built in and we may have to run some Bourne shell scripts. That
2399 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2402 $echo $n "The star should be here-->$c"
2412 cat <<'EOSC' >>trygcc
2417 int main(int argc, char *argv[]) {
2421 if $cc -o try $ccflags $ldflags try.c; then
2424 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2430 case "`$cc -v -c try.c 2>&1`" in
2433 if $test X"$trygcc" = Xyes; then
2434 if gcc -o try -c try.c; then
2436 echo "You seem to have a working gcc, though." >&4
2437 rp="Would you like to use it?"
2439 if $test -f myread; then
2442 if $test -f UU/myread; then
2445 echo "Cannot find myread, sorry. Aborting." >&2
2450 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2451 if $test -f usethreads.cbu; then
2454 *** However, any setting of the C compiler flags (e.g. for thread support)
2455 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2456 *** (together with e.g. -Dusethreads).
2472 cat <<'EOSC' >>checkcc
2477 int main(int argc, char *argv[]) {
2481 if $cc -o try $ccflags $ldflags try.c; then
2484 if $test X"$despair" = Xyes; then
2485 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2488 You need to find a working C compiler.
2489 Either (purchase and) install the C compiler supplied by your OS vendor,
2490 or for a free C compiler try http://gcc.gnu.org/
2491 I cannot continue any further, aborting.
2500 : determine whether symbolic links are supported
2503 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2504 echo "Symbolic links are supported." >&4
2507 echo "Symbolic links are NOT supported." >&4
2512 : determine whether symbolic links are supported
2516 echo "Checking how to test for symbolic links..." >&4
2518 if $test "X$issymlink" = X; then
2520 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2521 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2523 if test $? = 0; then
2526 echo "Your builtin 'test -h' may be broken." >&4
2529 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2532 if test -f "$p/$test"; then
2541 echo "Trying external '$test -h'." >&4
2542 issymlink="$test -h"
2543 if $test ! -h sym >/dev/null 2>&1; then
2544 echo "External '$test -h' is broken, too." >&4
2552 if $test "X$issymlink" = X; then
2553 if $test -L sym 2>/dev/null; then
2554 issymlink="$test -L"
2555 echo "The builtin '$test -L' worked." >&4
2558 if $test "X$issymlink" != X; then
2559 echo "You can test for symbolic links with '$issymlink'." >&4
2561 echo "I do not know how you can test for symbolic links." >&4
2565 *) echo "No symbolic links, so not testing for their testing..." >&4
2571 case "$mksymlinks" in
2574 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2577 *) case "$lns:$issymlink" in
2578 *"ln"*" -s:"*"test -"?)
2579 echo "Creating the symbolic links..." >&4
2580 echo "(First creating the subdirectories...)" >&4
2582 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2584 test -z "$directory" && break
2588 if test ! -d t/base; then
2589 echo "Failed to create the subdirectories. Aborting." >&4
2592 echo "(Then creating the symlinks...)" >&4
2593 awk '{print $1}' $src/MANIFEST | while true; do
2595 test -z "$filename" && break
2596 if test -f $filename; then
2597 if $issymlink $filename; then
2601 if test -f $filename; then
2602 echo "$filename already exists, not symlinking."
2604 ln -s $src/$filename $filename
2608 if test ! -f t/base/lex.t; then
2609 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2614 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2623 case "$usecrosscompile" in
2625 $echo "Cross-compiling..."
2628 *-*-gcc) # A cross-compiling gcc, probably.
2629 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2631 # leave out ld, choosing it is more complex
2633 ranlib=$targetarch-ranlib
2634 $echo 'extern int foo;' > try.c
2635 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2637 if $test $# -gt 0; then
2639 incpth="`$echo $incpth|$sed 's/^ //'`"
2640 echo "Guessing incpth '$incpth'." >&4
2642 j="`$echo $i|$sed 's,/include$,/lib,'`"
2643 if $test -d $j; then
2647 libpth="`$echo $libpth|$sed 's/^ //'`"
2648 echo "Guessing libpth '$libpth'." >&4
2653 case "$targetarch" in
2654 '') echo "Targetarch not defined." >&4; croak=y ;;
2655 *) echo "Using targetarch $targetarch." >&4 ;;
2658 '') echo "Incpth not defined." >&4; croak=y ;;
2659 *) echo "Using incpth '$incpth'." >&4 ;;
2662 '') echo "Libpth not defined." >&4; croak=y ;;
2663 *) echo "Using libpth '$libpth'." >&4 ;;
2666 '') for i in $incpth; do
2667 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2669 echo "Guessing usrinc $usrinc." >&4
2674 '') echo "Usrinc not defined." >&4; croak=y ;;
2677 *) echo "Using usrinc $usrinc." >&4 ;;
2679 case "$targethost" in
2680 '') echo "Targethost not defined." >&4; croak=y ;;
2681 *) echo "Using targethost $targethost." >&4
2686 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2689 /*) run=$src/Cross/run
2690 targetmkdir=$src/Cross/mkdir
2692 from=$src/Cross/from
2694 *) pwd=`$test -f ../Configure & cd ..; pwd`
2696 targetmkdir=$pwd/Cross/mkdir
2698 from=$pwd/Cross/from
2701 case "$targetrun" in
2702 '') targetrun=ssh ;;
2707 case "$targetfrom" in
2708 '') targetfrom=scp ;;
2712 from=$from-$targetfrom
2713 case "$targetdir" in
2715 echo "Guessing targetdir $targetdir." >&4
2718 case "$targetuser" in
2720 echo "Guessing targetuser $targetuser." >&4
2723 case "$targetfrom" in
2727 case "$targetrun" in
2739 '') cwd=$targetdir ;;
2743 if $test ! -f \$exe.xok; then
2747 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2750 *) echo "Unknown targetrun '$targetrun'" >&4
2754 case "$targetmkdir" in
2756 cat >$targetmkdir <<EOF
2758 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2760 $chmod a+rx $targetmkdir
2762 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2774 $targetmkdir \`dirname \$f\`
2775 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2778 $targetmkdir $targetdir/\`dirname \$f\`
2779 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2792 $mkdir -p $targetdir/\`dirname \$f\`
2793 $cp \$f $targetdir/\$f || exit 1
2796 $targetmkdir $targetdir/\`dirname \$f\`
2797 $cp \$f $targetdir/\$f || exit 1
2804 *) echo "Unknown targetto '$targetto'" >&4
2808 case "$targetfrom" in
2815 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2820 cp) cat >$from <<EOF
2825 cp $targetdir/\$f . || exit 1
2830 *) echo "Unknown targetfrom '$targetfrom'" >&4
2834 if $test ! -f $run; then
2835 echo "Target 'run' script '$run' not found." >&4
2839 if $test ! -f $to; then
2840 echo "Target 'to' script '$to' not found." >&4
2844 if $test ! -f $from; then
2845 echo "Target 'from' script '$from' not found." >&4
2849 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2853 Using '$run' for remote execution,
2854 and '$from' and '$to'
2855 for remote file transfer.
2861 usecrosscompile='undef'
2866 : see whether [:lower:] and [:upper:] are supported character classes
2868 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2870 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2874 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2875 # (0xc9 and 0xd1), therefore that is a nice testing point.
2876 if test "X$up" = X -o "X$low" = X; then
2877 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2883 if test "X$up" = X -o "X$low" = X; then
2884 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2890 if test "X$up" = X -o "X$low" = X; then
2891 case "`echo IJ | od -x 2>/dev/null`" in
2893 echo "Hey, this might be EBCDIC." >&4
2894 if test "X$up" = X -o "X$low" = X; then
2895 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2896 ij) up='[A-IJ-RS-Z]'
2901 if test "X$up" = X -o "X$low" = X; then
2902 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2912 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2914 echo "Using $up and $low to convert case." >&4
2917 echo "I don't know how to translate letters from upper to lower case." >&4
2918 echo "Your tr is not acting any way I know of." >&4
2922 : set up the translation script tr, must be called with ./tr of course
2926 '[A-Z][a-z]') exec $tr '$up' '$low';;
2927 '[a-z][A-Z]') exec $tr '$low' '$up';;
2934 : Try to determine whether config.sh was made on this system
2935 case "$config_sh" in
2937 myuname=`$uname -a 2>/dev/null`
2938 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2939 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2940 # because the A-Z/a-z are not consecutive.
2941 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2942 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2943 newmyuname="$myuname"
2945 case "$knowitall" in
2947 if test -f ../config.sh; then
2948 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2949 eval "`grep myuname= ../config.sh`"
2951 if test "X$myuname" = "X$newmyuname"; then
2959 : Get old answers from old config file if Configure was run on the
2960 : same system, otherwise use the hints.
2963 if test -f config.sh; then
2965 rp="I see a config.sh file. Shall I use it to set the defaults?"
2968 n*|N*) echo "OK, I'll ignore it."
2969 mv config.sh config.sh.old
2970 myuname="$newmyuname"
2972 *) echo "Fetching default answers from your old config.sh file..." >&4
2980 : Older versions did not always set $sh. Catch re-use of such
2990 if test ! -f config.sh; then
2993 First time through, eh? I have some defaults handy for some systems
2994 that need some extra help getting the Configure answers right:
2997 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2999 : Half the following guesses are probably wrong... If you have better
3000 : tests or hints, please send them to perlbug@perl.org
3001 : The metaconfig authors would also appreciate a copy...
3002 $test -f /irix && osname=irix
3003 $test -f /xenix && osname=sco_xenix
3004 $test -f /dynix && osname=dynix
3005 $test -f /dnix && osname=dnix
3006 $test -f /lynx.os && osname=lynxos
3007 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3008 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3009 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3010 $test -f /bin/mips && /bin/mips && osname=mips
3011 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3012 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3013 $test -d /usr/apollo/bin && osname=apollo
3014 $test -f /etc/saf/_sactab && osname=svr4
3015 $test -d /usr/include/minix && osname=minix
3016 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3017 if $test -d /MachTen -o -d /MachTen_Folder; then
3019 if $test -x /sbin/version; then
3020 osvers=`/sbin/version | $awk '{print $2}' |
3021 $sed -e 's/[A-Za-z]$//'`
3022 elif $test -x /usr/etc/version; then
3023 osvers=`/usr/etc/version | $awk '{print $2}' |
3024 $sed -e 's/[A-Za-z]$//'`
3030 $test -f /sys/posix.dll &&
3031 $test -f /usr/bin/what &&
3032 set X `/usr/bin/what /sys/posix.dll` &&
3033 $test "$3" = UWIN &&
3037 if $test -f $uname; then
3045 umips) osname=umips ;;
3048 [23]100) osname=mips ;;
3049 next*) osname=next ;;
3051 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3052 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3055 elif $test -f /etc/kconfig; then
3057 if test "$lns" = "$ln -s"; then
3059 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3061 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3068 if test -n "$DJGPP"; then
3077 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3079 'not found') osvers="$4"."$3" ;;
3080 '<3240'|'<>3240') osvers=3.2.0 ;;
3081 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3082 '=3250'|'>3250') osvers=3.2.5 ;;
3086 bsd386) osname=bsd386
3089 cygwin*) osname=cygwin
3092 *dc.osx) osname=dcosx
3098 domainos) osname=apollo
3104 dynixptx*) osname=dynixptx
3105 osvers=`echo "$4"|sed 's/^v//'`
3107 freebsd) osname=freebsd
3109 genix) osname=genix ;;
3111 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3127 netbsd*) osname=netbsd
3130 news-os) osvers="$3"
3132 4*) osname=newsos4 ;;
3136 next*) osname=next ;;
3137 nonstop-ux) osname=nonstopux ;;
3138 openbsd) osname=openbsd
3144 POSIX-BC | posix-bc ) osname=posix-bc
3147 powerux | power_ux | powermax_os | powermaxos | \
3148 powerunix | power_unix) osname=powerux
3154 solaris) osname=solaris
3156 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3163 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3167 titanos) osname=titanos
3176 ultrix) osname=ultrix
3179 osf1|mls+) case "$5" in
3182 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3185 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3188 hp*) osname=hp_osf1 ;;
3189 mips) osname=mips_osf1 ;;
3192 unixware) osname=svr5
3200 $2) case "$osname" in
3204 : svr4.x or possibly later
3214 if test -f /stand/boot ; then
3215 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3216 if test -n "$INITPROG" -a -f "$INITPROG"; then
3217 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3218 if test -n "$isesix"; then
3226 *) if test -f /etc/systemid; then
3228 set `echo $3 | $sed 's/\./ /g'` $4
3229 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3231 elif $test -f $src/hints/sco_$1_$2.sh; then
3233 elif $test -f $src/hints/sco_$1.sh; then
3238 '') : Still unknown. Probably a generic Sys V.
3247 *) case "$osname" in
3248 '') : Still unknown. Probably a generic BSD.
3256 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3257 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3258 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3261 $rm -f UU/kernel.what
3262 elif test -d c:/. -o -n "$is_os2" ; then
3269 case "$targetarch" in
3272 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3277 : Now look for a hint file osname_osvers, unless one has been
3278 : specified already.
3281 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3282 : Also try without trailing minor version numbers.
3283 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3284 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3285 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3286 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3289 *) case "$osvers" in
3292 *) if $test -f $src/hints/$file.sh ; then
3294 elif $test -f $src/hints/$xfile.sh ; then
3296 elif $test -f $src/hints/$xxfile.sh ; then
3298 elif $test -f $src/hints/$xxxfile.sh ; then
3300 elif $test -f $src/hints/$xxxxfile.sh ; then
3302 elif $test -f "$src/hints/${osname}.sh" ; then
3311 if $test -f Policy.sh ; then
3314 none) dflt="Policy" ;;
3315 *) dflt="Policy $dflt" ;;
3320 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3324 if $test -f Policy.sh ; then
3327 There's also a Policy hint file available, which should make the
3328 site-specific (policy) questions easier to answer.
3335 You may give one or more space-separated answers, or "none" if appropriate.
3336 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3337 is a good thing. DO NOT give a wrong version or a wrong OS.
3341 rp="Which of these apply, if any?"
3344 for file in $tans; do
3345 if $test X$file = XPolicy -a -f Policy.sh; then
3347 $cat Policy.sh >> UU/config.sh
3348 elif $test -f $src/hints/$file.sh; then
3349 . $src/hints/$file.sh
3350 $cat $src/hints/$file.sh >> UU/config.sh
3351 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3354 : Give one chance to correct a possible typo.
3355 echo "$file.sh does not exist"
3357 rp="hint to use instead?"
3359 for file in $ans; do
3360 if $test -f "$src/hints/$file.sh"; then
3361 . $src/hints/$file.sh
3362 $cat $src/hints/$file.sh >> UU/config.sh
3363 elif $test X$ans = X -o X$ans = Xnone ; then
3366 echo "$file.sh does not exist -- ignored."
3373 : Remember our hint file for later.
3374 if $test -f "$src/hints/$file.sh" ; then
3384 echo "Fetching default answers from $config_sh..." >&4
3388 cp $config_sh config.sh 2>/dev/null
3398 test "$override" && . ./optdef.sh
3400 : Restore computed paths
3401 for file in $loclist $trylist; do
3402 eval $file="\$_$file"
3407 Configure uses the operating system name and version to set some defaults.
3408 The default value is probably right if the name rings a bell. Otherwise,
3409 since spelling matters for me, either accept the default or answer "none"
3416 ''|' '|none) dflt=none ;;
3417 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3420 *) dflt="$osname" ;;
3422 rp="Operating system name?"
3426 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3432 ''|' '|none) dflt=none ;;
3433 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3434 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3436 ''|' ') dflt=none ;;
3441 *) dflt="$osvers" ;;
3443 rp="Operating system version?"
3453 : who configured the system
3454 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3455 cf_by=`(logname) 2>/dev/null`
3458 cf_by=`(whoami) 2>/dev/null`
3460 "") cf_by=unknown ;;
3464 : set up the script used to warn in case of inconsistency
3471 echo "*** WHOA THERE!!! ***" >&4
3472 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3473 rp=" Keep the $hint value?"
3476 y) td=$was; tu=$was;;
3480 : function used to set $1 to $val
3481 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3483 $define$undef) . ./whoa; eval "$var=\$td";;
3484 $undef$define) . ./whoa; eval "$var=\$tu";;
3485 *) eval "$var=$val";;
3489 $define|true|[yY]*) dflt='y';;
3494 Perl can be built to use the SOCKS proxy protocol library. To do so,
3495 Configure must be run with -Dusesocks. If you use SOCKS you also need
3496 to use the PerlIO abstraction layer, this will be implicitly selected.
3498 If this doesn't make any sense to you, just accept the default '$dflt'.
3500 rp='Build Perl for SOCKS?'
3503 y|Y) val="$define" ;;
3510 $define|true|[yY]*) useperlio="$define";;
3513 case "$useperlio" in
3514 $define|true|[yY]*|'') dflt='y';;
3519 Previous version of $package used the standard IO mechanisms as
3520 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3521 alternate IO mechanisms via the PerlIO abstraction layer, but the
3522 stdio mechanism is still available if needed. The abstraction layer
3523 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3524 Using PerlIO with sfio may cause problems with some extension modules.
3526 If this doesn't make any sense to you, just accept the default '$dflt'.
3528 rp='Use the PerlIO abstraction layer?'
3535 echo "Ok, doing things the stdio way."
3544 case "$useperlio" in
3545 $define|true|[yY]*) ;;
3548 You are using the SOCKS proxy protocol library which means that you
3549 should also use the PerlIO layer. You may be headed for trouble.
3558 case "$usethreads" in
3559 $define|true|[yY]*) dflt='y';;
3560 *) # Catch case where user specified ithreads or 5005threads but
3561 # forgot -Dusethreads (A.D. 4/2002)
3562 case "$useithreads$use5005threads" in
3564 case "$useperlio" in
3565 "$define") dflt='y' ;;
3575 Perl can be built to take advantage of threads on some systems.
3576 To do so, Configure can be run with -Dusethreads.
3578 Note that Perl built with threading support runs slightly slower
3579 and uses more memory than plain Perl. The current implementation
3580 is believed to be stable, but it is fairly new, and so should be
3581 treated with caution.
3583 If this doesn't make any sense to you, just accept the default '$dflt'.
3585 rp='Build a threading Perl?'
3588 y|Y) val="$define" ;;
3594 case "$usethreads" in
3598 Since release 5.6, Perl has had two different threading implementations,
3599 the newer interpreter-based version (ithreads) with one interpreter per
3600 thread, and the older 5.005 version (5005threads).
3601 The 5005threads version is effectively unmaintained and will probably be
3602 removed in Perl 5.10, so there should be no need to build a Perl using it
3603 unless needed for backwards compatibility with some existing 5.005threads
3607 : Default to ithreads unless overridden on command line or with
3610 case "$use5005threads" in
3611 $define|true|[yY]*) dflt='n';;
3613 case "$useithreads" in
3614 $undef|false|[nN]*) dflt='n';;
3616 rp='Use the newer interpreter-based ithreads?'
3619 y|Y) val="$define" ;;
3624 : Now set use5005threads to the opposite value.
3625 case "$useithreads" in
3626 $define) val="$undef" ;;
3633 useithreads="$undef"
3634 use5005threads="$undef"
3638 case "$useithreads$use5005threads" in
3642 You cannot have both the ithreads and the 5.005 threads enabled
3643 at the same time. Disabling the 5.005 threads since they are
3644 much less stable than the ithreads.
3647 use5005threads="$undef"
3651 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3654 *** To build with ithreads you must also use the PerlIO layer.
3655 *** Cannot continue, aborting.
3661 case "$d_oldpthreads" in
3662 '') : Configure tests would be welcome here. For now, assume undef.
3664 *) val="$d_oldpthreads" ;;
3670 case "$usethreads" in
3671 "$define"|true|[yY]*)
3672 : Look for a hint-file generated 'call-back-unit'. If the
3673 : user has specified that a threading perl is to be built,
3674 : we may need to set or change some other defaults.
3675 if $test -f usethreads.cbu; then
3676 echo "Your platform has some specific hints for threaded builds, using them..."
3680 (Your platform doesn't have any specific hints for threaded builds.
3681 Assuming POSIX threads, then.)
3689 Perl can be built so that multiple Perl interpreters can coexist
3690 within the same Perl executable.
3693 case "$useithreads" in
3696 This multiple interpreter support is required for interpreter-based threads.
3700 *) case "$usemultiplicity" in
3701 $define|true|[yY]*) dflt='y';;
3705 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3706 rp='Build Perl for multiplicity?'
3709 y|Y) val="$define" ;;
3718 case "$usemorebits" in
3719 "$define"|true|[yY]*)
3720 use64bitint="$define"
3721 uselongdouble="$define"
3722 usemorebits="$define"
3724 *) usemorebits="$undef"
3728 : make some quick guesses about what we are up against
3730 $echo $n "Hmm... $c"
3740 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3741 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3743 echo "Looks kind of like an OSF/1 system, but we'll see..."
3745 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3746 xxx=`./loc addbib blurfl $pth`
3747 if $test -f $xxx; then
3748 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3752 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3753 echo "Looks kind of like an extended USG system, but we'll see..."
3755 echo "Looks kind of like a USG system, but we'll see..."
3759 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3760 echo "Looks kind of like a BSD system, but we'll see..."
3764 echo "Looks kind of like a Version 7 system, but we'll see..."
3767 case "$eunicefix" in
3770 There is, however, a strange, musty smell in the air that reminds me of
3771 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3775 : it so happens the Eunice I know will not run shell scripts in Unix format
3779 echo "Congratulations. You aren't running Eunice."
3783 : Detect OS2. The p_ variable is set above in the Head.U unit.
3784 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3785 : semicolon as a patch separator
3790 I have the feeling something is not exactly right, however...don't tell me...
3791 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3792 (Or you may be running DOS with DJGPP.)
3797 if test -f /xenix; then
3798 echo "Actually, this looks more like a XENIX system..."
3803 echo "It's not Xenix..."
3808 if test -f /venix; then
3809 echo "Actually, this looks more like a VENIX system..."
3816 echo "Nor is it Venix..."
3819 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3820 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3827 rp="Use which C compiler?"
3831 : See if they have not cc but they do have gcc
3833 : Look for a hint-file generated 'call-back-unit'. Now that the
3834 : user has specified the compiler, we may need to set or change some
3836 if $test -f cc.cbu; then
3842 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3848 printf("%s\n", __VERSION__);
3850 printf("%s\n", "1");
3856 if $cc -o try $ccflags $ldflags try.c; then
3857 gccversion=`$run ./try`
3858 case "$gccversion" in
3859 '') echo "You are not using GNU cc." ;;
3860 *) echo "You are using GNU cc $gccversion."
3866 echo "*** WHOA THERE!!! ***" >&4
3867 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3868 case "$knowitall" in
3870 echo " You'd better start hunting for one and let me know about it." >&4
3876 case "$gccversion" in
3877 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3879 case "$gccversion" in
3880 '') gccosandvers='' ;;
3881 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3882 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3884 case "$gccosandvers" in
3885 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3886 $osname$osvers) ;; # looking good
3887 $osname*) cat <<EOM >&4
3889 *** WHOA THERE!!! ***
3891 Your gcc has not been compiled for the exact release of
3892 your operating system ($gccosandvers versus $osname$osvers).
3894 In general it is a good idea to keep gcc synchronized with
3895 the operating system because otherwise serious problems
3896 may ensue when trying to compile software, like Perl.
3898 I'm trying to be optimistic here, though, and will continue.
3899 If later during the configuration and build icky compilation
3900 problems appear (headerfile conflicts being the most common
3901 manifestation), I suggest reinstalling the gcc to match
3902 your operating system release.
3906 *) gccosandvers='' ;; # failed to parse, better be silent
3914 # gcc 3.* complain about adding -Idirectories that they already know about,
3915 # so we will take those off from locincpth.
3916 case "$gccversion" in
3918 echo "main(){}">try.c
3919 for incdir in $locincpth; do
3920 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3921 grep '^c[cp]p*[01]: warning: changing search order '`
3922 if test "X$warn" != X; then
3923 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3929 : decide how portable to be. Allow command line overrides.
3930 case "$d_portable" in
3932 *) d_portable="$define" ;;
3935 : set up shell script to do ~ expansion
3941 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3944 if $test -f /bin/csh; then
3945 /bin/csh -f -c "glob \$1"
3950 name=\`$expr x\$1 : '..\([^/]*\)'\`
3951 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3952 if $test ! -d "\$dir"; then
3954 echo "\$me: can't locate home directory for: \$name" >&2
3959 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3975 : now set up to get a file name
3979 cat <<'EOSC' >>getfile
3995 : getfile will accept an answer from the comma-separated list
3996 : enclosed in parentheses even if it does not meet other criteria.
3997 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3998 fn=`echo $fn | sed 's/(.*)//'`
4004 loc_file=`expr $fn : '.*:\(.*\)'`
4005 fn=`expr $fn : '\(.*\):.*'`
4013 */*) fullpath=true;;
4022 *e*) exp_file=true;;
4025 *p*) nopath_ok=true;;
4030 *d*) type='Directory';;
4031 *l*) type='Locate';;
4036 Locate) what='File';;
4041 case "$d_portable" in
4049 while test "$type"; do
4054 true) rp="$rp (~name ok)";;
4057 if test -f UU/getfile.ok && \
4058 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4077 value=`UU/filexp $ans`
4080 if test "$ans" != "$value"; then
4081 echo "(That expands to $value on this system.)"
4095 /*) value="$ansexp" ;;
4096 [a-zA-Z]:/*) value="$ansexp" ;;
4101 echo "I shall only accept a full path name, as in /bin/ls." >&4
4102 echo "Use a ! shell escape if you wish to check pathnames." >&4
4105 echo "Please give a full path name, starting with slash." >&4
4108 echo "Note that using ~name is ok provided it expands well." >&4
4121 for fp in $gfpth; do
4122 if test "X$fp" = X.; then
4127 if test -f "$pf"; then
4129 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4131 echo "($value is not a plain file, but that's ok.)"
4134 if test X"$type" = X; then
4141 for fp in $gfpth; do
4142 if test "X$fp" = X.; then
4147 direxp="$fp/$ansexp"
4149 if test -d "$direxp"; then
4157 if test -d "$ansexp"; then
4158 echo "(Looking for $loc_file in directory $value.)"
4159 value="$value/$loc_file"
4160 ansexp="$ansexp/$loc_file"
4162 if test -f "$ansexp"; then
4165 case "$nopath_ok" in
4166 true) case "$value" in
4168 *) echo "Assuming $value will be in people's path."
4184 if test "$fastread" = yes; then
4189 rp="$what $value doesn't exist. Use that name anyway?"
4208 test "X$gfpthkeep" != Xy && gfpth=""
4211 : What should the include directory be ?
4213 $echo $n "Hmm... $c"
4217 if $test -f /bin/mips && /bin/mips; then
4218 echo "Looks like a MIPS system..."
4219 $cat >usr.c <<'EOCP'
4220 #ifdef SYSTYPE_BSD43
4224 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4225 dflt='/bsd43/usr/include'
4229 mips_type='System V'
4231 $rm -f usr.c usr.out
4232 echo "and you're compiling with the $mips_type compiler and libraries."
4236 echo "Doesn't look like a MIPS system."
4246 case "$xxx_prompt" in
4249 rp='Where are the include files you want to use?'
4257 : see how we invoke the C preprocessor
4259 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4260 cat <<'EOT' >testcpp.c
4266 if test ! -f cppstdin; then
4267 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4268 # AIX cc -E doesn't show the absolute headerfile
4269 # locations but we'll cheat by using the -M flag.
4270 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
4272 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4275 echo "Keeping your $hint cppstdin wrapper."
4278 wrapper=`pwd`/cppstdin
4282 if $test "X$cppstdin" != "X" && \
4283 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4284 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4286 echo "You used to use $cppstdin $cppminus so we'll use that again."
4288 '') echo "But let's see if we can live without a wrapper..." ;;
4290 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4291 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4293 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4296 echo "(However, $cpprun $cpplast does not work, let's see...)"
4304 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4311 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4312 $cc -E <testcpp.c >testcpp.out 2>&1; \
4313 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4314 echo "Yup, it does."
4317 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4318 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4319 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4320 echo "Yup, it does."
4323 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4324 $cc -P <testcpp.c >testcpp.out 2>&1; \
4325 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4326 echo "Yipee, that works!"
4329 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4330 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4331 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4332 echo "At long last!"
4335 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4336 $cpp <testcpp.c >testcpp.out 2>&1; \
4337 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4341 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4342 $cpp - <testcpp.c >testcpp.out 2>&1; \
4343 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4344 echo "Hooray, it works! I was beginning to wonder."
4347 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4348 $wrapper <testcpp.c >testcpp.out 2>&1; \
4349 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4355 rp="No dice. I can't find a C preprocessor. Name one:"
4359 $x_cpp <testcpp.c >testcpp.out 2>&1
4360 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4361 echo "OK, that will do." >&4
4363 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4378 echo "Perhaps can we force $cc -E using a wrapper..."
4379 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4380 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4386 echo "Nope, we'll have to live without it..."
4400 "$wrapper"|'cppstdin') ;;
4401 *) $rm -f $wrapper;;
4403 $rm -f testcpp.c testcpp.out
4405 : Set private lib path
4408 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4413 '') dlist="$loclibpth $plibpth $glibpth";;
4414 *) dlist="$libpth";;
4417 : Now check and see which directories actually exist, avoiding duplicates
4421 if $test -d $xxx; then
4424 *) libpth="$libpth $xxx";;
4430 Some systems have incompatible or broken versions of libraries. Among
4431 the directories listed in the question below, please remove any you
4432 know not to be holding relevant libraries, and add any that are needed.
4433 Say "none" for none.
4444 rp="Directories to use for library searches?"
4451 : compute shared library extension
4454 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4464 On some systems, shared libraries may be available. Answer 'none' if
4465 you want to suppress searching of shared libraries for the remainder
4466 of this configuration.
4469 rp='What is the file extension used for shared libraries?'
4473 : Define several unixisms.
4474 : Hints files or command line option can be used to override them.
4475 : The convoluted testing is in case hints files set either the old
4478 '') case "$exe_ext" in
4480 *) _exe="$exe_ext" ;;
4485 '') case "$lib_ext" in
4492 '') case "$obj_ext" in
4499 '') case "$path_sep" in
4510 : Which makefile gets called first. This is used by make depend.
4511 case "$firstmakefile" in
4512 '') firstmakefile='makefile';;
4515 : Looking for optional libraries
4517 echo "Checking for optional libraries..." >&4
4522 case "$libswanted" in
4523 '') libswanted='c_s';;
4526 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4532 for thisdir in $libpth $xlibpth; do
4533 test -d $thisdir && libspath="$libspath $thisdir"
4535 for thislib in $libswanted; do
4536 for thisdir in $libspath; do
4538 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4539 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4540 $test -f "$xxx" && eval $libscheck
4541 $test -f "$xxx" && libstyle=shared
4543 if test ! -f "$xxx"; then
4544 xxx=$thisdir/lib$thislib.$so
4545 $test -f "$xxx" && eval $libscheck
4546 $test -f "$xxx" && libstyle=shared
4548 if test ! -f "$xxx"; then
4549 xxx=$thisdir/lib$thislib$_a
4550 $test -f "$xxx" && eval $libscheck
4551 $test -f "$xxx" && libstyle=static
4553 if test ! -f "$xxx"; then
4554 xxx=$thisdir/$thislib$_a
4555 $test -f "$xxx" && eval $libscheck
4556 $test -f "$xxx" && libstyle=static
4558 if test ! -f "$xxx"; then
4559 xxx=$thisdir/lib${thislib}_s$_a
4560 $test -f "$xxx" && eval $libscheck
4561 $test -f "$xxx" && libstyle=static
4562 $test -f "$xxx" && thislib=${thislib}_s
4564 if test ! -f "$xxx"; then
4565 xxx=$thisdir/Slib$thislib$_a
4566 $test -f "$xxx" && eval $libscheck
4567 $test -f "$xxx" && libstyle=static
4569 if $test -f "$xxx"; then
4571 shared) echo "Found -l$thislib (shared)." ;;
4572 static) echo "Found -l$thislib." ;;
4573 *) echo "Found -l$thislib ($libstyle)." ;;
4577 *) dflt="$dflt -l$thislib"
4578 libsfound="$libsfound $xxx"
4580 libsfiles="$libsfiles $yyy"
4581 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4582 case " $libsdirs " in
4584 *) libsdirs="$libsdirs $yyy" ;;
4591 if $test ! -f "$xxx"; then
4592 echo "No -l$thislib."
4603 ' '|'') dflt='none';;
4608 In order to compile $package on your machine, a number of libraries
4609 are usually needed. Include any other special libraries here as well.
4610 Say "none" for none. The default list is almost always right.
4614 rp="What libraries to use?"
4621 : determine optimization, if desired, or use for debug flag also
4623 ' '|$undef) dflt='none';;
4625 *) dflt="$optimize";;
4629 By default, $package compiles with the -O flag to use the optimizer.
4630 Alternately, you might want to use the symbolic debugger, which uses
4631 the -g flag (on traditional Unix systems). Either flag can be
4632 specified here. To use neither flag, specify the word "none".
4635 rp="What optimizer/debugger flag should be used?"
4639 'none') optimize=" ";;
4643 : We will not override a previous value, but we might want to
4644 : augment a hint file
4646 default|recommended)
4647 case "$gccversion" in
4648 1*) dflt='-fpcc-struct-return' ;;
4651 *-g*) dflt="$dflt -DDEBUGGING";;
4653 case "$gccversion" in
4654 2*) if test -d /etc/conf/kconfig.d &&
4655 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4661 case "$gccversion" in
4665 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4666 echo 'int main(void) { return 0; }' > gcctest.c
4667 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4668 echo "Yes, it does." 2>&1
4671 echo "Leaving current flags $ccflags alone." 2>&1
4673 *) dflt="$dflt -fno-strict-aliasing" ;;
4676 echo "Nope, it doesn't, but that's ok." 2>&1
4683 case "$mips_type" in
4684 *BSD*|'') inclwanted="$locincpth $usrinc";;
4685 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4687 for thisincl in $inclwanted; do
4688 if $test -d $thisincl; then
4689 if $test x$thisincl != x$usrinc; then
4691 *" -I$thisincl "*);;
4692 *) dflt="$dflt -I$thisincl ";;
4698 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4700 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4708 *) dflt="$dflt -D$2";;
4712 set signal.h LANGUAGE_C; eval $inctest
4716 ccflags="$ccflags -DSOCKS"
4721 default|recommended) dflt="$ccflags $dflt" ;;
4722 *) dflt="$ccflags";;
4731 Your C compiler may want other flags. For this question you should include
4732 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4733 but you should NOT include libraries or ld flags like -lwhatever. If you
4734 want $package to honor its debug switch, you should include -DDEBUGGING here.
4735 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4737 To use no flags, specify the word "none".
4743 rp="Any additional cc flags?"
4750 : the following weeds options from ccflags that are of no interest to cpp
4752 '') cppflags="$ccflags" ;;
4753 *) cppflags="$cppflags $ccflags" ;;
4755 case "$gccversion" in
4756 1*) cppflags="$cppflags -D__GNUC__"
4758 case "$mips_type" in
4760 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4766 echo "Let me guess what the preprocessor flags are..." >&4
4780 *) ftry="$previous $flag";;
4782 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4783 >cpp1.out 2>/dev/null && \
4784 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4785 >cpp2.out 2>/dev/null && \
4786 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4787 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4789 cppflags="$cppflags $ftry"
4799 *-*) echo "They appear to be: $cppflags";;
4801 $rm -f cpp.c cpp?.out
4805 : flags used in final linking phase
4807 '') if ./venix; then
4813 *-posix*) dflt="$dflt -posix" ;;
4816 *) dflt="$ldflags";;
4819 : Try to guess additional flags to pick up local libraries.
4820 for thislibdir in $libpth; do
4821 case " $loclibpth " in
4824 *"-L$thislibdir "*) ;;
4825 *) dflt="$dflt -L$thislibdir" ;;
4837 Your C linker may need flags. For this question you should
4838 include -L/whatever and any other flags used by the C linker, but you
4839 should NOT include libraries like -lwhatever.
4841 Make sure you include the appropriate -L/path flags if your C linker
4842 does not normally search all of the directories you specified above,
4845 To use no flags, specify the word "none".
4849 rp="Any additional ld flags (NOT including libraries)?"
4855 rmlist="$rmlist pdp11"
4859 echo "Checking your choice of C compiler and flags for coherency..." >&4
4860 $cat > try.c <<'EOF'
4862 int main() { printf("Ok\n"); exit(0); }
4864 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4866 $cat >try.msg <<'EOM'
4867 I've tried to compile and run the following simple program:
4870 $cat try.c >> try.msg
4872 $cat >> try.msg <<EOM
4879 and I got the following output:
4883 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4884 if $sh -c "$run ./try" >>try.msg 2>&1; then
4888 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4891 cat >> try.msg <<'EOQS'
4892 If $libs contains -lsfio, and sfio is mis-configured, then it
4893 sometimes (apparently) runs and exits with a 0 status, but with no
4894 output! It may have to do with sfio's use of _exit vs. exit.
4897 rp="You have a big problem. Shall I abort Configure"
4904 echo "The program compiled OK, but exited with status $?." >>try.msg
4905 rp="You have a problem. Shall I abort Configure"
4909 echo "I can't compile the test program." >>try.msg
4910 rp="You have a BIG problem. Shall I abort Configure"
4916 case "$knowitall" in
4918 echo "(The supplied flags or libraries might be incorrect.)"
4926 *) echo "Ok. Stopping Configure." >&4
4931 n) echo "OK, that should do.";;
4933 $rm -f try try.* core
4935 : define a shorthand compile call
4939 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4940 : define a shorthand compile call for compilations that should be ok.
4944 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4946 : determine filename position in cpp output
4948 echo "Computing filename position in cpp output for #include directives..." >&4
4950 vos) testaccess=-e ;;
4953 echo '#include <stdio.h>' > foo.c
4956 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4957 $grep '^[ ]*#.*stdio\.h' | \
4958 while read cline; do
4961 while $test \$# -gt 0; do
4962 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4967 pos=\`expr \$pos + 1\`
4979 *) pos="${fieldn}th";;
4981 echo "Your cpp writes the filename in the $pos field of the line."
4984 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4985 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
4988 : locate header file
4993 for usrincdir in $usrinc
4995 if test -f \$usrincdir/\$wanted; then
4996 echo "\$usrincdir/\$wanted"
5000 awkprg='{ print \$$fieldn }'
5001 echo "#include <\$wanted>" > foo\$\$.c
5002 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5003 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5004 while read cline; do
5005 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5007 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5008 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5013 # status = 0: grep returned 0 lines, case statement not executed
5014 # status = 1: headerfile found
5015 # status = 2: while loop executed, no headerfile found
5019 if test \$status -eq 1; then
5026 : define an alternate in-header-list? function
5027 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5028 cont=true; xxf="echo \"<\$1> found.\" >&4";
5029 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5030 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5032 case $# in 4) instead=instead;; *) instead="at last";; esac;
5033 while $test "$cont"; do
5035 var=$2; eval "was=\$$2";
5036 if $test "$xxx" && $test -r "$xxx";
5038 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5041 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5042 set $yyy; shift; shift; yyy=$@;
5043 case $# in 0) cont="";;
5044 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5045 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5046 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5047 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5051 do set $yyy; var=$2; eval "was=\$$2";
5052 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5053 set $yyy; shift; shift; yyy=$@;
5056 : see if stdlib is available
5057 set stdlib.h i_stdlib
5060 : check for lengths of integral types
5064 echo "Checking to see how big your integers are..." >&4
5073 printf("intsize=%d;\n", (int)sizeof(int));
5074 printf("longsize=%d;\n", (int)sizeof(long));
5075 printf("shortsize=%d;\n", (int)sizeof(short));
5080 if eval $compile_ok && $run ./try > /dev/null; then
5082 echo "Your integers are $intsize bytes long."
5083 echo "Your long integers are $longsize bytes long."
5084 echo "Your short integers are $shortsize bytes long."
5088 Help! I can't compile and run the intsize test program: please enlighten me!
5089 (This is probably a misconfiguration in your system or libraries, and
5090 you really ought to fix it. Still, I'll try anyway.)
5094 rp="What is the size of an integer (in bytes)?"
5098 rp="What is the size of a long integer (in bytes)?"
5102 rp="What is the size of a short integer (in bytes)?"
5110 : check for long long
5112 echo "Checking to see if you have long long..." >&4
5113 echo 'int main() { long long x = 7; return 0; }' > try.c
5115 if eval $compile; then
5117 echo "You have long long."
5120 echo "You do not have long long."
5126 : check for length of long long
5127 case "${d_longlong}${longlongsize}" in
5130 echo "Checking to see how big your long longs are..." >&4
5131 $cat >try.c <<'EOCP'
5135 printf("%d\n", (int)sizeof(long long));
5140 if eval $compile_ok; then
5141 longlongsize=`$run ./try`
5142 echo "Your long longs are $longlongsize bytes long."
5146 echo "(I can't seem to compile the test program. Guessing...)"
5147 rp="What is the size of a long long (in bytes)?"
5151 if $test "X$longsize" = "X$longlongsize"; then
5152 echo "(That isn't any different from an ordinary long.)"
5158 : see if inttypes.h is available
5159 : we want a real compile instead of Inhdr because some systems
5160 : have an inttypes.h which includes non-existent headers
5163 #include <inttypes.h>
5165 static int32_t foo32 = 0x12345678;
5169 if eval $compile; then
5170 echo "<inttypes.h> found." >&4
5173 echo "<inttypes.h> NOT found." >&4
5182 echo "Checking to see if you have int64_t..." >&4
5184 #include <sys/types.h>
5185 #$i_inttypes I_INTTYPES
5187 #include <inttypes.h>
5189 int main() { int64_t x = 7; }
5192 if eval $compile; then
5194 echo "You have int64_t."
5197 echo "You do not have int64_t."
5205 echo "Checking which 64-bit integer type we could use..." >&4
5211 val='"unsigned int"'
5216 *) case "$longsize" in
5220 val='"unsigned long"'
5225 *) case "$d_longlong:$longlongsize" in
5230 val='"unsigned long long"'
5235 *) case "$d_int64_t" in
5254 '') echo "Alas, no 64-bit integer types in sight." >&4
5257 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5263 case "$uselonglong" in
5264 "$define"|true|[yY]*)
5267 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5269 use64bitint="$define"
5272 case "$use64bits" in
5273 "$define"|true|[yY]*)
5276 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5278 use64bitint="$define"
5281 case "$use64bitints" in
5282 "$define"|true|[yY]*)
5285 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5287 use64bitint="$define"
5290 case "$use64bitsint" in
5291 "$define"|true|[yY]*)
5294 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5296 use64bitint="$define"
5299 case "$uselonglongs" in
5300 "$define"|true|[yY]*)
5303 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5305 use64bitint="$define"
5308 case "$use64bitsall" in
5309 "$define"|true|[yY]*)
5312 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5314 use64bitall="$define"
5319 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5321 case "$use64bitall" in
5322 "$define"|true|[yY]*) use64bitint="$define" ;;
5328 You have natively 64-bit long integers.
5332 *) case "$use64bitint" in
5333 "$define"|true|[yY]*) dflt='y';;
5342 Perl can be built to take advantage of 64-bit integer types
5343 on some systems. To do so, Configure can be run with -Duse64bitint.
5344 Choosing this option will most probably introduce binary incompatibilities.
5346 If this doesn't make any sense to you, just accept the default '$dflt'.
5347 (The default has been chosen based on your configuration.)
5349 rp='Try to use 64-bit integers, if available?'
5352 [yY]*) val="$define" ;;
5360 case "$use64bitall" in
5361 "$define"|true|[yY]*) dflt='y' ;;
5362 *) case "$longsize" in
5370 You may also choose to try maximal 64-bitness. It means using as much
5371 64-bitness as possible on the platform. This in turn means even more
5372 binary incompatibilities. On the other hand, your platform may not
5373 have any more 64-bitness available than what you already have chosen.
5375 If this doesn't make any sense to you, just accept the default '$dflt'.
5376 (The default has been chosen based on your configuration.)
5378 rp='Try to use maximal 64-bit support, if available?'
5381 [yY]*) val="$define" ;;
5386 case "$use64bitall" in
5388 case "$use64bitint" in
5392 Since you have chosen a maximally 64-bit build, I'm also turning on
5393 the use of 64-bit integers.
5395 use64bitint="$define" ;;
5400 case "$use64bitint" in
5401 "$define"|true|[yY]*)
5402 : Look for a hint-file generated 'call-back-unit'. If the
5403 : user has specified that a 64-bit perl is to be built,
5404 : we may need to set or change some other defaults.
5405 if $test -f use64bitint.cbu; then
5406 echo "Your platform has some specific hints for 64-bit integers, using them..."
5410 4) case "$archname64" in
5411 '') archname64=64int ;;
5418 case "$use64bitall" in
5419 "$define"|true|[yY]*)
5420 : Look for a hint-file generated 'call-back-unit'. If the
5421 : user has specified that a maximally 64-bit perl is to be built,
5422 : we may need to set or change some other defaults.
5423 if $test -f use64bitall.cbu; then
5424 echo "Your platform has some specific hints for 64-bit builds, using them..."
5428 4) case "$archname64" in
5429 ''|64int) archname64=64all ;;
5437 echo "Checking for GNU C Library..." >&4
5439 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
5440 alone are insufficient to distinguish different versions, such as
5441 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
5442 libc version 2.1.0. A. Dougherty, June 3, 2002.
5448 # ifdef __GLIBC_MINOR__
5449 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
5450 # include <gnu/libc-version.h>
5451 printf("%s\n", gnu_get_libc_version());
5453 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
5456 printf("%d\n", __GLIBC__);
5465 if eval $compile_ok && $run ./try > glibc.ver; then
5467 gnulibc_version=`$cat glibc.ver`
5468 echo "You are using the GNU C Library version $gnulibc_version"
5472 echo "You are not using the GNU C Library"
5474 $rm -f try try.* glibc.ver
5478 : see if nm is to be used to determine whether a symbol is defined or not
5482 case "$d_gnulibc" in
5485 echo "nm probably won't work on the GNU C Library." >&4
5491 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
5493 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5494 echo "'nm' won't be sufficient on this sytem." >&4
5500 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5501 if $test $dflt -gt 20; then
5511 true|$define) dflt=y;;
5518 I can use $nm to extract the symbols from your C libraries. This
5519 is a time consuming task which may generate huge output on the disk (up
5520 to 3 megabytes) but that should make the symbols extraction faster. The
5521 alternative is to skip the 'nm' extraction part and to compile a small
5522 test program instead to determine whether each symbol is present. If
5523 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5524 this may be the best solution.
5526 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5529 rp="Shall I use $nm to extract C symbols from the libraries?"
5532 [Nn]*) usenm=false;;
5541 : nm options which may be necessary
5543 '') if $test -f /mach_boot; then
5545 elif $test -d /usr/ccs/lib; then
5546 nm_opt='-p' # Solaris (and SunOS?)
5547 elif $test -f /dgux; then
5549 elif $test -f /lib64/rld; then
5550 nm_opt='-p' # 64-bit Irix
5556 : nm options which may be necessary for shared libraries but illegal
5557 : for archive libraries. Thank you, Linux.
5558 case "$nm_so_opt" in
5559 '') case "$myuname" in
5561 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5562 nm_so_opt='--dynamic'
5571 : get list of predefined functions in a handy place
5576 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5582 *) for thislib in $libs; do
5585 : Handle C library specially below.
5588 thislib=`echo $thislib | $sed -e 's/^-l//'`
5589 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5591 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5593 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5595 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5597 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5599 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5601 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5606 libnames="$libnames $try"
5608 *) libnames="$libnames $thislib" ;;
5617 for xxx in $libpth; do
5618 $test -r $1 || set $xxx/libc.$so
5619 : The messy sed command sorts on library version numbers.
5621 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5622 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5624 s/[0-9][0-9]*/0000&/g
5625 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5628 $sort | $sed -e 's/^.* //'`
5631 $test -r $1 || set /usr/ccs/lib/libc.$so
5632 $test -r $1 || set /lib/libsys_s$_a
5638 if $test -r "$1"; then
5639 echo "Your (shared) C library seems to be in $1."
5641 elif $test -r /lib/libc && $test -r /lib/clib; then
5642 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5644 libc='/lib/clib /lib/libc'
5645 if $test -r /lib/syslib; then
5646 echo "(Your math library is in /lib/syslib.)"
5647 libc="$libc /lib/syslib"
5649 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5650 echo "Your C library seems to be in $libc, as you said before."
5651 elif $test -r $incpath/usr/lib/libc$_a; then
5652 libc=$incpath/usr/lib/libc$_a;
5653 echo "Your C library seems to be in $libc. That's fine."
5654 elif $test -r /lib/libc$_a; then
5656 echo "Your C library seems to be in $libc. You're normal."
5658 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5660 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5661 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5662 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5664 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5666 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5669 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5671 if $test -r "$tans"; then
5672 echo "Your C library seems to be in $tans, of all places."
5678 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5682 If the guess above is wrong (which it might be if you're using a strange
5683 compiler, or your machine supports multiple models), you can override it here.
5688 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5690 I can't seem to find your C library. I've looked in the following places:
5693 $sed 's/^/ /' libpath
5696 None of these seems to contain your C library. I need to get its name...
5701 rp='Where is your C library?'
5706 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5707 set X `cat libnames`
5710 case $# in 1) xxx=file; esac
5711 echo "Extracting names from the following $xxx for later perusal:" >&4
5713 $sed 's/^/ /' libnames >&4
5715 $echo $n "This may take a while...$c" >&4
5719 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5720 *) $nm $nm_opt $file 2>/dev/null;;
5725 $grep fprintf libc.tmp > libc.ptf
5726 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5727 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5729 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5731 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5733 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5735 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5737 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5739 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5741 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5743 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5745 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5747 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5749 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5751 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5753 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5754 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5756 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5758 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5760 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5762 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5764 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5766 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5768 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5770 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5772 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5774 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5776 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5778 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5780 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5782 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5784 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5787 $nm -p $* 2>/dev/null >libc.tmp
5788 $grep fprintf libc.tmp > libc.ptf
5789 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5790 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5796 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5798 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5799 for thisname in $libnames $libc; do
5800 $ar t $thisname >>libc.tmp
5802 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5804 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5805 # Repeat libc to extract forwarders to DLL entries too
5806 for thisname in $libnames $libc; do
5807 $ar tv $thisname >>libc.tmp
5808 # Revision 50 of EMX has bug in $ar.
5809 # it will not extract forwarders to DLL entries
5810 # Use emximp which will extract exactly them.
5811 emximp -o tmp.imp $thisname \
5813 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5814 < tmp.imp >>libc.tmp
5817 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5820 echo "$ar didn't seem to work right." >&4
5821 echo "Maybe this is a Cray...trying bld instead..." >&4
5822 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5824 for thisname in $libnames; do
5826 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5827 $ar t $thisname >>libc.tmp
5831 echo "That didn't work either. Giving up." >&4
5841 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
5842 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
5844 *) if $test -f /lib/syscalls.exp; then
5846 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5847 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5853 $rm -f libnames libpath
5855 : is a C symbol defined?
5858 -v) tf=libc.tmp; tc=""; tdc="";;
5859 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5860 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5863 case "$reuseval-$4" in
5865 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5871 if $contains $tlook $tf >/dev/null 2>&1;
5876 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5877 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5885 $define) tval=true;;
5891 : define an is-in-libc? function
5892 inlibc='echo " "; td=$define; tu=$undef;
5893 sym=$1; var=$2; eval "was=\$$2";
5895 case "$reuseval$was" in
5905 echo "$sym() found." >&4;
5906 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5908 echo "$sym() NOT found." >&4;
5909 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5913 $define) echo "$sym() found." >&4;;
5914 *) echo "$sym() NOT found." >&4;;
5918 : see if sqrtl exists
5922 hasproto='varname=$1; func=$2; shift; shift;
5923 while $test $# -ge 2; do
5925 $define) echo "#include <$2>";;
5929 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
5930 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
5931 echo "$func() prototype found.";
5934 echo "$func() prototype NOT found.";
5939 $rm -f try.c tryout.c'
5941 : check for length of double
5943 case "$doublesize" in
5945 echo "Checking to see how big your double precision numbers are..." >&4
5954 printf("%d\n", (int)sizeof(double));
5959 if eval $compile_ok; then
5960 doublesize=`$run ./try`
5961 echo "Your double is $doublesize bytes long."
5964 echo "(I can't seem to compile the test program. Guessing...)"
5965 rp="What is the size of a double precision number (in bytes)?"
5973 : check for long doubles
5975 echo "Checking to see if you have long double..." >&4
5976 echo 'int main() { long double x = 7.0; }' > try.c
5978 if eval $compile; then
5980 echo "You have long double."
5983 echo "You do not have long double."
5989 : check for length of long double
5990 case "${d_longdbl}${longdblsize}" in
5993 echo "Checking to see how big your long doubles are..." >&4
5994 $cat >try.c <<'EOCP'
5998 printf("%d\n", sizeof(long double));
6003 if eval $compile; then
6004 longdblsize=`$run ./try`
6005 echo "Your long doubles are $longdblsize bytes long."
6009 echo "(I can't seem to compile the test program. Guessing...)" >&4
6010 rp="What is the size of a long double (in bytes)?"
6014 if $test "X$doublesize" = "X$longdblsize"; then
6015 echo "(That isn't any different from an ordinary double.)"
6023 if $test X"$d_longdbl" = X"$define"; then
6025 echo "Checking how to print long doubles..." >&4
6027 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6028 $cat >try.c <<'EOCP'
6029 #include <sys/types.h>
6033 printf("%.3f\n", d);
6037 if eval $compile; then
6041 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6042 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
6043 echo "We will use %f."
6049 if $test X"$sPRIfldbl" = X; then
6050 $cat >try.c <<'EOCP'
6051 #include <sys/types.h>
6054 long double d = 123.456;
6055 printf("%.3Lf\n", d);
6059 if eval $compile; then
6063 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
6064 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
6065 echo "We will use %Lf."
6071 if $test X"$sPRIfldbl" = X; then
6072 $cat >try.c <<'EOCP'
6073 #include <sys/types.h>
6076 long double d = 123.456;
6077 printf("%.3llf\n", d);
6081 if eval $compile; then
6085 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
6086 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
6087 echo "We will use %llf."
6093 if $test X"$sPRIfldbl" = X; then
6094 $cat >try.c <<'EOCP'
6095 #include <sys/types.h>
6098 long double d = 123.456;
6099 printf("%.3lf\n", d);
6103 if eval $compile; then
6107 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
6108 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
6109 echo "We will use %lf."
6115 if $test X"$sPRIfldbl" = X; then
6116 echo "Cannot figure out how to print long doubles." >&4
6118 sSCNfldbl=$sPRIfldbl # expect consistency
6125 case "$sPRIfldbl" in
6126 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
6127 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
6128 d_SCNfldbl="$undef";
6130 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
6131 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
6132 d_SCNfldbl="$define";
6136 : see if modfl exists
6140 : see if prototype for modfl is available
6142 set d_modflproto modfl math.h
6145 d_modfl_pow32_bug="$undef"
6147 case "$d_longdbl$d_modfl" in
6150 Checking to see whether your modfl() is okay for large values...
6156 if $test "X$d_modflproto" != "X$define"; then
6158 /* Sigh. many current glibcs provide the function, but do not prototype it. */
6159 long double modfl (long double, long double *);
6164 long double nv = 4294967303.15;
6170 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
6174 case "$osname:$gccversion" in
6175 aix:) saveccflags="$ccflags"
6176 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
6179 if eval $compile; then
6182 *" 4294967303.150000 1.150000 4294967302.000000")
6183 echo >&4 "Your modfl() is broken for large values."
6184 d_modfl_pow32_bug="$define"
6186 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
6190 *" 4294967303.150000 0.150000 4294967303.000000")
6191 echo >&4 "Your modfl() seems okay for large values."
6193 *) echo >&4 "I don't understand your modfl() at all."
6197 $rm -f try.* try core core.try.*
6199 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
6202 case "$osname:$gccversion" in
6203 aix:) ccflags="$saveccflags" ;; # restore
6209 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6212 case "$uselongdouble" in
6213 $define|true|[yY]*) dflt='y';;
6218 Perl can be built to take advantage of long doubles which
6219 (if available) may give more accuracy and range for floating point numbers.
6221 If this doesn't make any sense to you, just accept the default '$dflt'.
6223 rp='Try to use long doubles if available?'
6226 y|Y) val="$define" ;;
6232 case "$uselongdouble" in
6233 true|[yY]*) uselongdouble="$define" ;;
6236 case "$uselongdouble" in
6238 : Look for a hint-file generated 'call-back-unit'. If the
6239 : user has specified that long doubles should be used,
6240 : we may need to set or change some other defaults.
6241 if $test -f uselongdouble.cbu; then
6242 echo "Your platform has some specific hints for long doubles, using them..."
6243 . ./uselongdouble.cbu
6246 (Your platform doesn't have any specific hints for long doubles.)
6253 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6254 $define:$define:$define)
6257 $define:$define:$undef)
6258 message="I could not find modfl"
6260 $define:$undef:$define)
6261 message="I could not find sqrtl"
6263 $define:$undef:$undef)
6264 message="I found neither sqrtl nor modfl"
6268 if $test "$message" != X; then
6271 *** You requested the use of long doubles but you do not seem to have
6272 *** the mathematic functions for long doubles.
6274 *** I'm disabling the use of long doubles.
6278 uselongdouble=$undef
6281 : determine the architecture name
6283 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6284 tarch=`arch`"-$osname"
6285 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6286 if uname -m > tmparch 2>&1 ; then
6287 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6288 -e 's/$/'"-$osname/" tmparch`
6296 case "$myarchname" in
6299 echo "(Your architecture name used to be $myarchname.)"
6303 case "$targetarch" in
6305 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6310 *) dflt="$archname";;
6312 rp='What is your architecture name'
6315 case "$usethreads" in
6317 echo "Threads selected." >&4
6319 *-thread*) echo "...and architecture name already has -thread." >&4
6321 *) archname="$archname-thread"
6322 echo "...setting architecture name to $archname." >&4
6327 case "$usemultiplicity" in
6329 echo "Multiplicity selected." >&4
6331 *-multi*) echo "...and architecture name already has -multi." >&4
6333 *) archname="$archname-multi"
6334 echo "...setting architecture name to $archname." >&4
6339 case "$use64bitint$use64bitall" in
6341 case "$archname64" in
6343 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6346 case "$use64bitint" in
6347 "$define") echo "64 bit integers selected." >&4 ;;
6349 case "$use64bitall" in
6350 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6353 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6355 *) archname="$archname-$archname64"
6356 echo "...setting architecture name to $archname." >&4
6362 case "$uselongdouble" in
6364 echo "Long doubles selected." >&4
6365 case "$longdblsize" in
6367 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6371 *-ld*) echo "...and architecture name already has -ld." >&4
6373 *) archname="$archname-ld"
6374 echo "...setting architecture name to $archname." >&4
6381 case "$useperlio" in
6383 echo "Perlio selected." >&4
6386 echo "Perlio not selected, using stdio." >&4
6388 *-stdio*) echo "...and architecture name already has -stdio." >&4
6390 *) archname="$archname-stdio"
6391 echo "...setting architecture name to $archname." >&4
6397 : determine root of directory hierarchy where package will be installed.
6400 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6403 dflt=`echo "$prefix" | sed 's/.$//'`
6411 By default, $package will be installed in $dflt/bin, manual pages
6412 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6413 installation directories. Typically this is something like /usr/local.
6414 If you wish to have binaries under /usr/bin but other parts of the
6415 installation under /usr/local, that's ok: you will be prompted
6416 separately for each of the installation directories, the prefix being
6417 only used to set the defaults.
6421 rp='Installation prefix to use?'
6429 *) oldprefix="$prefix";;
6438 *) afsroot=$afsroot ;;
6444 $define|true) afs=true ;;
6445 $undef|false) afs=false ;;
6446 *) if test -d $afsroot; then
6454 echo "AFS may be running... I'll be extra cautious then..." >&4
6456 echo "AFS does not seem to be running..." >&4
6459 : determine installation prefix for where package is to be installed.
6463 Since you are running AFS, I need to distinguish the directory in which
6464 files will reside from the directory in which they are installed (and from
6465 which they are presumably copied to the former directory by occult means).
6468 case "$installprefix" in
6469 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6470 *) dflt="$installprefix";;
6475 In some special cases, particularly when building $package for distribution,
6476 it is convenient to distinguish the directory in which files should be
6477 installed from the directory ($prefix) in which they will
6478 eventually reside. For most users, these two directories are the same.
6481 case "$installprefix" in
6483 *) dflt=$installprefix;;
6487 rp='What installation prefix should I use for installing files?'
6489 installprefix="$ans"
6490 installprefixexp="$ansexp"
6492 : set the prefixit variable, to compute a suitable default value
6493 prefixit='case "$3" in
6495 case "$oldprefix" in
6496 "") eval "$1=\"\$$2\"";;
6503 ""|" ") eval "$1=\"\$$2\"";;
6509 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6511 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6512 /*-$oldprefix/*|\~*-$oldprefix/*)
6513 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6514 *) eval "$1=\"\$$2\"";;
6518 : get the patchlevel
6520 echo "Getting the current patchlevel..." >&4
6521 if $test -r $rsrc/patchlevel.h;then
6522 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6523 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6524 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6525 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6526 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6527 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6528 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6537 $echo "(You do not have patchlevel.h. Eek.)"
6539 if $test -r $rsrc/.patch ; then
6540 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6541 perl_patchlevel=`cat $rsrc/.patch`
6544 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6545 version_patchlevel_string="version $patchlevel subversion $subversion"
6546 case "$perl_patchlevel" in
6548 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6551 $echo "(You have $package $version_patchlevel_string.)"
6555 : XXX Should be a Configure test for double-dots in filenames.
6556 version=`echo $revision $patchlevel $subversion | \
6557 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6558 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6559 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6562 version=`echo $revision $patchlevel $subversion | \
6563 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6564 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6565 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6568 : Special case the 5.005_xx maintenance series, which used 5.005
6569 : without any subversion label as a subdirectory in $sitelib
6570 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6571 api_versionstring='5.005'
6574 : determine installation style
6575 : For now, try to deduce it from prefix unless it is already set.
6576 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6577 case "$installstyle" in
6578 '') case "$prefix" in
6579 *perl*) dflt='lib';;
6580 *) dflt='lib/perl5' ;;
6583 *) dflt="$installstyle" ;;
6585 : Probably not worth prompting for this since we prompt for all
6586 : the directories individually, and the prompt would be too long and
6590 : determine where private library files go
6591 : Usual default is /usr/local/lib/perl5/$version.
6592 : Also allow things like /opt/perl/lib/$version, since
6593 : /opt/perl/lib/perl5... would be redundant.
6594 : The default "style" setting is made in installstyle.U
6595 case "$installstyle" in
6596 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6597 *) set dflt privlib lib/$version ;;
6602 There are some auxiliary files for $package that need to be put into a
6603 private library directory that is accessible by everyone.
6607 rp='Pathname where the private library files will reside?'
6610 privlibexp="$ansexp"
6611 : Change installation prefix, if necessary.
6612 if $test X"$prefix" != X"$installprefix"; then
6613 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6615 installprivlib="$privlibexp"
6618 : set the prefixup variable, to restore leading tilda escape
6619 prefixup='case "$prefixexp" in
6621 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6624 : determine where public architecture dependent libraries go
6627 : privlib default is /usr/local/lib/$package/$version
6628 : archlib default is /usr/local/lib/$package/$version/$archname
6629 : privlib may have an optional trailing /share.
6630 tdflt=`echo $privlib | $sed 's,/share$,,'`
6631 tdflt=$tdflt/$archname
6640 $spackage contains architecture-dependent library files. If you are
6641 sharing libraries in a heterogeneous environment, you might store
6642 these files in a separate location. Otherwise, you can just include
6643 them with the rest of the public library files.
6647 rp='Where do you want to put the public architecture-dependent libraries?'
6650 archlibexp="$ansexp"
6651 if $test X"$archlib" = X"$privlib"; then
6656 : Change installation prefix, if necessary.
6657 if $test X"$prefix" != X"$installprefix"; then
6658 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6660 installarchlib="$archlibexp"
6663 : see if setuid scripts can be secure
6666 Some kernels have a bug that prevents setuid #! scripts from being
6667 secure. Some sites have disabled setuid #! scripts because of this.
6669 First let's decide if your kernel supports secure setuid #! scripts.
6670 (If setuid #! scripts would be secure but have been disabled anyway,
6671 don't say that they are secure if asked.)
6676 if $test -d /dev/fd; then
6677 echo "#!$ls" >reflect
6678 chmod +x,u+s reflect
6679 ./reflect >flect 2>&1
6680 if $contains "/dev/fd" flect >/dev/null; then
6681 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6685 If you are not sure if they are secure, I can check but I'll need a
6686 username and password different from the one you are using right now.
6687 If you don't have such a username or don't want me to test, simply
6691 rp='Other username to test security of setuid scripts with?'
6696 case "$d_suidsafe" in
6697 '') echo "I'll assume setuid scripts are *not* secure." >&4
6700 echo "Well, the $hint value is *not* secure." >&4
6702 *) echo "Well, the $hint value *is* secure." >&4
6707 $rm -f reflect flect
6708 echo "#!$ls" >reflect
6709 chmod +x,u+s reflect
6712 echo '"su" will (probably) prompt you for '"$ans's password."
6713 su $ans -c './reflect >flect'
6714 if $contains "/dev/fd" flect >/dev/null; then
6715 echo "Okay, it looks like setuid scripts are secure." >&4
6718 echo "I don't think setuid scripts are secure." >&4
6723 rp='Does your kernel have *secure* setuid scripts?'
6726 [yY]*) val="$define";;
6731 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6732 echo "(That's for file descriptors, not floppy disks.)"
6738 $rm -f reflect flect
6740 : now see if they want to do setuid emulation
6743 case "$d_suidsafe" in
6746 echo "No need to emulate SUID scripts since they are secure here." >&4
6750 Some systems have disabled setuid scripts, especially systems where
6751 setuid scripts cannot be secure. On systems where setuid scripts have
6752 been disabled, the setuid/setgid bits on scripts are currently
6753 useless. It is possible for $package to detect those bits and emulate
6754 setuid/setgid in a secure fashion. This emulation will only work if
6755 setuid scripts have been disabled in your kernel.
6759 "$define") dflt=y ;;
6762 rp="Do you want to do setuid/setgid emulation?"
6765 [yY]*) val="$define";;
6773 : see if this is a malloc.h system
6774 : we want a real compile instead of Inhdr because some systems have a
6775 : malloc.h that just gives a compile error saying to use stdlib.h instead
6780 int main () { return 0; }
6783 if eval $compile; then
6784 echo "<malloc.h> found." >&4
6787 echo "<malloc.h> NOT found." >&4
6794 : check for void type
6796 echo "Checking to see how well your C compiler groks the void type..." >&4
6797 case "$voidflags" in
6809 extern void moo(); /* function returning void */
6810 void (*goo)(); /* ptr to func returning void */
6812 void *hue; /* generic ptr */
6825 int main() { sub(); }
6827 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6828 voidflags=$defvoidused
6829 echo "Good. It appears to support void to the level $package wants.">&4
6830 if $contains warning .out >/dev/null 2>&1; then
6831 echo "However, you might get some warnings that look like this:"
6835 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6836 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6837 echo "It supports 1..."
6838 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6839 echo "It also supports 2..."
6840 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6842 echo "And it supports 4 but not 8 definitely."
6844 echo "It doesn't support 4..."
6845 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6847 echo "But it supports 8."
6850 echo "Neither does it support 8."
6854 echo "It does not support 2..."
6855 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6857 echo "But it supports 4 and 8."
6859 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6861 echo "And it supports 4 but has not heard about 8."
6863 echo "However it supports 8 but not 4."
6868 echo "There is no support at all for void."
6873 case "$voidflags" in
6876 Support flag bits are:
6877 1: basic void declarations.
6878 2: arrays of pointers to functions returning void.
6879 4: operations between pointers to and addresses of void functions.
6880 8: generic void pointers.
6883 rp="Your void support flags add up to what?"
6890 : check for length of pointer
6894 echo "Checking to see how big your pointers are..." >&4
6895 if test "$voidflags" -gt 7; then
6896 echo '#define VOID_PTR char *' > try.c
6898 echo '#define VOID_PTR void *' > try.c
6908 printf("%d\n", (int)sizeof(VOID_PTR));
6913 if eval $compile_ok; then
6914 ptrsize=`$run ./try`
6915 echo "Your pointers are $ptrsize bytes long."
6918 echo "(I can't seem to compile the test program. Guessing...)" >&4
6919 rp="What is the size of a pointer (in bytes)?"
6926 case "$use64bitall" in
6927 "$define"|true|[yY]*)
6931 *** You have chosen a maximally 64-bit build, but your pointers
6932 *** are only 4 bytes wide, disabling maximal 64-bitness.
6935 use64bitall="$undef"
6936 case "$use64bitint" in
6937 "$define"|true|[yY]*) ;;
6940 *** Downgrading from maximal 64-bitness to using 64-bit integers.
6943 use64bitint="$define"
6952 : determine which malloc to compile in
6954 case "$usemymalloc" in
6955 [yY]*|true|$define) dflt='y' ;;
6956 [nN]*|false|$undef) dflt='n' ;;
6957 *) case "$ptrsize" in
6963 rp="Do you wish to attempt to use the malloc that comes with $package?"
6969 mallocsrc='malloc.c'
6970 mallocobj="malloc$_o"
6971 d_mymalloc="$define"
6974 : Remove malloc from list of libraries to use
6975 echo "Removing unneeded -lmalloc from library list" >&4
6976 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6979 echo "libs = $libs" >&4
6991 : compute the return types of malloc and free
6993 $cat >malloc.c <<END
6997 #include <sys/types.h>
7011 case "$malloctype" in
7013 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7020 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7024 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7031 echo "Your system uses $freetype free(), it would seem." >&4
7035 After $package is installed, you may wish to install various
7036 add-on modules and utilities. Typically, these add-ons will
7037 be installed under $prefix with the rest
7038 of this package. However, you may wish to install such add-ons
7039 elsewhere under a different prefix.
7041 If you do not wish to put everything under a single prefix, that's
7042 ok. You will be prompted for the individual locations; this siteprefix
7043 is only used to suggest the defaults.
7045 The default should be fine for most people.
7049 rp='Installation prefix to use for add-on modules and utilities?'
7050 : XXX Here might be another good place for an installstyle setting.
7051 case "$siteprefix" in
7053 *) dflt=$siteprefix ;;
7056 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7058 case "$siteprefix" in
7062 *) oldsiteprefix="$prefix";;
7067 siteprefixexp="$ansexp"
7069 : determine where site specific libraries go.
7070 : Usual default is /usr/local/lib/perl5/site_perl/$version
7071 : The default "style" setting is made in installstyle.U
7072 : XXX No longer works with Prefixit stuff.
7073 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7075 '') case "$installstyle" in
7076 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7077 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7085 The installation process will create a directory for
7086 site-specific extensions and modules. Most users find it convenient
7087 to place all site-specific files in this directory rather than in the
7088 main distribution directory.
7092 rp='Pathname for the site-specific library files?'
7095 sitelibexp="$ansexp"
7096 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7097 : Change installation prefix, if necessary.
7098 if $test X"$prefix" != X"$installprefix"; then
7099 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
7101 installsitelib="$sitelibexp"
7104 : determine where site specific architecture-dependent libraries go.
7105 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7106 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7107 : sitelib may have an optional trailing /share.
7109 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7110 dflt="$dflt/$archname"
7115 set sitearch sitearch none
7119 The installation process will also create a directory for
7120 architecture-dependent site-specific extensions and modules.
7124 rp='Pathname for the site-specific architecture-dependent library files?'
7127 sitearchexp="$ansexp"
7128 : Change installation prefix, if necessary.
7129 if $test X"$prefix" != X"$installprefix"; then
7130 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7132 installsitearch="$sitearchexp"
7137 The installation process will also create a directory for
7138 vendor-supplied add-ons. Vendors who supply perl with their system
7139 may find it convenient to place all vendor-supplied files in this
7140 directory rather than in the main distribution directory. This will
7141 ease upgrades between binary-compatible maintenance versions of perl.
7143 Of course you may also use these directories in whatever way you see
7144 fit. For example, you might use them to access modules shared over a
7145 company-wide network.
7147 The default answer should be fine for most people.
7148 This causes further questions about vendor add-ons to be skipped
7149 and no vendor-specific directories will be configured for perl.
7152 rp='Do you want to configure vendor-specific add-on directories?'
7153 case "$usevendorprefix" in
7154 define|true|[yY]*) dflt=y ;;
7155 *) : User may have set vendorprefix directly on Configure command line.
7156 case "$vendorprefix" in
7165 rp='Installation prefix to use for vendor-supplied add-ons?'
7166 case "$vendorprefix" in
7168 *) dflt=$vendorprefix ;;
7171 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7173 case "$vendorprefix" in
7177 *) oldvendorprefix="$prefix";;
7181 usevendorprefix="$define"
7183 vendorprefixexp="$ansexp"
7185 *) usevendorprefix="$undef"
7191 case "$vendorprefix" in
7192 '') d_vendorlib="$undef"
7196 *) d_vendorlib="$define"
7197 : determine where vendor-supplied modules go.
7198 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7199 case "$vendorlib" in
7201 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7202 case "$installstyle" in
7203 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7204 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7207 *) dflt="$vendorlib"
7211 rp='Pathname for the vendor-supplied library files?'
7214 vendorlibexp="$ansexp"
7217 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7218 : Change installation prefix, if necessary.
7219 if $test X"$prefix" != X"$installprefix"; then
7220 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7222 installvendorlib="$vendorlibexp"
7225 case "$vendorprefix" in
7226 '') d_vendorarch="$undef"
7230 *) d_vendorarch="$define"
7231 : determine where vendor-supplied architecture-dependent libraries go.
7232 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7233 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7234 : vendorlib may have an optional trailing /share.
7235 case "$vendorarch" in
7236 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7237 dflt="$dflt/$archname"
7239 *) dflt="$vendorarch" ;;
7242 rp='Pathname for vendor-supplied architecture-dependent files?'
7245 vendorarchexp="$ansexp"
7248 : Change installation prefix, if necessary.
7249 if $test X"$prefix" != X"$installprefix"; then
7250 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7252 installvendorarch="$vendorarchexp"
7255 : Final catch-all directories to search
7258 Lastly, you can have perl look in other directories for extensions and
7259 modules in addition to those already specified.
7260 These directories will be searched after
7264 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7265 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7267 case "$otherlibdirs" in
7268 ''|' ') dflt='none' ;;
7269 *) dflt="$otherlibdirs" ;;
7272 Enter a colon-separated set of extra paths to include in perl's @INC
7273 search path, or enter 'none' for no extra paths.
7277 rp='Colon-separated list of additional directories for perl to search?'
7280 ' '|''|none) otherlibdirs=' ' ;;
7281 *) otherlibdirs="$ans" ;;
7283 case "$otherlibdirs" in
7287 set d_perl_otherlibdirs
7290 : Cruising for prototypes
7292 echo "Checking out function prototypes..." >&4
7293 $cat >prototype.c <<'EOCP'
7294 int main(int argc, char *argv[]) {
7297 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7298 echo "Your C compiler appears to support function prototypes."
7301 echo "Your C compiler doesn't seem to understand function prototypes."
7308 case "$prototype" in
7310 *) ansi2knr='ansi2knr'
7315 This version of $package can only be compiled by a compiler that
7316 understands function prototypes. Unfortunately, your C compiler
7318 doesn't seem to understand them. Sorry about that.
7320 If GNU cc is available for your system, perhaps you could try that instead.
7322 Eventually, we hope to support building Perl with pre-ANSI compilers.
7323 If you would like to help in that effort, please contact <perlbug@perl.org>.
7325 Aborting Configure now.
7331 : determine where public executables go
7336 rp='Pathname where the public executables will reside?'
7338 if $test "X$ansexp" != "X$binexp"; then
7343 : Change installation prefix, if necessary.
7344 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7345 if $test X"$prefix" != X"$installprefix"; then
7346 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7348 installbin="$binexp"
7357 Perl can be built with extra modules or bundles of modules which
7358 will be fetched from the CPAN and installed alongside Perl.
7360 Notice that you will need access to the CPAN; either via the Internet,
7361 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7362 be asked later to configure the CPAN.pm module which will in turn do
7363 the installation of the rest of the extra modules or bundles.)
7365 Notice also that if the modules require any external software such as
7366 libraries and headers (the libz library and the zlib.h header for the
7367 Compress::Zlib module, for example) you MUST have any such software
7368 already installed, this configuration process will NOT install such
7371 If this doesn't make any sense to you, just accept the default '$dflt'.
7373 rp='Install any extra modules (y or n)?'
7379 Please list any extra modules or bundles to be installed from CPAN,
7380 with spaces between the names. The names can be in any format the
7381 'install' command of CPAN.pm will understand. (Answer 'none',
7382 without the quotes, to install no extra modules or bundles.)
7392 $rm -f ../extras.lst
7394 *) echo "(Saving the list of extras for later...)"
7395 echo "$extras" > ../extras.lst
7403 : determine where html pages for programs go
7404 set html1dir html1dir none
7408 If you wish to install html files for programs in $spackage, indicate
7409 the appropriate directory here. To skip installing html files,
7413 ''|none|$undef|' ') dflt=none ;;
7414 *) dflt=$html1dir ;;
7417 rp="Directory for the main $spackage html pages?"
7420 html1direxp="$ansexp"
7421 : Use ' ' for none so value is preserved next time through Configure
7422 $test X"$html1dir" = "X" && html1dir=' '
7423 : Change installation prefix, if necessary.
7424 if $test X"$prefix" != X"$installprefix"; then
7425 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
7427 installhtml1dir="$html1direxp"
7430 : determine where html pages for libraries and modules go
7431 set html3dir html3dir none
7435 If you wish to install html files for modules associated with $spackage,
7436 indicate the appropriate directory here. To skip installing html files,
7439 : There is no obvious default. If they have specified html1dir, then
7440 : try to key off that, possibly changing .../html1 into .../html3.
7442 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7443 *) dflt=$html3dir ;;
7446 rp="Directory for the $spackage module html pages?"
7449 html3direxp="$ansexp"
7450 : Use ' ' for none so value is preserved next time through Configure
7451 $test X"$html3dir" = "X" && html3dir=' '
7452 : Change installation prefix, if necessary.
7453 if $test X"$prefix" != X"$installprefix"; then
7454 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
7456 installhtml3dir="$html3direxp"
7459 : Find perl5.005 or later.
7460 echo "Looking for a previously installed perl5.005 or later... "
7462 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7463 : Check if this perl is recent and can load a simple module
7464 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7467 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7477 '') echo "None found. That's ok.";;
7478 *) echo "Using $perl5." ;;
7481 : Determine list of previous versions to include in @INC
7482 $cat > getverlist <<EOPL
7485 \$api_versionstring = "$api_versionstring";
7486 \$version = "$version";
7487 \$stem = "$sitelib_stem";
7488 \$archname = "$archname";
7490 $cat >> getverlist <<'EOPL'
7491 # Can't have leading @ because metaconfig interprets it as a command!
7492 ;@inc_version_list=();
7493 # XXX Redo to do opendir/readdir?
7496 ;@candidates = glob("5.*");
7502 # XXX ToDo: These comparisons must be reworked when two-digit
7503 # subversions come along, so that 5.7.10 compares as greater than
7504 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7505 # widespread that we can use the built-in version vectors rather
7506 # than reinventing them here. For 5.6.0, however, we must
7507 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7508 foreach $d (@candidates) {
7509 if ($d lt $version) {
7510 if ($d ge $api_versionstring) {
7511 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7513 elsif ($d ge "5.005") {
7514 unshift(@inc_version_list, grep { -d } $d);
7518 # Skip newer version. I.e. don't look in
7519 # 5.7.0 if we're installing 5.6.1.
7523 if (@inc_version_list) {
7524 print join(' ', @inc_version_list);
7527 # Blank space to preserve value for next Configure run.
7532 case "$inc_version_list" in
7533 '') if test -x "$perl5$exe_ext"; then
7534 dflt=`$perl5 getverlist`
7539 $undef) dflt='none' ;;
7540 *) eval dflt=\"$inc_version_list\" ;;
7543 ''|' ') dflt=none ;;
7550 In order to ease the process of upgrading, this version of perl
7551 can be configured to use modules built and installed with earlier
7552 versions of perl that were installed under $prefix. Specify here
7553 the list of earlier versions that this version of perl should check.
7554 If Configure detected no earlier versions of perl installed under
7555 $prefix, then the list will be empty. Answer 'none' to tell perl
7556 to not search earlier versions.
7558 The default should almost always be sensible, so if you're not sure,
7559 just accept the default.
7562 rp='List of earlier versions to include in @INC?'
7565 [Nn]one|''|' ') inc_version_list=' ' ;;
7566 *) inc_version_list="$ans" ;;
7568 case "$inc_version_list" in
7570 inc_version_list_init='0';;
7571 *) inc_version_list_init=`echo $inc_version_list |
7572 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7577 : determine whether to install perl also as /usr/bin/perl
7580 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7582 Many scripts expect perl to be installed as /usr/bin/perl.
7584 If you want to, I can install the perl you are about to compile
7585 as /usr/bin/perl (in addition to $bin/perl).
7587 if test -f /usr/bin/perl; then
7590 However, please note that because you already have a /usr/bin/perl,
7591 overwriting that with a new Perl would very probably cause problems.
7592 Therefore I'm assuming you don't want to do that (unless you insist).
7595 case "$installusrbinperl" in
7596 "$define"|[yY]*) dflt='y';;
7602 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7605 case "$installusrbinperl" in
7606 "$undef"|[nN]*) dflt='n';;
7610 rp="Do you want to install perl as /usr/bin/perl?"
7613 [yY]*) val="$define";;
7619 set installusrbinperl
7622 : see if dld is available
7626 : see if dlopen exists
7633 : determine which dynamic loading, if any, to compile in
7635 dldir="ext/DynaLoader"
7648 $define) dflt='y' ;;
7651 $define) dflt='y' ;;
7653 : Does a dl_xxx.xs file exist for this operating system
7654 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7657 rp="Do you wish to use dynamic loading?"
7664 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7665 dflt="$dldir/dl_${osname}.xs"
7666 elif $test "$d_dlopen" = "$define" ; then
7667 dflt="$dldir/dl_dlopen.xs"
7668 elif $test "$i_dld" = "$define" ; then
7669 dflt="$dldir/dl_dld.xs"
7674 *) dflt="$dldir/$dlsrc"
7677 echo "The following dynamic loading files are available:"
7678 : Can not go over to $dldir because getfile has path hard-coded in.
7679 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7680 rp="Source file to use for dynamic loading"
7686 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7690 Some systems may require passing special flags to $cc -c to
7691 compile modules that will be used to create a shared library.
7692 To use no flags, say "none".
7695 case "$cccdlflags" in
7696 '') case "$gccversion" in
7697 '') case "$osname" in
7699 next) dflt='none' ;;
7700 irix*) dflt='-KPIC' ;;
7701 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7702 sunos) dflt='-pic' ;;
7706 *) case "$osname" in
7707 darwin) dflt='none' ;;
7708 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7713 *) dflt="$cccdlflags" ;;
7715 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7718 none) cccdlflags=' ' ;;
7719 *) cccdlflags="$ans" ;;
7724 Some systems use ld to create libraries that can be dynamically loaded,
7725 while other systems (such as those using ELF) use $cc.
7729 '') $cat >try.c <<'EOM'
7730 /* Test for whether ELF binaries are produced */
7735 int i = open("a.out",O_RDONLY);
7738 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7739 exit(0); /* succeed (yes, it's ELF) */
7744 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7746 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7750 echo "I'll use ld to build dynamic libraries."
7759 rp="What command should be used to create dynamic libraries?"
7765 Some systems may require passing special flags to $ld to create a
7766 library that can be dynamically loaded. If your ld flags include
7767 -L/other/path options to locate libraries outside your loader's normal
7768 search path, you may need to specify those -L options here as well. To
7769 use no flags, say "none".
7772 case "$lddlflags" in
7773 '') case "$osname" in
7774 beos) dflt='-nostart' ;;
7776 case "$gccversion" in
7777 '') dflt="$dflt +vnocompatwarnings" ;;
7780 linux|irix*) dflt='-shared' ;;
7781 next) dflt='none' ;;
7782 solaris) dflt='-G' ;;
7783 sunos) dflt='-assert nodefinitions' ;;
7784 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7788 *) dflt="$lddlflags" ;;
7791 : Try to guess additional flags to pick up local libraries.
7792 : Be careful not to append to a plain 'none'
7796 for thisflag in $ldflags; do
7801 *) dflt="$dflt $thisflag" ;;
7808 ''|' ') dflt='none' ;;
7811 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7814 none) lddlflags=' ' ;;
7815 *) lddlflags="$ans" ;;
7820 Some systems may require passing special flags to $cc to indicate that
7821 the resulting executable will use dynamic linking. To use no flags,
7825 case "$ccdlflags" in
7826 '') case "$osname" in
7827 hpux) dflt='-Wl,-E' ;;
7828 linux) dflt='-rdynamic' ;;
7829 next) dflt='none' ;;
7830 sunos) dflt='none' ;;
7834 *) dflt="$ccdlflags" ;;
7836 rp="Any special flags to pass to $cc to use dynamic linking?"
7839 none) ccdlflags=' ' ;;
7840 *) ccdlflags="$ans" ;;
7854 # No dynamic loading being used, so don't bother even to prompt.
7857 *) case "$useshrplib" in
7858 '') case "$osname" in
7859 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7861 also='Building a shared libperl is required for dynamic loading to work on your system.'
7866 also='Building a shared libperl is needed for MAB support.'
7884 The perl executable is normally obtained by linking perlmain.c with
7885 libperl${_a}, any static extensions (usually just DynaLoader), and
7886 any other libraries needed on this system (such as -lm, etc.). Since
7887 your system supports dynamic loading, it is probably possible to build
7888 a shared libperl.$so. If you will have more than one executable linked
7889 to libperl.$so, this will significantly reduce the size of each
7890 executable, but it may have a noticeable affect on performance. The
7891 default is probably sensible for your system.
7895 rp="Build a shared libperl.$so (y/n)"
7899 useshrplib='true' ;;
7900 *) useshrplib='false' ;;
7905 case "$useshrplib" in
7909 # Figure out a good name for libperl.so. Since it gets stored in
7910 # a version-specific architecture-dependent library, the version
7911 # number isn't really that important, except for making cc/ld happy.
7913 # A name such as libperl.so.3.1
7914 majmin="libperl.$so.$patchlevel.$subversion"
7915 # A name such as libperl.so.301
7916 majonly=`echo $patchlevel $subversion |
7917 $awk '{printf "%d%02d", $1, $2}'`
7918 majonly=libperl.$so.$majonly
7919 # I'd prefer to keep the os-specific stuff here to a minimum, and
7920 # rely on figuring it out from the naming of libc.
7921 case "${osname}${osvers}" in
7924 # XXX How handle the --version stuff for MAB?
7926 linux*) # ld won't link with a bare -lperl otherwise.
7929 cygwin*) # ld links against an importlib
7930 dflt=libperl$lib_ext
7932 *) # Try to guess based on whether libc has major.minor.
7934 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7935 *libc.$so.[0-9]*) dflt=$majonly ;;
7936 *) dflt=libperl.$so ;;
7946 I need to select a good name for the shared libperl. If your system uses
7947 library names with major and minor numbers, then you might want something
7948 like $majmin. Alternatively, if your system uses a single version
7949 number for shared libraries, then you might want to use $majonly.
7950 Or, your system might be quite happy with a simple libperl.$so.
7952 Since the shared libperl will get installed into a version-specific
7953 architecture-dependent directory, the version number of the shared perl
7954 library probably isn't important, so the default should be o.k.
7957 rp='What name do you want to give to the shared libperl?'
7960 echo "Ok, I'll use $libperl"
7963 libperl="libperl${_a}"
7967 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7971 WARNING: Use of the shrpdir variable for the installation location of
7972 the shared $libperl is not supported. It was never documented and
7973 will not work in this version. Let me (perlbug@perl.org)
7974 know of any problems this may cause.
7980 But your current setting of $shrpdir is
7981 the default anyway, so it's harmless.
7986 Further, your current attempted setting of $shrpdir
7987 conflicts with the value of $archlibexp/CORE
7988 that installperl will use.
7995 # How will the perl executable find the installed shared $libperl?
7996 # Add $xxx to ccdlflags.
7997 # If we can't figure out a command-line option, use $shrpenv to
7998 # set env LD_RUN_PATH. The main perl makefile uses this.
7999 shrpdir=$archlibexp/CORE
8002 if "$useshrplib"; then
8005 # We'll set it in Makefile.SH...
8010 freebsd|netbsd|openbsd)
8011 xxx="-Wl,-R$shrpdir"
8013 bsdos|linux|irix*|dec_osf)
8014 xxx="-Wl,-rpath,$shrpdir"
8017 # next doesn't like the default...
8020 # beos doesn't like the default, either.
8023 # hpux doesn't like the default, either.
8024 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8027 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8033 # Only add $xxx if it isn't already in ccdlflags.
8034 case " $ccdlflags " in
8036 *) ccdlflags="$ccdlflags $xxx"
8039 Adding $xxx to the flags
8040 passed to $ld so that the perl executable will find the
8041 installed shared $libperl.
8049 # Fix ccdlflags in AIX for building external extensions.
8050 # (For building Perl itself bare -bE:perl.exp is needed,
8051 # Makefile.SH takes care of this.)
8053 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8055 # Respect a hint or command-line value.
8057 '') shrpenv="$tmp_shrpenv" ;;
8059 case "$ldlibpthname" in
8060 '') ldlibpthname=LD_LIBRARY_PATH ;;
8061 none) ldlibpthname='' ;;
8064 : determine where manual pages are on this system
8068 syspath='/usr/share/man/man1 /usr/man/man1'
8069 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8070 syspath="$syspath /usr/man/u_man/man1"
8071 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8072 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8073 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8074 sysman=`./loc . /usr/man/man1 $syspath`
8077 if $test -d "$sysman"; then
8078 echo "System manual is in $sysman." >&4
8080 echo "Could not find manual pages in source form." >&4
8083 : determine where manual pages go
8084 set man1dir man1dir none
8088 $spackage has manual pages available in source form.
8092 echo "However, you don't have nroff, so they're probably useless to you."
8094 '') man1dir="none";;
8097 echo "If you don't want the manual sources installed, answer 'none'."
8102 lookpath="$prefixexp/share/man/man1"
8103 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8104 lookpath="$lookpath $prefixexp/man/p_man/man1"
8105 lookpath="$lookpath $prefixexp/man/u_man/man1"
8106 lookpath="$lookpath $prefixexp/man/man.1"
8108 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8109 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8119 rp="Where do the main $spackage manual pages (source) go?"
8121 if $test "X$man1direxp" != "X$ansexp"; then
8125 man1direxp="$ansexp"
8131 : Change installation prefix, if necessary.
8132 if $test X"$prefix" != X"$installprefix"; then
8133 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8135 installman1dir="$man1direxp"
8138 : What suffix to use on installed man pages
8145 rp="What suffix should be used for the main $spackage man pages?"
8147 '') case "$man1dir" in
8161 *) dflt="$man1ext";;
8168 : see if we can have long filenames
8170 first=123456789abcdef
8172 if (echo hi >$first) 2>/dev/null; then
8173 if $test -f 123456789abcde; then
8174 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8177 echo 'You can have filenames longer than 14 characters.'>&4
8182 You can't have filenames longer than 14 chars.
8183 You can't even think about them!
8189 $rm -rf 123456789abcde*
8191 : determine where library module manual pages go
8192 set man3dir man3dir none
8196 $spackage has manual pages for many of the library modules.
8202 However, you don't have nroff, so they're probably useless to you.
8205 '') man3dir="none";;
8209 case "$d_flexfnam" in
8212 However, your system can't handle the long file names like File::Basename.3.
8215 '') man3dir="none";;
8219 echo "If you don't want the manual sources installed, answer 'none'."
8220 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8222 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8223 if $test -d "$privlib/man/man3"; then
8226 WARNING: Previous versions of perl installed man3 pages into
8227 $privlib/man/man3. This version will suggest a
8228 new default of $dflt.
8232 rp='Do you wish to preserve the old behavior?(y/n)'
8235 y*) dflt="$privlib/man/man3" ;;
8240 *) dflt="$man3dir" ;;
8247 rp="Where do the $package library man pages (source) go?"
8250 man3direxp="$ansexp"
8256 : Change installation prefix, if necessary.
8257 if $test X"$prefix" != X"$installprefix"; then
8258 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8260 installman3dir="$man3direxp"
8263 : What suffix to use on installed man pages
8269 rp="What suffix should be used for the $package library man pages?"
8271 '') case "$man3dir" in
8285 *) dflt="$man3ext";;
8292 : see if we have to deal with yellow pages, now NIS.
8293 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8294 if $test -f /usr/etc/nibindd; then
8296 echo "I'm fairly confident you're on a NeXT."
8298 rp='Do you get the hosts file via NetInfo?'
8307 y*) hostcat='nidump hosts .';;
8308 *) case "$hostcat" in
8309 nidump*) hostcat='';;
8319 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8327 rp='Are you getting the hosts file via yellow pages?'
8330 y*) hostcat='ypcat hosts';;
8331 *) hostcat='cat /etc/hosts';;
8337 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8340 '') test -f /etc/group && groupcat='cat /etc/group';;
8343 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8346 : now get the host name
8348 echo "Figuring out host name..." >&4
8349 case "$myhostname" in
8351 echo 'Maybe "hostname" will work...'
8352 if tans=`sh -c hostname 2>&1` ; then
8360 if $test "$cont"; then
8362 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8363 if tans=`cat /etc/systemid 2>&1` ; then
8365 phostname='cat /etc/systemid'
8366 echo "Whadyaknow. Xenix always was a bit strange..."
8369 elif $test -r /etc/systemid; then
8370 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8373 if $test "$cont"; then
8374 echo 'No, maybe "uuname -l" will work...'
8375 if tans=`sh -c 'uuname -l' 2>&1` ; then
8377 phostname='uuname -l'
8379 echo 'Strange. Maybe "uname -n" will work...'
8380 if tans=`sh -c 'uname -n' 2>&1` ; then
8382 phostname='uname -n'
8384 echo 'Oh well, maybe I can mine it out of whoami.h...'
8385 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8386 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8387 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8389 case "$myhostname" in
8390 '') echo "Does this machine have an identity crisis or something?"
8393 echo "Well, you said $myhostname before..."
8394 phostname='echo $myhostname';;
8400 case "$myhostname" in
8401 '') myhostname=noname ;;
8403 : you do not want to know about this
8408 if $test "$myhostname" ; then
8410 rp='Your host name appears to be "'$myhostname'".'" Right?"
8418 : bad guess or no guess
8419 while $test "X$myhostname" = X ; do
8421 rp="Please type the (one word) name of your host:"
8426 : translate upper to lower if necessary
8427 case "$myhostname" in
8429 echo "(Normalizing case in your host name)"
8430 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8434 case "$myhostname" in
8436 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8437 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8438 echo "(Trimming domain name from host name--host name is now $myhostname)"
8440 *) case "$mydomain" in
8443 test "X$hostcat" = "Xypcat hosts" &&
8444 ypmatch "$myhostname" hosts 2>/dev/null |\
8445 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8448 test "X$hostcat" != "X" &&
8449 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8450 /[ ]$myhostname[ . ]/p" > hosts
8453 if $test -f hosts; then
8454 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8455 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8456 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8457 hosts | $sort | $uniq | \
8458 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8459 case `$echo X$dflt` in
8460 X*\ *) echo "(Several hosts in the database matched hostname)"
8463 X.) echo "(You do not have fully-qualified names in the hosts database)"
8467 echo "(I cannot locate a hosts database anywhere)"
8472 tans=`./loc resolv.conf X /etc /usr/etc`
8473 if $test -f "$tans"; then
8474 echo "(Attempting domain name extraction from $tans)"
8475 dflt=.`$sed -n -e 's/ / /g' \
8476 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8477 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8479 .) dflt=.`$sed -n -e 's/ / /g' \
8480 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8481 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8488 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8489 dflt=.`sh -c domainname 2>/dev/null`
8492 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8496 case "$dflt$osname" in
8497 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8498 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8502 .) echo "(Lost all hope -- silly guess then)"
8508 *) dflt="$mydomain";;
8512 rp="What is your domain name?"
8522 : translate upper to lower if necessary
8525 echo "(Normalizing case in your domain name)"
8526 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8530 : a little sanity check here
8531 case "$phostname" in
8534 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8535 $myhostname$mydomain|$myhostname) ;;
8537 case "$phostname" in
8539 echo "(That doesn't agree with your whoami.h file, by the way.)"
8542 echo "(That doesn't agree with your $phostname command, by the way.)"
8552 I need to get your e-mail address in Internet format if possible, i.e.
8553 something like user@host.domain. Please answer accurately since I have
8554 no easy means to double check it. The default value provided below
8555 is most probably close to reality but may not be valid from outside
8556 your organization...
8560 while test "$cont"; do
8562 '') dflt="$cf_by@$myhostname$mydomain";;
8563 *) dflt="$cf_email";;
8565 rp='What is your e-mail address?'
8571 rp='Address does not look like an Internet one. Use it anyway?'
8587 If you or somebody else will be maintaining perl at your site, please
8588 fill in the correct e-mail address here so that they may be contacted
8589 if necessary. Currently, the "perlbug" program included with perl
8590 will send mail to this address in addition to perlbug@perl.org. You may
8591 enter "none" for no administrator.
8594 case "$perladmin" in
8595 '') dflt="$cf_email";;
8596 *) dflt="$perladmin";;
8598 rp='Perl administrator e-mail address'
8602 : determine whether to only install version-specific parts.
8605 Do you want to install only the version-specific parts of the perl
8606 distribution? Usually you do *not* want to do this.
8608 case "$versiononly" in
8609 "$define"|[Yy]*|true) dflt='y' ;;
8612 rp="Do you want to install only the version-specific parts of perl?"
8615 [yY]*) val="$define";;
8621 case "$versiononly" in
8622 "$define") inc_version_list=''
8623 inc_version_list_init=0
8627 : figure out how to guarantee perl startup
8628 case "$startperl" in
8630 case "$sharpbang" in
8634 I can use the #! construct to start perl on your system. This will
8635 make startup of perl scripts faster, but may cause problems if you
8636 want to share those scripts and perl is not in a standard place
8637 ($binexp/perl) on all your platforms. The alternative is to force
8638 a shell by starting the script with a single ':' character.
8641 case "$versiononly" in
8642 "$define") dflt="$binexp/perl$version";;
8643 *) dflt="$binexp/perl";;
8645 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8648 none) startperl=": # use perl";;
8649 *) startperl="#!$ans"
8650 if $test 30 -lt `echo "$ans" | wc -c`; then
8653 WARNING: Some systems limit the #! command to 32 characters.
8654 If you experience difficulty running Perl scripts with #!, try
8655 installing Perl in a directory with a shorter pathname.
8661 *) startperl=": # use perl"
8666 echo "I'll use $startperl to start perl scripts."
8668 : figure best path for perl in scripts
8671 case "$versiononly" in
8672 "$define") perlpath="$binexp/perl$version";;
8673 *) perlpath="$binexp/perl";;
8675 case "$startperl" in
8680 I will use the "eval 'exec'" idiom to start Perl on your system.
8681 I can use the full path of your Perl binary for this purpose, but
8682 doing so may cause problems if you want to share those scripts and
8683 Perl is not always in a standard place ($binexp/perl).
8687 rp="What path shall I use in \"eval 'exec'\"?"
8694 case "$startperl" in
8696 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8699 : determine where public executable scripts go
8700 set scriptdir scriptdir
8702 case "$scriptdir" in
8705 : guess some guesses
8706 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8707 $test -d /usr/share/bin && dflt=/usr/share/bin
8708 $test -d /usr/local/script && dflt=/usr/local/script
8709 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8710 $test -d $prefixexp/script && dflt=$prefixexp/script
8714 *) dflt="$scriptdir"
8719 Some installations have a separate directory just for executable scripts so
8720 that they can mount it across multiple architectures but keep the scripts in
8721 one spot. You might, for example, have a subdirectory of /usr/share for this.
8722 Or you might just lump your scripts in with all your other executables.
8726 rp='Where do you keep publicly executable scripts?'
8728 if $test "X$ansexp" != "X$scriptdirexp"; then
8732 scriptdirexp="$ansexp"
8733 : Change installation prefix, if necessary.
8734 if $test X"$prefix" != X"$installprefix"; then
8735 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8737 installscript="$scriptdirexp"
8740 : determine where add-on public executables go
8742 '') dflt=$siteprefix/bin ;;
8746 rp='Pathname where the add-on public executables should be installed?'
8749 sitebinexp="$ansexp"
8750 : Change installation prefix, if necessary.
8751 if $test X"$prefix" != X"$installprefix"; then
8752 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8754 installsitebin="$sitebinexp"
8757 : determine where add-on html pages go
8758 : There is no standard location, so try to copy the previously-selected
8759 : directory structure for the core html pages.
8760 case "$sitehtml1" in
8761 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8762 *) dflt=$sitehtml1 ;;
8765 ''|' ') dflt=none ;;
8768 rp='Pathname where the site-specific html pages should be installed?'
8771 sitehtml1exp="$ansexp"
8772 : Use ' ' for none so value is preserved next time through Configure
8773 $test X"$sitehtml1" = "X" && sitehtml1=' '
8774 : Change installation prefix, if necessary.
8775 if $test X"$prefix" != X"$installprefix"; then
8776 installsitehtml1=`echo "$sitehtml1exp" | $sed "s#^$prefix#$installprefix#"`
8778 installsitehtml1="$sitehtml1exp"
8781 : determine where add-on library html pages go
8782 : There is no standard location, so try to copy the previously-selected
8783 : directory structure for the core html pages.
8784 case "$sitehtml3" in
8785 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8786 *) dflt=$sitehtml3 ;;
8789 ''|' ') dflt=none ;;
8792 rp='Pathname where the site-specific library html pages should be installed?'
8795 sitehtml3exp="$ansexp"
8796 : Use ' ' for none so value is preserved next time through Configure
8797 $test X"$sitehtml3" = "X" && sitehtml3=' '
8798 : Change installation prefix, if necessary.
8799 if $test X"$prefix" != X"$installprefix"; then
8800 installsitehtml3=`echo "$sitehtml3exp" | $sed "s#^$prefix#$installprefix#"`
8802 installsitehtml3="$sitehtml3exp"
8805 : determine where add-on manual pages go
8807 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8808 *) dflt=$siteman1 ;;
8811 ''|' ') dflt=none ;;
8814 rp='Pathname where the site-specific manual pages should be installed?'
8817 siteman1exp="$ansexp"
8818 : Use ' ' for none so value is preserved next time through Configure
8819 $test X"$siteman1" = "X" && siteman1=' '
8820 : Change installation prefix, if necessary.
8821 if $test X"$prefix" != X"$installprefix"; then
8822 installsiteman1=`echo "$siteman1exp" | $sed "s#^$prefix#$installprefix#"`
8824 installsiteman1="$siteman1exp"
8827 : determine where add-on library man pages go
8829 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8830 *) dflt=$siteman3 ;;
8833 ''|' ') dflt=none ;;
8836 rp='Pathname where the site-specific library manual pages should be installed?'
8839 siteman3exp="$ansexp"
8840 : Use ' ' for none so value is preserved next time through Configure
8841 $test X"$siteman3" = "X" && siteman3=' '
8842 : Change installation prefix, if necessary.
8843 if $test X"$prefix" != X"$installprefix"; then
8844 installsiteman3=`echo "$siteman3exp" | $sed "s#^$prefix#$installprefix#"`
8846 installsiteman3="$siteman3exp"
8849 : determine where add-on public executable scripts go
8850 case "$sitescript" in
8851 '') dflt=$siteprefix/script
8852 $test -d $dflt || dflt=$sitebin ;;
8853 *) dflt="$sitescript" ;;
8856 rp='Pathname where add-on public executable scripts should be installed?'
8859 sitescriptexp="$ansexp"
8860 : Change installation prefix, if necessary.
8861 if $test X"$prefix" != X"$installprefix"; then
8862 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8864 installsitescript="$sitescriptexp"
8867 : define an is-a-typedef? function
8868 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8870 "") inclist="sys/types.h";;
8872 eval "varval=\$$var";
8876 for inc in $inclist; do
8877 echo "#include <$inc>" >>temp.c;
8879 echo "#ifdef $type" >> temp.c;
8880 echo "printf(\"We have $type\");" >> temp.c;
8881 echo "#endif" >> temp.c;
8882 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8883 if $contains $type temp.E >/dev/null 2>&1; then
8889 *) eval "$var=\$varval";;
8892 : define an is-a-typedef? function that prompts if the type is not available.
8893 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8895 "") inclist="sys/types.h";;
8897 eval "varval=\$$var";
8901 for inc in $inclist; do
8902 echo "#include <$inc>" >>temp.c;
8904 echo "#ifdef $type" >> temp.c;
8905 echo "printf(\"We have $type\");" >> temp.c;
8906 echo "#endif" >> temp.c;
8907 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8909 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8910 if $contains $type temp.E >/dev/null 2>&1; then
8911 echo "$type found." >&4;
8914 echo "$type NOT found." >&4;
8920 *) eval "$var=\$varval";;
8923 : see what type lseek is declared as in the kernel
8924 rp="What is the type used for lseek's offset on this system?"
8925 set off_t lseektype long stdio.h sys/types.h
8929 echo "Checking to see how big your file offsets are..." >&4
8931 #include <sys/types.h>
8935 printf("%d\n", (int)sizeof($lseektype));
8940 if eval $compile_ok; then
8941 lseeksize=`$run ./try`
8942 echo "Your file offsets are $lseeksize bytes long."
8946 echo "(I can't seem to compile the test program. Guessing...)"
8947 rp="What is the size of your file offsets (in bytes)?"
8953 : see what type file positions are declared as in the library
8954 rp="What is the type for file position used by fsetpos()?"
8955 set fpos_t fpostype long stdio.h sys/types.h
8960 *_t) zzz="$fpostype" ;;
8963 echo "Checking the size of $zzz..." >&4
8965 #include <sys/types.h>
8972 printf("%d\n", (int)sizeof($fpostype));
8977 if eval $compile_ok; then
8981 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8984 echo "Your $zzz is $fpossize bytes long."
8990 echo "(I can't compile the test program. Guessing...)" >&4
8991 rp="What is the size of your file positions (in bytes)?"
8998 # Backward compatibility (uselfs is deprecated).
9000 "$define"|true|[yY]*)
9003 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9005 uselargefiles="$define"
9009 case "$lseeksize:$fpossize" in
9012 You can have files larger than 2 gigabytes.
9015 *) case "$uselargefiles" in
9016 "$undef"|false|[nN]*) dflt='n' ;;
9021 Perl can be built to understand large files (files larger than 2 gigabytes)
9022 on some systems. To do so, Configure can be run with -Duselargefiles.
9024 If this doesn't make any sense to you, just accept the default '$dflt'.
9026 rp='Try to understand large files, if available?'
9029 y|Y) val="$define" ;;
9036 case "$uselargefiles" in
9038 : Look for a hint-file generated 'call-back-unit'. If the
9039 : user has specified that a large files perl is to be built,
9040 : we may need to set or change some other defaults.
9041 if $test -f uselargefiles.cbu; then
9042 echo "Your platform has some specific hints for large file builds, using them..."
9043 . ./uselargefiles.cbu
9045 echo "Rechecking to see how big your file offsets are..." >&4
9047 #include <sys/types.h>
9051 printf("%d\n", (int)sizeof($lseektype));
9056 if eval $compile_ok; then
9057 lseeksize=`$run ./try`
9058 $echo "Your file offsets are now $lseeksize bytes long."
9062 echo "(I can't seem to compile the test program. Guessing...)"
9063 rp="What is the size of your file offsets (in bytes)?"
9068 *_t) zzz="$fpostype" ;;
9071 $echo $n "Rechecking the size of $zzz...$c" >&4
9073 #include <sys/types.h>
9076 printf("%d\n", (int)sizeof($fpostype));
9081 if eval $compile_ok; then
9086 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9089 echo " $fpossize bytes." >&4
9095 echo "(I can't compile the test program. Guessing...)" >&4
9096 rp="What is the size of your file positions (in bytes)?"
9105 case "$vendorprefix" in
9106 '') d_vendorbin="$undef"
9110 *) d_vendorbin="$define"
9111 : determine where vendor-supplied executables go.
9112 case "$vendorbin" in
9113 '') dflt=$vendorprefix/bin ;;
9114 *) dflt="$vendorbin" ;;
9117 rp='Pathname for the vendor-supplied executables directory?'
9120 vendorbinexp="$ansexp"
9123 : Change installation prefix, if necessary.
9124 if $test X"$prefix" != X"$installprefix"; then
9125 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9127 installvendorbin="$vendorbinexp"
9130 case "$vendorprefix" in
9134 *) : determine where vendor-supplied html pages go.
9135 : There is no standard location, so try to copy the previously-selected
9136 : directory structure for the core html pages.
9137 : XXX Better default suggestions would be welcome.
9138 case "$vendorhtml1" in
9139 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9140 *) dflt=$vendorhtml1 ;;
9143 ''|' ') dflt=none ;;
9146 rp='Pathname for the vendor-supplied html pages?'
9149 vendorhtml1exp="$ansexp"
9152 : Use ' ' for none so value is preserved next time through Configure
9153 $test X"$vendorhtml1" = "X" && vendorhtml1=' '
9154 : Change installation prefix, if necessary.
9155 if $test X"$prefix" != X"$installprefix"; then
9156 installvendorhtml1=`echo $vendorhtml1exp | $sed "s#^$prefix#$installprefix#"`
9158 installvendorhtml1="$vendorhtml1exp"
9161 case "$vendorprefix" in
9165 *) : determine where vendor-supplied module html pages go.
9166 : There is no standard location, so try to copy the previously-selected
9167 : directory structure for the core html pages.
9168 : XXX Better default suggestions would be welcome.
9169 case "$vendorhtml3" in
9170 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9171 *) dflt=$vendorhtml3 ;;
9174 ''|' ') dflt=none ;;
9177 rp='Pathname for the vendor-supplied html pages?'
9180 vendorhtml3exp="$ansexp"
9183 : Use ' ' for none so value is preserved next time through Configure
9184 $test X"$vendorhtml3" = "X" && vendorhtml3=' '
9185 : Change installation prefix, if necessary.
9186 if $test X"$prefix" != X"$installprefix"; then
9187 installvendorhtml3=`echo $vendorhtml3exp | $sed "s#^$prefix#$installprefix#"`
9189 installvendorhtml3="$vendorhtml3exp"
9192 case "$vendorprefix" in
9196 *) : determine where vendor-supplied manual pages go.
9197 case "$vendorman1" in
9198 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9199 *) dflt=$vendorman1 ;;
9202 ''|' ') dflt=none ;;
9205 rp='Pathname for the vendor-supplied manual section 1 pages?'
9208 vendorman1exp="$ansexp"
9211 : Use ' ' for none so value is preserved next time through Configure
9212 $test X"$vendorman1" = "X" && vendorman1=' '
9213 : Change installation prefix, if necessary.
9214 if $test X"$prefix" != X"$installprefix"; then
9215 installvendorman1=`echo "$vendorman1exp" | $sed "s#^$prefix#$installprefix#"`
9217 installvendorman1="$vendorman1exp"
9220 case "$vendorprefix" in
9224 *) : determine where vendor-supplied module manual pages go.
9225 case "$vendorman3" in
9226 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9227 *) dflt=$vendorman3 ;;
9230 ''|' ') dflt=none ;;
9233 rp='Pathname for the vendor-supplied manual section 3 pages?'
9236 vendorman3exp="$ansexp"
9239 : Use ' ' for none so value is preserved next time through Configure
9240 $test X"$vendorman3" = "X" && vendorman3=' '
9241 : Change installation prefix, if necessary.
9242 if $test X"$prefix" != X"$installprefix"; then
9243 installvendorman3=`echo "$vendorman3exp" | $sed "s#^$prefix#$installprefix#"`
9245 installvendorman3="$vendorman3exp"
9248 case "$vendorprefix" in
9249 '') d_vendorscript="$undef"
9253 *) d_vendorscript="$define"
9254 : determine where vendor-supplied scripts go.
9255 case "$vendorscript" in
9256 '') dflt=$vendorprefix/script
9257 $test -d $dflt || dflt=$vendorbin ;;
9258 *) dflt="$vendorscript" ;;
9262 The installation process will create a directory for
9263 vendor-supplied scripts.
9267 rp='Pathname for the vendor-supplied scripts directory?'
9270 vendorscriptexp="$ansexp"
9273 : Change installation prefix, if necessary.
9274 if $test X"$prefix" != X"$installprefix"; then
9275 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9277 installvendorscript="$vendorscriptexp"
9280 : see if qgcvt exists
9284 : Check how to convert floats to strings.
9286 if test "X$d_Gconvert" = X; then
9289 echo "Checking for an efficient way to convert floats to strings."
9291 case "$uselongdouble" in
9292 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9294 case "$d_longdbl" in
9295 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9297 case "$d_PRIgldbl" in
9298 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9302 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9303 char *myname = "gconvert";
9306 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9307 char *myname = "gcvt";
9310 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9311 char *myname = "qgcvt";
9312 #define DOUBLETYPE long double
9315 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9317 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9319 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9322 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9324 char *myname = "sprintf";
9328 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9329 #define DOUBLETYPE long double
9331 #define DOUBLETYPE double
9337 #define I_STDLIB $i_stdlib
9343 checkit(expect, got)
9347 if (strcmp(expect, got)) {
9348 printf("%s oddity: Expected %s, got %s\n",
9349 myname, expect, got);
9359 /* This must be 1st test on (which?) platform */
9360 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9361 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9362 checkit("0.1", buf);
9364 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9365 checkit("0.01", buf);
9367 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9368 checkit("0.001", buf);
9370 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9371 checkit("0.0001", buf);
9373 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9374 if (strlen(buf) > 5)
9375 checkit("9e-005", buf); /* for Microsoft ?? */
9377 checkit("9e-05", buf);
9379 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9382 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9383 checkit("1.1", buf);
9385 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9386 checkit("1.01", buf);
9388 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9389 checkit("1.001", buf);
9391 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9392 checkit("1.0001", buf);
9394 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9395 checkit("1.00001", buf);
9397 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9398 checkit("1.000001", buf);
9400 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9403 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9406 /* Some Linux gcvt's give 1.e+5 here. */
9407 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9408 checkit("100000", buf);
9410 /* Some Linux gcvt's give -1.e+5 here. */
9411 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9412 checkit("-100000", buf);
9414 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9415 checkit("123.456", buf);
9417 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9418 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9419 /* 34 should be enough to scare even long double
9420 * places into using the e notation. */
9421 if (strlen(buf) > 5)
9422 checkit("1e+034", buf); /* for Microsoft */
9424 checkit("1e+34", buf);
9426 /* For Perl, if you add additional tests here, also add them to
9427 * t/base/num.t for benefit of platforms not using Configure or
9428 * overriding d_Gconvert */
9433 : first add preferred functions to our list
9435 for xxx_convert in $gconvert_preference; do
9436 case $xxx_convert in
9437 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9438 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9441 : then add any others
9442 for xxx_convert in gconvert gcvt sprintf; do
9445 *) xxx_list="$xxx_list $xxx_convert" ;;
9449 case "$d_longdbl$uselongdouble" in
9451 : again, add prefered functions to our list first
9453 for xxx_convert in $gconvert_ld_preference; do
9454 case $xxx_convert in
9455 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9456 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9459 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9460 for xxx_convert in qgcvt sprintf $xxx_list; do
9461 case "$xxx_ld_list" in
9462 $xxx_convert*|*" $xxx_convert"*) ;;
9463 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9466 : if sprintf cannot do long doubles, move it to the end
9467 if test "$d_PRIgldbl" != "$define"; then
9468 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9470 : if no qgcvt, remove it
9471 if test "$d_qgcvt" != "$define"; then
9472 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9475 xxx_list="$xxx_ld_list"
9479 for xxx_convert in $xxx_list; do
9480 echo "Trying $xxx_convert..."
9482 set try -DTRY_$xxx_convert
9483 if eval $compile; then
9484 echo "$xxx_convert() found." >&4
9486 echo "I'll use $xxx_convert to convert floats into a string." >&4
9489 echo "...But $xxx_convert didn't work as I expected."
9493 echo "$xxx_convert NOT found." >&4
9497 if test X$xxx_convert = X; then
9498 echo "*** WHOA THERE!!! ***" >&4
9499 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9503 case "$xxx_convert" in
9504 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9505 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9506 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9507 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9508 "$define$define$define")
9509 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9510 "$define$define$undef")
9511 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9512 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9519 : see if _fwalk exists
9523 : Initialize h_fcntl
9526 : Initialize h_sysfile
9529 : access call always available on UNIX
9533 : locate the flags for 'access()'
9537 $cat >access.c <<'EOCP'
9538 #include <sys/types.h>
9543 #include <sys/file.h>
9552 : check sys/file.h first, no particular reason here
9553 if $test `./findhdr sys/file.h` && \
9554 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9556 echo "<sys/file.h> defines the *_OK access constants." >&4
9557 elif $test `./findhdr fcntl.h` && \
9558 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9560 echo "<fcntl.h> defines the *_OK access constants." >&4
9561 elif $test `./findhdr unistd.h` && \
9562 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9563 echo "<unistd.h> defines the *_OK access constants." >&4
9565 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9571 : see if accessx exists
9572 set accessx d_accessx
9575 : see if alarm exists
9579 : see if POSIX threads are available
9580 set pthread.h i_pthread
9583 : define a fucntion to check prototypes
9584 $cat > protochk <<EOSH
9587 optimize="$optimize"
9589 prototype="$prototype"
9592 usethreads=$usethreads
9593 i_pthread=$i_pthread
9594 pthread_h_first=$pthread_h_first
9597 $cat >> protochk <<'EOSH'
9602 while test $# -ge 2; do
9604 $define) echo "#include <$2>" >> try.c ;;
9605 literal) echo "$2" >> try.c ;;
9607 # Extra magic for the benefit of systems that need pthread.h
9608 # to be included early to correctly detect threadsafe functions.
9609 # Such functions must guarantee themselves, though, that the usethreads
9610 # and i_pthread have been defined, before calling protochk.
9611 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9612 echo "#include <pthread.h>" >> try.c
9617 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9618 cat >> try.c <<'EOCP'
9619 #ifdef CAN_PROTOTYPE
9620 #define _(args) args
9625 echo "$foo" >> try.c
9626 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9627 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9635 : see if sys/types.h has to be included
9636 set sys/types.h i_systypes
9639 : see if sys/select.h has to be included
9640 set sys/select.h i_sysselct
9643 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9644 while $test $# -ge 2; do
9646 $define) echo "#include <$2>";;
9650 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9652 if eval $compile; then
9661 : see if we should include time.h, sys/time.h, or both
9663 if test "X$timeincl" = X; then
9664 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9665 $echo $n "I'm now running the test program...$c"
9666 $cat >try.c <<'EOCP'
9667 #include <sys/types.h>
9672 #ifdef SYSTIMEKERNEL
9675 #include <sys/time.h>
9678 #include <sys/select.h>
9687 struct timezone tzp;
9689 if (foo.tm_sec == foo.tm_sec)
9692 if (bar.tv_sec == bar.tv_sec)
9699 for s_timezone in '-DS_TIMEZONE' ''; do
9701 for s_timeval in '-DS_TIMEVAL' ''; do
9702 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9703 for i_time in '' '-DI_TIME'; do
9704 for i_systime in '-DI_SYSTIME' ''; do
9707 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9708 if eval $compile; then
9709 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9713 $echo $n "Succeeded with $flags$c"
9725 *SYSTIMEKERNEL*) i_systimek="$define"
9726 timeincl=`./findhdr sys/time.h`
9727 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9728 *) i_systimek="$undef";;
9731 *I_TIME*) i_time="$define"
9732 timeincl=`./findhdr time.h`" $timeincl"
9733 echo "We'll include <time.h>." >&4;;
9734 *) i_time="$undef";;
9737 *I_SYSTIME*) i_systime="$define"
9738 timeincl=`./findhdr sys/time.h`" $timeincl"
9739 echo "We'll include <sys/time.h>." >&4;;
9740 *) i_systime="$undef";;
9744 : see if struct tm knows about tm_zone
9745 case "$i_systime$i_time" in
9748 echo "Checking to see if your struct tm has tm_zone field..." >&4
9749 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9757 case "$d_tm_tm_zone" in
9758 "$define") echo "Yes, it does." ;;
9759 *) echo "No, it doesn't." ;;
9761 : see if struct tm knows about tm_gmtoff
9762 case "$i_systime$i_time" in
9765 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9766 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9774 case "$d_tm_tm_gmtoff" in
9775 "$define") echo "Yes, it does." ;;
9776 *) echo "No, it doesn't." ;;
9779 : see if asctime_r exists
9780 set asctime_r d_asctime_r
9782 case "$d_asctime_r" in
9784 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9785 case "$d_asctime_r_proto:$usethreads" in
9786 ":define") d_asctime_r_proto=define
9787 set d_asctime_r_proto asctime_r $hdrs
9791 case "$d_asctime_r_proto" in
9793 case "$asctime_r_proto" in
9794 ''|0) try='char* asctime_r(const struct tm*, char*);'
9795 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9797 case "$asctime_r_proto" in
9798 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9799 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9801 case "$asctime_r_proto" in
9802 ''|0) try='int asctime_r(const struct tm*, char*);'
9803 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9805 case "$asctime_r_proto" in
9806 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9807 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9809 case "$asctime_r_proto" in
9810 ''|0) d_asctime_r=undef
9812 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9813 * ) case "$asctime_r_proto" in
9814 REENTRANT_PROTO*) ;;
9815 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9817 echo "Prototype: $try" ;;
9820 *) case "$usethreads" in
9821 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9828 *) asctime_r_proto=0
9832 : see if atolf exists
9836 : see if atoll exists
9840 : Look for GNU-cc style attribute checking
9842 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9843 $cat >attrib.c <<'EOCP'
9845 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9847 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9848 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9849 echo "Your C compiler doesn't fully support __attribute__."
9852 echo "Your C compiler supports __attribute__."
9856 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9863 : see if bcmp exists
9867 : see if bcopy exists
9871 : see if this is a unistd.h system
9872 set unistd.h i_unistd
9875 : see if getpgrp exists
9876 set getpgrp d_getpgrp
9879 case "$d_getpgrp" in
9882 echo "Checking to see which flavor of getpgrp is in use..."
9885 #include <sys/types.h>
9887 # include <unistd.h>
9891 if (getuid() == 0) {
9892 printf("(I see you are running Configure as super-user...)\n");
9896 if (getpgrp(1) == 0)
9905 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9906 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9908 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9909 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9912 echo "I can't seem to compile and run the test program."
9914 xxx="a USG one, i.e. you use getpgrp()."
9916 # SVR4 systems can appear rather BSD-ish.
9919 xxx="a BSD one, i.e. you use getpgrp(pid)."
9923 xxx="probably a USG one, i.e. you use getpgrp()."
9928 echo "Assuming your getpgrp is $xxx" >&4
9937 : see if setpgrp exists
9938 set setpgrp d_setpgrp
9941 case "$d_setpgrp" in
9944 echo "Checking to see which flavor of setpgrp is in use..."
9947 #include <sys/types.h>
9949 # include <unistd.h>
9953 if (getuid() == 0) {
9954 printf("(I see you are running Configure as super-user...)\n");
9958 if (-1 == setpgrp(1, 1))
9961 if (setpgrp() != -1)
9967 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9968 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9970 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9971 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9974 echo "(I can't seem to compile and run the test program.)"
9976 xxx="a USG one, i.e. you use setpgrp()."
9978 # SVR4 systems can appear rather BSD-ish.
9981 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9985 xxx="probably a USG one, i.e. you use setpgrp()."
9990 echo "Assuming your setpgrp is $xxx" >&4
9998 : see if bzero exists
10002 : see if signal is declared as pointer to function returning int or void
10004 xxx=`./findhdr signal.h`
10005 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10006 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10007 echo "You have int (*signal())() instead of void." >&4
10009 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10010 echo "You have void (*signal())()." >&4
10012 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10013 echo "You have int (*signal())() instead of void." >&4
10015 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10016 echo "You have void (*signal())()." >&4
10019 case "$d_voidsig" in
10021 echo "I can't determine whether signal handler returns void or int..." >&4
10023 rp="What type does your signal handler return?"
10026 v*) val="$define";;
10030 echo "As you already told me, signal handler returns void." >&4
10033 *) echo "As you already told me, signal handler returns int." >&4
10040 case "$d_voidsig" in
10041 "$define") signal_t="void";;
10042 *) signal_t="int";;
10046 : check for ability to cast large floats to 32-bit ints.
10048 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10049 if $test "$intsize" -ge 4; then
10056 #$i_stdlib I_STDLIB
10058 #include <stdlib.h>
10060 #include <sys/types.h>
10061 #include <signal.h>
10062 $signal_t blech(s) int s; { exit(3); }
10069 signal(SIGFPE, blech);
10071 /* Don't let compiler optimize the test away. Store the number
10072 in a writable string for gcc to pass to sscanf under HP/UX.
10074 sprintf(str, "2147483647");
10075 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10079 /* x86 processors will probably give 0x8000 0000, which is a
10080 sign change. We don't want that. We want to mimic SPARC
10081 behavior here, which is to preserve the sign and give
10084 if (i32 != ($xxx) f)
10090 if eval $compile_ok; then
10094 echo "(I can't seem to compile the test program--assuming it can't)"
10099 echo "Yup, it can."
10102 echo "Nope, it can't."
10109 : check for ability to cast negative floats to unsigned
10111 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10114 #$i_stdlib I_STDLIB
10116 #include <stdlib.h>
10118 #include <sys/types.h>
10119 #include <signal.h>
10120 $signal_t blech(s) int s; { exit(7); }
10121 $signal_t blech_in_list(s) int s; { exit(4); }
10122 unsigned long dummy_long(p) unsigned long p; { return p; }
10123 unsigned int dummy_int(p) unsigned int p; { return p; }
10124 unsigned short dummy_short(p) unsigned short p; { return p; }
10128 unsigned long along;
10130 unsigned short ashort;
10134 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10135 a direct f = -123. assignment. gcc-2.8.0 reportedly
10136 optimized the whole file away
10138 /* Store the number in a writable string for gcc to pass to
10139 sscanf under HP/UX.
10141 sprintf(str, "-123");
10142 sscanf(str, "%lf", &f); /* f = -123.; */
10144 signal(SIGFPE, blech);
10145 along = (unsigned long)f;
10146 aint = (unsigned int)f;
10147 ashort = (unsigned short)f;
10148 if (along != (unsigned long)-123)
10150 if (aint != (unsigned int)-123)
10152 if (ashort != (unsigned short)-123)
10154 sprintf(str, "1073741824.");
10155 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10158 along = (unsigned long)f;
10159 if (along != 0x80000000)
10163 along = (unsigned long)f;
10164 if (along != 0x7fffffff)
10168 along = (unsigned long)f;
10169 if (along != 0x80000001)
10173 signal(SIGFPE, blech_in_list);
10174 sprintf(str, "123.");
10175 sscanf(str, "%lf", &f); /* f = 123.; */
10176 along = dummy_long((unsigned long)f);
10177 aint = dummy_int((unsigned int)f);
10178 ashort = dummy_short((unsigned short)f);
10179 if (along != (unsigned long)123)
10181 if (aint != (unsigned int)123)
10183 if (ashort != (unsigned short)123)
10190 if eval $compile_ok; then
10194 echo "(I can't seem to compile the test program--assuming it can't)"
10197 case "$castflags" in
10199 echo "Yup, it can."
10202 echo "Nope, it can't."
10209 : see if vprintf exists
10211 if set vprintf val -f d_vprintf; eval $csym; $val; then
10212 echo 'vprintf() found.' >&4
10214 $cat >try.c <<'EOF'
10215 #include <varargs.h>
10217 int main() { xxx("foo"); }
10226 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10230 if eval $compile && $run ./try; then
10231 echo "Your vsprintf() returns (int)." >&4
10234 echo "Your vsprintf() returns (char*)." >&4
10238 echo 'vprintf() NOT found.' >&4
10249 : see if chown exists
10253 : see if chroot exists
10254 set chroot d_chroot
10257 : see if chsize exists
10258 set chsize d_chsize
10261 : see if class exists
10265 hasstruct='varname=$1; struct=$2; shift; shift;
10266 while $test $# -ge 2; do
10268 $define) echo "#include <$2>";;
10272 echo "int main () { struct $struct foo; }" >> try.c;
10274 if eval $compile; then
10281 $rm -f try.c try.o'
10285 : see whether socket exists
10287 $echo $n "Hmm... $c" >&4
10288 if set socket val -f d_socket; eval $csym; $val; then
10289 echo "Looks like you have Berkeley networking support." >&4
10291 if set setsockopt val -f; eval $csym; $val; then
10294 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10295 d_oldsock="$define"
10298 if $contains socklib libc.list >/dev/null 2>&1; then
10299 echo "Looks like you have Berkeley networking support." >&4
10301 : we will have to assume that it supports the 4.2 BSD interface
10304 echo "You don't have Berkeley networking in libc$_a..." >&4
10305 if test "X$d_socket" = "X$define"; then
10306 echo "...but you seem to believe that you have sockets." >&4
10308 for net in net socket
10310 if test -f /usr/lib/lib$net$_a; then
10311 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10312 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10313 if $contains socket libc.list >/dev/null 2>&1; then
10318 echo "...but the Wollongong group seems to have hacked it in." >&4
10319 sockethdr="-I/usr/netinclude"
10322 echo "Found Berkeley sockets interface in lib$net." >&4
10323 if $contains setsockopt libc.list >/dev/null 2>&1; then
10326 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10327 d_oldsock="$define"
10333 if test "X$d_socket" != "X$define"; then
10334 echo "or anywhere else I see." >&4
10342 : see if socketpair exists
10343 set socketpair d_sockpair
10348 echo "Checking the availability of certain socket constants..." >&4
10349 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10350 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10352 #include <sys/types.h>
10353 #include <sys/socket.h>
10359 set try; if eval $compile; then
10362 set d_${enum}; eval $setvar
10366 : see if this is a sys/uio.h system
10367 set sys/uio.h i_sysuio
10372 echo "Checking to see if your system supports struct cmsghdr..." >&4
10373 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10375 case "$d_cmsghdr_s" in
10376 "$define") echo "Yes, it does." ;;
10377 *) echo "No, it doesn't." ;;
10381 : check for const keyword
10383 echo 'Checking to see if your C compiler knows about "const"...' >&4
10384 $cat >const.c <<'EOCP'
10385 typedef struct spug { int drokk; } spug;
10392 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10394 echo "Yup, it does."
10397 echo "Nope, it doesn't."
10402 : see if crypt exists
10407 $define) cryptlib='' ;;
10408 *) if set crypt val -f d_crypt; eval $csym; $val; then
10409 echo 'crypt() found.' >&4
10413 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10414 if $test -z "$cryptlib"; then
10415 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10419 if $test -z "$cryptlib"; then
10420 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10424 if $test -z "$cryptlib"; then
10425 cryptlib=`./loc libcrypt$_a "" $libpth`
10429 if $test -z "$cryptlib"; then
10430 echo 'crypt() NOT found.' >&4
10441 : see if this is a crypt.h system
10442 set crypt.h i_crypt
10445 : see if crypt_r exists
10446 set crypt_r d_crypt_r
10448 case "$d_crypt_r" in
10450 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10451 case "$d_crypt_r_proto:$usethreads" in
10452 ":define") d_crypt_r_proto=define
10453 set d_crypt_r_proto crypt_r $hdrs
10457 case "$d_crypt_r_proto" in
10459 case "$crypt_r_proto" in
10460 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10461 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10463 case "$crypt_r_proto" in
10464 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10465 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10467 case "$crypt_r_proto" in
10468 ''|0) d_crypt_r=undef
10470 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10471 * ) case "$crypt_r_proto" in
10472 REENTRANT_PROTO*) ;;
10473 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10475 echo "Prototype: $try" ;;
10478 *) case "$usethreads" in
10479 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10490 : get csh whereabouts
10492 'csh') val="$undef" ;;
10493 *) val="$define" ;;
10497 : Respect a hint or command line value for full_csh.
10498 case "$full_csh" in
10499 '') full_csh=$csh ;;
10502 : see if ctermid_r exists
10503 set ctermid_r d_ctermid_r
10505 case "$d_ctermid_r" in
10507 hdrs="$i_systypes sys/types.h define stdio.h "
10508 case "$d_ctermid_r_proto:$usethreads" in
10509 ":define") d_ctermid_r_proto=define
10510 set d_ctermid_r_proto ctermid_r $hdrs
10514 case "$d_ctermid_r_proto" in
10516 case "$ctermid_r_proto" in
10517 ''|0) try='char* ctermid_r(char*);'
10518 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10520 case "$ctermid_r_proto" in
10521 ''|0) d_ctermid_r=undef
10523 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10524 * ) case "$ctermid_r_proto" in
10525 REENTRANT_PROTO*) ;;
10526 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10528 echo "Prototype: $try" ;;
10531 *) case "$usethreads" in
10532 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10539 *) ctermid_r_proto=0
10543 : see if ctime_r exists
10544 set ctime_r d_ctime_r
10546 case "$d_ctime_r" in
10548 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10549 case "$d_ctime_r_proto:$usethreads" in
10550 ":define") d_ctime_r_proto=define
10551 set d_ctime_r_proto ctime_r $hdrs
10555 case "$d_ctime_r_proto" in
10557 case "$ctime_r_proto" in
10558 ''|0) try='char* ctime_r(const time_t*, char*);'
10559 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10561 case "$ctime_r_proto" in
10562 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10563 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10565 case "$ctime_r_proto" in
10566 ''|0) try='int ctime_r(const time_t*, char*);'
10567 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10569 case "$ctime_r_proto" in
10570 ''|0) try='int ctime_r(const time_t*, char*, int);'
10571 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10573 case "$ctime_r_proto" in
10574 ''|0) d_ctime_r=undef
10576 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10577 * ) case "$ctime_r_proto" in
10578 REENTRANT_PROTO*) ;;
10579 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10581 echo "Prototype: $try" ;;
10584 *) case "$usethreads" in
10585 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10596 : see if cuserid exists
10597 set cuserid d_cuserid
10600 : see if this is a limits.h system
10601 set limits.h i_limits
10604 : see if this is a float.h system
10605 set float.h i_float
10608 : See if number of significant digits in a double precision number is known
10610 $cat >dbl_dig.c <<EOM
10611 #$i_limits I_LIMITS
10614 #include <limits.h>
10620 printf("Contains DBL_DIG");
10623 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10624 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10625 echo "DBL_DIG found." >&4
10628 echo "DBL_DIG NOT found." >&4
10635 : see if dbm.h is available
10636 : see if dbmclose exists
10637 set dbmclose d_dbmclose
10640 case "$d_dbmclose" in
10650 *) set rpcsvc/dbm.h i_rpcsvcdbm
10655 *) echo "We won't be including <dbm.h>"
10665 : see if prototype for dbminit is available
10667 set d_dbminitproto dbminit $i_dbm dbm.h
10670 : see if difftime exists
10671 set difftime d_difftime
10674 : see if this is a dirent system
10676 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10678 echo "<dirent.h> found." >&4
10681 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10682 echo "<sys/dir.h> found." >&4
10685 xinc=`./findhdr sys/ndir.h`
10687 echo "<dirent.h> NOT found." >&4
10692 : Look for type of directory structure.
10694 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10696 case "$direntrytype" in
10698 case "$i_dirent" in
10699 $define) guess1='struct dirent' ;;
10700 *) guess1='struct direct' ;;
10703 *) guess1="$direntrytype"
10708 'struct dirent') guess2='struct direct' ;;
10709 *) guess2='struct dirent' ;;
10712 if $contains "$guess1" try.c >/dev/null 2>&1; then
10713 direntrytype="$guess1"
10714 echo "Your directory entries are $direntrytype." >&4
10715 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10716 direntrytype="$guess2"
10717 echo "Your directory entries seem to be $direntrytype." >&4
10719 echo "I don't recognize your system's directory entries." >&4
10720 rp="What type is used for directory entries on this system?"
10723 direntrytype="$ans"
10728 : see if the directory entry stores field length
10730 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10731 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10732 echo "Good, your directory entry keeps length information in d_namlen." >&4
10735 echo "Your directory entry does not know about the d_namlen field." >&4
10742 : see if this is an sysdir system
10743 set sys/dir.h i_sysdir
10746 : see if this is an sysndir system
10747 set sys/ndir.h i_sysndir
10752 $cat >dirfd.c <<EOM
10754 #$i_dirent I_DIRENT /**/
10755 #$i_sysdir I_SYS_DIR /**/
10756 #$i_sysndir I_SYS_NDIR /**/
10757 #$i_systypes I_SYS_TYPES /**/
10758 #if defined(I_SYS_TYPES)
10759 #include <sys/types.h>
10761 #if defined(I_DIRENT)
10762 #include <dirent.h>
10763 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10764 #include <sys/dir.h>
10768 #include <sys/ndir.h>
10772 #include <ndir.h> /* may be wrong in the future */
10774 #include <sys/dir.h>
10780 DIR *dirp = opendir(".");
10781 if (dirfd(dirp) >= 0)
10788 if eval $compile; then
10792 $define) echo "dirfd() found." >&4 ;;
10793 *) echo "dirfd() NOT found." >&4 ;;
10799 : see if dlerror exists
10802 set dlerror d_dlerror
10806 : see if dlfcn is available
10807 set dlfcn.h i_dlfcn
10814 On a few systems, the dynamically loaded modules that perl generates and uses
10815 will need a different extension than shared libs. The default will probably
10821 *) dflt="$dlext" ;;
10823 rp='What is the extension of dynamically loaded modules'
10832 : Check if dlsym need a leading underscore
10838 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10839 $cat >dyna.c <<'EOM'
10848 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10850 #include <sys/types.h>
10855 extern int fred() ;
10864 int mode = RTLD_LAZY ;
10866 handle = dlopen("./dyna.$dlext", mode) ;
10867 if (handle == NULL) {
10872 symbol = dlsym(handle, "fred") ;
10873 if (symbol == NULL) {
10874 /* try putting a leading underscore */
10875 symbol = dlsym(handle, "_fred") ;
10876 if (symbol == NULL) {
10889 : Call the object file tmp-dyna.o in case dlext=o.
10890 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10891 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10892 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10893 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10896 1) echo "Test program failed using dlopen." >&4
10897 echo "Perhaps you should not use dynamic loading." >&4;;
10898 2) echo "Test program failed using dlsym." >&4
10899 echo "Perhaps you should not use dynamic loading." >&4;;
10900 3) echo "dlsym needs a leading underscore" >&4
10902 4) echo "dlsym doesn't need a leading underscore." >&4;;
10905 echo "I can't compile and run the test program." >&4
10906 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10911 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10916 : see if drand48_r exists
10917 set drand48_r d_drand48_r
10919 case "$d_drand48_r" in
10921 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10922 case "$d_drand48_r_proto:$usethreads" in
10923 ":define") d_drand48_r_proto=define
10924 set d_drand48_r_proto drand48_r $hdrs
10928 case "$d_drand48_r_proto" in
10930 case "$drand48_r_proto" in
10931 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10932 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10934 case "$drand48_r_proto" in
10935 ''|0) d_drand48_r=undef
10937 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10938 * ) case "$drand48_r_proto" in
10939 REENTRANT_PROTO*) ;;
10940 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10942 echo "Prototype: $try" ;;
10945 *) case "$usethreads" in
10946 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10953 *) drand48_r_proto=0
10957 : see if prototype for drand48 is available
10959 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10962 : see if dup2 exists
10966 : see if eaccess exists
10967 set eaccess d_eaccess
10970 : see if endgrent exists
10971 set endgrent d_endgrent
10974 : see if this is an grp system
10980 xxx=`./findhdr grp.h`
10981 $cppstdin $cppflags $cppminus < $xxx >$$.h
10983 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10995 set d_grpasswd; eval $setvar
10999 : see if endgrent_r exists
11000 set endgrent_r d_endgrent_r
11002 case "$d_endgrent_r" in
11004 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11005 case "$d_endgrent_r_proto:$usethreads" in
11006 ":define") d_endgrent_r_proto=define
11007 set d_endgrent_r_proto endgrent_r $hdrs
11011 case "$d_endgrent_r_proto" in
11013 case "$endgrent_r_proto" in
11014 ''|0) try='int endgrent_r(FILE**);'
11015 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11017 case "$endgrent_r_proto" in
11018 ''|0) try='void endgrent_r(FILE**);'
11019 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11021 case "$endgrent_r_proto" in
11022 ''|0) d_endgrent_r=undef
11024 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11025 * ) case "$endgrent_r_proto" in
11026 REENTRANT_PROTO*) ;;
11027 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11029 echo "Prototype: $try" ;;
11032 *) case "$usethreads" in
11033 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11040 *) endgrent_r_proto=0
11044 : see if endhostent exists
11045 set endhostent d_endhent
11048 : see if this is a netdb.h system
11049 set netdb.h i_netdb
11052 : see if endhostent_r exists
11053 set endhostent_r d_endhostent_r
11055 case "$d_endhostent_r" in
11057 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11058 case "$d_endhostent_r_proto:$usethreads" in
11059 ":define") d_endhostent_r_proto=define
11060 set d_endhostent_r_proto endhostent_r $hdrs
11064 case "$d_endhostent_r_proto" in
11066 case "$endhostent_r_proto" in
11067 ''|0) try='int endhostent_r(struct hostent_data*);'
11068 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11070 case "$endhostent_r_proto" in
11071 ''|0) try='void endhostent_r(struct hostent_data*);'
11072 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11074 case "$endhostent_r_proto" in
11075 ''|0) d_endhostent_r=undef
11076 endhostent_r_proto=0
11077 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11078 * ) case "$endhostent_r_proto" in
11079 REENTRANT_PROTO*) ;;
11080 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11082 echo "Prototype: $try" ;;
11085 *) case "$usethreads" in
11086 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11088 d_endhostent_r=undef
11089 endhostent_r_proto=0
11093 *) endhostent_r_proto=0
11097 : see if endnetent exists
11098 set endnetent d_endnent
11101 : see if endnetent_r exists
11102 set endnetent_r d_endnetent_r
11104 case "$d_endnetent_r" in
11106 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11107 case "$d_endnetent_r_proto:$usethreads" in
11108 ":define") d_endnetent_r_proto=define
11109 set d_endnetent_r_proto endnetent_r $hdrs
11113 case "$d_endnetent_r_proto" in
11115 case "$endnetent_r_proto" in
11116 ''|0) try='int endnetent_r(struct netent_data*);'
11117 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11119 case "$endnetent_r_proto" in
11120 ''|0) try='void endnetent_r(struct netent_data*);'
11121 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11123 case "$endnetent_r_proto" in
11124 ''|0) d_endnetent_r=undef
11125 endnetent_r_proto=0
11126 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11127 * ) case "$endnetent_r_proto" in
11128 REENTRANT_PROTO*) ;;
11129 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11131 echo "Prototype: $try" ;;
11134 *) case "$usethreads" in
11135 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11137 d_endnetent_r=undef
11138 endnetent_r_proto=0
11142 *) endnetent_r_proto=0
11146 : see if endprotoent exists
11147 set endprotoent d_endpent
11150 : see if endprotoent_r exists
11151 set endprotoent_r d_endprotoent_r
11153 case "$d_endprotoent_r" in
11155 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11156 case "$d_endprotoent_r_proto:$usethreads" in
11157 ":define") d_endprotoent_r_proto=define
11158 set d_endprotoent_r_proto endprotoent_r $hdrs
11162 case "$d_endprotoent_r_proto" in
11164 case "$endprotoent_r_proto" in
11165 ''|0) try='int endprotoent_r(struct protoent_data*);'
11166 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11168 case "$endprotoent_r_proto" in
11169 ''|0) try='void endprotoent_r(struct protoent_data*);'
11170 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11172 case "$endprotoent_r_proto" in
11173 ''|0) d_endprotoent_r=undef
11174 endprotoent_r_proto=0
11175 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11176 * ) case "$endprotoent_r_proto" in
11177 REENTRANT_PROTO*) ;;
11178 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11180 echo "Prototype: $try" ;;
11183 *) case "$usethreads" in
11184 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11186 d_endprotoent_r=undef
11187 endprotoent_r_proto=0
11191 *) endprotoent_r_proto=0
11195 : see if endpwent exists
11196 set endpwent d_endpwent
11199 : see if this is a pwd.h system
11205 xxx=`./findhdr pwd.h`
11206 $cppstdin $cppflags $cppminus < $xxx >$$.h
11208 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11216 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11224 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11232 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11240 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11248 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11256 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11264 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11276 set d_pwquota; eval $setvar
11277 set d_pwage; eval $setvar
11278 set d_pwchange; eval $setvar
11279 set d_pwclass; eval $setvar
11280 set d_pwexpire; eval $setvar
11281 set d_pwcomment; eval $setvar
11282 set d_pwgecos; eval $setvar
11283 set d_pwpasswd; eval $setvar
11287 : see if endpwent_r exists
11288 set endpwent_r d_endpwent_r
11290 case "$d_endpwent_r" in
11292 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11293 case "$d_endpwent_r_proto:$usethreads" in
11294 ":define") d_endpwent_r_proto=define
11295 set d_endpwent_r_proto endpwent_r $hdrs
11299 case "$d_endpwent_r_proto" in
11301 case "$endpwent_r_proto" in
11302 ''|0) try='int endpwent_r(FILE**);'
11303 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11305 case "$endpwent_r_proto" in
11306 ''|0) try='void endpwent_r(FILE**);'
11307 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11309 case "$endpwent_r_proto" in
11310 ''|0) d_endpwent_r=undef
11312 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11313 * ) case "$endpwent_r_proto" in
11314 REENTRANT_PROTO*) ;;
11315 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11317 echo "Prototype: $try" ;;
11320 *) case "$usethreads" in
11321 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11328 *) endpwent_r_proto=0
11332 : see if endservent exists
11333 set endservent d_endsent
11336 : see if endservent_r exists
11337 set endservent_r d_endservent_r
11339 case "$d_endservent_r" in
11341 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11342 case "$d_endservent_r_proto:$usethreads" in
11343 ":define") d_endservent_r_proto=define
11344 set d_endservent_r_proto endservent_r $hdrs
11348 case "$d_endservent_r_proto" in
11350 case "$endservent_r_proto" in
11351 ''|0) try='int endservent_r(struct servent_data*);'
11352 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11354 case "$endservent_r_proto" in
11355 ''|0) try='void endservent_r(struct servent_data*);'
11356 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11358 case "$endservent_r_proto" in
11359 ''|0) d_endservent_r=undef
11360 endservent_r_proto=0
11361 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11362 * ) case "$endservent_r_proto" in
11363 REENTRANT_PROTO*) ;;
11364 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11366 echo "Prototype: $try" ;;
11369 *) case "$usethreads" in
11370 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11372 d_endservent_r=undef
11373 endservent_r_proto=0
11377 *) endservent_r_proto=0
11381 : Locate the flags for 'open()'
11383 $cat >try.c <<'EOCP'
11384 #include <sys/types.h>
11389 #include <sys/file.h>
11400 : check sys/file.h first to get FREAD on Sun
11401 if $test `./findhdr sys/file.h` && \
11402 set try -DI_SYS_FILE && eval $compile; then
11404 echo "<sys/file.h> defines the O_* constants..." >&4
11405 if $run ./try; then
11406 echo "and you have the 3 argument form of open()." >&4
11409 echo "but not the 3 argument form of open(). Oh, well." >&4
11412 elif $test `./findhdr fcntl.h` && \
11413 set try -DI_FCNTL && eval $compile; then
11415 echo "<fcntl.h> defines the O_* constants..." >&4
11416 if $run ./try; then
11417 echo "and you have the 3 argument form of open()." >&4
11420 echo "but not the 3 argument form of open(). Oh, well." >&4
11425 echo "I can't find the O_* constant definitions! You got problems." >&4
11431 : see which of string.h or strings.h is needed
11433 strings=`./findhdr string.h`
11434 if $test "$strings" && $test -r "$strings"; then
11435 echo "Using <string.h> instead of <strings.h>." >&4
11439 strings=`./findhdr strings.h`
11440 if $test "$strings" && $test -r "$strings"; then
11441 echo "Using <strings.h> instead of <string.h>." >&4
11443 echo "No string header found -- You'll surely have problems." >&4
11448 case "$i_string" in
11449 "$undef") strings=`./findhdr strings.h`;;
11450 *) strings=`./findhdr string.h`;;
11453 : see if this is a sys/file.h system
11458 : do we need to include sys/file.h ?
11462 if $h_sysfile; then
11464 echo "We'll be including <sys/file.h>." >&4
11467 echo "We won't be including <sys/file.h>." >&4
11477 : see if fcntl.h is there
11482 : see if we can include fcntl.h
11488 echo "We'll be including <fcntl.h>." >&4
11491 if $h_sysfile; then
11492 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11494 echo "We won't be including <fcntl.h>." >&4
11506 : check for non-blocking I/O stuff
11507 case "$h_sysfile" in
11508 true) echo "#include <sys/file.h>" > head.c;;
11511 true) echo "#include <fcntl.h>" > head.c;;
11512 *) echo "#include <sys/fcntl.h>" > head.c;;
11517 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11518 case "$o_nonblock" in
11520 $cat head.c > try.c
11521 $cat >>try.c <<EOCP
11523 #include <stdlib.h>
11530 printf("O_NONBLOCK\n");
11534 printf("O_NDELAY\n");
11538 printf("FNDELAY\n");
11545 if eval $compile_ok; then
11546 o_nonblock=`$run ./try`
11547 case "$o_nonblock" in
11548 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11549 *) echo "Seems like we can use $o_nonblock.";;
11552 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11555 *) echo "Using $hint value $o_nonblock.";;
11557 $rm -f try try.* .out core
11560 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11563 $cat head.c > try.c
11564 $cat >>try.c <<EOCP
11566 #include <sys/types.h>
11567 #include <signal.h>
11569 #include <stdlib.h>
11574 #define MY_O_NONBLOCK $o_nonblock
11575 #ifndef errno /* XXX need better Configure test */
11578 #$i_unistd I_UNISTD
11580 #include <unistd.h>
11582 #$i_string I_STRING
11584 #include <string.h>
11586 #include <strings.h>
11588 $signal_t blech(x) int x; { exit(3); }
11590 $cat >> try.c <<'EOCP'
11598 pipe(pd); /* Down: child -> parent */
11599 pipe(pu); /* Up: parent -> child */
11602 close(pd[1]); /* Parent reads from pd[0] */
11603 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11605 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11610 signal(SIGALRM, blech);
11612 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11614 sprintf(string, "%d\n", ret);
11615 write(2, string, strlen(string));
11618 if (errno == EAGAIN) {
11619 printf("EAGAIN\n");
11624 if (errno == EWOULDBLOCK)
11625 printf("EWOULDBLOCK\n");
11628 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11629 sleep(2); /* Give it time to close our pipe */
11631 ret = read(pd[0], buf, 1); /* Should read EOF */
11633 sprintf(string, "%d\n", ret);
11634 write(4, string, strlen(string));
11638 close(pd[0]); /* We write to pd[1] */
11639 close(pu[1]); /* We read from pu[0] */
11640 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11641 close(pd[1]); /* Pipe pd is now fully closed! */
11642 exit(0); /* Bye bye, thank you for playing! */
11646 if eval $compile_ok; then
11647 echo "$startsh" >mtry
11648 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11650 ./mtry >/dev/null 2>&1
11652 0) eagain=`$cat try.out`;;
11653 1) echo "Could not perform non-blocking setting!";;
11654 2) echo "I did a successful read() for something that was not there!";;
11655 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11656 4) echo "Could not find F_SETFL!";;
11657 *) echo "Something terribly wrong happened during testing.";;
11659 rd_nodata=`$cat try.ret`
11660 echo "A read() system call with no data present returns $rd_nodata."
11661 case "$rd_nodata" in
11664 echo "(That's peculiar, fixing that to be -1.)"
11670 echo "Forcing errno EAGAIN on read() with no data available."
11674 echo "Your read() sets errno to $eagain when no data is available."
11677 status=`$cat try.err`
11679 0) echo "And it correctly returns 0 to signal EOF.";;
11680 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11681 *) echo "However, your read() returns '$status' on EOF??";;
11684 if test "$status" = "$rd_nodata"; then
11685 echo "WARNING: you can't distinguish between EOF and no data!"
11689 echo "I can't compile the test program--assuming errno EAGAIN will do."
11696 echo "Using $hint value $eagain."
11697 echo "Your read() returns $rd_nodata when no data is present."
11698 case "$d_eofnblk" in
11699 "$define") echo "And you can see EOF because read() returns 0.";;
11700 "$undef") echo "But you can't see EOF status from read() returned value.";;
11702 echo "(Assuming you can't see EOF status from read anyway.)"
11708 $rm -f try try.* .out core head.c mtry
11710 : see if fchdir exists
11711 set fchdir d_fchdir
11714 : see if fchmod exists
11715 set fchmod d_fchmod
11718 : see if fchown exists
11719 set fchown d_fchown
11722 : see if this is an fcntl system
11727 : See if fcntl-based locking works.
11729 #include <stdlib.h>
11730 #include <unistd.h>
11732 #include <signal.h>
11733 $signal_t blech(x) int x; { exit(3); }
11735 #if defined(F_SETLK) && defined(F_SETLKW)
11736 struct flock flock;
11738 fd = open("try.c", O_RDONLY);
11739 flock.l_type = F_RDLCK;
11740 flock.l_whence = SEEK_SET;
11741 flock.l_start = flock.l_len = 0;
11742 signal(SIGALRM, blech);
11744 retval = fcntl(fd, F_SETLK, &flock);
11746 (retval < 0 ? exit(2) : exit(0));
11752 echo "Checking if fcntl-based file locking works... "
11756 if eval $compile_ok; then
11757 if $run ./try; then
11758 echo "Yes, it seems to work."
11761 echo "Nope, it didn't work."
11766 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11767 *** This is (almost) impossible.
11768 *** If your NFS lock daemons are not feeling well, something like
11769 *** this may happen, please investigate. Cannot continue, aborting.
11777 echo "I'm unable to compile the test program, so I'll assume not."
11782 echo "Nope, since you don't even have fcntl()."
11785 set d_fcntl_can_lock
11790 : check for fd_set items
11793 Checking to see how well your C compiler handles fd_set and friends ...
11796 #$i_systime I_SYS_TIME
11797 #$i_sysselct I_SYS_SELECT
11798 #$d_socket HAS_SOCKET
11799 #include <sys/types.h>
11801 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11804 #include <sys/time.h>
11806 #ifdef I_SYS_SELECT
11807 #include <sys/select.h>
11816 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11824 if eval $compile; then
11825 d_fds_bits="$define"
11827 echo "Well, your system knows about the normal fd_set typedef..." >&4
11828 if $run ./try; then
11829 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11830 d_fd_macros="$define"
11833 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11835 d_fd_macros="$undef"
11839 Hmm, your compiler has some difficulty with fd_set. Checking further...
11842 if eval $compile; then
11843 d_fds_bits="$undef"
11845 echo "Well, your system has some sort of fd_set available..." >&4
11846 if $run ./try; then
11847 echo "and you have the normal fd_set macros." >&4
11848 d_fd_macros="$define"
11851 but not the normal fd_set macros! Gross! More work for me...
11853 d_fd_macros="$undef"
11856 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11858 d_fds_bits="$undef"
11859 d_fd_macros="$undef"
11864 : see if fgetpos exists
11865 set fgetpos d_fgetpos
11868 : see if finite exists
11869 set finite d_finite
11872 : see if finitel exists
11873 set finitel d_finitel
11876 : see if flock exists
11880 : see if prototype for flock is available
11882 set d_flockproto flock $i_sysfile sys/file.h
11885 : see if fork exists
11889 : see if fp_class exists
11890 set fp_class d_fp_class
11893 : see if pathconf exists
11894 set pathconf d_pathconf
11897 : see if fpathconf exists
11898 set fpathconf d_fpathconf
11901 : see if fpclass exists
11902 set fpclass d_fpclass
11905 : see if fpclassify exists
11906 set fpclassify d_fpclassify
11909 : see if fpclassl exists
11910 set fpclassl d_fpclassl
11914 : check for fpos64_t
11916 echo "Checking to see if you have fpos64_t..." >&4
11919 int main() { fpos64_t x = 7; }
11922 if eval $compile; then
11924 echo "You have fpos64_t."
11927 echo "You do not have fpos64_t."
11928 case "$fpossize" in
11929 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11936 : see if frexpl exists
11937 set frexpl d_frexpl
11940 : see if this is a sys/param system
11941 set sys/param.h i_sysparam
11944 : see if this is a sys/mount.h system
11945 set sys/mount.h i_sysmount
11950 echo "Checking to see if your system supports struct fs_data..." >&4
11951 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11953 case "$d_fs_data_s" in
11954 "$define") echo "Yes, it does." ;;
11955 *) echo "No, it doesn't." ;;
11958 : see if fseeko exists
11959 set fseeko d_fseeko
11961 case "$longsize" in
11962 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11965 : see if fsetpos exists
11966 set fsetpos d_fsetpos
11970 : see if fstatfs exists
11971 set fstatfs d_fstatfs
11975 : see if statvfs exists
11976 set statvfs d_statvfs
11979 : see if fstatvfs exists
11980 set fstatvfs d_fstatvfs
11984 : see if fsync exists
11988 : see if ftello exists
11989 set ftello d_ftello
11991 case "$longsize" in
11992 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11995 : see if getcwd exists
11996 set getcwd d_getcwd
11999 : see if getespwnam exists
12000 set getespwnam d_getespwnam
12004 : see if getfsstat exists
12005 set getfsstat d_getfsstat
12008 : see if getgrent exists
12009 set getgrent d_getgrent
12012 : see if getgrent_r exists
12013 set getgrent_r d_getgrent_r
12015 case "$d_getgrent_r" in
12017 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12018 case "$d_getgrent_r_proto:$usethreads" in
12019 ":define") d_getgrent_r_proto=define
12020 set d_getgrent_r_proto getgrent_r $hdrs
12024 case "$d_getgrent_r_proto" in
12026 case "$getgrent_r_proto" in
12027 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12028 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12030 case "$getgrent_r_proto" in
12031 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12032 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12034 case "$getgrent_r_proto" in
12035 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12036 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12038 case "$getgrent_r_proto" in
12039 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12040 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12042 case "$getgrent_r_proto" in
12043 ''|0) try='int getgrent_r(struct group*, char*, int);'
12044 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12046 case "$getgrent_r_proto" in
12047 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12048 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12050 case "$getgrent_r_proto" in
12051 ''|0) d_getgrent_r=undef
12053 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12054 * ) case "$getgrent_r_proto" in
12055 REENTRANT_PROTO*) ;;
12056 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12058 echo "Prototype: $try" ;;
12061 *) case "$usethreads" in
12062 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12069 *) getgrent_r_proto=0
12073 : see if getgrgid_r exists
12074 set getgrgid_r d_getgrgid_r
12076 case "$d_getgrgid_r" in
12078 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12079 case "$d_getgrgid_r_proto:$usethreads" in
12080 ":define") d_getgrgid_r_proto=define
12081 set d_getgrgid_r_proto getgrgid_r $hdrs
12085 case "$d_getgrgid_r_proto" in
12087 case "$getgrgid_r_proto" in
12088 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12089 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12091 case "$getgrgid_r_proto" in
12092 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12093 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12095 case "$getgrgid_r_proto" in
12096 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12097 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12099 case "$getgrgid_r_proto" in
12100 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12101 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12103 case "$getgrgid_r_proto" in
12104 ''|0) d_getgrgid_r=undef
12106 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12107 * ) case "$getgrgid_r_proto" in
12108 REENTRANT_PROTO*) ;;
12109 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12111 echo "Prototype: $try" ;;
12114 *) case "$usethreads" in
12115 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12122 *) getgrgid_r_proto=0
12126 : see if getgrnam_r exists
12127 set getgrnam_r d_getgrnam_r
12129 case "$d_getgrnam_r" in
12131 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12132 case "$d_getgrnam_r_proto:$usethreads" in
12133 ":define") d_getgrnam_r_proto=define
12134 set d_getgrnam_r_proto getgrnam_r $hdrs
12138 case "$d_getgrnam_r_proto" in
12140 case "$getgrnam_r_proto" in
12141 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12142 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12144 case "$getgrnam_r_proto" in
12145 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12146 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12148 case "$getgrnam_r_proto" in
12149 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12150 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12152 case "$getgrnam_r_proto" in
12153 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12154 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12156 case "$getgrnam_r_proto" in
12157 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12158 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12160 case "$getgrnam_r_proto" in
12161 ''|0) d_getgrnam_r=undef
12163 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12164 * ) case "$getgrnam_r_proto" in
12165 REENTRANT_PROTO*) ;;
12166 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12168 echo "Prototype: $try" ;;
12171 *) case "$usethreads" in
12172 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12179 *) getgrnam_r_proto=0
12183 : see if gethostbyaddr exists
12184 set gethostbyaddr d_gethbyaddr
12187 : see if gethostbyname exists
12188 set gethostbyname d_gethbyname
12191 : see if gethostent exists
12192 set gethostent d_gethent
12195 : see how we will look up host name
12198 if set gethostname val -f d_gethname; eval $csym; $val; then
12199 echo 'gethostname() found.' >&4
12200 d_gethname="$define"
12203 if set uname val -f d_uname; eval $csym; $val; then
12206 uname() was found, but you're running xenix, and older versions of xenix
12207 have a broken uname(). If you don't really know whether your xenix is old
12208 enough to have a broken system call, use the default answer.
12213 "$define") dflt=n;;
12215 rp='Is your uname() broken?'
12218 n*) d_uname="$define"; call=uname;;
12221 echo 'uname() found.' >&4
12228 case "$d_gethname" in
12229 '') d_gethname="$undef";;
12232 '') d_uname="$undef";;
12234 case "$d_uname$d_gethname" in
12239 Every now and then someone has a $call() that lies about the hostname
12240 but can't be fixed for political or economic reasons. If you wish, I can
12241 pretend $call() isn't there and maybe compute hostname at run-time
12242 thanks to the '$phostname' command.
12245 rp="Shall I ignore $call() from now on?"
12248 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12251 case "$phostname" in
12252 '') aphostname='';;
12253 *) case "$aphostname" in
12255 *) set X $phostname
12259 file=`./loc $file $file $pth`
12260 aphostname=`echo $file $*`
12265 case "$d_uname$d_gethname" in
12268 case "$phostname" in
12270 echo "There will be no way for $package to get your hostname." >&4;;
12272 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12276 case "$d_phostname" in
12277 '') d_phostname="$undef";;
12280 : see if gethostbyaddr_r exists
12281 set gethostbyaddr_r d_gethostbyaddr_r
12283 case "$d_gethostbyaddr_r" in
12285 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12286 case "$d_gethostbyaddr_r_proto:$usethreads" in
12287 ":define") d_gethostbyaddr_r_proto=define
12288 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12292 case "$d_gethostbyaddr_r_proto" in
12294 case "$gethostbyaddr_r_proto" in
12295 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12296 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12298 case "$gethostbyaddr_r_proto" in
12299 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12300 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12302 case "$gethostbyaddr_r_proto" in
12303 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12304 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12306 case "$gethostbyaddr_r_proto" in
12307 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12308 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12310 case "$gethostbyaddr_r_proto" in
12311 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12312 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12314 case "$gethostbyaddr_r_proto" in
12315 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12316 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12318 case "$gethostbyaddr_r_proto" in
12319 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12320 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12322 case "$gethostbyaddr_r_proto" in
12323 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12324 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12326 case "$gethostbyaddr_r_proto" in
12327 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12328 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12330 case "$gethostbyaddr_r_proto" in
12331 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12332 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12334 case "$gethostbyaddr_r_proto" in
12335 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12336 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12338 case "$gethostbyaddr_r_proto" in
12339 ''|0) d_gethostbyaddr_r=undef
12340 gethostbyaddr_r_proto=0
12341 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12342 * ) case "$gethostbyaddr_r_proto" in
12343 REENTRANT_PROTO*) ;;
12344 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12346 echo "Prototype: $try" ;;
12349 *) case "$usethreads" in
12350 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12352 d_gethostbyaddr_r=undef
12353 gethostbyaddr_r_proto=0
12357 *) gethostbyaddr_r_proto=0
12361 : see if gethostbyname_r exists
12362 set gethostbyname_r d_gethostbyname_r
12364 case "$d_gethostbyname_r" in
12366 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12367 case "$d_gethostbyname_r_proto:$usethreads" in
12368 ":define") d_gethostbyname_r_proto=define
12369 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12373 case "$d_gethostbyname_r_proto" in
12375 case "$gethostbyname_r_proto" in
12376 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12377 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12379 case "$gethostbyname_r_proto" in
12380 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12381 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12383 case "$gethostbyname_r_proto" in
12384 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12385 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12387 case "$gethostbyname_r_proto" in
12388 ''|0) d_gethostbyname_r=undef
12389 gethostbyname_r_proto=0
12390 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12391 * ) case "$gethostbyname_r_proto" in
12392 REENTRANT_PROTO*) ;;
12393 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12395 echo "Prototype: $try" ;;
12398 *) case "$usethreads" in
12399 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12401 d_gethostbyname_r=undef
12402 gethostbyname_r_proto=0
12406 *) gethostbyname_r_proto=0
12410 : see if gethostent_r exists
12411 set gethostent_r d_gethostent_r
12413 case "$d_gethostent_r" in
12415 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12416 case "$d_gethostent_r_proto:$usethreads" in
12417 ":define") d_gethostent_r_proto=define
12418 set d_gethostent_r_proto gethostent_r $hdrs
12422 case "$d_gethostent_r_proto" in
12424 case "$gethostent_r_proto" in
12425 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12426 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12428 case "$gethostent_r_proto" in
12429 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12430 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12432 case "$gethostent_r_proto" in
12433 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12434 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12436 case "$gethostent_r_proto" in
12437 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12438 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12440 case "$gethostent_r_proto" in
12441 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12442 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12444 case "$gethostent_r_proto" in
12445 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
12446 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
12448 case "$gethostent_r_proto" in
12449 ''|0) d_gethostent_r=undef
12450 gethostent_r_proto=0
12451 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
12452 * ) case "$gethostent_r_proto" in
12453 REENTRANT_PROTO*) ;;
12454 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
12456 echo "Prototype: $try" ;;
12459 *) case "$usethreads" in
12460 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
12462 d_gethostent_r=undef
12463 gethostent_r_proto=0
12467 *) gethostent_r_proto=0
12471 : see if prototypes for various gethostxxx netdb.h functions are available
12473 set d_gethostprotos gethostent $i_netdb netdb.h
12476 : see if getitimer exists
12477 set getitimer d_getitimer
12480 : see if getlogin exists
12481 set getlogin d_getlogin
12484 : see if getlogin_r exists
12485 set getlogin_r d_getlogin_r
12487 case "$d_getlogin_r" in
12489 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
12490 case "$d_getlogin_r_proto:$usethreads" in
12491 ":define") d_getlogin_r_proto=define
12492 set d_getlogin_r_proto getlogin_r $hdrs
12496 case "$d_getlogin_r_proto" in
12498 case "$getlogin_r_proto" in
12499 ''|0) try='int getlogin_r(char*, size_t);'
12500 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
12502 case "$getlogin_r_proto" in
12503 ''|0) try='int getlogin_r(char*, int);'
12504 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12506 case "$getlogin_r_proto" in
12507 ''|0) try='char* getlogin_r(char*, size_t);'
12508 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12510 case "$getlogin_r_proto" in
12511 ''|0) try='char* getlogin_r(char*, int);'
12512 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12514 case "$getlogin_r_proto" in
12515 ''|0) d_getlogin_r=undef
12517 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12518 * ) case "$getlogin_r_proto" in
12519 REENTRANT_PROTO*) ;;
12520 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12522 echo "Prototype: $try" ;;
12525 *) case "$usethreads" in
12526 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12533 *) getlogin_r_proto=0
12537 : see if getmnt exists
12538 set getmnt d_getmnt
12541 : see if getmntent exists
12542 set getmntent d_getmntent
12545 : see if getnetbyaddr exists
12546 set getnetbyaddr d_getnbyaddr
12549 : see if getnetbyname exists
12550 set getnetbyname d_getnbyname
12553 : see if getnetent exists
12554 set getnetent d_getnent
12557 : see if getnetbyaddr_r exists
12558 set getnetbyaddr_r d_getnetbyaddr_r
12560 case "$d_getnetbyaddr_r" in
12562 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12563 case "$d_getnetbyaddr_r_proto:$usethreads" in
12564 ":define") d_getnetbyaddr_r_proto=define
12565 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12569 case "$d_getnetbyaddr_r_proto" in
12571 case "$getnetbyaddr_r_proto" in
12572 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12573 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12575 case "$getnetbyaddr_r_proto" in
12576 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12577 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12579 case "$getnetbyaddr_r_proto" in
12580 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12581 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12583 case "$getnetbyaddr_r_proto" in
12584 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12585 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12587 case "$getnetbyaddr_r_proto" in
12588 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12589 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12591 case "$getnetbyaddr_r_proto" in
12592 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12593 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12595 case "$getnetbyaddr_r_proto" in
12596 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12597 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12599 case "$getnetbyaddr_r_proto" in
12600 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
12601 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
12603 case "$getnetbyaddr_r_proto" in
12604 ''|0) d_getnetbyaddr_r=undef
12605 getnetbyaddr_r_proto=0
12606 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12607 * ) case "$getnetbyaddr_r_proto" in
12608 REENTRANT_PROTO*) ;;
12609 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12611 echo "Prototype: $try" ;;
12614 *) case "$usethreads" in
12615 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12617 d_getnetbyaddr_r=undef
12618 getnetbyaddr_r_proto=0
12622 *) getnetbyaddr_r_proto=0
12626 : see if getnetbyname_r exists
12627 set getnetbyname_r d_getnetbyname_r
12629 case "$d_getnetbyname_r" in
12631 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12632 case "$d_getnetbyname_r_proto:$usethreads" in
12633 ":define") d_getnetbyname_r_proto=define
12634 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12638 case "$d_getnetbyname_r_proto" in
12640 case "$getnetbyname_r_proto" in
12641 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12642 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12644 case "$getnetbyname_r_proto" in
12645 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12646 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12648 case "$getnetbyname_r_proto" in
12649 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12650 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12652 case "$getnetbyname_r_proto" in
12653 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12654 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12656 case "$getnetbyname_r_proto" in
12657 ''|0) d_getnetbyname_r=undef
12658 getnetbyname_r_proto=0
12659 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12660 * ) case "$getnetbyname_r_proto" in
12661 REENTRANT_PROTO*) ;;
12662 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12664 echo "Prototype: $try" ;;
12667 *) case "$usethreads" in
12668 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12670 d_getnetbyname_r=undef
12671 getnetbyname_r_proto=0
12675 *) getnetbyname_r_proto=0
12679 : see if getnetent_r exists
12680 set getnetent_r d_getnetent_r
12682 case "$d_getnetent_r" in
12684 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12685 case "$d_getnetent_r_proto:$usethreads" in
12686 ":define") d_getnetent_r_proto=define
12687 set d_getnetent_r_proto getnetent_r $hdrs
12691 case "$d_getnetent_r_proto" in
12693 case "$getnetent_r_proto" in
12694 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12695 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12697 case "$getnetent_r_proto" in
12698 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12699 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12701 case "$getnetent_r_proto" in
12702 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12703 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12705 case "$getnetent_r_proto" in
12706 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12707 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12709 case "$getnetent_r_proto" in
12710 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12711 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12713 case "$getnetent_r_proto" in
12714 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12715 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12717 case "$getnetent_r_proto" in
12718 ''|0) d_getnetent_r=undef
12719 getnetent_r_proto=0
12720 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12721 * ) case "$getnetent_r_proto" in
12722 REENTRANT_PROTO*) ;;
12723 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12725 echo "Prototype: $try" ;;
12728 *) case "$usethreads" in
12729 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12731 d_getnetent_r=undef
12732 getnetent_r_proto=0
12736 *) getnetent_r_proto=0
12740 : see if prototypes for various getnetxxx netdb.h functions are available
12742 set d_getnetprotos getnetent $i_netdb netdb.h
12745 : see if getpagesize exists
12746 set getpagesize d_getpagsz
12750 : see if getprotobyname exists
12751 set getprotobyname d_getpbyname
12754 : see if getprotobynumber exists
12755 set getprotobynumber d_getpbynumber
12758 : see if getprotoent exists
12759 set getprotoent d_getpent
12762 : see if getpgid exists
12763 set getpgid d_getpgid
12766 : see if getpgrp2 exists
12767 set getpgrp2 d_getpgrp2
12770 : see if getppid exists
12771 set getppid d_getppid
12774 : see if getpriority exists
12775 set getpriority d_getprior
12778 : see if getprotobyname_r exists
12779 set getprotobyname_r d_getprotobyname_r
12781 case "$d_getprotobyname_r" in
12783 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12784 case "$d_getprotobyname_r_proto:$usethreads" in
12785 ":define") d_getprotobyname_r_proto=define
12786 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12790 case "$d_getprotobyname_r_proto" in
12792 case "$getprotobyname_r_proto" in
12793 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12794 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12796 case "$getprotobyname_r_proto" in
12797 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12798 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12800 case "$getprotobyname_r_proto" in
12801 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12802 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12804 case "$getprotobyname_r_proto" in
12805 ''|0) d_getprotobyname_r=undef
12806 getprotobyname_r_proto=0
12807 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12808 * ) case "$getprotobyname_r_proto" in
12809 REENTRANT_PROTO*) ;;
12810 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12812 echo "Prototype: $try" ;;
12815 *) case "$usethreads" in
12816 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12818 d_getprotobyname_r=undef
12819 getprotobyname_r_proto=0
12823 *) getprotobyname_r_proto=0
12827 : see if getprotobynumber_r exists
12828 set getprotobynumber_r d_getprotobynumber_r
12830 case "$d_getprotobynumber_r" in
12832 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12833 case "$d_getprotobynumber_r_proto:$usethreads" in
12834 ":define") d_getprotobynumber_r_proto=define
12835 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12839 case "$d_getprotobynumber_r_proto" in
12841 case "$getprotobynumber_r_proto" in
12842 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12843 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12845 case "$getprotobynumber_r_proto" in
12846 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12847 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12849 case "$getprotobynumber_r_proto" in
12850 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12851 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12853 case "$getprotobynumber_r_proto" in
12854 ''|0) d_getprotobynumber_r=undef
12855 getprotobynumber_r_proto=0
12856 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12857 * ) case "$getprotobynumber_r_proto" in
12858 REENTRANT_PROTO*) ;;
12859 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12861 echo "Prototype: $try" ;;
12864 *) case "$usethreads" in
12865 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12867 d_getprotobynumber_r=undef
12868 getprotobynumber_r_proto=0
12872 *) getprotobynumber_r_proto=0
12876 : see if getprotoent_r exists
12877 set getprotoent_r d_getprotoent_r
12879 case "$d_getprotoent_r" in
12881 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12882 case "$d_getprotoent_r_proto:$usethreads" in
12883 ":define") d_getprotoent_r_proto=define
12884 set d_getprotoent_r_proto getprotoent_r $hdrs
12888 case "$d_getprotoent_r_proto" in
12890 case "$getprotoent_r_proto" in
12891 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12892 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12894 case "$getprotoent_r_proto" in
12895 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12896 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12898 case "$getprotoent_r_proto" in
12899 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12900 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12902 case "$getprotoent_r_proto" in
12903 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12904 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12906 case "$getprotoent_r_proto" in
12907 ''|0) d_getprotoent_r=undef
12908 getprotoent_r_proto=0
12909 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12910 * ) case "$getprotoent_r_proto" in
12911 REENTRANT_PROTO*) ;;
12912 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12914 echo "Prototype: $try" ;;
12917 *) case "$usethreads" in
12918 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12920 d_getprotoent_r=undef
12921 getprotoent_r_proto=0
12925 *) getprotoent_r_proto=0
12929 : see if prototypes for various getprotoxxx netdb.h functions are available
12931 set d_getprotoprotos getprotoent $i_netdb netdb.h
12934 : see if getprpwnam exists
12935 set getprpwnam d_getprpwnam
12938 : see if getpwent exists
12939 set getpwent d_getpwent
12942 : see if getpwent_r exists
12943 set getpwent_r d_getpwent_r
12945 case "$d_getpwent_r" in
12947 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12948 case "$d_getpwent_r_proto:$usethreads" in
12949 ":define") d_getpwent_r_proto=define
12950 set d_getpwent_r_proto getpwent_r $hdrs
12954 case "$d_getpwent_r_proto" in
12956 case "$getpwent_r_proto" in
12957 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12958 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12960 case "$getpwent_r_proto" in
12961 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12962 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12964 case "$getpwent_r_proto" in
12965 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12966 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12968 case "$getpwent_r_proto" in
12969 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12970 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12972 case "$getpwent_r_proto" in
12973 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12974 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12976 case "$getpwent_r_proto" in
12977 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12978 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12980 case "$getpwent_r_proto" in
12981 ''|0) d_getpwent_r=undef
12983 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12984 * ) case "$getpwent_r_proto" in
12985 REENTRANT_PROTO*) ;;
12986 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12988 echo "Prototype: $try" ;;
12991 *) case "$usethreads" in
12992 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12999 *) getpwent_r_proto=0
13003 : see if getpwnam_r exists
13004 set getpwnam_r d_getpwnam_r
13006 case "$d_getpwnam_r" in
13008 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13009 case "$d_getpwnam_r_proto:$usethreads" in
13010 ":define") d_getpwnam_r_proto=define
13011 set d_getpwnam_r_proto getpwnam_r $hdrs
13015 case "$d_getpwnam_r_proto" in
13017 case "$getpwnam_r_proto" in
13018 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13019 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13021 case "$getpwnam_r_proto" in
13022 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13023 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13025 case "$getpwnam_r_proto" in
13026 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13027 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13029 case "$getpwnam_r_proto" in
13030 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13031 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13033 case "$getpwnam_r_proto" in
13034 ''|0) d_getpwnam_r=undef
13036 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13037 * ) case "$getpwnam_r_proto" in
13038 REENTRANT_PROTO*) ;;
13039 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13041 echo "Prototype: $try" ;;
13044 *) case "$usethreads" in
13045 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13052 *) getpwnam_r_proto=0
13056 : see if getpwuid_r exists
13057 set getpwuid_r d_getpwuid_r
13059 case "$d_getpwuid_r" in
13061 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13062 case "$d_getpwuid_r_proto:$usethreads" in
13063 ":define") d_getpwuid_r_proto=define
13064 set d_getpwuid_r_proto getpwuid_r $hdrs
13068 case "$d_getpwuid_r_proto" in
13070 case "$getpwuid_r_proto" in
13071 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13072 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13074 case "$getpwuid_r_proto" in
13075 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13076 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13078 case "$getpwuid_r_proto" in
13079 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13080 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13082 case "$getpwuid_r_proto" in
13083 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13084 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13086 case "$getpwuid_r_proto" in
13087 ''|0) d_getpwuid_r=undef
13089 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13090 * ) case "$getpwuid_r_proto" in
13091 REENTRANT_PROTO*) ;;
13092 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13094 echo "Prototype: $try" ;;
13097 *) case "$usethreads" in
13098 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13105 *) getpwuid_r_proto=0
13110 : see if getservbyname exists
13111 set getservbyname d_getsbyname
13114 : see if getservbyport exists
13115 set getservbyport d_getsbyport
13118 : see if getservent exists
13119 set getservent d_getsent
13122 : see if getservbyname_r exists
13123 set getservbyname_r d_getservbyname_r
13125 case "$d_getservbyname_r" in
13127 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13128 case "$d_getservbyname_r_proto:$usethreads" in
13129 ":define") d_getservbyname_r_proto=define
13130 set d_getservbyname_r_proto getservbyname_r $hdrs
13134 case "$d_getservbyname_r_proto" in
13136 case "$getservbyname_r_proto" in
13137 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13138 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13140 case "$getservbyname_r_proto" in
13141 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13142 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13144 case "$getservbyname_r_proto" in
13145 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13146 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13148 case "$getservbyname_r_proto" in
13149 ''|0) d_getservbyname_r=undef
13150 getservbyname_r_proto=0
13151 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13152 * ) case "$getservbyname_r_proto" in
13153 REENTRANT_PROTO*) ;;
13154 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13156 echo "Prototype: $try" ;;
13159 *) case "$usethreads" in
13160 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13162 d_getservbyname_r=undef
13163 getservbyname_r_proto=0
13167 *) getservbyname_r_proto=0
13171 : see if getservbyport_r exists
13172 set getservbyport_r d_getservbyport_r
13174 case "$d_getservbyport_r" in
13176 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13177 case "$d_getservbyport_r_proto:$usethreads" in
13178 ":define") d_getservbyport_r_proto=define
13179 set d_getservbyport_r_proto getservbyport_r $hdrs
13183 case "$d_getservbyport_r_proto" in
13185 case "$getservbyport_r_proto" in
13186 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13187 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13189 case "$getservbyport_r_proto" in
13190 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13191 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13193 case "$getservbyport_r_proto" in
13194 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13195 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13197 case "$getservbyport_r_proto" in
13198 ''|0) d_getservbyport_r=undef
13199 getservbyport_r_proto=0
13200 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13201 * ) case "$getservbyport_r_proto" in
13202 REENTRANT_PROTO*) ;;
13203 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13205 echo "Prototype: $try" ;;
13208 *) case "$usethreads" in
13209 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13211 d_getservbyport_r=undef
13212 getservbyport_r_proto=0
13216 *) getservbyport_r_proto=0
13220 : see if getservent_r exists
13221 set getservent_r d_getservent_r
13223 case "$d_getservent_r" in
13225 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13226 case "$d_getservent_r_proto:$usethreads" in
13227 ":define") d_getservent_r_proto=define
13228 set d_getservent_r_proto getservent_r $hdrs
13232 case "$d_getservent_r_proto" in
13234 case "$getservent_r_proto" in
13235 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13236 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13238 case "$getservent_r_proto" in
13239 ''|0) try='int getservent_r(struct servent*, char*, int);'
13240 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13242 case "$getservent_r_proto" in
13243 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13244 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13246 case "$getservent_r_proto" in
13247 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13248 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13250 case "$getservent_r_proto" in
13251 ''|0) d_getservent_r=undef
13252 getservent_r_proto=0
13253 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13254 * ) case "$getservent_r_proto" in
13255 REENTRANT_PROTO*) ;;
13256 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13258 echo "Prototype: $try" ;;
13261 *) case "$usethreads" in
13262 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13264 d_getservent_r=undef
13265 getservent_r_proto=0
13269 *) getservent_r_proto=0
13273 : see if prototypes for various getservxxx netdb.h functions are available
13275 set d_getservprotos getservent $i_netdb netdb.h
13278 : see if getspnam exists
13279 set getspnam d_getspnam
13282 : see if this is a shadow.h system
13283 set shadow.h i_shadow
13286 : see if getspnam_r exists
13287 set getspnam_r d_getspnam_r
13289 case "$d_getspnam_r" in
13291 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13292 case "$d_getspnam_r_proto:$usethreads" in
13293 ":define") d_getspnam_r_proto=define
13294 set d_getspnam_r_proto getspnam_r $hdrs
13298 case "$d_getspnam_r_proto" in
13300 case "$getspnam_r_proto" in
13301 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13302 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13304 case "$getspnam_r_proto" in
13305 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13306 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13308 case "$getspnam_r_proto" in
13309 ''|0) d_getspnam_r=undef
13311 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13312 * ) case "$getspnam_r_proto" in
13313 REENTRANT_PROTO*) ;;
13314 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13316 echo "Prototype: $try" ;;
13319 *) case "$usethreads" in
13320 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13327 *) getspnam_r_proto=0
13331 : see if gettimeofday or ftime exists
13332 set gettimeofday d_gettimeod
13334 case "$d_gettimeod" in
13340 val="$undef"; set d_ftime; eval $setvar
13343 case "$d_gettimeod$d_ftime" in
13346 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13350 : see if gmtime_r exists
13351 set gmtime_r d_gmtime_r
13353 case "$d_gmtime_r" in
13355 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13356 case "$d_gmtime_r_proto:$usethreads" in
13357 ":define") d_gmtime_r_proto=define
13358 set d_gmtime_r_proto gmtime_r $hdrs
13362 case "$d_gmtime_r_proto" in
13364 case "$gmtime_r_proto" in
13365 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13366 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13368 case "$gmtime_r_proto" in
13369 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13370 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13372 case "$gmtime_r_proto" in
13373 ''|0) d_gmtime_r=undef
13375 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13376 * ) case "$gmtime_r_proto" in
13377 REENTRANT_PROTO*) ;;
13378 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13380 echo "Prototype: $try" ;;
13383 *) case "$usethreads" in
13384 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13391 *) gmtime_r_proto=0
13395 : see if hasmntopt exists
13396 set hasmntopt d_hasmntopt
13399 : see if this is a netinet/in.h or sys/in.h system
13400 set netinet/in.h i_niin sys/in.h i_sysin
13403 : see if arpa/inet.h has to be included
13404 set arpa/inet.h i_arpainet
13407 : see if htonl --and friends-- exists
13412 : Maybe they are macros.
13415 $cat >htonl.c <<EOM
13417 #include <sys/types.h>
13418 #$i_niin I_NETINET_IN
13420 #$i_arpainet I_ARPA_INET
13421 #ifdef I_NETINET_IN
13422 #include <netinet/in.h>
13425 #include <sys/in.h>
13428 #include <arpa/inet.h>
13431 printf("Defined as a macro.");
13434 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13435 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13437 echo "But it seems to be defined as a macro." >&4
13447 if set index val -f; eval $csym; $val; then
13448 if set strchr val -f d_strchr; eval $csym; $val; then
13449 if $contains strchr "$strings" >/dev/null 2>&1 ; then
13452 echo "strchr() found." >&4
13456 echo "index() found." >&4
13461 echo "index() found." >&4
13464 if set strchr val -f d_strchr; eval $csym; $val; then
13467 echo "strchr() found." >&4
13469 echo "No index() or strchr() found!" >&4
13474 set d_strchr; eval $setvar
13476 set d_index; eval $setvar
13478 : check whether inet_aton exists
13479 set inet_aton d_inetaton
13484 $cat >isascii.c <<'EOCP'
13496 if eval $compile; then
13497 echo "isascii() found." >&4
13500 echo "isascii() NOT found." >&4
13507 : see if isfinite exists
13508 set isfinite d_isfinite
13511 : see if isinf exists
13515 : see if isnan exists
13519 : see if isnanl exists
13520 set isnanl d_isnanl
13523 : see if killpg exists
13524 set killpg d_killpg
13527 : see if lchown exists
13529 $cat > try.c <<'EOCP'
13530 /* System header to define __stub macros and hopefully few prototypes,
13531 which can conflict with char lchown(); below. */
13532 #include <assert.h>
13533 /* Override any gcc2 internal prototype to avoid an error. */
13534 /* We use char because int might match the return type of a gcc2
13535 builtin and then its argument prototype would still apply. */
13538 /* The GNU C library defines this for functions which it implements
13539 to always fail with ENOSYS. Some functions are actually named
13540 something starting with __ and the normal name is an alias. */
13541 #if defined (__stub_lchown) || defined (__stub___lchown)
13549 if eval $compile; then
13550 $echo "lchown() found." >&4
13553 $echo "lchown() NOT found." >&4
13559 : See if number of significant digits in a double precision number is known
13561 $cat >ldbl_dig.c <<EOM
13562 #$i_limits I_LIMITS
13565 #include <limits.h>
13571 printf("Contains LDBL_DIG");
13574 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13575 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13576 echo "LDBL_DIG found." >&4
13579 echo "LDBL_DIG NOT found." >&4
13586 : see if link exists
13590 : see if localtime_r exists
13591 set localtime_r d_localtime_r
13593 case "$d_localtime_r" in
13595 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13596 case "$d_localtime_r_proto:$usethreads" in
13597 ":define") d_localtime_r_proto=define
13598 set d_localtime_r_proto localtime_r $hdrs
13602 case "$d_localtime_r_proto" in
13604 case "$localtime_r_proto" in
13605 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13606 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13608 case "$localtime_r_proto" in
13609 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13610 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13612 case "$localtime_r_proto" in
13613 ''|0) d_localtime_r=undef
13614 localtime_r_proto=0
13615 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13616 * ) case "$localtime_r_proto" in
13617 REENTRANT_PROTO*) ;;
13618 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13620 echo "Prototype: $try" ;;
13623 *) case "$usethreads" in
13624 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13626 d_localtime_r=undef
13627 localtime_r_proto=0
13631 *) localtime_r_proto=0
13635 : see if localeconv exists
13636 set localeconv d_locconv
13639 : see if lockf exists
13643 : see if prototype for lseek is available
13645 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13648 : see if lstat exists
13652 : see if madvise exists
13653 set madvise d_madvise
13656 : see if mblen exists
13660 : see if mbstowcs exists
13661 set mbstowcs d_mbstowcs
13664 : see if mbtowc exists
13665 set mbtowc d_mbtowc
13668 : see if memchr exists
13669 set memchr d_memchr
13672 : see if memcmp exists
13673 set memcmp d_memcmp
13676 : see if memcpy exists
13677 set memcpy d_memcpy
13680 : see if memmove exists
13681 set memmove d_memmove
13684 : see if memset exists
13685 set memset d_memset
13688 : see if mkdir exists
13692 : see if mkdtemp exists
13693 set mkdtemp d_mkdtemp
13696 : see if mkfifo exists
13697 set mkfifo d_mkfifo
13700 : see if mkstemp exists
13701 set mkstemp d_mkstemp
13704 : see if mkstemps exists
13705 set mkstemps d_mkstemps
13708 : see if mktime exists
13709 set mktime d_mktime
13712 : see if this is a sys/mman.h system
13713 set sys/mman.h i_sysmman
13716 : see if mmap exists
13719 : see what shmat returns
13720 : default to something harmless
13722 case "$i_sysmman$d_mmap" in
13724 $cat >mmap.c <<'END'
13725 #include <sys/mman.h>
13728 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13733 echo "and it returns ($mmaptype)." >&4
13739 : see if mprotect exists
13740 set mprotect d_mprotect
13743 : see if msgctl exists
13744 set msgctl d_msgctl
13747 : see if msgget exists
13748 set msgget d_msgget
13751 : see if msgsnd exists
13752 set msgsnd d_msgsnd
13755 : see if msgrcv exists
13756 set msgrcv d_msgrcv
13759 : see how much of the 'msg*(2)' library is present.
13762 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13763 *"$undef"*) h_msg=false;;
13767 case "`ipcs 2>&1`" in
13768 "SVID messages"*"not configured"*)
13769 echo "Your $osname does not have the msg*(2) configured." >&4
13772 set msgctl d_msgctl
13774 set msgget d_msgget
13776 set msgsnd d_msgsnd
13778 set msgrcv d_msgrcv
13784 : we could also check for sys/ipc.h ...
13785 if $h_msg && $test `./findhdr sys/msg.h`; then
13786 echo "You have the full msg*(2) library." >&4
13789 echo "You don't have the full msg*(2) library." >&4
13797 echo "Checking to see if your system supports struct msghdr..." >&4
13798 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13800 case "$d_msghdr_s" in
13801 "$define") echo "Yes, it does." ;;
13802 *) echo "No, it doesn't." ;;
13806 : see if msync exists
13810 : see if munmap exists
13811 set munmap d_munmap
13814 : see if nanosleep exists
13815 set nanosleep d_nanosleep
13818 : see if nice exists
13822 : see if this is a langinfo.h system
13823 set langinfo.h i_langinfo
13826 : see if nl_langinfo exists
13827 set nl_langinfo d_nl_langinfo
13830 : check for length of character
13832 case "$charsize" in
13834 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13837 #$i_stdlib I_STDLIB
13839 #include <stdlib.h>
13843 printf("%d\n", (int)sizeof(char));
13848 if eval $compile_ok; then
13852 echo "(I can't seem to compile the test program. Guessing...)"
13859 rp="What is the size of a character (in bytes)?"
13864 : check for volatile keyword
13866 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13867 $cat >try.c <<'EOCP'
13870 typedef struct _goo_struct goo_struct;
13871 goo_struct * volatile goo = ((goo_struct *)0);
13872 struct _goo_struct {
13877 typedef unsigned short foo_t;
13878 char *volatile foo;
13880 volatile foo_t blech;
13884 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13886 echo "Yup, it does."
13889 echo "Nope, it doesn't."
13897 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13899 case "$use64bitint:$d_quad:$quadtype" in
13902 uvtype="$uquadtype"
13907 uvtype="unsigned long"
13913 case "$uselongdouble:$d_longdbl" in
13915 nvtype="long double"
13916 nvsize=$longdblsize
13923 $echo "(IV will be "$ivtype", $ivsize bytes)"
13924 $echo "(UV will be "$uvtype", $uvsize bytes)"
13925 $echo "(NV will be "$nvtype", $nvsize bytes)"
13928 #$i_inttypes I_INTTYPES
13930 #include <inttypes.h>
13935 int8_t i = INT8_MAX;
13936 uint8_t u = UINT8_MAX;
13937 printf("int8_t\n");
13940 int16_t i = INT16_MAX;
13941 uint16_t i = UINT16_MAX;
13942 printf("int16_t\n");
13945 int32_t i = INT32_MAX;
13946 uint32_t u = UINT32_MAX;
13947 printf("int32_t\n");
13953 '') case "$charsize" in
13955 u8type="unsigned char"
13964 if eval $compile; then
13965 case "`$run ./try`" in
13966 int8_t) i8type=int8_t
13976 '') if $test $charsize -ge 1; then
13978 u8type="unsigned char"
13986 '') case "$shortsize" in
13988 u16type="unsigned short"
13996 '') set try -DINT16
13997 if eval $compile; then
13998 case "`$run ./try`" in
14010 '') if $test $shortsize -ge 2; then
14012 u16type="unsigned short"
14020 '') case "$longsize" in
14022 u32type="unsigned long"
14026 *) case "$intsize" in
14028 u32type="unsigned int"
14038 '') set try -DINT32
14039 if eval $compile; then
14040 case "`$run ./try`" in
14052 '') if $test $intsize -ge 4; then
14054 u32type="unsigned int"
14062 '') case "$d_quad:$quadtype" in
14064 i64type="$quadtype"
14065 u64type="$uquadtype"
14073 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14074 : volatile so that the compiler has to store it out to memory.
14075 if test X"$d_volatile" = X"$define"; then
14080 #include <sys/types.h>
14081 #include <signal.h>
14083 $volatile int bletched = 0;
14084 $signal_t blech(s) int s; { bletched = 1; }
14089 int n = 8 * $uvsize;
14092 signal(SIGFPE, blech);
14095 for (i = 0; i < n; i++) {
14096 u = u << 1 | ($uvtype)1;
14098 if (($uvtype)d != u)
14102 d = ($nvtype)(u - 1);
14103 if (($uvtype)d != (u - 1))
14111 printf("%d\n", ((i == n) ? -n : i));
14117 d_nv_preserves_uv="$undef"
14118 if eval $compile; then
14119 nv_preserves_uv_bits="`$run ./try`"
14121 case "$nv_preserves_uv_bits" in
14123 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14124 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14125 d_nv_preserves_uv="$define"
14127 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14128 d_nv_preserves_uv="$undef" ;;
14129 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14130 nv_preserves_uv_bits="$undef" ;;
14136 : check for off64_t
14138 echo "Checking to see if you have off64_t..." >&4
14140 #include <sys/types.h>
14141 #include <unistd.h>
14142 int main() { off64_t x = 7; }
14145 if eval $compile; then
14147 echo "You have off64_t."
14150 echo "You do not have off64_t."
14151 case "$lseeksize" in
14152 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
14159 : how to create joinable pthreads
14160 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
14162 echo "Checking what constant to use for creating joinable pthreads..." >&4
14163 $cat >try.c <<'EOCP'
14164 #include <pthread.h>
14166 int detachstate = JOINABLE;
14169 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
14170 if eval $compile; then
14171 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
14172 val="$undef" # Yes, undef.
14173 set d_old_pthread_create_joinable
14176 set old_pthread_create_joinable
14179 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
14180 if eval $compile; then
14181 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
14183 set d_old_pthread_create_joinable
14185 val=PTHREAD_CREATE_UNDETACHED
14186 set old_pthread_create_joinable
14189 set try -DJOINABLE=__UNDETACHED
14190 if eval $compile; then
14191 echo "You seem to use __UNDETACHED." >&4
14193 set d_old_pthread_create_joinable
14196 set old_pthread_create_joinable
14199 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
14201 set d_old_pthread_create_joinable
14204 set old_pthread_create_joinable
14211 d_old_pthread_create_joinable="$undef"
14212 old_pthread_create_joinable=""
14215 : see if pause exists
14219 : see if pipe exists
14223 : see if poll exists
14227 : see if readlink exists
14228 set readlink d_readlink
14234 case "$d_readlink" in
14236 if $issymlink /proc/self/exe ; then
14237 $ls -l /proc/self/exe > reflect
14238 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14239 echo "You have Linux-like /proc/self/exe."
14240 procselfexe='"/proc/self/exe"'
14244 if $issymlink /proc/curproc/file ; then
14245 $ls -l /proc/curproc/file > reflect
14246 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14247 echo "You have BSD-like /proc/curproc/file."
14248 procselfexe='"/proc/curproc/file"'
14258 : see whether the pthread_atfork exists
14260 #include <pthread.h>
14263 #ifdef PTHREAD_ATFORK
14264 pthread_atfork(NULL,NULL,NULL);
14269 : see if pthread_atfork exists
14270 set try -DPTHREAD_ATFORK
14271 if eval $compile; then
14276 case "$usethreads" in
14279 $define) echo 'pthread_atfork found.' >&4 ;;
14280 *) echo 'pthread_atfork NOT found.' >&4 ;;
14283 set d_pthread_atfork
14287 : see whether the various POSIXish _yields exist
14289 #include <pthread.h>
14295 #ifdef PTHREAD_YIELD
14298 #ifdef PTHREAD_YIELD_NULL
14299 pthread_yield(NULL);
14305 : see if sched_yield exists
14306 set try -DSCHED_YIELD
14307 if eval $compile; then
14309 sched_yield='sched_yield()'
14313 case "$usethreads" in
14316 $define) echo 'sched_yield() found.' >&4 ;;
14317 *) echo 'sched_yield() NOT found.' >&4 ;;
14323 : see if pthread_yield exists
14324 set try -DPTHREAD_YIELD
14325 if eval $compile; then
14327 case "$sched_yield" in
14328 '') sched_yield='pthread_yield()' ;;
14331 set try -DPTHREAD_YIELD_NULL
14332 if eval $compile; then
14334 case "$sched_yield" in
14335 '') sched_yield='pthread_yield(NULL)' ;;
14341 case "$usethreads" in
14344 $define) echo 'pthread_yield() found.' >&4 ;;
14345 *) echo 'pthread_yield() NOT found.' >&4 ;;
14349 set d_pthread_yield
14352 case "$sched_yield" in
14353 '') sched_yield=undef ;;
14358 : see if random_r exists
14359 set random_r d_random_r
14361 case "$d_random_r" in
14363 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
14364 case "$d_random_r_proto:$usethreads" in
14365 ":define") d_random_r_proto=define
14366 set d_random_r_proto random_r $hdrs
14370 case "$d_random_r_proto" in
14372 case "$random_r_proto" in
14373 ''|0) try='int random_r(int*, struct random_data*);'
14374 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
14376 case "$random_r_proto" in
14377 ''|0) try='int random_r(long*, struct random_data*);'
14378 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
14380 case "$random_r_proto" in
14381 ''|0) try='int random_r(struct random_data*, int32_t*);'
14382 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
14384 case "$random_r_proto" in
14385 ''|0) d_random_r=undef
14387 echo "Disabling random_r, cannot determine prototype." >&4 ;;
14388 * ) case "$random_r_proto" in
14389 REENTRANT_PROTO*) ;;
14390 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
14392 echo "Prototype: $try" ;;
14395 *) case "$usethreads" in
14396 define) echo "random_r has no prototype, not using it." >&4 ;;
14403 *) random_r_proto=0
14407 : see if readdir and friends exist
14408 set readdir d_readdir
14410 set seekdir d_seekdir
14412 set telldir d_telldir
14414 set rewinddir d_rewinddir
14417 : see if readdir64_r exists
14418 set readdir64_r d_readdir64_r
14420 case "$d_readdir64_r" in
14422 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14423 case "$d_readdir64_r_proto:$usethreads" in
14424 ":define") d_readdir64_r_proto=define
14425 set d_readdir64_r_proto readdir64_r $hdrs
14429 case "$d_readdir64_r_proto" in
14431 case "$readdir64_r_proto" in
14432 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
14433 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
14435 case "$readdir64_r_proto" in
14436 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
14437 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
14439 case "$readdir64_r_proto" in
14440 ''|0) d_readdir64_r=undef
14441 readdir64_r_proto=0
14442 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
14443 * ) case "$readdir64_r_proto" in
14444 REENTRANT_PROTO*) ;;
14445 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
14447 echo "Prototype: $try" ;;
14450 *) case "$usethreads" in
14451 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
14453 d_readdir64_r=undef
14454 readdir64_r_proto=0
14458 *) readdir64_r_proto=0
14462 : see if readdir_r exists
14463 set readdir_r d_readdir_r
14465 case "$d_readdir_r" in
14467 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14468 case "$d_readdir_r_proto:$usethreads" in
14469 ":define") d_readdir_r_proto=define
14470 set d_readdir_r_proto readdir_r $hdrs
14474 case "$d_readdir_r_proto" in
14476 case "$readdir_r_proto" in
14477 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
14478 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
14480 case "$readdir_r_proto" in
14481 ''|0) try='int readdir_r(DIR*, struct dirent*);'
14482 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
14484 case "$readdir_r_proto" in
14485 ''|0) d_readdir_r=undef
14487 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
14488 * ) case "$readdir_r_proto" in
14489 REENTRANT_PROTO*) ;;
14490 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
14492 echo "Prototype: $try" ;;
14495 *) case "$usethreads" in
14496 define) echo "readdir_r has no prototype, not using it." >&4 ;;
14503 *) readdir_r_proto=0
14507 : see if readv exists
14511 : see if recvmsg exists
14512 set recvmsg d_recvmsg
14515 : see if rename exists
14516 set rename d_rename
14519 : see if rmdir exists
14523 : see if memory.h is available.
14528 : See if it conflicts with string.h
14534 $cppstdin $cppflags $cppminus < $strings > mem.h
14535 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
14537 echo "We won't be including <memory.h>."
14547 : can bcopy handle overlapping blocks?
14550 case "$d_memmove" in
14551 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14552 *) case "$d_bcopy" in
14554 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14556 #$i_memory I_MEMORY
14557 #$i_stdlib I_STDLIB
14558 #$i_string I_STRING
14559 #$i_unistd I_UNISTD
14561 $cat >>try.c <<'EOCP'
14564 # include <memory.h>
14567 # include <stdlib.h>
14570 # include <string.h>
14572 # include <strings.h>
14575 # include <unistd.h> /* Needed for NetBSD */
14579 char buf[128], abc[128];
14585 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14586 try to store the string in read-only memory. */
14587 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14589 for (align = 7; align >= 0; align--) {
14590 for (len = 36; len; len--) {
14592 bcopy(abc, b, len);
14593 for (off = 1; off <= len; off++) {
14594 bcopy(b, b+off, len);
14595 bcopy(b+off, b, len);
14596 if (bcmp(b, abc, len))
14605 if eval $compile_ok; then
14606 if ./try 2>/dev/null; then
14607 echo "Yes, it can."
14610 echo "It can't, sorry."
14613 echo "(I can't compile the test program, so we'll assume not...)"
14617 $rm -f try.* try core
14623 : can memcpy handle overlapping blocks?
14626 case "$d_memmove" in
14627 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14628 *) case "$d_memcpy" in
14630 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14632 #$i_memory I_MEMORY
14633 #$i_stdlib I_STDLIB
14634 #$i_string I_STRING
14635 #$i_unistd I_UNISTD
14637 $cat >>try.c <<'EOCP'
14640 # include <memory.h>
14643 # include <stdlib.h>
14646 # include <string.h>
14648 # include <strings.h>
14651 # include <unistd.h> /* Needed for NetBSD */
14655 char buf[128], abc[128];
14661 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14662 try to store the string in read-only memory. */
14663 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14665 for (align = 7; align >= 0; align--) {
14666 for (len = 36; len; len--) {
14668 memcpy(b, abc, len);
14669 for (off = 1; off <= len; off++) {
14670 memcpy(b+off, b, len);
14671 memcpy(b, b+off, len);
14672 if (memcmp(b, abc, len))
14681 if eval $compile_ok; then
14682 if ./try 2>/dev/null; then
14683 echo "Yes, it can."
14686 echo "It can't, sorry."
14689 echo "(I can't compile the test program, so we'll assume not...)"
14693 $rm -f try.* try core
14699 : can memcmp be trusted to compare relative magnitude?
14701 case "$d_memcmp" in
14704 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14706 #$i_memory I_MEMORY
14707 #$i_stdlib I_STDLIB
14708 #$i_string I_STRING
14709 #$i_unistd I_UNISTD
14711 $cat >>try.c <<'EOCP'
14714 # include <memory.h>
14717 # include <stdlib.h>
14720 # include <string.h>
14722 # include <strings.h>
14725 # include <unistd.h> /* Needed for NetBSD */
14731 if ((a < b) && memcmp(&a, &b, 1) < 0)
14737 if eval $compile_ok; then
14738 if $run ./try 2>/dev/null; then
14739 echo "Yes, it can."
14742 echo "No, it can't (it uses signed chars)."
14745 echo "(I can't compile the test program, so we'll assume not...)"
14749 $rm -f try.* try core
14753 : see if prototype for sbrk is available
14755 set d_sbrkproto sbrk $i_unistd unistd.h
14758 : see if select exists
14759 set select d_select
14762 : see if semctl exists
14763 set semctl d_semctl
14766 : see if semget exists
14767 set semget d_semget
14770 : see if semop exists
14774 : see how much of the 'sem*(2)' library is present.
14777 case "$d_semctl$d_semget$d_semop" in
14778 *"$undef"*) h_sem=false;;
14782 case "`ipcs 2>&1`" in
14783 "SVID messages"*"not configured"*)
14784 echo "Your $osname does not have the sem*(2) configured." >&4
14787 set semctl d_semctl
14789 set semget d_semget
14797 : we could also check for sys/ipc.h ...
14798 if $h_sem && $test `./findhdr sys/sem.h`; then
14799 echo "You have the full sem*(2) library." >&4
14802 echo "You don't have the full sem*(2) library." >&4
14808 : see whether sys/sem.h defines union semun
14810 $cat > try.c <<'END'
14811 #include <sys/types.h>
14812 #include <sys/ipc.h>
14813 #include <sys/sem.h>
14814 int main () { union semun semun; semun.buf = 0; }
14817 if eval $compile; then
14818 echo "You have union semun in <sys/sem.h>." >&4
14821 echo "You do not have union semun in <sys/sem.h>." >&4
14824 $rm -f try try.c try.h
14828 : see how to do semctl IPC_STAT
14831 : see whether semctl IPC_STAT can use union semun
14836 # define S_IRUSR S_IREAD
14837 # define S_IWUSR S_IWRITE
14838 # define S_IXUSR S_IEXEC
14840 # define S_IRUSR 0400
14841 # define S_IWUSR 0200
14842 # define S_IXUSR 0100
14844 # define S_IRGRP (S_IRUSR>>3)
14845 # define S_IWGRP (S_IWUSR>>3)
14846 # define S_IXGRP (S_IXUSR>>3)
14847 # define S_IROTH (S_IRUSR>>6)
14848 # define S_IWOTH (S_IWUSR>>6)
14849 # define S_IXOTH (S_IXUSR>>6)
14852 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14853 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14854 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14859 #include <sys/types.h>
14860 #include <sys/ipc.h>
14861 #include <sys/sem.h>
14862 #include <sys/stat.h>
14869 #$d_union_semun HAS_UNION_SEMUN
14872 #ifndef HAS_UNION_SEMUN
14875 struct semid_ds *buf;
14876 unsigned short *array;
14882 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14883 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14885 struct semid_ds argbuf;
14888 st = semctl(sem, 0, IPC_STAT, arg);
14892 # endif /* IPC_STAT */
14893 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14895 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14896 # endif /* IPC_RMID */
14897 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14899 #endif /* IPC_PRIVATE && ... */
14900 printf("semget failed: errno = %d\n", errno);
14906 if eval $compile; then
14909 semun) val="$define" ;;
14915 case "$d_semctl_semun" in
14917 echo "You can use union semun for semctl IPC_STAT." >&4
14920 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14925 : see whether semctl IPC_STAT can use struct semid_ds pointer
14926 $cat > try.c <<'END'
14927 #include <sys/types.h>
14928 #include <sys/ipc.h>
14929 #include <sys/sem.h>
14930 #include <sys/stat.h>
14938 struct semid_ds arg;
14941 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14942 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14945 st = semctl(sem, 0, IPC_STAT, &arg);
14947 printf("semid_ds\n");
14949 # endif /* IPC_STAT */
14950 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14952 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14953 # endif /* IPC_RMID */
14954 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14956 #endif /* IPC_PRIVATE && ... */
14957 printf("semget failed: errno = %d\n", errno);
14964 if eval $compile; then
14967 semid_ds) val="$define" ;;
14971 set d_semctl_semid_ds
14973 case "$d_semctl_semid_ds" in
14975 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14977 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14984 # We do not have the full sem*(2) library, so assume we can not
14990 set d_semctl_semid_ds
14995 : see if sendmsg exists
14996 set sendmsg d_sendmsg
14999 : see if setegid exists
15000 set setegid d_setegid
15003 : see if seteuid exists
15004 set seteuid d_seteuid
15007 : see if setgrent exists
15008 set setgrent d_setgrent
15011 : see if setgrent_r exists
15012 set setgrent_r d_setgrent_r
15014 case "$d_setgrent_r" in
15016 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15017 case "$d_setgrent_r_proto:$usethreads" in
15018 ":define") d_setgrent_r_proto=define
15019 set d_setgrent_r_proto setgrent_r $hdrs
15023 case "$d_setgrent_r_proto" in
15025 case "$setgrent_r_proto" in
15026 ''|0) try='int setgrent_r(FILE**);'
15027 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15029 case "$setgrent_r_proto" in
15030 ''|0) try='void setgrent_r(FILE**);'
15031 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15033 case "$setgrent_r_proto" in
15034 ''|0) d_setgrent_r=undef
15036 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15037 * ) case "$setgrent_r_proto" in
15038 REENTRANT_PROTO*) ;;
15039 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15041 echo "Prototype: $try" ;;
15044 *) case "$usethreads" in
15045 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15052 *) setgrent_r_proto=0
15056 : see if sethostent exists
15057 set sethostent d_sethent
15060 : see if sethostent_r exists
15061 set sethostent_r d_sethostent_r
15063 case "$d_sethostent_r" in
15065 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15066 case "$d_sethostent_r_proto:$usethreads" in
15067 ":define") d_sethostent_r_proto=define
15068 set d_sethostent_r_proto sethostent_r $hdrs
15072 case "$d_sethostent_r_proto" in
15074 case "$sethostent_r_proto" in
15075 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15076 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15078 case "$sethostent_r_proto" in
15079 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15080 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15082 case "$sethostent_r_proto" in
15083 ''|0) d_sethostent_r=undef
15084 sethostent_r_proto=0
15085 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15086 * ) case "$sethostent_r_proto" in
15087 REENTRANT_PROTO*) ;;
15088 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15090 echo "Prototype: $try" ;;
15093 *) case "$usethreads" in
15094 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15096 d_sethostent_r=undef
15097 sethostent_r_proto=0
15101 *) sethostent_r_proto=0
15105 : see if setitimer exists
15106 set setitimer d_setitimer
15109 : see if setlinebuf exists
15110 set setlinebuf d_setlinebuf
15113 : see if setlocale exists
15114 set setlocale d_setlocale
15117 : see if locale.h is available
15118 set locale.h i_locale
15121 : see if setlocale_r exists
15122 set setlocale_r d_setlocale_r
15124 case "$d_setlocale_r" in
15126 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15127 case "$d_setlocale_r_proto:$usethreads" in
15128 ":define") d_setlocale_r_proto=define
15129 set d_setlocale_r_proto setlocale_r $hdrs
15133 case "$d_setlocale_r_proto" in
15135 case "$setlocale_r_proto" in
15136 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15137 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15139 case "$setlocale_r_proto" in
15140 ''|0) d_setlocale_r=undef
15141 setlocale_r_proto=0
15142 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15143 * ) case "$setlocale_r_proto" in
15144 REENTRANT_PROTO*) ;;
15145 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15147 echo "Prototype: $try" ;;
15150 *) case "$usethreads" in
15151 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
15153 d_setlocale_r=undef
15154 setlocale_r_proto=0
15158 *) setlocale_r_proto=0
15162 : see if setnetent exists
15163 set setnetent d_setnent
15166 : see if setnetent_r exists
15167 set setnetent_r d_setnetent_r
15169 case "$d_setnetent_r" in
15171 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15172 case "$d_setnetent_r_proto:$usethreads" in
15173 ":define") d_setnetent_r_proto=define
15174 set d_setnetent_r_proto setnetent_r $hdrs
15178 case "$d_setnetent_r_proto" in
15180 case "$setnetent_r_proto" in
15181 ''|0) try='int setnetent_r(int, struct netent_data*);'
15182 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
15184 case "$setnetent_r_proto" in
15185 ''|0) try='void setnetent_r(int, struct netent_data*);'
15186 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
15188 case "$setnetent_r_proto" in
15189 ''|0) d_setnetent_r=undef
15190 setnetent_r_proto=0
15191 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
15192 * ) case "$setnetent_r_proto" in
15193 REENTRANT_PROTO*) ;;
15194 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
15196 echo "Prototype: $try" ;;
15199 *) case "$usethreads" in
15200 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
15202 d_setnetent_r=undef
15203 setnetent_r_proto=0
15207 *) setnetent_r_proto=0
15211 : see if setprotoent exists
15212 set setprotoent d_setpent
15215 : see if setpgid exists
15216 set setpgid d_setpgid
15219 : see if setpgrp2 exists
15220 set setpgrp2 d_setpgrp2
15223 : see if setpriority exists
15224 set setpriority d_setprior
15227 : see if setproctitle exists
15228 set setproctitle d_setproctitle
15231 : see if setprotoent_r exists
15232 set setprotoent_r d_setprotoent_r
15234 case "$d_setprotoent_r" in
15236 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15237 case "$d_setprotoent_r_proto:$usethreads" in
15238 ":define") d_setprotoent_r_proto=define
15239 set d_setprotoent_r_proto setprotoent_r $hdrs
15243 case "$d_setprotoent_r_proto" in
15245 case "$setprotoent_r_proto" in
15246 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
15247 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
15249 case "$setprotoent_r_proto" in
15250 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
15251 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
15253 case "$setprotoent_r_proto" in
15254 ''|0) d_setprotoent_r=undef
15255 setprotoent_r_proto=0
15256 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
15257 * ) case "$setprotoent_r_proto" in
15258 REENTRANT_PROTO*) ;;
15259 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
15261 echo "Prototype: $try" ;;
15264 *) case "$usethreads" in
15265 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
15267 d_setprotoent_r=undef
15268 setprotoent_r_proto=0
15272 *) setprotoent_r_proto=0
15276 : see if setpwent exists
15277 set setpwent d_setpwent
15280 : see if setpwent_r exists
15281 set setpwent_r d_setpwent_r
15283 case "$d_setpwent_r" in
15285 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15286 case "$d_setpwent_r_proto:$usethreads" in
15287 ":define") d_setpwent_r_proto=define
15288 set d_setpwent_r_proto setpwent_r $hdrs
15292 case "$d_setpwent_r_proto" in
15294 case "$setpwent_r_proto" in
15295 ''|0) try='int setpwent_r(FILE**);'
15296 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
15298 case "$setpwent_r_proto" in
15299 ''|0) try='void setpwent_r(FILE**);'
15300 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
15302 case "$setpwent_r_proto" in
15303 ''|0) d_setpwent_r=undef
15305 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
15306 * ) case "$setpwent_r_proto" in
15307 REENTRANT_PROTO*) ;;
15308 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
15310 echo "Prototype: $try" ;;
15313 *) case "$usethreads" in
15314 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
15321 *) setpwent_r_proto=0
15325 : see if setregid exists
15326 set setregid d_setregid
15328 set setresgid d_setresgid
15331 : see if setreuid exists
15332 set setreuid d_setreuid
15334 set setresuid d_setresuid
15337 : see if setrgid exists
15338 set setrgid d_setrgid
15341 : see if setruid exists
15342 set setruid d_setruid
15345 : see if setservent exists
15346 set setservent d_setsent
15349 : see if setservent_r exists
15350 set setservent_r d_setservent_r
15352 case "$d_setservent_r" in
15354 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15355 case "$d_setservent_r_proto:$usethreads" in
15356 ":define") d_setservent_r_proto=define
15357 set d_setservent_r_proto setservent_r $hdrs
15361 case "$d_setservent_r_proto" in
15363 case "$setservent_r_proto" in
15364 ''|0) try='int setservent_r(int, struct servent_data*);'
15365 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
15367 case "$setservent_r_proto" in
15368 ''|0) try='void setservent_r(int, struct servent_data*);'
15369 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
15371 case "$setservent_r_proto" in
15372 ''|0) d_setservent_r=undef
15373 setservent_r_proto=0
15374 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
15375 * ) case "$setservent_r_proto" in
15376 REENTRANT_PROTO*) ;;
15377 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
15379 echo "Prototype: $try" ;;
15382 *) case "$usethreads" in
15383 define) echo "setservent_r has no prototype, not using it." >&4 ;;
15385 d_setservent_r=undef
15386 setservent_r_proto=0
15390 *) setservent_r_proto=0
15394 : see if setsid exists
15395 set setsid d_setsid
15398 : see if setvbuf exists
15399 set setvbuf d_setvbuf
15402 : see if sfio.h is available
15407 : see if sfio library is available
15418 : Ok, but do we want to use it.
15422 true|$define|[yY]*) dflt='y';;
15425 echo "$package can use the sfio library, but it is experimental."
15426 case "$useperlio" in
15428 echo "For sfio also the PerlIO abstraction layer is needed."
15429 echo "Earlier you said you wouldn't want that."
15432 rp="You seem to have sfio available, do you want to try using it?"
15435 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
15436 useperlio="$define"
15439 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
15444 *) case "$usesfio" in
15445 true|$define|[yY]*)
15446 echo "Sorry, cannot find sfio on this machine." >&4
15447 echo "Ignoring your setting of usesfio=$usesfio." >&4
15456 $define) usesfio='true';;
15457 *) usesfio='false';;
15461 *) : Remove sfio from list of libraries to use
15464 echo "Removing unneeded -lsfio from library list" >&4
15465 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
15468 echo "libs = $libs" >&4
15475 : see if shmctl exists
15476 set shmctl d_shmctl
15479 : see if shmget exists
15480 set shmget d_shmget
15483 : see if shmat exists
15486 : see what shmat returns
15489 $cat >shmat.c <<'END'
15490 #include <sys/shm.h>
15493 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
15498 echo "and it returns ($shmattype)." >&4
15499 : see if a prototype for shmat is available
15500 xxx=`./findhdr sys/shm.h`
15501 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
15502 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
15513 set d_shmatprototype
15516 : see if shmdt exists
15520 : see how much of the 'shm*(2)' library is present.
15523 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
15524 *"$undef"*) h_shm=false;;
15528 case "`ipcs 2>&1`" in
15529 "SVID shared memory"*"not configured"*)
15530 echo "Your $osname does not have the shm*(2) configured." >&4
15533 set shmctl d_shmctl
15535 set shmget d_shmget
15545 : we could also check for sys/ipc.h ...
15546 if $h_shm && $test `./findhdr sys/shm.h`; then
15547 echo "You have the full shm*(2) library." >&4
15550 echo "You don't have the full shm*(2) library." >&4
15557 : see if we have sigaction
15558 if set sigaction val -f d_sigaction; eval $csym; $val; then
15559 echo 'sigaction() found.' >&4
15562 #include <sys/types.h>
15563 #include <signal.h>
15564 #$i_stdlib I_STDLIB
15566 #include <stdlib.h>
15570 struct sigaction act, oact;
15572 oact.sa_handler = 0;
15573 /* so that act and oact are used */
15574 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15578 if eval $compile_ok; then
15581 echo "But you don't seem to have a useable struct sigaction." >&4
15585 echo 'sigaction NOT found.' >&4
15588 set d_sigaction; eval $setvar
15589 $rm -f try try$_o try.c
15591 : see if sigprocmask exists
15592 set sigprocmask d_sigprocmask
15595 : see if sigsetjmp exists
15597 case "$d_sigsetjmp" in
15600 #include <setjmp.h>
15601 #$i_stdlib I_STDLIB
15603 #include <stdlib.h>
15609 if (sigsetjmp(env,1))
15612 siglongjmp(env, 1);
15617 if eval $compile; then
15618 if $run ./try >/dev/null 2>&1; then
15619 echo "POSIX sigsetjmp found." >&4
15623 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15629 echo "sigsetjmp not found." >&4
15633 *) val="$d_sigsetjmp"
15634 case "$d_sigsetjmp" in
15635 $define) echo "POSIX sigsetjmp found." >&4;;
15636 $undef) echo "sigsetjmp not found." >&4;;
15644 : see if sockatmark exists
15645 set sockatmark d_sockatmark
15648 : see if prototype for sockatmark is available
15650 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15653 : see if socks5_init exists
15654 set socks5_init d_socks5_init
15657 : see if srand48_r exists
15658 set srand48_r d_srand48_r
15660 case "$d_srand48_r" in
15662 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15663 case "$d_srand48_r_proto:$usethreads" in
15664 ":define") d_srand48_r_proto=define
15665 set d_srand48_r_proto srand48_r $hdrs
15669 case "$d_srand48_r_proto" in
15671 case "$srand48_r_proto" in
15672 ''|0) try='int srand48_r(long, struct drand48_data*);'
15673 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15675 case "$srand48_r_proto" in
15676 ''|0) d_srand48_r=undef
15678 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15679 * ) case "$srand48_r_proto" in
15680 REENTRANT_PROTO*) ;;
15681 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15683 echo "Prototype: $try" ;;
15686 *) case "$usethreads" in
15687 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15694 *) srand48_r_proto=0
15698 : see if srandom_r exists
15699 set srandom_r d_srandom_r
15701 case "$d_srandom_r" in
15703 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15704 case "$d_srandom_r_proto:$usethreads" in
15705 ":define") d_srandom_r_proto=define
15706 set d_srandom_r_proto srandom_r $hdrs
15710 case "$d_srandom_r_proto" in
15712 case "$srandom_r_proto" in
15713 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15714 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15716 case "$srandom_r_proto" in
15717 ''|0) d_srandom_r=undef
15719 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15720 * ) case "$srandom_r_proto" in
15721 REENTRANT_PROTO*) ;;
15722 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15724 echo "Prototype: $try" ;;
15727 *) case "$usethreads" in
15728 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15735 *) srandom_r_proto=0
15739 : see if prototype for setresgid is available
15741 set d_sresgproto setresgid $i_unistd unistd.h
15744 : see if prototype for setresuid is available
15746 set d_sresuproto setresuid $i_unistd unistd.h
15749 : see if sys/stat.h is available
15750 set sys/stat.h i_sysstat
15754 : see if stat knows about block sizes
15756 echo "Checking to see if your struct stat has st_blocks field..." >&4
15757 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15761 : see if this is a sys/vfs.h system
15762 set sys/vfs.h i_sysvfs
15766 : see if this is a sys/statfs.h system
15767 set sys/statfs.h i_sysstatfs
15772 echo "Checking to see if your system supports struct statfs..." >&4
15773 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
15775 case "$d_statfs_s" in
15776 "$define") echo "Yes, it does." ;;
15777 *) echo "No, it doesn't." ;;
15782 : see if struct statfs knows about f_flags
15783 case "$d_statfs_s" in
15786 echo "Checking to see if your struct statfs has f_flags field..." >&4
15787 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
15791 set d_statfs_f_flags
15795 case "$d_statfs_f_flags" in
15796 "$define") echo "Yes, it does." ;;
15797 *) echo "No, it doesn't." ;;
15800 : see if _ptr and _cnt from stdio act std
15803 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15804 echo "(Looks like you have stdio.h from BSD.)"
15805 case "$stdio_ptr" in
15806 '') stdio_ptr='((fp)->_p)'
15809 *) ptr_lval=$d_stdio_ptr_lval;;
15811 case "$stdio_cnt" in
15812 '') stdio_cnt='((fp)->_r)'
15815 *) cnt_lval=$d_stdio_cnt_lval;;
15817 case "$stdio_base" in
15818 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15820 case "$stdio_bufsiz" in
15821 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15823 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15824 echo "(Looks like you have stdio.h from Linux.)"
15825 case "$stdio_ptr" in
15826 '') stdio_ptr='((fp)->_IO_read_ptr)'
15829 *) ptr_lval=$d_stdio_ptr_lval;;
15831 case "$stdio_cnt" in
15832 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15835 *) cnt_lval=$d_stdio_cnt_lval;;
15837 case "$stdio_base" in
15838 '') stdio_base='((fp)->_IO_read_base)';;
15840 case "$stdio_bufsiz" in
15841 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15844 case "$stdio_ptr" in
15845 '') stdio_ptr='((fp)->_ptr)'
15848 *) ptr_lval=$d_stdio_ptr_lval;;
15850 case "$stdio_cnt" in
15851 '') stdio_cnt='((fp)->_cnt)'
15854 *) cnt_lval=$d_stdio_cnt_lval;;
15856 case "$stdio_base" in
15857 '') stdio_base='((fp)->_base)';;
15859 case "$stdio_bufsiz" in
15860 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15864 : test whether _ptr and _cnt really work
15865 echo "Checking how std your stdio is..." >&4
15868 #define FILE_ptr(fp) $stdio_ptr
15869 #define FILE_cnt(fp) $stdio_cnt
15871 FILE *fp = fopen("try.c", "r");
15874 18 <= FILE_cnt(fp) &&
15875 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15883 if eval $compile && $to try.c; then
15884 if $run ./try; then
15885 echo "Your stdio acts pretty std."
15888 echo "Your stdio isn't very std."
15891 echo "Your stdio doesn't appear very std."
15895 # glibc 2.2.90 and above apparently change stdio streams so Perl's
15896 # direct buffer manipulation no longer works. The Configure tests
15897 # should be changed to correctly detect this, but until then,
15898 # the following check should at least let perl compile and run.
15899 # (This quick fix should be updated before 5.8.1.)
15900 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
15901 # A. Dougherty, June 3, 2002.
15902 case "$d_gnulibc" in
15904 case "$gnulibc_version" in
15908 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
15917 : Can _ptr be used as an lvalue?
15918 case "$d_stdstdio$ptr_lval" in
15919 $define$define) val=$define ;;
15922 set d_stdio_ptr_lval
15925 : Can _cnt be used as an lvalue?
15926 case "$d_stdstdio$cnt_lval" in
15927 $define$define) val=$define ;;
15930 set d_stdio_cnt_lval
15934 : test whether setting _ptr sets _cnt as a side effect
15935 d_stdio_ptr_lval_sets_cnt="$undef"
15936 d_stdio_ptr_lval_nochange_cnt="$undef"
15937 case "$d_stdio_ptr_lval$d_stdstdio" in
15939 echo "Checking to see what happens if we set the stdio ptr..." >&4
15942 /* Can we scream? */
15943 /* Eat dust sed :-) */
15944 /* In the buffer space, no one can hear you scream. */
15945 #define FILE_ptr(fp) $stdio_ptr
15946 #define FILE_cnt(fp) $stdio_cnt
15947 #include <sys/types.h>
15949 FILE *fp = fopen("try.c", "r");
15954 puts("Fail even to read");
15957 c = getc(fp); /* Read away the first # */
15959 puts("Fail even to read");
15963 18 <= FILE_cnt(fp) &&
15964 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15966 puts("Fail even to read");
15969 ptr = (char*) FILE_ptr(fp);
15970 cnt = (size_t)FILE_cnt(fp);
15972 FILE_ptr(fp) += 42;
15974 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15975 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15978 if (FILE_cnt(fp) <= 20) {
15979 printf ("Fail (<20 chars to test)");
15982 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15983 puts("Fail compare");
15986 if (cnt == FILE_cnt(fp)) {
15987 puts("Pass_unchanged");
15990 if (FILE_cnt(fp) == (cnt - 42)) {
15991 puts("Pass_changed");
15994 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
16000 if eval $compile && $to try.c; then
16001 case `$run ./try` in
16003 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
16004 d_stdio_ptr_lval_sets_cnt="$define" ;;
16006 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
16007 d_stdio_ptr_lval_nochange_cnt="$define" ;;
16009 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
16011 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
16014 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
16020 : see if _base is also standard
16022 case "$d_stdstdio" in
16026 #define FILE_base(fp) $stdio_base
16027 #define FILE_bufsiz(fp) $stdio_bufsiz
16029 FILE *fp = fopen("try.c", "r");
16032 19 <= FILE_bufsiz(fp) &&
16033 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
16040 if eval $compile && $to try.c; then
16041 if $run ./try; then
16042 echo "And its _base field acts std."
16045 echo "But its _base field isn't std."
16048 echo "However, it seems to be lacking the _base field."
16057 Checking how to access stdio streams by file descriptor number...
16059 case "$stdio_stream_array" in
16060 '') $cat >try.c <<EOCP
16063 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16067 for s in _iob __iob __sF
16069 set try -DSTDIO_STREAM_ARRAY=$s
16070 if eval $compile; then
16071 case "`$run ./try`" in
16072 yes) stdio_stream_array=$s; break ;;
16076 $rm -f try.* try$exe_ext
16078 case "$stdio_stream_array" in
16080 I can't figure out how to access stdio streams by file descriptor number.
16082 d_stdio_stream_array="$undef"
16085 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16087 d_stdio_stream_array="$define"
16091 : see if strcoll exists
16092 set strcoll d_strcoll
16095 : check for structure copying
16097 echo "Checking to see if your C compiler can copy structs..." >&4
16098 $cat >try.c <<'EOCP'
16108 if $cc -c try.c >/dev/null 2>&1 ; then
16110 echo "Yup, it can."
16113 echo "Nope, it can't."
16119 : see if strerror and/or sys_errlist[] exist
16121 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16122 if set strerror val -f d_strerror; eval $csym; $val; then
16123 echo 'strerror() found.' >&4
16124 d_strerror="$define"
16125 d_strerrm='strerror(e)'
16126 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16127 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16128 d_syserrlst="$define"
16130 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16131 d_syserrlst="$undef"
16133 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16134 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16135 echo 'strerror() found in string header.' >&4
16136 d_strerror="$define"
16137 d_strerrm='strerror(e)'
16138 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16139 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16140 d_syserrlst="$define"
16142 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16143 d_syserrlst="$undef"
16145 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16146 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16147 d_strerror="$undef"
16148 d_syserrlst="$define"
16149 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16151 echo 'strerror() and sys_errlist[] NOT found.' >&4
16152 d_strerror="$undef"
16153 d_syserrlst="$undef"
16154 d_strerrm='"unknown"'
16158 : see if strerror_r exists
16159 set strerror_r d_strerror_r
16161 case "$d_strerror_r" in
16163 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16164 case "$d_strerror_r_proto:$usethreads" in
16165 ":define") d_strerror_r_proto=define
16166 set d_strerror_r_proto strerror_r $hdrs
16170 case "$d_strerror_r_proto" in
16172 case "$strerror_r_proto" in
16173 ''|0) try='int strerror_r(int, char*, size_t);'
16174 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16176 case "$strerror_r_proto" in
16177 ''|0) try='int strerror_r(int, char*, int);'
16178 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16180 case "$strerror_r_proto" in
16181 ''|0) try='char* strerror_r(int, char*, size_t);'
16182 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16184 case "$strerror_r_proto" in
16185 ''|0) d_strerror_r=undef
16187 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16188 * ) case "$strerror_r_proto" in
16189 REENTRANT_PROTO*) ;;
16190 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16192 echo "Prototype: $try" ;;
16195 *) case "$usethreads" in
16196 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16203 *) strerror_r_proto=0
16207 : see if strftime exists
16208 set strftime d_strftime
16211 : see if strtod exists
16212 set strtod d_strtod
16215 : see if strtol exists
16216 set strtol d_strtol
16219 : see if strtold exists
16220 set strtold d_strtold
16223 : see if strtoll exists
16224 set strtoll d_strtoll
16227 case "$d_longlong-$d_strtoll" in
16230 Checking whether your strtoll() works okay...
16232 $cat >try.c <<'EOCP'
16235 #define strtoll __strtoll
16238 #define strtoll _strtoll
16241 extern long long int strtoll(char *s, char **, int);
16242 static int bad = 0;
16243 int check(char *s, long long ell, int een) {
16246 gll = strtoll(s, 0, 10);
16247 if (!((gll == ell) && (errno == een)))
16251 check(" 1", 1LL, 0);
16252 check(" 0", 0LL, 0);
16253 check("-1", -1LL, 0);
16254 check("-9223372036854775808", -9223372036854775808LL, 0);
16255 check("-9223372036854775808", -9223372036854775808LL, 0);
16256 check(" 9223372036854775807", 9223372036854775807LL, 0);
16257 check("-9223372036854775808", -9223372036854775808LL, 0);
16258 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16259 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16265 if eval $compile; then
16268 ok) echo "Your strtoll() seems to be working okay." ;;
16270 Your strtoll() doesn't seem to be working okay.
16276 echo "(I can't seem to compile the test program--assuming it doesn't)"
16282 : see if strtoq exists
16283 set strtoq d_strtoq
16286 : see if strtoul exists
16287 set strtoul d_strtoul
16290 case "$d_strtoul" in
16293 Checking whether your strtoul() works okay...
16295 $cat >try.c <<'EOCP'
16298 extern unsigned long int strtoul(char *s, char **, int);
16299 static int bad = 0;
16300 void check(char *s, unsigned long eul, int een) {
16303 gul = strtoul(s, 0, 10);
16304 if (!((gul == eul) && (errno == een)))
16308 check(" 1", 1L, 0);
16309 check(" 0", 0L, 0);
16311 case "$longsize" in
16313 $cat >>try.c <<'EOCP'
16314 check("18446744073709551615", 18446744073709551615UL, 0);
16315 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16316 #if 0 /* strtoul() for /^-/ strings is undefined. */
16317 check("-1", 18446744073709551615UL, 0);
16318 check("-18446744073709551614", 2, 0);
16319 check("-18446744073709551615", 1, 0);
16320 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16321 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16326 $cat >>try.c <<'EOCP'
16327 check("4294967295", 4294967295UL, 0);
16328 check("4294967296", 4294967295UL, ERANGE);
16329 #if 0 /* strtoul() for /^-/ strings is undefined. */
16330 check("-1", 4294967295UL, 0);
16331 check("-4294967294", 2, 0);
16332 check("-4294967295", 1, 0);
16333 check("-4294967296", 4294967295UL, ERANGE);
16334 check("-4294967297", 4294967295UL, ERANGE);
16339 : Should we write these tests to be more portable by sprintf-ing
16340 : ~0 and then manipulating that char string as input for strtol?
16343 $cat >>try.c <<'EOCP'
16350 if eval $compile; then
16351 case "`$run ./try`" in
16352 ok) echo "Your strtoul() seems to be working okay." ;;
16354 Your strtoul() doesn't seem to be working okay.
16363 : see if strtoull exists
16364 set strtoull d_strtoull
16367 case "$d_longlong-$d_strtoull" in
16370 Checking whether your strtoull() works okay...
16372 $cat >try.c <<'EOCP'
16375 #define strtoull __strtoull
16378 extern unsigned long long int strtoull(char *s, char **, int);
16379 static int bad = 0;
16380 int check(char *s, long long eull, int een) {
16383 gull = strtoull(s, 0, 10);
16384 if (!((gull == eull) && (errno == een)))
16388 check(" 1", 1LL, 0);
16389 check(" 0", 0LL, 0);
16390 check("18446744073709551615", 18446744073709551615ULL, 0);
16391 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16392 #if 0 /* strtoull() for /^-/ strings is undefined. */
16393 check("-1", 18446744073709551615ULL, 0);
16394 check("-18446744073709551614", 2LL, 0);
16395 check("-18446744073709551615", 1LL, 0);
16396 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16397 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16404 if eval $compile; then
16405 case "`$run ./try`" in
16406 ok) echo "Your strtoull() seems to be working okay." ;;
16408 Your strtoull() doesn't seem to be working okay.
16410 d_strtoull="$undef"
16417 : see if strtouq exists
16418 set strtouq d_strtouq
16421 case "$d_strtouq" in
16424 Checking whether your strtouq() works okay...
16426 $cat >try.c <<'EOCP'
16429 extern unsigned long long int strtouq(char *s, char **, int);
16430 static int bad = 0;
16431 void check(char *s, unsigned long long eull, int een) {
16432 unsigned long long gull;
16434 gull = strtouq(s, 0, 10);
16435 if (!((gull == eull) && (errno == een)))
16439 check(" 1", 1LL, 0);
16440 check(" 0", 0LL, 0);
16441 check("18446744073709551615", 18446744073709551615ULL, 0);
16442 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16443 #if 0 /* strtouq() for /^-/ strings is undefined. */
16444 check("-1", 18446744073709551615ULL, 0);
16445 check("-18446744073709551614", 2LL, 0);
16446 check("-18446744073709551615", 1LL, 0);
16447 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16448 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16456 if eval $compile; then
16457 case "`$run ./try`" in
16458 ok) echo "Your strtouq() seems to be working okay." ;;
16460 Your strtouq() doesn't seem to be working okay.
16469 : see if strxfrm exists
16470 set strxfrm d_strxfrm
16473 : see if symlink exists
16474 set symlink d_symlink
16477 : see if syscall exists
16478 set syscall d_syscall
16481 : see if prototype for syscall is available
16483 set d_syscallproto syscall $i_unistd unistd.h
16486 : see if sysconf exists
16487 set sysconf d_sysconf
16490 : see if system exists
16491 set system d_system
16494 : see if tcgetpgrp exists
16495 set tcgetpgrp d_tcgetpgrp
16498 : see if tcsetpgrp exists
16499 set tcsetpgrp d_tcsetpgrp
16502 : see if prototype for telldir is available
16504 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
16507 : see if time exists
16509 if test "X$d_time" = X -o X"$timetype" = X; then
16510 if set time val -f d_time; eval $csym; $val; then
16511 echo 'time() found.' >&4
16513 rp="What is the type returned by time() on this system?"
16514 set time_t timetype long stdio.h sys/types.h
16517 echo 'time() not found, hope that will do.' >&4
16525 : see if this is a sys/times.h system
16526 set sys/times.h i_systimes
16529 : see if times exists
16531 if set times val -f d_times; eval $csym; $val; then
16532 echo 'times() found.' >&4
16535 case "$i_systimes" in
16536 "$define") inc='sys/times.h';;
16538 rp="What is the type returned by times() on this system?"
16539 set clock_t clocktype long stdio.h sys/types.h $inc
16542 echo 'times() NOT found, hope that will do.' >&4
16547 : see if tmpnam_r exists
16548 set tmpnam_r d_tmpnam_r
16550 case "$d_tmpnam_r" in
16552 hdrs="$i_systypes sys/types.h define stdio.h "
16553 case "$d_tmpnam_r_proto:$usethreads" in
16554 ":define") d_tmpnam_r_proto=define
16555 set d_tmpnam_r_proto tmpnam_r $hdrs
16559 case "$d_tmpnam_r_proto" in
16561 case "$tmpnam_r_proto" in
16562 ''|0) try='char* tmpnam_r(char*);'
16563 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16565 case "$tmpnam_r_proto" in
16566 ''|0) d_tmpnam_r=undef
16568 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16569 * ) case "$tmpnam_r_proto" in
16570 REENTRANT_PROTO*) ;;
16571 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16573 echo "Prototype: $try" ;;
16576 *) case "$usethreads" in
16577 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16584 *) tmpnam_r_proto=0
16588 : see if truncate exists
16589 set truncate d_truncate
16592 : see if ttyname_r exists
16593 set ttyname_r d_ttyname_r
16595 case "$d_ttyname_r" in
16597 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16598 case "$d_ttyname_r_proto:$usethreads" in
16599 ":define") d_ttyname_r_proto=define
16600 set d_ttyname_r_proto ttyname_r $hdrs
16604 case "$d_ttyname_r_proto" in
16606 case "$ttyname_r_proto" in
16607 ''|0) try='int ttyname_r(int, char*, size_t);'
16608 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16610 case "$ttyname_r_proto" in
16611 ''|0) try='int ttyname_r(int, char*, int);'
16612 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16614 case "$ttyname_r_proto" in
16615 ''|0) try='char* ttyname_r(int, char*, int);'
16616 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16618 case "$ttyname_r_proto" in
16619 ''|0) d_ttyname_r=undef
16621 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16622 * ) case "$ttyname_r_proto" in
16623 REENTRANT_PROTO*) ;;
16624 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16626 echo "Prototype: $try" ;;
16629 *) case "$usethreads" in
16630 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16637 *) ttyname_r_proto=0
16641 : see if tzname[] exists
16643 if set tzname val -a d_tzname; eval $csym; $val; then
16645 echo 'tzname[] found.' >&4
16648 echo 'tzname[] NOT found.' >&4
16654 next|rhapsody|darwin) multiarch="$define" ;;
16656 case "$multiarch" in
16657 ''|[nN]*) multiarch="$undef" ;;
16660 : check for ordering of bytes in a UV
16662 case "$usecrosscompile$multiarch" in
16665 You seem to be either cross-compiling or doing a multiarchitecture build,
16666 skipping the byteorder check.
16672 case "$byteorder" in
16675 In the following, larger digits indicate more significance. A big-endian
16676 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16677 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16678 machines may have weird orders like 3412. A Cray will report 87654321,
16679 an Alpha will report 12345678. If the test program works the default is
16681 I'm now running the test program...
16685 #include <sys/types.h>
16686 typedef $uvtype UV;
16696 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16698 u.l = (UV)0x04030201;
16699 for (i = 0; i < $uvsize; i++)
16700 printf("%c", u.c[i]+'0');
16707 if eval $compile && ./try > /dev/null; then
16710 [1-4][1-4][1-4][1-4]|12345678|87654321)
16711 echo "(The test program ran ok.)"
16712 echo "byteorder=$dflt"
16715 ????|????????) echo "(The test program ran ok.)" ;;
16716 *) echo "(The test program didn't run right for some reason.)" ;;
16721 (I can't seem to compile the test program. Guessing big-endian...)
16724 case "$xxx_prompt" in
16726 rp="What is the order of bytes in $uvtype?"
16742 Checking to see whether you can access character data unalignedly...
16744 case "$d_u32align" in
16745 '') $cat >try.c <<EOCP
16747 #$i_stdlib I_STDLIB
16749 #include <stdlib.h>
16751 #define U32 $u32type
16752 #define BYTEORDER 0x$byteorder
16754 #include <signal.h>
16756 $signal_t bletch(s) int s; { exit(4); }
16759 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16764 if (sizeof(U32) != 4) {
16765 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16772 signal(SIGBUS, bletch);
16784 for (i = 0; i < 4; i++) {
16785 up = (U32*)(buf + i);
16786 if (! ((*up == 1 << (8*i)) || /* big-endian */
16787 (*up == 1 << (8*(3-i))) /* little-endian */
16791 printf("read failed (%x)\n", *up);
16797 for (i = 0; i < 4; i++) {
16798 up = (U32*)(buf + i);
16800 if (*up != 0xBeef) {
16801 printf("write failed (%x)\n", *up);
16815 if eval $compile_ok; then
16816 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16817 $run ./try 2>&1 >/dev/null
16820 You can access character data pretty unalignedly.
16822 d_u32align="$undef"
16825 It seems that you must access character data in an aligned manner.
16827 d_u32align="$define"
16831 rp='Can you access character data at unaligned addresses?'
16835 [yY]*) d_u32align="$undef" ;;
16836 *) d_u32align="$define" ;;
16839 $rm -f core core.try.* try.core
16843 : see if ualarm exists
16844 set ualarm d_ualarm
16847 : see if umask exists
16851 : see if unordered exists
16852 set unordered d_unordered
16855 : see if usleep exists
16856 set usleep d_usleep
16859 : see if prototype for usleep is available
16861 set d_usleepproto usleep $i_unistd unistd.h
16864 : see if ustat exists
16868 : backward compatibility for d_hvfork
16869 if test X$d_hvfork != X; then
16870 d_vfork="$d_hvfork"
16873 : see if there is a vfork
16878 : Ok, but do we want to use it. vfork is reportedly unreliable in
16879 : perl on Solaris 2.x, and probably elsewhere.
16883 case "$usevfork" in
16889 Perl can only use a vfork() that doesn't suffer from strict
16890 restrictions on calling functions or modifying global data in
16891 the child. For example, glibc-2.1 contains such a vfork()
16892 that is unsuitable. If your system provides a proper fork()
16893 call, chances are that you do NOT want perl to use vfork().
16896 rp="Do you still want to use vfork()?"
16901 echo "Ok, we won't use vfork()."
16910 $define) usevfork='true';;
16911 *) usevfork='false';;
16914 : see if closedir exists
16915 set closedir d_closedir
16918 case "$d_closedir" in
16921 echo "Checking whether closedir() returns a status..." >&4
16923 #$i_dirent I_DIRENT /**/
16924 #$i_sysdir I_SYS_DIR /**/
16925 #$i_sysndir I_SYS_NDIR /**/
16926 #$i_systypes I_SYS_TYPES /**/
16928 #if defined(I_SYS_TYPES)
16929 #include <sys/types.h>
16931 #if defined(I_DIRENT)
16932 #include <dirent.h>
16933 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16934 #include <sys/dir.h>
16938 #include <sys/ndir.h>
16942 #include <ndir.h> /* may be wrong in the future */
16944 #include <sys/dir.h>
16949 int main() { return closedir(opendir(".")); }
16952 if eval $compile_ok; then
16953 if $run ./try > /dev/null 2>&1 ; then
16954 echo "Yes, it does."
16957 echo "No, it doesn't."
16961 echo "(I can't seem to compile the test program--assuming it doesn't)"
16969 set d_void_closedir
16972 : see if there is a wait4
16976 : see if waitpid exists
16977 set waitpid d_waitpid
16980 : see if wcstombs exists
16981 set wcstombs d_wcstombs
16984 : see if wctomb exists
16985 set wctomb d_wctomb
16988 : see if writev exists
16989 set writev d_writev
16992 : preserve RCS keywords in files with variable substitution, grrr
16997 Revision='$Revision'
16999 : check for alignment requirements
17001 case "$usecrosscompile$multiarch" in
17004 You seem to be either cross-compiling or doing a multiarchitecture build,
17005 skipping the memory alignment check.
17008 case "$alignbytes" in
17009 '') alignbytes=8 ;;
17013 case "$alignbytes" in
17014 '') echo "Checking alignment constraints..." >&4
17015 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17016 $cat >try.c <<'EOCP'
17017 typedef long double NV;
17020 $cat >try.c <<'EOCP'
17024 $cat >>try.c <<'EOCP'
17032 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17037 if eval $compile_ok; then
17041 echo "(I can't seem to compile the test program...)"
17044 *) dflt="$alignbytes"
17047 rp="Doubles must be aligned on a how-many-byte boundary?"
17055 : set the base revision
17058 : how do we catenate cpp tokens here?
17060 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
17061 $cat >cpp_stuff.c <<'EOCP'
17062 #define RCAT(a,b)a/**/b
17063 #define ACAT(a,b)a ## b
17067 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17068 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17069 echo "Oh! Smells like ANSI's been here." >&4
17070 echo "We can catify or stringify, separately or together!"
17072 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17073 echo "Ah, yes! The good old days!" >&4
17074 echo "However, in the good old days we don't know how to stringify and"
17075 echo "catify at the same time."
17079 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
17080 to have to edit the values of CAT[2-5] in config.h...
17082 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17086 : see if this is a db.h system
17092 : Check db version.
17094 echo "Checking Berkeley DB version ..." >&4
17100 #include <sys/types.h>
17103 int main(int argc, char *argv[])
17105 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17106 int Major, Minor, Patch ;
17107 unsigned long Version ;
17108 (void)db_version(&Major, &Minor, &Patch) ;
17110 printf("%d %d %d %d %d %d\n",
17111 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17112 Major, Minor, Patch);
17115 printf("You have Berkeley DB Version 2 or greater.\n");
17117 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17118 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17119 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17120 Major, Minor, Patch) ;
17122 /* check that db.h & libdb are compatible */
17123 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17124 printf("db.h and libdb are incompatible.\n") ;
17128 printf("db.h and libdb are compatible.\n") ;
17130 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17131 + DB_VERSION_PATCH ;
17133 /* needs to be >= 2.3.4 */
17134 if (Version < 2003004) {
17135 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17136 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17142 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17147 printf("You have Berkeley DB Version 1.\n");
17148 exit(0); /* DB version < 2: the coast is clear. */
17150 exit(1); /* <db.h> not Berkeley DB? */
17156 if eval $compile_ok && $run ./try; then
17157 echo 'Looks OK.' >&4
17159 db_version_major=$1
17160 db_version_minor=$2
17161 db_version_patch=$3
17163 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17167 : Remove db from list of libraries to use
17168 echo "Removing unusable -ldb from library list" >&4
17169 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17172 echo "libs = $libs" >&4
17182 : Check the return type needed for hash
17184 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17190 #include <sys/types.h>
17193 #ifndef DB_VERSION_MAJOR
17194 u_int32_t hash_cb (ptr, size)
17202 info.hash = hash_cb;
17206 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17207 if $contains warning try.out >>/dev/null 2>&1 ; then
17210 db_hashtype='u_int32_t'
17213 : XXX Maybe we should just give up here.
17214 db_hashtype=u_int32_t
17216 echo "Help: I can't seem to compile the db test program." >&4
17217 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17220 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17222 *) db_hashtype=u_int32_t
17227 : Check the return type needed for prefix
17229 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17235 #include <sys/types.h>
17238 #ifndef DB_VERSION_MAJOR
17239 size_t prefix_cb (key1, key2)
17247 info.prefix = prefix_cb;
17251 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17252 if $contains warning try.out >>/dev/null 2>&1 ; then
17253 db_prefixtype='int'
17255 db_prefixtype='size_t'
17258 db_prefixtype='size_t'
17259 : XXX Maybe we should just give up here.
17261 echo "Help: I can't seem to compile the db test program." >&4
17262 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17265 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17267 *) db_prefixtype='size_t'
17272 : How can we generate normalized random numbers ?
17274 echo "Looking for a random number function..." >&4
17275 case "$randfunc" in
17277 if set drand48 val -f; eval $csym; $val; then
17279 echo "Good, found drand48()." >&4
17280 elif set random val -f; eval $csym; $val; then
17282 echo "OK, found random()." >&4
17285 echo "Yick, looks like I have to use rand()." >&4
17296 *-Dmy_rand=*|*-Dmy_srand=*)
17297 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17298 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17299 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17300 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17304 while $test "$cont"; do
17305 rp="Use which function to generate random numbers?"
17307 if $test "$ans" = "$dflt"; then
17313 if set $ans val -f; eval $csym; $val; then
17317 rp="I cannot find function $ans. Use that name anyway?"
17326 case "$randfunc" in
17328 drand01="drand48()"
17334 case "$randbits" in
17336 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17338 #$i_unistd I_UNISTD
17339 #$i_stdlib I_STDLIB
17342 # include <unistd.h>
17345 # include <stdlib.h>
17350 register unsigned long tmp;
17351 register unsigned long max = 0L;
17353 for (i = 1000; i; i--) {
17354 tmp = (unsigned long) $randfunc();
17355 if (tmp > max) max = tmp;
17357 for (i = 0; max; i++)
17363 if eval $compile_ok; then
17367 echo "(I can't seem to compile the test program...)"
17374 rp="How many bits does your $randfunc() function produce?"
17378 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17379 seedfunc="s$randfunc"
17380 randseedtype=unsigned
17384 rp="How many bits does your $randfunc() function produce?"
17387 seedfunc="s$randfunc"
17388 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17389 if set $seedfunc val -f; eval $csym; $val; then
17390 echo "(Using $seedfunc() to seed random generator)"
17392 echo "(Warning: no $seedfunc() to seed random generator)"
17395 randseedtype=unsigned
17403 echo "Determining whether or not we are on an EBCDIC system..." >&4
17404 $cat >try.c <<'EOM'
17407 if ('M'==0xd4) return 0;
17414 if eval $compile_ok; then
17415 if $run ./try; then
17416 echo "You seem to speak EBCDIC." >&4
17419 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
17422 echo "I'm unable to compile the test program." >&4
17423 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
17431 Checking how to flush all pending stdio output...
17433 # I only know how to find the first 32 possibly open files on SunOS.
17434 # See also hints/sunos_4_1.sh and util.c --AD
17436 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
17438 $cat >>try.c <<EOCP
17440 #$i_unistd I_UNISTD
17442 # include <unistd.h>
17444 #$d_sysconf HAS_SYSCONF
17445 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
17446 #ifdef HAS_STDIO_STREAM_ARRAY
17447 # define STDIO_STREAM_ARRAY $stdio_stream_array
17452 p = fopen("try.out", "w");
17456 # ifdef TRY_FPRINTF
17460 #ifdef TRY_FFLUSH_NULL
17463 #ifdef TRY_FFLUSH_ALL
17465 long open_max = -1;
17466 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
17467 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
17469 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
17470 open_max = sysconf(_SC_OPEN_MAX);
17473 open_max = FOPEN_MAX;
17476 open_max = OPEN_MAX;
17485 # ifdef HAS_STDIO_STREAM_ARRAY
17486 if (open_max > 0) {
17488 for (i = 0; i < open_max; i++)
17489 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
17490 STDIO_STREAM_ARRAY[i]._file < open_max &&
17491 STDIO_STREAM_ARRAY[i]._flag)
17492 fflush(&STDIO_STREAM_ARRAY[i]);
17500 : first we have to find out how _not_ to flush
17502 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
17504 set try -DTRY_FPUTC
17505 if eval $compile; then
17506 $run ./try 2>/dev/null
17509 if $test ! -s try.out -a "X$code" = X42; then
17515 set try -DTRY_FPRINTF
17516 if eval $compile; then
17517 $run ./try 2>/dev/null
17520 if $test ! -s try.out -a "X$code" = X42; then
17521 output=-DTRY_FPRINTF
17527 : check for fflush NULL behaviour
17528 case "$fflushNULL" in
17529 '') set try -DTRY_FFLUSH_NULL $output
17530 if eval $compile; then
17531 $run ./try 2>/dev/null
17534 if $test -s try.out -a "X$code" = X42; then
17535 fflushNULL="`$cat try.out`"
17537 if $test "X$code" != X42; then
17539 (If this test failed, don't worry, we'll try another method shortly.)
17544 $rm -f core try.core core.try.*
17545 case "$fflushNULL" in
17547 Your fflush(NULL) works okay for output streams.
17548 Let's see if it clobbers input pipes...
17550 # As of mid-March 2000 all versions of Solaris appear to have a stdio
17551 # bug that improperly flushes the input end of pipes. So we avoid the
17552 # autoflush on fork/system/exec support for now. :-(
17553 $cat >tryp.c <<EOCP
17556 main(int argc, char **argv)
17562 while ((i = getc(stdin)) != -1
17563 && (*bp++ = i) != '\n'
17564 && bp < &buf[1024])
17567 fprintf(stdout, "%s", buf);
17575 fflushNULL="$define"
17577 if eval $compile; then
17579 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17580 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17582 fflush(NULL) seems to behave okay with input streams.
17584 fflushNULL="$define"
17587 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17589 fflushNULL="$undef"
17592 $rm -f core tryp.c tryp.core core.tryp.*
17595 Your fflush(NULL) isn't working (contrary to ANSI C).
17597 fflushNULL="$undef"
17600 Cannot figure out whether your fflush(NULL) works or not.
17601 I'm assuming it doesn't (contrary to ANSI C).
17603 fflushNULL="$undef"
17607 $define|true|[yY]*)
17608 fflushNULL="$define"
17611 fflushNULL="$undef"
17614 : check explicit looping only if NULL did not work, and if the pipe
17615 : bug does not show up on an explicit flush too
17616 case "$fflushNULL" in
17618 $cat >tryp.c <<EOCP
17621 main(int argc, char **argv)
17627 while ((i = getc(stdin)) != -1
17628 && (*bp++ = i) != '\n'
17629 && bp < &buf[1024])
17632 fprintf(stdout, "%s", buf);
17641 if eval $compile; then
17643 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17644 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17646 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17648 : now check for fflushall behaviour
17649 case "$fflushall" in
17650 '') set try -DTRY_FFLUSH_ALL $output
17651 if eval $compile; then
17653 (Now testing the other method--but note that this also may fail.)
17655 $run ./try 2>/dev/null
17658 if $test -s try.out -a "X$code" = X42; then
17659 fflushall="`$cat try.out`"
17662 $rm -f core try.core core.try.*
17663 case "$fflushall" in
17665 Whew. Flushing explicitly all the stdio streams works.
17667 fflushall="$define"
17670 Sigh. Flushing explicitly all the stdio streams doesn't work.
17675 Cannot figure out whether flushing stdio streams explicitly works or not.
17676 I'm assuming it doesn't.
17682 "$define"|true|[yY]*)
17683 fflushall="$define"
17691 All is futile. Even fflush(stdin) clobbers input pipes!
17698 $rm -f core tryp.c tryp.core core.tryp.*
17700 *) fflushall="$undef"
17704 case "$fflushNULL$fflushall" in
17707 OK, I give up. I cannot figure out how to flush pending stdio output.
17708 We won't be flushing handles at all before fork/exec/popen.
17712 $rm -f try.* try$exe_ext
17714 : Store the full pathname to the ar program for use in the C program
17715 : Respect a hint or command line value for full_ar.
17720 : Store the full pathname to the sed program for use in the C program
17723 : see what type gids are declared as in the kernel
17725 echo "Looking for the type for group ids returned by getgid()."
17726 set gid_t gidtype xxx stdio.h sys/types.h
17730 xxx=`./findhdr sys/user.h`
17731 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17733 unsigned) dflt="$1 $2" ;;
17737 *) dflt="$gidtype";;
17740 gid_t) echo "gid_t found." ;;
17741 *) rp="What is the type for group ids returned by getgid()?"
17749 *_t) zzz="$gidtype" ;;
17752 echo "Checking the size of $zzz..." >&4
17754 #include <sys/types.h>
17756 #$i_stdlib I_STDLIB
17758 #include <stdlib.h>
17761 printf("%d\n", (int)sizeof($gidtype));
17766 if eval $compile_ok; then
17770 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17773 echo "Your $zzz is $gidsize bytes long."
17778 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17784 *_t) zzz="$gidtype" ;;
17787 echo "Checking the sign of $zzz..." >&4
17789 #include <sys/types.h>
17800 if eval $compile; then
17804 echo "(I can't execute the test program--guessing unsigned.)" >&4
17808 1) echo "Your $zzz is unsigned." ;;
17809 -1) echo "Your $zzz is signed." ;;
17815 echo "(I can't compile the test program--guessing unsigned.)" >&4
17821 if $test X"$quadtype" != X; then
17823 echo "Checking how to print 64-bit integers..." >&4
17825 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17826 $cat >try.c <<'EOCP'
17827 #include <sys/types.h>
17830 int q = 12345678901;
17831 printf("%ld\n", q);
17835 if eval $compile; then
17839 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17840 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17841 echo "We will use %d."
17847 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17848 $cat >try.c <<'EOCP'
17849 #include <sys/types.h>
17852 long q = 12345678901;
17853 printf("%ld\n", q);
17857 if eval $compile; then
17861 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17862 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17863 echo "We will use %ld."
17869 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17870 $cat >try.c <<'EOCP'
17871 #include <sys/types.h>
17872 #include <inttypes.h>
17875 int64_t q = 12345678901;
17876 printf("%" PRId64 "\n", q);
17880 if eval $compile; then
17884 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17885 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17886 echo "We will use the C9X style."
17892 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17894 #include <sys/types.h>
17897 $quadtype q = 12345678901;
17898 printf("%Ld\n", q);
17902 if eval $compile; then
17906 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17907 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17908 echo "We will use %Ld."
17914 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17915 $cat >try.c <<'EOCP'
17916 #include <sys/types.h>
17919 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17920 printf("%lld\n", q);
17924 if eval $compile; then
17928 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17929 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17930 echo "We will use the %lld style."
17936 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17938 #include <sys/types.h>
17941 $quadtype q = 12345678901;
17942 printf("%qd\n", q);
17946 if eval $compile; then
17950 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17951 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17952 echo "We will use %qd."
17958 if $test X"$sPRId64" = X; then
17959 echo "Cannot figure out how to print 64-bit integers." >&4
17967 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17968 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17970 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17971 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17977 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17979 if $test X"$ivsize" = X8; then
17980 ivdformat="$sPRId64"
17981 uvuformat="$sPRIu64"
17982 uvoformat="$sPRIo64"
17983 uvxformat="$sPRIx64"
17984 uvXUformat="$sPRIXU64"
17986 if $test X"$ivsize" = X"$longsize"; then
17993 if $test X"$ivsize" = X"$intsize"; then
18001 if $test X"$ivsize" = X"$shortsize"; then
18012 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18013 nveformat="$sPRIeldbl"
18014 nvfformat="$sPRIfldbl"
18015 nvgformat="$sPRIgldbl"
18016 nvEUformat="$sPRIEUldbl"
18017 nvFUformat="$sPRIFUldbl"
18018 nvGUformat="$sPRIGUldbl"
18028 case "$ivdformat" in
18029 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18036 $echo "Checking the format string to be used for gids..." >&4
18039 -1) if $test X"$gidsize" = X"$ivsize"; then
18040 gidformat="$ivdformat"
18042 if $test X"$gidsize" = X"$longsize"; then
18045 if $test X"$gidsize" = X"$intsize"; then
18048 if $test X"$gidsize" = X"$shortsize"; then
18055 *) if $test X"$gidsize" = X"$uvsize"; then
18056 gidformat="$uvuformat"
18058 if $test X"$gidsize" = X"$longsize"; then
18061 if $test X"$gidsize" = X"$intsize"; then
18064 if $test X"$gidsize" = X"$shortsize"; then
18073 : see if getgroups exists
18074 set getgroups d_getgrps
18077 : see if setgroups exists
18078 set setgroups d_setgrps
18082 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18084 case "$d_getgrps$d_setgrps" in
18086 case "$groupstype" in
18087 '') dflt="$gidtype" ;;
18088 *) dflt="$groupstype" ;;
18091 What type of pointer is the second argument to getgroups() and setgroups()?
18092 Usually this is the same as group ids, $gidtype, but not always.
18095 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18099 *) groupstype="$gidtype";;
18103 echo "Checking if your $make program sets \$(MAKE)..." >&4
18104 case "$make_set_make" in
18106 $sed 's/^X //' > testmake.mak << 'EOF'
18108 X @echo 'maketemp="$(MAKE)"'
18110 case "`$make -f testmake.mak 2>/dev/null`" in
18111 *maketemp=*) make_set_make='#' ;;
18112 *) make_set_make="MAKE=$make" ;;
18114 $rm -f testmake.mak
18117 case "$make_set_make" in
18118 '#') echo "Yup, it does.";;
18119 *) echo "Nope, it doesn't.";;
18122 : see what type is used for mode_t
18123 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18124 set mode_t modetype int stdio.h sys/types.h
18127 : see if stdarg is available
18129 if $test `./findhdr stdarg.h`; then
18130 echo "<stdarg.h> found." >&4
18133 echo "<stdarg.h> NOT found." >&4
18137 : see if varags is available
18139 if $test `./findhdr varargs.h`; then
18140 echo "<varargs.h> found." >&4
18142 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18145 : set up the varargs testing programs
18146 $cat > varargs.c <<EOP
18148 #include <stdarg.h>
18151 #include <varargs.h>
18155 int f(char *p, ...)
18169 p = va_arg(ap, char *);
18174 $cat > varargs <<EOP
18176 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18185 : now check which varargs header should be included
18190 if `./varargs I_STDARG`; then
18192 elif `./varargs I_VARARGS`; then
18197 if `./varargs I_VARARGS`; then
18204 echo "I could not find the definition for va_dcl... You have problems..." >&4
18205 val="$undef"; set i_stdarg; eval $setvar
18206 val="$undef"; set i_varargs; eval $setvar
18211 case "$i_varhdr" in
18213 val="$define"; set i_stdarg; eval $setvar
18214 val="$undef"; set i_varargs; eval $setvar
18217 val="$undef"; set i_stdarg; eval $setvar
18218 val="$define"; set i_varargs; eval $setvar
18221 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18225 : see if we need va_copy
18227 case "$i_stdarg" in
18230 #include <stdarg.h>
18232 #$i_stdlib I_STDLIB
18234 #include <stdlib.h>
18236 #include <signal.h>
18239 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18241 return vfprintf(f, fmt, *valp);
18245 myvfprintf(FILE *f, const char *fmt, va_list val)
18247 return ivfprintf(f, fmt, &val);
18251 myprintf(char *fmt, ...)
18254 va_start(val, fmt);
18255 return myvfprintf(stdout, fmt, val);
18259 main(int ac, char **av)
18261 signal(SIGSEGV, exit);
18263 myprintf("%s%cs all right, then\n", "that", '\'');
18268 if eval $compile && $run ./try 2>&1 >/dev/null; then
18269 case "`$run ./try`" in
18270 "that's all right, then")
18276 yes) echo "It seems that you don't need va_copy()." >&4
18277 need_va_copy="$undef"
18279 *) echo "It seems that va_copy() or similar will be needed." >&4
18280 need_va_copy="$define"
18283 $rm -f try.* core core.* *.core *.core.*
18285 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18289 : see what type is used for size_t
18290 rp="What is the type used for the length parameter for string functions?"
18291 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18294 : check for type of arguments to gethostbyaddr.
18295 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18296 case "$d_gethbyaddr" in
18300 Checking to see what type of arguments are accepted by gethostbyaddr().
18302 hdrs="$define sys/types.h
18303 $d_socket sys/socket.h
18304 $i_niin netinet/in.h
18306 $i_unistd unistd.h"
18307 : The first arg can 'char *' or 'void *'
18308 : The second arg is some of integral type
18309 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18310 for yyy in size_t long int; do
18311 case "$netdb_host_type" in
18312 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18313 if ./protochk "$try" $hdrs; then
18314 echo "Your system accepts $xxx for the first arg."
18315 echo "...and $yyy for the second arg."
18316 netdb_host_type="$xxx"
18317 netdb_hlen_type="$yyy"
18323 : In case none of those worked, prompt the user.
18324 case "$netdb_host_type" in
18325 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18328 netdb_host_type=$ans
18329 rp='What is the type for the 2nd argument to gethostbyaddr?'
18332 netdb_hlen_type=$ans
18336 *) : no gethostbyaddr, so pick harmless defaults
18337 netdb_host_type='char *'
18338 netdb_hlen_type="$sizetype"
18341 # Remove the "const" if needed. -- but then we'll have a
18343 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18346 : check for type of argument to gethostbyname.
18347 if test "X$netdb_name_type" = X ; then
18348 case "$d_gethbyname" in
18352 Checking to see what type of argument is accepted by gethostbyname().
18354 hdrs="$define sys/types.h
18355 $d_socket sys/socket.h
18356 $i_niin netinet/in.h
18358 $i_unistd unistd.h"
18359 for xxx in "const char *" "char *"; do
18360 case "$netdb_name_type" in
18361 '') try="extern struct hostent *gethostbyname($xxx);"
18362 if ./protochk "$try" $hdrs; then
18363 echo "Your system accepts $xxx."
18364 netdb_name_type="$xxx"
18369 : In case none of those worked, prompt the user.
18370 case "$netdb_name_type" in
18371 '') rp='What is the type for the 1st argument to gethostbyname?'
18374 netdb_name_type=$ans
18378 *) : no gethostbyname, so pick harmless default
18379 netdb_name_type='char *'
18384 : check for type of 1st argument to getnetbyaddr.
18385 if test "X$netdb_net_type" = X ; then
18386 case "$d_getnbyaddr" in
18390 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18392 hdrs="$define sys/types.h
18393 $d_socket sys/socket.h
18394 $i_niin netinet/in.h
18396 $i_unistd unistd.h"
18397 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
18398 case "$netdb_net_type" in
18399 '') try="extern struct netent *getnetbyaddr($xxx, int);"
18400 if ./protochk "$try" $hdrs; then
18401 echo "Your system accepts $xxx."
18402 netdb_net_type="$xxx"
18407 : In case none of those worked, prompt the user.
18408 case "$netdb_net_type" in
18409 '') rp='What is the type for the 1st argument to getnetbyaddr?'
18412 netdb_net_type=$ans
18416 *) : no getnetbyaddr, so pick harmless default
18417 netdb_net_type='long'
18421 : locate the preferred pager for this system
18428 [a-zA-Z]:/*) dflt=$pg;;
18432 [a-zA-Z]:/*) dflt=$more;;
18436 [a-zA-Z]:/*) dflt=$less;;
18439 '') dflt=/usr/ucb/more;;
18443 : Instruct ./getfile to trust the hinted or previous pager value,
18444 : even if it does not begin with a slash. For example, on os2,
18445 : pager might be cmd /c more. See comments in UU/getfile.
18450 rp='What pager is used on your system?'
18454 : see what type pids are declared as in the kernel
18455 rp="What is the type of process ids on this system?"
18456 set pid_t pidtype int stdio.h sys/types.h
18459 : Find earliest binary compatible site_perl subdirectory perl can use.
18460 xs_apiversion=$version # The current site_perl version.
18461 : Find earliest pure perl site_perl subdirectory perl can use.
18462 : The versioned directories started at 5.005.
18463 pm_apiversion='5.005'
18465 : see if ar generates random libraries by itself
18467 echo "Checking how to generate random libraries on your machine..." >&4
18468 echo 'int bar1() { return bar2(); }' > bar1.c
18469 echo 'int bar2() { return 2; }' > bar2.c
18470 $cat > foo.c <<'EOP'
18471 int main() { printf("%d\n", bar1()); exit(0); }
18473 $cc $ccflags -c bar1.c >/dev/null 2>&1
18474 $cc $ccflags -c bar2.c >/dev/null 2>&1
18475 $cc $ccflags -c foo.c >/dev/null 2>&1
18476 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
18477 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18478 $run ./foobar >/dev/null 2>&1; then
18479 echo "$ar appears to generate random libraries itself."
18482 elif $ar ts bar$_a >/dev/null 2>&1 &&
18483 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18484 $run ./foobar >/dev/null 2>&1; then
18485 echo "a table of contents needs to be added with '$ar ts'."
18492 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
18493 $test -f $ranlib || ranlib=''
18496 if $test -n "$ranlib"; then
18497 echo "your system has '$ranlib'; we'll use that."
18500 echo "your system doesn't seem to support random libraries"
18501 echo "so we'll use lorder and tsort to order the libraries."
18508 : check for type of arguments to select.
18509 case "$selecttype" in
18510 '') case "$d_select" in
18514 Checking to see what type of arguments are accepted by select().
18516 hdrs="$define sys/types.h
18517 $i_systime sys/time.h
18518 $i_sysselct sys/select.h
18519 $d_socket sys/socket.h"
18520 : The first arg can be int, unsigned, or size_t
18521 : The last arg may or may not be 'const'
18523 : void pointer has been seen but using that
18524 : breaks the selectminbits test
18525 for xxx in 'fd_set *' 'int *'; do
18526 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
18527 for tmo in 'struct timeval *' 'const struct timeval *'; do
18529 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
18530 if ./protochk "$try" $hdrs; then
18531 echo "Your system accepts $xxx."
18540 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
18541 case "$d_fd_set" in
18542 $define) dflt="fd_set *" ;;
18551 *) : no select, so pick a harmless default
18558 : check for the select 'width'
18559 case "$selectminbits" in
18560 '') case "$d_select" in
18564 Checking to see on how many bits at a time your select() operates...
18567 #include <sys/types.h>
18569 #$i_systime I_SYS_TIME
18570 #$i_systimek I_SYS_TIME_KERNEL
18575 # ifdef I_SYS_TIME_KERNEL
18578 # include <sys/time.h>
18579 # ifdef I_SYS_TIME_KERNEL
18583 #$i_sysselct I_SYS_SELECT
18584 #ifdef I_SYS_SELECT
18585 #include <sys/select.h>
18587 #$d_socket HAS_SOCKET
18589 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18592 #$i_stdlib I_STDLIB
18594 #include <stdlib.h>
18597 #define S sizeof(*(b))
18599 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18600 #define NBITS (NBYTES * 8)
18609 fp = fopen("try.c", "r");
18615 b = ($selecttype)s;
18616 for (i = 0; i < NBITS; i++)
18620 select(fd + 1, b, 0, 0, &t);
18621 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18622 printf("%d\n", i + 1);
18627 if eval $compile_ok; then
18628 selectminbits=`$run ./try`
18629 case "$selectminbits" in
18631 Cannot figure out on how many bits at a time your select() operates.
18632 I'll play safe and guess it is 32 bits.
18638 *) bits="$selectminbits bits" ;;
18640 echo "Your select() operates on $bits at a time." >&4
18642 rp='What is the minimum number of bits your select() operates on?'
18643 case "$byteorder" in
18644 1234|12345678) dflt=32 ;;
18649 selectminbits="$val"
18653 *) : no select, so pick a harmless default
18660 : Trace out the files included by signal.h, then look for SIGxxx names.
18661 : Remove SIGARRAYSIZE used by HPUX.
18662 : Remove SIGSTKSIZE used by Linux.
18663 : Remove SIGSTKSZ used by Posix.
18664 : Remove SIGTYP void lines used by OS2.
18665 : Some cpps, like os390, dont give the file name anywhere
18666 if [ "X$fieldn" = X ]; then
18667 : Just make some guesses. We check them later.
18668 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18670 xxx=`echo '#include <signal.h>' |
18671 $cppstdin $cppminus $cppflags 2>/dev/null |
18672 $grep '^[ ]*#.*include' |
18673 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18675 : Check this list of files to be sure we have parsed the cpp output ok.
18676 : This will also avoid potentially non-existent files, such
18679 for xx in $xxx /dev/null ; do
18680 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18682 : If we have found no files, at least try signal.h
18683 case "$xxxfiles" in
18684 '') xxxfiles=`./findhdr signal.h` ;;
18687 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18688 print substr($2, 4, 20)
18690 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18691 print substr($3, 4, 20)
18693 : Append some common names just in case the awk scan failed.
18694 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18695 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18696 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18697 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18698 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18700 : generate a few handy files for later
18701 $cat > signal.c <<'EOCP'
18702 #include <sys/types.h>
18703 #include <signal.h>
18707 /* Strange style to avoid deeply-nested #if/#else/#endif */
18710 # define NSIG (_NSIG)
18716 # define NSIG (SIGMAX+1)
18722 # define NSIG (SIG_MAX+1)
18728 # define NSIG (MAXSIG+1)
18734 # define NSIG (MAX_SIG+1)
18739 # ifdef SIGARRAYSIZE
18740 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18746 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18750 /* Default to some arbitrary number that's big enough to get most
18751 of the common signals.
18757 printf("NSIG %d\n", NSIG);
18763 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18765 printf "#ifdef SIG"; printf $1; printf "\n"
18766 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18767 printf $1; printf ");\n"
18771 printf "#endif /* JUST_NSIG */\n";
18772 printf "exit(0);\n}\n";
18775 $cat >signal.awk <<'EOP'
18776 BEGIN { ndups = 0 }
18777 $1 ~ /^NSIG$/ { nsig = $2 }
18778 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
18779 if ($2 > maxsig) { maxsig = $2 }
18780 if (sig_name[$2]) {
18781 dup_name[ndups] = $1
18782 dup_num[ndups] = $2
18794 printf("NSIG %d\n", nsig);
18795 for (n = 1; n < nsig; n++) {
18797 printf("%s %d\n", sig_name[n], sig_num[n])
18800 printf("NUM%d %d\n", n, n)
18803 for (n = 0; n < ndups; n++) {
18804 printf("%s %d\n", dup_name[n], dup_num[n])
18808 $cat >signal_cmd <<EOS
18810 if $test -s signal.lst; then
18811 echo "Using your existing signal.lst file"
18816 $cat >>signal_cmd <<'EOS'
18819 if eval $compile_ok; then
18820 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18822 echo "(I can't seem be able to compile the whole test program)" >&4
18823 echo "(I'll try it in little pieces.)" >&4
18824 set signal -DJUST_NSIG
18825 if eval $compile_ok; then
18826 $run ./signal$_exe > signal.nsg
18829 echo "I can't seem to figure out how many signals you have." >&4
18830 echo "Guessing 50." >&4
18831 echo 'NSIG 50' > signal.nsg
18833 : Now look at all the signal names, one at a time.
18834 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18835 $cat > signal.c <<EOCP
18836 #include <sys/types.h>
18837 #include <signal.h>
18840 printf("$xx %d\n", SIG${xx});
18845 if eval $compile; then
18846 echo "SIG${xx} found."
18847 $run ./signal$_exe >> signal.ls1
18849 echo "SIG${xx} NOT found."
18852 if $test -s signal.ls1; then
18853 $cat signal.nsg signal.ls1 |
18854 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18858 if $test -s signal.lst; then
18861 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18862 echo 'kill -l' >signal
18863 set X `csh -f <signal`
18867 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18869 echo $@ | $tr ' ' $trnl | \
18870 $awk '{ printf "%s %d\n", $1, ++s; }
18871 END { printf "NSIG %d\n", ++s }' >signal.lst
18873 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18875 chmod a+x signal_cmd
18876 $eunicefix signal_cmd
18878 : generate list of signal names
18880 case "$sig_name_init" in
18882 *) case "$sig_num_init" in
18883 ''|*,*) doinit=yes ;;
18888 echo "Generating a list of signal names and numbers..." >&4
18890 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18891 sig_name=`$awk 'BEGIN { printf "ZERO " }
18892 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18893 sig_num=`$awk 'BEGIN { printf "0 " }
18894 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18895 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18896 !/^NSIG/ { printf "\"%s\", ", $1 }
18897 END { printf "0\n" }' signal.lst`
18898 sig_num_init=`$awk 'BEGIN { printf "0, " }
18899 !/^NSIG/ { printf "%d, ", $2}
18900 END { printf "0\n"}' signal.lst`
18903 echo "The following $sig_count signals are available:"
18905 echo $sig_name | $awk \
18906 'BEGIN { linelen = 0 }
18908 for (i = 1; i <= NF; i++) {
18909 name = "SIG" $i " "
18910 linelen = linelen + length(name)
18911 if (linelen > 70) {
18913 linelen = length(name)
18919 sig_size=`echo $sig_name | awk '{print NF}'`
18920 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18923 case "$sizetype" in
18924 *_t) zzz="$sizetype" ;;
18925 *) zzz="filesize" ;;
18927 echo "Checking the size of $zzz..." >&4
18929 #include <sys/types.h>
18931 #$i_stdlib I_STDLIB
18933 #include <stdlib.h>
18936 printf("%d\n", (int)sizeof($sizetype));
18941 if eval $compile_ok; then
18945 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18948 echo "Your $zzz size is $sizesize bytes."
18953 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18957 : check for socklen_t
18959 echo "Checking to see if you have socklen_t..." >&4
18961 #include <sys/types.h>
18962 #$d_socket HAS_SOCKET
18964 #include <sys/socket.h>
18966 int main() { socklen_t x = 16; }
18969 if eval $compile; then
18971 echo "You have socklen_t."
18974 echo "You do not have socklen_t."
18975 case "$sizetype" in
18976 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18983 : see if this is a socks.h system
18984 set socks.h i_socks
18987 : check for type of the size argument to socket calls
18988 case "$d_socket" in
18992 Checking to see what type is the last argument of accept().
18995 case "$d_socklen_t" in
18996 "$define") yyy="$yyy socklen_t"
18998 yyy="$yyy $sizetype int long unsigned"
18999 for xxx in $yyy; do
19000 case "$socksizetype" in
19001 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19002 case "$usesocks" in
19004 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19005 echo "Your system accepts '$xxx *' for the last argument of accept()."
19006 socksizetype="$xxx"
19009 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19010 echo "Your system accepts '$xxx *' for the last argument of accept()."
19011 socksizetype="$xxx"
19018 : In case none of those worked, prompt the user.
19019 case "$socksizetype" in
19020 '') rp='What is the type for socket address structure sizes?'
19027 *) : no sockets, so pick relatively harmless default
19032 : see what type is used for signed size_t
19033 set ssize_t ssizetype int stdio.h sys/types.h
19038 #$i_stdlib I_STDLIB
19040 #include <stdlib.h>
19042 #include <sys/types.h>
19043 #define Size_t $sizetype
19044 #define SSize_t $dflt
19047 if (sizeof(Size_t) == sizeof(SSize_t))
19049 else if (sizeof(Size_t) == sizeof(int))
19058 if eval $compile_ok && $run ./try > /dev/null; then
19059 ssizetype=`$run ./try`
19060 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19063 Help! I can't compile and run the ssize_t test program: please enlighten me!
19064 (This is probably a misconfiguration in your system or libraries, and
19065 you really ought to fix it. Still, I'll try anyway.)
19067 I need a type that is the same size as $sizetype, but is guaranteed to
19068 be signed. Common values are ssize_t, int and long.
19071 rp="What signed type is the same size as $sizetype?"
19077 : see what type of char stdio uses.
19079 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19080 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19081 echo "Your stdio uses unsigned chars." >&4
19082 stdchar="unsigned char"
19084 echo "Your stdio uses signed chars." >&4
19091 : see what type uids are declared as in the kernel
19093 echo "Looking for the type for user ids returned by getuid()."
19094 set uid_t uidtype xxx stdio.h sys/types.h
19098 xxx=`./findhdr sys/user.h`
19099 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19101 unsigned) dflt="$1 $2" ;;
19105 *) dflt="$uidtype";;
19108 uid_t) echo "uid_t found." ;;
19109 *) rp="What is the type for user ids returned by getuid()?"
19117 *_t) zzz="$uidtype" ;;
19120 echo "Checking the size of $zzz..." >&4
19122 #include <sys/types.h>
19124 #$i_stdlib I_STDLIB
19126 #include <stdlib.h>
19129 printf("%d\n", (int)sizeof($uidtype));
19134 if eval $compile_ok; then
19138 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19141 echo "Your $zzz is $uidsize bytes long."
19146 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19151 *_t) zzz="$uidtype" ;;
19154 echo "Checking the sign of $zzz..." >&4
19156 #include <sys/types.h>
19167 if eval $compile; then
19171 echo "(I can't execute the test program--guessing unsigned.)" >&4
19175 1) echo "Your $zzz is unsigned." ;;
19176 -1) echo "Your $zzz is signed." ;;
19182 echo "(I can't compile the test program--guessing unsigned.)" >&4
19188 $echo "Checking the format string to be used for uids..." >&4
19191 -1) if $test X"$uidsize" = X"$ivsize"; then
19192 uidformat="$ivdformat"
19194 if $test X"$uidsize" = X"$longsize"; then
19197 if $test X"$uidsize" = X"$intsize"; then
19200 if $test X"$uidsize" = X"$shortsize"; then
19207 *) if $test X"$uidsize" = X"$uvsize"; then
19208 uidformat="$uvuformat"
19210 if $test X"$uidsize" = X"$longsize"; then
19213 if $test X"$uidsize" = X"$intsize"; then
19216 if $test X"$uidsize" = X"$shortsize"; then
19225 : determine compiler compiler
19234 if $test -f "$byacc$_exe"; then
19236 comp="byacc or $comp"
19238 if $test -f "$bison$_exe"; then
19239 comp="$comp or bison -y"
19241 rp="Which compiler compiler ($comp) shall I use?"
19250 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19256 : see if this is a fp.h system
19260 : see if this is a fp_class.h system
19261 set fp_class.h i_fp_class
19264 : see if this is a ieeefp.h system
19265 case "$i_ieeefp" in
19266 '' ) set ieeefp.h i_ieeefp
19271 : see if this is a libutil.h system
19272 set libutil.h i_libutil
19275 : see if mach cthreads are available
19276 if test "X$usethreads" = "X$define"; then
19277 set mach/cthreads.h i_machcthr
19280 i_machcthr="$undef"
19285 : see if this is a math.h system
19289 : see if this is a mntent.h system
19290 set mntent.h i_mntent
19293 : see if ndbm.h is available
19299 # Some Linux distributions such as RedHat 7.1 put the
19300 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19301 if $test -f /usr/include/gdbm/ndbm.h; then
19302 echo '<gdbm/ndbm.h> found.'
19303 ccflags="$ccflags -I/usr/include/gdbm"
19304 cppflags="$cppflags -I/usr/include/gdbm"
19312 : see if dbm_open exists
19313 set dbm_open d_dbm_open
19315 case "$d_dbm_open" in
19318 echo "We won't be including <ndbm.h>"
19327 : see if net/errno.h is available
19329 set net/errno.h val
19332 : Unfortunately, it causes problems on some systems. Arrgh.
19335 cat > try.c <<'EOM'
19338 #include <net/errno.h>
19344 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19345 echo "We'll be including <net/errno.h>." >&4
19347 echo "We won't be including <net/errno.h>." >&4
19356 : see if netinet/tcp.h is available
19357 set netinet/tcp.h i_netinettcp
19360 : see if this is a poll.h system
19364 : see if this is a prot.h system
19369 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19370 $cat <<'EOSH' > Cppsym.know
19371 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19372 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19373 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19374 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
19375 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
19376 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
19377 bull c cadmus clipper CMU COFF COMPILER_VERSION
19378 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
19379 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
19380 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
19381 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
19383 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
19384 H3050R H3050RX hbullx20 hcx host_mips
19385 hp200 hp300 hp700 HP700 hp800 hp9000
19386 hp9000s200 hp9000s300 hp9000s400 hp9000s500
19387 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
19388 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
19389 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
19390 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
19391 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
19392 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
19393 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
19394 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
19395 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
19396 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
19397 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
19398 MATH_HAS_NO_SIDE_EFFECTS
19399 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
19400 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
19401 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
19402 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
19403 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
19404 NetBSD news1500 news1700 news1800 news1900 news3700
19405 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
19406 ns32016 ns32332 ns32k nsc32000
19407 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
19408 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
19409 pc532 pdp11 PGC PIC plexus PORTAR posix
19410 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
19411 POSIX_C_SOURCE POSIX_SOURCE POWER
19412 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
19413 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
19414 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
19415 sony sony_news sonyrisc sparc sparclite spectrum
19416 stardent stdc STDC_EXT stratos sun sun3 sun386
19417 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
19418 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
19419 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
19420 sysV68 sysV88 Tek4132 Tek4300 titan
19421 TM3200 TM5400 TM5600
19422 tower tower32 tower32_200 tower32_600 tower32_700
19423 tower32_800 tower32_850 tss
19424 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
19425 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
19426 unix UNIX95 UNIX99 unixpc unos
19427 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
19428 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
19429 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
19431 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
19432 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
19433 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
19436 # Maybe put other stuff here too.
19437 cat <<EOSH >>Cppsym.know
19440 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
19441 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
19442 $cat Cppsym.know > Cppsym.c
19443 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
19444 $rm -f Cppsym.a Cppsym.b Cppsym.c
19445 cat <<EOSH > Cppsym
19447 if $test \$# -gt 0; then
19448 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
19449 if $test -s Cppsym.got; then
19456 $tr " " "$trnl" | ./Cppsym.try
19462 cat <<EOSH > Cppsym.try
19464 cat <<'EOCP' > try.c
19470 cat <<'EOSH' >> Cppsym.try
19472 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
19473 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
19474 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
19475 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
19477 echo 'return 0;}' >> try.c
19479 cat <<EOSH >> Cppsym.try
19481 case "$osname-$gccversion" in
19482 irix-) ccflags="\$ccflags -woff 1178" ;;
19483 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
19485 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
19487 chmod +x Cppsym.try
19488 $eunicefix Cppsym.try
19489 ./Cppsym < Cppsym.know > Cppsym.true
19490 : now check the C compiler for additional symbols
19491 postprocess_cc_v=''
19493 aix) postprocess_cc_v="|$tr , ' '" ;;
19500 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
19503 -D*) echo "\$i" | $sed 's/^-D//';;
19504 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
19509 postprocess_cc_v=''
19512 ./ccsym > ccsym1.raw
19513 if $test -s ccsym1.raw; then
19514 $sort ccsym1.raw | $uniq >ccsym.raw
19516 mv ccsym1.raw ccsym.raw
19519 $awk '/\=/ { print $0; next }
19520 { print $0"=1" }' ccsym.raw >ccsym.list
19521 $awk '/\=/ { print $0; next }
19522 { print $0"=1" }' Cppsym.true >ccsym.true
19523 $comm -13 ccsym.true ccsym.list >ccsym.own
19524 $comm -12 ccsym.true ccsym.list >ccsym.com
19525 $comm -23 ccsym.true ccsym.list >ccsym.cpp
19527 if $test -z ccsym.raw; then
19528 echo "Your C compiler doesn't seem to define any symbols!" >&4
19530 echo "However, your C preprocessor defines the following symbols:"
19533 cppsymbols=`$cat Cppsym.true`
19534 cppsymbols=`echo $cppsymbols`
19535 cppccsymbols="$cppsymbols"
19537 if $test -s ccsym.com; then
19538 echo "Your C compiler and pre-processor define these symbols:"
19539 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
19542 cppccsymbols=`$cat ccsym.com`
19543 cppccsymbols=`echo $cppccsymbols`
19544 $test "$silent" || sleep 1
19546 if $test -s ccsym.cpp; then
19547 $test "$also" && echo " "
19548 echo "Your C pre-processor ${also}defines the following symbols:"
19549 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
19551 cppsymbols=`$cat ccsym.cpp`
19552 cppsymbols=`echo $cppsymbols`
19553 $test "$silent" || sleep 1
19555 if $test -s ccsym.own; then
19556 $test "$also" && echo " "
19557 echo "Your C compiler ${also}defines the following cpp symbols:"
19558 $sed -e 's/\(..*\)=1/\1/' ccsym.own
19559 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
19560 ccsymbols=`$cat ccsym.own`
19561 ccsymbols=`echo $ccsymbols`
19562 $test "$silent" || sleep 1
19566 : see if this is a termio system
19570 if $test `./findhdr termios.h`; then
19571 set tcsetattr i_termios
19577 "$define") echo "You have POSIX termios.h... good!" >&4;;
19578 *) if ./Cppsym pyr; then
19579 case "`/bin/universe`" in
19580 ucb) if $test `./findhdr sgtty.h`; then
19582 echo "<sgtty.h> found." >&4
19584 echo "System is pyramid with BSD universe."
19585 echo "<sgtty.h> not found--you could have problems." >&4
19587 *) if $test `./findhdr termio.h`; then
19589 echo "<termio.h> found." >&4
19591 echo "System is pyramid with USG universe."
19592 echo "<termio.h> not found--you could have problems." >&4
19596 if $test `./findhdr termio.h`; then
19597 echo "<termio.h> found." >&4
19599 elif $test `./findhdr sgtty.h`; then
19600 echo "<sgtty.h> found." >&4
19603 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19606 if $test `./findhdr sgtty.h`; then
19607 echo "<sgtty.h> found." >&4
19609 elif $test `./findhdr termio.h`; then
19610 echo "<termio.h> found." >&4
19613 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19617 set i_termio; eval $setvar
19618 val=$val2; set i_sgtty; eval $setvar
19619 val=$val3; set i_termios; eval $setvar
19621 : see if stddef is available
19622 set stddef.h i_stddef
19625 : see if this is a sunmath.h system
19626 set sunmath.h i_sunmath
19629 : see if sys/access.h is available
19630 set sys/access.h i_sysaccess
19633 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19634 set sys/filio.h i_sysfilio
19637 if $test `./findhdr sys/ioctl.h`; then
19639 echo '<sys/ioctl.h> found.' >&4
19642 if $test $i_sysfilio = "$define"; then
19643 echo '<sys/ioctl.h> NOT found.' >&4
19645 $test $i_sgtty = "$define" && xxx="sgtty.h"
19646 $test $i_termio = "$define" && xxx="termio.h"
19647 $test $i_termios = "$define" && xxx="termios.h"
19648 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19654 : see if socket ioctl defs are in sys/sockio.h
19656 xxx=`./findhdr sys/sockio.h`
19657 if $test "$xxx"; then
19658 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19660 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19663 echo "No socket ioctls found in <sys/sockio.h>." >&4
19668 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19675 : see if this is a syslog.h system
19676 set syslog.h i_syslog
19680 : see if this is a sys/mode.h system
19681 set sys/mode.h i_sysmode
19684 : see if sys/resource.h has to be included
19685 set sys/resource.h i_sysresrc
19688 : see if sys/security.h is available
19689 set sys/security.h i_syssecrt
19692 : see if this is a sys/statvfs.h system
19693 set sys/statvfs.h i_sysstatvfs
19696 : see if this is a sys/un.h system
19697 set sys/un.h i_sysun
19701 : see if this is a sys/utsname.h system
19702 set sys/utsname.h i_sysutsname
19705 : see if this is a syswait system
19706 set sys/wait.h i_syswait
19709 : see if this is a ustat.h system
19710 set ustat.h i_ustat
19713 : see if this is an utime system
19714 set utime.h i_utime
19717 : see if this is a values.h system
19718 set values.h i_values
19721 : see if this is a vfork system
19724 set vfork.h i_vfork
19732 : see if gdbm.h is available
19737 : see if gdbm_open exists
19738 set gdbm_open d_gdbm_open
19740 case "$d_gdbm_open" in
19743 echo "We won't be including <gdbm.h>"
19753 echo "Looking for extensions..." >&4
19754 : If we are using the old config.sh, known_extensions may contain
19755 : old or inaccurate or duplicate values.
19756 known_extensions=''
19757 nonxs_extensions=''
19758 : We do not use find because it might not be available.
19759 : We do not just use MANIFEST because the user may have dropped
19760 : some additional extensions into the source tree and expect them
19763 : Function to recursively find available extensions, ignoring DynaLoader
19764 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19768 DynaLoader|dynaload) ;;
19770 if $test -f $xxx/$xxx.xs; then
19771 known_extensions="$known_extensions $1$xxx";
19772 elif $test -f $xxx/Makefile.PL; then
19773 nonxs_extensions="$nonxs_extensions $1$xxx";
19775 if $test -d $xxx -a $# -lt 10; then
19778 eval $find_extensions;
19790 eval $find_extensions
19791 # Special case: Add in threads/shared since it is not picked up by the
19792 # recursive find above (and adding in general recursive finding breaks
19793 # SDBM_File/sdbm). A.D. 10/25/2001.
19794 known_extensions="$known_extensions threads/shared"
19795 set X $nonxs_extensions
19797 nonxs_extensions="$*"
19798 set X $known_extensions
19800 known_extensions="$*"
19803 : Now see which are supported on this system.
19805 for xxx in $known_extensions ; do
19809 $define) avail_ext="$avail_ext $xxx" ;;
19812 GDBM_File|gdbm_fil)
19814 $define) avail_ext="$avail_ext $xxx" ;;
19817 I18N/Langinfo|i18n_lan)
19818 case "$i_langinfo$d_nl_langinfo" in
19819 $define$define) avail_ext="$avail_ext $xxx" ;;
19822 NDBM_File|ndbm_fil)
19825 case "$osname-$use64bitint" in
19828 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19831 *) avail_ext="$avail_ext $xxx" ;;
19836 ODBM_File|odbm_fil)
19837 case "${i_dbm}${i_rpcsvcdbm}" in
19839 case "$osname-$use64bitint" in
19842 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19845 *) avail_ext="$avail_ext $xxx" ;;
19851 case "$useposix" in
19852 true|define|y) avail_ext="$avail_ext $xxx" ;;
19856 case "$useopcode" in
19857 true|define|y) avail_ext="$avail_ext $xxx" ;;
19861 case "$d_socket" in
19864 beos) ;; # not unless BONE
19865 *) avail_ext="$avail_ext $xxx" ;;
19870 Sys/Syslog|sys/syslog)
19871 : XXX syslog requires socket
19872 case "$d_socket" in
19873 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19877 case "$usethreads" in
19879 case "$useithreads" in
19880 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19884 XS/APItest|xs/apitest)
19885 # This is just for testing. Skip it unless we have dynamic loading.
19888 $define) avail_ext="$avail_ext $xxx" ;;
19891 XS/Typemap|xs/typemap)
19892 # This is just for testing. Skip it unless we have dynamic loading.
19894 $define) avail_ext="$avail_ext $xxx" ;;
19897 threads|threads/shared)
19898 # threads and threads::shared are special cases.
19899 # To stop people from asking "Perl 5.8.0 was supposed
19900 # to have this new fancy threads implementation but my
19901 # perl doesn't have it" and from people trying to
19902 # (re)install the threads module using CPAN.pm and
19903 # CPAN.pm then offering to reinstall Perl 5.8.0,
19904 # the threads.pm and threads/shared.pm will always be
19905 # there, croaking informatively ("you need to rebuild
19906 # all of Perl with threads, sorry") when threads haven't
19907 # been compiled in.
19909 avail_ext="$avail_ext $xxx"
19912 : XXX Do we need a useipcsysv variable here
19913 case "${d_msg}${d_sem}${d_shm}" in
19914 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19917 *) avail_ext="$avail_ext $xxx"
19926 : Now see which nonxs extensions are supported on this system.
19927 : For now assume all are.
19929 for xxx in $nonxs_extensions ; do
19931 *) nonxs_ext="$nonxs_ext $xxx"
19943 A number of extensions are supplied with $package. You may choose to
19944 compile these extensions for dynamic loading (the default), compile
19945 them into the $package executable (static loading), or not include
19946 them at all. Answer "none" to include no extensions.
19947 Note that DynaLoader is always built and need not be mentioned here.
19950 case "$dynamic_ext" in
19952 : Exclude those listed in static_ext
19954 for xxx in $avail_ext; do
19955 case " $static_ext " in
19957 *) dflt="$dflt $xxx" ;;
19964 *) dflt="$dynamic_ext"
19965 # Perhaps we are reusing an old out-of-date config.sh.
19968 if test X"$dynamic_ext" != X"$avail_ext"; then
19970 NOTICE: Your previous config.sh list may be incorrect.
19971 The extensions now available to you are
19973 but the default list from your previous config.sh is
19985 rp="What extensions do you wish to load dynamically?"
19988 none) dynamic_ext=' ' ;;
19989 *) dynamic_ext="$ans" ;;
19992 case "$static_ext" in
19994 : Exclude those already listed in dynamic linking
19996 for xxx in $avail_ext; do
19997 case " $dynamic_ext " in
19999 *) dflt="$dflt $xxx" ;;
20006 *) dflt="$static_ext"
20013 rp="What extensions do you wish to load statically?"
20016 none) static_ext=' ' ;;
20017 *) static_ext="$ans" ;;
20022 A number of extensions are supplied with $package. Answer "none"
20023 to include no extensions.
20024 Note that DynaLoader is always built and need not be mentioned here.
20027 case "$static_ext" in
20028 '') dflt="$avail_ext" ;;
20029 *) dflt="$static_ext"
20030 # Perhaps we are reusing an old out-of-date config.sh.
20033 if test X"$static_ext" != X"$avail_ext"; then
20035 NOTICE: Your previous config.sh list may be incorrect.
20036 The extensions now available to you are
20038 but the default list from your previous config.sh is
20047 : Exclude those that are not xs extensions
20051 rp="What extensions do you wish to include?"
20054 none) static_ext=' ' ;;
20055 *) static_ext="$ans" ;;
20060 # Encode is a special case. If we are building Encode as a static
20061 # extension, we need to explicitly list its subextensions as well.
20062 # For other nested extensions, this is handled automatically by
20063 # the appropriate Makefile.PL.
20064 case " $static_ext " in
20065 *" Encode "*) # Add the subextensions of Encode
20067 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20068 static_ext="$static_ext Encode/$xxx"
20074 set X $dynamic_ext $static_ext $nonxs_ext
20078 : Remove libraries needed only for extensions
20079 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20080 : The exception is SunOS 4.x, which needs them.
20081 case "${osname}X${osvers}" in
20085 *) case "$usedl" in
20086 $define|true|[yY]*)
20087 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20091 *) perllibs="$libs"
20097 : Remove build directory name from cppstdin so it can be used from
20098 : either the present location or the final installed location.
20100 : Get out of the UU directory to get correct path name.
20102 case "$cppstdin" in
20104 echo "Stripping down cppstdin path name"
20110 : end of configuration questions
20112 echo "End of configuration questions."
20115 : back to where it started
20116 if test -d ../UU; then
20120 : configuration may be patched via a 'config.arch' file
20121 if $test -f config.arch; then
20122 echo "I see a config.arch file, loading it."
20126 : configuration may be patched via a 'config.over' file
20127 if $test -f config.over; then
20130 rp='I see a config.over file. Do you wish to load it?'
20133 n*) echo "OK, I'll ignore it.";;
20135 echo "Configuration override changes have been loaded."
20140 : in case they want portability, strip down executable paths
20141 case "$d_portable" in
20144 echo "Stripping down executable paths..." >&4
20145 for file in $loclist $trylist; do
20147 eval $file=`basename $temp`
20152 : create config.sh file
20154 echo "Creating config.sh..." >&4
20155 $spitshell <<EOT >config.sh
20158 # This file was produced by running the Configure script. It holds all the
20159 # definitions figured out by Configure. Should you modify one of these values,
20160 # do not forget to propagate your changes by running "Configure -der". You may
20161 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20164 # Package name : $package
20165 # Source directory : $src
20166 # Configuration time: $cf_time
20167 # Configured by : $cf_by
20168 # Target system : $myuname
20178 Revision='$Revision'
20186 alignbytes='$alignbytes'
20187 ansi2knr='$ansi2knr'
20188 aphostname='$aphostname'
20189 api_revision='$api_revision'
20190 api_subversion='$api_subversion'
20191 api_version='$api_version'
20192 api_versionstring='$api_versionstring'
20195 archlibexp='$archlibexp'
20196 archname64='$archname64'
20197 archname='$archname'
20198 archobjs='$archobjs'
20199 asctime_r_proto='$asctime_r_proto'
20207 byteorder='$byteorder'
20209 castflags='$castflags'
20212 cccdlflags='$cccdlflags'
20213 ccdlflags='$ccdlflags'
20215 ccflags_uselargefiles='$ccflags_uselargefiles'
20217 ccsymbols='$ccsymbols'
20218 ccversion='$ccversion'
20220 cf_email='$cf_email'
20222 charsize='$charsize'
20226 clocktype='$clocktype'
20228 compress='$compress'
20229 contains='$contains'
20233 cpp_stuff='$cpp_stuff'
20234 cppccsymbols='$cppccsymbols'
20235 cppflags='$cppflags'
20237 cppminus='$cppminus'
20239 cppstdin='$cppstdin'
20240 cppsymbols='$cppsymbols'
20241 crypt_r_proto='$crypt_r_proto'
20242 cryptlib='$cryptlib'
20244 ctermid_r_proto='$ctermid_r_proto'
20245 ctime_r_proto='$ctime_r_proto'
20246 d_Gconvert='$d_Gconvert'
20247 d_PRIEUldbl='$d_PRIEUldbl'
20248 d_PRIFUldbl='$d_PRIFUldbl'
20249 d_PRIGUldbl='$d_PRIGUldbl'
20250 d_PRIXU64='$d_PRIXU64'
20251 d_PRId64='$d_PRId64'
20252 d_PRIeldbl='$d_PRIeldbl'
20253 d_PRIfldbl='$d_PRIfldbl'
20254 d_PRIgldbl='$d_PRIgldbl'
20255 d_PRIi64='$d_PRIi64'
20256 d_PRIo64='$d_PRIo64'
20257 d_PRIu64='$d_PRIu64'
20258 d_PRIx64='$d_PRIx64'
20259 d_SCNfldbl='$d_SCNfldbl'
20260 d__fwalk='$d__fwalk'
20261 d_access='$d_access'
20262 d_accessx='$d_accessx'
20264 d_archlib='$d_archlib'
20265 d_asctime_r='$d_asctime_r'
20268 d_attribut='$d_attribut'
20272 d_bsdgetpgrp='$d_bsdgetpgrp'
20273 d_bsdsetpgrp='$d_bsdsetpgrp'
20275 d_casti32='$d_casti32'
20276 d_castneg='$d_castneg'
20277 d_charvspr='$d_charvspr'
20279 d_chroot='$d_chroot'
20280 d_chsize='$d_chsize'
20282 d_closedir='$d_closedir'
20283 d_cmsghdr_s='$d_cmsghdr_s'
20286 d_crypt_r='$d_crypt_r'
20288 d_ctermid_r='$d_ctermid_r'
20289 d_ctime_r='$d_ctime_r'
20290 d_cuserid='$d_cuserid'
20291 d_dbl_dig='$d_dbl_dig'
20292 d_dbminitproto='$d_dbminitproto'
20293 d_difftime='$d_difftime'
20295 d_dirnamlen='$d_dirnamlen'
20296 d_dlerror='$d_dlerror'
20297 d_dlopen='$d_dlopen'
20298 d_dlsymun='$d_dlsymun'
20299 d_dosuid='$d_dosuid'
20300 d_drand48_r='$d_drand48_r'
20301 d_drand48proto='$d_drand48proto'
20303 d_eaccess='$d_eaccess'
20304 d_endgrent='$d_endgrent'
20305 d_endgrent_r='$d_endgrent_r'
20306 d_endhent='$d_endhent'
20307 d_endhostent_r='$d_endhostent_r'
20308 d_endnent='$d_endnent'
20309 d_endnetent_r='$d_endnetent_r'
20310 d_endpent='$d_endpent'
20311 d_endprotoent_r='$d_endprotoent_r'
20312 d_endpwent='$d_endpwent'
20313 d_endpwent_r='$d_endpwent_r'
20314 d_endsent='$d_endsent'
20315 d_endservent_r='$d_endservent_r'
20316 d_eofnblk='$d_eofnblk'
20317 d_eunice='$d_eunice'
20318 d_fchdir='$d_fchdir'
20319 d_fchmod='$d_fchmod'
20320 d_fchown='$d_fchown'
20322 d_fcntl_can_lock='$d_fcntl_can_lock'
20323 d_fd_macros='$d_fd_macros'
20324 d_fd_set='$d_fd_set'
20325 d_fds_bits='$d_fds_bits'
20326 d_fgetpos='$d_fgetpos'
20327 d_finite='$d_finite'
20328 d_finitel='$d_finitel'
20329 d_flexfnam='$d_flexfnam'
20331 d_flockproto='$d_flockproto'
20333 d_fp_class='$d_fp_class'
20334 d_fpathconf='$d_fpathconf'
20335 d_fpclass='$d_fpclass'
20336 d_fpclassify='$d_fpclassify'
20337 d_fpclassl='$d_fpclassl'
20338 d_fpos64_t='$d_fpos64_t'
20339 d_frexpl='$d_frexpl'
20340 d_fs_data_s='$d_fs_data_s'
20341 d_fseeko='$d_fseeko'
20342 d_fsetpos='$d_fsetpos'
20343 d_fstatfs='$d_fstatfs'
20344 d_fstatvfs='$d_fstatvfs'
20346 d_ftello='$d_ftello'
20348 d_getcwd='$d_getcwd'
20349 d_getespwnam='$d_getespwnam'
20350 d_getfsstat='$d_getfsstat'
20351 d_getgrent='$d_getgrent'
20352 d_getgrent_r='$d_getgrent_r'
20353 d_getgrgid_r='$d_getgrgid_r'
20354 d_getgrnam_r='$d_getgrnam_r'
20355 d_getgrps='$d_getgrps'
20356 d_gethbyaddr='$d_gethbyaddr'
20357 d_gethbyname='$d_gethbyname'
20358 d_gethent='$d_gethent'
20359 d_gethname='$d_gethname'
20360 d_gethostbyaddr_r='$d_gethostbyaddr_r'
20361 d_gethostbyname_r='$d_gethostbyname_r'
20362 d_gethostent_r='$d_gethostent_r'
20363 d_gethostprotos='$d_gethostprotos'
20364 d_getitimer='$d_getitimer'
20365 d_getlogin='$d_getlogin'
20366 d_getlogin_r='$d_getlogin_r'
20367 d_getmnt='$d_getmnt'
20368 d_getmntent='$d_getmntent'
20369 d_getnbyaddr='$d_getnbyaddr'
20370 d_getnbyname='$d_getnbyname'
20371 d_getnent='$d_getnent'
20372 d_getnetbyaddr_r='$d_getnetbyaddr_r'
20373 d_getnetbyname_r='$d_getnetbyname_r'
20374 d_getnetent_r='$d_getnetent_r'
20375 d_getnetprotos='$d_getnetprotos'
20376 d_getpagsz='$d_getpagsz'
20377 d_getpbyname='$d_getpbyname'
20378 d_getpbynumber='$d_getpbynumber'
20379 d_getpent='$d_getpent'
20380 d_getpgid='$d_getpgid'
20381 d_getpgrp2='$d_getpgrp2'
20382 d_getpgrp='$d_getpgrp'
20383 d_getppid='$d_getppid'
20384 d_getprior='$d_getprior'
20385 d_getprotobyname_r='$d_getprotobyname_r'
20386 d_getprotobynumber_r='$d_getprotobynumber_r'
20387 d_getprotoent_r='$d_getprotoent_r'
20388 d_getprotoprotos='$d_getprotoprotos'
20389 d_getprpwnam='$d_getprpwnam'
20390 d_getpwent='$d_getpwent'
20391 d_getpwent_r='$d_getpwent_r'
20392 d_getpwnam_r='$d_getpwnam_r'
20393 d_getpwuid_r='$d_getpwuid_r'
20394 d_getsbyname='$d_getsbyname'
20395 d_getsbyport='$d_getsbyport'
20396 d_getsent='$d_getsent'
20397 d_getservbyname_r='$d_getservbyname_r'
20398 d_getservbyport_r='$d_getservbyport_r'
20399 d_getservent_r='$d_getservent_r'
20400 d_getservprotos='$d_getservprotos'
20401 d_getspnam='$d_getspnam'
20402 d_getspnam_r='$d_getspnam_r'
20403 d_gettimeod='$d_gettimeod'
20404 d_gmtime_r='$d_gmtime_r'
20405 d_gnulibc='$d_gnulibc'
20406 d_grpasswd='$d_grpasswd'
20407 d_hasmntopt='$d_hasmntopt'
20410 d_inetaton='$d_inetaton'
20411 d_int64_t='$d_int64_t'
20412 d_isascii='$d_isascii'
20413 d_isfinite='$d_isfinite'
20416 d_isnanl='$d_isnanl'
20417 d_killpg='$d_killpg'
20418 d_lchown='$d_lchown'
20419 d_ldbl_dig='$d_ldbl_dig'
20421 d_localtime_r='$d_localtime_r'
20422 d_locconv='$d_locconv'
20424 d_longdbl='$d_longdbl'
20425 d_longlong='$d_longlong'
20426 d_lseekproto='$d_lseekproto'
20428 d_madvise='$d_madvise'
20430 d_mbstowcs='$d_mbstowcs'
20431 d_mbtowc='$d_mbtowc'
20432 d_memchr='$d_memchr'
20433 d_memcmp='$d_memcmp'
20434 d_memcpy='$d_memcpy'
20435 d_memmove='$d_memmove'
20436 d_memset='$d_memset'
20438 d_mkdtemp='$d_mkdtemp'
20439 d_mkfifo='$d_mkfifo'
20440 d_mkstemp='$d_mkstemp'
20441 d_mkstemps='$d_mkstemps'
20442 d_mktime='$d_mktime'
20445 d_modfl_pow32_bug='$d_modfl_pow32_bug'
20446 d_modflproto='$d_modflproto'
20447 d_mprotect='$d_mprotect'
20449 d_msg_ctrunc='$d_msg_ctrunc'
20450 d_msg_dontroute='$d_msg_dontroute'
20451 d_msg_oob='$d_msg_oob'
20452 d_msg_peek='$d_msg_peek'
20453 d_msg_proxy='$d_msg_proxy'
20454 d_msgctl='$d_msgctl'
20455 d_msgget='$d_msgget'
20456 d_msghdr_s='$d_msghdr_s'
20457 d_msgrcv='$d_msgrcv'
20458 d_msgsnd='$d_msgsnd'
20460 d_munmap='$d_munmap'
20461 d_mymalloc='$d_mymalloc'
20462 d_nanosleep='$d_nanosleep'
20464 d_nl_langinfo='$d_nl_langinfo'
20465 d_nv_preserves_uv='$d_nv_preserves_uv'
20466 d_off64_t='$d_off64_t'
20467 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
20468 d_oldpthreads='$d_oldpthreads'
20469 d_oldsock='$d_oldsock'
20471 d_pathconf='$d_pathconf'
20473 d_perl_otherlibdirs='$d_perl_otherlibdirs'
20474 d_phostname='$d_phostname'
20477 d_portable='$d_portable'
20478 d_procselfexe='$d_procselfexe'
20479 d_pthread_atfork='$d_pthread_atfork'
20480 d_pthread_yield='$d_pthread_yield'
20482 d_pwchange='$d_pwchange'
20483 d_pwclass='$d_pwclass'
20484 d_pwcomment='$d_pwcomment'
20485 d_pwexpire='$d_pwexpire'
20486 d_pwgecos='$d_pwgecos'
20487 d_pwpasswd='$d_pwpasswd'
20488 d_pwquota='$d_pwquota'
20491 d_random_r='$d_random_r'
20492 d_readdir64_r='$d_readdir64_r'
20493 d_readdir='$d_readdir'
20494 d_readdir_r='$d_readdir_r'
20495 d_readlink='$d_readlink'
20497 d_recvmsg='$d_recvmsg'
20498 d_rename='$d_rename'
20499 d_rewinddir='$d_rewinddir'
20501 d_safebcpy='$d_safebcpy'
20502 d_safemcpy='$d_safemcpy'
20503 d_sanemcmp='$d_sanemcmp'
20504 d_sbrkproto='$d_sbrkproto'
20505 d_sched_yield='$d_sched_yield'
20506 d_scm_rights='$d_scm_rights'
20507 d_seekdir='$d_seekdir'
20508 d_select='$d_select'
20510 d_semctl='$d_semctl'
20511 d_semctl_semid_ds='$d_semctl_semid_ds'
20512 d_semctl_semun='$d_semctl_semun'
20513 d_semget='$d_semget'
20515 d_sendmsg='$d_sendmsg'
20516 d_setegid='$d_setegid'
20517 d_seteuid='$d_seteuid'
20518 d_setgrent='$d_setgrent'
20519 d_setgrent_r='$d_setgrent_r'
20520 d_setgrps='$d_setgrps'
20521 d_sethent='$d_sethent'
20522 d_sethostent_r='$d_sethostent_r'
20523 d_setitimer='$d_setitimer'
20524 d_setlinebuf='$d_setlinebuf'
20525 d_setlocale='$d_setlocale'
20526 d_setlocale_r='$d_setlocale_r'
20527 d_setnent='$d_setnent'
20528 d_setnetent_r='$d_setnetent_r'
20529 d_setpent='$d_setpent'
20530 d_setpgid='$d_setpgid'
20531 d_setpgrp2='$d_setpgrp2'
20532 d_setpgrp='$d_setpgrp'
20533 d_setprior='$d_setprior'
20534 d_setproctitle='$d_setproctitle'
20535 d_setprotoent_r='$d_setprotoent_r'
20536 d_setpwent='$d_setpwent'
20537 d_setpwent_r='$d_setpwent_r'
20538 d_setregid='$d_setregid'
20539 d_setresgid='$d_setresgid'
20540 d_setresuid='$d_setresuid'
20541 d_setreuid='$d_setreuid'
20542 d_setrgid='$d_setrgid'
20543 d_setruid='$d_setruid'
20544 d_setsent='$d_setsent'
20545 d_setservent_r='$d_setservent_r'
20546 d_setsid='$d_setsid'
20547 d_setvbuf='$d_setvbuf'
20551 d_shmatprototype='$d_shmatprototype'
20552 d_shmctl='$d_shmctl'
20554 d_shmget='$d_shmget'
20555 d_sigaction='$d_sigaction'
20556 d_sigprocmask='$d_sigprocmask'
20557 d_sigsetjmp='$d_sigsetjmp'
20558 d_sockatmark='$d_sockatmark'
20559 d_sockatmarkproto='$d_sockatmarkproto'
20560 d_socket='$d_socket'
20561 d_socklen_t='$d_socklen_t'
20562 d_sockpair='$d_sockpair'
20563 d_socks5_init='$d_socks5_init'
20565 d_srand48_r='$d_srand48_r'
20566 d_srandom_r='$d_srandom_r'
20567 d_sresgproto='$d_sresgproto'
20568 d_sresuproto='$d_sresuproto'
20569 d_statblks='$d_statblks'
20570 d_statfs_f_flags='$d_statfs_f_flags'
20571 d_statfs_s='$d_statfs_s'
20572 d_statvfs='$d_statvfs'
20573 d_stdio_cnt_lval='$d_stdio_cnt_lval'
20574 d_stdio_ptr_lval='$d_stdio_ptr_lval'
20575 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
20576 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
20577 d_stdio_stream_array='$d_stdio_stream_array'
20578 d_stdiobase='$d_stdiobase'
20579 d_stdstdio='$d_stdstdio'
20580 d_strchr='$d_strchr'
20581 d_strcoll='$d_strcoll'
20582 d_strctcpy='$d_strctcpy'
20583 d_strerrm='$d_strerrm'
20584 d_strerror='$d_strerror'
20585 d_strerror_r='$d_strerror_r'
20586 d_strftime='$d_strftime'
20587 d_strtod='$d_strtod'
20588 d_strtol='$d_strtol'
20589 d_strtold='$d_strtold'
20590 d_strtoll='$d_strtoll'
20591 d_strtoq='$d_strtoq'
20592 d_strtoul='$d_strtoul'
20593 d_strtoull='$d_strtoull'
20594 d_strtouq='$d_strtouq'
20595 d_strxfrm='$d_strxfrm'
20596 d_suidsafe='$d_suidsafe'
20597 d_symlink='$d_symlink'
20598 d_syscall='$d_syscall'
20599 d_syscallproto='$d_syscallproto'
20600 d_sysconf='$d_sysconf'
20601 d_sysernlst='$d_sysernlst'
20602 d_syserrlst='$d_syserrlst'
20603 d_system='$d_system'
20604 d_tcgetpgrp='$d_tcgetpgrp'
20605 d_tcsetpgrp='$d_tcsetpgrp'
20606 d_telldir='$d_telldir'
20607 d_telldirproto='$d_telldirproto'
20610 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20611 d_tm_tm_zone='$d_tm_tm_zone'
20612 d_tmpnam_r='$d_tmpnam_r'
20613 d_truncate='$d_truncate'
20614 d_ttyname_r='$d_ttyname_r'
20615 d_tzname='$d_tzname'
20616 d_u32align='$d_u32align'
20617 d_ualarm='$d_ualarm'
20620 d_union_semun='$d_union_semun'
20621 d_unordered='$d_unordered'
20622 d_usleep='$d_usleep'
20623 d_usleepproto='$d_usleepproto'
20625 d_vendorarch='$d_vendorarch'
20626 d_vendorbin='$d_vendorbin'
20627 d_vendorlib='$d_vendorlib'
20628 d_vendorscript='$d_vendorscript'
20630 d_void_closedir='$d_void_closedir'
20631 d_voidsig='$d_voidsig'
20632 d_voidtty='$d_voidtty'
20633 d_volatile='$d_volatile'
20634 d_vprintf='$d_vprintf'
20636 d_waitpid='$d_waitpid'
20637 d_wcstombs='$d_wcstombs'
20638 d_wctomb='$d_wctomb'
20639 d_writev='$d_writev'
20642 db_hashtype='$db_hashtype'
20643 db_prefixtype='$db_prefixtype'
20644 db_version_major='$db_version_major'
20645 db_version_minor='$db_version_minor'
20646 db_version_patch='$db_version_patch'
20647 defvoidused='$defvoidused'
20648 direntrytype='$direntrytype'
20651 doublesize='$doublesize'
20653 drand48_r_proto='$drand48_r_proto'
20654 dynamic_ext='$dynamic_ext'
20660 endgrent_r_proto='$endgrent_r_proto'
20661 endhostent_r_proto='$endhostent_r_proto'
20662 endnetent_r_proto='$endnetent_r_proto'
20663 endprotoent_r_proto='$endprotoent_r_proto'
20664 endpwent_r_proto='$endpwent_r_proto'
20665 endservent_r_proto='$endservent_r_proto'
20666 eunicefix='$eunicefix'
20669 extensions='$extensions'
20671 fflushNULL='$fflushNULL'
20672 fflushall='$fflushall'
20674 firstmakefile='$firstmakefile'
20676 fpossize='$fpossize'
20677 fpostype='$fpostype'
20678 freetype='$freetype'
20681 full_csh='$full_csh'
20682 full_sed='$full_sed'
20683 gccansipedantic='$gccansipedantic'
20684 gccosandvers='$gccosandvers'
20685 gccversion='$gccversion'
20686 getgrent_r_proto='$getgrent_r_proto'
20687 getgrgid_r_proto='$getgrgid_r_proto'
20688 getgrnam_r_proto='$getgrnam_r_proto'
20689 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20690 gethostbyname_r_proto='$gethostbyname_r_proto'
20691 gethostent_r_proto='$gethostent_r_proto'
20692 getlogin_r_proto='$getlogin_r_proto'
20693 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20694 getnetbyname_r_proto='$getnetbyname_r_proto'
20695 getnetent_r_proto='$getnetent_r_proto'
20696 getprotobyname_r_proto='$getprotobyname_r_proto'
20697 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20698 getprotoent_r_proto='$getprotoent_r_proto'
20699 getpwent_r_proto='$getpwent_r_proto'
20700 getpwnam_r_proto='$getpwnam_r_proto'
20701 getpwuid_r_proto='$getpwuid_r_proto'
20702 getservbyname_r_proto='$getservbyname_r_proto'
20703 getservbyport_r_proto='$getservbyport_r_proto'
20704 getservent_r_proto='$getservent_r_proto'
20705 getspnam_r_proto='$getspnam_r_proto'
20706 gidformat='$gidformat'
20712 gmtime_r_proto='$gmtime_r_proto'
20713 gnulibc_version='$gnulibc_version'
20715 groupcat='$groupcat'
20716 groupstype='$groupstype'
20719 h_sysfile='$h_sysfile'
20722 html1dir='$html1dir'
20723 html1direxp='$html1direxp'
20724 html3dir='$html3dir'
20725 html3direxp='$html3direxp'
20734 i_arpainet='$i_arpainet'
20735 i_bsdioctl='$i_bsdioctl'
20739 i_dirent='$i_dirent'
20745 i_fp_class='$i_fp_class'
20748 i_ieeefp='$i_ieeefp'
20749 i_inttypes='$i_inttypes'
20750 i_langinfo='$i_langinfo'
20751 i_libutil='$i_libutil'
20752 i_limits='$i_limits'
20753 i_locale='$i_locale'
20754 i_machcthr='$i_machcthr'
20755 i_malloc='$i_malloc'
20757 i_memory='$i_memory'
20758 i_mntent='$i_mntent'
20761 i_neterrno='$i_neterrno'
20762 i_netinettcp='$i_netinettcp'
20766 i_pthread='$i_pthread'
20768 i_rpcsvcdbm='$i_rpcsvcdbm'
20771 i_shadow='$i_shadow'
20773 i_stdarg='$i_stdarg'
20774 i_stddef='$i_stddef'
20775 i_stdlib='$i_stdlib'
20776 i_string='$i_string'
20777 i_sunmath='$i_sunmath'
20778 i_sysaccess='$i_sysaccess'
20779 i_sysdir='$i_sysdir'
20780 i_sysfile='$i_sysfile'
20781 i_sysfilio='$i_sysfilio'
20783 i_sysioctl='$i_sysioctl'
20784 i_syslog='$i_syslog'
20785 i_sysmman='$i_sysmman'
20786 i_sysmode='$i_sysmode'
20787 i_sysmount='$i_sysmount'
20788 i_sysndir='$i_sysndir'
20789 i_sysparam='$i_sysparam'
20790 i_sysresrc='$i_sysresrc'
20791 i_syssecrt='$i_syssecrt'
20792 i_sysselct='$i_sysselct'
20793 i_syssockio='$i_syssockio'
20794 i_sysstat='$i_sysstat'
20795 i_sysstatfs='$i_sysstatfs'
20796 i_sysstatvfs='$i_sysstatvfs'
20797 i_systime='$i_systime'
20798 i_systimek='$i_systimek'
20799 i_systimes='$i_systimes'
20800 i_systypes='$i_systypes'
20801 i_sysuio='$i_sysuio'
20803 i_sysutsname='$i_sysutsname'
20804 i_sysvfs='$i_sysvfs'
20805 i_syswait='$i_syswait'
20806 i_termio='$i_termio'
20807 i_termios='$i_termios'
20809 i_unistd='$i_unistd'
20812 i_values='$i_values'
20813 i_varargs='$i_varargs'
20814 i_varhdr='$i_varhdr'
20816 ignore_versioned_solibs='$ignore_versioned_solibs'
20817 inc_version_list='$inc_version_list'
20818 inc_version_list_init='$inc_version_list_init'
20821 installarchlib='$installarchlib'
20822 installbin='$installbin'
20823 installhtml1dir='$installhtml1dir'
20824 installhtml3dir='$installhtml3dir'
20825 installman1dir='$installman1dir'
20826 installman3dir='$installman3dir'
20827 installprefix='$installprefix'
20828 installprefixexp='$installprefixexp'
20829 installprivlib='$installprivlib'
20830 installscript='$installscript'
20831 installsitearch='$installsitearch'
20832 installsitebin='$installsitebin'
20833 installsitehtml1='$installsitehtml1'
20834 installsitehtml3='$installsitehtml3'
20835 installsitelib='$installsitelib'
20836 installsiteman1='$installsiteman1'
20837 installsiteman3='$installsiteman3'
20838 installsitescript='$installsitescript'
20839 installstyle='$installstyle'
20840 installusrbinperl='$installusrbinperl'
20841 installvendorarch='$installvendorarch'
20842 installvendorbin='$installvendorbin'
20843 installvendorhtml1='$installvendorhtml1'
20844 installvendorhtml3='$installvendorhtml3'
20845 installvendorlib='$installvendorlib'
20846 installvendorman1='$installvendorman1'
20847 installvendorman3='$installvendorman3'
20848 installvendorscript='$installvendorscript'
20850 issymlink='$issymlink'
20851 ivdformat='$ivdformat'
20854 known_extensions='$known_extensions'
20857 lddlflags='$lddlflags'
20859 ldflags_uselargefiles='$ldflags_uselargefiles'
20860 ldlibpthname='$ldlibpthname'
20867 libsdirs='$libsdirs'
20868 libsfiles='$libsfiles'
20869 libsfound='$libsfound'
20870 libspath='$libspath'
20871 libswanted='$libswanted'
20872 libswanted_uselargefiles='$libswanted_uselargefiles'
20878 localtime_r_proto='$localtime_r_proto'
20879 locincpth='$locincpth'
20880 loclibpth='$loclibpth'
20881 longdblsize='$longdblsize'
20882 longlongsize='$longlongsize'
20883 longsize='$longsize'
20887 lseeksize='$lseeksize'
20888 lseektype='$lseektype'
20892 make_set_make='$make_set_make'
20893 mallocobj='$mallocobj'
20894 mallocsrc='$mallocsrc'
20895 malloctype='$malloctype'
20897 man1direxp='$man1direxp'
20900 man3direxp='$man3direxp'
20902 mips_type='$mips_type'
20904 mmaptype='$mmaptype'
20905 modetype='$modetype'
20907 multiarch='$multiarch'
20909 myarchname='$myarchname'
20910 mydomain='$mydomain'
20911 myhostname='$myhostname'
20914 need_va_copy='$need_va_copy'
20915 netdb_hlen_type='$netdb_hlen_type'
20916 netdb_host_type='$netdb_host_type'
20917 netdb_name_type='$netdb_name_type'
20918 netdb_net_type='$netdb_net_type'
20921 nm_so_opt='$nm_so_opt'
20922 nonxs_ext='$nonxs_ext'
20924 nvEUformat='$nvEUformat'
20925 nvFUformat='$nvFUformat'
20926 nvGUformat='$nvGUformat'
20927 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20928 nveformat='$nveformat'
20929 nvfformat='$nvfformat'
20930 nvgformat='$nvgformat'
20933 o_nonblock='$o_nonblock'
20935 old_pthread_create_joinable='$old_pthread_create_joinable'
20936 optimize='$optimize'
20937 orderlib='$orderlib'
20940 otherlibdirs='$otherlibdirs'
20944 patchlevel='$patchlevel'
20945 path_sep='$path_sep'
20948 perl_patchlevel='$perl_patchlevel'
20949 perladmin='$perladmin'
20950 perllibs='$perllibs'
20951 perlpath='$perlpath'
20953 phostname='$phostname'
20956 pm_apiversion='$pm_apiversion'
20960 prefixexp='$prefixexp'
20962 privlibexp='$privlibexp'
20963 procselfexe='$procselfexe'
20964 prototype='$prototype'
20966 quadkind='$quadkind'
20967 quadtype='$quadtype'
20968 randbits='$randbits'
20969 randfunc='$randfunc'
20970 random_r_proto='$random_r_proto'
20971 randseedtype='$randseedtype'
20973 rd_nodata='$rd_nodata'
20974 readdir64_r_proto='$readdir64_r_proto'
20975 readdir_r_proto='$readdir_r_proto'
20976 revision='$revision'
20981 sPRIEUldbl='$sPRIEUldbl'
20982 sPRIFUldbl='$sPRIFUldbl'
20983 sPRIGUldbl='$sPRIGUldbl'
20984 sPRIXU64='$sPRIXU64'
20986 sPRIeldbl='$sPRIeldbl'
20987 sPRIfldbl='$sPRIfldbl'
20988 sPRIgldbl='$sPRIgldbl'
20993 sSCNfldbl='$sSCNfldbl'
20994 sched_yield='$sched_yield'
20995 scriptdir='$scriptdir'
20996 scriptdirexp='$scriptdirexp'
20998 seedfunc='$seedfunc'
20999 selectminbits='$selectminbits'
21000 selecttype='$selecttype'
21001 sendmail='$sendmail'
21002 setgrent_r_proto='$setgrent_r_proto'
21003 sethostent_r_proto='$sethostent_r_proto'
21004 setlocale_r_proto='$setlocale_r_proto'
21005 setnetent_r_proto='$setnetent_r_proto'
21006 setprotoent_r_proto='$setprotoent_r_proto'
21007 setpwent_r_proto='$setpwent_r_proto'
21008 setservent_r_proto='$setservent_r_proto'
21011 sharpbang='$sharpbang'
21012 shmattype='$shmattype'
21013 shortsize='$shortsize'
21016 sig_count='$sig_count'
21017 sig_name='$sig_name'
21018 sig_name_init='$sig_name_init'
21020 sig_num_init='$sig_num_init'
21021 sig_size='$sig_size'
21022 signal_t='$signal_t'
21023 sitearch='$sitearch'
21024 sitearchexp='$sitearchexp'
21026 sitebinexp='$sitebinexp'
21027 sitehtml1='$sitehtml1'
21028 sitehtml1exp='$sitehtml1exp'
21029 sitehtml3='$sitehtml3'
21030 sitehtml3exp='$sitehtml3exp'
21032 sitelib_stem='$sitelib_stem'
21033 sitelibexp='$sitelibexp'
21034 siteman1='$siteman1'
21035 siteman1exp='$siteman1exp'
21036 siteman3='$siteman3'
21037 siteman3exp='$siteman3exp'
21038 siteprefix='$siteprefix'
21039 siteprefixexp='$siteprefixexp'
21040 sitescript='$sitescript'
21041 sitescriptexp='$sitescriptexp'
21042 sizesize='$sizesize'
21043 sizetype='$sizetype'
21047 sockethdr='$sockethdr'
21048 socketlib='$socketlib'
21049 socksizetype='$socksizetype'
21051 spackage='$spackage'
21052 spitshell='$spitshell'
21053 srand48_r_proto='$srand48_r_proto'
21054 srandom_r_proto='$srandom_r_proto'
21056 ssizetype='$ssizetype'
21057 startperl='$startperl'
21059 static_ext='$static_ext'
21061 stdio_base='$stdio_base'
21062 stdio_bufsiz='$stdio_bufsiz'
21063 stdio_cnt='$stdio_cnt'
21064 stdio_filbuf='$stdio_filbuf'
21065 stdio_ptr='$stdio_ptr'
21066 stdio_stream_array='$stdio_stream_array'
21067 strerror_r_proto='$strerror_r_proto'
21070 subversion='$subversion'
21074 targetarch='$targetarch'
21078 timeincl='$timeincl'
21079 timetype='$timetype'
21080 tmpnam_r_proto='$tmpnam_r_proto'
21086 ttyname_r_proto='$ttyname_r_proto'
21095 uidformat='$uidformat'
21101 uquadtype='$uquadtype'
21102 use5005threads='$use5005threads'
21103 use64bitall='$use64bitall'
21104 use64bitint='$use64bitint'
21105 usecrosscompile='$usecrosscompile'
21107 useithreads='$useithreads'
21108 uselargefiles='$uselargefiles'
21109 uselongdouble='$uselongdouble'
21110 usemorebits='$usemorebits'
21111 usemultiplicity='$usemultiplicity'
21112 usemymalloc='$usemymalloc'
21114 useopcode='$useopcode'
21115 useperlio='$useperlio'
21116 useposix='$useposix'
21117 usereentrant='$usereentrant'
21119 useshrplib='$useshrplib'
21120 usesocks='$usesocks'
21121 usethreads='$usethreads'
21122 usevendorprefix='$usevendorprefix'
21123 usevfork='$usevfork'
21126 uvXUformat='$uvXUformat'
21127 uvoformat='$uvoformat'
21130 uvuformat='$uvuformat'
21131 uvxformat='$uvxformat'
21132 vendorarch='$vendorarch'
21133 vendorarchexp='$vendorarchexp'
21134 vendorbin='$vendorbin'
21135 vendorbinexp='$vendorbinexp'
21136 vendorhtml1='$vendorhtml1'
21137 vendorhtml1exp='$vendorhtml1exp'
21138 vendorhtml3='$vendorhtml3'
21139 vendorhtml3exp='$vendorhtml3exp'
21140 vendorlib='$vendorlib'
21141 vendorlib_stem='$vendorlib_stem'
21142 vendorlibexp='$vendorlibexp'
21143 vendorman1='$vendorman1'
21144 vendorman1exp='$vendorman1exp'
21145 vendorman3='$vendorman3'
21146 vendorman3exp='$vendorman3exp'
21147 vendorprefix='$vendorprefix'
21148 vendorprefixexp='$vendorprefixexp'
21149 vendorscript='$vendorscript'
21150 vendorscriptexp='$vendorscriptexp'
21152 version_patchlevel_string='$version_patchlevel_string'
21153 versiononly='$versiononly'
21155 voidflags='$voidflags'
21157 xs_apiversion='$xs_apiversion'
21159 yaccflags='$yaccflags'
21164 : Add in command line options if available
21165 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21167 : add special variables
21168 $test -f $src/patchlevel.h && \
21169 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21170 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21171 echo "PERL_CONFIG_SH=true" >>config.sh
21173 : propagate old symbols
21174 if $test -f UU/config.sh; then
21175 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21176 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21177 $sort | $uniq -u >UU/oldsyms
21178 set X `cat UU/oldsyms`
21184 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21186 echo "# Variables propagated from previous config.sh file." >>config.sh
21187 for sym in `cat UU/oldsyms`; do
21188 echo " Propagating $hint variable "'$'"$sym..."
21189 eval 'tmp="$'"${sym}"'"'
21191 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21197 : Finish up by extracting the .SH files
21201 echo "Extraction done."
21211 If you'd like to make any changes to the config.sh file before I begin
21212 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21215 rp="Press return or use a shell escape to edit config.sh:"
21220 *) : in case they cannot read
21221 sh 1>&4 -c "$ans";;
21226 : if this fails, just run all the .SH files by hand
21235 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21242 Now you need to generate make dependencies by running "$make depend".
21243 You might prefer to run it in background: "$make depend > makedepend.out &"
21244 It can take a while, so you might not want to run it right now.
21249 rp="Run $make depend now?"
21253 $make depend && echo "Now you must run '$make'."
21256 echo "You must run '$make depend' then '$make'."
21259 elif test -f [Mm]akefile; then
21261 echo "Now you must run a $make."
21263 echo "Configure done."
21266 if $test -f Policy.sh; then
21269 If you compile $package on a different machine or from a different object
21270 directory, copy the Policy.sh file from this object directory to the
21271 new one before you run Configure -- this will help you with most of
21272 the policy defaults.
21276 if $test -f config.msg; then
21277 echo "Hmm. I also noted the following information while running:"
21279 $cat config.msg >&4
21282 $rm -f kit*isdone ark*isdone