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 Jun 21 21:45:01 CEST 2005 [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 /opt/ansic/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
342 d_attribute_format=''
343 d_attribute_malloc=''
344 d_attribute_nonnull=''
345 d_attribute_noreturn=''
347 d_attribute_unused=''
348 d_attribute_warn_unused_result=''
394 endhostent_r_proto=''
400 endprotoent_r_proto=''
406 endservent_r_proto=''
457 gethostbyaddr_r_proto=''
459 gethostbyname_r_proto=''
461 gethostent_r_proto=''
473 getnetbyaddr_r_proto=''
475 getnetbyname_r_proto=''
489 d_getprotobyname_r=''
490 getprotobyname_r_proto=''
491 d_getprotobynumber_r=''
492 getprotobynumber_r_proto=''
494 getprotoent_r_proto=''
506 getservbyname_r_proto=''
508 getservbyport_r_proto=''
510 getservent_r_proto=''
534 d_libm_lib_version=''
587 d_old_pthread_create_joinable=''
588 old_pthread_create_joinable=''
590 d_pthread_attr_setscope=''
629 sethostent_r_proto=''
646 setprotoent_r_proto=''
658 setservent_r_proto=''
703 d_stdio_ptr_lval_nochange_cnt=''
704 d_stdio_ptr_lval_sets_cnt=''
907 inc_version_list_init=''
926 ignore_versioned_solibs=''
986 d_perl_otherlibdirs=''
1000 version_patchlevel_string=''
1004 d_nv_preserves_uv=''
1005 d_nv_zero_is_allbits_zero=''
1016 nv_preserves_uv_bits=''
1087 installsitehtml1dir=''
1090 installsitehtml3dir=''
1097 installsiteman1dir=''
1100 installsiteman3dir=''
1105 installsitescript=''
1120 d_stdio_stream_array=''
1121 stdio_stream_array=''
1132 ccflags_uselargefiles=''
1133 ldflags_uselargefiles=''
1134 libswanted_uselargefiles=''
1144 userelocatableinc=''
1155 installvendorarch=''
1162 installvendorhtml1dir=''
1164 vendorhtml1direxp=''
1165 installvendorhtml3dir=''
1167 vendorhtml3direxp=''
1173 installvendorman1dir=''
1176 installvendorman3dir=''
1183 installvendorscript=''
1195 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1198 : We must find out about Eunice early
1200 if test -f /etc/unixtovms; then
1201 eunicefix=/etc/unixtovms
1203 if test -f /etc/unixtovms.exe; then
1204 eunicefix=/etc/unixtovms.exe
1207 : Set executable suffix now -- needed before hints available
1208 if test -f "/libs/version.library"; then
1211 elif test -f "/system/gnu_library/bin/ar.pm"; then
1214 elif test -n "$DJGPP"; then
1217 elif test -d c:/. -o -n "$is_os2" ; then
1226 : set useposix=false in your hint file to disable the POSIX extension.
1228 : set useopcode=false in your hint file to disable the Opcode extension.
1230 : Trailing extension. Override this in a hint file, if needed.
1231 : Extra object files, if any, needed on this platform.
1234 : Possible local include directories to search.
1235 : Set locincpth to "" in a hint file to defeat local include searches.
1236 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1237 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1239 : no include file wanted by default
1244 : change the next line if compiling for Xenix/286 on Xenix/386
1245 xlibpth='/usr/lib/386 /lib/386'
1246 : Possible local library directories to search.
1247 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1248 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1250 : general looking path for locating libraries
1251 glibpth="/lib /usr/lib $xlibpth"
1252 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1253 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1254 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1256 : Private path used by Configure to find libraries. Its value
1257 : is prepended to libpth. This variable takes care of special
1258 : machines, like the mips. Usually, it should be empty.
1261 : default library list
1263 : some systems want to use only the non-versioned libso:s
1264 ignore_versioned_solibs=''
1269 ccflags_uselargefiles=''
1270 ldflags_uselargefiles=''
1271 libswanted_uselargefiles=''
1272 : set usemultiplicity on the Configure command line to enable multiplicity.
1273 : set usesocks on the Configure command line to enable socks.
1274 : set usethreads on the Configure command line to enable threads.
1275 usereentrant='undef'
1276 : full support for void wanted by default
1279 : List of libraries we want.
1280 : If anyone needs extra -lxxx, put those in a hint file.
1281 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1282 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1283 : We probably want to search /usr/shlib before most other libraries.
1284 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1285 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1286 glibpth="/usr/shlib $glibpth"
1287 : Do not use vfork unless overridden by a hint file.
1290 : Find the basic shell for Bourne shell scripts
1294 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1297 if test -f "$xxx"; then
1300 : Build up a list and do a single loop so we can 'break' out.
1301 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1302 for xxx in sh bash ksh pdksh ash; do
1304 try="$try ${p}/${xxx}"
1308 if test -f "$xxx"; then
1311 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1314 elif test -f "$xxx.exe"; then
1325 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1327 Usually it's in /bin/sh. How did you even get this far?
1328 Please contact me (Perl Maintainers) at perlbug@perl.org and
1329 we'll try to straighten this all out.
1335 : see if sh knows # comments
1336 if `$sh -c '#' >/dev/null 2>&1`; then
1340 test -f $xcat$_exe || xcat=/usr/bin/cat
1341 if test ! -f $xcat$_exe; then
1342 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1343 if test -f $p/cat$_exe; then
1348 if test ! -f $xcat$_exe; then
1349 echo "Can't find cat anywhere!"
1353 echo "#!$xcat" >sharp
1357 if test -s today; then
1360 echo "#! $xcat" > sharp
1364 if test -s today; then
1372 echo "Your $sh doesn't grok # comments--I will strip them later on."
1375 echo "exec grep -v '^[ ]*#'" >spitshell
1377 $eunicefix spitshell
1378 spitshell=`pwd`/spitshell
1380 echo "I presume that if # doesn't work, #! won't work either!"
1385 : figure out how to guarantee sh startup
1387 '') startsh=${sharpbang}${sh} ;;
1399 : echo "Yup, it does."
1401 echo "Hmm... '$startsh' does not guarantee sh startup..."
1402 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1407 : Save command line options in file UU/cmdline.opt for later use in
1408 : generating config.sh.
1409 cat > cmdline.opt <<EOSH
1410 # Configure command line arguments.
1419 cat >>cmdline.opt <<EOSH
1420 config_arg$argn='$arg'
1422 # Extreme backslashitis: replace each ' by '"'"'
1423 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1426 arg_exp=`cat cmdl.opt`
1427 args_exp="$args_exp$args_sep'$arg_exp'"
1428 argn=`expr $argn + 1`
1431 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1432 # used by ./hints/os2.sh
1435 : produce awk script to parse command line options
1436 cat >options.awk <<'EOF'
1438 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1440 len = length(optstr);
1441 for (i = 1; i <= len; i++) {
1442 c = substr(optstr, i, 1);
1443 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1454 if (substr(str, 1, 1) != "-") {
1455 printf("'%s'\n", str);
1459 for (i = 2; i <= len; i++) {
1460 c = substr(str, i, 1);
1462 printf("-%s\n", substr(str, i));
1468 printf("'%s'\n", substr(str, i + 1));
1481 : process the command line options
1482 set X `for arg in "$@"; do echo "X$arg"; done |
1483 sed -e s/X// | awk -f options.awk`
1488 : set up default values
1498 rm -f optdef.sh posthint.sh
1499 cat >optdef.sh <<EOS
1505 while test $# -gt 0; do
1507 -d) shift; fastread=yes;;
1508 -e) shift; alldone=cont;;
1512 if test -r "$1"; then
1515 echo "$me: cannot read config file $1." >&2
1520 -h) shift; error=true;;
1521 -r) shift; reuseval=true;;
1522 -s) shift; silent=true; realsilent=true;;
1523 -E) shift; alldone=exit;;
1524 -K) shift; knowitall=true;;
1525 -O) shift; override=true;;
1526 -S) shift; silent=true; extractsh=true;;
1531 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1532 echo "$me: ignoring -D $1" >&2
1535 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1536 *) echo "$1='define'" >> optdef.sh;;
1543 *=) echo "$1" >> optdef.sh;;
1545 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1546 echo "$me: ignoring -U $1" >&2
1548 *) echo "$1='undef'" >> optdef.sh;;
1559 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1563 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1564 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1570 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1571 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1572 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1573 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1574 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1575 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1581 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1583 echo "$yyy=''" >> posthint.sh ;;
1588 echo "$yyy='$zzz'" >> posthint.sh ;;
1590 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1592 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1597 echo "$yyy=$zzz" >> posthint.sh ;;
1598 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1602 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1605 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1613 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1614 [-U symbol] [-U symbol=] [-A command:symbol...]
1615 -d : use defaults for all answers.
1616 -e : go on without questioning past the production of config.sh.
1617 -f : specify an alternate default configuration file.
1618 -h : print this help message and exit (with an error status).
1619 -r : reuse C symbols value if possible (skips costly nm extraction).
1620 -s : silent mode, only echoes questions and essential information.
1621 -D : define symbol to have some value:
1622 -D symbol symbol gets the value 'define'
1623 -D symbol=value symbol gets the value 'value'
1624 -E : stop at the end of questions, after having produced config.sh.
1625 -K : do not use unless you know what you are doing.
1626 -O : let -D and -U override definitions from loaded configuration file.
1627 -S : perform variable substitutions on all .SH files (can mix with -f)
1628 -U : undefine symbol:
1629 -U symbol symbol gets the value 'undef'
1630 -U symbol= symbol gets completely empty
1631 -A : manipulate symbol after the platform specific hints have been applied:
1632 -A symbol=value append " "value to symbol
1633 -A append:symbol=value append value to symbol
1634 -A define:symbol=value define symbol to have value
1635 -A clear:symbol define symbol to be ''
1636 -A define:symbol define symbol to be 'define'
1637 -A eval:symbol=value define symbol to be eval of value
1638 -A prepend:symbol=value prepend value to symbol
1639 -A undef:symbol define symbol to be 'undef'
1640 -A undef:symbol= define symbol to be ''
1641 -V : print version number and exit (with a zero status).
1648 case "$fastread$alldone" in
1651 case "$extractsh" in
1654 if test ! -t 0; then
1655 echo "Say 'sh Configure', not 'sh <Configure'"
1665 true) exec 1>/dev/null;;
1668 : run the defines and the undefines, if any, but leave the file out there...
1671 : create the posthint manipulation script and leave the file out there...
1676 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1677 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1678 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1679 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1680 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1683 : Some greps do not return status, grrr.
1684 echo "grimblepritz" >grimble
1685 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1687 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1693 : the following should work in any shell
1697 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1698 cat >contains <<'EOSS'
1699 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1704 : Find the path to the source tree
1707 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1711 *) src=`cd ../$src && pwd` ;;
1724 if test -f $rsrc/Configure && \
1725 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1727 : found it, so we are ok.
1730 for src in . .. ../.. ../../.. ../../../..; do
1731 if test -f ../$src/Configure && \
1732 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1743 Sorry, I can't seem to locate the source dir for $package. Please start
1744 Configure with an explicit path -- i.e. /some/path/Configure.
1752 echo "Sources for $package found in \"$src\"." >&4
1756 : script used to extract .SH files with variable substitutions
1757 cat >extract <<'EOS'
1759 echo "Doing variable substitutions on .SH files..."
1760 if test -f MANIFEST; then
1761 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1763 echo "(Looking for .SH files under the source directory.)"
1764 set x `(cd "$src"; find . -name "*.SH" -print)`
1768 0) set x `(cd "$src"; echo *.SH)`; shift;;
1770 if test ! -f "$src/$1"; then
1776 while test $name; do
1777 if test ! -d "$name"; then
1778 create="$name $create";
1779 name=`echo $name | sed -e "s|^[^/]*$||"`;
1780 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1785 for file in $create; do
1794 dir=`expr X$file : 'X\(.*\)/'`
1795 file=`expr X$file : 'X.*/\(.*\)'`
1796 (cd "$dir" && . ./$file)
1806 dir=`expr X$file : 'X\(.*\)/'`
1807 file=`expr X$file : 'X.*/\(.*\)'`
1808 (set x $dir; shift; eval $mkdir_p)
1809 sh <"$src/$dir/$file"
1818 if test -f "$src/config_h.SH"; then
1819 if test ! -f config.h; then
1820 : oops, they left it out of MANIFEST, probably, so do it anyway.
1821 . "$src/config_h.SH"
1826 : extract files and exit if asked to do so
1827 case "$extractsh" in
1829 case "$realsilent" in
1833 case "$config_sh" in
1834 '') config_sh='config.sh';;
1837 echo "Fetching answers from $config_sh..."
1840 test "$override" && . ./optdef.sh
1844 echo "Extraction done."
1849 : Eunice requires " " instead of "", can you believe it
1852 echo "Beginning of configuration questions for $package."
1854 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1856 : first determine how to suppress newline on echo command
1858 echo "Checking echo to see how to suppress newlines..."
1859 (echo "hi there\c" ; echo " ") >.echotmp
1860 if $contains c .echotmp >/dev/null 2>&1 ; then
1871 echo $n "The star should be here-->$c"
1875 : Now test for existence of everything in MANIFEST
1877 if test -f "$rsrc/MANIFEST"; then
1878 echo "First let's make sure your kit is complete. Checking..." >&4
1879 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1882 for filelist in x??; do
1883 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1885 if test -s missing; then
1889 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1891 You have the option of continuing the configuration process, despite the
1892 distinct possibility that your kit is damaged, by typing 'y'es. If you
1893 do, don't blame me if something goes wrong. I advise you to type 'n'o
1894 and contact the author (perlbug@perl.org).
1897 echo $n "Continue? [n] $c" >&4
1901 echo "Continuing..." >&4
1905 echo "ABORTING..." >&4
1910 echo "Looks good..."
1913 echo "There is no MANIFEST file. I hope your kit is complete !"
1918 : Find the appropriate value for a newline for tr
1919 if test -n "$DJGPP"; then
1922 if test X"$trnl" = X; then
1923 case "`echo foo|tr '\n' x 2>/dev/null`" in
1927 if test X"$trnl" = X; then
1928 case "`echo foo|tr '\012' x 2>/dev/null`" in
1929 foox) trnl='\012' ;;
1932 if test X"$trnl" = X; then
1933 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1934 fooxy) trnl='\n\r' ;;
1937 if test X"$trnl" = X; then
1940 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1946 : compute the number of columns on the terminal for proper question formatting
1951 : set up the echo used in my read
1952 myecho="case \"\$xxxm\" in
1953 '') echo $n \"\$rp $c\" >&4;;
1955 '') echo $n \"[\$xxxm] $c\";;
1957 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1959 echo $n \"[\$xxxm] $c\" >&4
1961 echo $n \"\$rp [\$xxxm] $c\" >&4
1967 : now set up to do reads with possible shell escape and default assignment
1973 case "\$fastread" in
1974 yes) case "\$dflt" in
1977 case "\$silent-\$rp" in
1982 *) case "\$silent" in
1983 true) case "\$rp" in
1988 while expr "X\$ans" : "X!" >/dev/null; do
1992 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2000 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2009 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2014 echo "(OK, I'll run with -d after this question.)" >&4
2017 echo "*** Sorry, \$1 not supported yet." >&4
2027 echo "*** Substitution done -- please confirm."
2029 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2034 echo "*** Error -- try again."
2041 case "\$ans\$xxxm\$nostick" in
2053 : create .config dir to save info across Configure sessions
2054 test -d ../.config || mkdir ../.config
2055 cat >../.config/README <<EOF
2056 This directory created by Configure to save information that should
2057 persist across sessions for $package.
2059 You may safely delete it if you wish.
2062 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2064 $define|true|[yY]*) ;;
2065 *) case "$xversion" in
2068 *** WHOA THERE!!! ***
2070 This is an UNSTABLE DEVELOPMENT release.
2071 The version of this $package distribution is $xversion, that is, odd,
2072 (as opposed to even) and that signifies a development release.
2073 If you want a maintenance release, you want an even-numbered version.
2075 Do ***NOT*** install this into production use.
2076 Data corruption and crashes are possible.
2078 It is most seriously suggested that you do not continue any further
2079 unless you want to help in developing and debugging Perl.
2081 If you *still* want to build perl, you can answer 'y' now,
2082 or pass -Dusedevel to Configure.
2085 rp='Do you really want to continue?'
2089 [yY]) echo >&4 "Okay, continuing."
2090 usedevel="$define" ;;
2091 *) echo >&4 "Okay, bye."
2101 case "$versiononly" in
2102 '') versiononly="$define" ;;
2104 case "$installusrbinperl" in
2105 '') installusrbinperl="$undef" ;;
2110 : general instructions
2113 user=`(logname) 2>/dev/null`
2115 '') user=`whoami 2>&1`;;
2117 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2120 rp='Would you like to see the instructions?'
2131 This installation shell script will examine your system and ask you questions
2132 to determine how the perl5 package should be installed. If you get
2133 stuck on a question, you may use a ! shell escape to start a subshell or
2134 execute a command. Many of the questions will have default answers in square
2135 brackets; typing carriage return will give you the default.
2137 On some of the questions which ask for file or directory names you are allowed
2138 to use the ~name construct to specify the login directory belonging to "name",
2139 even if you don't have a shell which knows about that. Questions where this is
2140 allowed will be marked "(~name ok)".
2144 dflt='Type carriage return to continue'
2148 The prompter used in this script allows you to use shell variables and
2149 backticks in your answers. You may use $1, $2, etc... to refer to the words
2150 in the default answer, as if the default line was a set of arguments given to a
2151 script shell. This means you may also use $* to repeat the whole default line,
2152 so you do not have to re-type everything to add something to the default.
2154 Everytime there is a substitution, you will have to confirm. If there is an
2155 error (e.g. an unmatched backtick), the default answer will remain unchanged
2156 and you will be prompted again.
2158 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2159 the questions and use the computed defaults (or the previous answers if there
2160 was already a config.sh file). Type 'Configure -h' for a list of options.
2161 You may also start interactively and then answer '& -d' at any prompt to turn
2162 on the non-interactive behaviour for the remainder of the execution.
2168 Much effort has been expended to ensure that this shell script will run on any
2169 Unix system. If despite that it blows up on yours, your best bet is to edit
2170 Configure and run it again. If you can't run Configure for some reason,
2171 you'll have to generate a config.sh file by hand. Whatever problems you
2172 have, let me (perlbug@perl.org) know how I blew it.
2174 This installation script affects things in two ways:
2176 1) it may do direct variable substitutions on some of the files included
2178 2) it builds a config.h file for inclusion in C programs. You may edit
2179 any of these files as the need arises after running this script.
2181 If you make a mistake on a question, there is no easy way to back up to it
2182 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2183 files. Configure will offer to let you do this before it runs the SH files.
2186 dflt='Type carriage return to continue'
2188 case "$firsttime" in
2189 true) echo $user >>../.config/instruct;;
2193 : find out where common programs are
2195 echo "Locating common programs..." >&4
2208 if test -d \$dir/\$thing; then
2214 for thisthing in \$dir/\$thing; do
2215 : just loop through to pick last item
2217 if test -f \$thisthing; then
2220 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2223 elif test -f \$dir/\$thing.exe; then
2224 if test -n "$DJGPP"; then
2225 echo \$dir/\$thing.exe
2226 elif test "$eunicefix" != ":"; then
2227 : on Eunice apparently
2281 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2282 pth="$pth /lib /usr/lib"
2283 for file in $loclist; do
2287 if test -f "$xxx"; then
2290 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2291 xxx=`./loc $file $file $pth`
2294 '') xxx=`./loc $file $file $pth`;;
2295 *) xxx=`./loc $xxx $xxx $pth`;;
2297 eval $file=$xxx$_exe
2301 echo $file is in $xxx.
2304 echo $file is in $xxx.
2307 echo "I don't know where '$file' is, and my life depends on it." >&4
2308 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2314 echo "Don't worry if any of the following aren't found..."
2316 for file in $trylist; do
2320 if test -f "$xxx"; then
2323 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2324 xxx=`./loc $file $file $pth`
2327 '') xxx=`./loc $file $file $pth`;;
2328 *) xxx=`./loc $xxx $xxx $pth`;;
2330 eval $file=$xxx$_exe
2334 echo $file is in $xxx.
2337 echo $file is in $xxx.
2340 echo "I don't see $file out there, $say."
2347 echo "Substituting grep for egrep."
2354 echo "Substituting cp for ln."
2363 echo "I can't find make or gmake, and my life depends on it." >&4
2364 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2372 *) # We can't have osname yet.
2373 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2374 # Assume that gmake, if found, is definitely GNU make
2375 # and prefer it over the system make.
2376 echo "Substituting gmake for make."
2384 echo "Hopefully test is built into your sh."
2387 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2388 echo "Using the test built into your sh."
2396 echo "Hopefully echo is built into your sh."
2401 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2402 $echo $n "hi there$c" >foo1
2403 echo $n "hi there$c" >foo2
2404 if cmp foo1 foo2 >/dev/null 2>&1; then
2405 echo "They are compatible. In fact, they may be identical."
2412 They are not compatible! You are probably running ksh on a non-USG system.
2413 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2414 have echo built in and we may have to run some Bourne shell scripts. That
2415 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2418 $echo $n "The star should be here-->$c"
2428 cat <<'EOSC' >>trygcc
2433 int main(int argc, char *argv[]) {
2437 if $cc -o try $ccflags $ldflags try.c; then
2440 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2446 case "`$cc -v -c try.c 2>&1`" in
2449 if $test X"$trygcc" = Xyes; then
2450 if gcc -o try -c try.c; then
2452 echo "You seem to have a working gcc, though." >&4
2453 rp="Would you like to use it?"
2455 if $test -f myread; then
2458 if $test -f UU/myread; then
2461 echo "Cannot find myread, sorry. Aborting." >&2
2466 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2467 if $test -f usethreads.cbu; then
2470 *** However, any setting of the C compiler flags (e.g. for thread support)
2471 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2472 *** (together with e.g. -Dusethreads).
2488 cat <<'EOSC' >>checkcc
2493 int main(int argc, char *argv[]) {
2497 if $cc -o try $ccflags $ldflags try.c; then
2500 if $test X"$despair" = Xyes; then
2501 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2504 You need to find a working C compiler.
2505 Either (purchase and) install the C compiler supplied by your OS vendor,
2506 or for a free C compiler try http://gcc.gnu.org/
2507 I cannot continue any further, aborting.
2516 : determine whether symbolic links are supported
2519 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2520 echo "Symbolic links are supported." >&4
2523 echo "Symbolic links are NOT supported." >&4
2528 : determine whether symbolic links are supported
2532 echo "Checking how to test for symbolic links..." >&4
2534 if $test "X$issymlink" = X; then
2536 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2537 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2539 if test $? = 0; then
2542 echo "Your builtin 'test -h' may be broken." >&4
2545 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2548 if test -f "$p/$test"; then
2557 echo "Trying external '$test -h'." >&4
2558 issymlink="$test -h"
2559 if $test ! -h sym >/dev/null 2>&1; then
2560 echo "External '$test -h' is broken, too." >&4
2568 if $test "X$issymlink" = X; then
2569 if $test -L sym 2>/dev/null; then
2570 issymlink="$test -L"
2571 echo "The builtin '$test -L' worked." >&4
2574 if $test "X$issymlink" != X; then
2575 echo "You can test for symbolic links with '$issymlink'." >&4
2577 echo "I do not know how you can test for symbolic links." >&4
2581 *) echo "No symbolic links, so not testing for their testing..." >&4
2587 case "$mksymlinks" in
2590 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2593 *) case "$lns:$issymlink" in
2594 *"ln"*" -s:"*"test -"?)
2595 echo "Creating the symbolic links..." >&4
2596 echo "(First creating the subdirectories...)" >&4
2598 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2600 test -z "$directory" && break
2604 if test ! -d t/base; then
2605 echo "Failed to create the subdirectories. Aborting." >&4
2608 echo "(Then creating the symlinks...)" >&4
2609 awk '{print $1}' $src/MANIFEST | while true; do
2611 test -z "$filename" && break
2612 if test -f $filename; then
2613 if $issymlink $filename; then
2617 if test -f $filename; then
2618 echo "$filename already exists, not symlinking."
2620 ln -s $src/$filename $filename
2624 if test ! -f t/base/lex.t; then
2625 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2630 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2639 case "$usecrosscompile" in
2641 $echo "Cross-compiling..."
2644 *-*-gcc) # A cross-compiling gcc, probably.
2645 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2647 # leave out ld, choosing it is more complex
2649 ranlib=$targetarch-ranlib
2650 $echo 'extern int foo;' > try.c
2651 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2653 if $test $# -gt 0; then
2655 incpth="`$echo $incpth|$sed 's/^ //'`"
2656 echo "Guessing incpth '$incpth'." >&4
2658 j="`$echo $i|$sed 's,/include$,/lib,'`"
2659 if $test -d $j; then
2663 libpth="`$echo $libpth|$sed 's/^ //'`"
2664 echo "Guessing libpth '$libpth'." >&4
2669 case "$targetarch" in
2670 '') echo "Targetarch not defined." >&4; croak=y ;;
2671 *) echo "Using targetarch $targetarch." >&4 ;;
2674 '') echo "Incpth not defined." >&4; croak=y ;;
2675 *) echo "Using incpth '$incpth'." >&4 ;;
2678 '') echo "Libpth not defined." >&4; croak=y ;;
2679 *) echo "Using libpth '$libpth'." >&4 ;;
2682 '') for i in $incpth; do
2683 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2685 echo "Guessing usrinc $usrinc." >&4
2690 '') echo "Usrinc not defined." >&4; croak=y ;;
2693 *) echo "Using usrinc $usrinc." >&4 ;;
2695 case "$targethost" in
2696 '') echo "Targethost not defined." >&4; croak=y ;;
2697 *) echo "Using targethost $targethost." >&4
2702 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2705 /*) run=$src/Cross/run
2706 targetmkdir=$src/Cross/mkdir
2708 from=$src/Cross/from
2710 *) pwd=`$test -f ../Configure & cd ..; pwd`
2712 targetmkdir=$pwd/Cross/mkdir
2714 from=$pwd/Cross/from
2717 case "$targetrun" in
2718 '') targetrun=ssh ;;
2723 case "$targetfrom" in
2724 '') targetfrom=scp ;;
2728 from=$from-$targetfrom
2729 case "$targetdir" in
2731 echo "Guessing targetdir $targetdir." >&4
2734 case "$targetuser" in
2736 echo "Guessing targetuser $targetuser." >&4
2739 case "$targetfrom" in
2743 case "$targetrun" in
2755 '') cwd=$targetdir ;;
2759 if $test ! -f \$exe.xok; then
2763 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2766 *) echo "Unknown targetrun '$targetrun'" >&4
2770 case "$targetmkdir" in
2772 cat >$targetmkdir <<EOF
2774 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2776 $chmod a+rx $targetmkdir
2778 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2790 $targetmkdir \`dirname \$f\`
2791 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2794 $targetmkdir $targetdir/\`dirname \$f\`
2795 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2808 $mkdir -p $targetdir/\`dirname \$f\`
2809 $cp \$f $targetdir/\$f || exit 1
2812 $targetmkdir $targetdir/\`dirname \$f\`
2813 $cp \$f $targetdir/\$f || exit 1
2820 *) echo "Unknown targetto '$targetto'" >&4
2824 case "$targetfrom" in
2831 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2836 cp) cat >$from <<EOF
2841 cp $targetdir/\$f . || exit 1
2846 *) echo "Unknown targetfrom '$targetfrom'" >&4
2850 if $test ! -f $run; then
2851 echo "Target 'run' script '$run' not found." >&4
2855 if $test ! -f $to; then
2856 echo "Target 'to' script '$to' not found." >&4
2860 if $test ! -f $from; then
2861 echo "Target 'from' script '$from' not found." >&4
2865 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2869 Using '$run' for remote execution,
2870 and '$from' and '$to'
2871 for remote file transfer.
2877 usecrosscompile='undef'
2882 : see whether [:lower:] and [:upper:] are supported character classes
2884 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2886 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2890 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2891 # (0xd9 and 0xe2), therefore that is a nice testing point.
2892 if test "X$up" = X -o "X$low" = X; then
2893 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2899 if test "X$up" = X -o "X$low" = X; then
2900 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2906 if test "X$up" = X -o "X$low" = X; then
2907 case "`echo RS | od -x 2>/dev/null`" in
2909 echo "Hey, this might be EBCDIC." >&4
2910 if test "X$up" = X -o "X$low" = X; then
2911 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2912 rs) up='[A-IJ-RS-Z]'
2917 if test "X$up" = X -o "X$low" = X; then
2918 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2928 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2930 echo "Using $up and $low to convert case." >&4
2933 echo "I don't know how to translate letters from upper to lower case." >&4
2934 echo "Your tr is not acting any way I know of." >&4
2938 : set up the translation script tr, must be called with ./tr of course
2942 '[A-Z][a-z]') exec $tr '$up' '$low';;
2943 '[a-z][A-Z]') exec $tr '$low' '$up';;
2950 : Try to determine whether config.sh was made on this system
2951 case "$config_sh" in
2953 myuname=`$uname -a 2>/dev/null`
2954 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2955 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2956 # because the A-Z/a-z are not consecutive.
2957 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2958 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2959 newmyuname="$myuname"
2961 case "$knowitall" in
2963 if test -f ../config.sh; then
2964 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2965 eval "`grep myuname= ../config.sh`"
2967 if test "X$myuname" = "X$newmyuname"; then
2975 : Get old answers from old config file if Configure was run on the
2976 : same system, otherwise use the hints.
2979 if test -f config.sh; then
2981 rp="I see a config.sh file. Shall I use it to set the defaults?"
2984 n*|N*) echo "OK, I'll ignore it."
2985 mv config.sh config.sh.old
2986 myuname="$newmyuname"
2988 *) echo "Fetching default answers from your old config.sh file..." >&4
2996 : Older versions did not always set $sh. Catch re-use of such
3006 if test ! -f config.sh; then
3009 First time through, eh? I have some defaults handy for some systems
3010 that need some extra help getting the Configure answers right:
3013 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3015 : Half the following guesses are probably wrong... If you have better
3016 : tests or hints, please send them to perlbug@perl.org
3017 : The metaconfig authors would also appreciate a copy...
3018 $test -f /irix && osname=irix
3019 $test -f /xenix && osname=sco_xenix
3020 $test -f /dynix && osname=dynix
3021 $test -f /dnix && osname=dnix
3022 $test -f /lynx.os && osname=lynxos
3023 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3024 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3025 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3026 $test -f /bin/mips && /bin/mips && osname=mips
3027 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3028 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3029 $test -d /usr/apollo/bin && osname=apollo
3030 $test -f /etc/saf/_sactab && osname=svr4
3031 $test -d /usr/include/minix && osname=minix
3032 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3033 if $test -d /MachTen -o -d /MachTen_Folder; then
3035 if $test -x /sbin/version; then
3036 osvers=`/sbin/version | $awk '{print $2}' |
3037 $sed -e 's/[A-Za-z]$//'`
3038 elif $test -x /usr/etc/version; then
3039 osvers=`/usr/etc/version | $awk '{print $2}' |
3040 $sed -e 's/[A-Za-z]$//'`
3046 $test -f /sys/posix.dll &&
3047 $test -f /usr/bin/what &&
3048 set X `/usr/bin/what /sys/posix.dll` &&
3049 $test "$3" = UWIN &&
3053 if $test -f $uname; then
3061 umips) osname=umips ;;
3064 [23]100) osname=mips ;;
3065 next*) osname=next ;;
3067 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3068 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3071 elif $test -f /etc/kconfig; then
3073 if test "$lns" = "$ln -s"; then
3075 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3077 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3084 if test -n "$DJGPP"; then
3093 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3095 # oslevel can fail with:
3096 # oslevel: Unable to acquire lock.
3097 *not\ found) osvers="$4"."$3" ;;
3098 '<3240'|'<>3240') osvers=3.2.0 ;;
3099 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3100 '=3250'|'>3250') osvers=3.2.5 ;;
3104 bsd386) osname=bsd386
3107 cygwin*) osname=cygwin
3110 *dc.osx) osname=dcosx
3116 domainos) osname=apollo
3122 dynixptx*) osname=dynixptx
3123 osvers=`echo "$4"|sed 's/^v//'`
3125 freebsd) osname=freebsd
3127 genix) osname=genix ;;
3131 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3147 netbsd*) osname=netbsd
3150 news-os) osvers="$3"
3152 4*) osname=newsos4 ;;
3156 next*) osname=next ;;
3157 nonstop-ux) osname=nonstopux ;;
3158 openbsd) osname=openbsd
3164 POSIX-BC | posix-bc ) osname=posix-bc
3167 powerux | power_ux | powermax_os | powermaxos | \
3168 powerunix | power_unix) osname=powerux
3174 solaris) osname=solaris
3176 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3183 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3187 titanos) osname=titanos
3196 ultrix) osname=ultrix
3199 osf1|mls+) case "$5" in
3202 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3205 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3208 hp*) osname=hp_osf1 ;;
3209 mips) osname=mips_osf1 ;;
3212 # UnixWare 7.1.2 is known as Open UNIX 8
3213 openunix|unixware) osname=svr5
3221 $2) case "$osname" in
3225 : svr4.x or possibly later
3235 if test -f /stand/boot ; then
3236 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3237 if test -n "$INITPROG" -a -f "$INITPROG"; then
3238 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3239 if test -n "$isesix"; then
3247 *) if test -f /etc/systemid; then
3249 set `echo $3 | $sed 's/\./ /g'` $4
3250 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3252 elif $test -f $src/hints/sco_$1_$2.sh; then
3254 elif $test -f $src/hints/sco_$1.sh; then
3259 '') : Still unknown. Probably a generic Sys V.
3268 *) case "$osname" in
3269 '') : Still unknown. Probably a generic BSD.
3277 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3278 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3279 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3282 $rm -f UU/kernel.what
3283 elif test -d c:/. -o -n "$is_os2" ; then
3290 case "$targetarch" in
3293 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3298 : Now look for a hint file osname_osvers, unless one has been
3299 : specified already.
3302 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3303 : Also try without trailing minor version numbers.
3304 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3305 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3306 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3307 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3310 *) case "$osvers" in
3313 *) if $test -f $src/hints/$file.sh ; then
3315 elif $test -f $src/hints/$xfile.sh ; then
3317 elif $test -f $src/hints/$xxfile.sh ; then
3319 elif $test -f $src/hints/$xxxfile.sh ; then
3321 elif $test -f $src/hints/$xxxxfile.sh ; then
3323 elif $test -f "$src/hints/${osname}.sh" ; then
3332 if $test -f Policy.sh ; then
3335 none) dflt="Policy" ;;
3336 *) dflt="Policy $dflt" ;;
3341 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3345 if $test -f Policy.sh ; then
3348 There's also a Policy hint file available, which should make the
3349 site-specific (policy) questions easier to answer.
3356 You may give one or more space-separated answers, or "none" if appropriate.
3357 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3358 is a good thing. DO NOT give a wrong version or a wrong OS.
3362 rp="Which of these apply, if any?"
3365 for file in $tans; do
3366 if $test X$file = XPolicy -a -f Policy.sh; then
3368 $cat Policy.sh >> UU/config.sh
3369 elif $test -f $src/hints/$file.sh; then
3370 . $src/hints/$file.sh
3371 $cat $src/hints/$file.sh >> UU/config.sh
3372 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3375 : Give one chance to correct a possible typo.
3376 echo "$file.sh does not exist"
3378 rp="hint to use instead?"
3380 for file in $ans; do
3381 if $test -f "$src/hints/$file.sh"; then
3382 . $src/hints/$file.sh
3383 $cat $src/hints/$file.sh >> UU/config.sh
3384 elif $test X$ans = X -o X$ans = Xnone ; then
3387 echo "$file.sh does not exist -- ignored."
3394 : Remember our hint file for later.
3395 if $test -f "$src/hints/$file.sh" ; then
3405 echo "Fetching default answers from $config_sh..." >&4
3409 cp $config_sh config.sh 2>/dev/null
3419 test "$override" && . ./optdef.sh
3421 : Restore computed paths
3422 for file in $loclist $trylist; do
3423 eval $file="\$_$file"
3428 Configure uses the operating system name and version to set some defaults.
3429 The default value is probably right if the name rings a bell. Otherwise,
3430 since spelling matters for me, either accept the default or answer "none"
3437 ''|' '|none) dflt=none ;;
3438 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3441 *) dflt="$osname" ;;
3443 rp="Operating system name?"
3447 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3453 ''|' '|none) dflt=none ;;
3454 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3455 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3457 ''|' ') dflt=none ;;
3462 *) dflt="$osvers" ;;
3464 rp="Operating system version?"
3474 : who configured the system
3475 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3478 cf_by=`(logname) 2>/dev/null`
3481 cf_by=`(whoami) 2>/dev/null`
3483 "") cf_by=unknown ;;
3488 : set up the script used to warn in case of inconsistency
3495 echo "*** WHOA THERE!!! ***" >&4
3496 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3497 rp=" Keep the $hint value?"
3500 y) td=$was; tu=$was;;
3504 : function used to set $1 to $val
3505 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3507 $define$undef) . ./whoa; eval "$var=\$td";;
3508 $undef$define) . ./whoa; eval "$var=\$tu";;
3509 *) eval "$var=$val";;
3513 $define|true|[yY]*) dflt='y';;
3518 Perl can be built to use the SOCKS proxy protocol library. To do so,
3519 Configure must be run with -Dusesocks. If you use SOCKS you also need
3520 to use the PerlIO abstraction layer, this will be implicitly selected.
3522 If this doesn't make any sense to you, just accept the default '$dflt'.
3524 rp='Build Perl for SOCKS?'
3527 y|Y) val="$define" ;;
3534 $define|true|[yY]*) useperlio="$define";;
3537 case "$useperlio" in
3538 $define|true|[yY]*|'') dflt='y';;
3543 Previous version of $package used the standard IO mechanisms as
3544 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3545 alternate IO mechanisms via the PerlIO abstraction layer, but the
3546 stdio mechanism is still available if needed. The abstraction layer
3547 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3548 Using PerlIO with sfio may cause problems with some extension modules.
3550 If this doesn't make any sense to you, just accept the default '$dflt'.
3552 rp='Use the PerlIO abstraction layer?'
3559 echo "Ok, doing things the stdio way."
3568 case "$useperlio" in
3569 $define|true|[yY]*) ;;
3572 You are using the SOCKS proxy protocol library which means that you
3573 should also use the PerlIO layer. You may be headed for trouble.
3582 case "$usethreads" in
3583 $define|true|[yY]*) dflt='y';;
3584 *) # Catch case where user specified ithreads or 5005threads but
3585 # forgot -Dusethreads (A.D. 4/2002)
3586 case "$useithreads$use5005threads" in
3588 case "$useperlio" in
3589 "$define") dflt='y' ;;
3599 Perl can be built to take advantage of threads on some systems.
3600 To do so, Configure can be run with -Dusethreads.
3602 Note that Perl built with threading support runs slightly slower
3603 and uses more memory than plain Perl. The current implementation
3604 is believed to be stable, but it is fairly new, and so should be
3605 treated with caution.
3607 If this doesn't make any sense to you, just accept the default '$dflt'.
3609 rp='Build a threading Perl?'
3612 y|Y) val="$define" ;;
3618 case "$usethreads" in
3622 Since release 5.6, Perl has had two different threading implementations,
3623 the newer interpreter-based version (ithreads) with one interpreter per
3624 thread, and the older 5.005 version (5005threads).
3625 The 5005threads version is effectively unmaintained and will probably be
3626 removed in Perl 5.10, so there should be no need to build a Perl using it
3627 unless needed for backwards compatibility with some existing 5.005threads
3631 : Default to ithreads unless overridden on command line or with
3634 case "$use5005threads" in
3635 $define|true|[yY]*) dflt='n';;
3637 case "$useithreads" in
3638 $undef|false|[nN]*) dflt='n';;
3640 rp='Use the newer interpreter-based ithreads?'
3643 y|Y) val="$define" ;;
3648 : Now set use5005threads to the opposite value.
3649 case "$useithreads" in
3650 $define) val="$undef" ;;
3657 useithreads="$undef"
3658 use5005threads="$undef"
3662 case "$useithreads$use5005threads" in
3666 You cannot have both the ithreads and the 5.005 threads enabled
3667 at the same time. Disabling the 5.005 threads since they are
3668 much less stable than the ithreads.
3671 use5005threads="$undef"
3675 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3678 *** To build with ithreads you must also use the PerlIO layer.
3679 *** Cannot continue, aborting.
3685 case "$d_oldpthreads" in
3686 '') : Configure tests would be welcome here. For now, assume undef.
3688 *) val="$d_oldpthreads" ;;
3694 : Look for a hint-file generated 'call-back-unit'. If the
3695 : user has specified that a threading perl is to be built,
3696 : we may need to set or change some other defaults.
3697 if $test -f usethreads.cbu; then
3698 echo "Your platform has some specific hints regarding threaded builds, using them..."
3701 case "$usethreads" in
3702 "$define"|true|[yY]*)
3704 (Your platform does not have any specific hints for threaded builds.
3705 Assuming POSIX threads, then.)
3713 Perl can be built so that multiple Perl interpreters can coexist
3714 within the same Perl executable.
3717 case "$useithreads" in
3720 This multiple interpreter support is required for interpreter-based threads.
3724 *) case "$usemultiplicity" in
3725 $define|true|[yY]*) dflt='y';;
3729 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3730 rp='Build Perl for multiplicity?'
3733 y|Y) val="$define" ;;
3742 case "$usemorebits" in
3743 "$define"|true|[yY]*)
3744 use64bitint="$define"
3745 uselongdouble="$define"
3746 usemorebits="$define"
3748 *) usemorebits="$undef"
3752 : make some quick guesses about what we are up against
3754 $echo $n "Hmm... $c"
3764 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3765 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3767 echo "Looks kind of like an OSF/1 system, but we'll see..."
3769 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3770 xxx=`./loc addbib blurfl $pth`
3771 if $test -f $xxx; then
3772 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3776 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3777 echo "Looks kind of like an extended USG system, but we'll see..."
3779 echo "Looks kind of like a USG system, but we'll see..."
3783 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3784 echo "Looks kind of like a BSD system, but we'll see..."
3788 echo "Looks kind of like a Version 7 system, but we'll see..."
3791 case "$eunicefix" in
3794 There is, however, a strange, musty smell in the air that reminds me of
3795 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3799 : it so happens the Eunice I know will not run shell scripts in Unix format
3803 echo "Congratulations. You aren't running Eunice."
3807 : Detect OS2. The p_ variable is set above in the Head.U unit.
3808 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3809 : semicolon as a patch separator
3814 I have the feeling something is not exactly right, however...don't tell me...
3815 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3816 (Or you may be running DOS with DJGPP.)
3821 if test -f /xenix; then
3822 echo "Actually, this looks more like a XENIX system..."
3827 echo "It's not Xenix..."
3832 if test -f /venix; then
3833 echo "Actually, this looks more like a VENIX system..."
3840 echo "Nor is it Venix..."
3843 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3844 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3851 rp="Use which C compiler?"
3855 : See if they have not cc but they do have gcc
3857 : Look for a hint-file generated 'call-back-unit'. Now that the
3858 : user has specified the compiler, we may need to set or change some
3860 if $test -f cc.cbu; then
3866 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3872 printf("%s\n", __VERSION__);
3874 printf("%s\n", "1");
3880 if $cc -o try $ccflags $ldflags try.c; then
3881 gccversion=`$run ./try`
3882 case "$gccversion" in
3883 '') echo "You are not using GNU cc." ;;
3884 *) echo "You are using GNU cc $gccversion."
3890 echo "*** WHOA THERE!!! ***" >&4
3891 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3892 case "$knowitall" in
3894 echo " You'd better start hunting for one and let me know about it." >&4
3900 case "$gccversion" in
3901 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3903 case "$gccversion" in
3904 '') gccosandvers='' ;;
3905 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3906 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3908 case "$gccosandvers" in
3909 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3910 $osname$osvers) ;; # looking good
3911 $osname*) cat <<EOM >&4
3913 *** WHOA THERE!!! ***
3915 Your gcc has not been compiled for the exact release of
3916 your operating system ($gccosandvers versus $osname$osvers).
3918 In general it is a good idea to keep gcc synchronized with
3919 the operating system because otherwise serious problems
3920 may ensue when trying to compile software, like Perl.
3922 I'm trying to be optimistic here, though, and will continue.
3923 If later during the configuration and build icky compilation
3924 problems appear (headerfile conflicts being the most common
3925 manifestation), I suggest reinstalling the gcc to match
3926 your operating system release.
3930 *) gccosandvers='' ;; # failed to parse, better be silent
3938 # gcc 3.* complain about adding -Idirectories that they already know about,
3939 # so we will take those off from locincpth.
3940 case "$gccversion" in
3942 echo "main(){}">try.c
3943 for incdir in $locincpth; do
3944 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3945 grep '^c[cp]p*[01]: warning: changing search order '`
3946 if test "X$warn" != X; then
3947 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3953 : decide how portable to be. Allow command line overrides.
3954 case "$d_portable" in
3956 *) d_portable="$define" ;;
3959 : set up shell script to do ~ expansion
3965 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3968 if $test -f /bin/csh; then
3969 /bin/csh -f -c "glob \$1"
3974 name=\`$expr x\$1 : '..\([^/]*\)'\`
3975 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3976 if $test ! -d "\$dir"; then
3978 echo "\$me: can't locate home directory for: \$name" >&2
3983 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3999 : now set up to get a file name
4003 cat <<'EOSC' >>getfile
4019 : getfile will accept an answer from the comma-separated list
4020 : enclosed in parentheses even if it does not meet other criteria.
4021 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4022 fn=`echo $fn | sed 's/(.*)//'`
4028 loc_file=`expr $fn : '.*:\(.*\)'`
4029 fn=`expr $fn : '\(.*\):.*'`
4037 */*) fullpath=true;;
4046 *e*) exp_file=true;;
4049 *p*) nopath_ok=true;;
4054 *d*) type='Directory';;
4055 *l*) type='Locate';;
4060 Locate) what='File';;
4065 case "$d_portable" in
4073 while test "$type"; do
4078 true) rp="$rp (~name ok)";;
4081 if test -f UU/getfile.ok && \
4082 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4101 value=`UU/filexp $ans`
4104 if test "$ans" != "$value"; then
4105 echo "(That expands to $value on this system.)"
4119 /*) value="$ansexp" ;;
4120 [a-zA-Z]:/*) value="$ansexp" ;;
4125 echo "I shall only accept a full path name, as in /bin/ls." >&4
4126 echo "Use a ! shell escape if you wish to check pathnames." >&4
4129 echo "Please give a full path name, starting with slash." >&4
4132 echo "Note that using ~name is ok provided it expands well." >&4
4145 for fp in $gfpth; do
4146 if test "X$fp" = X.; then
4151 if test -f "$pf"; then
4153 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4155 echo "($value is not a plain file, but that's ok.)"
4158 if test X"$type" = X; then
4165 for fp in $gfpth; do
4166 if test "X$fp" = X.; then
4171 direxp="$fp/$ansexp"
4173 if test -d "$direxp"; then
4181 if test -d "$ansexp"; then
4182 echo "(Looking for $loc_file in directory $value.)"
4183 value="$value/$loc_file"
4184 ansexp="$ansexp/$loc_file"
4186 if test -f "$ansexp"; then
4189 case "$nopath_ok" in
4190 true) case "$value" in
4192 *) echo "Assuming $value will be in people's path."
4208 if test "$fastread" = yes; then
4213 rp="$what $value doesn't exist. Use that name anyway?"
4232 test "X$gfpthkeep" != Xy && gfpth=""
4235 : What should the include directory be ?
4237 $echo $n "Hmm... $c"
4241 if $test -f /bin/mips && /bin/mips; then
4242 echo "Looks like a MIPS system..."
4243 $cat >usr.c <<'EOCP'
4244 #ifdef SYSTYPE_BSD43
4248 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4249 dflt='/bsd43/usr/include'
4253 mips_type='System V'
4255 $rm -f usr.c usr.out
4256 echo "and you're compiling with the $mips_type compiler and libraries."
4260 echo "Doesn't look like a MIPS system."
4270 case "$xxx_prompt" in
4273 rp='Where are the include files you want to use?'
4281 : see how we invoke the C preprocessor
4283 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4284 cat <<'EOT' >testcpp.c
4290 if test ! -f cppstdin; then
4291 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4292 # AIX cc -E doesn't show the absolute headerfile
4293 # locations but we'll cheat by using the -M flag.
4294 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
4296 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4299 echo "Keeping your $hint cppstdin wrapper."
4302 wrapper=`pwd`/cppstdin
4306 if $test "X$cppstdin" != "X" && \
4307 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4308 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4310 echo "You used to use $cppstdin $cppminus so we'll use that again."
4312 '') echo "But let's see if we can live without a wrapper..." ;;
4314 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4315 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4317 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4320 echo "(However, $cpprun $cpplast does not work, let's see...)"
4328 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4335 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4336 $cc -E <testcpp.c >testcpp.out 2>&1; \
4337 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4338 echo "Yup, it does."
4341 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4342 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4343 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4344 echo "Yup, it does."
4347 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4348 $cc -P <testcpp.c >testcpp.out 2>&1; \
4349 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4350 echo "Yipee, that works!"
4353 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4354 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4355 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4356 echo "At long last!"
4359 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4360 $cpp <testcpp.c >testcpp.out 2>&1; \
4361 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4365 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4366 $cpp - <testcpp.c >testcpp.out 2>&1; \
4367 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4368 echo "Hooray, it works! I was beginning to wonder."
4371 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4372 $wrapper <testcpp.c >testcpp.out 2>&1; \
4373 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4379 rp="No dice. I can't find a C preprocessor. Name one:"
4383 $x_cpp <testcpp.c >testcpp.out 2>&1
4384 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4385 echo "OK, that will do." >&4
4387 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4402 echo "Perhaps can we force $cc -E using a wrapper..."
4403 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4404 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4410 echo "Nope, we'll have to live without it..."
4424 "$wrapper"|'cppstdin') ;;
4425 *) $rm -f $wrapper;;
4427 $rm -f testcpp.c testcpp.out
4429 : Set private lib path
4432 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4437 '') dlist="$loclibpth $plibpth $glibpth";;
4438 *) dlist="$libpth";;
4441 : Now check and see which directories actually exist, avoiding duplicates
4445 if $test -d $xxx; then
4448 *) libpth="$libpth $xxx";;
4454 Some systems have incompatible or broken versions of libraries. Among
4455 the directories listed in the question below, please remove any you
4456 know not to be holding relevant libraries, and add any that are needed.
4457 Say "none" for none.
4468 rp="Directories to use for library searches?"
4475 : compute shared library extension
4478 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4488 On some systems, shared libraries may be available. Answer 'none' if
4489 you want to suppress searching of shared libraries for the remainder
4490 of this configuration.
4493 rp='What is the file extension used for shared libraries?'
4497 : Define several unixisms.
4498 : Hints files or command line option can be used to override them.
4499 : The convoluted testing is in case hints files set either the old
4502 '') case "$exe_ext" in
4504 *) _exe="$exe_ext" ;;
4509 '') case "$lib_ext" in
4516 '') case "$obj_ext" in
4523 '') case "$path_sep" in
4534 : Which makefile gets called first. This is used by make depend.
4535 case "$firstmakefile" in
4536 '') firstmakefile='makefile';;
4540 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4543 case "$uselongdouble" in
4544 $define|true|[yY]*) dflt='y';;
4549 Perl can be built to take advantage of long doubles which
4550 (if available) may give more accuracy and range for floating point numbers.
4552 If this doesn't make any sense to you, just accept the default '$dflt'.
4554 rp='Try to use long doubles if available?'
4557 y|Y) val="$define" ;;
4563 case "$uselongdouble" in
4564 true|[yY]*) uselongdouble="$define" ;;
4567 : Look for a hint-file generated 'call-back-unit'. If the
4568 : user has specified that long doubles should be used,
4569 : we may need to set or change some other defaults.
4570 if $test -f uselongdouble.cbu; then
4571 echo "Your platform has some specific hints regarding long doubles, using them..."
4572 . ./uselongdouble.cbu
4574 case "$uselongdouble" in
4577 (Your platform does not have any specific hints for long doubles.)
4583 : Looking for optional libraries
4585 echo "Checking for optional libraries..." >&4
4590 case "$libswanted" in
4591 '') libswanted='c_s';;
4594 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4600 for thisdir in $libpth $xlibpth; do
4601 test -d $thisdir && libspath="$libspath $thisdir"
4603 for thislib in $libswanted; do
4604 for thisdir in $libspath; do
4606 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4607 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4608 $test -f "$xxx" && eval $libscheck
4609 $test -f "$xxx" && libstyle=shared
4611 if test ! -f "$xxx"; then
4612 xxx=$thisdir/lib$thislib.$so
4613 $test -f "$xxx" && eval $libscheck
4614 $test -f "$xxx" && libstyle=shared
4616 if test ! -f "$xxx"; then
4617 xxx=$thisdir/lib$thislib$_a
4618 $test -f "$xxx" && eval $libscheck
4619 $test -f "$xxx" && libstyle=static
4621 if test ! -f "$xxx"; then
4622 xxx=$thisdir/$thislib$_a
4623 $test -f "$xxx" && eval $libscheck
4624 $test -f "$xxx" && libstyle=static
4626 if test ! -f "$xxx"; then
4627 xxx=$thisdir/lib${thislib}_s$_a
4628 $test -f "$xxx" && eval $libscheck
4629 $test -f "$xxx" && libstyle=static
4630 $test -f "$xxx" && thislib=${thislib}_s
4632 if test ! -f "$xxx"; then
4633 xxx=$thisdir/Slib$thislib$_a
4634 $test -f "$xxx" && eval $libscheck
4635 $test -f "$xxx" && libstyle=static
4637 if $test -f "$xxx"; then
4639 shared) echo "Found -l$thislib (shared)." ;;
4640 static) echo "Found -l$thislib." ;;
4641 *) echo "Found -l$thislib ($libstyle)." ;;
4645 *) dflt="$dflt -l$thislib"
4646 libsfound="$libsfound $xxx"
4648 libsfiles="$libsfiles $yyy"
4649 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4650 case " $libsdirs " in
4652 *) libsdirs="$libsdirs $yyy" ;;
4659 if $test ! -f "$xxx"; then
4660 echo "No -l$thislib."
4671 ' '|'') dflt='none';;
4676 In order to compile $package on your machine, a number of libraries
4677 are usually needed. Include any other special libraries here as well.
4678 Say "none" for none. The default list is almost always right.
4682 rp="What libraries to use?"
4689 : determine optimization, if desired, or use for debug flag also
4691 ' '|$undef) dflt='none';;
4693 *) dflt="$optimize";;
4697 By default, $package compiles with the -O flag to use the optimizer.
4698 Alternately, you might want to use the symbolic debugger, which uses
4699 the -g flag (on traditional Unix systems). Either flag can be
4700 specified here. To use neither flag, specify the word "none".
4703 rp="What optimizer/debugger flag should be used?"
4707 'none') optimize=" ";;
4711 : We will not override a previous value, but we might want to
4712 : augment a hint file
4714 default|recommended)
4715 case "$gccversion" in
4716 1*) dflt='-fpcc-struct-return' ;;
4719 *-g*) dflt="$dflt -DDEBUGGING";;
4721 case "$gccversion" in
4722 2*) if test -d /etc/conf/kconfig.d &&
4723 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4725 # Interactive Systems (ISC) POSIX mode.
4730 case "$gccversion" in
4734 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4735 echo 'int main(void) { return 0; }' > gcctest.c
4736 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4737 echo "Yes, it does." 2>&1
4740 echo "Leaving current flags $ccflags alone." 2>&1
4742 *) dflt="$dflt -fno-strict-aliasing" ;;
4745 echo "Nope, it doesn't, but that's ok." 2>&1
4749 # For gcc, adding -pipe speeds up compilations for some, but apparently
4750 # some assemblers can't read from stdin. (It also slows down compilations
4751 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4752 case "$gccversion" in
4754 echo "Checking if your compiler accepts -pipe" 2>&1
4755 echo 'int main(void) { return 0; }' > gcctest.c
4756 if $cc -pipe -o gcctest gcctest.c; then
4757 echo "Yes, it does." 2>&1
4760 echo "Leaving current flags $ccflags alone." 2>&1
4762 *) dflt="$dflt -pipe" ;;
4765 echo "Nope, it doesn't, but that's ok." 2>&1
4768 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4769 echo 'int main(void) { return 0; }' > gcctest.c
4770 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4771 echo "Yes, it does." 2>&1
4773 *-Wdeclaration-after-statement*)
4774 echo "Leaving current flags $ccflags alone." 2>&1
4776 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4779 echo "Nope, it doesn't, but that's ok." 2>&1
4786 case "$mips_type" in
4787 *BSD*|'') inclwanted="$locincpth $usrinc";;
4788 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4790 for thisincl in $inclwanted; do
4791 if $test -d $thisincl; then
4792 if $test x$thisincl != x$usrinc; then
4794 *" -I$thisincl "*);;
4795 *) dflt="$dflt -I$thisincl ";;
4801 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4803 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4811 *) dflt="$dflt -D$2";;
4815 set signal.h LANGUAGE_C; eval $inctest
4819 ccflags="$ccflags -DSOCKS"
4824 default|recommended) dflt="$ccflags $dflt" ;;
4825 *) dflt="$ccflags";;
4834 Your C compiler may want other flags. For this question you should include
4835 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4836 but you should NOT include libraries or ld flags like -lwhatever. If you
4837 want $package to honor its debug switch, you should include -DDEBUGGING here.
4838 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4840 To use no flags, specify the word "none".
4846 rp="Any additional cc flags?"
4853 : the following weeds options from ccflags that are of no interest to cpp
4855 '') cppflags="$ccflags" ;;
4856 *) cppflags="$cppflags $ccflags" ;;
4858 case "$gccversion" in
4859 1*) cppflags="$cppflags -D__GNUC__"
4861 case "$mips_type" in
4863 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4869 echo "Let me guess what the preprocessor flags are..." >&4
4883 *) ftry="$previous $flag";;
4885 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4886 >cpp1.out 2>/dev/null && \
4887 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4888 >cpp2.out 2>/dev/null && \
4889 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4890 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4892 cppflags="$cppflags $ftry"
4902 *-*) echo "They appear to be: $cppflags";;
4904 $rm -f cpp.c cpp?.out
4908 : flags used in final linking phase
4910 '') if ./venix; then
4916 *-posix*) dflt="$dflt -posix" ;;
4919 *) dflt="$ldflags";;
4922 : Try to guess additional flags to pick up local libraries.
4923 for thislibdir in $libpth; do
4924 case " $loclibpth " in
4927 *"-L$thislibdir "*) ;;
4928 *) dflt="$dflt -L$thislibdir" ;;
4940 Your C linker may need flags. For this question you should
4941 include -L/whatever and any other flags used by the C linker, but you
4942 should NOT include libraries like -lwhatever.
4944 Make sure you include the appropriate -L/path flags if your C linker
4945 does not normally search all of the directories you specified above,
4948 To use no flags, specify the word "none".
4952 rp="Any additional ld flags (NOT including libraries)?"
4958 rmlist="$rmlist pdp11"
4962 echo "Checking your choice of C compiler and flags for coherency..." >&4
4963 $cat > try.c <<'EOF'
4965 int main() { printf("Ok\n"); return(0); }
4967 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4969 $cat >try.msg <<'EOM'
4970 I've tried to compile and run the following simple program:
4973 $cat try.c >> try.msg
4975 $cat >> try.msg <<EOM
4982 and I got the following output:
4986 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4987 if $sh -c "$run ./try" >>try.msg 2>&1; then
4991 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4994 cat >> try.msg <<'EOQS'
4995 If $libs contains -lsfio, and sfio is mis-configured, then it
4996 sometimes (apparently) runs and exits with a 0 status, but with no
4997 output! It may have to do with sfio's use of _exit vs. exit.
5000 rp="You have a big problem. Shall I abort Configure"
5007 echo "The program compiled OK, but exited with status $?." >>try.msg
5008 rp="You have a problem. Shall I abort Configure"
5012 echo "I can't compile the test program." >>try.msg
5013 rp="You have a BIG problem. Shall I abort Configure"
5019 case "$knowitall" in
5021 echo "(The supplied flags or libraries might be incorrect.)"
5029 *) echo "Ok. Stopping Configure." >&4
5034 n) echo "OK, that should do.";;
5036 $rm -f try try.* core
5038 : define a shorthand compile call
5042 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5043 : define a shorthand compile call for compilations that should be ok.
5047 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5049 : determine filename position in cpp output
5051 echo "Computing filename position in cpp output for #include directives..." >&4
5053 vos) testaccess=-e ;;
5056 echo '#include <stdio.h>' > foo.c
5059 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5060 $grep '^[ ]*#.*stdio\.h' | \
5061 while read cline; do
5064 while $test \$# -gt 0; do
5065 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5070 pos=\`expr \$pos + 1\`
5082 *) pos="${fieldn}th";;
5084 echo "Your cpp writes the filename in the $pos field of the line."
5087 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5088 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5091 : locate header file
5096 for usrincdir in $usrinc
5098 if test -f \$usrincdir/\$wanted; then
5099 echo "\$usrincdir/\$wanted"
5103 awkprg='{ print \$$fieldn }'
5104 echo "#include <\$wanted>" > foo\$\$.c
5105 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5106 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5107 while read cline; do
5108 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5110 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5111 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5116 # status = 0: grep returned 0 lines, case statement not executed
5117 # status = 1: headerfile found
5118 # status = 2: while loop executed, no headerfile found
5122 if test \$status -eq 1; then
5129 : define an alternate in-header-list? function
5130 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5131 cont=true; xxf="echo \"<\$1> found.\" >&4";
5132 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5133 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5135 case $# in 4) instead=instead;; *) instead="at last";; esac;
5136 while $test "$cont"; do
5138 var=$2; eval "was=\$$2";
5139 if $test "$xxx" && $test -r "$xxx";
5141 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5144 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5145 set $yyy; shift; shift; yyy=$@;
5146 case $# in 0) cont="";;
5147 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5148 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5149 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5150 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5154 do set $yyy; var=$2; eval "was=\$$2";
5155 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5156 set $yyy; shift; shift; yyy=$@;
5159 : see if stdlib is available
5160 set stdlib.h i_stdlib
5163 : check for lengths of integral types
5167 echo "Checking to see how big your integers are..." >&4
5176 printf("intsize=%d;\n", (int)sizeof(int));
5177 printf("longsize=%d;\n", (int)sizeof(long));
5178 printf("shortsize=%d;\n", (int)sizeof(short));
5183 if eval $compile_ok && $run ./try > /dev/null; then
5185 echo "Your integers are $intsize bytes long."
5186 echo "Your long integers are $longsize bytes long."
5187 echo "Your short integers are $shortsize bytes long."
5191 Help! I can't compile and run the intsize test program: please enlighten me!
5192 (This is probably a misconfiguration in your system or libraries, and
5193 you really ought to fix it. Still, I'll try anyway.)
5197 rp="What is the size of an integer (in bytes)?"
5201 rp="What is the size of a long integer (in bytes)?"
5205 rp="What is the size of a short integer (in bytes)?"
5213 : check for long long
5215 echo "Checking to see if you have long long..." >&4
5216 echo 'int main() { long long x = 7; return 0; }' > try.c
5218 if eval $compile; then
5220 echo "You have long long."
5223 echo "You do not have long long."
5229 : check for length of long long
5230 case "${d_longlong}${longlongsize}" in
5233 echo "Checking to see how big your long longs are..." >&4
5234 $cat >try.c <<'EOCP'
5238 printf("%d\n", (int)sizeof(long long));
5243 if eval $compile_ok; then
5244 longlongsize=`$run ./try`
5245 echo "Your long longs are $longlongsize bytes long."
5249 echo "(I can't seem to compile the test program. Guessing...)"
5250 rp="What is the size of a long long (in bytes)?"
5254 if $test "X$longsize" = "X$longlongsize"; then
5255 echo "(That isn't any different from an ordinary long.)"
5261 : see if inttypes.h is available
5262 : we want a real compile instead of Inhdr because some systems
5263 : have an inttypes.h which includes non-existent headers
5266 #include <inttypes.h>
5268 static int32_t foo32 = 0x12345678;
5272 if eval $compile; then
5273 echo "<inttypes.h> found." >&4
5276 echo "<inttypes.h> NOT found." >&4
5285 echo "Checking to see if you have int64_t..." >&4
5287 #include <sys/types.h>
5288 #$i_inttypes I_INTTYPES
5290 #include <inttypes.h>
5292 int main() { int64_t x = 7; }
5295 if eval $compile; then
5297 echo "You have int64_t."
5300 echo "You do not have int64_t."
5308 echo "Checking which 64-bit integer type we could use..." >&4
5314 val='"unsigned int"'
5319 *) case "$longsize" in
5323 val='"unsigned long"'
5328 *) case "$d_longlong:$longlongsize" in
5333 val='"unsigned long long"'
5338 *) case "$d_int64_t" in
5357 '') echo "Alas, no 64-bit integer types in sight." >&4
5360 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5366 case "$uselonglong" in
5367 "$define"|true|[yY]*)
5370 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5372 use64bitint="$define"
5375 case "$use64bits" in
5376 "$define"|true|[yY]*)
5379 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5381 use64bitint="$define"
5384 case "$use64bitints" in
5385 "$define"|true|[yY]*)
5388 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5390 use64bitint="$define"
5393 case "$use64bitsint" in
5394 "$define"|true|[yY]*)
5397 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5399 use64bitint="$define"
5402 case "$uselonglongs" in
5403 "$define"|true|[yY]*)
5406 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5408 use64bitint="$define"
5411 case "$use64bitsall" in
5412 "$define"|true|[yY]*)
5415 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5417 use64bitall="$define"
5422 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5424 case "$use64bitall" in
5425 "$define"|true|[yY]*) use64bitint="$define" ;;
5431 You have natively 64-bit long integers.
5435 *) case "$use64bitint" in
5436 "$define"|true|[yY]*) dflt='y';;
5445 Perl can be built to take advantage of 64-bit integer types
5446 on some systems. To do so, Configure can be run with -Duse64bitint.
5447 Choosing this option will most probably introduce binary incompatibilities.
5449 If this doesn't make any sense to you, just accept the default '$dflt'.
5450 (The default has been chosen based on your configuration.)
5452 rp='Try to use 64-bit integers, if available?'
5455 [yY]*) val="$define" ;;
5463 case "$use64bitall" in
5464 "$define"|true|[yY]*) dflt='y' ;;
5465 *) case "$longsize" in
5473 You may also choose to try maximal 64-bitness. It means using as much
5474 64-bitness as possible on the platform. This in turn means even more
5475 binary incompatibilities. On the other hand, your platform may not
5476 have any more 64-bitness available than what you already have chosen.
5478 If this doesn't make any sense to you, just accept the default '$dflt'.
5479 (The default has been chosen based on your configuration.)
5481 rp='Try to use maximal 64-bit support, if available?'
5484 [yY]*) val="$define" ;;
5489 case "$use64bitall" in
5491 case "$use64bitint" in
5495 Since you have chosen a maximally 64-bit build, I'm also turning on
5496 the use of 64-bit integers.
5498 use64bitint="$define" ;;
5503 : Look for a hint-file generated 'call-back-unit'. If the
5504 : user has specified that a 64-bit perl is to be built,
5505 : we may need to set or change some other defaults.
5506 if $test -f use64bitint.cbu; then
5507 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5510 case "$use64bitint" in
5511 "$define"|true|[yY]*)
5513 4) case "$archname64" in
5514 '') archname64=64int ;;
5521 : Look for a hint-file generated 'call-back-unit'. If the
5522 : user has specified that a maximally 64-bit perl is to be built,
5523 : we may need to set or change some other defaults.
5524 if $test -f use64bitall.cbu; then
5525 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5528 case "$use64bitall" in
5529 "$define"|true|[yY]*)
5531 4) case "$archname64" in
5532 ''|64int) archname64=64all ;;
5539 case "$d_quad:$use64bitint" in
5543 *** You have chosen to use 64-bit integers,
5544 *** but none can be found.
5545 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5546 *** Cannot continue, aborting.
5553 : check for length of double
5555 case "$doublesize" in
5557 echo "Checking to see how big your double precision numbers are..." >&4
5566 printf("%d\n", (int)sizeof(double));
5571 if eval $compile_ok; then
5572 doublesize=`$run ./try`
5573 echo "Your double is $doublesize bytes long."
5576 echo "(I can't seem to compile the test program. Guessing...)"
5577 rp="What is the size of a double precision number (in bytes)?"
5585 : check for long doubles
5587 echo "Checking to see if you have long double..." >&4
5588 echo 'int main() { long double x = 7.0; }' > try.c
5590 if eval $compile; then
5592 echo "You have long double."
5595 echo "You do not have long double."
5601 : check for length of long double
5602 case "${d_longdbl}${longdblsize}" in
5605 echo "Checking to see how big your long doubles are..." >&4
5606 $cat >try.c <<'EOCP'
5610 printf("%d\n", sizeof(long double));
5615 if eval $compile; then
5616 longdblsize=`$run ./try`
5617 echo "Your long doubles are $longdblsize bytes long."
5621 echo "(I can't seem to compile the test program. Guessing...)" >&4
5622 rp="What is the size of a long double (in bytes)?"
5626 if $test "X$doublesize" = "X$longdblsize"; then
5627 echo "That isn't any different from an ordinary double."
5628 echo "I'll keep your setting anyway, but you may see some"
5629 echo "harmless compilation warnings."
5635 : determine the architecture name
5637 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5638 tarch=`arch`"-$osname"
5639 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5640 if uname -m > tmparch 2>&1 ; then
5641 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5642 -e 's/$/'"-$osname/" tmparch`
5650 case "$myarchname" in
5653 echo "(Your architecture name used to be $myarchname.)"
5657 case "$targetarch" in
5659 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5664 *) dflt="$archname";;
5666 rp='What is your architecture name'
5669 case "$usethreads" in
5671 echo "Threads selected." >&4
5673 *-thread*) echo "...and architecture name already has -thread." >&4
5675 *) archname="$archname-thread"
5676 echo "...setting architecture name to $archname." >&4
5681 case "$usemultiplicity" in
5683 echo "Multiplicity selected." >&4
5685 *-multi*) echo "...and architecture name already has -multi." >&4
5687 *) archname="$archname-multi"
5688 echo "...setting architecture name to $archname." >&4
5693 case "$use64bitint$use64bitall" in
5695 case "$archname64" in
5697 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5700 case "$use64bitint" in
5701 "$define") echo "64 bit integers selected." >&4 ;;
5703 case "$use64bitall" in
5704 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5707 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5709 *) archname="$archname-$archname64"
5710 echo "...setting architecture name to $archname." >&4
5716 case "$uselongdouble" in
5718 echo "Long doubles selected." >&4
5719 case "$longdblsize" in
5721 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5725 *-ld*) echo "...and architecture name already has -ld." >&4
5727 *) archname="$archname-ld"
5728 echo "...setting architecture name to $archname." >&4
5735 case "$useperlio" in
5737 echo "Perlio selected." >&4
5740 echo "Perlio not selected, using stdio." >&4
5742 *-stdio*) echo "...and architecture name already has -stdio." >&4
5744 *) archname="$archname-stdio"
5745 echo "...setting architecture name to $archname." >&4
5750 if $test -f archname.cbu; then
5751 echo "Your platform has some specific hints for architecture name, using them..."
5755 : determine root of directory hierarchy where package will be installed.
5758 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5761 dflt=`echo "$prefix" | sed 's/.$//'`
5769 By default, $package will be installed in $dflt/bin, manual pages
5770 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5771 installation directories. Typically this is something like /usr/local.
5772 If you wish to have binaries under /usr/bin but other parts of the
5773 installation under /usr/local, that's ok: you will be prompted
5774 separately for each of the installation directories, the prefix being
5775 only used to set the defaults.
5779 rp='Installation prefix to use?'
5787 *) oldprefix="$prefix";;
5796 *) afsroot=$afsroot ;;
5802 $define|true) afs=true ;;
5803 $undef|false) afs=false ;;
5804 *) if test -d $afsroot; then
5812 echo "AFS may be running... I'll be extra cautious then..." >&4
5814 echo "AFS does not seem to be running..." >&4
5817 : determine installation prefix for where package is to be installed.
5821 Since you are running AFS, I need to distinguish the directory in which
5822 files will reside from the directory in which they are installed (and from
5823 which they are presumably copied to the former directory by occult means).
5826 case "$installprefix" in
5827 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5828 *) dflt="$installprefix";;
5833 In some special cases, particularly when building $package for distribution,
5834 it is convenient to distinguish the directory in which files should be
5835 installed from the directory ($prefix) in which they will
5836 eventually reside. For most users, these two directories are the same.
5839 case "$installprefix" in
5841 *) dflt=$installprefix;;
5845 rp='What installation prefix should I use for installing files?'
5847 installprefix="$ans"
5848 installprefixexp="$ansexp"
5850 : set the prefixit variable, to compute a suitable default value
5851 prefixit='case "$3" in
5853 case "$oldprefix" in
5854 "") eval "$1=\"\$$2\"";;
5861 ""|" ") eval "$1=\"\$$2\"";;
5867 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5869 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5870 /*-$oldprefix/*|\~*-$oldprefix/*)
5871 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5872 *) eval "$1=\"\$$2\"";;
5876 : get the patchlevel
5878 echo "Getting the current patchlevel..." >&4
5879 if $test -r $rsrc/patchlevel.h;then
5880 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5881 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5882 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5883 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5884 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5885 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5886 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5895 $echo "(You do not have patchlevel.h. Eek.)"
5897 if $test -r $rsrc/.patch ; then
5898 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5899 perl_patchlevel=`cat $rsrc/.patch`
5902 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5903 version_patchlevel_string="version $patchlevel subversion $subversion"
5904 case "$perl_patchlevel" in
5906 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5909 $echo "(You have $package $version_patchlevel_string.)"
5913 : XXX Should be a Configure test for double-dots in filenames.
5914 version=`echo $revision $patchlevel $subversion | \
5915 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5916 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5917 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5920 version=`echo $revision $patchlevel $subversion | \
5921 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5922 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5923 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5926 : Special case the 5.005_xx maintenance series, which used 5.005
5927 : without any subversion label as a subdirectory in $sitelib
5928 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5929 api_versionstring='5.005'
5932 : determine installation style
5933 : For now, try to deduce it from prefix unless it is already set.
5934 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5935 case "$installstyle" in
5936 '') case "$prefix" in
5937 *perl*) dflt='lib';;
5938 *) dflt='lib/perl5' ;;
5941 *) dflt="$installstyle" ;;
5943 : Probably not worth prompting for this since we prompt for all
5944 : the directories individually, and the prompt would be too long and
5948 : determine where private library files go
5949 : Usual default is /usr/local/lib/perl5/$version.
5950 : Also allow things like /opt/perl/lib/$version, since
5951 : /opt/perl/lib/perl5... would be redundant.
5952 : The default "style" setting is made in installstyle.U
5953 case "$installstyle" in
5954 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5955 *) set dflt privlib lib/$version ;;
5960 There are some auxiliary files for $package that need to be put into a
5961 private library directory that is accessible by everyone.
5965 rp='Pathname where the private library files will reside?'
5968 privlibexp="$ansexp"
5969 : Change installation prefix, if necessary.
5970 if $test X"$prefix" != X"$installprefix"; then
5971 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5973 installprivlib="$privlibexp"
5976 : set the prefixup variable, to restore leading tilda escape
5977 prefixup='case "$prefixexp" in
5979 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5982 : determine where public architecture dependent libraries go
5985 : privlib default is /usr/local/lib/$package/$version
5986 : archlib default is /usr/local/lib/$package/$version/$archname
5987 : privlib may have an optional trailing /share.
5988 tdflt=`echo $privlib | $sed 's,/share$,,'`
5989 tdflt=$tdflt/$archname
5998 $spackage contains architecture-dependent library files. If you are
5999 sharing libraries in a heterogeneous environment, you might store
6000 these files in a separate location. Otherwise, you can just include
6001 them with the rest of the public library files.
6005 rp='Where do you want to put the public architecture-dependent libraries?'
6008 archlibexp="$ansexp"
6009 if $test X"$archlib" = X"$privlib"; then
6014 : Change installation prefix, if necessary.
6015 if $test X"$prefix" != X"$installprefix"; then
6016 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6018 installarchlib="$archlibexp"
6021 : see if setuid scripts can be secure
6024 Some kernels have a bug that prevents setuid #! scripts from being
6025 secure. Some sites have disabled setuid #! scripts because of this.
6027 First let's decide if your kernel supports secure setuid #! scripts.
6028 (If setuid #! scripts would be secure but have been disabled anyway,
6029 don't say that they are secure if asked.)
6034 if $test -d /dev/fd; then
6035 echo "#!$ls" >reflect
6036 chmod +x,u+s reflect
6037 ./reflect >flect 2>&1
6038 if $contains "/dev/fd" flect >/dev/null; then
6039 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6043 If you are not sure if they are secure, I can check but I'll need a
6044 username and password different from the one you are using right now.
6045 If you don't have such a username or don't want me to test, simply
6049 rp='Other username to test security of setuid scripts with?'
6054 case "$d_suidsafe" in
6055 '') echo "I'll assume setuid scripts are *not* secure." >&4
6058 echo "Well, the $hint value is *not* secure." >&4
6060 *) echo "Well, the $hint value *is* secure." >&4
6065 $rm -f reflect flect
6066 echo "#!$ls" >reflect
6067 chmod +x,u+s reflect
6070 echo '"su" will (probably) prompt you for '"$ans's password."
6071 su $ans -c './reflect >flect'
6072 if $contains "/dev/fd" flect >/dev/null; then
6073 echo "Okay, it looks like setuid scripts are secure." >&4
6076 echo "I don't think setuid scripts are secure." >&4
6081 rp='Does your kernel have *secure* setuid scripts?'
6084 [yY]*) val="$define";;
6089 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6090 echo "(That's for file descriptors, not floppy disks.)"
6096 $rm -f reflect flect
6098 : now see if they want to do setuid emulation
6101 case "$d_suidsafe" in
6104 echo "No need to emulate SUID scripts since they are secure here." >&4
6108 Some systems have disabled setuid scripts, especially systems where
6109 setuid scripts cannot be secure. On systems where setuid scripts have
6110 been disabled, the setuid/setgid bits on scripts are currently
6111 useless. It is possible for $package to detect those bits and emulate
6112 setuid/setgid in a secure fashion. This emulation will only work if
6113 setuid scripts have been disabled in your kernel.
6117 "$define") dflt=y ;;
6120 rp="Do you want to do setuid/setgid emulation?"
6123 [yY]*) val="$define";;
6131 : see if this is a malloc.h system
6132 : we want a real compile instead of Inhdr because some systems have a
6133 : malloc.h that just gives a compile error saying to use stdlib.h instead
6138 int main () { return 0; }
6141 if eval $compile; then
6142 echo "<malloc.h> found." >&4
6145 echo "<malloc.h> NOT found." >&4
6152 : check for void type
6154 echo "Checking to see how well your C compiler groks the void type..." >&4
6155 case "$voidflags" in
6167 extern void moo(); /* function returning void */
6168 void (*goo)(); /* ptr to func returning void */
6170 void *hue; /* generic ptr */
6183 int main() { sub(); }
6185 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6186 voidflags=$defvoidused
6187 echo "Good. It appears to support void to the level $package wants.">&4
6188 if $contains warning .out >/dev/null 2>&1; then
6189 echo "However, you might get some warnings that look like this:"
6193 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6194 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6195 echo "It supports 1..."
6196 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6197 echo "It also supports 2..."
6198 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6200 echo "And it supports 4 but not 8 definitely."
6202 echo "It doesn't support 4..."
6203 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6205 echo "But it supports 8."
6208 echo "Neither does it support 8."
6212 echo "It does not support 2..."
6213 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6215 echo "But it supports 4 and 8."
6217 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6219 echo "And it supports 4 but has not heard about 8."
6221 echo "However it supports 8 but not 4."
6226 echo "There is no support at all for void."
6231 case "$voidflags" in
6234 Support flag bits are:
6235 1: basic void declarations.
6236 2: arrays of pointers to functions returning void.
6237 4: operations between pointers to and addresses of void functions.
6238 8: generic void pointers.
6241 rp="Your void support flags add up to what?"
6248 : check for length of pointer
6252 echo "Checking to see how big your pointers are..." >&4
6253 if test "$voidflags" -gt 7; then
6254 echo '#define VOID_PTR char *' > try.c
6256 echo '#define VOID_PTR void *' > try.c
6266 printf("%d\n", (int)sizeof(VOID_PTR));
6271 if eval $compile_ok; then
6272 ptrsize=`$run ./try`
6273 echo "Your pointers are $ptrsize bytes long."
6276 echo "(I can't seem to compile the test program. Guessing...)" >&4
6277 rp="What is the size of a pointer (in bytes)?"
6284 case "$use64bitall" in
6285 "$define"|true|[yY]*)
6289 *** You have chosen a maximally 64-bit build,
6290 *** but your pointers are only 4 bytes wide.
6291 *** Please rerun Configure without -Duse64bitall.
6296 *** Since you have quads, you could possibly try with -Duse64bitint.
6301 *** Cannot continue, aborting.
6312 : determine whether to use malloc wrapping
6314 case "$usemallocwrap" in
6315 [yY]*|true|$define) dflt='y' ;;
6316 [nN]*|false|$undef) dflt='n' ;;
6317 *) case "$usedevel" in
6318 [yY]*|true|$define) dflt='y' ;;
6323 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6325 usemallocwrap="$ans"
6328 usemallocwrap="$define" ;;
6330 usemallocwrap="$undef" ;;
6333 : determine which malloc to compile in
6335 case "$usemymalloc" in
6336 [yY]*|true|$define) dflt='y' ;;
6337 [nN]*|false|$undef) dflt='n' ;;
6338 *) case "$ptrsize" in
6344 rp="Do you wish to attempt to use the malloc that comes with $package?"
6350 mallocsrc='malloc.c'
6351 mallocobj="malloc$_o"
6352 d_mymalloc="$define"
6355 : Remove malloc from list of libraries to use
6356 echo "Removing unneeded -lmalloc from library list" >&4
6357 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6360 echo "libs = $libs" >&4
6372 : compute the return types of malloc and free
6374 $cat >malloc.c <<END
6378 #include <sys/types.h>
6392 case "$malloctype" in
6394 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6401 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6405 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6412 echo "Your system uses $freetype free(), it would seem." >&4
6416 After $package is installed, you may wish to install various
6417 add-on modules and utilities. Typically, these add-ons will
6418 be installed under $prefix with the rest
6419 of this package. However, you may wish to install such add-ons
6420 elsewhere under a different prefix.
6422 If you do not wish to put everything under a single prefix, that's
6423 ok. You will be prompted for the individual locations; this siteprefix
6424 is only used to suggest the defaults.
6426 The default should be fine for most people.
6430 rp='Installation prefix to use for add-on modules and utilities?'
6431 : XXX Here might be another good place for an installstyle setting.
6432 case "$siteprefix" in
6434 *) dflt=$siteprefix ;;
6437 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6439 case "$siteprefix" in
6443 *) oldsiteprefix="$prefix";;
6448 siteprefixexp="$ansexp"
6450 : determine where site specific libraries go.
6451 : Usual default is /usr/local/lib/perl5/site_perl/$version
6452 : The default "style" setting is made in installstyle.U
6453 : XXX No longer works with Prefixit stuff.
6454 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6456 '') case "$installstyle" in
6457 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6458 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6466 The installation process will create a directory for
6467 site-specific extensions and modules. Most users find it convenient
6468 to place all site-specific files in this directory rather than in the
6469 main distribution directory.
6473 rp='Pathname for the site-specific library files?'
6476 sitelibexp="$ansexp"
6477 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6478 : Change installation prefix, if necessary.
6479 if $test X"$prefix" != X"$installprefix"; then
6480 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6482 installsitelib="$sitelibexp"
6485 : determine where site specific architecture-dependent libraries go.
6486 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6487 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6488 : sitelib may have an optional trailing /share.
6490 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6491 dflt="$dflt/$archname"
6496 set sitearch sitearch none
6500 The installation process will also create a directory for
6501 architecture-dependent site-specific extensions and modules.
6505 rp='Pathname for the site-specific architecture-dependent library files?'
6508 sitearchexp="$ansexp"
6509 : Change installation prefix, if necessary.
6510 if $test X"$prefix" != X"$installprefix"; then
6511 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6513 installsitearch="$sitearchexp"
6518 The installation process will also create a directory for
6519 vendor-supplied add-ons. Vendors who supply perl with their system
6520 may find it convenient to place all vendor-supplied files in this
6521 directory rather than in the main distribution directory. This will
6522 ease upgrades between binary-compatible maintenance versions of perl.
6524 Of course you may also use these directories in whatever way you see
6525 fit. For example, you might use them to access modules shared over a
6526 company-wide network.
6528 The default answer should be fine for most people.
6529 This causes further questions about vendor add-ons to be skipped
6530 and no vendor-specific directories will be configured for perl.
6533 rp='Do you want to configure vendor-specific add-on directories?'
6534 case "$usevendorprefix" in
6535 define|true|[yY]*) dflt=y ;;
6536 *) : User may have set vendorprefix directly on Configure command line.
6537 case "$vendorprefix" in
6546 rp='Installation prefix to use for vendor-supplied add-ons?'
6547 case "$vendorprefix" in
6549 *) dflt=$vendorprefix ;;
6552 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6554 case "$vendorprefix" in
6558 *) oldvendorprefix="$prefix";;
6562 usevendorprefix="$define"
6564 vendorprefixexp="$ansexp"
6566 *) usevendorprefix="$undef"
6572 case "$vendorprefix" in
6573 '') d_vendorlib="$undef"
6577 *) d_vendorlib="$define"
6578 : determine where vendor-supplied modules go.
6579 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6580 case "$vendorlib" in
6582 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6583 case "$installstyle" in
6584 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6585 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6588 *) dflt="$vendorlib"
6592 rp='Pathname for the vendor-supplied library files?'
6595 vendorlibexp="$ansexp"
6598 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6599 : Change installation prefix, if necessary.
6600 if $test X"$prefix" != X"$installprefix"; then
6601 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6603 installvendorlib="$vendorlibexp"
6606 case "$vendorprefix" in
6607 '') d_vendorarch="$undef"
6611 *) d_vendorarch="$define"
6612 : determine where vendor-supplied architecture-dependent libraries go.
6613 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6614 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6615 : vendorlib may have an optional trailing /share.
6616 case "$vendorarch" in
6617 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6618 dflt="$dflt/$archname"
6620 *) dflt="$vendorarch" ;;
6623 rp='Pathname for vendor-supplied architecture-dependent files?'
6626 vendorarchexp="$ansexp"
6629 : Change installation prefix, if necessary.
6630 if $test X"$prefix" != X"$installprefix"; then
6631 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6633 installvendorarch="$vendorarchexp"
6636 : Final catch-all directories to search
6639 Lastly, you can have perl look in other directories for extensions and
6640 modules in addition to those already specified.
6641 These directories will be searched after
6645 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6646 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6648 case "$otherlibdirs" in
6649 ''|' ') dflt='none' ;;
6650 *) dflt="$otherlibdirs" ;;
6653 Enter a colon-separated set of extra paths to include in perl's @INC
6654 search path, or enter 'none' for no extra paths.
6658 rp='Colon-separated list of additional directories for perl to search?'
6661 ' '|''|none) otherlibdirs=' ' ;;
6662 *) otherlibdirs="$ans" ;;
6664 case "$otherlibdirs" in
6668 set d_perl_otherlibdirs
6671 : Cruising for prototypes
6673 echo "Checking out function prototypes..." >&4
6674 $cat >prototype.c <<EOCP
6679 int main(int argc, char *argv[]) {
6682 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6683 echo "Your C compiler appears to support function prototypes."
6686 echo "Your C compiler doesn't seem to understand function prototypes."
6693 case "$prototype" in
6695 *) ansi2knr='ansi2knr'
6700 This version of $package can only be compiled by a compiler that
6701 understands function prototypes. Unfortunately, your C compiler
6703 doesn't seem to understand them. Sorry about that.
6705 If GNU cc is available for your system, perhaps you could try that instead.
6707 Eventually, we hope to support building Perl with pre-ANSI compilers.
6708 If you would like to help in that effort, please contact <perlbug@perl.org>.
6710 Aborting Configure now.
6716 : determine where public executables go
6721 rp='Pathname where the public executables will reside?'
6723 if $test "X$ansexp" != "X$binexp"; then
6728 : Change installation prefix, if necessary.
6729 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6730 if $test X"$prefix" != X"$installprefix"; then
6731 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6733 installbin="$binexp"
6742 Perl can be built with extra modules or bundles of modules which
6743 will be fetched from the CPAN and installed alongside Perl.
6745 Notice that you will need access to the CPAN; either via the Internet,
6746 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6747 be asked later to configure the CPAN.pm module which will in turn do
6748 the installation of the rest of the extra modules or bundles.)
6750 Notice also that if the modules require any external software such as
6751 libraries and headers (the libz library and the zlib.h header for the
6752 Compress::Zlib module, for example) you MUST have any such software
6753 already installed, this configuration process will NOT install such
6756 If this doesn't make any sense to you, just accept the default '$dflt'.
6758 rp='Install any extra modules (y or n)?'
6764 Please list any extra modules or bundles to be installed from CPAN,
6765 with spaces between the names. The names can be in any format the
6766 'install' command of CPAN.pm will understand. (Answer 'none',
6767 without the quotes, to install no extra modules or bundles.)
6777 $rm -f ../extras.lst
6779 *) echo "(Saving the list of extras for later...)"
6780 echo "$extras" > ../extras.lst
6788 : determine where html pages for programs go
6789 set html1dir html1dir none
6793 If you wish to install html files for programs in $spackage, indicate
6794 the appropriate directory here. To skip installing html files,
6798 ''|none|$undef|' ') dflt=none ;;
6799 *) dflt=$html1dir ;;
6802 rp="Directory for the main $spackage html pages?"
6805 html1direxp="$ansexp"
6806 : Use ' ' for none so value is preserved next time through Configure
6807 $test X"$html1dir" = "X" && html1dir=' '
6808 : Change installation prefix, if necessary.
6809 if $test X"$prefix" != X"$installprefix"; then
6810 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6812 installhtml1dir="$html1direxp"
6815 : determine where html pages for libraries and modules go
6816 set html3dir html3dir none
6820 If you wish to install html files for modules associated with $spackage,
6821 indicate the appropriate directory here. To skip installing html files,
6824 : There is no obvious default. If they have specified html1dir, then
6825 : try to key off that, possibly changing .../html1 into .../html3.
6827 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6828 *) dflt=$html3dir ;;
6831 rp="Directory for the $spackage module html pages?"
6834 html3direxp="$ansexp"
6835 : Use ' ' for none so value is preserved next time through Configure
6836 $test X"$html3dir" = "X" && html3dir=' '
6837 : Change installation prefix, if necessary.
6838 if $test X"$prefix" != X"$installprefix"; then
6839 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6841 installhtml3dir="$html3direxp"
6844 : Find perl5.005 or later.
6845 echo "Looking for a previously installed perl5.005 or later... "
6847 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6848 : Check if this perl is recent and can load a simple module
6849 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6852 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6862 '') echo "None found. That's ok.";;
6863 *) echo "Using $perl5." ;;
6866 : Determine list of previous versions to include in @INC
6867 $cat > getverlist <<EOPL
6870 \$api_versionstring = "$api_versionstring";
6871 \$version = "$version";
6872 \$stem = "$sitelib_stem";
6873 \$archname = "$archname";
6875 $cat >> getverlist <<'EOPL'
6876 # Can't have leading @ because metaconfig interprets it as a command!
6877 ;@inc_version_list=();
6878 # XXX Redo to do opendir/readdir?
6881 ;@candidates = glob("5.*");
6887 # XXX ToDo: These comparisons must be reworked when two-digit
6888 # subversions come along, so that 5.7.10 compares as greater than
6889 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6890 # widespread that we can use the built-in version vectors rather
6891 # than reinventing them here. For 5.6.0, however, we must
6892 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6893 foreach $d (@candidates) {
6894 if ($d lt $version) {
6895 if ($d ge $api_versionstring) {
6896 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6898 elsif ($d ge "5.005") {
6899 unshift(@inc_version_list, grep { -d } $d);
6903 # Skip newer version. I.e. don't look in
6904 # 5.7.0 if we're installing 5.6.1.
6908 if (@inc_version_list) {
6909 print join(' ', @inc_version_list);
6912 # Blank space to preserve value for next Configure run.
6917 case "$inc_version_list" in
6918 '') if test -x "$perl5$exe_ext"; then
6919 dflt=`$perl5 getverlist`
6924 $undef) dflt='none' ;;
6925 *) eval dflt=\"$inc_version_list\" ;;
6928 ''|' ') dflt=none ;;
6935 In order to ease the process of upgrading, this version of perl
6936 can be configured to use modules built and installed with earlier
6937 versions of perl that were installed under $prefix. Specify here
6938 the list of earlier versions that this version of perl should check.
6939 If Configure detected no earlier versions of perl installed under
6940 $prefix, then the list will be empty. Answer 'none' to tell perl
6941 to not search earlier versions.
6943 The default should almost always be sensible, so if you're not sure,
6944 just accept the default.
6947 rp='List of earlier versions to include in @INC?'
6950 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6951 *) inc_version_list="$ans" ;;
6953 case "$inc_version_list" in
6955 inc_version_list_init='0';;
6956 *) inc_version_list_init=`echo $inc_version_list |
6957 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6962 : determine whether to install perl also as /usr/bin/perl
6965 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6967 Many scripts expect perl to be installed as /usr/bin/perl.
6969 If you want to, I can install the perl you are about to compile
6970 as /usr/bin/perl (in addition to $bin/perl).
6972 if test -f /usr/bin/perl; then
6975 However, please note that because you already have a /usr/bin/perl,
6976 overwriting that with a new Perl would very probably cause problems.
6977 Therefore I'm assuming you don't want to do that (unless you insist).
6980 case "$installusrbinperl" in
6981 "$define"|[yY]*) dflt='y';;
6987 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
6990 case "$installusrbinperl" in
6991 "$undef"|[nN]*) dflt='n';;
6995 rp="Do you want to install perl as /usr/bin/perl?"
6998 [yY]*) val="$define";;
7004 set installusrbinperl
7008 echo "Checking for GNU C Library..." >&4
7010 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7011 alone are insufficient to distinguish different versions, such as
7012 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7013 libc version 2.1.0. A. Dougherty, June 3, 2002.
7019 # ifdef __GLIBC_MINOR__
7020 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7021 # include <gnu/libc-version.h>
7022 printf("%s\n", gnu_get_libc_version());
7024 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7027 printf("%d\n", __GLIBC__);
7036 if eval $compile_ok && $run ./try > glibc.ver; then
7038 gnulibc_version=`$cat glibc.ver`
7039 echo "You are using the GNU C Library version $gnulibc_version"
7043 echo "You are not using the GNU C Library"
7045 $rm -f try try.* glibc.ver
7049 : see if nm is to be used to determine whether a symbol is defined or not
7053 case "$d_gnulibc" in
7056 echo "nm probably won't work on the GNU C Library." >&4
7062 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7064 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7065 echo "'nm' won't be sufficient on this sytem." >&4
7071 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7072 if $test $dflt -gt 20; then
7082 true|$define) dflt=y;;
7089 I can use $nm to extract the symbols from your C libraries. This
7090 is a time consuming task which may generate huge output on the disk (up
7091 to 3 megabytes) but that should make the symbols extraction faster. The
7092 alternative is to skip the 'nm' extraction part and to compile a small
7093 test program instead to determine whether each symbol is present. If
7094 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7095 this may be the best solution.
7097 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7100 rp="Shall I use $nm to extract C symbols from the libraries?"
7103 [Nn]*) usenm=false;;
7112 : nm options which may be necessary
7114 '') if $test -f /mach_boot; then
7116 elif $test -d /usr/ccs/lib; then
7117 nm_opt='-p' # Solaris (and SunOS?)
7118 elif $test -f /dgux; then
7120 elif $test -f /lib64/rld; then
7121 nm_opt='-p' # 64-bit Irix
7127 : nm options which may be necessary for shared libraries but illegal
7128 : for archive libraries. Thank you, Linux.
7129 case "$nm_so_opt" in
7130 '') case "$myuname" in
7132 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7133 nm_so_opt='--dynamic'
7142 : get list of predefined functions in a handy place
7147 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7153 *) for thislib in $libs; do
7156 : Handle C library specially below.
7159 thislib=`echo $thislib | $sed -e 's/^-l//'`
7160 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7162 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7164 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7166 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7168 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7170 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7172 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7177 libnames="$libnames $try"
7179 *) libnames="$libnames $thislib" ;;
7188 for xxx in $libpth; do
7189 $test -r $1 || set $xxx/libc.$so
7190 : The messy sed command sorts on library version numbers.
7192 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7193 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7195 s/[0-9][0-9]*/0000&/g
7196 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7199 $sort | $sed -e 's/^.* //'`
7202 $test -r $1 || set /usr/ccs/lib/libc.$so
7203 $test -r $1 || set /lib/libsys_s$_a
7209 if $test -r "$1"; then
7210 echo "Your (shared) C library seems to be in $1."
7212 elif $test -r /lib/libc && $test -r /lib/clib; then
7213 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7215 libc='/lib/clib /lib/libc'
7216 if $test -r /lib/syslib; then
7217 echo "(Your math library is in /lib/syslib.)"
7218 libc="$libc /lib/syslib"
7220 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7221 echo "Your C library seems to be in $libc, as you said before."
7222 elif $test -r $incpath/usr/lib/libc$_a; then
7223 libc=$incpath/usr/lib/libc$_a;
7224 echo "Your C library seems to be in $libc. That's fine."
7225 elif $test -r /lib/libc$_a; then
7227 echo "Your C library seems to be in $libc. You're normal."
7229 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7231 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7232 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7233 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7235 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7237 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7240 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7242 if $test -r "$tans"; then
7243 echo "Your C library seems to be in $tans, of all places."
7249 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7253 If the guess above is wrong (which it might be if you're using a strange
7254 compiler, or your machine supports multiple models), you can override it here.
7259 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7261 I can't seem to find your C library. I've looked in the following places:
7264 $sed 's/^/ /' libpath
7267 None of these seems to contain your C library. I need to get its name...
7272 rp='Where is your C library?'
7277 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7278 set X `cat libnames`
7281 case $# in 1) xxx=file; esac
7282 echo "Extracting names from the following $xxx for later perusal:" >&4
7284 $sed 's/^/ /' libnames >&4
7286 $echo $n "This may take a while...$c" >&4
7290 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7291 *) $nm $nm_opt $file 2>/dev/null;;
7296 $grep fprintf libc.tmp > libc.ptf
7297 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7298 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7300 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7302 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7304 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7306 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7308 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7310 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7312 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7314 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7316 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7318 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7320 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7322 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7324 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7325 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7327 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7329 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7331 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7333 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7335 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7337 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7339 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7341 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7343 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7345 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7347 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7349 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7351 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7353 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7355 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7358 $nm -p $* 2>/dev/null >libc.tmp
7359 $grep fprintf libc.tmp > libc.ptf
7360 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7361 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7367 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7369 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7370 for thisname in $libnames $libc; do
7371 $ar t $thisname >>libc.tmp
7373 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7375 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7376 # Repeat libc to extract forwarders to DLL entries too
7377 for thisname in $libnames $libc; do
7378 $ar tv $thisname >>libc.tmp
7379 # Revision 50 of EMX has bug in $ar.
7380 # it will not extract forwarders to DLL entries
7381 # Use emximp which will extract exactly them.
7382 emximp -o tmp.imp $thisname \
7384 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7385 < tmp.imp >>libc.tmp
7388 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7391 echo "$ar didn't seem to work right." >&4
7392 echo "Maybe this is a Cray...trying bld instead..." >&4
7393 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7395 for thisname in $libnames; do
7397 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7398 $ar t $thisname >>libc.tmp
7402 echo "That didn't work either. Giving up." >&4
7412 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7413 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7415 *) if $test -f /lib/syscalls.exp; then
7417 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7418 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7424 $rm -f libnames libpath
7426 : see if dld is available
7430 : is a C symbol defined?
7433 -v) tf=libc.tmp; tdc="";;
7434 -a) tf=libc.tmp; tdc="[]";;
7435 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7438 case "$reuseval-$4" in
7440 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7445 if $test "$runnm" = true; then
7446 if $contains $tlook $tf >/dev/null 2>&1; then
7448 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7449 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7450 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7451 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7452 $rm -f try$_exe try.c core core.* try.core;
7455 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7456 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7457 $rm -f try$_exe try.c;
7462 $define) tval=true;;
7469 : define an is-in-libc? function
7470 inlibc='echo " "; td=$define; tu=$undef;
7471 sym=$1; var=$2; eval "was=\$$2";
7473 case "$reuseval$was" in
7483 echo "$sym() found." >&4;
7484 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7486 echo "$sym() NOT found." >&4;
7487 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7491 $define) echo "$sym() found." >&4;;
7492 *) echo "$sym() NOT found." >&4;;
7496 : see if dlopen exists
7503 : determine which dynamic loading, if any, to compile in
7505 dldir="ext/DynaLoader"
7518 $define) dflt='y' ;;
7521 $define) dflt='y' ;;
7523 : Does a dl_xxx.xs file exist for this operating system
7524 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7527 rp="Do you wish to use dynamic loading?"
7534 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7535 dflt="$dldir/dl_${osname}.xs"
7536 elif $test "$d_dlopen" = "$define" ; then
7537 dflt="$dldir/dl_dlopen.xs"
7538 elif $test "$i_dld" = "$define" ; then
7539 dflt="$dldir/dl_dld.xs"
7544 *) dflt="$dldir/$dlsrc"
7547 echo "The following dynamic loading files are available:"
7548 : Can not go over to $dldir because getfile has path hard-coded in.
7549 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7550 rp="Source file to use for dynamic loading"
7556 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7560 Some systems may require passing special flags to $cc -c to
7561 compile modules that will be used to create a shared library.
7562 To use no flags, say "none".
7565 case "$cccdlflags" in
7566 '') case "$gccversion" in
7567 '') case "$osname" in
7569 next) dflt='none' ;;
7570 irix*) dflt='-KPIC' ;;
7571 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7572 sunos) dflt='-pic' ;;
7576 *) case "$osname" in
7577 darwin) dflt='none' ;;
7578 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7583 *) dflt="$cccdlflags" ;;
7585 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7588 none) cccdlflags=' ' ;;
7589 *) cccdlflags="$ans" ;;
7594 Some systems use ld to create libraries that can be dynamically loaded,
7595 while other systems (such as those using ELF) use $cc.
7599 '') $cat >try.c <<EOM
7600 /* Test for whether ELF binaries are produced */
7608 int i = open("a.out",O_RDONLY);
7611 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7612 exit(0); /* succeed (yes, it's ELF) */
7617 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7619 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7623 echo "I'll use ld to build dynamic libraries."
7632 rp="What command should be used to create dynamic libraries?"
7638 Some systems may require passing special flags to $ld to create a
7639 library that can be dynamically loaded. If your ld flags include
7640 -L/other/path options to locate libraries outside your loader's normal
7641 search path, you may need to specify those -L options here as well. To
7642 use no flags, say "none".
7645 case "$lddlflags" in
7646 '') case "$osname" in
7647 beos) dflt='-nostart' ;;
7649 case "$gccversion" in
7650 '') dflt="$dflt +vnocompatwarnings" ;;
7653 linux|irix*|gnu*) dflt='-shared' ;;
7654 next) dflt='none' ;;
7655 solaris) dflt='-G' ;;
7656 sunos) dflt='-assert nodefinitions' ;;
7657 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7661 *) dflt="$lddlflags" ;;
7664 : Try to guess additional flags to pick up local libraries.
7665 : Be careful not to append to a plain 'none'
7669 for thisflag in $ldflags; do
7674 *) dflt="$dflt $thisflag" ;;
7681 ''|' ') dflt='none' ;;
7684 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7687 none) lddlflags=' ' ;;
7688 *) lddlflags="$ans" ;;
7693 Some systems may require passing special flags to $cc to indicate that
7694 the resulting executable will use dynamic linking. To use no flags,
7698 case "$ccdlflags" in
7699 '') case "$osname" in
7700 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7701 next|sunos) dflt='none' ;;
7705 *) dflt="$ccdlflags" ;;
7707 rp="Any special flags to pass to $cc to use dynamic linking?"
7710 none) ccdlflags=' ' ;;
7711 *) ccdlflags="$ans" ;;
7725 # No dynamic loading being used, so don't bother even to prompt.
7728 *) case "$useshrplib" in
7729 '') case "$osname" in
7730 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7732 also='Building a shared libperl is required for dynamic loading to work on your system.'
7737 also='Building a shared libperl is needed for MAB support.'
7755 The perl executable is normally obtained by linking perlmain.c with
7756 libperl${_a}, any static extensions (usually just DynaLoader), and
7757 any other libraries needed on this system (such as -lm, etc.). Since
7758 your system supports dynamic loading, it is probably possible to build
7759 a shared libperl.$so. If you will have more than one executable linked
7760 to libperl.$so, this will significantly reduce the size of each
7761 executable, but it may have a noticeable affect on performance. The
7762 default is probably sensible for your system.
7766 rp="Build a shared libperl.$so (y/n)"
7770 useshrplib='true' ;;
7771 *) useshrplib='false' ;;
7776 case "$useshrplib" in
7780 # Figure out a good name for libperl.so. Since it gets stored in
7781 # a version-specific architecture-dependent library, the version
7782 # number isn't really that important, except for making cc/ld happy.
7784 # A name such as libperl.so.3.1
7785 majmin="libperl.$so.$patchlevel.$subversion"
7786 # A name such as libperl.so.301
7787 majonly=`echo $patchlevel $subversion |
7788 $awk '{printf "%d%02d", $1, $2}'`
7789 majonly=libperl.$so.$majonly
7790 # I'd prefer to keep the os-specific stuff here to a minimum, and
7791 # rely on figuring it out from the naming of libc.
7792 case "${osname}${osvers}" in
7795 # XXX How handle the --version stuff for MAB?
7797 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7800 cygwin*) # ld links against an importlib
7801 dflt=libperl$lib_ext
7803 *) # Try to guess based on whether libc has major.minor.
7805 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7806 *libc.$so.[0-9]*) dflt=$majonly ;;
7807 *) dflt=libperl.$so ;;
7817 I need to select a good name for the shared libperl. If your system uses
7818 library names with major and minor numbers, then you might want something
7819 like $majmin. Alternatively, if your system uses a single version
7820 number for shared libraries, then you might want to use $majonly.
7821 Or, your system might be quite happy with a simple libperl.$so.
7823 Since the shared libperl will get installed into a version-specific
7824 architecture-dependent directory, the version number of the shared perl
7825 library probably isn't important, so the default should be o.k.
7828 rp='What name do you want to give to the shared libperl?'
7831 echo "Ok, I'll use $libperl"
7834 libperl="libperl${_a}"
7838 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7842 WARNING: Use of the shrpdir variable for the installation location of
7843 the shared $libperl is not supported. It was never documented and
7844 will not work in this version. Let me (perlbug@perl.org)
7845 know of any problems this may cause.
7851 But your current setting of $shrpdir is
7852 the default anyway, so it's harmless.
7857 Further, your current attempted setting of $shrpdir
7858 conflicts with the value of $archlibexp/CORE
7859 that installperl will use.
7866 # How will the perl executable find the installed shared $libperl?
7867 # Add $xxx to ccdlflags.
7868 # If we can't figure out a command-line option, use $shrpenv to
7869 # set env LD_RUN_PATH. The main perl makefile uses this.
7870 shrpdir=$archlibexp/CORE
7873 if "$useshrplib"; then
7876 # We'll set it in Makefile.SH...
7881 freebsd|netbsd|openbsd|interix)
7882 xxx="-Wl,-R$shrpdir"
7884 bsdos|linux|irix*|dec_osf|gnu*)
7885 xxx="-Wl,-rpath,$shrpdir"
7888 # next doesn't like the default...
7891 # beos doesn't like the default, either.
7894 # hpux doesn't like the default, either.
7895 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7898 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7904 # Only add $xxx if it isn't already in ccdlflags.
7905 case " $ccdlflags " in
7907 *) ccdlflags="$ccdlflags $xxx"
7910 Adding $xxx to the flags
7911 passed to $ld so that the perl executable will find the
7912 installed shared $libperl.
7920 # Fix ccdlflags in AIX for building external extensions.
7921 # (For building Perl itself bare -bE:perl.exp is needed,
7922 # Makefile.SH takes care of this.)
7924 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7926 # Respect a hint or command-line value.
7928 '') shrpenv="$tmp_shrpenv" ;;
7930 case "$ldlibpthname" in
7931 '') ldlibpthname=LD_LIBRARY_PATH ;;
7932 none) ldlibpthname='' ;;
7935 : determine where manual pages are on this system
7939 syspath='/usr/share/man/man1 /usr/man/man1'
7940 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7941 syspath="$syspath /usr/man/u_man/man1"
7942 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7943 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7944 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7945 sysman=`./loc . /usr/man/man1 $syspath`
7948 if $test -d "$sysman"; then
7949 echo "System manual is in $sysman." >&4
7951 echo "Could not find manual pages in source form." >&4
7954 : determine where manual pages go
7955 set man1dir man1dir none
7959 $spackage has manual pages available in source form.
7963 echo "However, you don't have nroff, so they're probably useless to you."
7965 '') man1dir="none";;
7968 echo "If you don't want the manual sources installed, answer 'none'."
7973 lookpath="$prefixexp/share/man/man1"
7974 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7975 lookpath="$lookpath $prefixexp/man/p_man/man1"
7976 lookpath="$lookpath $prefixexp/man/u_man/man1"
7977 lookpath="$lookpath $prefixexp/man/man.1"
7979 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7980 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7990 rp="Where do the main $spackage manual pages (source) go?"
7992 if $test "X$man1direxp" != "X$ansexp"; then
7996 man1direxp="$ansexp"
8002 : Change installation prefix, if necessary.
8003 if $test X"$prefix" != X"$installprefix"; then
8004 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8006 installman1dir="$man1direxp"
8009 : What suffix to use on installed man pages
8016 rp="What suffix should be used for the main $spackage man pages?"
8018 '') case "$man1dir" in
8032 *) dflt="$man1ext";;
8039 : see if we can have long filenames
8041 first=123456789abcdef
8043 if (echo hi >$first) 2>/dev/null; then
8044 if $test -f 123456789abcde; then
8045 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8048 echo 'You can have filenames longer than 14 characters.'>&4
8053 You can't have filenames longer than 14 chars.
8054 You can't even think about them!
8060 $rm -rf 123456789abcde*
8062 : determine where library module manual pages go
8063 set man3dir man3dir none
8067 $spackage has manual pages for many of the library modules.
8073 However, you don't have nroff, so they're probably useless to you.
8076 '') man3dir="none";;
8080 case "$d_flexfnam" in
8083 However, your system can't handle the long file names like File::Basename.3.
8086 '') man3dir="none";;
8090 echo "If you don't want the manual sources installed, answer 'none'."
8091 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8093 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8094 if $test -d "$privlib/man/man3"; then
8097 WARNING: Previous versions of perl installed man3 pages into
8098 $privlib/man/man3. This version will suggest a
8099 new default of $dflt.
8103 rp='Do you wish to preserve the old behavior?(y/n)'
8106 y*) dflt="$privlib/man/man3" ;;
8111 *) dflt="$man3dir" ;;
8118 rp="Where do the $package library man pages (source) go?"
8121 man3direxp="$ansexp"
8127 : Change installation prefix, if necessary.
8128 if $test X"$prefix" != X"$installprefix"; then
8129 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8131 installman3dir="$man3direxp"
8134 : What suffix to use on installed man pages
8140 rp="What suffix should be used for the $package library man pages?"
8142 '') case "$man3dir" in
8156 *) dflt="$man3ext";;
8163 : see if we have to deal with yellow pages, now NIS.
8164 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8165 if $test -f /usr/etc/nibindd; then
8167 echo "I'm fairly confident you're on a NeXT."
8169 rp='Do you get the hosts file via NetInfo?'
8178 y*) hostcat='nidump hosts .';;
8179 *) case "$hostcat" in
8180 nidump*) hostcat='';;
8190 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8198 rp='Are you getting the hosts file via yellow pages?'
8201 y*) hostcat='ypcat hosts';;
8202 *) hostcat='cat /etc/hosts';;
8208 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8211 '') test -f /etc/group && groupcat='cat /etc/group';;
8214 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8217 : now get the host name
8219 echo "Figuring out host name..." >&4
8220 case "$myhostname" in
8222 echo 'Maybe "hostname" will work...'
8223 if tans=`sh -c hostname 2>&1` ; then
8231 if $test "$cont"; then
8233 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8234 if tans=`cat /etc/systemid 2>&1` ; then
8236 phostname='cat /etc/systemid'
8237 echo "Whadyaknow. Xenix always was a bit strange..."
8240 elif $test -r /etc/systemid; then
8241 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8244 if $test "$cont"; then
8245 echo 'No, maybe "uuname -l" will work...'
8246 if tans=`sh -c 'uuname -l' 2>&1` ; then
8248 phostname='uuname -l'
8250 echo 'Strange. Maybe "uname -n" will work...'
8251 if tans=`sh -c 'uname -n' 2>&1` ; then
8253 phostname='uname -n'
8255 echo 'Oh well, maybe I can mine it out of whoami.h...'
8256 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8257 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8258 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8260 case "$myhostname" in
8261 '') echo "Does this machine have an identity crisis or something?"
8264 echo "Well, you said $myhostname before..."
8265 phostname='echo $myhostname';;
8271 case "$myhostname" in
8272 '') myhostname=noname ;;
8274 : you do not want to know about this
8279 if $test "$myhostname" ; then
8281 rp='Your host name appears to be "'$myhostname'".'" Right?"
8289 : bad guess or no guess
8290 while $test "X$myhostname" = X ; do
8292 rp="Please type the (one word) name of your host:"
8297 : translate upper to lower if necessary
8298 case "$myhostname" in
8300 echo "(Normalizing case in your host name)"
8301 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8305 case "$myhostname" in
8307 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8308 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8309 echo "(Trimming domain name from host name--host name is now $myhostname)"
8311 *) case "$mydomain" in
8314 test "X$hostcat" = "Xypcat hosts" &&
8315 ypmatch "$myhostname" hosts 2>/dev/null |\
8316 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8319 test "X$hostcat" != "X" &&
8320 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8321 /[ ]$myhostname[ . ]/p" > hosts
8324 if $test -f hosts; then
8325 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8326 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8327 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8328 hosts | $sort | $uniq | \
8329 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8330 case `$echo X$dflt` in
8331 X*\ *) echo "(Several hosts in the database matched hostname)"
8334 X.) echo "(You do not have fully-qualified names in the hosts database)"
8338 echo "(I cannot locate a hosts database anywhere)"
8343 tans=`./loc resolv.conf X /etc /usr/etc`
8344 if $test -f "$tans"; then
8345 echo "(Attempting domain name extraction from $tans)"
8346 dflt=.`$sed -n -e 's/ / /g' \
8347 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8348 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8350 .) dflt=.`$sed -n -e 's/ / /g' \
8351 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8352 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8359 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8360 dflt=.`sh -c domainname 2>/dev/null`
8363 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8367 case "$dflt$osname" in
8368 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8369 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8373 .) echo "(Lost all hope -- silly guess then)"
8379 *) dflt="$mydomain";;
8383 rp="What is your domain name?"
8393 : translate upper to lower if necessary
8396 echo "(Normalizing case in your domain name)"
8397 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8401 : a little sanity check here
8402 case "$phostname" in
8405 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8406 $myhostname$mydomain|$myhostname) ;;
8408 case "$phostname" in
8410 echo "(That doesn't agree with your whoami.h file, by the way.)"
8413 echo "(That doesn't agree with your $phostname command, by the way.)"
8423 I need to get your e-mail address in Internet format if possible, i.e.
8424 something like user@host.domain. Please answer accurately since I have
8425 no easy means to double check it. The default value provided below
8426 is most probably close to reality but may not be valid from outside
8427 your organization...
8431 while test "$cont"; do
8433 '') dflt="$cf_by@$myhostname$mydomain";;
8434 *) dflt="$cf_email";;
8436 rp='What is your e-mail address?'
8442 rp='Address does not look like an Internet one. Use it anyway?'
8458 If you or somebody else will be maintaining perl at your site, please
8459 fill in the correct e-mail address here so that they may be contacted
8460 if necessary. Currently, the "perlbug" program included with perl
8461 will send mail to this address in addition to perlbug@perl.org. You may
8462 enter "none" for no administrator.
8465 case "$perladmin" in
8466 '') dflt="$cf_email";;
8467 *) dflt="$perladmin";;
8469 rp='Perl administrator e-mail address'
8473 : determine whether to only install version-specific parts.
8476 Do you want to install only the version-specific parts of the perl
8477 distribution? Usually you do *not* want to do this.
8479 case "$versiononly" in
8480 "$define"|[Yy]*|true) dflt='y' ;;
8483 rp="Do you want to install only the version-specific parts of perl?"
8486 [yY]*) val="$define";;
8492 case "$versiononly" in
8493 "$define") inc_version_list=''
8494 inc_version_list_init=0
8498 : figure out how to guarantee perl startup
8499 case "$startperl" in
8501 case "$sharpbang" in
8505 I can use the #! construct to start perl on your system. This will
8506 make startup of perl scripts faster, but may cause problems if you
8507 want to share those scripts and perl is not in a standard place
8508 ($binexp/perl) on all your platforms. The alternative is to force
8509 a shell by starting the script with a single ':' character.
8512 case "$versiononly" in
8513 "$define") dflt="$binexp/perl$version";;
8514 *) dflt="$binexp/perl";;
8516 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8519 none) startperl=": # use perl";;
8520 *) startperl="#!$ans"
8521 if $test 30 -lt `echo "$ans" | wc -c`; then
8524 WARNING: Some systems limit the #! command to 32 characters.
8525 If you experience difficulty running Perl scripts with #!, try
8526 installing Perl in a directory with a shorter pathname.
8532 *) startperl=": # use perl"
8537 echo "I'll use $startperl to start perl scripts."
8539 : figure best path for perl in scripts
8542 case "$versiononly" in
8543 "$define") perlpath="$binexp/perl$version";;
8544 *) perlpath="$binexp/perl";;
8546 case "$startperl" in
8551 I will use the "eval 'exec'" idiom to start Perl on your system.
8552 I can use the full path of your Perl binary for this purpose, but
8553 doing so may cause problems if you want to share those scripts and
8554 Perl is not always in a standard place ($binexp/perl).
8558 rp="What path shall I use in \"eval 'exec'\"?"
8565 case "$startperl" in
8567 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8570 : determine where public executable scripts go
8571 set scriptdir scriptdir
8573 case "$scriptdir" in
8576 : guess some guesses
8577 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8578 $test -d /usr/share/bin && dflt=/usr/share/bin
8579 $test -d /usr/local/script && dflt=/usr/local/script
8580 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8581 $test -d $prefixexp/script && dflt=$prefixexp/script
8585 *) dflt="$scriptdir"
8590 Some installations have a separate directory just for executable scripts so
8591 that they can mount it across multiple architectures but keep the scripts in
8592 one spot. You might, for example, have a subdirectory of /usr/share for this.
8593 Or you might just lump your scripts in with all your other executables.
8597 rp='Where do you keep publicly executable scripts?'
8599 if $test "X$ansexp" != "X$scriptdirexp"; then
8603 scriptdirexp="$ansexp"
8604 : Change installation prefix, if necessary.
8605 if $test X"$prefix" != X"$installprefix"; then
8606 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8608 installscript="$scriptdirexp"
8611 : determine where add-on public executables go
8613 '') dflt=$siteprefix/bin ;;
8617 rp='Pathname where the add-on public executables should be installed?'
8620 sitebinexp="$ansexp"
8621 : Change installation prefix, if necessary.
8622 if $test X"$prefix" != X"$installprefix"; then
8623 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8625 installsitebin="$sitebinexp"
8628 : determine where add-on html pages go
8629 : There is no standard location, so try to copy the previously-selected
8630 : directory structure for the core html pages.
8631 case "$sitehtml1dir" in
8632 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8633 *) dflt=$sitehtml1dir ;;
8636 ''|' ') dflt=none ;;
8639 rp='Pathname where the site-specific html pages should be installed?'
8642 sitehtml1direxp="$ansexp"
8643 : Change installation prefix, if necessary.
8644 if $test X"$prefix" != X"$installprefix"; then
8645 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8647 installsitehtml1dir="$sitehtml1direxp"
8650 : determine where add-on library html pages go
8651 : There is no standard location, so try to copy the previously-selected
8652 : directory structure for the core html pages.
8653 case "$sitehtml3dir" in
8654 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8655 *) dflt=$sitehtml3dir ;;
8658 ''|' ') dflt=none ;;
8661 rp='Pathname where the site-specific library html pages should be installed?'
8664 sitehtml3direxp="$ansexp"
8665 : Change installation prefix, if necessary.
8666 if $test X"$prefix" != X"$installprefix"; then
8667 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8669 installsitehtml3dir="$sitehtml3direxp"
8672 : determine where add-on manual pages go
8673 case "$siteman1dir" in
8674 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8675 *) dflt=$siteman1dir ;;
8678 ''|' ') dflt=none ;;
8681 rp='Pathname where the site-specific manual pages should be installed?'
8684 siteman1direxp="$ansexp"
8685 : Change installation prefix, if necessary.
8686 if $test X"$prefix" != X"$installprefix"; then
8687 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8689 installsiteman1dir="$siteman1direxp"
8692 : determine where add-on library man pages go
8693 case "$siteman3dir" in
8694 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8695 *) dflt=$siteman3dir ;;
8698 ''|' ') dflt=none ;;
8701 rp='Pathname where the site-specific library manual pages should be installed?'
8704 siteman3direxp="$ansexp"
8705 : Change installation prefix, if necessary.
8706 if $test X"$prefix" != X"$installprefix"; then
8707 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8709 installsiteman3dir="$siteman3direxp"
8712 : determine where add-on public executable scripts go
8713 case "$sitescript" in
8714 '') dflt=$siteprefix/script
8715 $test -d $dflt || dflt=$sitebin ;;
8716 *) dflt="$sitescript" ;;
8719 rp='Pathname where add-on public executable scripts should be installed?'
8722 sitescriptexp="$ansexp"
8723 : Change installation prefix, if necessary.
8724 if $test X"$prefix" != X"$installprefix"; then
8725 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8727 installsitescript="$sitescriptexp"
8730 case "$usefaststdio" in
8731 $define|true|[yY]*|'')
8732 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8742 Perl can be built to use 'fast stdio', which means using the stdio
8743 library but also directly manipulating the stdio buffers to enable
8744 faster I/O. Using stdio is better for backward compatibility (especially
8745 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8746 interface has been preferred instead of stdio.
8748 If this doesn't make any sense to you, just accept the default '$dflt'.
8750 rp='Use the "fast stdio" if available?'
8753 y|Y) val="$define" ;;
8760 : define an is-a-typedef? function
8761 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8763 "") inclist="sys/types.h";;
8765 eval "varval=\$$var";
8769 for inc in $inclist; do
8770 echo "#include <$inc>" >>temp.c;
8772 echo "#ifdef $type" >> temp.c;
8773 echo "printf(\"We have $type\");" >> temp.c;
8774 echo "#endif" >> temp.c;
8775 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8776 if $contains $type temp.E >/dev/null 2>&1; then
8782 *) eval "$var=\$varval";;
8785 : define an is-a-typedef? function that prompts if the type is not available.
8786 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8788 "") inclist="sys/types.h";;
8790 eval "varval=\$$var";
8794 for inc in $inclist; do
8795 echo "#include <$inc>" >>temp.c;
8797 echo "#ifdef $type" >> temp.c;
8798 echo "printf(\"We have $type\");" >> temp.c;
8799 echo "#endif" >> temp.c;
8800 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8802 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8803 if $contains $type temp.E >/dev/null 2>&1; then
8804 echo "$type found." >&4;
8807 echo "$type NOT found." >&4;
8813 *) eval "$var=\$varval";;
8816 : see what type lseek is declared as in the kernel
8817 rp="What is the type used for lseek's offset on this system?"
8818 set off_t lseektype long stdio.h sys/types.h
8822 echo "Checking to see how big your file offsets are..." >&4
8824 #include <sys/types.h>
8828 printf("%d\n", (int)sizeof($lseektype));
8833 if eval $compile_ok; then
8834 lseeksize=`$run ./try`
8835 echo "Your file offsets are $lseeksize bytes long."
8839 echo "(I can't seem to compile the test program. Guessing...)"
8840 rp="What is the size of your file offsets (in bytes)?"
8846 : see what type file positions are declared as in the library
8847 rp="What is the type for file position used by fsetpos()?"
8848 set fpos_t fpostype long stdio.h sys/types.h
8853 *_t) zzz="$fpostype" ;;
8856 echo "Checking the size of $zzz..." >&4
8858 #include <sys/types.h>
8865 printf("%d\n", (int)sizeof($fpostype));
8870 if eval $compile_ok; then
8874 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8877 echo "Your $zzz is $fpossize bytes long."
8883 echo "(I can't compile the test program. Guessing...)" >&4
8884 rp="What is the size of your file positions (in bytes)?"
8889 # Backward compatibility (uselfs is deprecated).
8891 "$define"|true|[yY]*)
8894 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8896 uselargefiles="$define"
8900 case "$lseeksize:$fpossize" in
8903 You can have files larger than 2 gigabytes.
8906 *) case "$uselargefiles" in
8907 "$undef"|false|[nN]*) dflt='n' ;;
8912 Perl can be built to understand large files (files larger than 2 gigabytes)
8913 on some systems. To do so, Configure can be run with -Duselargefiles.
8915 If this doesn't make any sense to you, just accept the default '$dflt'.
8917 rp='Try to understand large files, if available?'
8920 y|Y) val="$define" ;;
8927 : Look for a hint-file generated 'call-back-unit'. If the
8928 : user has specified that a large files perl is to be built,
8929 : we may need to set or change some other defaults.
8930 if $test -f uselargefiles.cbu; then
8931 echo "Your platform has some specific hints regarding large file builds, using them..."
8932 . ./uselargefiles.cbu
8934 case "$uselargefiles" in
8936 if $test -f uselargefiles.cbu; then
8938 echo "Rechecking to see how big your file offsets are..." >&4
8940 #include <sys/types.h>
8944 printf("%d\n", (int)sizeof($lseektype));
8949 if eval $compile_ok; then
8950 lseeksize=`$run ./try`
8951 $echo "Your file offsets are now $lseeksize bytes long."
8955 echo "(I can't seem to compile the test program. Guessing...)"
8956 rp="What is the size of your file offsets (in bytes)?"
8961 *_t) zzz="$fpostype" ;;
8964 $echo $n "Rechecking the size of $zzz...$c" >&4
8966 #include <sys/types.h>
8973 printf("%d\n", (int)sizeof($fpostype));
8978 if eval $compile_ok; then
8983 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8986 echo " $fpossize bytes." >&4
8992 echo "(I can't compile the test program. Guessing...)" >&4
8993 rp="What is the size of your file positions (in bytes)?"
9002 # probably will refer to
9003 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9005 userelocatableinc=undef
9007 case "$vendorprefix" in
9008 '') d_vendorbin="$undef"
9012 *) d_vendorbin="$define"
9013 : determine where vendor-supplied executables go.
9014 case "$vendorbin" in
9015 '') dflt=$vendorprefix/bin ;;
9016 *) dflt="$vendorbin" ;;
9019 rp='Pathname for the vendor-supplied executables directory?'
9022 vendorbinexp="$ansexp"
9025 : Change installation prefix, if necessary.
9026 if $test X"$prefix" != X"$installprefix"; then
9027 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9029 installvendorbin="$vendorbinexp"
9032 case "$vendorprefix" in
9033 '') vendorhtml1dir=''
9034 vendorhtml1direxp=''
9036 *) : determine where vendor-supplied html pages go.
9037 : There is no standard location, so try to copy the previously-selected
9038 : directory structure for the core html pages.
9039 : XXX Better default suggestions would be welcome.
9040 case "$vendorhtml1dir" in
9041 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9042 *) dflt=$vendorhtml1dir ;;
9045 ''|' ') dflt=none ;;
9048 rp='Pathname for the vendor-supplied html pages?'
9050 vendorhtml1dir="$ans"
9051 vendorhtml1direxp="$ansexp"
9054 : Use ' ' for none so value is preserved next time through Configure
9055 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9056 : Change installation prefix, if necessary.
9057 if $test X"$prefix" != X"$installprefix"; then
9058 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9060 installvendorhtml1dir="$vendorhtml1direxp"
9063 case "$vendorprefix" in
9064 '') vendorhtml3dir=''
9065 vendorhtml3direxp=''
9067 *) : determine where vendor-supplied module html pages go.
9068 : There is no standard location, so try to copy the previously-selected
9069 : directory structure for the core html pages.
9070 : XXX Better default suggestions would be welcome.
9071 case "$vendorhtml3dir" in
9072 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9073 *) dflt=$vendorhtml3dir ;;
9076 ''|' ') dflt=none ;;
9079 rp='Pathname for the vendor-supplied html pages?'
9081 vendorhtml3dir="$ans"
9082 vendorhtml3direxp="$ansexp"
9085 : Use ' ' for none so value is preserved next time through Configure
9086 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9087 : Change installation prefix, if necessary.
9088 if $test X"$prefix" != X"$installprefix"; then
9089 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9091 installvendorhtml3dir="$vendorhtml3direxp"
9094 case "$vendorprefix" in
9095 '') vendorman1dir=''
9098 *) : determine where vendor-supplied manual pages go.
9099 case "$vendorman1dir" in
9100 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9101 *) dflt=$vendorman1dir ;;
9104 ''|' ') dflt=none ;;
9107 rp='Pathname for the vendor-supplied manual section 1 pages?'
9109 vendorman1dir="$ans"
9110 vendorman1direxp="$ansexp"
9113 : Use ' ' for none so value is preserved next time through Configure
9114 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9115 : Change installation prefix, if necessary.
9116 if $test X"$prefix" != X"$installprefix"; then
9117 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9119 installvendorman1dir="$vendorman1direxp"
9122 case "$vendorprefix" in
9123 '') vendorman3dir=''
9126 *) : determine where vendor-supplied module manual pages go.
9127 case "$vendorman3dir" in
9128 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9129 *) dflt=$vendorman3dir ;;
9132 ''|' ') dflt=none ;;
9135 rp='Pathname for the vendor-supplied manual section 3 pages?'
9137 vendorman3dir="$ans"
9138 vendorman3direxp="$ansexp"
9141 : Use ' ' for none so value is preserved next time through Configure
9142 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9143 : Change installation prefix, if necessary.
9144 if $test X"$prefix" != X"$installprefix"; then
9145 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9147 installvendorman3dir="$vendorman3direxp"
9150 case "$vendorprefix" in
9151 '') d_vendorscript="$undef"
9155 *) d_vendorscript="$define"
9156 : determine where vendor-supplied scripts go.
9157 case "$vendorscript" in
9158 '') dflt=$vendorprefix/script
9159 $test -d $dflt || dflt=$vendorbin ;;
9160 *) dflt="$vendorscript" ;;
9164 The installation process will create a directory for
9165 vendor-supplied scripts.
9169 rp='Pathname for the vendor-supplied scripts directory?'
9172 vendorscriptexp="$ansexp"
9175 : Change installation prefix, if necessary.
9176 if $test X"$prefix" != X"$installprefix"; then
9177 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9179 installvendorscript="$vendorscriptexp"
9182 : see if qgcvt exists
9188 if $test X"$d_longdbl" = X"$define"; then
9190 echo "Checking how to print long doubles..." >&4
9192 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9193 $cat >try.c <<'EOCP'
9194 #include <sys/types.h>
9198 printf("%.3f\n", d);
9202 if eval $compile; then
9206 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9207 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9208 echo "We will use %f."
9214 if $test X"$sPRIfldbl" = X; then
9215 $cat >try.c <<'EOCP'
9216 #include <sys/types.h>
9219 long double d = 123.456;
9220 printf("%.3Lf\n", d);
9224 if eval $compile; then
9228 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9229 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9230 echo "We will use %Lf."
9236 if $test X"$sPRIfldbl" = X; then
9237 $cat >try.c <<'EOCP'
9238 #include <sys/types.h>
9241 long double d = 123.456;
9242 printf("%.3llf\n", d);
9246 if eval $compile; then
9250 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9251 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9252 echo "We will use %llf."
9258 if $test X"$sPRIfldbl" = X; then
9259 $cat >try.c <<'EOCP'
9260 #include <sys/types.h>
9263 long double d = 123.456;
9264 printf("%.3lf\n", d);
9268 if eval $compile; then
9272 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9273 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9274 echo "We will use %lf."
9280 if $test X"$sPRIfldbl" = X; then
9281 echo "Cannot figure out how to print long doubles." >&4
9283 sSCNfldbl=$sPRIfldbl # expect consistency
9290 case "$sPRIfldbl" in
9291 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9292 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9293 d_SCNfldbl="$undef";
9295 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9296 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9297 d_SCNfldbl="$define";
9301 : Check how to convert floats to strings.
9303 if test "X$d_Gconvert" = X; then
9306 echo "Checking for an efficient way to convert floats to strings."
9308 case "$uselongdouble" in
9309 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9311 case "$d_longdbl" in
9312 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9314 case "$d_PRIgldbl" in
9315 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9319 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9320 char *myname = "gconvert";
9323 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9324 char *myname = "gcvt";
9327 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9328 char *myname = "qgcvt";
9329 #define DOUBLETYPE long double
9332 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9334 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9336 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9339 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9341 char *myname = "sprintf";
9345 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9346 #define DOUBLETYPE long double
9348 #define DOUBLETYPE double
9354 #define I_STDLIB $i_stdlib
9360 checkit(expect, got)
9364 if (strcmp(expect, got)) {
9365 printf("%s oddity: Expected %s, got %s\n",
9366 myname, expect, got);
9376 /* This must be 1st test on (which?) platform */
9377 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9378 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9379 checkit("0.1", buf);
9381 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9382 checkit("0.01", buf);
9384 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9385 checkit("0.001", buf);
9387 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9388 checkit("0.0001", buf);
9390 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9391 if (strlen(buf) > 5)
9392 checkit("9e-005", buf); /* for Microsoft ?? */
9394 checkit("9e-05", buf);
9396 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9399 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9400 checkit("1.1", buf);
9402 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9403 checkit("1.01", buf);
9405 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9406 checkit("1.001", buf);
9408 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9409 checkit("1.0001", buf);
9411 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9412 checkit("1.00001", buf);
9414 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9415 checkit("1.000001", buf);
9417 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9420 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9423 /* Some Linux gcvt's give 1.e+5 here. */
9424 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9425 checkit("100000", buf);
9427 /* Some Linux gcvt's give -1.e+5 here. */
9428 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9429 checkit("-100000", buf);
9431 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9432 checkit("123.456", buf);
9434 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9435 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9436 /* 34 should be enough to scare even long double
9437 * places into using the e notation. */
9438 if (strlen(buf) > 5)
9439 checkit("1e+034", buf); /* for Microsoft */
9441 checkit("1e+34", buf);
9443 /* For Perl, if you add additional tests here, also add them to
9444 * t/base/num.t for benefit of platforms not using Configure or
9445 * overriding d_Gconvert */
9450 : first add preferred functions to our list
9452 for xxx_convert in $gconvert_preference; do
9453 case $xxx_convert in
9454 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9455 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9458 : then add any others
9459 for xxx_convert in gconvert gcvt sprintf; do
9462 *) xxx_list="$xxx_list $xxx_convert" ;;
9466 case "$d_longdbl$uselongdouble" in
9468 : again, add prefered functions to our list first
9470 for xxx_convert in $gconvert_ld_preference; do
9471 case $xxx_convert in
9472 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9473 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9476 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9477 for xxx_convert in qgcvt sprintf $xxx_list; do
9478 case "$xxx_ld_list" in
9479 $xxx_convert*|*" $xxx_convert"*) ;;
9480 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9483 : if sprintf cannot do long doubles, move it to the end
9484 if test "$d_PRIgldbl" != "$define"; then
9485 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9487 : if no qgcvt, remove it
9488 if test "$d_qgcvt" != "$define"; then
9489 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9492 xxx_list="$xxx_ld_list"
9496 for xxx_convert in $xxx_list; do
9497 echo "Trying $xxx_convert..."
9499 set try -DTRY_$xxx_convert
9500 if eval $compile; then
9501 echo "$xxx_convert() found." >&4
9503 echo "I'll use $xxx_convert to convert floats into a string." >&4
9506 echo "...But $xxx_convert didn't work as I expected."
9510 echo "$xxx_convert NOT found." >&4
9514 if test X$xxx_convert = X; then
9515 echo "*** WHOA THERE!!! ***" >&4
9516 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9520 case "$xxx_convert" in
9521 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9522 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9523 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9524 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9525 "$define$define$define")
9526 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9527 "$define$define$undef")
9528 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9529 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9536 : see if _fwalk exists
9540 : Initialize h_fcntl
9543 : Initialize h_sysfile
9546 : access call always available on UNIX
9550 : locate the flags for 'access()'
9554 $cat >access.c <<EOCP
9555 #include <sys/types.h>
9560 #include <sys/file.h>
9573 : check sys/file.h first, no particular reason here
9574 if $test `./findhdr sys/file.h` && \
9575 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9577 echo "<sys/file.h> defines the *_OK access constants." >&4
9578 elif $test `./findhdr fcntl.h` && \
9579 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9581 echo "<fcntl.h> defines the *_OK access constants." >&4
9582 elif $test `./findhdr unistd.h` && \
9583 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9584 echo "<unistd.h> defines the *_OK access constants." >&4
9586 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9592 : see if accessx exists
9593 set accessx d_accessx
9596 : see if aintl exists
9600 : see if alarm exists
9604 : see if POSIX threads are available
9605 set pthread.h i_pthread
9608 : define a fucntion to check prototypes
9609 $cat > protochk <<EOSH
9612 optimize="$optimize"
9614 prototype="$prototype"
9617 usethreads=$usethreads
9618 i_pthread=$i_pthread
9619 pthread_h_first=$pthread_h_first
9622 $cat >> protochk <<'EOSH'
9627 while test $# -ge 2; do
9629 $define) echo "#include <$2>" >> try.c ;;
9630 literal) echo "$2" >> try.c ;;
9632 # Extra magic for the benefit of systems that need pthread.h
9633 # to be included early to correctly detect threadsafe functions.
9634 # Such functions must guarantee themselves, though, that the usethreads
9635 # and i_pthread have been defined, before calling protochk.
9636 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9637 echo "#include <pthread.h>" >> try.c
9642 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9643 cat >> try.c <<'EOCP'
9644 #ifdef CAN_PROTOTYPE
9645 #define _(args) args
9650 echo "$foo" >> try.c
9651 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9652 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9660 hasproto='varname=$1; func=$2; shift; shift;
9661 while $test $# -ge 2; do
9663 $define) echo "#include <$2>";;
9667 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9668 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9669 echo "$func() prototype found.";
9672 echo "$func() prototype NOT found.";
9677 $rm -f try.c tryout.c'
9679 : see if sys/types.h has to be included
9680 set sys/types.h i_systypes
9683 : see if sys/select.h has to be included
9684 set sys/select.h i_sysselct
9687 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9688 while $test $# -ge 2; do
9690 $define) echo "#include <$2>";;
9694 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9696 if eval $compile; then
9705 : see if we should include time.h, sys/time.h, or both
9707 if test "X$timeincl" = X; then
9708 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9709 $echo $n "I'm now running the test program...$c"
9711 #include <sys/types.h>
9716 #ifdef SYSTIMEKERNEL
9719 #include <sys/time.h>
9722 #include <sys/select.h>
9735 struct timezone tzp;
9737 if (foo.tm_sec == foo.tm_sec)
9740 if (bar.tv_sec == bar.tv_sec)
9747 for s_timezone in '-DS_TIMEZONE' ''; do
9749 for s_timeval in '-DS_TIMEVAL' ''; do
9750 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9751 for i_time in '' '-DI_TIME'; do
9752 for i_systime in '-DI_SYSTIME' ''; do
9755 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9756 if eval $compile; then
9757 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9761 $echo $n "Succeeded with $flags$c"
9773 *SYSTIMEKERNEL*) i_systimek="$define"
9774 timeincl=`./findhdr sys/time.h`
9775 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9776 *) i_systimek="$undef";;
9779 *I_TIME*) i_time="$define"
9780 timeincl=`./findhdr time.h`" $timeincl"
9781 echo "We'll include <time.h>." >&4;;
9782 *) i_time="$undef";;
9785 *I_SYSTIME*) i_systime="$define"
9786 timeincl=`./findhdr sys/time.h`" $timeincl"
9787 echo "We'll include <sys/time.h>." >&4;;
9788 *) i_systime="$undef";;
9792 : see if struct tm knows about tm_zone
9793 case "$i_systime$i_time" in
9796 echo "Checking to see if your struct tm has tm_zone field..." >&4
9797 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9805 case "$d_tm_tm_zone" in
9806 "$define") echo "Yes, it does." ;;
9807 *) echo "No, it doesn't." ;;
9809 : see if struct tm knows about tm_gmtoff
9810 case "$i_systime$i_time" in
9813 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9814 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9822 case "$d_tm_tm_gmtoff" in
9823 "$define") echo "Yes, it does." ;;
9824 *) echo "No, it doesn't." ;;
9827 : see if asctime_r exists
9828 set asctime_r d_asctime_r
9830 case "$d_asctime_r" in
9832 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9833 case "$d_asctime_r_proto:$usethreads" in
9834 ":define") d_asctime_r_proto=define
9835 set d_asctime_r_proto asctime_r $hdrs
9839 case "$d_asctime_r_proto" in
9841 case "$asctime_r_proto" in
9842 ''|0) try='char* asctime_r(const struct tm*, char*);'
9843 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9845 case "$asctime_r_proto" in
9846 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9847 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9849 case "$asctime_r_proto" in
9850 ''|0) try='int asctime_r(const struct tm*, char*);'
9851 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9853 case "$asctime_r_proto" in
9854 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9855 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9857 case "$asctime_r_proto" in
9858 ''|0) d_asctime_r=undef
9860 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9861 * ) case "$asctime_r_proto" in
9862 REENTRANT_PROTO*) ;;
9863 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9865 echo "Prototype: $try" ;;
9868 *) case "$usethreads" in
9869 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9876 *) asctime_r_proto=0
9880 : see if atolf exists
9884 : see if atoll exists
9888 : Look for GCC-style attribute format
9889 case "$d_attribute_format" in
9892 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9893 $cat >attrib.c <<'EOCP'
9895 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9897 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9898 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9899 echo "Your C compiler doesn't support __attribute__((format))."
9902 echo "Your C compiler supports __attribute__((format))."
9906 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9910 *) val="$d_attribute_format" ;;
9912 set d_attribute_format
9916 : Look for GCC-style attribute malloc
9917 case "$d_attribute_malloc" in
9920 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9921 $cat >attrib.c <<'EOCP'
9923 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9925 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9926 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9927 echo "Your C compiler doesn't support __attribute__((malloc))."
9930 echo "Your C compiler supports __attribute__((malloc))."
9934 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9938 *) val="$d_attribute_malloc" ;;
9940 set d_attribute_malloc
9944 : Look for GCC-style attribute nonnull
9945 case "$d_attribute_nonnull" in
9948 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9949 $cat >attrib.c <<'EOCP'
9951 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9953 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9954 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9955 echo "Your C compiler doesn't support __attribute__((nonnull))."
9958 echo "Your C compiler supports __attribute__((nonnull))."
9962 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9966 *) val="$d_attribute_nonnull" ;;
9968 set d_attribute_nonnull
9972 : Look for GCC-style attribute noreturn
9973 case "$d_attribute_noreturn" in
9976 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9977 $cat >attrib.c <<'EOCP'
9979 void fall_over_dead( void ) __attribute__((noreturn));
9981 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9982 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9983 echo "Your C compiler doesn't support __attribute__((noreturn))."
9986 echo "Your C compiler supports __attribute__((noreturn))."
9990 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9994 *) val="$d_attribute_noreturn" ;;
9996 set d_attribute_noreturn
10000 : Look for GCC-style attribute pure
10001 case "$d_attribute_pure" in
10004 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10005 $cat >attrib.c <<'EOCP'
10007 int square( int n ) __attribute__((pure));
10009 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10010 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10011 echo "Your C compiler doesn't support __attribute__((pure))."
10014 echo "Your C compiler supports __attribute__((pure))."
10018 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10022 *) val="$d_attribute_pure" ;;
10024 set d_attribute_pure
10028 : Look for GCC-style attribute unused
10029 case "$d_attribute_unused" in
10032 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10033 $cat >attrib.c <<'EOCP'
10035 int do_something( int dummy __attribute__((unused)), int n );
10037 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10038 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10039 echo "Your C compiler doesn't support __attribute__((unused))."
10042 echo "Your C compiler supports __attribute__((unused))."
10046 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10050 *) val="$d_attribute_unused" ;;
10052 set d_attribute_unused
10056 : Look for GCC-style attribute warn_unused_result
10057 case "$d_attribute_warn_unused_result" in
10060 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10061 $cat >attrib.c <<'EOCP'
10063 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10065 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10066 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10067 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10070 echo "Your C compiler supports __attribute__((warn_unused_result))."
10074 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10078 *) val="$d_attribute_warn_unused_result" ;;
10080 set d_attribute_warn_unused_result
10084 : see if bcmp exists
10088 : see if bcopy exists
10092 : see if this is a unistd.h system
10093 set unistd.h i_unistd
10096 : see if getpgrp exists
10097 set getpgrp d_getpgrp
10100 case "$d_getpgrp" in
10103 echo "Checking to see which flavor of getpgrp is in use..."
10105 #$i_unistd I_UNISTD
10106 #include <sys/types.h>
10108 # include <unistd.h>
10110 #$i_stdlib I_STDLIB
10112 #include <stdlib.h>
10116 if (getuid() == 0) {
10117 printf("(I see you are running Configure as super-user...)\n");
10120 #ifdef TRY_BSD_PGRP
10121 if (getpgrp(1) == 0)
10130 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10131 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10133 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10134 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10137 echo "I can't seem to compile and run the test program."
10139 xxx="a USG one, i.e. you use getpgrp()."
10141 # SVR4 systems can appear rather BSD-ish.
10142 case "$i_unistd" in
10144 xxx="a BSD one, i.e. you use getpgrp(pid)."
10148 xxx="probably a USG one, i.e. you use getpgrp()."
10153 echo "Assuming your getpgrp is $xxx" >&4
10162 : see if setpgrp exists
10163 set setpgrp d_setpgrp
10166 case "$d_setpgrp" in
10169 echo "Checking to see which flavor of setpgrp is in use..."
10171 #$i_unistd I_UNISTD
10172 #include <sys/types.h>
10174 # include <unistd.h>
10176 #$i_stdlib I_STDLIB
10178 #include <stdlib.h>
10182 if (getuid() == 0) {
10183 printf("(I see you are running Configure as super-user...)\n");
10186 #ifdef TRY_BSD_PGRP
10187 if (-1 == setpgrp(1, 1))
10190 if (setpgrp() != -1)
10196 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10197 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10199 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10200 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10203 echo "(I can't seem to compile and run the test program.)"
10205 xxx="a USG one, i.e. you use setpgrp()."
10207 # SVR4 systems can appear rather BSD-ish.
10208 case "$i_unistd" in
10210 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10214 xxx="probably a USG one, i.e. you use setpgrp()."
10219 echo "Assuming your setpgrp is $xxx" >&4
10227 : see if bzero exists
10231 : see if signal is declared as pointer to function returning int or void
10233 xxx=`./findhdr signal.h`
10234 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10235 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10236 echo "You have int (*signal())() instead of void." >&4
10238 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10239 echo "You have void (*signal())()." >&4
10241 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10242 echo "You have int (*signal())() instead of void." >&4
10244 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10245 echo "You have void (*signal())()." >&4
10248 case "$d_voidsig" in
10250 echo "I can't determine whether signal handler returns void or int..." >&4
10252 rp="What type does your signal handler return?"
10255 v*) val="$define";;
10259 echo "As you already told me, signal handler returns void." >&4
10262 *) echo "As you already told me, signal handler returns int." >&4
10269 case "$d_voidsig" in
10270 "$define") signal_t="void";;
10271 *) signal_t="int";;
10275 : check for ability to cast large floats to 32-bit ints.
10277 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10278 if $test "$intsize" -ge 4; then
10285 #$i_stdlib I_STDLIB
10287 #include <stdlib.h>
10289 #include <sys/types.h>
10290 #include <signal.h>
10291 $signal_t blech(s) int s; { exit(3); }
10298 signal(SIGFPE, blech);
10300 /* Don't let compiler optimize the test away. Store the number
10301 in a writable string for gcc to pass to sscanf under HP/UX.
10303 sprintf(str, "2147483647");
10304 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10308 /* x86 processors will probably give 0x8000 0000, which is a
10309 sign change. We don't want that. We want to mimic SPARC
10310 behavior here, which is to preserve the sign and give
10313 if (i32 != ($xxx) f)
10319 if eval $compile_ok; then
10323 echo "(I can't seem to compile the test program--assuming it can't)"
10328 echo "Yup, it can."
10331 echo "Nope, it can't."
10338 : check for ability to cast negative floats to unsigned
10340 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10343 #$i_stdlib I_STDLIB
10345 #include <stdlib.h>
10347 #include <sys/types.h>
10348 #include <signal.h>
10349 $signal_t blech(s) int s; { exit(7); }
10350 $signal_t blech_in_list(s) int s; { exit(4); }
10351 unsigned long dummy_long(p) unsigned long p; { return p; }
10352 unsigned int dummy_int(p) unsigned int p; { return p; }
10353 unsigned short dummy_short(p) unsigned short p; { return p; }
10357 unsigned long along;
10359 unsigned short ashort;
10363 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10364 a direct f = -123. assignment. gcc-2.8.0 reportedly
10365 optimized the whole file away
10367 /* Store the number in a writable string for gcc to pass to
10368 sscanf under HP/UX.
10370 sprintf(str, "-123");
10371 sscanf(str, "%lf", &f); /* f = -123.; */
10373 signal(SIGFPE, blech);
10374 along = (unsigned long)f;
10375 aint = (unsigned int)f;
10376 ashort = (unsigned short)f;
10377 if (along != (unsigned long)-123)
10379 if (aint != (unsigned int)-123)
10381 if (ashort != (unsigned short)-123)
10383 sprintf(str, "1073741824.");
10384 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10387 along = (unsigned long)f;
10388 if (along != 0x80000000)
10392 along = (unsigned long)f;
10393 if (along != 0x7fffffff)
10397 along = (unsigned long)f;
10398 if (along != 0x80000001)
10402 signal(SIGFPE, blech_in_list);
10403 sprintf(str, "123.");
10404 sscanf(str, "%lf", &f); /* f = 123.; */
10405 along = dummy_long((unsigned long)f);
10406 aint = dummy_int((unsigned int)f);
10407 ashort = dummy_short((unsigned short)f);
10408 if (along != (unsigned long)123)
10410 if (aint != (unsigned int)123)
10412 if (ashort != (unsigned short)123)
10419 if eval $compile_ok; then
10423 echo "(I can't seem to compile the test program--assuming it can't)"
10426 case "$castflags" in
10428 echo "Yup, it can."
10431 echo "Nope, it can't."
10438 : see if vprintf exists
10440 if set vprintf val -f d_vprintf; eval $csym; $val; then
10441 echo 'vprintf() found.' >&4
10444 #include <varargs.h>
10445 #$i_stdlib I_STDLIB
10447 #include <stdlib.h>
10450 int main() { xxx("foo"); }
10459 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10463 if eval $compile && $run ./try; then
10464 echo "Your vsprintf() returns (int)." >&4
10467 echo "Your vsprintf() returns (char*)." >&4
10471 echo 'vprintf() NOT found.' >&4
10482 : see if chown exists
10486 : see if chroot exists
10487 set chroot d_chroot
10490 : see if chsize exists
10491 set chsize d_chsize
10494 : see if class exists
10498 hasstruct='varname=$1; struct=$2; shift; shift;
10499 while $test $# -ge 2; do
10501 $define) echo "#include <$2>";;
10505 echo "int main () { struct $struct foo; }" >> try.c;
10507 if eval $compile; then
10514 $rm -f try.c try.o'
10518 : see whether socket exists
10520 $echo $n "Hmm... $c" >&4
10521 if set socket val -f d_socket; eval $csym; $val; then
10522 echo "Looks like you have Berkeley networking support." >&4
10524 if set setsockopt val -f; eval $csym; $val; then
10527 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10528 d_oldsock="$define"
10531 if $contains socklib libc.list >/dev/null 2>&1; then
10532 echo "Looks like you have Berkeley networking support." >&4
10534 : we will have to assume that it supports the 4.2 BSD interface
10537 echo "You don't have Berkeley networking in libc$_a..." >&4
10538 if test "X$d_socket" = "X$define"; then
10539 echo "...but you seem to believe that you have sockets." >&4
10541 for net in net socket
10543 if test -f /usr/lib/lib$net$_a; then
10544 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10545 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10546 if $contains socket libc.list >/dev/null 2>&1; then
10551 echo "...but the Wollongong group seems to have hacked it in." >&4
10552 sockethdr="-I/usr/netinclude"
10555 echo "Found Berkeley sockets interface in lib$net." >&4
10556 if $contains setsockopt libc.list >/dev/null 2>&1; then
10559 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10560 d_oldsock="$define"
10566 if test "X$d_socket" != "X$define"; then
10567 echo "or anywhere else I see." >&4
10575 : see if socketpair exists
10576 set socketpair d_sockpair
10581 echo "Checking the availability of certain socket constants..." >&4
10582 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10583 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10585 #include <sys/types.h>
10586 #include <sys/socket.h>
10592 set try; if eval $compile; then
10595 set d_${enum}; eval $setvar
10599 : see if this is a sys/uio.h system
10600 set sys/uio.h i_sysuio
10605 echo "Checking to see if your system supports struct cmsghdr..." >&4
10606 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10608 case "$d_cmsghdr_s" in
10609 "$define") echo "Yes, it does." ;;
10610 *) echo "No, it doesn't." ;;
10614 : check for const keyword
10616 echo 'Checking to see if your C compiler knows about "const"...' >&4
10617 $cat >const.c <<'EOCP'
10618 typedef struct spug { int drokk; } spug;
10625 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10627 echo "Yup, it does."
10630 echo "Nope, it doesn't."
10635 : see if copysignl exists
10636 set copysignl d_copysignl
10639 : see if crypt exists
10644 $define) cryptlib='' ;;
10645 *) if set crypt val -f d_crypt; eval $csym; $val; then
10646 echo 'crypt() found.' >&4
10650 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10651 if $test -z "$cryptlib"; then
10652 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10656 if $test -z "$cryptlib"; then
10657 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10661 if $test -z "$cryptlib"; then
10662 cryptlib=`./loc libcrypt$_a "" $libpth`
10666 if $test -z "$cryptlib"; then
10667 echo 'crypt() NOT found.' >&4
10678 : see if this is a crypt.h system
10679 set crypt.h i_crypt
10682 : see if crypt_r exists
10683 set crypt_r d_crypt_r
10685 case "$d_crypt_r" in
10687 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10688 case "$d_crypt_r_proto:$usethreads" in
10689 ":define") d_crypt_r_proto=define
10690 set d_crypt_r_proto crypt_r $hdrs
10694 case "$d_crypt_r_proto" in
10696 case "$crypt_r_proto" in
10697 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10698 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10700 case "$crypt_r_proto" in
10701 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10702 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10704 case "$crypt_r_proto" in
10705 ''|0) d_crypt_r=undef
10707 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10708 * ) case "$crypt_r_proto" in
10709 REENTRANT_PROTO*) ;;
10710 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10712 echo "Prototype: $try" ;;
10715 *) case "$usethreads" in
10716 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10727 : get csh whereabouts
10729 'csh') val="$undef" ;;
10730 *) val="$define" ;;
10734 : Respect a hint or command line value for full_csh.
10735 case "$full_csh" in
10736 '') full_csh=$csh ;;
10739 : see if ctermid_r exists
10740 set ctermid_r d_ctermid_r
10742 case "$d_ctermid_r" in
10744 hdrs="$i_systypes sys/types.h define stdio.h "
10745 case "$d_ctermid_r_proto:$usethreads" in
10746 ":define") d_ctermid_r_proto=define
10747 set d_ctermid_r_proto ctermid_r $hdrs
10751 case "$d_ctermid_r_proto" in
10753 case "$ctermid_r_proto" in
10754 ''|0) try='char* ctermid_r(char*);'
10755 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10757 case "$ctermid_r_proto" in
10758 ''|0) d_ctermid_r=undef
10760 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10761 * ) case "$ctermid_r_proto" in
10762 REENTRANT_PROTO*) ;;
10763 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10765 echo "Prototype: $try" ;;
10768 *) case "$usethreads" in
10769 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10776 *) ctermid_r_proto=0
10780 : see if ctime_r exists
10781 set ctime_r d_ctime_r
10783 case "$d_ctime_r" in
10785 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10786 case "$d_ctime_r_proto:$usethreads" in
10787 ":define") d_ctime_r_proto=define
10788 set d_ctime_r_proto ctime_r $hdrs
10792 case "$d_ctime_r_proto" in
10794 case "$ctime_r_proto" in
10795 ''|0) try='char* ctime_r(const time_t*, char*);'
10796 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10798 case "$ctime_r_proto" in
10799 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10800 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10802 case "$ctime_r_proto" in
10803 ''|0) try='int ctime_r(const time_t*, char*);'
10804 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10806 case "$ctime_r_proto" in
10807 ''|0) try='int ctime_r(const time_t*, char*, int);'
10808 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10810 case "$ctime_r_proto" in
10811 ''|0) d_ctime_r=undef
10813 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10814 * ) case "$ctime_r_proto" in
10815 REENTRANT_PROTO*) ;;
10816 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10818 echo "Prototype: $try" ;;
10821 *) case "$usethreads" in
10822 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10833 : see if cuserid exists
10834 set cuserid d_cuserid
10837 : see if this is a limits.h system
10838 set limits.h i_limits
10841 : see if this is a float.h system
10842 set float.h i_float
10845 : See if number of significant digits in a double precision number is known
10847 $cat >dbl_dig.c <<EOM
10848 #$i_limits I_LIMITS
10851 #include <limits.h>
10857 printf("Contains DBL_DIG");
10860 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10861 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10862 echo "DBL_DIG found." >&4
10865 echo "DBL_DIG NOT found." >&4
10872 : see if dbm.h is available
10873 : see if dbmclose exists
10874 set dbmclose d_dbmclose
10877 case "$d_dbmclose" in
10887 *) set rpcsvc/dbm.h i_rpcsvcdbm
10892 *) echo "We won't be including <dbm.h>"
10902 : see if prototype for dbminit is available
10904 set d_dbminitproto dbminit $i_dbm dbm.h
10907 : see if difftime exists
10908 set difftime d_difftime
10911 : see if this is a dirent system
10913 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10915 echo "<dirent.h> found." >&4
10918 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10919 echo "<sys/dir.h> found." >&4
10922 xinc=`./findhdr sys/ndir.h`
10924 echo "<dirent.h> NOT found." >&4
10929 : Look for type of directory structure.
10931 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10933 case "$direntrytype" in
10935 case "$i_dirent" in
10936 $define) guess1='struct dirent' ;;
10937 *) guess1='struct direct' ;;
10940 *) guess1="$direntrytype"
10945 'struct dirent') guess2='struct direct' ;;
10946 *) guess2='struct dirent' ;;
10949 if $contains "$guess1" try.c >/dev/null 2>&1; then
10950 direntrytype="$guess1"
10951 echo "Your directory entries are $direntrytype." >&4
10952 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10953 direntrytype="$guess2"
10954 echo "Your directory entries seem to be $direntrytype." >&4
10956 echo "I don't recognize your system's directory entries." >&4
10957 rp="What type is used for directory entries on this system?"
10960 direntrytype="$ans"
10965 : see if the directory entry stores field length
10967 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10968 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10969 echo "Good, your directory entry keeps length information in d_namlen." >&4
10972 echo "Your directory entry does not know about the d_namlen field." >&4
10979 : see if this is an sysdir system
10980 set sys/dir.h i_sysdir
10983 : see if this is an sysndir system
10984 set sys/ndir.h i_sysndir
10989 $cat >dirfd.c <<EOM
10991 #$i_stdlib I_STDLIB
10993 #include <stdlib.h>
10995 #$i_dirent I_DIRENT /**/
10996 #$i_sysdir I_SYS_DIR /**/
10997 #$i_sysndir I_SYS_NDIR /**/
10998 #$i_systypes I_SYS_TYPES /**/
10999 #if defined(I_SYS_TYPES)
11000 #include <sys/types.h>
11002 #if defined(I_DIRENT)
11003 #include <dirent.h>
11004 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11005 #include <sys/dir.h>
11009 #include <sys/ndir.h>
11013 #include <ndir.h> /* may be wrong in the future */
11015 #include <sys/dir.h>
11021 DIR *dirp = opendir(".");
11022 if (dirfd(dirp) >= 0)
11029 if eval $compile; then
11033 $define) echo "dirfd() found." >&4 ;;
11034 *) echo "dirfd() NOT found." >&4 ;;
11040 : see if dlerror exists
11043 set dlerror d_dlerror
11047 : see if dlfcn is available
11048 set dlfcn.h i_dlfcn
11055 On a few systems, the dynamically loaded modules that perl generates and uses
11056 will need a different extension than shared libs. The default will probably
11062 *) dflt="$dlext" ;;
11064 rp='What is the extension of dynamically loaded modules'
11073 : Check if dlsym need a leading underscore
11079 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11080 $cat >dyna.c <<'EOM'
11087 #$i_stdlib I_STDLIB
11089 #include <stdlib.h>
11093 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11095 #include <sys/types.h>
11100 extern int fred() ;
11109 int mode = RTLD_LAZY ;
11111 handle = dlopen("./dyna.$dlext", mode) ;
11112 if (handle == NULL) {
11117 symbol = dlsym(handle, "fred") ;
11118 if (symbol == NULL) {
11119 /* try putting a leading underscore */
11120 symbol = dlsym(handle, "_fred") ;
11121 if (symbol == NULL) {
11134 : Call the object file tmp-dyna.o in case dlext=o.
11135 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11136 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11137 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11138 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11141 1) echo "Test program failed using dlopen." >&4
11142 echo "Perhaps you should not use dynamic loading." >&4;;
11143 2) echo "Test program failed using dlsym." >&4
11144 echo "Perhaps you should not use dynamic loading." >&4;;
11145 3) echo "dlsym needs a leading underscore" >&4
11147 4) echo "dlsym doesn't need a leading underscore." >&4;;
11150 echo "I can't compile and run the test program." >&4
11151 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11156 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11161 : see if drand48_r exists
11162 set drand48_r d_drand48_r
11164 case "$d_drand48_r" in
11166 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11167 case "$d_drand48_r_proto:$usethreads" in
11168 ":define") d_drand48_r_proto=define
11169 set d_drand48_r_proto drand48_r $hdrs
11173 case "$d_drand48_r_proto" in
11175 case "$drand48_r_proto" in
11176 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11177 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11179 case "$drand48_r_proto" in
11180 ''|0) d_drand48_r=undef
11182 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11183 * ) case "$drand48_r_proto" in
11184 REENTRANT_PROTO*) ;;
11185 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11187 echo "Prototype: $try" ;;
11190 *) case "$usethreads" in
11191 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11198 *) drand48_r_proto=0
11202 : see if prototype for drand48 is available
11204 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11207 : see if dup2 exists
11211 : see if eaccess exists
11212 set eaccess d_eaccess
11215 : see if endgrent exists
11216 set endgrent d_endgrent
11219 : see if this is an grp system
11225 xxx=`./findhdr grp.h`
11226 $cppstdin $cppflags $cppminus < $xxx >$$.h
11228 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11240 set d_grpasswd; eval $setvar
11244 : see if endgrent_r exists
11245 set endgrent_r d_endgrent_r
11247 case "$d_endgrent_r" in
11249 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11250 case "$d_endgrent_r_proto:$usethreads" in
11251 ":define") d_endgrent_r_proto=define
11252 set d_endgrent_r_proto endgrent_r $hdrs
11256 case "$d_endgrent_r_proto" in
11258 case "$endgrent_r_proto" in
11259 ''|0) try='int endgrent_r(FILE**);'
11260 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11262 case "$endgrent_r_proto" in
11263 ''|0) try='void endgrent_r(FILE**);'
11264 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11266 case "$endgrent_r_proto" in
11267 ''|0) d_endgrent_r=undef
11269 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11270 * ) case "$endgrent_r_proto" in
11271 REENTRANT_PROTO*) ;;
11272 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11274 echo "Prototype: $try" ;;
11277 *) case "$usethreads" in
11278 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11285 *) endgrent_r_proto=0
11289 : see if endhostent exists
11290 set endhostent d_endhent
11293 : see if this is a netdb.h system
11294 set netdb.h i_netdb
11297 : see if endhostent_r exists
11298 set endhostent_r d_endhostent_r
11300 case "$d_endhostent_r" in
11302 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11303 case "$d_endhostent_r_proto:$usethreads" in
11304 ":define") d_endhostent_r_proto=define
11305 set d_endhostent_r_proto endhostent_r $hdrs
11309 case "$d_endhostent_r_proto" in
11311 case "$endhostent_r_proto" in
11312 ''|0) try='int endhostent_r(struct hostent_data*);'
11313 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11315 case "$endhostent_r_proto" in
11316 ''|0) try='void endhostent_r(struct hostent_data*);'
11317 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11319 case "$endhostent_r_proto" in
11320 ''|0) d_endhostent_r=undef
11321 endhostent_r_proto=0
11322 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11323 * ) case "$endhostent_r_proto" in
11324 REENTRANT_PROTO*) ;;
11325 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11327 echo "Prototype: $try" ;;
11330 *) case "$usethreads" in
11331 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11333 d_endhostent_r=undef
11334 endhostent_r_proto=0
11338 *) endhostent_r_proto=0
11342 : see if endnetent exists
11343 set endnetent d_endnent
11346 : see if endnetent_r exists
11347 set endnetent_r d_endnetent_r
11349 case "$d_endnetent_r" in
11351 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11352 case "$d_endnetent_r_proto:$usethreads" in
11353 ":define") d_endnetent_r_proto=define
11354 set d_endnetent_r_proto endnetent_r $hdrs
11358 case "$d_endnetent_r_proto" in
11360 case "$endnetent_r_proto" in
11361 ''|0) try='int endnetent_r(struct netent_data*);'
11362 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11364 case "$endnetent_r_proto" in
11365 ''|0) try='void endnetent_r(struct netent_data*);'
11366 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11368 case "$endnetent_r_proto" in
11369 ''|0) d_endnetent_r=undef
11370 endnetent_r_proto=0
11371 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11372 * ) case "$endnetent_r_proto" in
11373 REENTRANT_PROTO*) ;;
11374 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11376 echo "Prototype: $try" ;;
11379 *) case "$usethreads" in
11380 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11382 d_endnetent_r=undef
11383 endnetent_r_proto=0
11387 *) endnetent_r_proto=0
11391 : see if endprotoent exists
11392 set endprotoent d_endpent
11395 : see if endprotoent_r exists
11396 set endprotoent_r d_endprotoent_r
11398 case "$d_endprotoent_r" in
11400 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11401 case "$d_endprotoent_r_proto:$usethreads" in
11402 ":define") d_endprotoent_r_proto=define
11403 set d_endprotoent_r_proto endprotoent_r $hdrs
11407 case "$d_endprotoent_r_proto" in
11409 case "$endprotoent_r_proto" in
11410 ''|0) try='int endprotoent_r(struct protoent_data*);'
11411 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11413 case "$endprotoent_r_proto" in
11414 ''|0) try='void endprotoent_r(struct protoent_data*);'
11415 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11417 case "$endprotoent_r_proto" in
11418 ''|0) d_endprotoent_r=undef
11419 endprotoent_r_proto=0
11420 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11421 * ) case "$endprotoent_r_proto" in
11422 REENTRANT_PROTO*) ;;
11423 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11425 echo "Prototype: $try" ;;
11428 *) case "$usethreads" in
11429 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11431 d_endprotoent_r=undef
11432 endprotoent_r_proto=0
11436 *) endprotoent_r_proto=0
11440 : see if endpwent exists
11441 set endpwent d_endpwent
11444 : see if this is a pwd.h system
11450 xxx=`./findhdr pwd.h`
11451 $cppstdin $cppflags $cppminus < $xxx >$$.h
11453 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11461 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11469 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11477 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11485 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11493 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11501 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11509 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11521 set d_pwquota; eval $setvar
11522 set d_pwage; eval $setvar
11523 set d_pwchange; eval $setvar
11524 set d_pwclass; eval $setvar
11525 set d_pwexpire; eval $setvar
11526 set d_pwcomment; eval $setvar
11527 set d_pwgecos; eval $setvar
11528 set d_pwpasswd; eval $setvar
11532 : see if endpwent_r exists
11533 set endpwent_r d_endpwent_r
11535 case "$d_endpwent_r" in
11537 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11538 case "$d_endpwent_r_proto:$usethreads" in
11539 ":define") d_endpwent_r_proto=define
11540 set d_endpwent_r_proto endpwent_r $hdrs
11544 case "$d_endpwent_r_proto" in
11546 case "$endpwent_r_proto" in
11547 ''|0) try='int endpwent_r(FILE**);'
11548 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11550 case "$endpwent_r_proto" in
11551 ''|0) try='void endpwent_r(FILE**);'
11552 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11554 case "$endpwent_r_proto" in
11555 ''|0) d_endpwent_r=undef
11557 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11558 * ) case "$endpwent_r_proto" in
11559 REENTRANT_PROTO*) ;;
11560 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11562 echo "Prototype: $try" ;;
11565 *) case "$usethreads" in
11566 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11573 *) endpwent_r_proto=0
11577 : see if endservent exists
11578 set endservent d_endsent
11581 : see if endservent_r exists
11582 set endservent_r d_endservent_r
11584 case "$d_endservent_r" in
11586 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11587 case "$d_endservent_r_proto:$usethreads" in
11588 ":define") d_endservent_r_proto=define
11589 set d_endservent_r_proto endservent_r $hdrs
11593 case "$d_endservent_r_proto" in
11595 case "$endservent_r_proto" in
11596 ''|0) try='int endservent_r(struct servent_data*);'
11597 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11599 case "$endservent_r_proto" in
11600 ''|0) try='void endservent_r(struct servent_data*);'
11601 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11603 case "$endservent_r_proto" in
11604 ''|0) d_endservent_r=undef
11605 endservent_r_proto=0
11606 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11607 * ) case "$endservent_r_proto" in
11608 REENTRANT_PROTO*) ;;
11609 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11611 echo "Prototype: $try" ;;
11614 *) case "$usethreads" in
11615 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11617 d_endservent_r=undef
11618 endservent_r_proto=0
11622 *) endservent_r_proto=0
11626 : Locate the flags for 'open()'
11629 #include <sys/types.h>
11634 #include <sys/file.h>
11636 #$i_stdlib I_STDLIB
11638 #include <stdlib.h>
11649 : check sys/file.h first to get FREAD on Sun
11650 if $test `./findhdr sys/file.h` && \
11651 set try -DI_SYS_FILE && eval $compile; then
11653 echo "<sys/file.h> defines the O_* constants..." >&4
11654 if $run ./try; then
11655 echo "and you have the 3 argument form of open()." >&4
11658 echo "but not the 3 argument form of open(). Oh, well." >&4
11661 elif $test `./findhdr fcntl.h` && \
11662 set try -DI_FCNTL && eval $compile; then
11664 echo "<fcntl.h> defines the O_* constants..." >&4
11665 if $run ./try; then
11666 echo "and you have the 3 argument form of open()." >&4
11669 echo "but not the 3 argument form of open(). Oh, well." >&4
11674 echo "I can't find the O_* constant definitions! You got problems." >&4
11680 : see which of string.h or strings.h is needed
11682 strings=`./findhdr string.h`
11683 if $test "$strings" && $test -r "$strings"; then
11684 echo "Using <string.h> instead of <strings.h>." >&4
11688 strings=`./findhdr strings.h`
11689 if $test "$strings" && $test -r "$strings"; then
11690 echo "Using <strings.h> instead of <string.h>." >&4
11692 echo "No string header found -- You'll surely have problems." >&4
11697 case "$i_string" in
11698 "$undef") strings=`./findhdr strings.h`;;
11699 *) strings=`./findhdr string.h`;;
11702 : see if this is a sys/file.h system
11707 : do we need to include sys/file.h ?
11711 if $h_sysfile; then
11713 echo "We'll be including <sys/file.h>." >&4
11716 echo "We won't be including <sys/file.h>." >&4
11726 : see if fcntl.h is there
11731 : see if we can include fcntl.h
11737 echo "We'll be including <fcntl.h>." >&4
11740 if $h_sysfile; then
11741 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11743 echo "We won't be including <fcntl.h>." >&4
11755 : check for non-blocking I/O stuff
11756 case "$h_sysfile" in
11757 true) echo "#include <sys/file.h>" > head.c;;
11760 true) echo "#include <fcntl.h>" > head.c;;
11761 *) echo "#include <sys/fcntl.h>" > head.c;;
11766 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11767 case "$o_nonblock" in
11769 $cat head.c > try.c
11770 $cat >>try.c <<EOCP
11772 #$i_stdlib I_STDLIB
11774 #include <stdlib.h>
11782 printf("O_NONBLOCK\n");
11786 printf("O_NDELAY\n");
11790 printf("FNDELAY\n");
11797 if eval $compile_ok; then
11798 o_nonblock=`$run ./try`
11799 case "$o_nonblock" in
11800 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11801 *) echo "Seems like we can use $o_nonblock.";;
11804 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11807 *) echo "Using $hint value $o_nonblock.";;
11809 $rm -f try try.* .out core
11812 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11815 $cat head.c > try.c
11816 $cat >>try.c <<EOCP
11818 #include <sys/types.h>
11819 #include <signal.h>
11821 #$i_stdlib I_STDLIB
11823 #include <stdlib.h>
11829 #define MY_O_NONBLOCK $o_nonblock
11830 #ifndef errno /* XXX need better Configure test */
11833 #$i_unistd I_UNISTD
11835 #include <unistd.h>
11837 #$i_string I_STRING
11839 #include <string.h>
11841 #include <strings.h>
11843 $signal_t blech(x) int x; { exit(3); }
11845 $cat >> try.c <<'EOCP'
11853 pipe(pd); /* Down: child -> parent */
11854 pipe(pu); /* Up: parent -> child */
11857 close(pd[1]); /* Parent reads from pd[0] */
11858 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11860 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11865 signal(SIGALRM, blech);
11867 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11869 sprintf(string, "%d\n", ret);
11870 write(2, string, strlen(string));
11873 if (errno == EAGAIN) {
11874 printf("EAGAIN\n");
11879 if (errno == EWOULDBLOCK)
11880 printf("EWOULDBLOCK\n");
11883 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11884 sleep(2); /* Give it time to close our pipe */
11886 ret = read(pd[0], buf, 1); /* Should read EOF */
11888 sprintf(string, "%d\n", ret);
11889 write(4, string, strlen(string));
11893 close(pd[0]); /* We write to pd[1] */
11894 close(pu[1]); /* We read from pu[0] */
11895 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11896 close(pd[1]); /* Pipe pd is now fully closed! */
11897 exit(0); /* Bye bye, thank you for playing! */
11901 if eval $compile_ok; then
11902 echo "$startsh" >mtry
11903 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11905 ./mtry >/dev/null 2>&1
11907 0) eagain=`$cat try.out`;;
11908 1) echo "Could not perform non-blocking setting!";;
11909 2) echo "I did a successful read() for something that was not there!";;
11910 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11911 4) echo "Could not find F_SETFL!";;
11912 *) echo "Something terribly wrong happened during testing.";;
11914 rd_nodata=`$cat try.ret`
11915 echo "A read() system call with no data present returns $rd_nodata."
11916 case "$rd_nodata" in
11919 echo "(That's peculiar, fixing that to be -1.)"
11925 echo "Forcing errno EAGAIN on read() with no data available."
11929 echo "Your read() sets errno to $eagain when no data is available."
11932 status=`$cat try.err`
11934 0) echo "And it correctly returns 0 to signal EOF.";;
11935 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11936 *) echo "However, your read() returns '$status' on EOF??";;
11939 if test "$status" = "$rd_nodata"; then
11940 echo "WARNING: you can't distinguish between EOF and no data!"
11944 echo "I can't compile the test program--assuming errno EAGAIN will do."
11951 echo "Using $hint value $eagain."
11952 echo "Your read() returns $rd_nodata when no data is present."
11953 case "$d_eofnblk" in
11954 "$define") echo "And you can see EOF because read() returns 0.";;
11955 "$undef") echo "But you can't see EOF status from read() returned value.";;
11957 echo "(Assuming you can't see EOF status from read anyway.)"
11963 $rm -f try try.* .out core head.c mtry
11965 : see if _ptr and _cnt from stdio act std
11968 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11969 echo "(Looks like you have stdio.h from BSD.)"
11970 case "$stdio_ptr" in
11971 '') stdio_ptr='((fp)->_p)'
11974 *) ptr_lval=$d_stdio_ptr_lval;;
11976 case "$stdio_cnt" in
11977 '') stdio_cnt='((fp)->_r)'
11980 *) cnt_lval=$d_stdio_cnt_lval;;
11982 case "$stdio_base" in
11983 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11985 case "$stdio_bufsiz" in
11986 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11988 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11989 echo "(Looks like you have stdio.h from Linux.)"
11990 case "$stdio_ptr" in
11991 '') stdio_ptr='((fp)->_IO_read_ptr)'
11994 *) ptr_lval=$d_stdio_ptr_lval;;
11996 case "$stdio_cnt" in
11997 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12000 *) cnt_lval=$d_stdio_cnt_lval;;
12002 case "$stdio_base" in
12003 '') stdio_base='((fp)->_IO_read_base)';;
12005 case "$stdio_bufsiz" in
12006 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12009 case "$stdio_ptr" in
12010 '') stdio_ptr='((fp)->_ptr)'
12013 *) ptr_lval=$d_stdio_ptr_lval;;
12015 case "$stdio_cnt" in
12016 '') stdio_cnt='((fp)->_cnt)'
12019 *) cnt_lval=$d_stdio_cnt_lval;;
12021 case "$stdio_base" in
12022 '') stdio_base='((fp)->_base)';;
12024 case "$stdio_bufsiz" in
12025 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12029 : test whether _ptr and _cnt really work
12030 echo "Checking how std your stdio is..." >&4
12033 #$i_stdlib I_STDLIB
12035 #include <stdlib.h>
12037 #define FILE_ptr(fp) $stdio_ptr
12038 #define FILE_cnt(fp) $stdio_cnt
12040 FILE *fp = fopen("try.c", "r");
12043 18 <= FILE_cnt(fp) &&
12044 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12052 if eval $compile && $to try.c; then
12053 if $run ./try; then
12054 echo "Your stdio acts pretty std."
12057 echo "Your stdio isn't very std."
12060 echo "Your stdio doesn't appear very std."
12064 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12065 # direct buffer manipulation no longer works. The Configure tests
12066 # should be changed to correctly detect this, but until then,
12067 # the following check should at least let perl compile and run.
12068 # (This quick fix should be updated before 5.8.1.)
12069 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12070 # A. Dougherty, June 3, 2002.
12071 case "$d_gnulibc" in
12073 case "$gnulibc_version" in
12077 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12086 : Can _ptr be used as an lvalue?
12087 case "$d_stdstdio$ptr_lval" in
12088 $define$define) val=$define ;;
12091 set d_stdio_ptr_lval
12094 : Can _cnt be used as an lvalue?
12095 case "$d_stdstdio$cnt_lval" in
12096 $define$define) val=$define ;;
12099 set d_stdio_cnt_lval
12103 : test whether setting _ptr sets _cnt as a side effect
12104 d_stdio_ptr_lval_sets_cnt="$undef"
12105 d_stdio_ptr_lval_nochange_cnt="$undef"
12106 case "$d_stdio_ptr_lval$d_stdstdio" in
12108 echo "Checking to see what happens if we set the stdio ptr..." >&4
12111 /* Can we scream? */
12112 /* Eat dust sed :-) */
12113 /* In the buffer space, no one can hear you scream. */
12114 #$i_stdlib I_STDLIB
12116 #include <stdlib.h>
12118 #define FILE_ptr(fp) $stdio_ptr
12119 #define FILE_cnt(fp) $stdio_cnt
12120 #include <sys/types.h>
12122 FILE *fp = fopen("try.c", "r");
12127 puts("Fail even to read");
12130 c = getc(fp); /* Read away the first # */
12132 puts("Fail even to read");
12136 18 <= FILE_cnt(fp) &&
12137 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12139 puts("Fail even to read");
12142 ptr = (char*) FILE_ptr(fp);
12143 cnt = (size_t)FILE_cnt(fp);
12145 FILE_ptr(fp) += 42;
12147 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12148 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12151 if (FILE_cnt(fp) <= 20) {
12152 printf ("Fail (<20 chars to test)");
12155 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12156 puts("Fail compare");
12159 if (cnt == FILE_cnt(fp)) {
12160 puts("Pass_unchanged");
12163 if (FILE_cnt(fp) == (cnt - 42)) {
12164 puts("Pass_changed");
12167 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12173 if eval $compile && $to try.c; then
12174 case `$run ./try` in
12176 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12177 d_stdio_ptr_lval_sets_cnt="$define" ;;
12179 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12180 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12182 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12184 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12187 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12193 : see if _base is also standard
12195 case "$d_stdstdio" in
12199 #$i_stdlib I_STDLIB
12201 #include <stdlib.h>
12203 #define FILE_base(fp) $stdio_base
12204 #define FILE_bufsiz(fp) $stdio_bufsiz
12206 FILE *fp = fopen("try.c", "r");
12209 19 <= FILE_bufsiz(fp) &&
12210 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12217 if eval $compile && $to try.c; then
12218 if $run ./try; then
12219 echo "And its _base field acts std."
12222 echo "But its _base field isn't std."
12225 echo "However, it seems to be lacking the _base field."
12233 : see if fast_stdio exists
12235 case "$d_stdstdio:$d_stdio_ptr_lval" in
12237 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12239 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12250 : see if fchdir exists
12251 set fchdir d_fchdir
12254 : see if fchmod exists
12255 set fchmod d_fchmod
12258 : see if fchown exists
12259 set fchown d_fchown
12262 : see if this is an fcntl system
12267 : See if fcntl-based locking works.
12269 #$i_stdlib I_STDLIB
12271 #include <stdlib.h>
12273 #include <unistd.h>
12275 #include <signal.h>
12276 $signal_t blech(x) int x; { exit(3); }
12278 #if defined(F_SETLK) && defined(F_SETLKW)
12279 struct flock flock;
12281 fd = open("try.c", O_RDONLY);
12282 flock.l_type = F_RDLCK;
12283 flock.l_whence = SEEK_SET;
12284 flock.l_start = flock.l_len = 0;
12285 signal(SIGALRM, blech);
12287 retval = fcntl(fd, F_SETLK, &flock);
12289 (retval < 0 ? exit(2) : exit(0));
12295 echo "Checking if fcntl-based file locking works... "
12299 if eval $compile_ok; then
12300 if $run ./try; then
12301 echo "Yes, it seems to work."
12304 echo "Nope, it didn't work."
12309 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12310 *** This is (almost) impossible.
12311 *** If your NFS lock daemons are not feeling well, something like
12312 *** this may happen, please investigate. Cannot continue, aborting.
12320 echo "I'm unable to compile the test program, so I'll assume not."
12325 echo "Nope, since you don't even have fcntl()."
12328 set d_fcntl_can_lock
12333 : check for fd_set items
12336 Checking to see how well your C compiler handles fd_set and friends ...
12339 #$i_stdlib I_STDLIB
12341 #include <stdlib.h>
12343 #$i_systime I_SYS_TIME
12344 #$i_sysselct I_SYS_SELECT
12345 #$d_socket HAS_SOCKET
12346 #include <sys/types.h>
12348 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12351 #include <sys/time.h>
12353 #ifdef I_SYS_SELECT
12354 #include <sys/select.h>
12363 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12371 if eval $compile; then
12372 d_fds_bits="$define"
12374 echo "Well, your system knows about the normal fd_set typedef..." >&4
12375 if $run ./try; then
12376 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12377 d_fd_macros="$define"
12380 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12382 d_fd_macros="$undef"
12386 Hmm, your compiler has some difficulty with fd_set. Checking further...
12389 if eval $compile; then
12390 d_fds_bits="$undef"
12392 echo "Well, your system has some sort of fd_set available..." >&4
12393 if $run ./try; then
12394 echo "and you have the normal fd_set macros." >&4
12395 d_fd_macros="$define"
12398 but not the normal fd_set macros! Gross! More work for me...
12400 d_fd_macros="$undef"
12403 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12405 d_fds_bits="$undef"
12406 d_fd_macros="$undef"
12411 : see if fgetpos exists
12412 set fgetpos d_fgetpos
12415 : see if finite exists
12416 set finite d_finite
12419 : see if finitel exists
12420 set finitel d_finitel
12423 : see if flock exists
12427 : see if prototype for flock is available
12429 set d_flockproto flock $i_sysfile sys/file.h
12432 : see if fork exists
12436 : see if fp_class exists
12437 set fp_class d_fp_class
12440 : see if pathconf exists
12441 set pathconf d_pathconf
12444 : see if fpathconf exists
12445 set fpathconf d_fpathconf
12448 : see if fpclass exists
12449 set fpclass d_fpclass
12452 : see if fpclassify exists
12453 set fpclassify d_fpclassify
12456 : see if fpclassl exists
12457 set fpclassl d_fpclassl
12461 : check for fpos64_t
12463 echo "Checking to see if you have fpos64_t..." >&4
12466 int main() { fpos64_t x = 7; }
12469 if eval $compile; then
12471 echo "You have fpos64_t."
12474 echo "You do not have fpos64_t."
12475 case "$fpossize" in
12476 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12483 : see if frexpl exists
12484 set frexpl d_frexpl
12487 : see if this is a sys/param system
12488 set sys/param.h i_sysparam
12491 : see if this is a sys/mount.h system
12492 set sys/mount.h i_sysmount
12497 echo "Checking to see if your system supports struct fs_data..." >&4
12498 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12500 case "$d_fs_data_s" in
12501 "$define") echo "Yes, it does." ;;
12502 *) echo "No, it doesn't." ;;
12505 : see if fseeko exists
12506 set fseeko d_fseeko
12508 case "$longsize" in
12509 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12512 : see if fsetpos exists
12513 set fsetpos d_fsetpos
12517 : see if fstatfs exists
12518 set fstatfs d_fstatfs
12522 : see if statvfs exists
12523 set statvfs d_statvfs
12526 : see if fstatvfs exists
12527 set fstatvfs d_fstatvfs
12531 : see if fsync exists
12535 : see if ftello exists
12536 set ftello d_ftello
12538 case "$longsize" in
12539 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12542 : see if getcwd exists
12543 set getcwd d_getcwd
12546 : see if getespwnam exists
12547 set getespwnam d_getespwnam
12551 : see if getfsstat exists
12552 set getfsstat d_getfsstat
12555 : see if getgrent exists
12556 set getgrent d_getgrent
12559 : see if getgrent_r exists
12560 set getgrent_r d_getgrent_r
12562 case "$d_getgrent_r" in
12564 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12565 case "$d_getgrent_r_proto:$usethreads" in
12566 ":define") d_getgrent_r_proto=define
12567 set d_getgrent_r_proto getgrent_r $hdrs
12571 case "$d_getgrent_r_proto" in
12573 case "$getgrent_r_proto" in
12574 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12575 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12577 case "$getgrent_r_proto" in
12578 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12579 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12581 case "$getgrent_r_proto" in
12582 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12583 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12585 case "$getgrent_r_proto" in
12586 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12587 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12589 case "$getgrent_r_proto" in
12590 ''|0) try='int getgrent_r(struct group*, char*, int);'
12591 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12593 case "$getgrent_r_proto" in
12594 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12595 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12597 case "$getgrent_r_proto" in
12598 ''|0) d_getgrent_r=undef
12600 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12601 * ) case "$getgrent_r_proto" in
12602 REENTRANT_PROTO*) ;;
12603 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12605 echo "Prototype: $try" ;;
12608 *) case "$usethreads" in
12609 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12616 *) getgrent_r_proto=0
12620 : see if getgrgid_r exists
12621 set getgrgid_r d_getgrgid_r
12623 case "$d_getgrgid_r" in
12625 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12626 case "$d_getgrgid_r_proto:$usethreads" in
12627 ":define") d_getgrgid_r_proto=define
12628 set d_getgrgid_r_proto getgrgid_r $hdrs
12632 case "$d_getgrgid_r_proto" in
12634 case "$getgrgid_r_proto" in
12635 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12636 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12638 case "$getgrgid_r_proto" in
12639 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12640 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12642 case "$getgrgid_r_proto" in
12643 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12644 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12646 case "$getgrgid_r_proto" in
12647 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12648 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12650 case "$getgrgid_r_proto" in
12651 ''|0) d_getgrgid_r=undef
12653 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12654 * ) case "$getgrgid_r_proto" in
12655 REENTRANT_PROTO*) ;;
12656 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12658 echo "Prototype: $try" ;;
12661 *) case "$usethreads" in
12662 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12669 *) getgrgid_r_proto=0
12673 : see if getgrnam_r exists
12674 set getgrnam_r d_getgrnam_r
12676 case "$d_getgrnam_r" in
12678 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12679 case "$d_getgrnam_r_proto:$usethreads" in
12680 ":define") d_getgrnam_r_proto=define
12681 set d_getgrnam_r_proto getgrnam_r $hdrs
12685 case "$d_getgrnam_r_proto" in
12687 case "$getgrnam_r_proto" in
12688 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12689 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12691 case "$getgrnam_r_proto" in
12692 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12693 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12695 case "$getgrnam_r_proto" in
12696 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12697 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12699 case "$getgrnam_r_proto" in
12700 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12701 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12703 case "$getgrnam_r_proto" in
12704 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12705 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12707 case "$getgrnam_r_proto" in
12708 ''|0) d_getgrnam_r=undef
12710 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12711 * ) case "$getgrnam_r_proto" in
12712 REENTRANT_PROTO*) ;;
12713 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12715 echo "Prototype: $try" ;;
12718 *) case "$usethreads" in
12719 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12726 *) getgrnam_r_proto=0
12730 : see if gethostbyaddr exists
12731 set gethostbyaddr d_gethbyaddr
12734 : see if gethostbyname exists
12735 set gethostbyname d_gethbyname
12738 : see if gethostent exists
12739 set gethostent d_gethent
12742 : see how we will look up host name
12745 if set gethostname val -f d_gethname; eval $csym; $val; then
12746 echo 'gethostname() found.' >&4
12747 d_gethname="$define"
12750 if set uname val -f d_uname; eval $csym; $val; then
12753 uname() was found, but you're running xenix, and older versions of xenix
12754 have a broken uname(). If you don't really know whether your xenix is old
12755 enough to have a broken system call, use the default answer.
12760 "$define") dflt=n;;
12762 rp='Is your uname() broken?'
12765 n*) d_uname="$define"; call=uname;;
12768 echo 'uname() found.' >&4
12775 case "$d_gethname" in
12776 '') d_gethname="$undef";;
12779 '') d_uname="$undef";;
12781 case "$d_uname$d_gethname" in
12786 Every now and then someone has a $call() that lies about the hostname
12787 but can't be fixed for political or economic reasons. If you wish, I can
12788 pretend $call() isn't there and maybe compute hostname at run-time
12789 thanks to the '$phostname' command.
12792 rp="Shall I ignore $call() from now on?"
12795 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12798 case "$phostname" in
12799 '') aphostname='';;
12800 *) case "$aphostname" in
12802 *) set X $phostname
12806 file=`./loc $file $file $pth`
12807 aphostname=`echo $file $*`
12812 case "$d_uname$d_gethname" in
12815 case "$phostname" in
12817 echo "There will be no way for $package to get your hostname." >&4;;
12819 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12823 case "$d_phostname" in
12824 '') d_phostname="$undef";;
12827 : see if gethostbyaddr_r exists
12828 set gethostbyaddr_r d_gethostbyaddr_r
12830 case "$d_gethostbyaddr_r" in
12832 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12833 case "$d_gethostbyaddr_r_proto:$usethreads" in
12834 ":define") d_gethostbyaddr_r_proto=define
12835 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12839 case "$d_gethostbyaddr_r_proto" in
12841 case "$gethostbyaddr_r_proto" in
12842 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12843 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12845 case "$gethostbyaddr_r_proto" in
12846 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12847 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12849 case "$gethostbyaddr_r_proto" in
12850 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12851 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12853 case "$gethostbyaddr_r_proto" in
12854 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12855 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12857 case "$gethostbyaddr_r_proto" in
12858 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12859 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12861 case "$gethostbyaddr_r_proto" in
12862 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12863 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12865 case "$gethostbyaddr_r_proto" in
12866 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12867 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12869 case "$gethostbyaddr_r_proto" in
12870 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12871 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12873 case "$gethostbyaddr_r_proto" in
12874 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12875 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12877 case "$gethostbyaddr_r_proto" in
12878 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12879 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12881 case "$gethostbyaddr_r_proto" in
12882 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12883 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12885 case "$gethostbyaddr_r_proto" in
12886 ''|0) d_gethostbyaddr_r=undef
12887 gethostbyaddr_r_proto=0
12888 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12889 * ) case "$gethostbyaddr_r_proto" in
12890 REENTRANT_PROTO*) ;;
12891 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12893 echo "Prototype: $try" ;;
12896 *) case "$usethreads" in
12897 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12899 d_gethostbyaddr_r=undef
12900 gethostbyaddr_r_proto=0
12904 *) gethostbyaddr_r_proto=0
12908 : see if gethostbyname_r exists
12909 set gethostbyname_r d_gethostbyname_r
12911 case "$d_gethostbyname_r" in
12913 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12914 case "$d_gethostbyname_r_proto:$usethreads" in
12915 ":define") d_gethostbyname_r_proto=define
12916 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12920 case "$d_gethostbyname_r_proto" in
12922 case "$gethostbyname_r_proto" in
12923 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12924 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12926 case "$gethostbyname_r_proto" in
12927 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12928 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12930 case "$gethostbyname_r_proto" in
12931 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12932 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12934 case "$gethostbyname_r_proto" in
12935 ''|0) d_gethostbyname_r=undef
12936 gethostbyname_r_proto=0
12937 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12938 * ) case "$gethostbyname_r_proto" in
12939 REENTRANT_PROTO*) ;;
12940 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12942 echo "Prototype: $try" ;;
12945 *) case "$usethreads" in
12946 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12948 d_gethostbyname_r=undef
12949 gethostbyname_r_proto=0
12953 *) gethostbyname_r_proto=0
12957 : see if gethostent_r exists
12958 set gethostent_r d_gethostent_r
12960 case "$d_gethostent_r" in
12962 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12963 case "$d_gethostent_r_proto:$usethreads" in
12964 ":define") d_gethostent_r_proto=define
12965 set d_gethostent_r_proto gethostent_r $hdrs
12969 case "$d_gethostent_r_proto" in
12971 case "$gethostent_r_proto" in
12972 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12973 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12975 case "$gethostent_r_proto" in
12976 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12977 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12979 case "$gethostent_r_proto" in
12980 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12981 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12983 case "$gethostent_r_proto" in
12984 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12985 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12987 case "$gethostent_r_proto" in
12988 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12989 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12991 case "$gethostent_r_proto" in
12992 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
12993 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
12995 case "$gethostent_r_proto" in
12996 ''|0) d_gethostent_r=undef
12997 gethostent_r_proto=0
12998 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
12999 * ) case "$gethostent_r_proto" in
13000 REENTRANT_PROTO*) ;;
13001 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13003 echo "Prototype: $try" ;;
13006 *) case "$usethreads" in
13007 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13009 d_gethostent_r=undef
13010 gethostent_r_proto=0
13014 *) gethostent_r_proto=0
13018 : see if prototypes for various gethostxxx netdb.h functions are available
13020 set d_gethostprotos gethostent $i_netdb netdb.h
13023 : see if getitimer exists
13024 set getitimer d_getitimer
13027 : see if getlogin exists
13028 set getlogin d_getlogin
13031 : see if getlogin_r exists
13032 set getlogin_r d_getlogin_r
13034 case "$d_getlogin_r" in
13036 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13037 case "$d_getlogin_r_proto:$usethreads" in
13038 ":define") d_getlogin_r_proto=define
13039 set d_getlogin_r_proto getlogin_r $hdrs
13043 case "$d_getlogin_r_proto" in
13045 case "$getlogin_r_proto" in
13046 ''|0) try='int getlogin_r(char*, size_t);'
13047 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13049 case "$getlogin_r_proto" in
13050 ''|0) try='int getlogin_r(char*, int);'
13051 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13053 case "$getlogin_r_proto" in
13054 ''|0) try='char* getlogin_r(char*, size_t);'
13055 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13057 case "$getlogin_r_proto" in
13058 ''|0) try='char* getlogin_r(char*, int);'
13059 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13061 case "$getlogin_r_proto" in
13062 ''|0) d_getlogin_r=undef
13064 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13065 * ) case "$getlogin_r_proto" in
13066 REENTRANT_PROTO*) ;;
13067 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13069 echo "Prototype: $try" ;;
13072 *) case "$usethreads" in
13073 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13080 *) getlogin_r_proto=0
13084 : see if getmnt exists
13085 set getmnt d_getmnt
13088 : see if getmntent exists
13089 set getmntent d_getmntent
13092 : see if getnetbyaddr exists
13093 set getnetbyaddr d_getnbyaddr
13096 : see if getnetbyname exists
13097 set getnetbyname d_getnbyname
13100 : see if getnetent exists
13101 set getnetent d_getnent
13104 : see if getnetbyaddr_r exists
13105 set getnetbyaddr_r d_getnetbyaddr_r
13107 case "$d_getnetbyaddr_r" in
13109 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13110 case "$d_getnetbyaddr_r_proto:$usethreads" in
13111 ":define") d_getnetbyaddr_r_proto=define
13112 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13116 case "$d_getnetbyaddr_r_proto" in
13118 case "$getnetbyaddr_r_proto" in
13119 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13120 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13122 case "$getnetbyaddr_r_proto" in
13123 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13124 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13126 case "$getnetbyaddr_r_proto" in
13127 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13128 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13130 case "$getnetbyaddr_r_proto" in
13131 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13132 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13134 case "$getnetbyaddr_r_proto" in
13135 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13136 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13138 case "$getnetbyaddr_r_proto" in
13139 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13140 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13142 case "$getnetbyaddr_r_proto" in
13143 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13144 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13146 case "$getnetbyaddr_r_proto" in
13147 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13148 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13150 case "$getnetbyaddr_r_proto" in
13151 ''|0) d_getnetbyaddr_r=undef
13152 getnetbyaddr_r_proto=0
13153 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13154 * ) case "$getnetbyaddr_r_proto" in
13155 REENTRANT_PROTO*) ;;
13156 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13158 echo "Prototype: $try" ;;
13161 *) case "$usethreads" in
13162 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13164 d_getnetbyaddr_r=undef
13165 getnetbyaddr_r_proto=0
13169 *) getnetbyaddr_r_proto=0
13173 : see if getnetbyname_r exists
13174 set getnetbyname_r d_getnetbyname_r
13176 case "$d_getnetbyname_r" in
13178 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13179 case "$d_getnetbyname_r_proto:$usethreads" in
13180 ":define") d_getnetbyname_r_proto=define
13181 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13185 case "$d_getnetbyname_r_proto" in
13187 case "$getnetbyname_r_proto" in
13188 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13189 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13191 case "$getnetbyname_r_proto" in
13192 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13193 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13195 case "$getnetbyname_r_proto" in
13196 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13197 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13199 case "$getnetbyname_r_proto" in
13200 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13201 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13203 case "$getnetbyname_r_proto" in
13204 ''|0) d_getnetbyname_r=undef
13205 getnetbyname_r_proto=0
13206 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13207 * ) case "$getnetbyname_r_proto" in
13208 REENTRANT_PROTO*) ;;
13209 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13211 echo "Prototype: $try" ;;
13214 *) case "$usethreads" in
13215 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13217 d_getnetbyname_r=undef
13218 getnetbyname_r_proto=0
13222 *) getnetbyname_r_proto=0
13226 : see if getnetent_r exists
13227 set getnetent_r d_getnetent_r
13229 case "$d_getnetent_r" in
13231 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13232 case "$d_getnetent_r_proto:$usethreads" in
13233 ":define") d_getnetent_r_proto=define
13234 set d_getnetent_r_proto getnetent_r $hdrs
13238 case "$d_getnetent_r_proto" in
13240 case "$getnetent_r_proto" in
13241 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13242 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13244 case "$getnetent_r_proto" in
13245 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13246 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13248 case "$getnetent_r_proto" in
13249 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13250 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13252 case "$getnetent_r_proto" in
13253 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13254 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13256 case "$getnetent_r_proto" in
13257 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13258 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13260 case "$getnetent_r_proto" in
13261 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13262 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13264 case "$getnetent_r_proto" in
13265 ''|0) d_getnetent_r=undef
13266 getnetent_r_proto=0
13267 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13268 * ) case "$getnetent_r_proto" in
13269 REENTRANT_PROTO*) ;;
13270 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13272 echo "Prototype: $try" ;;
13275 *) case "$usethreads" in
13276 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13278 d_getnetent_r=undef
13279 getnetent_r_proto=0
13283 *) getnetent_r_proto=0
13287 : see if prototypes for various getnetxxx netdb.h functions are available
13289 set d_getnetprotos getnetent $i_netdb netdb.h
13292 : see if getpagesize exists
13293 set getpagesize d_getpagsz
13297 : see if getprotobyname exists
13298 set getprotobyname d_getpbyname
13301 : see if getprotobynumber exists
13302 set getprotobynumber d_getpbynumber
13305 : see if getprotoent exists
13306 set getprotoent d_getpent
13309 : see if getpgid exists
13310 set getpgid d_getpgid
13313 : see if getpgrp2 exists
13314 set getpgrp2 d_getpgrp2
13317 : see if getppid exists
13318 set getppid d_getppid
13321 : see if getpriority exists
13322 set getpriority d_getprior
13325 : see if getprotobyname_r exists
13326 set getprotobyname_r d_getprotobyname_r
13328 case "$d_getprotobyname_r" in
13330 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13331 case "$d_getprotobyname_r_proto:$usethreads" in
13332 ":define") d_getprotobyname_r_proto=define
13333 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13337 case "$d_getprotobyname_r_proto" in
13339 case "$getprotobyname_r_proto" in
13340 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13341 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13343 case "$getprotobyname_r_proto" in
13344 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13345 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13347 case "$getprotobyname_r_proto" in
13348 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13349 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13351 case "$getprotobyname_r_proto" in
13352 ''|0) d_getprotobyname_r=undef
13353 getprotobyname_r_proto=0
13354 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13355 * ) case "$getprotobyname_r_proto" in
13356 REENTRANT_PROTO*) ;;
13357 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13359 echo "Prototype: $try" ;;
13362 *) case "$usethreads" in
13363 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13365 d_getprotobyname_r=undef
13366 getprotobyname_r_proto=0
13370 *) getprotobyname_r_proto=0
13374 : see if getprotobynumber_r exists
13375 set getprotobynumber_r d_getprotobynumber_r
13377 case "$d_getprotobynumber_r" in
13379 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13380 case "$d_getprotobynumber_r_proto:$usethreads" in
13381 ":define") d_getprotobynumber_r_proto=define
13382 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13386 case "$d_getprotobynumber_r_proto" in
13388 case "$getprotobynumber_r_proto" in
13389 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13390 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13392 case "$getprotobynumber_r_proto" in
13393 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13394 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13396 case "$getprotobynumber_r_proto" in
13397 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13398 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13400 case "$getprotobynumber_r_proto" in
13401 ''|0) d_getprotobynumber_r=undef
13402 getprotobynumber_r_proto=0
13403 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13404 * ) case "$getprotobynumber_r_proto" in
13405 REENTRANT_PROTO*) ;;
13406 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13408 echo "Prototype: $try" ;;
13411 *) case "$usethreads" in
13412 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13414 d_getprotobynumber_r=undef
13415 getprotobynumber_r_proto=0
13419 *) getprotobynumber_r_proto=0
13423 : see if getprotoent_r exists
13424 set getprotoent_r d_getprotoent_r
13426 case "$d_getprotoent_r" in
13428 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13429 case "$d_getprotoent_r_proto:$usethreads" in
13430 ":define") d_getprotoent_r_proto=define
13431 set d_getprotoent_r_proto getprotoent_r $hdrs
13435 case "$d_getprotoent_r_proto" in
13437 case "$getprotoent_r_proto" in
13438 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13439 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13441 case "$getprotoent_r_proto" in
13442 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13443 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13445 case "$getprotoent_r_proto" in
13446 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13447 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13449 case "$getprotoent_r_proto" in
13450 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13451 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13453 case "$getprotoent_r_proto" in
13454 ''|0) d_getprotoent_r=undef
13455 getprotoent_r_proto=0
13456 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13457 * ) case "$getprotoent_r_proto" in
13458 REENTRANT_PROTO*) ;;
13459 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13461 echo "Prototype: $try" ;;
13464 *) case "$usethreads" in
13465 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13467 d_getprotoent_r=undef
13468 getprotoent_r_proto=0
13472 *) getprotoent_r_proto=0
13476 : see if prototypes for various getprotoxxx netdb.h functions are available
13478 set d_getprotoprotos getprotoent $i_netdb netdb.h
13481 : see if getprpwnam exists
13482 set getprpwnam d_getprpwnam
13485 : see if getpwent exists
13486 set getpwent d_getpwent
13489 : see if getpwent_r exists
13490 set getpwent_r d_getpwent_r
13492 case "$d_getpwent_r" in
13494 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13495 case "$d_getpwent_r_proto:$usethreads" in
13496 ":define") d_getpwent_r_proto=define
13497 set d_getpwent_r_proto getpwent_r $hdrs
13501 case "$d_getpwent_r_proto" in
13503 case "$getpwent_r_proto" in
13504 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13505 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13507 case "$getpwent_r_proto" in
13508 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13509 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13511 case "$getpwent_r_proto" in
13512 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13513 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13515 case "$getpwent_r_proto" in
13516 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13517 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13519 case "$getpwent_r_proto" in
13520 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13521 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13523 case "$getpwent_r_proto" in
13524 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13525 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13527 case "$getpwent_r_proto" in
13528 ''|0) d_getpwent_r=undef
13530 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13531 * ) case "$getpwent_r_proto" in
13532 REENTRANT_PROTO*) ;;
13533 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13535 echo "Prototype: $try" ;;
13538 *) case "$usethreads" in
13539 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13546 *) getpwent_r_proto=0
13550 : see if getpwnam_r exists
13551 set getpwnam_r d_getpwnam_r
13553 case "$d_getpwnam_r" in
13555 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13556 case "$d_getpwnam_r_proto:$usethreads" in
13557 ":define") d_getpwnam_r_proto=define
13558 set d_getpwnam_r_proto getpwnam_r $hdrs
13562 case "$d_getpwnam_r_proto" in
13564 case "$getpwnam_r_proto" in
13565 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13566 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13568 case "$getpwnam_r_proto" in
13569 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13570 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13572 case "$getpwnam_r_proto" in
13573 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13574 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13576 case "$getpwnam_r_proto" in
13577 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13578 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13580 case "$getpwnam_r_proto" in
13581 ''|0) d_getpwnam_r=undef
13583 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13584 * ) case "$getpwnam_r_proto" in
13585 REENTRANT_PROTO*) ;;
13586 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13588 echo "Prototype: $try" ;;
13591 *) case "$usethreads" in
13592 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13599 *) getpwnam_r_proto=0
13603 : see if getpwuid_r exists
13604 set getpwuid_r d_getpwuid_r
13606 case "$d_getpwuid_r" in
13608 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13609 case "$d_getpwuid_r_proto:$usethreads" in
13610 ":define") d_getpwuid_r_proto=define
13611 set d_getpwuid_r_proto getpwuid_r $hdrs
13615 case "$d_getpwuid_r_proto" in
13617 case "$getpwuid_r_proto" in
13618 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13619 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13621 case "$getpwuid_r_proto" in
13622 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13623 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13625 case "$getpwuid_r_proto" in
13626 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13627 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13629 case "$getpwuid_r_proto" in
13630 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13631 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13633 case "$getpwuid_r_proto" in
13634 ''|0) d_getpwuid_r=undef
13636 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13637 * ) case "$getpwuid_r_proto" in
13638 REENTRANT_PROTO*) ;;
13639 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13641 echo "Prototype: $try" ;;
13644 *) case "$usethreads" in
13645 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13652 *) getpwuid_r_proto=0
13657 : see if getservbyname exists
13658 set getservbyname d_getsbyname
13661 : see if getservbyport exists
13662 set getservbyport d_getsbyport
13665 : see if getservent exists
13666 set getservent d_getsent
13669 : see if getservbyname_r exists
13670 set getservbyname_r d_getservbyname_r
13672 case "$d_getservbyname_r" in
13674 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13675 case "$d_getservbyname_r_proto:$usethreads" in
13676 ":define") d_getservbyname_r_proto=define
13677 set d_getservbyname_r_proto getservbyname_r $hdrs
13681 case "$d_getservbyname_r_proto" in
13683 case "$getservbyname_r_proto" in
13684 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13685 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13687 case "$getservbyname_r_proto" in
13688 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13689 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13691 case "$getservbyname_r_proto" in
13692 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13693 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13695 case "$getservbyname_r_proto" in
13696 ''|0) d_getservbyname_r=undef
13697 getservbyname_r_proto=0
13698 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13699 * ) case "$getservbyname_r_proto" in
13700 REENTRANT_PROTO*) ;;
13701 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13703 echo "Prototype: $try" ;;
13706 *) case "$usethreads" in
13707 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13709 d_getservbyname_r=undef
13710 getservbyname_r_proto=0
13714 *) getservbyname_r_proto=0
13718 : see if getservbyport_r exists
13719 set getservbyport_r d_getservbyport_r
13721 case "$d_getservbyport_r" in
13723 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13724 case "$d_getservbyport_r_proto:$usethreads" in
13725 ":define") d_getservbyport_r_proto=define
13726 set d_getservbyport_r_proto getservbyport_r $hdrs
13730 case "$d_getservbyport_r_proto" in
13732 case "$getservbyport_r_proto" in
13733 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13734 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13736 case "$getservbyport_r_proto" in
13737 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13738 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13740 case "$getservbyport_r_proto" in
13741 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13742 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13744 case "$getservbyport_r_proto" in
13745 ''|0) d_getservbyport_r=undef
13746 getservbyport_r_proto=0
13747 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13748 * ) case "$getservbyport_r_proto" in
13749 REENTRANT_PROTO*) ;;
13750 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13752 echo "Prototype: $try" ;;
13755 *) case "$usethreads" in
13756 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13758 d_getservbyport_r=undef
13759 getservbyport_r_proto=0
13763 *) getservbyport_r_proto=0
13767 : see if getservent_r exists
13768 set getservent_r d_getservent_r
13770 case "$d_getservent_r" in
13772 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13773 case "$d_getservent_r_proto:$usethreads" in
13774 ":define") d_getservent_r_proto=define
13775 set d_getservent_r_proto getservent_r $hdrs
13779 case "$d_getservent_r_proto" in
13781 case "$getservent_r_proto" in
13782 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13783 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13785 case "$getservent_r_proto" in
13786 ''|0) try='int getservent_r(struct servent*, char*, int);'
13787 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13789 case "$getservent_r_proto" in
13790 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13791 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13793 case "$getservent_r_proto" in
13794 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13795 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13797 case "$getservent_r_proto" in
13798 ''|0) d_getservent_r=undef
13799 getservent_r_proto=0
13800 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13801 * ) case "$getservent_r_proto" in
13802 REENTRANT_PROTO*) ;;
13803 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13805 echo "Prototype: $try" ;;
13808 *) case "$usethreads" in
13809 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13811 d_getservent_r=undef
13812 getservent_r_proto=0
13816 *) getservent_r_proto=0
13820 : see if prototypes for various getservxxx netdb.h functions are available
13822 set d_getservprotos getservent $i_netdb netdb.h
13825 : see if getspnam exists
13826 set getspnam d_getspnam
13829 : see if this is a shadow.h system
13830 set shadow.h i_shadow
13833 : see if getspnam_r exists
13834 set getspnam_r d_getspnam_r
13836 case "$d_getspnam_r" in
13838 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13839 case "$d_getspnam_r_proto:$usethreads" in
13840 ":define") d_getspnam_r_proto=define
13841 set d_getspnam_r_proto getspnam_r $hdrs
13845 case "$d_getspnam_r_proto" in
13847 case "$getspnam_r_proto" in
13848 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13849 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13851 case "$getspnam_r_proto" in
13852 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13853 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13855 case "$getspnam_r_proto" in
13856 ''|0) d_getspnam_r=undef
13858 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13859 * ) case "$getspnam_r_proto" in
13860 REENTRANT_PROTO*) ;;
13861 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13863 echo "Prototype: $try" ;;
13866 *) case "$usethreads" in
13867 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13874 *) getspnam_r_proto=0
13878 : see if gettimeofday or ftime exists
13879 set gettimeofday d_gettimeod
13881 case "$d_gettimeod" in
13887 val="$undef"; set d_ftime; eval $setvar
13890 case "$d_gettimeod$d_ftime" in
13893 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13897 : see if gmtime_r exists
13898 set gmtime_r d_gmtime_r
13900 case "$d_gmtime_r" in
13902 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13903 case "$d_gmtime_r_proto:$usethreads" in
13904 ":define") d_gmtime_r_proto=define
13905 set d_gmtime_r_proto gmtime_r $hdrs
13909 case "$d_gmtime_r_proto" in
13911 case "$gmtime_r_proto" in
13912 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13913 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13915 case "$gmtime_r_proto" in
13916 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13917 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13919 case "$gmtime_r_proto" in
13920 ''|0) d_gmtime_r=undef
13922 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13923 * ) case "$gmtime_r_proto" in
13924 REENTRANT_PROTO*) ;;
13925 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13927 echo "Prototype: $try" ;;
13930 *) case "$usethreads" in
13931 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13938 *) gmtime_r_proto=0
13942 : see if hasmntopt exists
13943 set hasmntopt d_hasmntopt
13946 : see if this is a netinet/in.h or sys/in.h system
13947 set netinet/in.h i_niin sys/in.h i_sysin
13950 : see if arpa/inet.h has to be included
13951 set arpa/inet.h i_arpainet
13954 : see if htonl --and friends-- exists
13959 : Maybe they are macros.
13962 $cat >htonl.c <<EOM
13964 #include <sys/types.h>
13965 #$i_niin I_NETINET_IN
13967 #$i_arpainet I_ARPA_INET
13968 #ifdef I_NETINET_IN
13969 #include <netinet/in.h>
13972 #include <sys/in.h>
13975 #include <arpa/inet.h>
13978 printf("Defined as a macro.");
13981 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13982 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13984 echo "But it seems to be defined as a macro." >&4
13992 : see if ilogbl exists
13993 set ilogbl d_ilogbl
13998 if set index val -f; eval $csym; $val; then
13999 if set strchr val -f d_strchr; eval $csym; $val; then
14000 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14003 echo "strchr() found." >&4
14007 echo "index() found." >&4
14012 echo "index() found." >&4
14015 if set strchr val -f d_strchr; eval $csym; $val; then
14018 echo "strchr() found." >&4
14020 echo "No index() or strchr() found!" >&4
14025 set d_strchr; eval $setvar
14027 set d_index; eval $setvar
14029 : check whether inet_aton exists
14030 set inet_aton d_inetaton
14035 $cat >isascii.c <<EOCP
14038 #$i_stdlib I_STDLIB
14040 #include <stdlib.h>
14051 if eval $compile; then
14052 echo "isascii() found." >&4
14055 echo "isascii() NOT found." >&4
14062 : see if isfinite exists
14063 set isfinite d_isfinite
14066 : see if isinf exists
14070 : see if isnan exists
14074 : see if isnanl exists
14075 set isnanl d_isnanl
14078 : see if killpg exists
14079 set killpg d_killpg
14082 : see if lchown exists
14084 $cat > try.c <<'EOCP'
14085 /* System header to define __stub macros and hopefully few prototypes,
14086 which can conflict with char lchown(); below. */
14087 #include <assert.h>
14088 /* Override any gcc2 internal prototype to avoid an error. */
14089 /* We use char because int might match the return type of a gcc2
14090 builtin and then its argument prototype would still apply. */
14093 /* The GNU C library defines this for functions which it implements
14094 to always fail with ENOSYS. Some functions are actually named
14095 something starting with __ and the normal name is an alias. */
14096 #if defined (__stub_lchown) || defined (__stub___lchown)
14104 if eval $compile; then
14105 $echo "lchown() found." >&4
14108 $echo "lchown() NOT found." >&4
14114 : See if number of significant digits in a double precision number is known
14116 $cat >ldbl_dig.c <<EOM
14117 #$i_limits I_LIMITS
14120 #include <limits.h>
14126 printf("Contains LDBL_DIG");
14129 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14130 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14131 echo "LDBL_DIG found." >&4
14134 echo "LDBL_DIG NOT found." >&4
14141 : see if this is a math.h system
14145 d_libm_lib_version="$undef"
14148 : check to see if math.h defines _LIB_VERSION
14150 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14152 #include <unistd.h>
14154 int main (int argc, char *argv[])
14156 printf ("%d\n", _LIB_VERSION);
14161 if eval $compile; then
14163 echo "Yes, it does ($foo)" >&4
14164 d_libm_lib_version="$define"
14166 echo "No, it does not (probably harmless)\n" >&4
14168 $rm -f try.* try core core.try.*
14173 : see if link exists
14177 : see if localtime_r exists
14178 set localtime_r d_localtime_r
14180 case "$d_localtime_r" in
14182 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14183 case "$d_localtime_r_proto:$usethreads" in
14184 ":define") d_localtime_r_proto=define
14185 set d_localtime_r_proto localtime_r $hdrs
14189 case "$d_localtime_r_proto" in
14191 case "$localtime_r_proto" in
14192 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14193 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14195 case "$localtime_r_proto" in
14196 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14197 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14199 case "$localtime_r_proto" in
14200 ''|0) d_localtime_r=undef
14201 localtime_r_proto=0
14202 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14203 * ) case "$localtime_r_proto" in
14204 REENTRANT_PROTO*) ;;
14205 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14207 echo "Prototype: $try" ;;
14210 *) case "$usethreads" in
14211 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14213 d_localtime_r=undef
14214 localtime_r_proto=0
14218 *) localtime_r_proto=0
14222 : see if localeconv exists
14223 set localeconv d_locconv
14226 : see if lockf exists
14230 : see if prototype for lseek is available
14232 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14235 : see if lstat exists
14239 : see if madvise exists
14240 set madvise d_madvise
14243 : see if mblen exists
14247 : see if mbstowcs exists
14248 set mbstowcs d_mbstowcs
14251 : see if mbtowc exists
14252 set mbtowc d_mbtowc
14255 : see if memchr exists
14256 set memchr d_memchr
14259 : see if memcmp exists
14260 set memcmp d_memcmp
14263 : see if memcpy exists
14264 set memcpy d_memcpy
14267 : see if memmove exists
14268 set memmove d_memmove
14271 : see if memset exists
14272 set memset d_memset
14275 : see if mkdir exists
14279 : see if mkdtemp exists
14280 set mkdtemp d_mkdtemp
14283 : see if mkfifo exists
14284 set mkfifo d_mkfifo
14287 : see if mkstemp exists
14288 set mkstemp d_mkstemp
14291 : see if mkstemps exists
14292 set mkstemps d_mkstemps
14295 : see if mktime exists
14296 set mktime d_mktime
14299 : see if this is a sys/mman.h system
14300 set sys/mman.h i_sysmman
14303 : see if mmap exists
14306 : see what shmat returns
14307 : default to something harmless
14309 case "$i_sysmman$d_mmap" in
14311 $cat >mmap.c <<'END'
14312 #include <sys/mman.h>
14315 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14320 echo "and it returns ($mmaptype)." >&4
14326 : see if sqrtl exists
14330 : see if scalbnl exists
14331 set scalbnl d_scalbnl
14334 : see if modfl exists
14338 : see if prototype for modfl is available
14340 set d_modflproto modfl $i_math math.h
14343 d_modfl_pow32_bug="$undef"
14345 case "$d_longdbl$d_modfl" in
14348 Checking to see whether your modfl() is okay for large values...
14354 if $test "X$d_modflproto" != "X$define"; then
14355 $cat >>try.c <<EOCP
14356 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14357 long double modfl (long double, long double *);
14360 $cat >>try.c <<EOCP
14362 long double nv = 4294967303.15;
14368 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14372 case "$osname:$gccversion" in
14373 aix:) saveccflags="$ccflags"
14374 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14377 if eval $compile; then
14380 *" 4294967303.150000 1.150000 4294967302.000000")
14381 echo >&4 "Your modfl() is broken for large values."
14382 d_modfl_pow32_bug="$define"
14384 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14388 *" 4294967303.150000 0.150000 4294967303.000000")
14389 echo >&4 "Your modfl() seems okay for large values."
14391 *) echo >&4 "I don't understand your modfl() at all."
14395 $rm -f try.* try core core.try.*
14397 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14400 case "$osname:$gccversion" in
14401 aix:) ccflags="$saveccflags" ;; # restore
14406 if $test "$uselongdouble" = "$define"; then
14408 if $test "$d_sqrtl" != "$define"; then
14409 message="$message sqrtl"
14411 if $test "$d_modfl" != "$define"; then
14412 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14413 echo "You have both aintl and copysignl, so I can emulate modfl."
14415 message="$message modfl"
14418 if $test "$d_frexpl" != "$define"; then
14419 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14420 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14422 message="$message frexpl"
14426 if $test "$message" != ""; then
14429 *** You requested the use of long doubles but you do not seem to have
14430 *** the following mathematical functions needed for long double support:
14432 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14433 *** Cannot continue, aborting.
14441 : see if mprotect exists
14442 set mprotect d_mprotect
14445 : see if msgctl exists
14446 set msgctl d_msgctl
14449 : see if msgget exists
14450 set msgget d_msgget
14453 : see if msgsnd exists
14454 set msgsnd d_msgsnd
14457 : see if msgrcv exists
14458 set msgrcv d_msgrcv
14461 : see how much of the 'msg*(2)' library is present.
14464 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14465 *"$undef"*) h_msg=false;;
14469 case "`ipcs 2>&1`" in
14470 "SVID messages"*"not configured"*)
14471 echo "Your $osname does not have the msg*(2) configured." >&4
14474 set msgctl d_msgctl
14476 set msgget d_msgget
14478 set msgsnd d_msgsnd
14480 set msgrcv d_msgrcv
14486 : we could also check for sys/ipc.h ...
14487 if $h_msg && $test `./findhdr sys/msg.h`; then
14488 echo "You have the full msg*(2) library." >&4
14491 echo "You don't have the full msg*(2) library." >&4
14499 echo "Checking to see if your system supports struct msghdr..." >&4
14500 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14502 case "$d_msghdr_s" in
14503 "$define") echo "Yes, it does." ;;
14504 *) echo "No, it doesn't." ;;
14508 : see if msync exists
14512 : see if munmap exists
14513 set munmap d_munmap
14516 : see if nice exists
14520 : see if this is a langinfo.h system
14521 set langinfo.h i_langinfo
14524 : see if nl_langinfo exists
14525 set nl_langinfo d_nl_langinfo
14528 : check for length of character
14530 case "$charsize" in
14532 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14535 #$i_stdlib I_STDLIB
14537 #include <stdlib.h>
14541 printf("%d\n", (int)sizeof(char));
14546 if eval $compile_ok; then
14550 echo "(I can't seem to compile the test program. Guessing...)"
14557 rp="What is the size of a character (in bytes)?"
14562 : check for volatile keyword
14564 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14565 $cat >try.c <<'EOCP'
14568 typedef struct _goo_struct goo_struct;
14569 goo_struct * volatile goo = ((goo_struct *)0);
14570 struct _goo_struct {
14575 typedef unsigned short foo_t;
14576 char *volatile foo;
14578 volatile foo_t blech;
14582 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14584 echo "Yup, it does."
14587 echo "Nope, it doesn't."
14595 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14597 case "$use64bitint:$d_quad:$quadtype" in
14600 uvtype="$uquadtype"
14605 uvtype="unsigned long"
14611 case "$uselongdouble:$d_longdbl" in
14613 nvtype="long double"
14614 nvsize=$longdblsize
14621 $echo "(IV will be "$ivtype", $ivsize bytes)"
14622 $echo "(UV will be "$uvtype", $uvsize bytes)"
14623 $echo "(NV will be "$nvtype", $nvsize bytes)"
14626 #$i_inttypes I_INTTYPES
14628 #include <inttypes.h>
14633 int8_t i = INT8_MAX;
14634 uint8_t u = UINT8_MAX;
14635 printf("int8_t\n");
14638 int16_t i = INT16_MAX;
14639 uint16_t i = UINT16_MAX;
14640 printf("int16_t\n");
14643 int32_t i = INT32_MAX;
14644 uint32_t u = UINT32_MAX;
14645 printf("int32_t\n");
14651 '') case "$charsize" in
14653 u8type="unsigned char"
14662 if eval $compile; then
14663 case "`$run ./try`" in
14664 int8_t) i8type=int8_t
14674 '') if $test $charsize -ge 1; then
14676 u8type="unsigned char"
14684 '') case "$shortsize" in
14686 u16type="unsigned short"
14694 '') set try -DINT16
14695 if eval $compile; then
14696 case "`$run ./try`" in
14708 '') if $test $shortsize -ge 2; then
14710 u16type="unsigned short"
14718 '') case "$longsize" in
14720 u32type="unsigned long"
14724 *) case "$intsize" in
14726 u32type="unsigned int"
14736 '') set try -DINT32
14737 if eval $compile; then
14738 case "`$run ./try`" in
14750 '') if $test $intsize -ge 4; then
14752 u32type="unsigned int"
14760 '') case "$d_quad:$quadtype" in
14762 i64type="$quadtype"
14763 u64type="$uquadtype"
14771 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14772 : volatile so that the compiler has to store it out to memory.
14773 if test X"$d_volatile" = X"$define"; then
14778 #$i_stdlib I_STDLIB
14780 #include <stdlib.h>
14782 #include <sys/types.h>
14783 #include <signal.h>
14785 $volatile int bletched = 0;
14786 $signal_t blech(s) int s; { bletched = 1; }
14791 int n = 8 * $uvsize;
14794 signal(SIGFPE, blech);
14797 for (i = 0; i < n; i++) {
14798 u = u << 1 | ($uvtype)1;
14800 if (($uvtype)d != u)
14804 d = ($nvtype)(u - 1);
14805 if (($uvtype)d != (u - 1))
14813 printf("%d\n", ((i == n) ? -n : i));
14819 d_nv_preserves_uv="$undef"
14820 if eval $compile; then
14821 nv_preserves_uv_bits="`$run ./try`"
14823 case "$nv_preserves_uv_bits" in
14825 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14826 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14827 d_nv_preserves_uv="$define"
14829 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14830 d_nv_preserves_uv="$undef" ;;
14831 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14832 nv_preserves_uv_bits="$undef" ;;
14837 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14838 : volatile so that the compiler has to store it out to memory.
14839 if test X"$d_volatile" = X"$define"; then
14844 #$i_stdlib I_STDLIB
14846 #include <stdlib.h>
14848 #$i_string I_STRING
14850 # include <string.h>
14852 # include <strings.h>
14854 #include <sys/types.h>
14855 #include <signal.h>
14857 $volatile int bletched = 0;
14858 $signal_t blech(s) int s; { bletched = 1; }
14861 int checkit($nvtype d, char *where) {
14862 unsigned char *p = (char *)&d;
14863 unsigned char *end = p + sizeof(d);
14873 printf("No - %s: 0x", where);
14875 printf ("%02X", *p++);
14880 int main(int argc, char **argv) {
14883 fail += checkit(d, "0.0");
14885 /* The compiler shouldn't be assuming that bletched is 0 */
14888 fail += checkit(d, "bleched");
14891 signal(SIGFPE, blech);
14894 /* Paranoia - the compiler should have no way of knowing that ANSI says
14895 that argv[argc] will always be NULL. Actually, if it did assume this it
14896 would be buggy, as this is C and main() can be called from elsewhere in
14898 d = argv[argc] ? 1 : 0;
14901 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14904 fail += checkit(d, "ternary");
14906 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14909 printf("No - memset doesn't give 0.0\n");
14910 /* This might just blow up: */
14911 printf("(gives %g)\n", d);
14917 printf("No - something bleched\n");
14922 printf("No - %d fail(s)\n", fail);
14931 d_nv_zero_is_allbits_zero="$undef"
14932 if eval $compile; then
14938 0.0 is represented as all bits zero in memory
14940 d_nv_zero_is_allbits_zero="$define"
14943 0.0 is not represented as all bits zero in memory
14945 d_nv_zero_is_allbits_zero="$undef"
14950 0.0 is not represented as all bits zero in memory
14952 d_nv_zero_is_allbits_zero="$undef"
14960 : check for off64_t
14962 echo "Checking to see if you have off64_t..." >&4
14964 #include <sys/types.h>
14965 #include <unistd.h>
14966 int main() { off64_t x = 7; }
14969 if eval $compile; then
14971 echo "You have off64_t."
14974 echo "You do not have off64_t."
14975 case "$lseeksize" in
14976 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
14983 : how to create joinable pthreads
14984 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
14986 echo "Checking what constant to use for creating joinable pthreads..." >&4
14987 $cat >try.c <<'EOCP'
14988 #include <pthread.h>
14990 int detachstate = JOINABLE;
14993 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
14994 if eval $compile; then
14995 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
14996 val="$undef" # Yes, undef.
14997 set d_old_pthread_create_joinable
15000 set old_pthread_create_joinable
15003 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15004 if eval $compile; then
15005 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15007 set d_old_pthread_create_joinable
15009 val=PTHREAD_CREATE_UNDETACHED
15010 set old_pthread_create_joinable
15013 set try -DJOINABLE=__UNDETACHED
15014 if eval $compile; then
15015 echo "You seem to use __UNDETACHED." >&4
15017 set d_old_pthread_create_joinable
15020 set old_pthread_create_joinable
15023 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15025 set d_old_pthread_create_joinable
15028 set old_pthread_create_joinable
15035 d_old_pthread_create_joinable="$undef"
15036 old_pthread_create_joinable=""
15039 : see if pause exists
15043 : see if pipe exists
15047 : see if poll exists
15051 : see if readlink exists
15052 set readlink d_readlink
15058 case "$d_readlink" in
15060 if $issymlink /proc/self/exe ; then
15061 $ls -l /proc/self/exe > reflect
15062 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15063 echo "You have Linux-like /proc/self/exe."
15064 procselfexe='"/proc/self/exe"'
15068 if $issymlink /proc/curproc/file ; then
15069 $ls -l /proc/curproc/file > reflect
15070 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15071 echo "You have BSD-like /proc/curproc/file."
15072 procselfexe='"/proc/curproc/file"'
15082 : see whether the pthread_atfork exists
15084 #include <pthread.h>
15087 #ifdef PTHREAD_ATFORK
15088 pthread_atfork(NULL,NULL,NULL);
15093 : see if pthread_atfork exists
15094 set try -DPTHREAD_ATFORK
15095 if eval $compile; then
15100 case "$usethreads" in
15103 $define) echo 'pthread_atfork found.' >&4 ;;
15104 *) echo 'pthread_atfork NOT found.' >&4 ;;
15107 set d_pthread_atfork
15110 : see if pthread_attr_setscope exists
15111 set pthread_attr_setscope d_pthread_attr_setscope
15115 : see whether the various POSIXish _yields exist
15117 #include <pthread.h>
15123 #ifdef PTHREAD_YIELD
15126 #ifdef PTHREAD_YIELD_NULL
15127 pthread_yield(NULL);
15133 : see if sched_yield exists
15134 set try -DSCHED_YIELD
15135 if eval $compile; then
15137 sched_yield='sched_yield()'
15141 case "$usethreads" in
15144 $define) echo 'sched_yield() found.' >&4 ;;
15145 *) echo 'sched_yield() NOT found.' >&4 ;;
15151 : see if pthread_yield exists
15152 set try -DPTHREAD_YIELD
15153 if eval $compile; then
15155 case "$sched_yield" in
15156 '') sched_yield='pthread_yield()' ;;
15159 set try -DPTHREAD_YIELD_NULL
15160 if eval $compile; then
15162 case "$sched_yield" in
15163 '') sched_yield='pthread_yield(NULL)' ;;
15169 case "$usethreads" in
15172 $define) echo 'pthread_yield() found.' >&4 ;;
15173 *) echo 'pthread_yield() NOT found.' >&4 ;;
15177 set d_pthread_yield
15180 case "$sched_yield" in
15181 '') sched_yield=undef ;;
15186 : see if random_r exists
15187 set random_r d_random_r
15189 case "$d_random_r" in
15191 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15192 case "$d_random_r_proto:$usethreads" in
15193 ":define") d_random_r_proto=define
15194 set d_random_r_proto random_r $hdrs
15198 case "$d_random_r_proto" in
15200 case "$random_r_proto" in
15201 ''|0) try='int random_r(int*, struct random_data*);'
15202 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15204 case "$random_r_proto" in
15205 ''|0) try='int random_r(long*, struct random_data*);'
15206 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15208 case "$random_r_proto" in
15209 ''|0) try='int random_r(struct random_data*, int32_t*);'
15210 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15212 case "$random_r_proto" in
15213 ''|0) d_random_r=undef
15215 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15216 * ) case "$random_r_proto" in
15217 REENTRANT_PROTO*) ;;
15218 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15220 echo "Prototype: $try" ;;
15223 *) case "$usethreads" in
15224 define) echo "random_r has no prototype, not using it." >&4 ;;
15231 *) random_r_proto=0
15235 : see if readdir and friends exist
15236 set readdir d_readdir
15238 set seekdir d_seekdir
15240 set telldir d_telldir
15242 set rewinddir d_rewinddir
15245 : see if readdir64_r exists
15246 set readdir64_r d_readdir64_r
15248 case "$d_readdir64_r" in
15250 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15251 case "$d_readdir64_r_proto:$usethreads" in
15252 ":define") d_readdir64_r_proto=define
15253 set d_readdir64_r_proto readdir64_r $hdrs
15257 case "$d_readdir64_r_proto" in
15259 case "$readdir64_r_proto" in
15260 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15261 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15263 case "$readdir64_r_proto" in
15264 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15265 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15267 case "$readdir64_r_proto" in
15268 ''|0) d_readdir64_r=undef
15269 readdir64_r_proto=0
15270 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15271 * ) case "$readdir64_r_proto" in
15272 REENTRANT_PROTO*) ;;
15273 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15275 echo "Prototype: $try" ;;
15278 *) case "$usethreads" in
15279 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15281 d_readdir64_r=undef
15282 readdir64_r_proto=0
15286 *) readdir64_r_proto=0
15290 : see if readdir_r exists
15291 set readdir_r d_readdir_r
15293 case "$d_readdir_r" in
15295 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15296 case "$d_readdir_r_proto:$usethreads" in
15297 ":define") d_readdir_r_proto=define
15298 set d_readdir_r_proto readdir_r $hdrs
15302 case "$d_readdir_r_proto" in
15304 case "$readdir_r_proto" in
15305 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15306 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15308 case "$readdir_r_proto" in
15309 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15310 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15312 case "$readdir_r_proto" in
15313 ''|0) d_readdir_r=undef
15315 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15316 * ) case "$readdir_r_proto" in
15317 REENTRANT_PROTO*) ;;
15318 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15320 echo "Prototype: $try" ;;
15323 *) case "$usethreads" in
15324 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15331 *) readdir_r_proto=0
15335 : see if readv exists
15339 : see if recvmsg exists
15340 set recvmsg d_recvmsg
15343 : see if rename exists
15344 set rename d_rename
15347 : see if rmdir exists
15351 : see if memory.h is available.
15356 : See if it conflicts with string.h
15362 $cppstdin $cppflags $cppminus < $strings > mem.h
15363 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15365 echo "We won't be including <memory.h>."
15375 : can bcopy handle overlapping blocks?
15378 case "$d_memmove" in
15379 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15380 *) case "$d_bcopy" in
15382 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15384 #$i_memory I_MEMORY
15385 #$i_stdlib I_STDLIB
15386 #$i_string I_STRING
15387 #$i_unistd I_UNISTD
15389 $cat >>try.c <<'EOCP'
15392 # include <memory.h>
15395 # include <stdlib.h>
15398 # include <string.h>
15400 # include <strings.h>
15403 # include <unistd.h> /* Needed for NetBSD */
15407 char buf[128], abc[128];
15413 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15414 try to store the string in read-only memory. */
15415 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15417 for (align = 7; align >= 0; align--) {
15418 for (len = 36; len; len--) {
15420 bcopy(abc, b, len);
15421 for (off = 1; off <= len; off++) {
15422 bcopy(b, b+off, len);
15423 bcopy(b+off, b, len);
15424 if (bcmp(b, abc, len))
15433 if eval $compile_ok; then
15434 if ./try 2>/dev/null; then
15435 echo "Yes, it can."
15438 echo "It can't, sorry."
15441 echo "(I can't compile the test program, so we'll assume not...)"
15445 $rm -f try.* try core
15451 : can memcpy handle overlapping blocks?
15454 case "$d_memmove" in
15455 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15456 *) case "$d_memcpy" in
15458 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15460 #$i_memory I_MEMORY
15461 #$i_stdlib I_STDLIB
15462 #$i_string I_STRING
15463 #$i_unistd I_UNISTD
15465 $cat >>try.c <<'EOCP'
15468 # include <memory.h>
15471 # include <stdlib.h>
15474 # include <string.h>
15476 # include <strings.h>
15479 # include <unistd.h> /* Needed for NetBSD */
15483 char buf[128], abc[128];
15489 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15490 try to store the string in read-only memory. */
15491 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15493 for (align = 7; align >= 0; align--) {
15494 for (len = 36; len; len--) {
15496 memcpy(b, abc, len);
15497 for (off = 1; off <= len; off++) {
15498 memcpy(b+off, b, len);
15499 memcpy(b, b+off, len);
15500 if (memcmp(b, abc, len))
15509 if eval $compile_ok; then
15510 if ./try 2>/dev/null; then
15511 echo "Yes, it can."
15514 echo "It can't, sorry."
15517 echo "(I can't compile the test program, so we'll assume not...)"
15521 $rm -f try.* try core
15527 : can memcmp be trusted to compare relative magnitude?
15529 case "$d_memcmp" in
15532 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15534 #$i_memory I_MEMORY
15535 #$i_stdlib I_STDLIB
15536 #$i_string I_STRING
15537 #$i_unistd I_UNISTD
15539 $cat >>try.c <<'EOCP'
15542 # include <memory.h>
15545 # include <stdlib.h>
15548 # include <string.h>
15550 # include <strings.h>
15553 # include <unistd.h> /* Needed for NetBSD */
15559 if ((a < b) && memcmp(&a, &b, 1) < 0)
15565 if eval $compile_ok; then
15566 if $run ./try 2>/dev/null; then
15567 echo "Yes, it can."
15570 echo "No, it can't (it uses signed chars)."
15573 echo "(I can't compile the test program, so we'll assume not...)"
15577 $rm -f try.* try core
15581 : see if prototype for sbrk is available
15583 set d_sbrkproto sbrk $i_unistd unistd.h
15586 : see if select exists
15587 set select d_select
15590 : see if semctl exists
15591 set semctl d_semctl
15594 : see if semget exists
15595 set semget d_semget
15598 : see if semop exists
15602 : see how much of the 'sem*(2)' library is present.
15605 case "$d_semctl$d_semget$d_semop" in
15606 *"$undef"*) h_sem=false;;
15610 case "`ipcs 2>&1`" in
15611 "SVID messages"*"not configured"*)
15612 echo "Your $osname does not have the sem*(2) configured." >&4
15615 set semctl d_semctl
15617 set semget d_semget
15625 : we could also check for sys/ipc.h ...
15626 if $h_sem && $test `./findhdr sys/sem.h`; then
15627 echo "You have the full sem*(2) library." >&4
15630 echo "You don't have the full sem*(2) library." >&4
15636 : see whether sys/sem.h defines union semun
15638 $cat > try.c <<'END'
15639 #include <sys/types.h>
15640 #include <sys/ipc.h>
15641 #include <sys/sem.h>
15642 int main () { union semun semun; semun.buf = 0; }
15645 if eval $compile; then
15646 echo "You have union semun in <sys/sem.h>." >&4
15649 echo "You do not have union semun in <sys/sem.h>." >&4
15656 : see how to do semctl IPC_STAT
15663 # define S_IRUSR S_IREAD
15664 # define S_IWUSR S_IWRITE
15665 # define S_IXUSR S_IEXEC
15667 # define S_IRUSR 0400
15668 # define S_IWUSR 0200
15669 # define S_IXUSR 0100
15671 # define S_IRGRP (S_IRUSR>>3)
15672 # define S_IWGRP (S_IWUSR>>3)
15673 # define S_IXGRP (S_IXUSR>>3)
15674 # define S_IROTH (S_IRUSR>>6)
15675 # define S_IWOTH (S_IWUSR>>6)
15676 # define S_IXOTH (S_IXUSR>>6)
15679 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15680 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15681 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15684 : see whether semctl IPC_STAT can use union semun
15686 case "$d_semctl_semun" in
15689 #include <sys/types.h>
15690 #include <sys/ipc.h>
15691 #include <sys/sem.h>
15692 #include <sys/stat.h>
15699 #$d_union_semun HAS_UNION_SEMUN
15702 #ifndef HAS_UNION_SEMUN
15705 struct semid_ds *buf;
15706 unsigned short *array;
15712 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15713 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15715 struct semid_ds argbuf;
15718 st = semctl(sem, 0, IPC_STAT, arg);
15722 # endif /* IPC_STAT */
15723 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15725 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15726 # endif /* IPC_RMID */
15727 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15729 #endif /* IPC_PRIVATE && ... */
15730 printf("semget failed: errno = %d\n", errno);
15735 if eval $compile; then
15738 semun) val="$define" ;;
15746 case "$d_semctl_semun" in
15748 echo "You can use union semun for semctl IPC_STAT." >&4
15751 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15756 : see whether semctl IPC_STAT can use struct semid_ds pointer
15758 case "$d_semctl_semid_ds" in
15760 $cat > try.c <<'END'
15761 #include <sys/types.h>
15762 #include <sys/ipc.h>
15763 #include <sys/sem.h>
15764 #include <sys/stat.h>
15772 struct semid_ds arg;
15775 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15776 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15779 st = semctl(sem, 0, IPC_STAT, &arg);
15781 printf("semid_ds\n");
15783 # endif /* IPC_STAT */
15784 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15786 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15787 # endif /* IPC_RMID */
15788 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15790 #endif /* IPC_PRIVATE && ... */
15791 printf("semget failed: errno = %d\n", errno);
15797 if eval $compile; then
15800 semid_ds) val="$define" ;;
15806 set d_semctl_semid_ds
15808 case "$d_semctl_semid_ds" in
15810 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15812 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15819 # We do not have the full sem*(2) library, so assume we can not
15825 set d_semctl_semid_ds
15830 : see if sendmsg exists
15831 set sendmsg d_sendmsg
15834 : see if setegid exists
15835 set setegid d_setegid
15838 : see if seteuid exists
15839 set seteuid d_seteuid
15842 : see if setgrent exists
15843 set setgrent d_setgrent
15846 : see if setgrent_r exists
15847 set setgrent_r d_setgrent_r
15849 case "$d_setgrent_r" in
15851 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15852 case "$d_setgrent_r_proto:$usethreads" in
15853 ":define") d_setgrent_r_proto=define
15854 set d_setgrent_r_proto setgrent_r $hdrs
15858 case "$d_setgrent_r_proto" in
15860 case "$setgrent_r_proto" in
15861 ''|0) try='int setgrent_r(FILE**);'
15862 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15864 case "$setgrent_r_proto" in
15865 ''|0) try='void setgrent_r(FILE**);'
15866 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15868 case "$setgrent_r_proto" in
15869 ''|0) d_setgrent_r=undef
15871 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15872 * ) case "$setgrent_r_proto" in
15873 REENTRANT_PROTO*) ;;
15874 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15876 echo "Prototype: $try" ;;
15879 *) case "$usethreads" in
15880 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15887 *) setgrent_r_proto=0
15891 : see if sethostent exists
15892 set sethostent d_sethent
15895 : see if sethostent_r exists
15896 set sethostent_r d_sethostent_r
15898 case "$d_sethostent_r" in
15900 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15901 case "$d_sethostent_r_proto:$usethreads" in
15902 ":define") d_sethostent_r_proto=define
15903 set d_sethostent_r_proto sethostent_r $hdrs
15907 case "$d_sethostent_r_proto" in
15909 case "$sethostent_r_proto" in
15910 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15911 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15913 case "$sethostent_r_proto" in
15914 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15915 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15917 case "$sethostent_r_proto" in
15918 ''|0) d_sethostent_r=undef
15919 sethostent_r_proto=0
15920 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15921 * ) case "$sethostent_r_proto" in
15922 REENTRANT_PROTO*) ;;
15923 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15925 echo "Prototype: $try" ;;
15928 *) case "$usethreads" in
15929 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15931 d_sethostent_r=undef
15932 sethostent_r_proto=0
15936 *) sethostent_r_proto=0
15940 : see if setitimer exists
15941 set setitimer d_setitimer
15944 : see if setlinebuf exists
15945 set setlinebuf d_setlinebuf
15948 : see if setlocale exists
15949 set setlocale d_setlocale
15952 : see if locale.h is available
15953 set locale.h i_locale
15956 : see if setlocale_r exists
15957 set setlocale_r d_setlocale_r
15959 case "$d_setlocale_r" in
15961 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15962 case "$d_setlocale_r_proto:$usethreads" in
15963 ":define") d_setlocale_r_proto=define
15964 set d_setlocale_r_proto setlocale_r $hdrs
15968 case "$d_setlocale_r_proto" in
15970 case "$setlocale_r_proto" in
15971 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15972 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15974 case "$setlocale_r_proto" in
15975 ''|0) d_setlocale_r=undef
15976 setlocale_r_proto=0
15977 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15978 * ) case "$setlocale_r_proto" in
15979 REENTRANT_PROTO*) ;;
15980 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15982 echo "Prototype: $try" ;;
15985 *) case "$usethreads" in
15986 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
15988 d_setlocale_r=undef
15989 setlocale_r_proto=0
15993 *) setlocale_r_proto=0
15997 : see if setnetent exists
15998 set setnetent d_setnent
16001 : see if setnetent_r exists
16002 set setnetent_r d_setnetent_r
16004 case "$d_setnetent_r" in
16006 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16007 case "$d_setnetent_r_proto:$usethreads" in
16008 ":define") d_setnetent_r_proto=define
16009 set d_setnetent_r_proto setnetent_r $hdrs
16013 case "$d_setnetent_r_proto" in
16015 case "$setnetent_r_proto" in
16016 ''|0) try='int setnetent_r(int, struct netent_data*);'
16017 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16019 case "$setnetent_r_proto" in
16020 ''|0) try='void setnetent_r(int, struct netent_data*);'
16021 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16023 case "$setnetent_r_proto" in
16024 ''|0) d_setnetent_r=undef
16025 setnetent_r_proto=0
16026 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16027 * ) case "$setnetent_r_proto" in
16028 REENTRANT_PROTO*) ;;
16029 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16031 echo "Prototype: $try" ;;
16034 *) case "$usethreads" in
16035 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16037 d_setnetent_r=undef
16038 setnetent_r_proto=0
16042 *) setnetent_r_proto=0
16046 : see if setprotoent exists
16047 set setprotoent d_setpent
16050 : see if setpgid exists
16051 set setpgid d_setpgid
16054 : see if setpgrp2 exists
16055 set setpgrp2 d_setpgrp2
16058 : see if setpriority exists
16059 set setpriority d_setprior
16062 : see if setproctitle exists
16063 set setproctitle d_setproctitle
16066 : see if setprotoent_r exists
16067 set setprotoent_r d_setprotoent_r
16069 case "$d_setprotoent_r" in
16071 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16072 case "$d_setprotoent_r_proto:$usethreads" in
16073 ":define") d_setprotoent_r_proto=define
16074 set d_setprotoent_r_proto setprotoent_r $hdrs
16078 case "$d_setprotoent_r_proto" in
16080 case "$setprotoent_r_proto" in
16081 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16082 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16084 case "$setprotoent_r_proto" in
16085 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16086 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16088 case "$setprotoent_r_proto" in
16089 ''|0) d_setprotoent_r=undef
16090 setprotoent_r_proto=0
16091 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16092 * ) case "$setprotoent_r_proto" in
16093 REENTRANT_PROTO*) ;;
16094 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16096 echo "Prototype: $try" ;;
16099 *) case "$usethreads" in
16100 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16102 d_setprotoent_r=undef
16103 setprotoent_r_proto=0
16107 *) setprotoent_r_proto=0
16111 : see if setpwent exists
16112 set setpwent d_setpwent
16115 : see if setpwent_r exists
16116 set setpwent_r d_setpwent_r
16118 case "$d_setpwent_r" in
16120 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16121 case "$d_setpwent_r_proto:$usethreads" in
16122 ":define") d_setpwent_r_proto=define
16123 set d_setpwent_r_proto setpwent_r $hdrs
16127 case "$d_setpwent_r_proto" in
16129 case "$setpwent_r_proto" in
16130 ''|0) try='int setpwent_r(FILE**);'
16131 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16133 case "$setpwent_r_proto" in
16134 ''|0) try='void setpwent_r(FILE**);'
16135 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16137 case "$setpwent_r_proto" in
16138 ''|0) d_setpwent_r=undef
16140 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16141 * ) case "$setpwent_r_proto" in
16142 REENTRANT_PROTO*) ;;
16143 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16145 echo "Prototype: $try" ;;
16148 *) case "$usethreads" in
16149 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16156 *) setpwent_r_proto=0
16160 : see if setregid exists
16161 set setregid d_setregid
16163 set setresgid d_setresgid
16166 : see if setreuid exists
16167 set setreuid d_setreuid
16169 set setresuid d_setresuid
16172 : see if setrgid exists
16173 set setrgid d_setrgid
16176 : see if setruid exists
16177 set setruid d_setruid
16180 : see if setservent exists
16181 set setservent d_setsent
16184 : see if setservent_r exists
16185 set setservent_r d_setservent_r
16187 case "$d_setservent_r" in
16189 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16190 case "$d_setservent_r_proto:$usethreads" in
16191 ":define") d_setservent_r_proto=define
16192 set d_setservent_r_proto setservent_r $hdrs
16196 case "$d_setservent_r_proto" in
16198 case "$setservent_r_proto" in
16199 ''|0) try='int setservent_r(int, struct servent_data*);'
16200 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16202 case "$setservent_r_proto" in
16203 ''|0) try='void setservent_r(int, struct servent_data*);'
16204 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16206 case "$setservent_r_proto" in
16207 ''|0) d_setservent_r=undef
16208 setservent_r_proto=0
16209 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16210 * ) case "$setservent_r_proto" in
16211 REENTRANT_PROTO*) ;;
16212 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16214 echo "Prototype: $try" ;;
16217 *) case "$usethreads" in
16218 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16220 d_setservent_r=undef
16221 setservent_r_proto=0
16225 *) setservent_r_proto=0
16229 : see if setsid exists
16230 set setsid d_setsid
16233 : see if setvbuf exists
16234 set setvbuf d_setvbuf
16237 : see if sfio.h is available
16242 : see if sfio library is available
16253 : Ok, but do we want to use it.
16257 true|$define|[yY]*) dflt='y';;
16260 echo "$package can use the sfio library, but it is experimental."
16261 case "$useperlio" in
16263 echo "For sfio also the PerlIO abstraction layer is needed."
16264 echo "Earlier you said you wouldn't want that."
16267 rp="You seem to have sfio available, do you want to try using it?"
16270 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16271 useperlio="$define"
16274 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16279 *) case "$usesfio" in
16280 true|$define|[yY]*)
16281 echo "Sorry, cannot find sfio on this machine." >&4
16282 echo "Ignoring your setting of usesfio=$usesfio." >&4
16291 $define) usesfio='true';;
16292 *) usesfio='false';;
16296 *) : Remove sfio from list of libraries to use
16299 echo "Removing unneeded -lsfio from library list" >&4
16300 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16303 echo "libs = $libs" >&4
16310 : see if shmctl exists
16311 set shmctl d_shmctl
16314 : see if shmget exists
16315 set shmget d_shmget
16318 : see if shmat exists
16321 : see what shmat returns
16324 $cat >shmat.c <<'END'
16325 #include <sys/shm.h>
16328 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16333 echo "and it returns ($shmattype)." >&4
16334 : see if a prototype for shmat is available
16335 xxx=`./findhdr sys/shm.h`
16336 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16337 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16348 set d_shmatprototype
16351 : see if shmdt exists
16355 : see how much of the 'shm*(2)' library is present.
16358 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16359 *"$undef"*) h_shm=false;;
16363 case "`ipcs 2>&1`" in
16364 "SVID shared memory"*"not configured"*)
16365 echo "Your $osname does not have the shm*(2) configured." >&4
16368 set shmctl d_shmctl
16370 set shmget d_shmget
16380 : we could also check for sys/ipc.h ...
16381 if $h_shm && $test `./findhdr sys/shm.h`; then
16382 echo "You have the full shm*(2) library." >&4
16385 echo "You don't have the full shm*(2) library." >&4
16392 : see if we have sigaction
16393 if set sigaction val -f d_sigaction; eval $csym; $val; then
16394 echo 'sigaction() found.' >&4
16397 #include <sys/types.h>
16398 #include <signal.h>
16399 #$i_stdlib I_STDLIB
16401 #include <stdlib.h>
16405 struct sigaction act, oact;
16407 oact.sa_handler = 0;
16408 /* so that act and oact are used */
16409 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16413 if eval $compile_ok; then
16416 echo "But you don't seem to have a useable struct sigaction." >&4
16420 echo 'sigaction NOT found.' >&4
16423 set d_sigaction; eval $setvar
16424 $rm -f try try$_o try.c
16426 : see if sigprocmask exists
16427 set sigprocmask d_sigprocmask
16430 : see if sigsetjmp exists
16432 case "$d_sigsetjmp" in
16435 #include <setjmp.h>
16436 #$i_stdlib I_STDLIB
16438 #include <stdlib.h>
16444 if (sigsetjmp(env,1))
16447 siglongjmp(env, 1);
16452 if eval $compile; then
16453 if $run ./try >/dev/null 2>&1; then
16454 echo "POSIX sigsetjmp found." >&4
16458 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16464 echo "sigsetjmp not found." >&4
16468 *) val="$d_sigsetjmp"
16469 case "$d_sigsetjmp" in
16470 $define) echo "POSIX sigsetjmp found." >&4;;
16471 $undef) echo "sigsetjmp not found." >&4;;
16479 : see if sockatmark exists
16480 set sockatmark d_sockatmark
16483 : see if prototype for sockatmark is available
16485 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16488 : see if socks5_init exists
16489 set socks5_init d_socks5_init
16492 : see if srand48_r exists
16493 set srand48_r d_srand48_r
16495 case "$d_srand48_r" in
16497 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16498 case "$d_srand48_r_proto:$usethreads" in
16499 ":define") d_srand48_r_proto=define
16500 set d_srand48_r_proto srand48_r $hdrs
16504 case "$d_srand48_r_proto" in
16506 case "$srand48_r_proto" in
16507 ''|0) try='int srand48_r(long, struct drand48_data*);'
16508 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16510 case "$srand48_r_proto" in
16511 ''|0) d_srand48_r=undef
16513 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16514 * ) case "$srand48_r_proto" in
16515 REENTRANT_PROTO*) ;;
16516 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16518 echo "Prototype: $try" ;;
16521 *) case "$usethreads" in
16522 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16529 *) srand48_r_proto=0
16533 : see if srandom_r exists
16534 set srandom_r d_srandom_r
16536 case "$d_srandom_r" in
16538 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16539 case "$d_srandom_r_proto:$usethreads" in
16540 ":define") d_srandom_r_proto=define
16541 set d_srandom_r_proto srandom_r $hdrs
16545 case "$d_srandom_r_proto" in
16547 case "$srandom_r_proto" in
16548 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16549 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16551 case "$srandom_r_proto" in
16552 ''|0) d_srandom_r=undef
16554 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16555 * ) case "$srandom_r_proto" in
16556 REENTRANT_PROTO*) ;;
16557 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16559 echo "Prototype: $try" ;;
16562 *) case "$usethreads" in
16563 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16570 *) srandom_r_proto=0
16574 : see if prototype for setresgid is available
16576 set d_sresgproto setresgid $i_unistd unistd.h
16579 : see if prototype for setresuid is available
16581 set d_sresuproto setresuid $i_unistd unistd.h
16584 : see if sys/stat.h is available
16585 set sys/stat.h i_sysstat
16589 : see if stat knows about block sizes
16591 echo "Checking to see if your struct stat has st_blocks field..." >&4
16592 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16596 : see if this is a sys/vfs.h system
16597 set sys/vfs.h i_sysvfs
16601 : see if this is a sys/statfs.h system
16602 set sys/statfs.h i_sysstatfs
16607 echo "Checking to see if your system supports struct statfs..." >&4
16608 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
16610 case "$d_statfs_s" in
16611 "$define") echo "Yes, it does." ;;
16612 *) echo "No, it doesn't." ;;
16617 : see if struct statfs knows about f_flags
16618 case "$d_statfs_s" in
16621 echo "Checking to see if your struct statfs has f_flags field..." >&4
16622 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
16626 set d_statfs_f_flags
16630 case "$d_statfs_f_flags" in
16631 "$define") echo "Yes, it does." ;;
16632 *) echo "No, it doesn't." ;;
16636 Checking how to access stdio streams by file descriptor number...
16638 case "$stdio_stream_array" in
16639 '') $cat >try.c <<EOCP
16642 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16646 for s in _iob __iob __sF
16648 set try -DSTDIO_STREAM_ARRAY=$s
16649 if eval $compile; then
16650 case "`$run ./try`" in
16651 yes) stdio_stream_array=$s; break ;;
16655 $rm -f try.* try$exe_ext
16657 case "$stdio_stream_array" in
16659 I can't figure out how to access stdio streams by file descriptor number.
16661 d_stdio_stream_array="$undef"
16664 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16666 d_stdio_stream_array="$define"
16670 : see if strcoll exists
16671 set strcoll d_strcoll
16674 : check for structure copying
16676 echo "Checking to see if your C compiler can copy structs..." >&4
16677 $cat >try.c <<'EOCP'
16687 if $cc -c try.c >/dev/null 2>&1 ; then
16689 echo "Yup, it can."
16692 echo "Nope, it can't."
16698 : see if strerror and/or sys_errlist[] exist
16700 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16701 if set strerror val -f d_strerror; eval $csym; $val; then
16702 echo 'strerror() found.' >&4
16703 d_strerror="$define"
16704 d_strerrm='strerror(e)'
16705 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16706 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16707 d_syserrlst="$define"
16709 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16710 d_syserrlst="$undef"
16712 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16713 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16714 echo 'strerror() found in string header.' >&4
16715 d_strerror="$define"
16716 d_strerrm='strerror(e)'
16717 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16718 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16719 d_syserrlst="$define"
16721 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16722 d_syserrlst="$undef"
16724 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16725 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16726 d_strerror="$undef"
16727 d_syserrlst="$define"
16728 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16730 echo 'strerror() and sys_errlist[] NOT found.' >&4
16731 d_strerror="$undef"
16732 d_syserrlst="$undef"
16733 d_strerrm='"unknown"'
16737 : see if strerror_r exists
16738 set strerror_r d_strerror_r
16740 case "$d_strerror_r" in
16742 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16743 case "$d_strerror_r_proto:$usethreads" in
16744 ":define") d_strerror_r_proto=define
16745 set d_strerror_r_proto strerror_r $hdrs
16749 case "$d_strerror_r_proto" in
16751 case "$strerror_r_proto" in
16752 ''|0) try='int strerror_r(int, char*, size_t);'
16753 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16755 case "$strerror_r_proto" in
16756 ''|0) try='int strerror_r(int, char*, int);'
16757 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16759 case "$strerror_r_proto" in
16760 ''|0) try='char* strerror_r(int, char*, size_t);'
16761 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16763 case "$strerror_r_proto" in
16764 ''|0) d_strerror_r=undef
16766 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16767 * ) case "$strerror_r_proto" in
16768 REENTRANT_PROTO*) ;;
16769 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16771 echo "Prototype: $try" ;;
16774 *) case "$usethreads" in
16775 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16782 *) strerror_r_proto=0
16786 : see if strftime exists
16787 set strftime d_strftime
16790 : see if strlcat exists
16791 set strlcat d_strlcat
16794 : see if strlcpy exists
16795 set strlcpy d_strlcpy
16798 : see if strtod exists
16799 set strtod d_strtod
16802 : see if strtol exists
16803 set strtol d_strtol
16806 : see if strtold exists
16807 set strtold d_strtold
16810 : see if strtoll exists
16811 set strtoll d_strtoll
16814 case "$d_longlong-$d_strtoll" in
16817 Checking whether your strtoll() works okay...
16819 $cat >try.c <<'EOCP'
16822 #define strtoll __strtoll
16825 #define strtoll _strtoll
16828 extern long long int strtoll(char *s, char **, int);
16829 static int bad = 0;
16830 int check(char *s, long long ell, int een) {
16833 gll = strtoll(s, 0, 10);
16834 if (!((gll == ell) && (errno == een)))
16838 check(" 1", 1LL, 0);
16839 check(" 0", 0LL, 0);
16840 check("-1", -1LL, 0);
16841 check("-9223372036854775808", -9223372036854775808LL, 0);
16842 check("-9223372036854775808", -9223372036854775808LL, 0);
16843 check(" 9223372036854775807", 9223372036854775807LL, 0);
16844 check("-9223372036854775808", -9223372036854775808LL, 0);
16845 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16846 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16852 if eval $compile; then
16855 ok) echo "Your strtoll() seems to be working okay." ;;
16857 Your strtoll() doesn't seem to be working okay.
16863 echo "(I can't seem to compile the test program--assuming it doesn't)"
16869 : see if strtoq exists
16870 set strtoq d_strtoq
16873 : see if strtoul exists
16874 set strtoul d_strtoul
16877 case "$d_strtoul" in
16880 Checking whether your strtoul() works okay...
16882 $cat >try.c <<'EOCP'
16885 extern unsigned long int strtoul(char *s, char **, int);
16886 static int bad = 0;
16887 void check(char *s, unsigned long eul, int een) {
16890 gul = strtoul(s, 0, 10);
16891 if (!((gul == eul) && (errno == een)))
16895 check(" 1", 1L, 0);
16896 check(" 0", 0L, 0);
16898 case "$longsize" in
16900 $cat >>try.c <<'EOCP'
16901 check("18446744073709551615", 18446744073709551615UL, 0);
16902 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16903 #if 0 /* strtoul() for /^-/ strings is undefined. */
16904 check("-1", 18446744073709551615UL, 0);
16905 check("-18446744073709551614", 2, 0);
16906 check("-18446744073709551615", 1, 0);
16907 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16908 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16913 $cat >>try.c <<'EOCP'
16914 check("4294967295", 4294967295UL, 0);
16915 check("4294967296", 4294967295UL, ERANGE);
16916 #if 0 /* strtoul() for /^-/ strings is undefined. */
16917 check("-1", 4294967295UL, 0);
16918 check("-4294967294", 2, 0);
16919 check("-4294967295", 1, 0);
16920 check("-4294967296", 4294967295UL, ERANGE);
16921 check("-4294967297", 4294967295UL, ERANGE);
16926 : Should we write these tests to be more portable by sprintf-ing
16927 : ~0 and then manipulating that char string as input for strtol?
16930 $cat >>try.c <<'EOCP'
16937 if eval $compile; then
16938 case "`$run ./try`" in
16939 ok) echo "Your strtoul() seems to be working okay." ;;
16941 Your strtoul() doesn't seem to be working okay.
16950 : see if strtoull exists
16951 set strtoull d_strtoull
16954 case "$d_longlong-$d_strtoull" in
16957 Checking whether your strtoull() works okay...
16959 $cat >try.c <<'EOCP'
16962 #define strtoull __strtoull
16965 extern unsigned long long int strtoull(char *s, char **, int);
16966 static int bad = 0;
16967 int check(char *s, long long eull, int een) {
16970 gull = strtoull(s, 0, 10);
16971 if (!((gull == eull) && (errno == een)))
16975 check(" 1", 1LL, 0);
16976 check(" 0", 0LL, 0);
16977 check("18446744073709551615", 18446744073709551615ULL, 0);
16978 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16979 #if 0 /* strtoull() for /^-/ strings is undefined. */
16980 check("-1", 18446744073709551615ULL, 0);
16981 check("-18446744073709551614", 2LL, 0);
16982 check("-18446744073709551615", 1LL, 0);
16983 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16984 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16991 if eval $compile; then
16992 case "`$run ./try`" in
16993 ok) echo "Your strtoull() seems to be working okay." ;;
16995 Your strtoull() doesn't seem to be working okay.
16997 d_strtoull="$undef"
17004 : see if strtouq exists
17005 set strtouq d_strtouq
17008 case "$d_strtouq" in
17011 Checking whether your strtouq() works okay...
17013 $cat >try.c <<'EOCP'
17016 extern unsigned long long int strtouq(char *s, char **, int);
17017 static int bad = 0;
17018 void check(char *s, unsigned long long eull, int een) {
17019 unsigned long long gull;
17021 gull = strtouq(s, 0, 10);
17022 if (!((gull == eull) && (errno == een)))
17026 check(" 1", 1LL, 0);
17027 check(" 0", 0LL, 0);
17028 check("18446744073709551615", 18446744073709551615ULL, 0);
17029 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17030 #if 0 /* strtouq() for /^-/ strings is undefined. */
17031 check("-1", 18446744073709551615ULL, 0);
17032 check("-18446744073709551614", 2LL, 0);
17033 check("-18446744073709551615", 1LL, 0);
17034 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17035 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17043 if eval $compile; then
17044 case "`$run ./try`" in
17045 ok) echo "Your strtouq() seems to be working okay." ;;
17047 Your strtouq() doesn't seem to be working okay.
17056 : see if strxfrm exists
17057 set strxfrm d_strxfrm
17060 : see if symlink exists
17061 set symlink d_symlink
17064 : see if syscall exists
17065 set syscall d_syscall
17068 : see if prototype for syscall is available
17070 set d_syscallproto syscall $i_unistd unistd.h
17073 : see if sysconf exists
17074 set sysconf d_sysconf
17077 : see if system exists
17078 set system d_system
17081 : see if tcgetpgrp exists
17082 set tcgetpgrp d_tcgetpgrp
17085 : see if tcsetpgrp exists
17086 set tcsetpgrp d_tcsetpgrp
17089 : see if prototype for telldir is available
17091 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17094 : see if time exists
17096 if test "X$d_time" = X -o X"$timetype" = X; then
17097 if set time val -f d_time; eval $csym; $val; then
17098 echo 'time() found.' >&4
17100 rp="What is the type returned by time() on this system?"
17101 set time_t timetype long stdio.h sys/types.h
17104 echo 'time() not found, hope that will do.' >&4
17112 : see if this is a sys/times.h system
17113 set sys/times.h i_systimes
17116 : see if times exists
17118 if set times val -f d_times; eval $csym; $val; then
17119 echo 'times() found.' >&4
17122 case "$i_systimes" in
17123 "$define") inc='sys/times.h';;
17125 rp="What is the type returned by times() on this system?"
17126 set clock_t clocktype long stdio.h sys/types.h $inc
17129 echo 'times() NOT found, hope that will do.' >&4
17134 : see if tmpnam_r exists
17135 set tmpnam_r d_tmpnam_r
17137 case "$d_tmpnam_r" in
17139 hdrs="$i_systypes sys/types.h define stdio.h "
17140 case "$d_tmpnam_r_proto:$usethreads" in
17141 ":define") d_tmpnam_r_proto=define
17142 set d_tmpnam_r_proto tmpnam_r $hdrs
17146 case "$d_tmpnam_r_proto" in
17148 case "$tmpnam_r_proto" in
17149 ''|0) try='char* tmpnam_r(char*);'
17150 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17152 case "$tmpnam_r_proto" in
17153 ''|0) d_tmpnam_r=undef
17155 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17156 * ) case "$tmpnam_r_proto" in
17157 REENTRANT_PROTO*) ;;
17158 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17160 echo "Prototype: $try" ;;
17163 *) case "$usethreads" in
17164 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17171 *) tmpnam_r_proto=0
17175 : see if truncate exists
17176 set truncate d_truncate
17179 : see if ttyname_r exists
17180 set ttyname_r d_ttyname_r
17182 case "$d_ttyname_r" in
17184 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17185 case "$d_ttyname_r_proto:$usethreads" in
17186 ":define") d_ttyname_r_proto=define
17187 set d_ttyname_r_proto ttyname_r $hdrs
17191 case "$d_ttyname_r_proto" in
17193 case "$ttyname_r_proto" in
17194 ''|0) try='int ttyname_r(int, char*, size_t);'
17195 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17197 case "$ttyname_r_proto" in
17198 ''|0) try='int ttyname_r(int, char*, int);'
17199 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17201 case "$ttyname_r_proto" in
17202 ''|0) try='char* ttyname_r(int, char*, int);'
17203 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17205 case "$ttyname_r_proto" in
17206 ''|0) d_ttyname_r=undef
17208 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17209 * ) case "$ttyname_r_proto" in
17210 REENTRANT_PROTO*) ;;
17211 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17213 echo "Prototype: $try" ;;
17216 *) case "$usethreads" in
17217 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17224 *) ttyname_r_proto=0
17228 : see if tzname[] exists
17230 if set tzname val -a d_tzname; eval $csym; $val; then
17232 echo 'tzname[] found.' >&4
17235 echo 'tzname[] NOT found.' >&4
17241 next|rhapsody|darwin) multiarch="$define" ;;
17243 case "$multiarch" in
17244 ''|[nN]*) multiarch="$undef" ;;
17247 : check for ordering of bytes in a UV
17249 case "$usecrosscompile$multiarch" in
17252 You seem to be either cross-compiling or doing a multiarchitecture build,
17253 skipping the byteorder check.
17259 case "$byteorder" in
17262 In the following, larger digits indicate more significance. A big-endian
17263 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17264 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17265 machines may have weird orders like 3412. A Cray will report 87654321,
17266 an Alpha will report 12345678. If the test program works the default is
17268 I'm now running the test program...
17272 #$i_stdlib I_STDLIB
17274 #include <stdlib.h>
17276 #include <sys/types.h>
17277 typedef $uvtype UV;
17287 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17289 u.l = (UV)0x04030201;
17290 for (i = 0; i < $uvsize; i++)
17291 printf("%c", u.c[i]+'0');
17298 if eval $compile && ./try > /dev/null; then
17301 [1-4][1-4][1-4][1-4]|12345678|87654321)
17302 echo "(The test program ran ok.)"
17303 echo "byteorder=$dflt"
17306 ????|????????) echo "(The test program ran ok.)" ;;
17307 *) echo "(The test program didn't run right for some reason.)" ;;
17312 (I can't seem to compile the test program. Guessing big-endian...)
17315 case "$xxx_prompt" in
17317 rp="What is the order of bytes in $uvtype?"
17333 Checking to see whether you can access character data unalignedly...
17335 case "$d_u32align" in
17336 '') $cat >try.c <<EOCP
17338 #$i_stdlib I_STDLIB
17340 #include <stdlib.h>
17342 #define U32 $u32type
17343 #define BYTEORDER 0x$byteorder
17345 #include <signal.h>
17347 $signal_t bletch(s) int s; { exit(4); }
17350 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17355 if (sizeof(U32) != 4) {
17356 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17363 signal(SIGBUS, bletch);
17375 for (i = 0; i < 4; i++) {
17376 up = (U32*)(buf + i);
17377 if (! ((*up == 1 << (8*i)) || /* big-endian */
17378 (*up == 1 << (8*(3-i))) /* little-endian */
17382 printf("read failed (%x)\n", *up);
17388 for (i = 0; i < 4; i++) {
17389 up = (U32*)(buf + i);
17391 if (*up != 0xBeef) {
17392 printf("write failed (%x)\n", *up);
17406 if eval $compile_ok; then
17407 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17408 $run ./try 2>&1 >/dev/null
17411 You can access character data pretty unalignedly.
17413 d_u32align="$undef"
17416 It seems that you must access character data in an aligned manner.
17418 d_u32align="$define"
17422 rp='Can you access character data at unaligned addresses?'
17426 [yY]*) d_u32align="$undef" ;;
17427 *) d_u32align="$define" ;;
17430 $rm -f core core.try.* try.core
17434 : see if ualarm exists
17435 set ualarm d_ualarm
17438 : see if umask exists
17442 : see if unordered exists
17443 set unordered d_unordered
17446 : see if usleep exists
17447 set usleep d_usleep
17450 : see if prototype for usleep is available
17452 set d_usleepproto usleep $i_unistd unistd.h
17455 : see if ustat exists
17459 : backward compatibility for d_hvfork
17460 if test X$d_hvfork != X; then
17461 d_vfork="$d_hvfork"
17464 : see if there is a vfork
17469 : Ok, but do we want to use it. vfork is reportedly unreliable in
17470 : perl on Solaris 2.x, and probably elsewhere.
17474 case "$usevfork" in
17480 Perl can only use a vfork() that doesn't suffer from strict
17481 restrictions on calling functions or modifying global data in
17482 the child. For example, glibc-2.1 contains such a vfork()
17483 that is unsuitable. If your system provides a proper fork()
17484 call, chances are that you do NOT want perl to use vfork().
17487 rp="Do you still want to use vfork()?"
17492 echo "Ok, we won't use vfork()."
17501 $define) usevfork='true';;
17502 *) usevfork='false';;
17505 : see if closedir exists
17506 set closedir d_closedir
17509 case "$d_closedir" in
17512 echo "Checking whether closedir() returns a status..." >&4
17514 #$i_dirent I_DIRENT /**/
17515 #$i_sysdir I_SYS_DIR /**/
17516 #$i_sysndir I_SYS_NDIR /**/
17517 #$i_systypes I_SYS_TYPES /**/
17519 #if defined(I_SYS_TYPES)
17520 #include <sys/types.h>
17522 #if defined(I_DIRENT)
17523 #include <dirent.h>
17524 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17525 #include <sys/dir.h>
17529 #include <sys/ndir.h>
17533 #include <ndir.h> /* may be wrong in the future */
17535 #include <sys/dir.h>
17540 int main() { return closedir(opendir(".")); }
17543 if eval $compile_ok; then
17544 if $run ./try > /dev/null 2>&1 ; then
17545 echo "Yes, it does."
17548 echo "No, it doesn't."
17552 echo "(I can't seem to compile the test program--assuming it doesn't)"
17560 set d_void_closedir
17563 : see if there is a wait4
17567 : see if waitpid exists
17568 set waitpid d_waitpid
17571 : see if wcstombs exists
17572 set wcstombs d_wcstombs
17575 : see if wctomb exists
17576 set wctomb d_wctomb
17579 : see if writev exists
17580 set writev d_writev
17583 : preserve RCS keywords in files with variable substitution, grrr
17588 Revision='$Revision'
17590 : check for alignment requirements
17592 case "$usecrosscompile$multiarch" in
17595 You seem to be either cross-compiling or doing a multiarchitecture build,
17596 skipping the memory alignment check.
17599 case "$alignbytes" in
17600 '') alignbytes=8 ;;
17604 case "$alignbytes" in
17605 '') echo "Checking alignment constraints..." >&4
17606 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17607 $cat >try.c <<'EOCP'
17608 typedef long double NV;
17611 $cat >try.c <<'EOCP'
17615 $cat >>try.c <<'EOCP'
17623 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17628 if eval $compile_ok; then
17632 echo "(I can't seem to compile the test program...)"
17635 *) dflt="$alignbytes"
17638 rp="Doubles must be aligned on a how-many-byte boundary?"
17646 : set the base revision
17649 : how do we concatenate cpp tokens here?
17651 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17652 $cat >cpp_stuff.c <<'EOCP'
17653 #define RCAT(a,b)a/**/b
17654 #define ACAT(a,b)a ## b
17658 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17659 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17660 echo "Oh! Smells like ANSI's been here." >&4
17661 echo "We can catify or stringify, separately or together!"
17663 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17664 echo "Ah, yes! The good old days!" >&4
17665 echo "However, in the good old days we don't know how to stringify and"
17666 echo "catify at the same time."
17670 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17671 You're going to have to edit the values of CAT[2-5] in config.h...
17673 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17677 : see if this is a db.h system
17683 : Check db version.
17685 echo "Checking Berkeley DB version ..." >&4
17691 #include <sys/types.h>
17693 #$i_stdlib I_STDLIB
17695 #include <stdlib.h>
17698 int main(int argc, char *argv[])
17700 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17701 int Major, Minor, Patch ;
17702 unsigned long Version ;
17703 (void)db_version(&Major, &Minor, &Patch) ;
17705 printf("%d %d %d %d %d %d\n",
17706 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17707 Major, Minor, Patch);
17710 printf("You have Berkeley DB Version 2 or greater.\n");
17712 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17713 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17714 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17715 Major, Minor, Patch) ;
17717 /* check that db.h & libdb are compatible */
17718 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17719 printf("db.h and libdb are incompatible.\n") ;
17723 printf("db.h and libdb are compatible.\n") ;
17725 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17726 + DB_VERSION_PATCH ;
17728 /* needs to be >= 2.3.4 */
17729 if (Version < 2003004) {
17730 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17731 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17737 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17742 printf("You have Berkeley DB Version 1.\n");
17743 exit(0); /* DB version < 2: the coast is clear. */
17745 exit(1); /* <db.h> not Berkeley DB? */
17751 if eval $compile_ok && $run ./try; then
17752 echo 'Looks OK.' >&4
17754 db_version_major=$1
17755 db_version_minor=$2
17756 db_version_patch=$3
17758 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17762 : Remove db from list of libraries to use
17763 echo "Removing unusable -ldb from library list" >&4
17764 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17767 echo "libs = $libs" >&4
17777 : Check the return type needed for hash
17779 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17785 #include <sys/types.h>
17788 #ifndef DB_VERSION_MAJOR
17789 u_int32_t hash_cb (ptr, size)
17797 info.hash = hash_cb;
17801 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17802 if $contains warning try.out >>/dev/null 2>&1 ; then
17805 db_hashtype='u_int32_t'
17808 : XXX Maybe we should just give up here.
17809 db_hashtype=u_int32_t
17811 echo "Help: I can't seem to compile the db test program." >&4
17812 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17815 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17817 *) db_hashtype=u_int32_t
17822 : Check the return type needed for prefix
17824 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17830 #include <sys/types.h>
17833 #ifndef DB_VERSION_MAJOR
17834 size_t prefix_cb (key1, key2)
17842 info.prefix = prefix_cb;
17846 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17847 if $contains warning try.out >>/dev/null 2>&1 ; then
17848 db_prefixtype='int'
17850 db_prefixtype='size_t'
17853 db_prefixtype='size_t'
17854 : XXX Maybe we should just give up here.
17856 echo "Help: I can't seem to compile the db test program." >&4
17857 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17860 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17862 *) db_prefixtype='size_t'
17867 : How can we generate normalized random numbers ?
17869 echo "Looking for a random number function..." >&4
17870 case "$randfunc" in
17872 if set drand48 val -f; eval $csym; $val; then
17874 echo "Good, found drand48()." >&4
17875 elif set random val -f; eval $csym; $val; then
17877 echo "OK, found random()." >&4
17880 echo "Yick, looks like I have to use rand()." >&4
17891 *-Dmy_rand=*|*-Dmy_srand=*)
17892 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17893 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17894 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17895 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17899 while $test "$cont"; do
17900 rp="Use which function to generate random numbers?"
17902 if $test "$ans" = "$dflt"; then
17908 if set $ans val -f; eval $csym; $val; then
17912 rp="I cannot find function $ans. Use that name anyway?"
17921 case "$randfunc" in
17923 drand01="drand48()"
17929 case "$randbits" in
17931 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17933 #$i_unistd I_UNISTD
17934 #$i_stdlib I_STDLIB
17937 # include <unistd.h>
17940 # include <stdlib.h>
17945 register unsigned long tmp;
17946 register unsigned long max = 0L;
17948 for (i = 1000; i; i--) {
17949 tmp = (unsigned long) $randfunc();
17950 if (tmp > max) max = tmp;
17952 for (i = 0; max; i++)
17958 if eval $compile_ok; then
17962 echo "(I can't seem to compile the test program...)"
17969 rp="How many bits does your $randfunc() function produce?"
17973 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17974 seedfunc="s$randfunc"
17975 randseedtype=unsigned
17979 rp="How many bits does your $randfunc() function produce?"
17982 seedfunc="s$randfunc"
17983 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17984 if set $seedfunc val -f; eval $csym; $val; then
17985 echo "(Using $seedfunc() to seed random generator)"
17987 echo "(Warning: no $seedfunc() to seed random generator)"
17990 randseedtype=unsigned
17998 echo "Determining whether or not we are on an EBCDIC system..." >&4
17999 $cat >try.c <<'EOM'
18002 if ('M'==0xd4) return 0;
18009 if eval $compile_ok; then
18010 if $run ./try; then
18011 echo "You seem to speak EBCDIC." >&4
18014 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18017 echo "I'm unable to compile the test program." >&4
18018 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18026 Checking how to flush all pending stdio output...
18028 # I only know how to find the first 32 possibly open files on SunOS.
18029 # See also hints/sunos_4_1.sh and util.c --AD
18031 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18033 $cat >>try.c <<EOCP
18035 #$i_stdlib I_STDLIB
18037 #include <stdlib.h>
18039 #$i_unistd I_UNISTD
18041 # include <unistd.h>
18043 #$d_sysconf HAS_SYSCONF
18044 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18045 #ifdef HAS_STDIO_STREAM_ARRAY
18046 # define STDIO_STREAM_ARRAY $stdio_stream_array
18051 p = fopen("try.out", "w");
18055 # ifdef TRY_FPRINTF
18059 #ifdef TRY_FFLUSH_NULL
18062 #ifdef TRY_FFLUSH_ALL
18064 long open_max = -1;
18065 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18066 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18068 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18069 open_max = sysconf(_SC_OPEN_MAX);
18072 open_max = FOPEN_MAX;
18075 open_max = OPEN_MAX;
18084 # ifdef HAS_STDIO_STREAM_ARRAY
18085 if (open_max > 0) {
18087 for (i = 0; i < open_max; i++)
18088 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18089 STDIO_STREAM_ARRAY[i]._file < open_max &&
18090 STDIO_STREAM_ARRAY[i]._flag)
18091 fflush(&STDIO_STREAM_ARRAY[i]);
18099 : first we have to find out how _not_ to flush
18101 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18103 set try -DTRY_FPUTC
18104 if eval $compile; then
18105 $run ./try 2>/dev/null
18108 if $test ! -s try.out -a "X$code" = X42; then
18114 set try -DTRY_FPRINTF
18115 if eval $compile; then
18116 $run ./try 2>/dev/null
18119 if $test ! -s try.out -a "X$code" = X42; then
18120 output=-DTRY_FPRINTF
18126 : check for fflush NULL behaviour
18127 case "$fflushNULL" in
18128 '') set try -DTRY_FFLUSH_NULL $output
18129 if eval $compile; then
18130 $run ./try 2>/dev/null
18133 if $test -s try.out -a "X$code" = X42; then
18134 fflushNULL="`$cat try.out`"
18136 if $test "X$code" != X42; then
18138 (If this test failed, don't worry, we'll try another method shortly.)
18143 $rm -f core try.core core.try.*
18144 case "$fflushNULL" in
18146 Your fflush(NULL) works okay for output streams.
18147 Let's see if it clobbers input pipes...
18149 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18150 # bug that improperly flushes the input end of pipes. So we avoid the
18151 # autoflush on fork/system/exec support for now. :-(
18152 $cat >tryp.c <<EOCP
18155 main(int argc, char **argv)
18161 while ((i = getc(stdin)) != -1
18162 && (*bp++ = i) != '\n'
18163 && bp < &buf[1024])
18166 fprintf(stdout, "%s", buf);
18174 fflushNULL="$define"
18176 if eval $compile; then
18178 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18179 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18181 fflush(NULL) seems to behave okay with input streams.
18183 fflushNULL="$define"
18186 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18188 fflushNULL="$undef"
18191 $rm -f core tryp.c tryp.core core.tryp.*
18194 Your fflush(NULL) isn't working (contrary to ANSI C).
18196 fflushNULL="$undef"
18199 Cannot figure out whether your fflush(NULL) works or not.
18200 I'm assuming it doesn't (contrary to ANSI C).
18202 fflushNULL="$undef"
18206 $define|true|[yY]*)
18207 fflushNULL="$define"
18210 fflushNULL="$undef"
18213 : check explicit looping only if NULL did not work, and if the pipe
18214 : bug does not show up on an explicit flush too
18215 case "$fflushNULL" in
18217 $cat >tryp.c <<EOCP
18220 main(int argc, char **argv)
18226 while ((i = getc(stdin)) != -1
18227 && (*bp++ = i) != '\n'
18228 && bp < &buf[1024])
18231 fprintf(stdout, "%s", buf);
18240 if eval $compile; then
18242 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18243 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18245 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18247 : now check for fflushall behaviour
18248 case "$fflushall" in
18249 '') set try -DTRY_FFLUSH_ALL $output
18250 if eval $compile; then
18252 (Now testing the other method--but note that this also may fail.)
18254 $run ./try 2>/dev/null
18257 if $test -s try.out -a "X$code" = X42; then
18258 fflushall="`$cat try.out`"
18261 $rm -f core try.core core.try.*
18262 case "$fflushall" in
18264 Whew. Flushing explicitly all the stdio streams works.
18266 fflushall="$define"
18269 Sigh. Flushing explicitly all the stdio streams doesn't work.
18274 Cannot figure out whether flushing stdio streams explicitly works or not.
18275 I'm assuming it doesn't.
18281 "$define"|true|[yY]*)
18282 fflushall="$define"
18290 All is futile. Even fflush(stdin) clobbers input pipes!
18297 $rm -f core tryp.c tryp.core core.tryp.*
18299 *) fflushall="$undef"
18303 case "$fflushNULL$fflushall" in
18306 OK, I give up. I cannot figure out how to flush pending stdio output.
18307 We won't be flushing handles at all before fork/exec/popen.
18311 $rm -f try.* try$exe_ext
18313 : Store the full pathname to the ar program for use in the C program
18314 : Respect a hint or command line value for full_ar.
18319 : Store the full pathname to the sed program for use in the C program
18322 : see what type gids are declared as in the kernel
18324 echo "Looking for the type for group ids returned by getgid()."
18325 set gid_t gidtype xxx stdio.h sys/types.h
18329 xxx=`./findhdr sys/user.h`
18330 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18332 unsigned) dflt="$1 $2" ;;
18336 *) dflt="$gidtype";;
18339 gid_t) echo "gid_t found." ;;
18340 *) rp="What is the type for group ids returned by getgid()?"
18348 *_t) zzz="$gidtype" ;;
18351 echo "Checking the size of $zzz..." >&4
18353 #include <sys/types.h>
18355 #$i_stdlib I_STDLIB
18357 #include <stdlib.h>
18360 printf("%d\n", (int)sizeof($gidtype));
18365 if eval $compile_ok; then
18369 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18372 echo "Your $zzz is $gidsize bytes long."
18377 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18383 *_t) zzz="$gidtype" ;;
18386 echo "Checking the sign of $zzz..." >&4
18388 #include <sys/types.h>
18399 if eval $compile; then
18403 echo "(I can't execute the test program--guessing unsigned.)" >&4
18407 1) echo "Your $zzz is unsigned." ;;
18408 -1) echo "Your $zzz is signed." ;;
18414 echo "(I can't compile the test program--guessing unsigned.)" >&4
18420 if $test X"$quadtype" != X; then
18422 echo "Checking how to print 64-bit integers..." >&4
18424 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18425 $cat >try.c <<'EOCP'
18426 #include <sys/types.h>
18429 int q = 12345678901;
18430 printf("%ld\n", q);
18434 if eval $compile; then
18438 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18439 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18440 echo "We will use %d."
18446 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18447 $cat >try.c <<'EOCP'
18448 #include <sys/types.h>
18451 long q = 12345678901;
18452 printf("%ld\n", q);
18456 if eval $compile; then
18460 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18461 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18462 echo "We will use %ld."
18468 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18469 $cat >try.c <<'EOCP'
18470 #include <sys/types.h>
18471 #include <inttypes.h>
18474 int64_t q = 12345678901;
18475 printf("%" PRId64 "\n", q);
18479 if eval $compile; then
18483 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18484 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18485 echo "We will use the C9X style."
18491 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18493 #include <sys/types.h>
18496 $quadtype q = 12345678901;
18497 printf("%Ld\n", q);
18501 if eval $compile; then
18505 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18506 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18507 echo "We will use %Ld."
18513 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18514 $cat >try.c <<'EOCP'
18515 #include <sys/types.h>
18518 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18519 printf("%lld\n", q);
18523 if eval $compile; then
18527 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18528 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18529 echo "We will use the %lld style."
18535 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18537 #include <sys/types.h>
18540 $quadtype q = 12345678901;
18541 printf("%qd\n", q);
18545 if eval $compile; then
18549 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18550 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18551 echo "We will use %qd."
18557 if $test X"$sPRId64" = X; then
18558 echo "Cannot figure out how to print 64-bit integers." >&4
18566 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18567 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18569 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18570 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18576 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18578 if $test X"$ivsize" = X8; then
18579 ivdformat="$sPRId64"
18580 uvuformat="$sPRIu64"
18581 uvoformat="$sPRIo64"
18582 uvxformat="$sPRIx64"
18583 uvXUformat="$sPRIXU64"
18585 if $test X"$ivsize" = X"$longsize"; then
18592 if $test X"$ivsize" = X"$intsize"; then
18600 if $test X"$ivsize" = X"$shortsize"; then
18611 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18612 nveformat="$sPRIeldbl"
18613 nvfformat="$sPRIfldbl"
18614 nvgformat="$sPRIgldbl"
18615 nvEUformat="$sPRIEUldbl"
18616 nvFUformat="$sPRIFUldbl"
18617 nvGUformat="$sPRIGUldbl"
18627 case "$ivdformat" in
18628 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18635 $echo "Checking the format string to be used for gids..." >&4
18638 -1) if $test X"$gidsize" = X"$ivsize"; then
18639 gidformat="$ivdformat"
18641 if $test X"$gidsize" = X"$longsize"; then
18644 if $test X"$gidsize" = X"$intsize"; then
18647 if $test X"$gidsize" = X"$shortsize"; then
18654 *) if $test X"$gidsize" = X"$uvsize"; then
18655 gidformat="$uvuformat"
18657 if $test X"$gidsize" = X"$longsize"; then
18660 if $test X"$gidsize" = X"$intsize"; then
18663 if $test X"$gidsize" = X"$shortsize"; then
18672 : see if getgroups exists
18673 set getgroups d_getgrps
18676 : see if setgroups exists
18677 set setgroups d_setgrps
18681 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18683 case "$d_getgrps$d_setgrps" in
18685 case "$groupstype" in
18686 '') dflt="$gidtype" ;;
18687 *) dflt="$groupstype" ;;
18690 What type of pointer is the second argument to getgroups() and setgroups()?
18691 Usually this is the same as group ids, $gidtype, but not always.
18694 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18698 *) groupstype="$gidtype";;
18702 echo "Checking if your $make program sets \$(MAKE)..." >&4
18703 case "$make_set_make" in
18705 $sed 's/^X //' > testmake.mak << 'EOF'
18707 X @echo 'maketemp="$(MAKE)"'
18709 case "`$make -f testmake.mak 2>/dev/null`" in
18710 *maketemp=*) make_set_make='#' ;;
18711 *) make_set_make="MAKE=$make" ;;
18713 $rm -f testmake.mak
18716 case "$make_set_make" in
18717 '#') echo "Yup, it does.";;
18718 *) echo "Nope, it doesn't.";;
18721 : see what type is used for mode_t
18722 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18723 set mode_t modetype int stdio.h sys/types.h
18726 : see if stdarg is available
18728 if $test `./findhdr stdarg.h`; then
18729 echo "<stdarg.h> found." >&4
18732 echo "<stdarg.h> NOT found." >&4
18736 : see if varags is available
18738 if $test `./findhdr varargs.h`; then
18739 echo "<varargs.h> found." >&4
18741 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18744 : set up the varargs testing programs
18745 $cat > varargs.c <<EOP
18747 #include <stdarg.h>
18750 #include <varargs.h>
18754 int f(char *p, ...)
18768 p = va_arg(ap, char *);
18773 $cat > varargs <<EOP
18775 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18784 : now check which varargs header should be included
18789 if `./varargs I_STDARG`; then
18791 elif `./varargs I_VARARGS`; then
18796 if `./varargs I_VARARGS`; then
18803 echo "I could not find the definition for va_dcl... You have problems..." >&4
18804 val="$undef"; set i_stdarg; eval $setvar
18805 val="$undef"; set i_varargs; eval $setvar
18810 case "$i_varhdr" in
18812 val="$define"; set i_stdarg; eval $setvar
18813 val="$undef"; set i_varargs; eval $setvar
18816 val="$undef"; set i_stdarg; eval $setvar
18817 val="$define"; set i_varargs; eval $setvar
18820 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18824 : see if we need va_copy
18826 case "$i_stdarg" in
18829 #include <stdarg.h>
18831 #$i_stdlib I_STDLIB
18833 #include <stdlib.h>
18835 #include <signal.h>
18838 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18840 return vfprintf(f, fmt, *valp);
18844 myvfprintf(FILE *f, const char *fmt, va_list val)
18846 return ivfprintf(f, fmt, &val);
18850 myprintf(char *fmt, ...)
18853 va_start(val, fmt);
18854 return myvfprintf(stdout, fmt, val);
18858 main(int ac, char **av)
18860 signal(SIGSEGV, exit);
18862 myprintf("%s%cs all right, then\n", "that", '\'');
18867 if eval $compile && $run ./try 2>&1 >/dev/null; then
18868 case "`$run ./try`" in
18869 "that's all right, then")
18875 yes) echo "It seems that you don't need va_copy()." >&4
18876 need_va_copy="$undef"
18878 *) echo "It seems that va_copy() or similar will be needed." >&4
18879 need_va_copy="$define"
18882 $rm -f try.* core core.* *.core *.core.*
18884 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18888 : see what type is used for size_t
18889 rp="What is the type used for the length parameter for string functions?"
18890 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18893 : check for type of arguments to gethostbyaddr.
18894 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18895 case "$d_gethbyaddr" in
18899 Checking to see what type of arguments are accepted by gethostbyaddr().
18901 hdrs="$define sys/types.h
18902 $d_socket sys/socket.h
18903 $i_niin netinet/in.h
18905 $i_unistd unistd.h"
18906 : The first arg can 'char *' or 'void *'
18907 : The second arg is some of integral type
18908 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18909 for yyy in size_t long int; do
18910 case "$netdb_host_type" in
18911 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18912 if ./protochk "$try" $hdrs; then
18913 echo "Your system accepts $xxx for the first arg."
18914 echo "...and $yyy for the second arg."
18915 netdb_host_type="$xxx"
18916 netdb_hlen_type="$yyy"
18922 : In case none of those worked, prompt the user.
18923 case "$netdb_host_type" in
18924 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18927 netdb_host_type=$ans
18928 rp='What is the type for the 2nd argument to gethostbyaddr?'
18931 netdb_hlen_type=$ans
18935 *) : no gethostbyaddr, so pick harmless defaults
18936 netdb_host_type='char *'
18937 netdb_hlen_type="$sizetype"
18940 # Remove the "const" if needed. -- but then we'll have a
18942 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18945 : check for type of argument to gethostbyname.
18946 if test "X$netdb_name_type" = X ; then
18947 case "$d_gethbyname" in
18951 Checking to see what type of argument is accepted by gethostbyname().
18953 hdrs="$define sys/types.h
18954 $d_socket sys/socket.h
18955 $i_niin netinet/in.h
18957 $i_unistd unistd.h"
18958 for xxx in "const char *" "char *"; do
18959 case "$netdb_name_type" in
18960 '') try="extern struct hostent *gethostbyname($xxx);"
18961 if ./protochk "$try" $hdrs; then
18962 echo "Your system accepts $xxx."
18963 netdb_name_type="$xxx"
18968 : In case none of those worked, prompt the user.
18969 case "$netdb_name_type" in
18970 '') rp='What is the type for the 1st argument to gethostbyname?'
18973 netdb_name_type=$ans
18977 *) : no gethostbyname, so pick harmless default
18978 netdb_name_type='char *'
18983 : check for type of 1st argument to getnetbyaddr.
18984 if test "X$netdb_net_type" = X ; then
18985 case "$d_getnbyaddr" in
18989 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18991 hdrs="$define sys/types.h
18992 $d_socket sys/socket.h
18993 $i_niin netinet/in.h
18995 $i_unistd unistd.h"
18996 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
18997 case "$netdb_net_type" in
18998 '') try="extern struct netent *getnetbyaddr($xxx, int);"
18999 if ./protochk "$try" $hdrs; then
19000 echo "Your system accepts $xxx."
19001 netdb_net_type="$xxx"
19006 : In case none of those worked, prompt the user.
19007 case "$netdb_net_type" in
19008 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19011 netdb_net_type=$ans
19015 *) : no getnetbyaddr, so pick harmless default
19016 netdb_net_type='long'
19020 : locate the preferred pager for this system
19027 [a-zA-Z]:/*) dflt=$pg;;
19031 [a-zA-Z]:/*) dflt=$more;;
19035 [a-zA-Z]:/*) dflt=$less;;
19038 '') dflt=/usr/ucb/more;;
19042 : Instruct ./getfile to trust the hinted or previous pager value,
19043 : even if it does not begin with a slash. For example, on os2,
19044 : pager might be cmd /c more. See comments in UU/getfile.
19049 rp='What pager is used on your system?'
19053 : see what type pids are declared as in the kernel
19054 rp="What is the type of process ids on this system?"
19055 set pid_t pidtype int stdio.h sys/types.h
19058 : see if ar generates random libraries by itself
19060 echo "Checking how to generate random libraries on your machine..." >&4
19061 echo 'int bar1() { return bar2(); }' > bar1.c
19062 echo 'int bar2() { return 2; }' > bar2.c
19064 #$i_stdlib I_STDLIB
19066 #include <stdlib.h>
19068 int main() { printf("%d\n", bar1()); exit(0); }
19070 $cc $ccflags -c bar1.c >/dev/null 2>&1
19071 $cc $ccflags -c bar2.c >/dev/null 2>&1
19072 $cc $ccflags -c foo.c >/dev/null 2>&1
19073 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19074 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19075 $run ./foobar >/dev/null 2>&1; then
19076 echo "$ar appears to generate random libraries itself."
19079 elif $ar ts bar$_a >/dev/null 2>&1 &&
19080 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19081 $run ./foobar >/dev/null 2>&1; then
19082 echo "a table of contents needs to be added with '$ar ts'."
19089 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19090 $test -f $ranlib || ranlib=''
19093 if $test -n "$ranlib"; then
19094 echo "your system has '$ranlib'; we'll use that."
19097 echo "your system doesn't seem to support random libraries"
19098 echo "so we'll use lorder and tsort to order the libraries."
19105 : check for type of arguments to select.
19106 case "$selecttype" in
19107 '') case "$d_select" in
19111 Checking to see what type of arguments are accepted by select().
19113 hdrs="$define sys/types.h
19114 $i_systime sys/time.h
19115 $i_sysselct sys/select.h
19116 $d_socket sys/socket.h"
19117 : The first arg can be int, unsigned, or size_t
19118 : The last arg may or may not be 'const'
19120 : void pointer has been seen but using that
19121 : breaks the selectminbits test
19122 for xxx in 'fd_set *' 'int *'; do
19123 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19124 for tmo in 'struct timeval *' 'const struct timeval *'; do
19126 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19127 if ./protochk "$try" $hdrs; then
19128 echo "Your system accepts $xxx."
19137 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19138 case "$d_fd_set" in
19139 $define) dflt="fd_set *" ;;
19148 *) : no select, so pick a harmless default
19155 : check for the select 'width'
19156 case "$selectminbits" in
19157 '') safebits=`expr $ptrsize \* 8`
19158 case "$d_select" in
19162 Checking to see on how many bits at a time your select() operates...
19165 #include <sys/types.h>
19167 #$i_systime I_SYS_TIME
19168 #$i_systimek I_SYS_TIME_KERNEL
19173 # ifdef I_SYS_TIME_KERNEL
19176 # include <sys/time.h>
19177 # ifdef I_SYS_TIME_KERNEL
19181 #$i_sysselct I_SYS_SELECT
19182 #ifdef I_SYS_SELECT
19183 #include <sys/select.h>
19185 #$d_socket HAS_SOCKET
19187 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19190 #$i_stdlib I_STDLIB
19192 #include <stdlib.h>
19195 #define S sizeof(*(b))
19197 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19198 #define NBITS (NBYTES * 8)
19200 char *s = malloc(NBYTES);
19209 fp = fopen("try.c", "r");
19215 b = ($selecttype)s;
19216 for (i = 0; i < NBITS; i++)
19220 select(fd + 1, b, 0, 0, &t);
19221 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19223 printf("%d\n", i + 1);
19228 if eval $compile_ok; then
19229 selectminbits=`$run ./try`
19230 case "$selectminbits" in
19232 Cannot figure out on how many bits at a time your select() operates.
19233 I'll play safe and guess it is $safebits bits.
19235 selectminbits=$safebits
19236 bits="$safebits bits"
19239 *) bits="$selectminbits bits" ;;
19241 echo "Your select() operates on $bits at a time." >&4
19243 rp='What is the minimum number of bits your select() operates on?'
19244 case "$byteorder" in
19245 12345678) dflt=64 ;;
19251 selectminbits="$val"
19255 *) : no select, so pick a harmless default
19256 selectminbits=$safebits
19262 : Trace out the files included by signal.h, then look for SIGxxx names.
19263 : Remove SIGARRAYSIZE used by HPUX.
19264 : Remove SIGSTKSIZE used by Linux.
19265 : Remove SIGSTKSZ used by Posix.
19266 : Remove SIGTYP void lines used by OS2.
19267 : Some cpps, like os390, dont give the file name anywhere
19268 if [ "X$fieldn" = X ]; then
19269 : Just make some guesses. We check them later.
19270 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19272 xxx=`echo '#include <signal.h>' |
19273 $cppstdin $cppminus $cppflags 2>/dev/null |
19274 $grep '^[ ]*#.*include' |
19275 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19277 : Check this list of files to be sure we have parsed the cpp output ok.
19278 : This will also avoid potentially non-existent files, such
19281 for xx in $xxx /dev/null ; do
19282 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19284 : If we have found no files, at least try signal.h
19285 case "$xxxfiles" in
19286 '') xxxfiles=`./findhdr signal.h` ;;
19289 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19290 print substr($2, 4, 20)
19292 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19293 print substr($3, 4, 20)
19295 : Append some common names just in case the awk scan failed.
19296 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19297 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19298 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19299 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19300 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19302 : generate a few handy files for later
19303 $cat > signal.c <<EOCP
19304 #include <sys/types.h>
19305 #include <signal.h>
19306 #$i_stdlib I_STDLIB
19308 #include <stdlib.h>
19313 /* Strange style to avoid deeply-nested #if/#else/#endif */
19316 # define NSIG (_NSIG)
19322 # define NSIG (SIGMAX+1)
19328 # define NSIG (SIG_MAX+1)
19334 # define NSIG (MAXSIG+1)
19340 # define NSIG (MAX_SIG+1)
19345 # ifdef SIGARRAYSIZE
19346 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
19352 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19356 /* Default to some arbitrary number that's big enough to get most
19357 of the common signals.
19363 printf("NSIG %d\n", NSIG);
19369 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19371 printf "#ifdef SIG"; printf $1; printf "\n"
19372 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19373 printf $1; printf ");\n"
19377 printf "#endif /* JUST_NSIG */\n";
19378 printf "exit(0);\n}\n";
19381 $cat >signal.awk <<'EOP'
19382 BEGIN { ndups = 0 }
19383 $1 ~ /^NSIG$/ { nsig = $2 }
19384 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19385 if ($2 > maxsig) { maxsig = $2 }
19386 if (sig_name[$2]) {
19387 dup_name[ndups] = $1
19388 dup_num[ndups] = $2
19400 printf("NSIG %d\n", nsig);
19401 for (n = 1; n < nsig; n++) {
19403 printf("%s %d\n", sig_name[n], sig_num[n])
19406 printf("NUM%d %d\n", n, n)
19409 for (n = 0; n < ndups; n++) {
19410 printf("%s %d\n", dup_name[n], dup_num[n])
19414 $cat >signal_cmd <<EOS
19416 if $test -s signal.lst; then
19417 echo "Using your existing signal.lst file"
19422 $cat >>signal_cmd <<'EOS'
19425 if eval $compile_ok; then
19426 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19428 echo "(I can't seem be able to compile the whole test program)" >&4
19429 echo "(I'll try it in little pieces.)" >&4
19430 set signal -DJUST_NSIG
19431 if eval $compile_ok; then
19432 $run ./signal$_exe > signal.nsg
19435 echo "I can't seem to figure out how many signals you have." >&4
19436 echo "Guessing 50." >&4
19437 echo 'NSIG 50' > signal.nsg
19439 : Now look at all the signal names, one at a time.
19440 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19441 $cat > signal.c <<EOCP
19442 #include <sys/types.h>
19443 #include <signal.h>
19446 printf("$xx %d\n", SIG${xx});
19451 if eval $compile; then
19452 echo "SIG${xx} found."
19453 $run ./signal$_exe >> signal.ls1
19455 echo "SIG${xx} NOT found."
19458 if $test -s signal.ls1; then
19459 $cat signal.nsg signal.ls1 |
19460 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19464 if $test -s signal.lst; then
19467 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19468 echo 'kill -l' >signal
19469 set X `csh -f <signal`
19473 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19475 echo $@ | $tr ' ' $trnl | \
19476 $awk '{ printf "%s %d\n", $1, ++s; }
19477 END { printf "NSIG %d\n", ++s }' >signal.lst
19479 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19481 chmod a+x signal_cmd
19482 $eunicefix signal_cmd
19484 : generate list of signal names
19486 case "$sig_name_init" in
19488 *) case "$sig_num_init" in
19489 ''|*,*) doinit=yes ;;
19494 echo "Generating a list of signal names and numbers..." >&4
19496 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19497 sig_name=`$awk 'BEGIN { printf "ZERO " }
19498 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19499 sig_num=`$awk 'BEGIN { printf "0 " }
19500 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19501 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19502 !/^NSIG/ { printf "\"%s\", ", $1 }
19503 END { printf "0\n" }' signal.lst`
19504 sig_num_init=`$awk 'BEGIN { printf "0, " }
19505 !/^NSIG/ { printf "%d, ", $2}
19506 END { printf "0\n"}' signal.lst`
19509 echo "The following $sig_count signals are available:"
19511 echo $sig_name | $awk \
19512 'BEGIN { linelen = 0 }
19514 for (i = 1; i <= NF; i++) {
19515 name = "SIG" $i " "
19516 linelen = linelen + length(name)
19517 if (linelen > 70) {
19519 linelen = length(name)
19525 sig_size=`echo $sig_name | awk '{print NF}'`
19526 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19529 case "$sizetype" in
19530 *_t) zzz="$sizetype" ;;
19531 *) zzz="filesize" ;;
19533 echo "Checking the size of $zzz..." >&4
19535 #include <sys/types.h>
19537 #$i_stdlib I_STDLIB
19539 #include <stdlib.h>
19542 printf("%d\n", (int)sizeof($sizetype));
19547 if eval $compile_ok; then
19551 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19554 echo "Your $zzz size is $sizesize bytes."
19559 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19563 : check for socklen_t
19565 echo "Checking to see if you have socklen_t..." >&4
19567 #include <sys/types.h>
19568 #$d_socket HAS_SOCKET
19570 #include <sys/socket.h>
19572 int main() { socklen_t x = 16; }
19575 if eval $compile; then
19577 echo "You have socklen_t."
19580 echo "You do not have socklen_t."
19581 case "$sizetype" in
19582 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19589 : see if this is a socks.h system
19590 set socks.h i_socks
19593 : check for type of the size argument to socket calls
19594 case "$d_socket" in
19598 Checking to see what type is the last argument of accept().
19601 case "$d_socklen_t" in
19602 "$define") yyy="$yyy socklen_t"
19604 yyy="$yyy $sizetype int long unsigned"
19605 for xxx in $yyy; do
19606 case "$socksizetype" in
19607 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19608 case "$usesocks" in
19610 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19611 echo "Your system accepts '$xxx *' for the last argument of accept()."
19612 socksizetype="$xxx"
19615 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19616 echo "Your system accepts '$xxx *' for the last argument of accept()."
19617 socksizetype="$xxx"
19624 : In case none of those worked, prompt the user.
19625 case "$socksizetype" in
19626 '') rp='What is the type for socket address structure sizes?'
19633 *) : no sockets, so pick relatively harmless default
19638 : see what type is used for signed size_t
19639 set ssize_t ssizetype int stdio.h sys/types.h
19644 #$i_stdlib I_STDLIB
19646 #include <stdlib.h>
19648 #include <sys/types.h>
19649 #define Size_t $sizetype
19650 #define SSize_t $dflt
19653 if (sizeof(Size_t) == sizeof(SSize_t))
19655 else if (sizeof(Size_t) == sizeof(int))
19664 if eval $compile_ok && $run ./try > /dev/null; then
19665 ssizetype=`$run ./try`
19666 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19669 Help! I can't compile and run the ssize_t test program: please enlighten me!
19670 (This is probably a misconfiguration in your system or libraries, and
19671 you really ought to fix it. Still, I'll try anyway.)
19673 I need a type that is the same size as $sizetype, but is guaranteed to
19674 be signed. Common values are ssize_t, int and long.
19677 rp="What signed type is the same size as $sizetype?"
19683 : see what type of char stdio uses.
19685 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19686 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19687 echo "Your stdio uses unsigned chars." >&4
19688 stdchar="unsigned char"
19690 echo "Your stdio uses signed chars." >&4
19697 : see what type uids are declared as in the kernel
19699 echo "Looking for the type for user ids returned by getuid()."
19700 set uid_t uidtype xxx stdio.h sys/types.h
19704 xxx=`./findhdr sys/user.h`
19705 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19707 unsigned) dflt="$1 $2" ;;
19711 *) dflt="$uidtype";;
19714 uid_t) echo "uid_t found." ;;
19715 *) rp="What is the type for user ids returned by getuid()?"
19723 *_t) zzz="$uidtype" ;;
19726 echo "Checking the size of $zzz..." >&4
19728 #include <sys/types.h>
19730 #$i_stdlib I_STDLIB
19732 #include <stdlib.h>
19735 printf("%d\n", (int)sizeof($uidtype));
19740 if eval $compile_ok; then
19744 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19747 echo "Your $zzz is $uidsize bytes long."
19752 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19757 *_t) zzz="$uidtype" ;;
19760 echo "Checking the sign of $zzz..." >&4
19762 #include <sys/types.h>
19773 if eval $compile; then
19777 echo "(I can't execute the test program--guessing unsigned.)" >&4
19781 1) echo "Your $zzz is unsigned." ;;
19782 -1) echo "Your $zzz is signed." ;;
19788 echo "(I can't compile the test program--guessing unsigned.)" >&4
19794 $echo "Checking the format string to be used for uids..." >&4
19797 -1) if $test X"$uidsize" = X"$ivsize"; then
19798 uidformat="$ivdformat"
19800 if $test X"$uidsize" = X"$longsize"; then
19803 if $test X"$uidsize" = X"$intsize"; then
19806 if $test X"$uidsize" = X"$shortsize"; then
19813 *) if $test X"$uidsize" = X"$uvsize"; then
19814 uidformat="$uvuformat"
19816 if $test X"$uidsize" = X"$longsize"; then
19819 if $test X"$uidsize" = X"$intsize"; then
19822 if $test X"$uidsize" = X"$shortsize"; then
19832 case "$usesitecustomize" in
19833 $define|true|[Yy]*)
19834 usesitecustomize="$define"
19837 usesitecustomize="$undef"
19841 : determine compiler compiler
19850 if $test -f "$byacc$_exe"; then
19852 comp="byacc or $comp"
19854 if $test -f "$bison$_exe"; then
19855 comp="$comp or bison -y"
19857 rp="Which compiler compiler ($comp) shall I use?"
19866 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19872 : see if this is a fp.h system
19876 : see if this is a fp_class.h system
19877 set fp_class.h i_fp_class
19880 : see if this is a ieeefp.h system
19881 case "$i_ieeefp" in
19882 '' ) set ieeefp.h i_ieeefp
19887 : see if this is a libutil.h system
19888 set libutil.h i_libutil
19891 : see if mach cthreads are available
19892 if test "X$usethreads" = "X$define"; then
19893 set mach/cthreads.h i_machcthr
19896 i_machcthr="$undef"
19901 : see if this is a mntent.h system
19902 set mntent.h i_mntent
19905 : see if ndbm.h is available
19911 # Some Linux distributions such as RedHat 7.1 put the
19912 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19913 if $test -f /usr/include/gdbm/ndbm.h; then
19914 echo '<gdbm/ndbm.h> found.'
19915 ccflags="$ccflags -I/usr/include/gdbm"
19916 cppflags="$cppflags -I/usr/include/gdbm"
19924 : see if dbm_open exists
19925 set dbm_open d_dbm_open
19927 case "$d_dbm_open" in
19930 echo "We won't be including <ndbm.h>"
19939 : see if net/errno.h is available
19941 set net/errno.h val
19944 : Unfortunately, it causes problems on some systems. Arrgh.
19947 cat > try.c <<'EOM'
19950 #include <net/errno.h>
19956 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19957 echo "We'll be including <net/errno.h>." >&4
19959 echo "We won't be including <net/errno.h>." >&4
19968 : see if netinet/tcp.h is available
19969 set netinet/tcp.h i_netinettcp
19972 : see if this is a poll.h system
19976 : see if this is a prot.h system
19981 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19982 $cat <<'EOSH' > Cppsym.know
19983 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19984 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19985 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19986 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
19987 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
19988 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
19989 bull c cadmus clipper CMU COFF COMPILER_VERSION
19990 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
19991 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
19992 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
19993 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
19995 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
19996 H3050R H3050RX hbullx20 hcx host_mips
19997 hp200 hp300 hp700 HP700 hp800 hp9000
19998 hp9000s200 hp9000s300 hp9000s400 hp9000s500
19999 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20000 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20001 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20002 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20003 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20004 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20005 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20006 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20007 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20008 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20009 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20010 MATH_HAS_NO_SIDE_EFFECTS
20011 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20012 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20013 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20014 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20015 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20016 NetBSD news1500 news1700 news1800 news1900 news3700
20017 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20018 ns32016 ns32332 ns32k nsc32000
20019 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20020 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20021 pc532 pdp11 PGC PIC plexus PORTAR posix
20022 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20023 POSIX_C_SOURCE POSIX_SOURCE POWER
20024 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20025 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20026 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20027 sony sony_news sonyrisc sparc sparclite spectrum
20028 stardent stdc STDC_EXT stratos sun sun3 sun386
20029 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20030 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20031 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20032 sysV68 sysV88 Tek4132 Tek4300 titan
20033 TM3200 TM5400 TM5600
20034 tower tower32 tower32_200 tower32_600 tower32_700
20035 tower32_800 tower32_850 tss
20036 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20037 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20038 unix UNIX95 UNIX99 unixpc unos
20039 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20040 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20041 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20043 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
20044 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20045 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20048 # Maybe put other stuff here too.
20049 cat <<EOSH >>Cppsym.know
20052 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20053 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20054 $cat Cppsym.know > Cppsym.c
20055 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20056 $rm -f Cppsym.a Cppsym.b Cppsym.c
20057 cat <<EOSH > Cppsym
20059 if $test \$# -gt 0; then
20060 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20061 if $test -s Cppsym.got; then
20068 $tr " " "$trnl" | ./Cppsym.try
20074 cat <<EOSH > Cppsym.try
20076 cat <<'EOCP' > try.c
20082 cat <<'EOSH' >> Cppsym.try
20084 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
20085 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
20086 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
20087 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
20089 echo 'return 0;}' >> try.c
20091 cat <<EOSH >> Cppsym.try
20093 case "$osname-$gccversion" in
20094 irix-) ccflags="\$ccflags -woff 1178" ;;
20095 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20097 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
20099 chmod +x Cppsym.try
20100 $eunicefix Cppsym.try
20101 ./Cppsym < Cppsym.know > Cppsym.true
20102 : now check the C compiler for additional symbols
20103 postprocess_cc_v=''
20105 aix) postprocess_cc_v="|$tr , ' '" ;;
20112 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20115 -D*) echo "\$i" | $sed 's/^-D//';;
20116 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20121 postprocess_cc_v=''
20124 ./ccsym > ccsym1.raw
20125 if $test -s ccsym1.raw; then
20126 $sort ccsym1.raw | $uniq >ccsym.raw
20128 mv ccsym1.raw ccsym.raw
20131 $awk '/\=/ { print $0; next }
20132 { print $0"=1" }' ccsym.raw >ccsym.list
20133 $awk '/\=/ { print $0; next }
20134 { print $0"=1" }' Cppsym.true >ccsym.true
20135 $comm -13 ccsym.true ccsym.list >ccsym.own
20136 $comm -12 ccsym.true ccsym.list >ccsym.com
20137 $comm -23 ccsym.true ccsym.list >ccsym.cpp
20139 if $test -z ccsym.raw; then
20140 echo "Your C compiler doesn't seem to define any symbols!" >&4
20142 echo "However, your C preprocessor defines the following symbols:"
20145 cppsymbols=`$cat Cppsym.true`
20146 cppsymbols=`echo $cppsymbols`
20147 cppccsymbols="$cppsymbols"
20149 if $test -s ccsym.com; then
20150 echo "Your C compiler and pre-processor define these symbols:"
20151 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20154 cppccsymbols=`$cat ccsym.com`
20155 cppccsymbols=`echo $cppccsymbols`
20156 $test "$silent" || sleep 1
20158 if $test -s ccsym.cpp; then
20159 $test "$also" && echo " "
20160 echo "Your C pre-processor ${also}defines the following symbols:"
20161 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20163 cppsymbols=`$cat ccsym.cpp`
20164 cppsymbols=`echo $cppsymbols`
20165 $test "$silent" || sleep 1
20167 if $test -s ccsym.own; then
20168 $test "$also" && echo " "
20169 echo "Your C compiler ${also}defines the following cpp symbols:"
20170 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20171 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20172 ccsymbols=`$cat ccsym.own`
20173 ccsymbols=`echo $ccsymbols`
20174 $test "$silent" || sleep 1
20178 : see if this is a termio system
20182 if $test `./findhdr termios.h`; then
20183 set tcsetattr i_termios
20189 "$define") echo "You have POSIX termios.h... good!" >&4;;
20190 *) if ./Cppsym pyr; then
20191 case "`/bin/universe`" in
20192 ucb) if $test `./findhdr sgtty.h`; then
20194 echo "<sgtty.h> found." >&4
20196 echo "System is pyramid with BSD universe."
20197 echo "<sgtty.h> not found--you could have problems." >&4
20199 *) if $test `./findhdr termio.h`; then
20201 echo "<termio.h> found." >&4
20203 echo "System is pyramid with USG universe."
20204 echo "<termio.h> not found--you could have problems." >&4
20208 if $test `./findhdr termio.h`; then
20209 echo "<termio.h> found." >&4
20211 elif $test `./findhdr sgtty.h`; then
20212 echo "<sgtty.h> found." >&4
20215 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20218 if $test `./findhdr sgtty.h`; then
20219 echo "<sgtty.h> found." >&4
20221 elif $test `./findhdr termio.h`; then
20222 echo "<termio.h> found." >&4
20225 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20229 set i_termio; eval $setvar
20230 val=$val2; set i_sgtty; eval $setvar
20231 val=$val3; set i_termios; eval $setvar
20233 : see if stddef is available
20234 set stddef.h i_stddef
20237 : see if this is a sunmath.h system
20238 set sunmath.h i_sunmath
20241 : see if sys/access.h is available
20242 set sys/access.h i_sysaccess
20245 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20246 set sys/filio.h i_sysfilio
20249 if $test `./findhdr sys/ioctl.h`; then
20251 echo '<sys/ioctl.h> found.' >&4
20254 if $test $i_sysfilio = "$define"; then
20255 echo '<sys/ioctl.h> NOT found.' >&4
20257 $test $i_sgtty = "$define" && xxx="sgtty.h"
20258 $test $i_termio = "$define" && xxx="termio.h"
20259 $test $i_termios = "$define" && xxx="termios.h"
20260 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20266 : see if socket ioctl defs are in sys/sockio.h
20268 xxx=`./findhdr sys/sockio.h`
20269 if $test "$xxx"; then
20270 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20272 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20275 echo "No socket ioctls found in <sys/sockio.h>." >&4
20280 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20287 : see if this is a syslog.h system
20288 set syslog.h i_syslog
20292 : see if this is a sys/mode.h system
20293 set sys/mode.h i_sysmode
20296 : see if sys/resource.h has to be included
20297 set sys/resource.h i_sysresrc
20300 : see if sys/security.h is available
20301 set sys/security.h i_syssecrt
20304 : see if this is a sys/statvfs.h system
20305 set sys/statvfs.h i_sysstatvfs
20308 : see if this is a sys/un.h system
20309 set sys/un.h i_sysun
20313 : see if this is a sys/utsname.h system
20314 set sys/utsname.h i_sysutsname
20317 : see if this is a syswait system
20318 set sys/wait.h i_syswait
20321 : see if this is a ustat.h system
20322 set ustat.h i_ustat
20325 : see if this is an utime system
20326 set utime.h i_utime
20329 : see if this is a values.h system
20330 set values.h i_values
20333 : see if this is a vfork system
20336 set vfork.h i_vfork
20344 : see if gdbm.h is available
20349 : see if gdbm_open exists
20350 set gdbm_open d_gdbm_open
20352 case "$d_gdbm_open" in
20355 echo "We won't be including <gdbm.h>"
20365 echo "Looking for extensions..." >&4
20366 : If we are using the old config.sh, known_extensions may contain
20367 : old or inaccurate or duplicate values.
20368 known_extensions=''
20369 nonxs_extensions=''
20370 : We do not use find because it might not be available.
20371 : We do not just use MANIFEST because the user may have dropped
20372 : some additional extensions into the source tree and expect them
20375 : Function to recursively find available extensions, ignoring DynaLoader
20376 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20380 DynaLoader|dynaload) ;;
20382 if $test -f $xxx/$xxx.xs; then
20383 known_extensions="$known_extensions $1$xxx";
20384 elif $test -f $xxx/Makefile.PL; then
20385 nonxs_extensions="$nonxs_extensions $1$xxx";
20387 if $test -d $xxx -a $# -lt 10; then
20390 eval $find_extensions;
20402 eval $find_extensions
20403 # Special case: Add in threads/shared since it is not picked up by the
20404 # recursive find above (and adding in general recursive finding breaks
20405 # SDBM_File/sdbm). A.D. 10/25/2001.
20406 known_extensions="$known_extensions threads/shared"
20407 set X $nonxs_extensions
20409 nonxs_extensions="$*"
20410 set X $known_extensions
20412 known_extensions="$*"
20415 : Now see which are supported on this system.
20417 for xxx in $known_extensions ; do
20421 $define) avail_ext="$avail_ext $xxx" ;;
20424 GDBM_File|gdbm_fil)
20426 $define) avail_ext="$avail_ext $xxx" ;;
20429 I18N/Langinfo|i18n_lan)
20430 case "$i_langinfo$d_nl_langinfo" in
20431 $define$define) avail_ext="$avail_ext $xxx" ;;
20434 NDBM_File|ndbm_fil)
20437 case "$osname-$use64bitint" in
20440 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20443 *) avail_ext="$avail_ext $xxx" ;;
20448 ODBM_File|odbm_fil)
20449 case "${i_dbm}${i_rpcsvcdbm}" in
20451 case "$osname-$use64bitint" in
20454 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20457 *) avail_ext="$avail_ext $xxx" ;;
20463 case "$useposix" in
20464 true|define|y) avail_ext="$avail_ext $xxx" ;;
20468 case "$useopcode" in
20469 true|define|y) avail_ext="$avail_ext $xxx" ;;
20473 case "$d_socket" in
20476 beos) ;; # not unless BONE
20477 *) avail_ext="$avail_ext $xxx" ;;
20482 Sys/Syslog|sys/syslog)
20483 : XXX syslog requires socket
20484 case "$d_socket" in
20485 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20489 case "$usethreads" in
20491 case "$useithreads" in
20492 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20496 XS/APItest|xs/apitest)
20497 # This is just for testing. Skip it unless we have dynamic loading.
20500 $define) avail_ext="$avail_ext $xxx" ;;
20503 XS/Typemap|xs/typemap)
20504 # This is just for testing. Skip it unless we have dynamic loading.
20506 $define) avail_ext="$avail_ext $xxx" ;;
20509 threads|threads/shared)
20510 # threads and threads::shared are special cases.
20511 # To stop people from asking "Perl 5.8.0 was supposed
20512 # to have this new fancy threads implementation but my
20513 # perl doesn't have it" and from people trying to
20514 # (re)install the threads module using CPAN.pm and
20515 # CPAN.pm then offering to reinstall Perl 5.8.0,
20516 # the threads.pm and threads/shared.pm will always be
20517 # there, croaking informatively ("you need to rebuild
20518 # all of Perl with threads, sorry") when threads haven't
20519 # been compiled in.
20521 avail_ext="$avail_ext $xxx"
20524 : XXX Do we need a useipcsysv variable here
20525 case "${d_msg}${d_sem}${d_shm}" in
20526 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20529 *) avail_ext="$avail_ext $xxx"
20538 case "$onlyextensions" in
20540 *) keepextensions=''
20541 echo "You have requested that only certains extensions be included..." >&4
20542 for i in $onlyextensions; do
20543 case " $avail_ext " in
20545 echo "Keeping extension $i."
20546 keepextensions="$keepextensions $i"
20548 *) echo "Ignoring extension $i." ;;
20551 avail_ext="$keepextensions"
20555 case "$noextensions" in
20557 *) keepextensions=''
20558 echo "You have requested that certain extensions be ignored..." >&4
20559 for i in $avail_ext; do
20560 case " $noextensions " in
20561 *" $i "*) echo "Ignoring extension $i." ;;
20562 *) echo "Keeping extension $i.";
20563 keepextensions="$keepextensions $i"
20567 avail_ext="$keepextensions"
20571 : Now see which nonxs extensions are supported on this system.
20572 : For now assume all are.
20574 for xxx in $nonxs_extensions ; do
20576 *) nonxs_ext="$nonxs_ext $xxx"
20588 A number of extensions are supplied with $package. You may choose to
20589 compile these extensions for dynamic loading (the default), compile
20590 them into the $package executable (static loading), or not include
20591 them at all. Answer "none" to include no extensions.
20592 Note that DynaLoader is always built and need not be mentioned here.
20595 case "$dynamic_ext" in
20597 : Exclude those listed in static_ext
20599 for xxx in $avail_ext; do
20600 case " $static_ext " in
20602 *) dflt="$dflt $xxx" ;;
20609 *) dflt="$dynamic_ext"
20610 # Perhaps we are reusing an old out-of-date config.sh.
20613 if test X"$dynamic_ext" != X"$avail_ext"; then
20615 NOTICE: Your previous config.sh list may be incorrect.
20616 The extensions now available to you are
20618 but the default list from your previous config.sh is
20630 rp="What extensions do you wish to load dynamically?"
20633 none) dynamic_ext=' ' ;;
20634 *) dynamic_ext="$ans" ;;
20637 case "$static_ext" in
20639 : Exclude those already listed in dynamic linking
20641 for xxx in $avail_ext; do
20642 case " $dynamic_ext " in
20644 *) dflt="$dflt $xxx" ;;
20651 *) dflt="$static_ext"
20658 rp="What extensions do you wish to load statically?"
20661 none) static_ext=' ' ;;
20662 *) static_ext="$ans" ;;
20667 A number of extensions are supplied with $package. Answer "none"
20668 to include no extensions.
20669 Note that DynaLoader is always built and need not be mentioned here.
20672 case "$static_ext" in
20673 '') dflt="$avail_ext" ;;
20674 *) dflt="$static_ext"
20675 # Perhaps we are reusing an old out-of-date config.sh.
20678 if test X"$static_ext" != X"$avail_ext"; then
20680 NOTICE: Your previous config.sh list may be incorrect.
20681 The extensions now available to you are
20683 but the default list from your previous config.sh is
20692 : Exclude those that are not xs extensions
20696 rp="What extensions do you wish to include?"
20699 none) static_ext=' ' ;;
20700 *) static_ext="$ans" ;;
20705 # Encode is a special case. If we are building Encode as a static
20706 # extension, we need to explicitly list its subextensions as well.
20707 # For other nested extensions, this is handled automatically by
20708 # the appropriate Makefile.PL.
20709 case " $static_ext " in
20710 *" Encode "*) # Add the subextensions of Encode
20712 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20713 static_ext="$static_ext Encode/$xxx"
20719 set X $dynamic_ext $static_ext $nonxs_ext
20723 # Sanity check: We require an extension suitable for use with
20724 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20725 # should show up as failures in the test suite, but it's helpful to
20726 # catch them now.) The 'extensions' list is normally sorted
20727 # alphabetically, so we need to accept either
20728 # DB_File ... Fcntl ... IO ....
20729 # or something like
20730 # Fcntl ... NDBM_File ... IO ....
20731 case " $extensions" in
20732 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20733 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20734 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20735 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20736 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20740 : Remove libraries needed only for extensions
20741 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20742 : The exception is SunOS 4.x, which needs them.
20743 case "${osname}X${osvers}" in
20747 *) case "$usedl" in
20748 $define|true|[yY]*)
20749 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20753 *) perllibs="$libs"
20759 : Remove build directory name from cppstdin so it can be used from
20760 : either the present location or the final installed location.
20762 : Get out of the UU directory to get correct path name.
20764 case "$cppstdin" in
20766 echo "Stripping down cppstdin path name"
20772 : end of configuration questions
20774 echo "End of configuration questions."
20777 : back to where it started
20778 if test -d ../UU; then
20782 : configuration may be patched via a 'config.arch' file
20783 if $test -f config.arch; then
20784 echo "I see a config.arch file, loading it."
20788 : configuration may be patched via a 'config.over' file
20789 if $test -f config.over; then
20792 rp='I see a config.over file. Do you wish to load it?'
20795 n*) echo "OK, I'll ignore it.";;
20797 echo "Configuration override changes have been loaded."
20802 : in case they want portability, strip down executable paths
20803 case "$d_portable" in
20806 echo "Stripping down executable paths..." >&4
20807 for file in $loclist $trylist; do
20809 eval $file=`basename $temp`
20814 : create config.sh file
20816 echo "Creating config.sh..." >&4
20817 $spitshell <<EOT >config.sh
20820 # This file was produced by running the Configure script. It holds all the
20821 # definitions figured out by Configure. Should you modify one of these values,
20822 # do not forget to propagate your changes by running "Configure -der". You may
20823 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20826 # Package name : $package
20827 # Source directory : $src
20828 # Configuration time: $cf_time
20829 # Configured by : $cf_by
20830 # Target system : $myuname
20840 Revision='$Revision'
20848 alignbytes='$alignbytes'
20849 ansi2knr='$ansi2knr'
20850 aphostname='$aphostname'
20851 api_revision='$api_revision'
20852 api_subversion='$api_subversion'
20853 api_version='$api_version'
20854 api_versionstring='$api_versionstring'
20857 archlibexp='$archlibexp'
20858 archname64='$archname64'
20859 archname='$archname'
20860 archobjs='$archobjs'
20861 asctime_r_proto='$asctime_r_proto'
20869 byteorder='$byteorder'
20871 castflags='$castflags'
20874 cccdlflags='$cccdlflags'
20875 ccdlflags='$ccdlflags'
20877 ccflags_uselargefiles='$ccflags_uselargefiles'
20879 ccsymbols='$ccsymbols'
20880 ccversion='$ccversion'
20882 cf_email='$cf_email'
20884 charsize='$charsize'
20888 clocktype='$clocktype'
20890 compress='$compress'
20891 contains='$contains'
20895 cpp_stuff='$cpp_stuff'
20896 cppccsymbols='$cppccsymbols'
20897 cppflags='$cppflags'
20899 cppminus='$cppminus'
20901 cppstdin='$cppstdin'
20902 cppsymbols='$cppsymbols'
20903 crypt_r_proto='$crypt_r_proto'
20904 cryptlib='$cryptlib'
20906 ctermid_r_proto='$ctermid_r_proto'
20907 ctime_r_proto='$ctime_r_proto'
20908 d_Gconvert='$d_Gconvert'
20909 d_PRIEUldbl='$d_PRIEUldbl'
20910 d_PRIFUldbl='$d_PRIFUldbl'
20911 d_PRIGUldbl='$d_PRIGUldbl'
20912 d_PRIXU64='$d_PRIXU64'
20913 d_PRId64='$d_PRId64'
20914 d_PRIeldbl='$d_PRIeldbl'
20915 d_PRIfldbl='$d_PRIfldbl'
20916 d_PRIgldbl='$d_PRIgldbl'
20917 d_PRIi64='$d_PRIi64'
20918 d_PRIo64='$d_PRIo64'
20919 d_PRIu64='$d_PRIu64'
20920 d_PRIx64='$d_PRIx64'
20921 d_SCNfldbl='$d_SCNfldbl'
20922 d__fwalk='$d__fwalk'
20923 d_access='$d_access'
20924 d_accessx='$d_accessx'
20927 d_archlib='$d_archlib'
20928 d_asctime_r='$d_asctime_r'
20931 d_attribute_format='$d_attribute_format'
20932 d_attribute_malloc='$d_attribute_malloc'
20933 d_attribute_nonnull='$d_attribute_nonnull'
20934 d_attribute_noreturn='$d_attribute_noreturn'
20935 d_attribute_pure='$d_attribute_pure'
20936 d_attribute_unused='$d_attribute_unused'
20937 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
20941 d_bsdgetpgrp='$d_bsdgetpgrp'
20942 d_bsdsetpgrp='$d_bsdsetpgrp'
20944 d_casti32='$d_casti32'
20945 d_castneg='$d_castneg'
20946 d_charvspr='$d_charvspr'
20948 d_chroot='$d_chroot'
20949 d_chsize='$d_chsize'
20951 d_closedir='$d_closedir'
20952 d_cmsghdr_s='$d_cmsghdr_s'
20954 d_copysignl='$d_copysignl'
20956 d_crypt_r='$d_crypt_r'
20958 d_ctermid_r='$d_ctermid_r'
20959 d_ctime_r='$d_ctime_r'
20960 d_cuserid='$d_cuserid'
20961 d_dbl_dig='$d_dbl_dig'
20962 d_dbminitproto='$d_dbminitproto'
20963 d_difftime='$d_difftime'
20965 d_dirnamlen='$d_dirnamlen'
20966 d_dlerror='$d_dlerror'
20967 d_dlopen='$d_dlopen'
20968 d_dlsymun='$d_dlsymun'
20969 d_dosuid='$d_dosuid'
20970 d_drand48_r='$d_drand48_r'
20971 d_drand48proto='$d_drand48proto'
20973 d_eaccess='$d_eaccess'
20974 d_endgrent='$d_endgrent'
20975 d_endgrent_r='$d_endgrent_r'
20976 d_endhent='$d_endhent'
20977 d_endhostent_r='$d_endhostent_r'
20978 d_endnent='$d_endnent'
20979 d_endnetent_r='$d_endnetent_r'
20980 d_endpent='$d_endpent'
20981 d_endprotoent_r='$d_endprotoent_r'
20982 d_endpwent='$d_endpwent'
20983 d_endpwent_r='$d_endpwent_r'
20984 d_endsent='$d_endsent'
20985 d_endservent_r='$d_endservent_r'
20986 d_eofnblk='$d_eofnblk'
20987 d_eunice='$d_eunice'
20988 d_faststdio='$d_faststdio'
20989 d_fchdir='$d_fchdir'
20990 d_fchmod='$d_fchmod'
20991 d_fchown='$d_fchown'
20993 d_fcntl_can_lock='$d_fcntl_can_lock'
20994 d_fd_macros='$d_fd_macros'
20995 d_fd_set='$d_fd_set'
20996 d_fds_bits='$d_fds_bits'
20997 d_fgetpos='$d_fgetpos'
20998 d_finite='$d_finite'
20999 d_finitel='$d_finitel'
21000 d_flexfnam='$d_flexfnam'
21002 d_flockproto='$d_flockproto'
21004 d_fp_class='$d_fp_class'
21005 d_fpathconf='$d_fpathconf'
21006 d_fpclass='$d_fpclass'
21007 d_fpclassify='$d_fpclassify'
21008 d_fpclassl='$d_fpclassl'
21009 d_fpos64_t='$d_fpos64_t'
21010 d_frexpl='$d_frexpl'
21011 d_fs_data_s='$d_fs_data_s'
21012 d_fseeko='$d_fseeko'
21013 d_fsetpos='$d_fsetpos'
21014 d_fstatfs='$d_fstatfs'
21015 d_fstatvfs='$d_fstatvfs'
21017 d_ftello='$d_ftello'
21019 d_getcwd='$d_getcwd'
21020 d_getespwnam='$d_getespwnam'
21021 d_getfsstat='$d_getfsstat'
21022 d_getgrent='$d_getgrent'
21023 d_getgrent_r='$d_getgrent_r'
21024 d_getgrgid_r='$d_getgrgid_r'
21025 d_getgrnam_r='$d_getgrnam_r'
21026 d_getgrps='$d_getgrps'
21027 d_gethbyaddr='$d_gethbyaddr'
21028 d_gethbyname='$d_gethbyname'
21029 d_gethent='$d_gethent'
21030 d_gethname='$d_gethname'
21031 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21032 d_gethostbyname_r='$d_gethostbyname_r'
21033 d_gethostent_r='$d_gethostent_r'
21034 d_gethostprotos='$d_gethostprotos'
21035 d_getitimer='$d_getitimer'
21036 d_getlogin='$d_getlogin'
21037 d_getlogin_r='$d_getlogin_r'
21038 d_getmnt='$d_getmnt'
21039 d_getmntent='$d_getmntent'
21040 d_getnbyaddr='$d_getnbyaddr'
21041 d_getnbyname='$d_getnbyname'
21042 d_getnent='$d_getnent'
21043 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21044 d_getnetbyname_r='$d_getnetbyname_r'
21045 d_getnetent_r='$d_getnetent_r'
21046 d_getnetprotos='$d_getnetprotos'
21047 d_getpagsz='$d_getpagsz'
21048 d_getpbyname='$d_getpbyname'
21049 d_getpbynumber='$d_getpbynumber'
21050 d_getpent='$d_getpent'
21051 d_getpgid='$d_getpgid'
21052 d_getpgrp2='$d_getpgrp2'
21053 d_getpgrp='$d_getpgrp'
21054 d_getppid='$d_getppid'
21055 d_getprior='$d_getprior'
21056 d_getprotobyname_r='$d_getprotobyname_r'
21057 d_getprotobynumber_r='$d_getprotobynumber_r'
21058 d_getprotoent_r='$d_getprotoent_r'
21059 d_getprotoprotos='$d_getprotoprotos'
21060 d_getprpwnam='$d_getprpwnam'
21061 d_getpwent='$d_getpwent'
21062 d_getpwent_r='$d_getpwent_r'
21063 d_getpwnam_r='$d_getpwnam_r'
21064 d_getpwuid_r='$d_getpwuid_r'
21065 d_getsbyname='$d_getsbyname'
21066 d_getsbyport='$d_getsbyport'
21067 d_getsent='$d_getsent'
21068 d_getservbyname_r='$d_getservbyname_r'
21069 d_getservbyport_r='$d_getservbyport_r'
21070 d_getservent_r='$d_getservent_r'
21071 d_getservprotos='$d_getservprotos'
21072 d_getspnam='$d_getspnam'
21073 d_getspnam_r='$d_getspnam_r'
21074 d_gettimeod='$d_gettimeod'
21075 d_gmtime_r='$d_gmtime_r'
21076 d_gnulibc='$d_gnulibc'
21077 d_grpasswd='$d_grpasswd'
21078 d_hasmntopt='$d_hasmntopt'
21080 d_ilogbl='$d_ilogbl'
21082 d_inetaton='$d_inetaton'
21083 d_int64_t='$d_int64_t'
21084 d_isascii='$d_isascii'
21085 d_isfinite='$d_isfinite'
21088 d_isnanl='$d_isnanl'
21089 d_killpg='$d_killpg'
21090 d_lchown='$d_lchown'
21091 d_ldbl_dig='$d_ldbl_dig'
21092 d_libm_lib_version='$d_libm_lib_version'
21094 d_localtime_r='$d_localtime_r'
21095 d_locconv='$d_locconv'
21097 d_longdbl='$d_longdbl'
21098 d_longlong='$d_longlong'
21099 d_lseekproto='$d_lseekproto'
21101 d_madvise='$d_madvise'
21103 d_mbstowcs='$d_mbstowcs'
21104 d_mbtowc='$d_mbtowc'
21105 d_memchr='$d_memchr'
21106 d_memcmp='$d_memcmp'
21107 d_memcpy='$d_memcpy'
21108 d_memmove='$d_memmove'
21109 d_memset='$d_memset'
21111 d_mkdtemp='$d_mkdtemp'
21112 d_mkfifo='$d_mkfifo'
21113 d_mkstemp='$d_mkstemp'
21114 d_mkstemps='$d_mkstemps'
21115 d_mktime='$d_mktime'
21118 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21119 d_modflproto='$d_modflproto'
21120 d_mprotect='$d_mprotect'
21122 d_msg_ctrunc='$d_msg_ctrunc'
21123 d_msg_dontroute='$d_msg_dontroute'
21124 d_msg_oob='$d_msg_oob'
21125 d_msg_peek='$d_msg_peek'
21126 d_msg_proxy='$d_msg_proxy'
21127 d_msgctl='$d_msgctl'
21128 d_msgget='$d_msgget'
21129 d_msghdr_s='$d_msghdr_s'
21130 d_msgrcv='$d_msgrcv'
21131 d_msgsnd='$d_msgsnd'
21133 d_munmap='$d_munmap'
21134 d_mymalloc='$d_mymalloc'
21136 d_nl_langinfo='$d_nl_langinfo'
21137 d_nv_preserves_uv='$d_nv_preserves_uv'
21138 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21139 d_off64_t='$d_off64_t'
21140 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21141 d_oldpthreads='$d_oldpthreads'
21142 d_oldsock='$d_oldsock'
21144 d_pathconf='$d_pathconf'
21146 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21147 d_phostname='$d_phostname'
21150 d_portable='$d_portable'
21151 d_procselfexe='$d_procselfexe'
21152 d_pthread_atfork='$d_pthread_atfork'
21153 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21154 d_pthread_yield='$d_pthread_yield'
21156 d_pwchange='$d_pwchange'
21157 d_pwclass='$d_pwclass'
21158 d_pwcomment='$d_pwcomment'
21159 d_pwexpire='$d_pwexpire'
21160 d_pwgecos='$d_pwgecos'
21161 d_pwpasswd='$d_pwpasswd'
21162 d_pwquota='$d_pwquota'
21165 d_random_r='$d_random_r'
21166 d_readdir64_r='$d_readdir64_r'
21167 d_readdir='$d_readdir'
21168 d_readdir_r='$d_readdir_r'
21169 d_readlink='$d_readlink'
21171 d_recvmsg='$d_recvmsg'
21172 d_rename='$d_rename'
21173 d_rewinddir='$d_rewinddir'
21175 d_safebcpy='$d_safebcpy'
21176 d_safemcpy='$d_safemcpy'
21177 d_sanemcmp='$d_sanemcmp'
21178 d_sbrkproto='$d_sbrkproto'
21179 d_scalbnl='$d_scalbnl'
21180 d_sched_yield='$d_sched_yield'
21181 d_scm_rights='$d_scm_rights'
21182 d_seekdir='$d_seekdir'
21183 d_select='$d_select'
21185 d_semctl='$d_semctl'
21186 d_semctl_semid_ds='$d_semctl_semid_ds'
21187 d_semctl_semun='$d_semctl_semun'
21188 d_semget='$d_semget'
21190 d_sendmsg='$d_sendmsg'
21191 d_setegid='$d_setegid'
21192 d_seteuid='$d_seteuid'
21193 d_setgrent='$d_setgrent'
21194 d_setgrent_r='$d_setgrent_r'
21195 d_setgrps='$d_setgrps'
21196 d_sethent='$d_sethent'
21197 d_sethostent_r='$d_sethostent_r'
21198 d_setitimer='$d_setitimer'
21199 d_setlinebuf='$d_setlinebuf'
21200 d_setlocale='$d_setlocale'
21201 d_setlocale_r='$d_setlocale_r'
21202 d_setnent='$d_setnent'
21203 d_setnetent_r='$d_setnetent_r'
21204 d_setpent='$d_setpent'
21205 d_setpgid='$d_setpgid'
21206 d_setpgrp2='$d_setpgrp2'
21207 d_setpgrp='$d_setpgrp'
21208 d_setprior='$d_setprior'
21209 d_setproctitle='$d_setproctitle'
21210 d_setprotoent_r='$d_setprotoent_r'
21211 d_setpwent='$d_setpwent'
21212 d_setpwent_r='$d_setpwent_r'
21213 d_setregid='$d_setregid'
21214 d_setresgid='$d_setresgid'
21215 d_setresuid='$d_setresuid'
21216 d_setreuid='$d_setreuid'
21217 d_setrgid='$d_setrgid'
21218 d_setruid='$d_setruid'
21219 d_setsent='$d_setsent'
21220 d_setservent_r='$d_setservent_r'
21221 d_setsid='$d_setsid'
21222 d_setvbuf='$d_setvbuf'
21226 d_shmatprototype='$d_shmatprototype'
21227 d_shmctl='$d_shmctl'
21229 d_shmget='$d_shmget'
21230 d_sigaction='$d_sigaction'
21231 d_sigprocmask='$d_sigprocmask'
21232 d_sigsetjmp='$d_sigsetjmp'
21233 d_sockatmark='$d_sockatmark'
21234 d_sockatmarkproto='$d_sockatmarkproto'
21235 d_socket='$d_socket'
21236 d_socklen_t='$d_socklen_t'
21237 d_sockpair='$d_sockpair'
21238 d_socks5_init='$d_socks5_init'
21240 d_srand48_r='$d_srand48_r'
21241 d_srandom_r='$d_srandom_r'
21242 d_sresgproto='$d_sresgproto'
21243 d_sresuproto='$d_sresuproto'
21244 d_statblks='$d_statblks'
21245 d_statfs_f_flags='$d_statfs_f_flags'
21246 d_statfs_s='$d_statfs_s'
21247 d_statvfs='$d_statvfs'
21248 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21249 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21250 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21251 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21252 d_stdio_stream_array='$d_stdio_stream_array'
21253 d_stdiobase='$d_stdiobase'
21254 d_stdstdio='$d_stdstdio'
21255 d_strchr='$d_strchr'
21256 d_strcoll='$d_strcoll'
21257 d_strctcpy='$d_strctcpy'
21258 d_strerrm='$d_strerrm'
21259 d_strerror='$d_strerror'
21260 d_strerror_r='$d_strerror_r'
21261 d_strftime='$d_strftime'
21262 d_strlcat='$d_strlcat'
21263 d_strlcpy='$d_strlcpy'
21264 d_strtod='$d_strtod'
21265 d_strtol='$d_strtol'
21266 d_strtold='$d_strtold'
21267 d_strtoll='$d_strtoll'
21268 d_strtoq='$d_strtoq'
21269 d_strtoul='$d_strtoul'
21270 d_strtoull='$d_strtoull'
21271 d_strtouq='$d_strtouq'
21272 d_strxfrm='$d_strxfrm'
21273 d_suidsafe='$d_suidsafe'
21274 d_symlink='$d_symlink'
21275 d_syscall='$d_syscall'
21276 d_syscallproto='$d_syscallproto'
21277 d_sysconf='$d_sysconf'
21278 d_sysernlst='$d_sysernlst'
21279 d_syserrlst='$d_syserrlst'
21280 d_system='$d_system'
21281 d_tcgetpgrp='$d_tcgetpgrp'
21282 d_tcsetpgrp='$d_tcsetpgrp'
21283 d_telldir='$d_telldir'
21284 d_telldirproto='$d_telldirproto'
21287 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21288 d_tm_tm_zone='$d_tm_tm_zone'
21289 d_tmpnam_r='$d_tmpnam_r'
21290 d_truncate='$d_truncate'
21291 d_ttyname_r='$d_ttyname_r'
21292 d_tzname='$d_tzname'
21293 d_u32align='$d_u32align'
21294 d_ualarm='$d_ualarm'
21297 d_union_semun='$d_union_semun'
21298 d_unordered='$d_unordered'
21299 d_usleep='$d_usleep'
21300 d_usleepproto='$d_usleepproto'
21302 d_vendorarch='$d_vendorarch'
21303 d_vendorbin='$d_vendorbin'
21304 d_vendorlib='$d_vendorlib'
21305 d_vendorscript='$d_vendorscript'
21307 d_void_closedir='$d_void_closedir'
21308 d_voidsig='$d_voidsig'
21309 d_voidtty='$d_voidtty'
21310 d_volatile='$d_volatile'
21311 d_vprintf='$d_vprintf'
21313 d_waitpid='$d_waitpid'
21314 d_wcstombs='$d_wcstombs'
21315 d_wctomb='$d_wctomb'
21316 d_writev='$d_writev'
21319 db_hashtype='$db_hashtype'
21320 db_prefixtype='$db_prefixtype'
21321 db_version_major='$db_version_major'
21322 db_version_minor='$db_version_minor'
21323 db_version_patch='$db_version_patch'
21324 defvoidused='$defvoidused'
21325 direntrytype='$direntrytype'
21328 doublesize='$doublesize'
21330 drand48_r_proto='$drand48_r_proto'
21331 dynamic_ext='$dynamic_ext'
21337 endgrent_r_proto='$endgrent_r_proto'
21338 endhostent_r_proto='$endhostent_r_proto'
21339 endnetent_r_proto='$endnetent_r_proto'
21340 endprotoent_r_proto='$endprotoent_r_proto'
21341 endpwent_r_proto='$endpwent_r_proto'
21342 endservent_r_proto='$endservent_r_proto'
21343 eunicefix='$eunicefix'
21346 extensions='$extensions'
21348 fflushNULL='$fflushNULL'
21349 fflushall='$fflushall'
21351 firstmakefile='$firstmakefile'
21353 fpossize='$fpossize'
21354 fpostype='$fpostype'
21355 freetype='$freetype'
21358 full_csh='$full_csh'
21359 full_sed='$full_sed'
21360 gccansipedantic='$gccansipedantic'
21361 gccosandvers='$gccosandvers'
21362 gccversion='$gccversion'
21363 getgrent_r_proto='$getgrent_r_proto'
21364 getgrgid_r_proto='$getgrgid_r_proto'
21365 getgrnam_r_proto='$getgrnam_r_proto'
21366 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21367 gethostbyname_r_proto='$gethostbyname_r_proto'
21368 gethostent_r_proto='$gethostent_r_proto'
21369 getlogin_r_proto='$getlogin_r_proto'
21370 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21371 getnetbyname_r_proto='$getnetbyname_r_proto'
21372 getnetent_r_proto='$getnetent_r_proto'
21373 getprotobyname_r_proto='$getprotobyname_r_proto'
21374 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21375 getprotoent_r_proto='$getprotoent_r_proto'
21376 getpwent_r_proto='$getpwent_r_proto'
21377 getpwnam_r_proto='$getpwnam_r_proto'
21378 getpwuid_r_proto='$getpwuid_r_proto'
21379 getservbyname_r_proto='$getservbyname_r_proto'
21380 getservbyport_r_proto='$getservbyport_r_proto'
21381 getservent_r_proto='$getservent_r_proto'
21382 getspnam_r_proto='$getspnam_r_proto'
21383 gidformat='$gidformat'
21389 gmtime_r_proto='$gmtime_r_proto'
21390 gnulibc_version='$gnulibc_version'
21392 groupcat='$groupcat'
21393 groupstype='$groupstype'
21396 h_sysfile='$h_sysfile'
21399 html1dir='$html1dir'
21400 html1direxp='$html1direxp'
21401 html3dir='$html3dir'
21402 html3direxp='$html3direxp'
21411 i_arpainet='$i_arpainet'
21412 i_bsdioctl='$i_bsdioctl'
21416 i_dirent='$i_dirent'
21422 i_fp_class='$i_fp_class'
21425 i_ieeefp='$i_ieeefp'
21426 i_inttypes='$i_inttypes'
21427 i_langinfo='$i_langinfo'
21428 i_libutil='$i_libutil'
21429 i_limits='$i_limits'
21430 i_locale='$i_locale'
21431 i_machcthr='$i_machcthr'
21432 i_malloc='$i_malloc'
21434 i_memory='$i_memory'
21435 i_mntent='$i_mntent'
21438 i_neterrno='$i_neterrno'
21439 i_netinettcp='$i_netinettcp'
21443 i_pthread='$i_pthread'
21445 i_rpcsvcdbm='$i_rpcsvcdbm'
21448 i_shadow='$i_shadow'
21450 i_stdarg='$i_stdarg'
21451 i_stddef='$i_stddef'
21452 i_stdlib='$i_stdlib'
21453 i_string='$i_string'
21454 i_sunmath='$i_sunmath'
21455 i_sysaccess='$i_sysaccess'
21456 i_sysdir='$i_sysdir'
21457 i_sysfile='$i_sysfile'
21458 i_sysfilio='$i_sysfilio'
21460 i_sysioctl='$i_sysioctl'
21461 i_syslog='$i_syslog'
21462 i_sysmman='$i_sysmman'
21463 i_sysmode='$i_sysmode'
21464 i_sysmount='$i_sysmount'
21465 i_sysndir='$i_sysndir'
21466 i_sysparam='$i_sysparam'
21467 i_sysresrc='$i_sysresrc'
21468 i_syssecrt='$i_syssecrt'
21469 i_sysselct='$i_sysselct'
21470 i_syssockio='$i_syssockio'
21471 i_sysstat='$i_sysstat'
21472 i_sysstatfs='$i_sysstatfs'
21473 i_sysstatvfs='$i_sysstatvfs'
21474 i_systime='$i_systime'
21475 i_systimek='$i_systimek'
21476 i_systimes='$i_systimes'
21477 i_systypes='$i_systypes'
21478 i_sysuio='$i_sysuio'
21480 i_sysutsname='$i_sysutsname'
21481 i_sysvfs='$i_sysvfs'
21482 i_syswait='$i_syswait'
21483 i_termio='$i_termio'
21484 i_termios='$i_termios'
21486 i_unistd='$i_unistd'
21489 i_values='$i_values'
21490 i_varargs='$i_varargs'
21491 i_varhdr='$i_varhdr'
21493 ignore_versioned_solibs='$ignore_versioned_solibs'
21494 inc_version_list='$inc_version_list'
21495 inc_version_list_init='$inc_version_list_init'
21498 installarchlib='$installarchlib'
21499 installbin='$installbin'
21500 installhtml1dir='$installhtml1dir'
21501 installhtml3dir='$installhtml3dir'
21502 installman1dir='$installman1dir'
21503 installman3dir='$installman3dir'
21504 installprefix='$installprefix'
21505 installprefixexp='$installprefixexp'
21506 installprivlib='$installprivlib'
21507 installscript='$installscript'
21508 installsitearch='$installsitearch'
21509 installsitebin='$installsitebin'
21510 installsitehtml1dir='$installsitehtml1dir'
21511 installsitehtml3dir='$installsitehtml3dir'
21512 installsitelib='$installsitelib'
21513 installsiteman1dir='$installsiteman1dir'
21514 installsiteman3dir='$installsiteman3dir'
21515 installsitescript='$installsitescript'
21516 installstyle='$installstyle'
21517 installusrbinperl='$installusrbinperl'
21518 installvendorarch='$installvendorarch'
21519 installvendorbin='$installvendorbin'
21520 installvendorhtml1dir='$installvendorhtml1dir'
21521 installvendorhtml3dir='$installvendorhtml3dir'
21522 installvendorlib='$installvendorlib'
21523 installvendorman1dir='$installvendorman1dir'
21524 installvendorman3dir='$installvendorman3dir'
21525 installvendorscript='$installvendorscript'
21527 issymlink='$issymlink'
21528 ivdformat='$ivdformat'
21531 known_extensions='$known_extensions'
21534 lddlflags='$lddlflags'
21536 ldflags_uselargefiles='$ldflags_uselargefiles'
21537 ldlibpthname='$ldlibpthname'
21544 libsdirs='$libsdirs'
21545 libsfiles='$libsfiles'
21546 libsfound='$libsfound'
21547 libspath='$libspath'
21548 libswanted='$libswanted'
21549 libswanted_uselargefiles='$libswanted_uselargefiles'
21555 localtime_r_proto='$localtime_r_proto'
21556 locincpth='$locincpth'
21557 loclibpth='$loclibpth'
21558 longdblsize='$longdblsize'
21559 longlongsize='$longlongsize'
21560 longsize='$longsize'
21564 lseeksize='$lseeksize'
21565 lseektype='$lseektype'
21569 make_set_make='$make_set_make'
21570 mallocobj='$mallocobj'
21571 mallocsrc='$mallocsrc'
21572 malloctype='$malloctype'
21574 man1direxp='$man1direxp'
21577 man3direxp='$man3direxp'
21579 mips_type='$mips_type'
21580 mistrustnm='$mistrustnm'
21582 mmaptype='$mmaptype'
21583 modetype='$modetype'
21585 multiarch='$multiarch'
21587 myarchname='$myarchname'
21588 mydomain='$mydomain'
21589 myhostname='$myhostname'
21592 need_va_copy='$need_va_copy'
21593 netdb_hlen_type='$netdb_hlen_type'
21594 netdb_host_type='$netdb_host_type'
21595 netdb_name_type='$netdb_name_type'
21596 netdb_net_type='$netdb_net_type'
21599 nm_so_opt='$nm_so_opt'
21600 nonxs_ext='$nonxs_ext'
21602 nvEUformat='$nvEUformat'
21603 nvFUformat='$nvFUformat'
21604 nvGUformat='$nvGUformat'
21605 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21606 nveformat='$nveformat'
21607 nvfformat='$nvfformat'
21608 nvgformat='$nvgformat'
21611 o_nonblock='$o_nonblock'
21613 old_pthread_create_joinable='$old_pthread_create_joinable'
21614 optimize='$optimize'
21615 orderlib='$orderlib'
21618 otherlibdirs='$otherlibdirs'
21622 patchlevel='$patchlevel'
21623 path_sep='$path_sep'
21626 perl_patchlevel='$perl_patchlevel'
21627 perladmin='$perladmin'
21628 perllibs='$perllibs'
21629 perlpath='$perlpath'
21631 phostname='$phostname'
21637 prefixexp='$prefixexp'
21639 privlibexp='$privlibexp'
21640 procselfexe='$procselfexe'
21641 prototype='$prototype'
21643 quadkind='$quadkind'
21644 quadtype='$quadtype'
21645 randbits='$randbits'
21646 randfunc='$randfunc'
21647 random_r_proto='$random_r_proto'
21648 randseedtype='$randseedtype'
21650 rd_nodata='$rd_nodata'
21651 readdir64_r_proto='$readdir64_r_proto'
21652 readdir_r_proto='$readdir_r_proto'
21653 revision='$revision'
21658 sPRIEUldbl='$sPRIEUldbl'
21659 sPRIFUldbl='$sPRIFUldbl'
21660 sPRIGUldbl='$sPRIGUldbl'
21661 sPRIXU64='$sPRIXU64'
21663 sPRIeldbl='$sPRIeldbl'
21664 sPRIfldbl='$sPRIfldbl'
21665 sPRIgldbl='$sPRIgldbl'
21670 sSCNfldbl='$sSCNfldbl'
21671 sched_yield='$sched_yield'
21672 scriptdir='$scriptdir'
21673 scriptdirexp='$scriptdirexp'
21675 seedfunc='$seedfunc'
21676 selectminbits='$selectminbits'
21677 selecttype='$selecttype'
21678 sendmail='$sendmail'
21679 setgrent_r_proto='$setgrent_r_proto'
21680 sethostent_r_proto='$sethostent_r_proto'
21681 setlocale_r_proto='$setlocale_r_proto'
21682 setnetent_r_proto='$setnetent_r_proto'
21683 setprotoent_r_proto='$setprotoent_r_proto'
21684 setpwent_r_proto='$setpwent_r_proto'
21685 setservent_r_proto='$setservent_r_proto'
21688 sharpbang='$sharpbang'
21689 shmattype='$shmattype'
21690 shortsize='$shortsize'
21693 sig_count='$sig_count'
21694 sig_name='$sig_name'
21695 sig_name_init='$sig_name_init'
21697 sig_num_init='$sig_num_init'
21698 sig_size='$sig_size'
21699 signal_t='$signal_t'
21700 sitearch='$sitearch'
21701 sitearchexp='$sitearchexp'
21703 sitebinexp='$sitebinexp'
21704 sitehtml1dir='$sitehtml1dir'
21705 sitehtml1direxp='$sitehtml1direxp'
21706 sitehtml3dir='$sitehtml3dir'
21707 sitehtml3direxp='$sitehtml3direxp'
21709 sitelib_stem='$sitelib_stem'
21710 sitelibexp='$sitelibexp'
21711 siteman1dir='$siteman1dir'
21712 siteman1direxp='$siteman1direxp'
21713 siteman3dir='$siteman3dir'
21714 siteman3direxp='$siteman3direxp'
21715 siteprefix='$siteprefix'
21716 siteprefixexp='$siteprefixexp'
21717 sitescript='$sitescript'
21718 sitescriptexp='$sitescriptexp'
21719 sizesize='$sizesize'
21720 sizetype='$sizetype'
21724 sockethdr='$sockethdr'
21725 socketlib='$socketlib'
21726 socksizetype='$socksizetype'
21728 spackage='$spackage'
21729 spitshell='$spitshell'
21730 srand48_r_proto='$srand48_r_proto'
21731 srandom_r_proto='$srandom_r_proto'
21733 ssizetype='$ssizetype'
21734 startperl='$startperl'
21736 static_ext='$static_ext'
21738 stdio_base='$stdio_base'
21739 stdio_bufsiz='$stdio_bufsiz'
21740 stdio_cnt='$stdio_cnt'
21741 stdio_filbuf='$stdio_filbuf'
21742 stdio_ptr='$stdio_ptr'
21743 stdio_stream_array='$stdio_stream_array'
21744 strerror_r_proto='$strerror_r_proto'
21747 subversion='$subversion'
21751 targetarch='$targetarch'
21755 timeincl='$timeincl'
21756 timetype='$timetype'
21757 tmpnam_r_proto='$tmpnam_r_proto'
21763 ttyname_r_proto='$ttyname_r_proto'
21772 uidformat='$uidformat'
21778 uquadtype='$uquadtype'
21779 use5005threads='$use5005threads'
21780 use64bitall='$use64bitall'
21781 use64bitint='$use64bitint'
21782 usecrosscompile='$usecrosscompile'
21784 usefaststdio='$usefaststdio'
21785 useithreads='$useithreads'
21786 uselargefiles='$uselargefiles'
21787 uselongdouble='$uselongdouble'
21788 usemallocwrap='$usemallocwrap'
21789 usemorebits='$usemorebits'
21790 usemultiplicity='$usemultiplicity'
21791 usemymalloc='$usemymalloc'
21793 useopcode='$useopcode'
21794 useperlio='$useperlio'
21795 useposix='$useposix'
21796 usereentrant='$usereentrant'
21797 userelocatableinc='$userelocatableinc'
21799 useshrplib='$useshrplib'
21800 usesitecustomize='$usesitecustomize'
21801 usesocks='$usesocks'
21802 usethreads='$usethreads'
21803 usevendorprefix='$usevendorprefix'
21804 usevfork='$usevfork'
21807 uvXUformat='$uvXUformat'
21808 uvoformat='$uvoformat'
21811 uvuformat='$uvuformat'
21812 uvxformat='$uvxformat'
21813 vendorarch='$vendorarch'
21814 vendorarchexp='$vendorarchexp'
21815 vendorbin='$vendorbin'
21816 vendorbinexp='$vendorbinexp'
21817 vendorhtml1dir='$vendorhtml1dir'
21818 vendorhtml1direxp='$vendorhtml1direxp'
21819 vendorhtml3dir='$vendorhtml3dir'
21820 vendorhtml3direxp='$vendorhtml3direxp'
21821 vendorlib='$vendorlib'
21822 vendorlib_stem='$vendorlib_stem'
21823 vendorlibexp='$vendorlibexp'
21824 vendorman1dir='$vendorman1dir'
21825 vendorman1direxp='$vendorman1direxp'
21826 vendorman3dir='$vendorman3dir'
21827 vendorman3direxp='$vendorman3direxp'
21828 vendorprefix='$vendorprefix'
21829 vendorprefixexp='$vendorprefixexp'
21830 vendorscript='$vendorscript'
21831 vendorscriptexp='$vendorscriptexp'
21833 version_patchlevel_string='$version_patchlevel_string'
21834 versiononly='$versiononly'
21836 voidflags='$voidflags'
21839 yaccflags='$yaccflags'
21844 : Add in command line options if available
21845 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21847 : add special variables
21848 $test -f $src/patchlevel.h && \
21849 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21850 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21851 echo "PERL_CONFIG_SH=true" >>config.sh
21853 : propagate old symbols
21854 if $test -f UU/config.sh; then
21855 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21856 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21857 $sort | $uniq -u >UU/oldsyms
21858 set X `cat UU/oldsyms`
21864 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21866 echo "# Variables propagated from previous config.sh file." >>config.sh
21867 for sym in `cat UU/oldsyms`; do
21868 echo " Propagating $hint variable "'$'"$sym..."
21869 eval 'tmp="$'"${sym}"'"'
21871 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21877 : Finish up by extracting the .SH files
21881 echo "Extraction done."
21891 If you'd like to make any changes to the config.sh file before I begin
21892 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21895 rp="Press return or use a shell escape to edit config.sh:"
21900 *) : in case they cannot read
21901 sh 1>&4 -c "$ans";;
21906 : if this fails, just run all the .SH files by hand
21915 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21922 Now you need to generate make dependencies by running "$make depend".
21923 You might prefer to run it in background: "$make depend > makedepend.out &"
21924 It can take a while, so you might not want to run it right now.
21929 rp="Run $make depend now?"
21933 $make depend && echo "Now you must run '$make'."
21936 echo "You must run '$make depend' then '$make'."
21939 elif test -f [Mm]akefile; then
21941 echo "Now you must run a $make."
21943 echo "Configure done."
21946 if $test -f Policy.sh; then
21949 If you compile $package on a different machine or from a different object
21950 directory, copy the Policy.sh file from this object directory to the
21951 new one before you run Configure -- this will help you with most of
21952 the policy defaults.
21956 if $test -f config.msg; then
21957 echo "Hmm. I also noted the following information while running:"
21959 $cat config.msg >&4
21962 $rm -f kit*isdone ark*isdone