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 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Tue Oct 18 16:11:43 CEST 2005 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
401 endhostent_r_proto=''
407 endprotoent_r_proto=''
413 endservent_r_proto=''
464 gethostbyaddr_r_proto=''
466 gethostbyname_r_proto=''
468 gethostent_r_proto=''
480 getnetbyaddr_r_proto=''
482 getnetbyname_r_proto=''
496 d_getprotobyname_r=''
497 getprotobyname_r_proto=''
498 d_getprotobynumber_r=''
499 getprotobynumber_r_proto=''
501 getprotoent_r_proto=''
513 getservbyname_r_proto=''
515 getservbyport_r_proto=''
517 getservent_r_proto=''
541 d_libm_lib_version=''
554 d_malloc_good_size=''
596 d_old_pthread_create_joinable=''
597 old_pthread_create_joinable=''
599 d_pthread_attr_setscope=''
638 sethostent_r_proto=''
655 setprotoent_r_proto=''
667 setservent_r_proto=''
712 d_stdio_ptr_lval_nochange_cnt=''
713 d_stdio_ptr_lval_sets_cnt=''
917 inc_version_list_init=''
936 ignore_versioned_solibs=''
996 d_perl_otherlibdirs=''
1004 api_versionstring=''
1010 version_patchlevel_string=''
1014 d_nv_preserves_uv=''
1015 d_nv_zero_is_allbits_zero=''
1026 nv_preserves_uv_bits=''
1097 installsitehtml1dir=''
1100 installsitehtml3dir=''
1107 installsiteman1dir=''
1110 installsiteman3dir=''
1115 installsitescript=''
1130 d_stdio_stream_array=''
1131 stdio_stream_array=''
1142 ccflags_uselargefiles=''
1143 ldflags_uselargefiles=''
1144 libswanted_uselargefiles=''
1154 userelocatableinc=''
1165 installvendorarch=''
1172 installvendorhtml1dir=''
1174 vendorhtml1direxp=''
1175 installvendorhtml3dir=''
1177 vendorhtml3direxp=''
1183 installvendorman1dir=''
1186 installvendorman3dir=''
1193 installvendorscript=''
1205 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1208 : We must find out about Eunice early
1210 if test -f /etc/unixtovms; then
1211 eunicefix=/etc/unixtovms
1213 if test -f /etc/unixtovms.exe; then
1214 eunicefix=/etc/unixtovms.exe
1217 : Set executable suffix now -- needed before hints available
1218 if test -f "/libs/version.library"; then
1221 elif test -f "/system/gnu_library/bin/ar.pm"; then
1224 elif test -n "$DJGPP"; then
1227 elif test -d c:/. -o -n "$is_os2" ; then
1236 : set useposix=false in your hint file to disable the POSIX extension.
1238 : set useopcode=false in your hint file to disable the Opcode extension.
1240 : Trailing extension. Override this in a hint file, if needed.
1241 : Extra object files, if any, needed on this platform.
1244 : Possible local include directories to search.
1245 : Set locincpth to "" in a hint file to defeat local include searches.
1246 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1247 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1249 : no include file wanted by default
1254 : change the next line if compiling for Xenix/286 on Xenix/386
1255 xlibpth='/usr/lib/386 /lib/386'
1256 : Possible local library directories to search.
1257 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1258 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1260 : general looking path for locating libraries
1261 glibpth="/lib /usr/lib $xlibpth"
1262 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1263 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1264 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1266 : Private path used by Configure to find libraries. Its value
1267 : is prepended to libpth. This variable takes care of special
1268 : machines, like the mips. Usually, it should be empty.
1271 : default library list
1273 : some systems want to use only the non-versioned libso:s
1274 ignore_versioned_solibs=''
1279 ccflags_uselargefiles=''
1280 ldflags_uselargefiles=''
1281 libswanted_uselargefiles=''
1282 : set usemultiplicity on the Configure command line to enable multiplicity.
1283 : set usesocks on the Configure command line to enable socks.
1284 : set usethreads on the Configure command line to enable threads.
1285 usereentrant='undef'
1286 : full support for void wanted by default
1289 : List of libraries we want.
1290 : If anyone needs extra -lxxx, put those in a hint file.
1291 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1292 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1293 : We probably want to search /usr/shlib before most other libraries.
1294 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1295 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1296 glibpth="/usr/shlib $glibpth"
1297 : Do not use vfork unless overridden by a hint file.
1300 : Find the basic shell for Bourne shell scripts
1304 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1307 if test -f "$xxx"; then
1310 : Build up a list and do a single loop so we can 'break' out.
1311 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1312 for xxx in sh bash ksh pdksh ash; do
1314 try="$try ${p}/${xxx}"
1318 if test -f "$xxx"; then
1321 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1324 elif test -f "$xxx.exe"; then
1335 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1337 Usually it's in /bin/sh. How did you even get this far?
1338 Please contact me (Perl Maintainers) at perlbug@perl.org and
1339 we'll try to straighten this all out.
1345 : see if sh knows # comments
1346 if `$sh -c '#' >/dev/null 2>&1`; then
1350 test -f $xcat$_exe || xcat=/usr/bin/cat
1351 if test ! -f $xcat$_exe; then
1352 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1353 if test -f $p/cat$_exe; then
1358 if test ! -f $xcat$_exe; then
1359 echo "Can't find cat anywhere!"
1363 echo "#!$xcat" >sharp
1367 if test -s today; then
1370 echo "#! $xcat" > sharp
1374 if test -s today; then
1382 echo "Your $sh doesn't grok # comments--I will strip them later on."
1385 echo "exec grep -v '^[ ]*#'" >spitshell
1387 $eunicefix spitshell
1388 spitshell=`pwd`/spitshell
1390 echo "I presume that if # doesn't work, #! won't work either!"
1395 : figure out how to guarantee sh startup
1397 '') startsh=${sharpbang}${sh} ;;
1409 : echo "Yup, it does."
1411 echo "Hmm... '$startsh' does not guarantee sh startup..."
1412 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1417 : Save command line options in file UU/cmdline.opt for later use in
1418 : generating config.sh.
1419 cat > cmdline.opt <<EOSH
1420 # Configure command line arguments.
1429 cat >>cmdline.opt <<EOSH
1430 config_arg$argn='$arg'
1432 # Extreme backslashitis: replace each ' by '"'"'
1433 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1436 arg_exp=`cat cmdl.opt`
1437 args_exp="$args_exp$args_sep'$arg_exp'"
1438 argn=`expr $argn + 1`
1441 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1442 # used by ./hints/os2.sh
1445 : produce awk script to parse command line options
1446 cat >options.awk <<'EOF'
1448 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1450 len = length(optstr);
1451 for (i = 1; i <= len; i++) {
1452 c = substr(optstr, i, 1);
1453 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1464 if (substr(str, 1, 1) != "-") {
1465 printf("'%s'\n", str);
1469 for (i = 2; i <= len; i++) {
1470 c = substr(str, i, 1);
1472 printf("-%s\n", substr(str, i));
1478 printf("'%s'\n", substr(str, i + 1));
1491 : process the command line options
1492 set X `for arg in "$@"; do echo "X$arg"; done |
1493 sed -e s/X// | awk -f options.awk`
1498 : set up default values
1508 rm -f optdef.sh posthint.sh
1509 cat >optdef.sh <<EOS
1515 while test $# -gt 0; do
1517 -d) shift; fastread=yes;;
1518 -e) shift; alldone=cont;;
1522 if test -r "$1"; then
1525 echo "$me: cannot read config file $1." >&2
1530 -h) shift; error=true;;
1531 -r) shift; reuseval=true;;
1532 -s) shift; silent=true; realsilent=true;;
1533 -E) shift; alldone=exit;;
1534 -K) shift; knowitall=true;;
1535 -O) shift; override=true;;
1536 -S) shift; silent=true; extractsh=true;;
1541 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1542 echo "$me: ignoring -D $1" >&2
1545 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1546 *) echo "$1='define'" >> optdef.sh;;
1553 *=) echo "$1" >> optdef.sh;;
1555 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1556 echo "$me: ignoring -U $1" >&2
1558 *) echo "$1='undef'" >> optdef.sh;;
1569 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1573 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1574 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1580 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1581 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1582 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1583 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1584 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1585 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1591 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1593 echo "$yyy=''" >> posthint.sh ;;
1598 echo "$yyy='$zzz'" >> posthint.sh ;;
1600 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1602 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1607 echo "$yyy=$zzz" >> posthint.sh ;;
1608 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1612 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1615 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1623 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1624 [-U symbol] [-U symbol=] [-A command:symbol...]
1625 -d : use defaults for all answers.
1626 -e : go on without questioning past the production of config.sh.
1627 -f : specify an alternate default configuration file.
1628 -h : print this help message and exit (with an error status).
1629 -r : reuse C symbols value if possible (skips costly nm extraction).
1630 -s : silent mode, only echoes questions and essential information.
1631 -D : define symbol to have some value:
1632 -D symbol symbol gets the value 'define'
1633 -D symbol=value symbol gets the value 'value'
1634 -E : stop at the end of questions, after having produced config.sh.
1635 -K : do not use unless you know what you are doing.
1636 -O : let -D and -U override definitions from loaded configuration file.
1637 -S : perform variable substitutions on all .SH files (can mix with -f)
1638 -U : undefine symbol:
1639 -U symbol symbol gets the value 'undef'
1640 -U symbol= symbol gets completely empty
1641 -A : manipulate symbol after the platform specific hints have been applied:
1642 -A symbol=value append " "value to symbol
1643 -A append:symbol=value append value to symbol
1644 -A define:symbol=value define symbol to have value
1645 -A clear:symbol define symbol to be ''
1646 -A define:symbol define symbol to be 'define'
1647 -A eval:symbol=value define symbol to be eval of value
1648 -A prepend:symbol=value prepend value to symbol
1649 -A undef:symbol define symbol to be 'undef'
1650 -A undef:symbol= define symbol to be ''
1651 -V : print version number and exit (with a zero status).
1658 case "$fastread$alldone" in
1661 case "$extractsh" in
1664 if test ! -t 0; then
1665 echo "Say 'sh Configure', not 'sh <Configure'"
1675 true) exec 1>/dev/null;;
1678 : run the defines and the undefines, if any, but leave the file out there...
1681 : create the posthint manipulation script and leave the file out there...
1686 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1687 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1688 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1689 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1690 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1693 : Some greps do not return status, grrr.
1694 echo "grimblepritz" >grimble
1695 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1697 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1703 : the following should work in any shell
1707 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1708 cat >contains <<'EOSS'
1709 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1714 : Find the path to the source tree
1717 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1721 *) src=`cd ../$src && pwd` ;;
1734 if test -f $rsrc/Configure && \
1735 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1737 : found it, so we are ok.
1740 for src in . .. ../.. ../../.. ../../../..; do
1741 if test -f ../$src/Configure && \
1742 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1753 Sorry, I can't seem to locate the source dir for $package. Please start
1754 Configure with an explicit path -- i.e. /some/path/Configure.
1762 echo "Sources for $package found in \"$src\"." >&4
1766 : script used to extract .SH files with variable substitutions
1767 cat >extract <<'EOS'
1769 echo "Doing variable substitutions on .SH files..."
1770 if test -f MANIFEST; then
1771 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1773 echo "(Looking for .SH files under the source directory.)"
1774 set x `(cd "$src"; find . -name "*.SH" -print)`
1778 0) set x `(cd "$src"; echo *.SH)`; shift;;
1780 if test ! -f "$src/$1"; then
1786 while test $name; do
1787 if test ! -d "$name"; then
1788 create="$name $create";
1789 name=`echo $name | sed -e "s|^[^/]*$||"`;
1790 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1795 for file in $create; do
1804 dir=`expr X$file : 'X\(.*\)/'`
1805 file=`expr X$file : 'X.*/\(.*\)'`
1806 (cd "$dir" && . ./$file)
1816 dir=`expr X$file : 'X\(.*\)/'`
1817 file=`expr X$file : 'X.*/\(.*\)'`
1818 (set x $dir; shift; eval $mkdir_p)
1819 sh <"$src/$dir/$file"
1828 if test -f "$src/config_h.SH"; then
1829 if test ! -f config.h; then
1830 : oops, they left it out of MANIFEST, probably, so do it anyway.
1831 . "$src/config_h.SH"
1836 : extract files and exit if asked to do so
1837 case "$extractsh" in
1839 case "$realsilent" in
1843 case "$config_sh" in
1844 '') config_sh='config.sh';;
1847 echo "Fetching answers from $config_sh..."
1850 test "$override" && . ./optdef.sh
1854 echo "Extraction done."
1859 : Eunice requires " " instead of "", can you believe it
1862 echo "Beginning of configuration questions for $package."
1864 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1866 : first determine how to suppress newline on echo command
1868 echo "Checking echo to see how to suppress newlines..."
1869 (echo "hi there\c" ; echo " ") >.echotmp
1870 if $contains c .echotmp >/dev/null 2>&1 ; then
1881 echo $n "The star should be here-->$c"
1885 : Now test for existence of everything in MANIFEST
1887 if test -f "$rsrc/MANIFEST"; then
1888 echo "First let's make sure your kit is complete. Checking..." >&4
1889 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1892 for filelist in x??; do
1893 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1895 if test -s missing; then
1899 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1901 You have the option of continuing the configuration process, despite the
1902 distinct possibility that your kit is damaged, by typing 'y'es. If you
1903 do, don't blame me if something goes wrong. I advise you to type 'n'o
1904 and contact the author (perlbug@perl.org).
1907 echo $n "Continue? [n] $c" >&4
1911 echo "Continuing..." >&4
1915 echo "ABORTING..." >&4
1920 echo "Looks good..."
1923 echo "There is no MANIFEST file. I hope your kit is complete !"
1928 : Find the appropriate value for a newline for tr
1929 if test -n "$DJGPP"; then
1932 if test X"$trnl" = X; then
1933 case "`echo foo|tr '\n' x 2>/dev/null`" in
1937 if test X"$trnl" = X; then
1938 case "`echo foo|tr '\012' x 2>/dev/null`" in
1939 foox) trnl='\012' ;;
1942 if test X"$trnl" = X; then
1943 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1944 fooxy) trnl='\n\r' ;;
1947 if test X"$trnl" = X; then
1950 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1956 : compute the number of columns on the terminal for proper question formatting
1961 : set up the echo used in my read
1962 myecho="case \"\$xxxm\" in
1963 '') echo $n \"\$rp $c\" >&4;;
1965 '') echo $n \"[\$xxxm] $c\";;
1967 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1969 echo $n \"[\$xxxm] $c\" >&4
1971 echo $n \"\$rp [\$xxxm] $c\" >&4
1977 : now set up to do reads with possible shell escape and default assignment
1983 case "\$fastread" in
1984 yes) case "\$dflt" in
1987 case "\$silent-\$rp" in
1992 *) case "\$silent" in
1993 true) case "\$rp" in
1998 while expr "X\$ans" : "X!" >/dev/null; do
2002 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2010 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2019 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2024 echo "(OK, I'll run with -d after this question.)" >&4
2027 echo "*** Sorry, \$1 not supported yet." >&4
2037 echo "*** Substitution done -- please confirm."
2039 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2044 echo "*** Error -- try again."
2051 case "\$ans\$xxxm\$nostick" in
2063 : create .config dir to save info across Configure sessions
2064 test -d ../.config || mkdir ../.config
2065 cat >../.config/README <<EOF
2066 This directory created by Configure to save information that should
2067 persist across sessions for $package.
2069 You may safely delete it if you wish.
2072 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2074 $define|true|[yY]*) ;;
2075 *) case "$xversion" in
2078 *** WHOA THERE!!! ***
2080 This is an UNSTABLE DEVELOPMENT release.
2081 The version of this $package distribution is $xversion, that is, odd,
2082 (as opposed to even) and that signifies a development release.
2083 If you want a maintenance release, you want an even-numbered version.
2085 Do ***NOT*** install this into production use.
2086 Data corruption and crashes are possible.
2088 It is most seriously suggested that you do not continue any further
2089 unless you want to help in developing and debugging Perl.
2091 If you *still* want to build perl, you can answer 'y' now,
2092 or pass -Dusedevel to Configure.
2095 rp='Do you really want to continue?'
2099 [yY]) echo >&4 "Okay, continuing."
2100 usedevel="$define" ;;
2101 *) echo >&4 "Okay, bye."
2111 case "$versiononly" in
2112 '') versiononly="$define" ;;
2114 case "$installusrbinperl" in
2115 '') installusrbinperl="$undef" ;;
2120 : general instructions
2123 user=`(logname) 2>/dev/null`
2125 '') user=`whoami 2>&1`;;
2127 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2130 rp='Would you like to see the instructions?'
2141 This installation shell script will examine your system and ask you questions
2142 to determine how the perl5 package should be installed. If you get
2143 stuck on a question, you may use a ! shell escape to start a subshell or
2144 execute a command. Many of the questions will have default answers in square
2145 brackets; typing carriage return will give you the default.
2147 On some of the questions which ask for file or directory names you are allowed
2148 to use the ~name construct to specify the login directory belonging to "name",
2149 even if you don't have a shell which knows about that. Questions where this is
2150 allowed will be marked "(~name ok)".
2154 dflt='Type carriage return to continue'
2158 The prompter used in this script allows you to use shell variables and
2159 backticks in your answers. You may use $1, $2, etc... to refer to the words
2160 in the default answer, as if the default line was a set of arguments given to a
2161 script shell. This means you may also use $* to repeat the whole default line,
2162 so you do not have to re-type everything to add something to the default.
2164 Everytime there is a substitution, you will have to confirm. If there is an
2165 error (e.g. an unmatched backtick), the default answer will remain unchanged
2166 and you will be prompted again.
2168 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2169 the questions and use the computed defaults (or the previous answers if there
2170 was already a config.sh file). Type 'Configure -h' for a list of options.
2171 You may also start interactively and then answer '& -d' at any prompt to turn
2172 on the non-interactive behaviour for the remainder of the execution.
2178 Much effort has been expended to ensure that this shell script will run on any
2179 Unix system. If despite that it blows up on yours, your best bet is to edit
2180 Configure and run it again. If you can't run Configure for some reason,
2181 you'll have to generate a config.sh file by hand. Whatever problems you
2182 have, let me (perlbug@perl.org) know how I blew it.
2184 This installation script affects things in two ways:
2186 1) it may do direct variable substitutions on some of the files included
2188 2) it builds a config.h file for inclusion in C programs. You may edit
2189 any of these files as the need arises after running this script.
2191 If you make a mistake on a question, there is no easy way to back up to it
2192 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2193 files. Configure will offer to let you do this before it runs the SH files.
2196 dflt='Type carriage return to continue'
2198 case "$firsttime" in
2199 true) echo $user >>../.config/instruct;;
2203 : find out where common programs are
2205 echo "Locating common programs..." >&4
2218 if test -d \$dir/\$thing; then
2224 for thisthing in \$dir/\$thing; do
2225 : just loop through to pick last item
2227 if test -f \$thisthing; then
2230 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2233 elif test -f \$dir/\$thing.exe; then
2234 if test -n "$DJGPP"; then
2235 echo \$dir/\$thing.exe
2236 elif test "$eunicefix" != ":"; then
2237 : on Eunice apparently
2291 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2292 pth="$pth /lib /usr/lib"
2293 for file in $loclist; do
2297 if test -f "$xxx"; then
2300 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2301 xxx=`./loc $file $file $pth`
2304 '') xxx=`./loc $file $file $pth`;;
2305 *) xxx=`./loc $xxx $xxx $pth`;;
2307 eval $file=$xxx$_exe
2311 echo $file is in $xxx.
2314 echo $file is in $xxx.
2317 echo "I don't know where '$file' is, and my life depends on it." >&4
2318 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2324 echo "Don't worry if any of the following aren't found..."
2326 for file in $trylist; do
2330 if test -f "$xxx"; then
2333 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2334 xxx=`./loc $file $file $pth`
2337 '') xxx=`./loc $file $file $pth`;;
2338 *) xxx=`./loc $xxx $xxx $pth`;;
2340 eval $file=$xxx$_exe
2344 echo $file is in $xxx.
2347 echo $file is in $xxx.
2350 echo "I don't see $file out there, $say."
2357 echo "Substituting grep for egrep."
2364 echo "Substituting cp for ln."
2373 echo "I can't find make or gmake, and my life depends on it." >&4
2374 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2382 *) # We can't have osname yet.
2383 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2384 # Assume that gmake, if found, is definitely GNU make
2385 # and prefer it over the system make.
2386 echo "Substituting gmake for make."
2394 echo "Hopefully test is built into your sh."
2397 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2398 echo "Using the test built into your sh."
2406 echo "Hopefully echo is built into your sh."
2411 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2412 $echo $n "hi there$c" >foo1
2413 echo $n "hi there$c" >foo2
2414 if cmp foo1 foo2 >/dev/null 2>&1; then
2415 echo "They are compatible. In fact, they may be identical."
2422 They are not compatible! You are probably running ksh on a non-USG system.
2423 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2424 have echo built in and we may have to run some Bourne shell scripts. That
2425 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2428 $echo $n "The star should be here-->$c"
2438 cat <<'EOSC' >>trygcc
2443 int main(int argc, char *argv[]) {
2447 if $cc -o try $ccflags $ldflags try.c; then
2450 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2456 case "`$cc -v -c try.c 2>&1`" in
2459 if $test X"$trygcc" = Xyes; then
2460 if gcc -o try -c try.c; then
2462 echo "You seem to have a working gcc, though." >&4
2463 rp="Would you like to use it?"
2465 if $test -f myread; then
2468 if $test -f UU/myread; then
2471 echo "Cannot find myread, sorry. Aborting." >&2
2476 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2477 if $test -f usethreads.cbu; then
2480 *** However, any setting of the C compiler flags (e.g. for thread support)
2481 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2482 *** (together with e.g. -Dusethreads).
2498 cat <<'EOSC' >>checkcc
2503 int main(int argc, char *argv[]) {
2507 if $cc -o try $ccflags $ldflags try.c; then
2510 if $test X"$despair" = Xyes; then
2511 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2514 You need to find a working C compiler.
2515 Either (purchase and) install the C compiler supplied by your OS vendor,
2516 or for a free C compiler try http://gcc.gnu.org/
2517 I cannot continue any further, aborting.
2526 : determine whether symbolic links are supported
2529 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2530 echo "Symbolic links are supported." >&4
2533 echo "Symbolic links are NOT supported." >&4
2538 : determine whether symbolic links are supported
2542 echo "Checking how to test for symbolic links..." >&4
2544 if $test "X$issymlink" = X; then
2546 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2547 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2549 if test $? = 0; then
2552 echo "Your builtin 'test -h' may be broken." >&4
2555 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2558 if test -f "$p/$test"; then
2567 echo "Trying external '$test -h'." >&4
2568 issymlink="$test -h"
2569 if $test ! -h sym >/dev/null 2>&1; then
2570 echo "External '$test -h' is broken, too." >&4
2578 if $test "X$issymlink" = X; then
2579 if $test -L sym 2>/dev/null; then
2580 issymlink="$test -L"
2581 echo "The builtin '$test -L' worked." >&4
2584 if $test "X$issymlink" != X; then
2585 echo "You can test for symbolic links with '$issymlink'." >&4
2587 echo "I do not know how you can test for symbolic links." >&4
2591 *) echo "No symbolic links, so not testing for their testing..." >&4
2597 case "$mksymlinks" in
2600 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2603 *) case "$lns:$issymlink" in
2604 *"ln"*" -s:"*"test -"?)
2605 echo "Creating the symbolic links..." >&4
2606 echo "(First creating the subdirectories...)" >&4
2608 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2610 test -z "$directory" && break
2614 if test ! -d t/base; then
2615 echo "Failed to create the subdirectories. Aborting." >&4
2618 echo "(Then creating the symlinks...)" >&4
2619 awk '{print $1}' $src/MANIFEST | while true; do
2621 test -z "$filename" && break
2622 if test -f $filename; then
2623 if $issymlink $filename; then
2627 if test -f $filename; then
2628 echo "$filename already exists, not symlinking."
2630 ln -s $src/$filename $filename
2634 if test ! -f t/base/lex.t; then
2635 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2640 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2649 case "$usecrosscompile" in
2651 $echo "Cross-compiling..."
2654 *-*-gcc) # A cross-compiling gcc, probably.
2655 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2657 # leave out ld, choosing it is more complex
2659 ranlib=$targetarch-ranlib
2660 $echo 'extern int foo;' > try.c
2661 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2663 if $test $# -gt 0; then
2665 incpth="`$echo $incpth|$sed 's/^ //'`"
2666 echo "Guessing incpth '$incpth'." >&4
2668 j="`$echo $i|$sed 's,/include$,/lib,'`"
2669 if $test -d $j; then
2673 libpth="`$echo $libpth|$sed 's/^ //'`"
2674 echo "Guessing libpth '$libpth'." >&4
2679 case "$targetarch" in
2680 '') echo "Targetarch not defined." >&4; croak=y ;;
2681 *) echo "Using targetarch $targetarch." >&4 ;;
2684 '') echo "Incpth not defined." >&4; croak=y ;;
2685 *) echo "Using incpth '$incpth'." >&4 ;;
2688 '') echo "Libpth not defined." >&4; croak=y ;;
2689 *) echo "Using libpth '$libpth'." >&4 ;;
2692 '') for i in $incpth; do
2693 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2695 echo "Guessing usrinc $usrinc." >&4
2700 '') echo "Usrinc not defined." >&4; croak=y ;;
2703 *) echo "Using usrinc $usrinc." >&4 ;;
2705 case "$targethost" in
2706 '') echo "Targethost not defined." >&4; croak=y ;;
2707 *) echo "Using targethost $targethost." >&4
2712 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2715 /*) run=$src/Cross/run
2716 targetmkdir=$src/Cross/mkdir
2718 from=$src/Cross/from
2720 *) pwd=`$test -f ../Configure & cd ..; pwd`
2722 targetmkdir=$pwd/Cross/mkdir
2724 from=$pwd/Cross/from
2727 case "$targetrun" in
2728 '') targetrun=ssh ;;
2733 case "$targetfrom" in
2734 '') targetfrom=scp ;;
2738 from=$from-$targetfrom
2739 case "$targetdir" in
2741 echo "Guessing targetdir $targetdir." >&4
2744 case "$targetuser" in
2746 echo "Guessing targetuser $targetuser." >&4
2749 case "$targetfrom" in
2753 case "$targetrun" in
2765 '') cwd=$targetdir ;;
2769 if $test ! -f \$exe.xok; then
2773 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2776 *) echo "Unknown targetrun '$targetrun'" >&4
2780 case "$targetmkdir" in
2782 cat >$targetmkdir <<EOF
2784 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2786 $chmod a+rx $targetmkdir
2788 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2800 $targetmkdir \`dirname \$f\`
2801 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2804 $targetmkdir $targetdir/\`dirname \$f\`
2805 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2818 $mkdir -p $targetdir/\`dirname \$f\`
2819 $cp \$f $targetdir/\$f || exit 1
2822 $targetmkdir $targetdir/\`dirname \$f\`
2823 $cp \$f $targetdir/\$f || exit 1
2830 *) echo "Unknown targetto '$targetto'" >&4
2834 case "$targetfrom" in
2841 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2846 cp) cat >$from <<EOF
2851 cp $targetdir/\$f . || exit 1
2856 *) echo "Unknown targetfrom '$targetfrom'" >&4
2860 if $test ! -f $run; then
2861 echo "Target 'run' script '$run' not found." >&4
2865 if $test ! -f $to; then
2866 echo "Target 'to' script '$to' not found." >&4
2870 if $test ! -f $from; then
2871 echo "Target 'from' script '$from' not found." >&4
2875 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2879 Using '$run' for remote execution,
2880 and '$from' and '$to'
2881 for remote file transfer.
2887 usecrosscompile='undef'
2892 : see whether [:lower:] and [:upper:] are supported character classes
2894 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2896 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2900 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2901 # (0xd9 and 0xe2), therefore that is a nice testing point.
2902 if test "X$up" = X -o "X$low" = X; then
2903 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2909 if test "X$up" = X -o "X$low" = X; then
2910 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2916 if test "X$up" = X -o "X$low" = X; then
2917 case "`echo RS | od -x 2>/dev/null`" in
2919 echo "Hey, this might be EBCDIC." >&4
2920 if test "X$up" = X -o "X$low" = X; then
2921 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2922 rs) up='[A-IJ-RS-Z]'
2927 if test "X$up" = X -o "X$low" = X; then
2928 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2938 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2940 echo "Using $up and $low to convert case." >&4
2943 echo "I don't know how to translate letters from upper to lower case." >&4
2944 echo "Your tr is not acting any way I know of." >&4
2948 : set up the translation script tr, must be called with ./tr of course
2952 '[A-Z][a-z]') exec $tr '$up' '$low';;
2953 '[a-z][A-Z]') exec $tr '$low' '$up';;
2960 : Try to determine whether config.sh was made on this system
2961 case "$config_sh" in
2963 myuname=`$uname -a 2>/dev/null`
2964 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2965 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2966 # because the A-Z/a-z are not consecutive.
2967 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2968 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2969 newmyuname="$myuname"
2971 case "$knowitall" in
2973 if test -f ../config.sh; then
2974 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2975 eval "`grep myuname= ../config.sh`"
2977 if test "X$myuname" = "X$newmyuname"; then
2985 : Get old answers from old config file if Configure was run on the
2986 : same system, otherwise use the hints.
2989 if test -f config.sh; then
2991 rp="I see a config.sh file. Shall I use it to set the defaults?"
2994 n*|N*) echo "OK, I'll ignore it."
2995 mv config.sh config.sh.old
2996 myuname="$newmyuname"
2998 *) echo "Fetching default answers from your old config.sh file..." >&4
3006 : Older versions did not always set $sh. Catch re-use of such
3016 if test ! -f config.sh; then
3019 First time through, eh? I have some defaults handy for some systems
3020 that need some extra help getting the Configure answers right:
3023 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3025 : Half the following guesses are probably wrong... If you have better
3026 : tests or hints, please send them to perlbug@perl.org
3027 : The metaconfig authors would also appreciate a copy...
3028 $test -f /irix && osname=irix
3029 $test -f /xenix && osname=sco_xenix
3030 $test -f /dynix && osname=dynix
3031 $test -f /dnix && osname=dnix
3032 $test -f /lynx.os && osname=lynxos
3033 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3034 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3035 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3036 $test -f /bin/mips && /bin/mips && osname=mips
3037 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3038 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3039 $test -d /usr/apollo/bin && osname=apollo
3040 $test -f /etc/saf/_sactab && osname=svr4
3041 $test -d /usr/include/minix && osname=minix
3042 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3043 if $test -d /MachTen -o -d /MachTen_Folder; then
3045 if $test -x /sbin/version; then
3046 osvers=`/sbin/version | $awk '{print $2}' |
3047 $sed -e 's/[A-Za-z]$//'`
3048 elif $test -x /usr/etc/version; then
3049 osvers=`/usr/etc/version | $awk '{print $2}' |
3050 $sed -e 's/[A-Za-z]$//'`
3056 $test -f /sys/posix.dll &&
3057 $test -f /usr/bin/what &&
3058 set X `/usr/bin/what /sys/posix.dll` &&
3059 $test "$3" = UWIN &&
3063 if $test -f $uname; then
3071 umips) osname=umips ;;
3074 [23]100) osname=mips ;;
3075 next*) osname=next ;;
3077 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3078 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3081 elif $test -f /etc/kconfig; then
3083 if test "$lns" = "$ln -s"; then
3085 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3087 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3094 if test -n "$DJGPP"; then
3103 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3105 # oslevel can fail with:
3106 # oslevel: Unable to acquire lock.
3107 *not\ found) osvers="$4"."$3" ;;
3108 '<3240'|'<>3240') osvers=3.2.0 ;;
3109 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3110 '=3250'|'>3250') osvers=3.2.5 ;;
3114 bsd386) osname=bsd386
3117 cygwin*) osname=cygwin
3120 *dc.osx) osname=dcosx
3126 domainos) osname=apollo
3132 dynixptx*) osname=dynixptx
3133 osvers=`echo "$4"|sed 's/^v//'`
3135 freebsd) osname=freebsd
3137 genix) osname=genix ;;
3141 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3157 netbsd*) osname=netbsd
3160 news-os) osvers="$3"
3162 4*) osname=newsos4 ;;
3166 next*) osname=next ;;
3167 nonstop-ux) osname=nonstopux ;;
3168 openbsd) osname=openbsd
3174 POSIX-BC | posix-bc ) osname=posix-bc
3177 powerux | power_ux | powermax_os | powermaxos | \
3178 powerunix | power_unix) osname=powerux
3184 solaris) osname=solaris
3186 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3193 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3197 titanos) osname=titanos
3206 ultrix) osname=ultrix
3209 osf1|mls+) case "$5" in
3212 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3215 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3218 hp*) osname=hp_osf1 ;;
3219 mips) osname=mips_osf1 ;;
3222 # UnixWare 7.1.2 is known as Open UNIX 8
3223 openunix|unixware) osname=svr5
3231 $2) case "$osname" in
3235 : svr4.x or possibly later
3245 if test -f /stand/boot ; then
3246 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3247 if test -n "$INITPROG" -a -f "$INITPROG"; then
3248 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3249 if test -n "$isesix"; then
3257 *) if test -f /etc/systemid; then
3259 set `echo $3 | $sed 's/\./ /g'` $4
3260 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3262 elif $test -f $src/hints/sco_$1_$2.sh; then
3264 elif $test -f $src/hints/sco_$1.sh; then
3269 '') : Still unknown. Probably a generic Sys V.
3278 *) case "$osname" in
3279 '') : Still unknown. Probably a generic BSD.
3287 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3288 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3289 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3292 $rm -f UU/kernel.what
3293 elif test -d c:/. -o -n "$is_os2" ; then
3300 case "$targetarch" in
3303 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3308 : Now look for a hint file osname_osvers, unless one has been
3309 : specified already.
3312 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3313 : Also try without trailing minor version numbers.
3314 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3315 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3316 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3317 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3320 *) case "$osvers" in
3323 *) if $test -f $src/hints/$file.sh ; then
3325 elif $test -f $src/hints/$xfile.sh ; then
3327 elif $test -f $src/hints/$xxfile.sh ; then
3329 elif $test -f $src/hints/$xxxfile.sh ; then
3331 elif $test -f $src/hints/$xxxxfile.sh ; then
3333 elif $test -f "$src/hints/${osname}.sh" ; then
3342 if $test -f Policy.sh ; then
3345 none) dflt="Policy" ;;
3346 *) dflt="Policy $dflt" ;;
3351 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3355 if $test -f Policy.sh ; then
3358 There's also a Policy hint file available, which should make the
3359 site-specific (policy) questions easier to answer.
3366 You may give one or more space-separated answers, or "none" if appropriate.
3367 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3368 is a good thing. DO NOT give a wrong version or a wrong OS.
3372 rp="Which of these apply, if any?"
3375 for file in $tans; do
3376 if $test X$file = XPolicy -a -f Policy.sh; then
3378 $cat Policy.sh >> UU/config.sh
3379 elif $test -f $src/hints/$file.sh; then
3380 . $src/hints/$file.sh
3381 $cat $src/hints/$file.sh >> UU/config.sh
3382 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3385 : Give one chance to correct a possible typo.
3386 echo "$file.sh does not exist"
3388 rp="hint to use instead?"
3390 for file in $ans; do
3391 if $test -f "$src/hints/$file.sh"; then
3392 . $src/hints/$file.sh
3393 $cat $src/hints/$file.sh >> UU/config.sh
3394 elif $test X$ans = X -o X$ans = Xnone ; then
3397 echo "$file.sh does not exist -- ignored."
3404 : Remember our hint file for later.
3405 if $test -f "$src/hints/$file.sh" ; then
3415 echo "Fetching default answers from $config_sh..." >&4
3419 cp $config_sh config.sh 2>/dev/null
3429 test "$override" && . ./optdef.sh
3431 : Restore computed paths
3432 for file in $loclist $trylist; do
3433 eval $file="\$_$file"
3438 Configure uses the operating system name and version to set some defaults.
3439 The default value is probably right if the name rings a bell. Otherwise,
3440 since spelling matters for me, either accept the default or answer "none"
3447 ''|' '|none) dflt=none ;;
3448 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3451 *) dflt="$osname" ;;
3453 rp="Operating system name?"
3457 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3463 ''|' '|none) dflt=none ;;
3464 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3465 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3467 ''|' ') dflt=none ;;
3472 *) dflt="$osvers" ;;
3474 rp="Operating system version?"
3484 : who configured the system
3485 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3488 cf_by=`(logname) 2>/dev/null`
3491 cf_by=`(whoami) 2>/dev/null`
3493 "") cf_by=unknown ;;
3498 : set up the script used to warn in case of inconsistency
3505 echo "*** WHOA THERE!!! ***" >&4
3506 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3507 rp=" Keep the $hint value?"
3510 y) td=$was; tu=$was;;
3514 : function used to set $1 to $val
3515 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3517 $define$undef) . ./whoa; eval "$var=\$td";;
3518 $undef$define) . ./whoa; eval "$var=\$tu";;
3519 *) eval "$var=$val";;
3523 $define|true|[yY]*) dflt='y';;
3528 Perl can be built to use the SOCKS proxy protocol library. To do so,
3529 Configure must be run with -Dusesocks. If you use SOCKS you also need
3530 to use the PerlIO abstraction layer, this will be implicitly selected.
3532 If this doesn't make any sense to you, just accept the default '$dflt'.
3534 rp='Build Perl for SOCKS?'
3537 y|Y) val="$define" ;;
3544 $define|true|[yY]*) useperlio="$define";;
3547 case "$useperlio" in
3548 $define|true|[yY]*|'') dflt='y';;
3553 Previous version of $package used the standard IO mechanisms as
3554 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3555 alternate IO mechanisms via the PerlIO abstraction layer, but the
3556 stdio mechanism is still available if needed. The abstraction layer
3557 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3558 Using PerlIO with sfio may cause problems with some extension modules.
3560 If this doesn't make any sense to you, just accept the default '$dflt'.
3562 rp='Use the PerlIO abstraction layer?'
3569 echo "Ok, doing things the stdio way."
3578 case "$useperlio" in
3579 $define|true|[yY]*) ;;
3582 You are using the SOCKS proxy protocol library which means that you
3583 should also use the PerlIO layer. You may be headed for trouble.
3592 case "$usethreads" in
3593 $define|true|[yY]*) dflt='y';;
3594 *) # Catch case where user specified ithreads or 5005threads but
3595 # forgot -Dusethreads (A.D. 4/2002)
3596 case "$useithreads$use5005threads" in
3598 case "$useperlio" in
3599 "$define") dflt='y' ;;
3609 Perl can be built to take advantage of threads on some systems.
3610 To do so, Configure can be run with -Dusethreads.
3612 Note that Perl built with threading support runs slightly slower
3613 and uses more memory than plain Perl. The current implementation
3614 is believed to be stable, but it is fairly new, and so should be
3615 treated with caution.
3617 If this doesn't make any sense to you, just accept the default '$dflt'.
3619 rp='Build a threading Perl?'
3622 y|Y) val="$define" ;;
3628 case "$usethreads" in
3632 Since release 5.6, Perl has had two different threading implementations,
3633 the newer interpreter-based version (ithreads) with one interpreter per
3634 thread, and the older 5.005 version (5005threads).
3635 The 5005threads version is effectively unmaintained and will probably be
3636 removed in Perl 5.10, so there should be no need to build a Perl using it
3637 unless needed for backwards compatibility with some existing 5.005threads
3641 : Default to ithreads unless overridden on command line or with
3644 case "$use5005threads" in
3645 $define|true|[yY]*) dflt='n';;
3647 case "$useithreads" in
3648 $undef|false|[nN]*) dflt='n';;
3650 rp='Use the newer interpreter-based ithreads?'
3653 y|Y) val="$define" ;;
3658 : Now set use5005threads to the opposite value.
3659 case "$useithreads" in
3660 $define) val="$undef" ;;
3667 useithreads="$undef"
3668 use5005threads="$undef"
3672 case "$useithreads$use5005threads" in
3676 You cannot have both the ithreads and the 5.005 threads enabled
3677 at the same time. Disabling the 5.005 threads since they are
3678 much less stable than the ithreads.
3681 use5005threads="$undef"
3685 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3688 *** To build with ithreads you must also use the PerlIO layer.
3689 *** Cannot continue, aborting.
3695 case "$d_oldpthreads" in
3696 '') : Configure tests would be welcome here. For now, assume undef.
3698 *) val="$d_oldpthreads" ;;
3704 : Look for a hint-file generated 'call-back-unit'. If the
3705 : user has specified that a threading perl is to be built,
3706 : we may need to set or change some other defaults.
3707 if $test -f usethreads.cbu; then
3708 echo "Your platform has some specific hints regarding threaded builds, using them..."
3711 case "$usethreads" in
3712 "$define"|true|[yY]*)
3714 (Your platform does not have any specific hints for threaded builds.
3715 Assuming POSIX threads, then.)
3723 Perl can be built so that multiple Perl interpreters can coexist
3724 within the same Perl executable.
3727 case "$useithreads" in
3730 This multiple interpreter support is required for interpreter-based threads.
3734 *) case "$usemultiplicity" in
3735 $define|true|[yY]*) dflt='y';;
3739 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3740 rp='Build Perl for multiplicity?'
3743 y|Y) val="$define" ;;
3752 case "$usemorebits" in
3753 "$define"|true|[yY]*)
3754 use64bitint="$define"
3755 uselongdouble="$define"
3756 usemorebits="$define"
3758 *) usemorebits="$undef"
3762 : make some quick guesses about what we are up against
3764 $echo $n "Hmm... $c"
3774 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3775 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3777 echo "Looks kind of like an OSF/1 system, but we'll see..."
3779 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3780 xxx=`./loc addbib blurfl $pth`
3781 if $test -f $xxx; then
3782 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3786 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3787 echo "Looks kind of like an extended USG system, but we'll see..."
3789 echo "Looks kind of like a USG system, but we'll see..."
3793 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3794 echo "Looks kind of like a BSD system, but we'll see..."
3798 echo "Looks kind of like a Version 7 system, but we'll see..."
3801 case "$eunicefix" in
3804 There is, however, a strange, musty smell in the air that reminds me of
3805 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3809 : it so happens the Eunice I know will not run shell scripts in Unix format
3813 echo "Congratulations. You aren't running Eunice."
3817 : Detect OS2. The p_ variable is set above in the Head.U unit.
3818 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3819 : semicolon as a patch separator
3824 I have the feeling something is not exactly right, however...don't tell me...
3825 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3826 (Or you may be running DOS with DJGPP.)
3831 if test -f /xenix; then
3832 echo "Actually, this looks more like a XENIX system..."
3837 echo "It's not Xenix..."
3842 if test -f /venix; then
3843 echo "Actually, this looks more like a VENIX system..."
3850 echo "Nor is it Venix..."
3853 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3854 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3861 rp="Use which C compiler?"
3865 : See if they have not cc but they do have gcc
3867 : Look for a hint-file generated 'call-back-unit'. Now that the
3868 : user has specified the compiler, we may need to set or change some
3870 if $test -f cc.cbu; then
3876 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3882 printf("%s\n", __VERSION__);
3884 printf("%s\n", "1");
3890 if $cc -o try $ccflags $ldflags try.c; then
3891 gccversion=`$run ./try`
3892 case "$gccversion" in
3893 '') echo "You are not using GNU cc." ;;
3894 *) echo "You are using GNU cc $gccversion."
3900 echo "*** WHOA THERE!!! ***" >&4
3901 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3902 case "$knowitall" in
3904 echo " You'd better start hunting for one and let me know about it." >&4
3910 case "$gccversion" in
3911 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3913 case "$gccversion" in
3914 '') gccosandvers='' ;;
3915 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3916 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3918 case "$gccosandvers" in
3919 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3920 $osname$osvers) ;; # looking good
3921 $osname*) cat <<EOM >&4
3923 *** WHOA THERE!!! ***
3925 Your gcc has not been compiled for the exact release of
3926 your operating system ($gccosandvers versus $osname$osvers).
3928 In general it is a good idea to keep gcc synchronized with
3929 the operating system because otherwise serious problems
3930 may ensue when trying to compile software, like Perl.
3932 I'm trying to be optimistic here, though, and will continue.
3933 If later during the configuration and build icky compilation
3934 problems appear (headerfile conflicts being the most common
3935 manifestation), I suggest reinstalling the gcc to match
3936 your operating system release.
3940 *) gccosandvers='' ;; # failed to parse, better be silent
3948 # gcc 3.* complain about adding -Idirectories that they already know about,
3949 # so we will take those off from locincpth.
3950 case "$gccversion" in
3952 echo "main(){}">try.c
3953 for incdir in $locincpth; do
3954 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3955 grep '^c[cp]p*[01]: warning: changing search order '`
3956 if test "X$warn" != X; then
3957 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3963 : decide how portable to be. Allow command line overrides.
3964 case "$d_portable" in
3966 *) d_portable="$define" ;;
3969 : set up shell script to do ~ expansion
3975 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3978 if $test -f /bin/csh; then
3979 /bin/csh -f -c "glob \$1"
3984 name=\`$expr x\$1 : '..\([^/]*\)'\`
3985 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3986 if $test ! -d "\$dir"; then
3988 echo "\$me: can't locate home directory for: \$name" >&2
3993 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4009 : now set up to get a file name
4013 cat <<'EOSC' >>getfile
4029 : getfile will accept an answer from the comma-separated list
4030 : enclosed in parentheses even if it does not meet other criteria.
4031 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4032 fn=`echo $fn | sed 's/(.*)//'`
4038 loc_file=`expr $fn : '.*:\(.*\)'`
4039 fn=`expr $fn : '\(.*\):.*'`
4047 */*) fullpath=true;;
4056 *e*) exp_file=true;;
4059 *p*) nopath_ok=true;;
4064 *d*) type='Directory';;
4065 *l*) type='Locate';;
4070 Locate) what='File';;
4075 case "$d_portable" in
4083 while test "$type"; do
4088 true) rp="$rp (~name ok)";;
4091 if test -f UU/getfile.ok && \
4092 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4111 value=`UU/filexp $ans`
4114 if test "$ans" != "$value"; then
4115 echo "(That expands to $value on this system.)"
4129 /*) value="$ansexp" ;;
4130 [a-zA-Z]:/*) value="$ansexp" ;;
4135 echo "I shall only accept a full path name, as in /bin/ls." >&4
4136 echo "Use a ! shell escape if you wish to check pathnames." >&4
4139 echo "Please give a full path name, starting with slash." >&4
4142 echo "Note that using ~name is ok provided it expands well." >&4
4155 for fp in $gfpth; do
4156 if test "X$fp" = X.; then
4161 if test -f "$pf"; then
4163 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4165 echo "($value is not a plain file, but that's ok.)"
4168 if test X"$type" = X; then
4175 for fp in $gfpth; do
4176 if test "X$fp" = X.; then
4181 direxp="$fp/$ansexp"
4183 if test -d "$direxp"; then
4191 if test -d "$ansexp"; then
4192 echo "(Looking for $loc_file in directory $value.)"
4193 value="$value/$loc_file"
4194 ansexp="$ansexp/$loc_file"
4196 if test -f "$ansexp"; then
4199 case "$nopath_ok" in
4200 true) case "$value" in
4202 *) echo "Assuming $value will be in people's path."
4218 if test "$fastread" = yes; then
4223 rp="$what $value doesn't exist. Use that name anyway?"
4242 test "X$gfpthkeep" != Xy && gfpth=""
4245 : What should the include directory be ?
4247 $echo $n "Hmm... $c"
4251 if $test -f /bin/mips && /bin/mips; then
4252 echo "Looks like a MIPS system..."
4253 $cat >usr.c <<'EOCP'
4254 #ifdef SYSTYPE_BSD43
4258 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4259 dflt='/bsd43/usr/include'
4263 mips_type='System V'
4265 $rm -f usr.c usr.out
4266 echo "and you're compiling with the $mips_type compiler and libraries."
4270 echo "Doesn't look like a MIPS system."
4280 case "$xxx_prompt" in
4283 rp='Where are the include files you want to use?'
4291 : see how we invoke the C preprocessor
4293 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4294 cat <<'EOT' >testcpp.c
4300 if test ! -f cppstdin; then
4301 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4302 # AIX cc -E doesn't show the absolute headerfile
4303 # locations but we'll cheat by using the -M flag.
4304 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
4306 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4309 echo "Keeping your $hint cppstdin wrapper."
4312 wrapper=`pwd`/cppstdin
4316 if $test "X$cppstdin" != "X" && \
4317 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4318 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4320 echo "You used to use $cppstdin $cppminus so we'll use that again."
4322 '') echo "But let's see if we can live without a wrapper..." ;;
4324 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4325 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4327 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4330 echo "(However, $cpprun $cpplast does not work, let's see...)"
4338 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4345 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4346 $cc -E <testcpp.c >testcpp.out 2>&1; \
4347 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4348 echo "Yup, it does."
4351 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4352 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4353 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4354 echo "Yup, it does."
4357 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4358 $cc -P <testcpp.c >testcpp.out 2>&1; \
4359 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4360 echo "Yipee, that works!"
4363 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4364 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4365 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4366 echo "At long last!"
4369 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4370 $cpp <testcpp.c >testcpp.out 2>&1; \
4371 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4375 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4376 $cpp - <testcpp.c >testcpp.out 2>&1; \
4377 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4378 echo "Hooray, it works! I was beginning to wonder."
4381 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4382 $wrapper <testcpp.c >testcpp.out 2>&1; \
4383 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4389 rp="No dice. I can't find a C preprocessor. Name one:"
4393 $x_cpp <testcpp.c >testcpp.out 2>&1
4394 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4395 echo "OK, that will do." >&4
4397 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4412 echo "Perhaps can we force $cc -E using a wrapper..."
4413 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4414 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4420 echo "Nope, we'll have to live without it..."
4434 "$wrapper"|'cppstdin') ;;
4435 *) $rm -f $wrapper;;
4437 $rm -f testcpp.c testcpp.out
4439 : Set private lib path
4442 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4447 '') dlist="$loclibpth $plibpth $glibpth";;
4448 *) dlist="$libpth";;
4451 : Now check and see which directories actually exist, avoiding duplicates
4455 if $test -d $xxx; then
4458 *) libpth="$libpth $xxx";;
4464 Some systems have incompatible or broken versions of libraries. Among
4465 the directories listed in the question below, please remove any you
4466 know not to be holding relevant libraries, and add any that are needed.
4467 Say "none" for none.
4478 rp="Directories to use for library searches?"
4485 : compute shared library extension
4488 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4498 On some systems, shared libraries may be available. Answer 'none' if
4499 you want to suppress searching of shared libraries for the remainder
4500 of this configuration.
4503 rp='What is the file extension used for shared libraries?'
4507 : Define several unixisms.
4508 : Hints files or command line option can be used to override them.
4509 : The convoluted testing is in case hints files set either the old
4512 '') case "$exe_ext" in
4514 *) _exe="$exe_ext" ;;
4519 '') case "$lib_ext" in
4526 '') case "$obj_ext" in
4533 '') case "$path_sep" in
4544 : Which makefile gets called first. This is used by make depend.
4545 case "$firstmakefile" in
4546 '') firstmakefile='makefile';;
4550 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4553 case "$uselongdouble" in
4554 $define|true|[yY]*) dflt='y';;
4559 Perl can be built to take advantage of long doubles which
4560 (if available) may give more accuracy and range for floating point numbers.
4562 If this doesn't make any sense to you, just accept the default '$dflt'.
4564 rp='Try to use long doubles if available?'
4567 y|Y) val="$define" ;;
4573 case "$uselongdouble" in
4574 true|[yY]*) uselongdouble="$define" ;;
4577 : Look for a hint-file generated 'call-back-unit'. If the
4578 : user has specified that long doubles should be used,
4579 : we may need to set or change some other defaults.
4580 if $test -f uselongdouble.cbu; then
4581 echo "Your platform has some specific hints regarding long doubles, using them..."
4582 . ./uselongdouble.cbu
4584 case "$uselongdouble" in
4587 (Your platform does not have any specific hints for long doubles.)
4593 : Looking for optional libraries
4595 echo "Checking for optional libraries..." >&4
4600 case "$libswanted" in
4601 '') libswanted='c_s';;
4604 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4610 for thisdir in $libpth $xlibpth; do
4611 test -d $thisdir && libspath="$libspath $thisdir"
4613 for thislib in $libswanted; do
4614 for thisdir in $libspath; do
4616 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4617 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4618 $test -f "$xxx" && eval $libscheck
4619 $test -f "$xxx" && libstyle=shared
4621 if test ! -f "$xxx"; then
4622 xxx=$thisdir/lib$thislib.$so
4623 $test -f "$xxx" && eval $libscheck
4624 $test -f "$xxx" && libstyle=shared
4626 if test ! -f "$xxx"; then
4627 xxx=$thisdir/lib$thislib$_a
4628 $test -f "$xxx" && eval $libscheck
4629 $test -f "$xxx" && libstyle=static
4631 if test ! -f "$xxx"; then
4632 xxx=$thisdir/$thislib$_a
4633 $test -f "$xxx" && eval $libscheck
4634 $test -f "$xxx" && libstyle=static
4636 if test ! -f "$xxx"; then
4637 xxx=$thisdir/lib${thislib}_s$_a
4638 $test -f "$xxx" && eval $libscheck
4639 $test -f "$xxx" && libstyle=static
4640 $test -f "$xxx" && thislib=${thislib}_s
4642 if test ! -f "$xxx"; then
4643 xxx=$thisdir/Slib$thislib$_a
4644 $test -f "$xxx" && eval $libscheck
4645 $test -f "$xxx" && libstyle=static
4647 if $test -f "$xxx"; then
4649 shared) echo "Found -l$thislib (shared)." ;;
4650 static) echo "Found -l$thislib." ;;
4651 *) echo "Found -l$thislib ($libstyle)." ;;
4655 *) dflt="$dflt -l$thislib"
4656 libsfound="$libsfound $xxx"
4658 libsfiles="$libsfiles $yyy"
4659 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4660 case " $libsdirs " in
4662 *) libsdirs="$libsdirs $yyy" ;;
4669 if $test ! -f "$xxx"; then
4670 echo "No -l$thislib."
4681 ' '|'') dflt='none';;
4686 In order to compile $package on your machine, a number of libraries
4687 are usually needed. Include any other special libraries here as well.
4688 Say "none" for none. The default list is almost always right.
4692 rp="What libraries to use?"
4699 : determine optimization, if desired, or use for debug flag also
4701 ' '|$undef) dflt='none';;
4703 *) dflt="$optimize";;
4707 By default, $package compiles with the -O flag to use the optimizer.
4708 Alternately, you might want to use the symbolic debugger, which uses
4709 the -g flag (on traditional Unix systems). Either flag can be
4710 specified here. To use neither flag, specify the word "none".
4713 rp="What optimizer/debugger flag should be used?"
4717 'none') optimize=" ";;
4721 : We will not override a previous value, but we might want to
4722 : augment a hint file
4724 default|recommended)
4725 case "$gccversion" in
4726 1*) dflt='-fpcc-struct-return' ;;
4729 *-g*) dflt="$dflt -DDEBUGGING";;
4731 case "$gccversion" in
4732 2*) if test -d /etc/conf/kconfig.d &&
4733 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4735 # Interactive Systems (ISC) POSIX mode.
4740 case "$gccversion" in
4744 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4745 echo 'int main(void) { return 0; }' > gcctest.c
4746 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4747 echo "Yes, it does." 2>&1
4750 echo "Leaving current flags $ccflags alone." 2>&1
4752 *) dflt="$dflt -fno-strict-aliasing" ;;
4755 echo "Nope, it doesn't, but that's ok." 2>&1
4759 # For gcc, adding -pipe speeds up compilations for some, but apparently
4760 # some assemblers can't read from stdin. (It also slows down compilations
4761 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4762 case "$gccversion" in
4764 echo "Checking if your compiler accepts -pipe" 2>&1
4765 echo 'int main(void) { return 0; }' > gcctest.c
4766 if $cc -pipe -o gcctest gcctest.c; then
4767 echo "Yes, it does." 2>&1
4770 echo "Leaving current flags $ccflags alone." 2>&1
4772 *) dflt="$dflt -pipe" ;;
4775 echo "Nope, it doesn't, but that's ok." 2>&1
4778 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4779 echo 'int main(void) { return 0; }' > gcctest.c
4780 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4781 echo "Yes, it does." 2>&1
4783 *-Wdeclaration-after-statement*)
4784 echo "Leaving current flags $ccflags alone." 2>&1
4786 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4789 echo "Nope, it doesn't, but that's ok." 2>&1
4796 case "$mips_type" in
4797 *BSD*|'') inclwanted="$locincpth $usrinc";;
4798 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4800 for thisincl in $inclwanted; do
4801 if $test -d $thisincl; then
4802 if $test x$thisincl != x$usrinc; then
4804 *" -I$thisincl "*);;
4805 *) dflt="$dflt -I$thisincl ";;
4811 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4813 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4821 *) dflt="$dflt -D$2";;
4825 set signal.h LANGUAGE_C; eval $inctest
4829 ccflags="$ccflags -DSOCKS"
4834 default|recommended) dflt="$ccflags $dflt" ;;
4835 *) dflt="$ccflags";;
4844 Your C compiler may want other flags. For this question you should include
4845 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4846 but you should NOT include libraries or ld flags like -lwhatever. If you
4847 want $package to honor its debug switch, you should include -DDEBUGGING here.
4848 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4850 To use no flags, specify the word "none".
4856 rp="Any additional cc flags?"
4863 : the following weeds options from ccflags that are of no interest to cpp
4865 '') cppflags="$ccflags" ;;
4866 *) cppflags="$cppflags $ccflags" ;;
4868 case "$gccversion" in
4869 1*) cppflags="$cppflags -D__GNUC__"
4871 case "$mips_type" in
4873 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4879 echo "Let me guess what the preprocessor flags are..." >&4
4893 *) ftry="$previous $flag";;
4895 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4896 >cpp1.out 2>/dev/null && \
4897 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4898 >cpp2.out 2>/dev/null && \
4899 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4900 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4902 cppflags="$cppflags $ftry"
4912 *-*) echo "They appear to be: $cppflags";;
4914 $rm -f cpp.c cpp?.out
4918 : flags used in final linking phase
4920 '') if ./venix; then
4926 *-posix*) dflt="$dflt -posix" ;;
4929 *) dflt="$ldflags";;
4932 : Try to guess additional flags to pick up local libraries.
4933 for thislibdir in $libpth; do
4934 case " $loclibpth " in
4937 *"-L$thislibdir "*) ;;
4938 *) dflt="$dflt -L$thislibdir" ;;
4950 Your C linker may need flags. For this question you should
4951 include -L/whatever and any other flags used by the C linker, but you
4952 should NOT include libraries like -lwhatever.
4954 Make sure you include the appropriate -L/path flags if your C linker
4955 does not normally search all of the directories you specified above,
4958 To use no flags, specify the word "none".
4962 rp="Any additional ld flags (NOT including libraries)?"
4968 rmlist="$rmlist pdp11"
4972 echo "Checking your choice of C compiler and flags for coherency..." >&4
4973 $cat > try.c <<'EOF'
4975 int main() { printf("Ok\n"); return(0); }
4977 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4979 $cat >try.msg <<'EOM'
4980 I've tried to compile and run the following simple program:
4983 $cat try.c >> try.msg
4985 $cat >> try.msg <<EOM
4992 and I got the following output:
4996 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4997 if $sh -c "$run ./try" >>try.msg 2>&1; then
5001 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5004 cat >> try.msg <<'EOQS'
5005 If $libs contains -lsfio, and sfio is mis-configured, then it
5006 sometimes (apparently) runs and exits with a 0 status, but with no
5007 output! It may have to do with sfio's use of _exit vs. exit.
5010 rp="You have a big problem. Shall I abort Configure"
5017 echo "The program compiled OK, but exited with status $?." >>try.msg
5018 rp="You have a problem. Shall I abort Configure"
5022 echo "I can't compile the test program." >>try.msg
5023 rp="You have a BIG problem. Shall I abort Configure"
5029 case "$knowitall" in
5031 echo "(The supplied flags or libraries might be incorrect.)"
5039 *) echo "Ok. Stopping Configure." >&4
5044 n) echo "OK, that should do.";;
5046 $rm -f try try.* core
5048 : define a shorthand compile call
5052 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5053 : define a shorthand compile call for compilations that should be ok.
5057 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5059 : determine filename position in cpp output
5061 echo "Computing filename position in cpp output for #include directives..." >&4
5063 vos) testaccess=-e ;;
5066 echo '#include <stdio.h>' > foo.c
5069 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5070 $grep '^[ ]*#.*stdio\.h' | \
5071 while read cline; do
5074 while $test \$# -gt 0; do
5075 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5080 pos=\`expr \$pos + 1\`
5092 *) pos="${fieldn}th";;
5094 echo "Your cpp writes the filename in the $pos field of the line."
5097 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5098 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5101 : locate header file
5106 for usrincdir in $usrinc
5108 if test -f \$usrincdir/\$wanted; then
5109 echo "\$usrincdir/\$wanted"
5113 awkprg='{ print \$$fieldn }'
5114 echo "#include <\$wanted>" > foo\$\$.c
5115 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5116 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5117 while read cline; do
5118 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5120 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5121 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5126 # status = 0: grep returned 0 lines, case statement not executed
5127 # status = 1: headerfile found
5128 # status = 2: while loop executed, no headerfile found
5132 if test \$status -eq 1; then
5139 : define an alternate in-header-list? function
5140 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5141 cont=true; xxf="echo \"<\$1> found.\" >&4";
5142 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5143 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5145 case $# in 4) instead=instead;; *) instead="at last";; esac;
5146 while $test "$cont"; do
5148 var=$2; eval "was=\$$2";
5149 if $test "$xxx" && $test -r "$xxx";
5151 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5154 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5155 set $yyy; shift; shift; yyy=$@;
5156 case $# in 0) cont="";;
5157 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5158 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5159 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5160 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5164 do set $yyy; var=$2; eval "was=\$$2";
5165 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5166 set $yyy; shift; shift; yyy=$@;
5169 : see if stdlib is available
5170 set stdlib.h i_stdlib
5173 : check for lengths of integral types
5177 echo "Checking to see how big your integers are..." >&4
5186 printf("intsize=%d;\n", (int)sizeof(int));
5187 printf("longsize=%d;\n", (int)sizeof(long));
5188 printf("shortsize=%d;\n", (int)sizeof(short));
5193 if eval $compile_ok && $run ./try > /dev/null; then
5195 echo "Your integers are $intsize bytes long."
5196 echo "Your long integers are $longsize bytes long."
5197 echo "Your short integers are $shortsize bytes long."
5201 Help! I can't compile and run the intsize test program: please enlighten me!
5202 (This is probably a misconfiguration in your system or libraries, and
5203 you really ought to fix it. Still, I'll try anyway.)
5207 rp="What is the size of an integer (in bytes)?"
5211 rp="What is the size of a long integer (in bytes)?"
5215 rp="What is the size of a short integer (in bytes)?"
5223 : check for long long
5225 echo "Checking to see if you have long long..." >&4
5226 echo 'int main() { long long x = 7; return 0; }' > try.c
5228 if eval $compile; then
5230 echo "You have long long."
5233 echo "You do not have long long."
5239 : check for length of long long
5240 case "${d_longlong}${longlongsize}" in
5243 echo "Checking to see how big your long longs are..." >&4
5244 $cat >try.c <<'EOCP'
5248 printf("%d\n", (int)sizeof(long long));
5253 if eval $compile_ok; then
5254 longlongsize=`$run ./try`
5255 echo "Your long longs are $longlongsize bytes long."
5259 echo "(I can't seem to compile the test program. Guessing...)"
5260 rp="What is the size of a long long (in bytes)?"
5264 if $test "X$longsize" = "X$longlongsize"; then
5265 echo "(That isn't any different from an ordinary long.)"
5271 : see if inttypes.h is available
5272 : we want a real compile instead of Inhdr because some systems
5273 : have an inttypes.h which includes non-existent headers
5276 #include <inttypes.h>
5278 static int32_t foo32 = 0x12345678;
5282 if eval $compile; then
5283 echo "<inttypes.h> found." >&4
5286 echo "<inttypes.h> NOT found." >&4
5295 echo "Checking to see if you have int64_t..." >&4
5297 #include <sys/types.h>
5298 #$i_inttypes I_INTTYPES
5300 #include <inttypes.h>
5302 int main() { int64_t x = 7; }
5305 if eval $compile; then
5307 echo "You have int64_t."
5310 echo "You do not have int64_t."
5318 echo "Checking which 64-bit integer type we could use..." >&4
5324 val='"unsigned int"'
5329 *) case "$longsize" in
5333 val='"unsigned long"'
5338 *) case "$d_longlong:$longlongsize" in
5343 val='"unsigned long long"'
5348 *) case "$d_int64_t" in
5367 '') echo "Alas, no 64-bit integer types in sight." >&4
5370 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5376 case "$uselonglong" in
5377 "$define"|true|[yY]*)
5380 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5382 use64bitint="$define"
5385 case "$use64bits" in
5386 "$define"|true|[yY]*)
5389 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5391 use64bitint="$define"
5394 case "$use64bitints" in
5395 "$define"|true|[yY]*)
5398 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5400 use64bitint="$define"
5403 case "$use64bitsint" in
5404 "$define"|true|[yY]*)
5407 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5409 use64bitint="$define"
5412 case "$uselonglongs" in
5413 "$define"|true|[yY]*)
5416 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5418 use64bitint="$define"
5421 case "$use64bitsall" in
5422 "$define"|true|[yY]*)
5425 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5427 use64bitall="$define"
5432 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5434 case "$use64bitall" in
5435 "$define"|true|[yY]*) use64bitint="$define" ;;
5441 You have natively 64-bit long integers.
5445 *) case "$use64bitint" in
5446 "$define"|true|[yY]*) dflt='y';;
5455 Perl can be built to take advantage of 64-bit integer types
5456 on some systems. To do so, Configure can be run with -Duse64bitint.
5457 Choosing this option will most probably introduce binary incompatibilities.
5459 If this doesn't make any sense to you, just accept the default '$dflt'.
5460 (The default has been chosen based on your configuration.)
5462 rp='Try to use 64-bit integers, if available?'
5465 [yY]*) val="$define" ;;
5473 case "$use64bitall" in
5474 "$define"|true|[yY]*) dflt='y' ;;
5475 *) case "$longsize" in
5483 You may also choose to try maximal 64-bitness. It means using as much
5484 64-bitness as possible on the platform. This in turn means even more
5485 binary incompatibilities. On the other hand, your platform may not
5486 have any more 64-bitness available than what you already have chosen.
5488 If this doesn't make any sense to you, just accept the default '$dflt'.
5489 (The default has been chosen based on your configuration.)
5491 rp='Try to use maximal 64-bit support, if available?'
5494 [yY]*) val="$define" ;;
5499 case "$use64bitall" in
5501 case "$use64bitint" in
5505 Since you have chosen a maximally 64-bit build, I'm also turning on
5506 the use of 64-bit integers.
5508 use64bitint="$define" ;;
5513 : Look for a hint-file generated 'call-back-unit'. If the
5514 : user has specified that a 64-bit perl is to be built,
5515 : we may need to set or change some other defaults.
5516 if $test -f use64bitint.cbu; then
5517 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5520 case "$use64bitint" in
5521 "$define"|true|[yY]*)
5523 4) case "$archname64" in
5524 '') archname64=64int ;;
5531 : Look for a hint-file generated 'call-back-unit'. If the
5532 : user has specified that a maximally 64-bit perl is to be built,
5533 : we may need to set or change some other defaults.
5534 if $test -f use64bitall.cbu; then
5535 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5538 case "$use64bitall" in
5539 "$define"|true|[yY]*)
5541 4) case "$archname64" in
5542 ''|64int) archname64=64all ;;
5549 case "$d_quad:$use64bitint" in
5553 *** You have chosen to use 64-bit integers,
5554 *** but none can be found.
5555 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5556 *** Cannot continue, aborting.
5563 : check for length of double
5565 case "$doublesize" in
5567 echo "Checking to see how big your double precision numbers are..." >&4
5576 printf("%d\n", (int)sizeof(double));
5581 if eval $compile_ok; then
5582 doublesize=`$run ./try`
5583 echo "Your double is $doublesize bytes long."
5586 echo "(I can't seem to compile the test program. Guessing...)"
5587 rp="What is the size of a double precision number (in bytes)?"
5595 : check for long doubles
5597 echo "Checking to see if you have long double..." >&4
5598 echo 'int main() { long double x = 7.0; }' > try.c
5600 if eval $compile; then
5602 echo "You have long double."
5605 echo "You do not have long double."
5611 : check for length of long double
5612 case "${d_longdbl}${longdblsize}" in
5615 echo "Checking to see how big your long doubles are..." >&4
5616 $cat >try.c <<'EOCP'
5620 printf("%d\n", sizeof(long double));
5625 if eval $compile; then
5626 longdblsize=`$run ./try`
5627 echo "Your long doubles are $longdblsize bytes long."
5631 echo "(I can't seem to compile the test program. Guessing...)" >&4
5632 rp="What is the size of a long double (in bytes)?"
5636 if $test "X$doublesize" = "X$longdblsize"; then
5637 echo "That isn't any different from an ordinary double."
5638 echo "I'll keep your setting anyway, but you may see some"
5639 echo "harmless compilation warnings."
5645 : determine the architecture name
5647 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5648 tarch=`arch`"-$osname"
5649 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5650 if uname -m > tmparch 2>&1 ; then
5651 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5652 -e 's/$/'"-$osname/" tmparch`
5660 case "$myarchname" in
5663 echo "(Your architecture name used to be $myarchname.)"
5667 case "$targetarch" in
5669 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5674 *) dflt="$archname";;
5676 rp='What is your architecture name'
5679 case "$usethreads" in
5681 echo "Threads selected." >&4
5683 *-thread*) echo "...and architecture name already has -thread." >&4
5685 *) archname="$archname-thread"
5686 echo "...setting architecture name to $archname." >&4
5691 case "$usemultiplicity" in
5693 echo "Multiplicity selected." >&4
5695 *-multi*) echo "...and architecture name already has -multi." >&4
5697 *) archname="$archname-multi"
5698 echo "...setting architecture name to $archname." >&4
5703 case "$use64bitint$use64bitall" in
5705 case "$archname64" in
5707 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5710 case "$use64bitint" in
5711 "$define") echo "64 bit integers selected." >&4 ;;
5713 case "$use64bitall" in
5714 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5717 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5719 *) archname="$archname-$archname64"
5720 echo "...setting architecture name to $archname." >&4
5726 case "$uselongdouble" in
5728 echo "Long doubles selected." >&4
5729 case "$longdblsize" in
5731 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5735 *-ld*) echo "...and architecture name already has -ld." >&4
5737 *) archname="$archname-ld"
5738 echo "...setting architecture name to $archname." >&4
5745 case "$useperlio" in
5747 echo "Perlio selected." >&4
5750 echo "Perlio not selected, using stdio." >&4
5752 *-stdio*) echo "...and architecture name already has -stdio." >&4
5754 *) archname="$archname-stdio"
5755 echo "...setting architecture name to $archname." >&4
5760 if $test -f archname.cbu; then
5761 echo "Your platform has some specific hints for architecture name, using them..."
5765 : determine root of directory hierarchy where package will be installed.
5768 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5771 dflt=`echo "$prefix" | sed 's/.$//'`
5779 By default, $package will be installed in $dflt/bin, manual pages
5780 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5781 installation directories. Typically this is something like /usr/local.
5782 If you wish to have binaries under /usr/bin but other parts of the
5783 installation under /usr/local, that's ok: you will be prompted
5784 separately for each of the installation directories, the prefix being
5785 only used to set the defaults.
5789 rp='Installation prefix to use?'
5797 *) oldprefix="$prefix";;
5806 *) afsroot=$afsroot ;;
5812 $define|true) afs=true ;;
5813 $undef|false) afs=false ;;
5814 *) if test -d $afsroot; then
5822 echo "AFS may be running... I'll be extra cautious then..." >&4
5824 echo "AFS does not seem to be running..." >&4
5827 : determine installation prefix for where package is to be installed.
5831 Since you are running AFS, I need to distinguish the directory in which
5832 files will reside from the directory in which they are installed (and from
5833 which they are presumably copied to the former directory by occult means).
5836 case "$installprefix" in
5837 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5838 *) dflt="$installprefix";;
5843 In some special cases, particularly when building $package for distribution,
5844 it is convenient to distinguish the directory in which files should be
5845 installed from the directory ($prefix) in which they will
5846 eventually reside. For most users, these two directories are the same.
5849 case "$installprefix" in
5851 *) dflt=$installprefix;;
5855 rp='What installation prefix should I use for installing files?'
5857 installprefix="$ans"
5858 installprefixexp="$ansexp"
5860 : set the prefixit variable, to compute a suitable default value
5861 prefixit='case "$3" in
5863 case "$oldprefix" in
5864 "") eval "$1=\"\$$2\"";;
5871 ""|" ") eval "$1=\"\$$2\"";;
5877 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5879 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5880 /*-$oldprefix/*|\~*-$oldprefix/*)
5881 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5882 *) eval "$1=\"\$$2\"";;
5886 : get the patchlevel
5888 echo "Getting the current patchlevel..." >&4
5889 if $test -r $rsrc/patchlevel.h;then
5890 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5891 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5892 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5893 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5894 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5895 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5896 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5905 $echo "(You do not have patchlevel.h. Eek.)"
5907 if $test -r $rsrc/.patch ; then
5908 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5909 perl_patchlevel=`cat $rsrc/.patch`
5912 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5913 version_patchlevel_string="version $patchlevel subversion $subversion"
5914 case "$perl_patchlevel" in
5916 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5919 $echo "(You have $package $version_patchlevel_string.)"
5923 : XXX Should be a Configure test for double-dots in filenames.
5924 version=`echo $revision $patchlevel $subversion | \
5925 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5926 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5927 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5930 version=`echo $revision $patchlevel $subversion | \
5931 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5932 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5933 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5936 : Special case the 5.005_xx maintenance series, which used 5.005
5937 : without any subversion label as a subdirectory in $sitelib
5938 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5939 api_versionstring='5.005'
5942 : determine installation style
5943 : For now, try to deduce it from prefix unless it is already set.
5944 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5945 case "$installstyle" in
5946 '') case "$prefix" in
5947 *perl*) dflt='lib';;
5948 *) dflt='lib/perl5' ;;
5951 *) dflt="$installstyle" ;;
5953 : Probably not worth prompting for this since we prompt for all
5954 : the directories individually, and the prompt would be too long and
5958 : determine where private library files go
5959 : Usual default is /usr/local/lib/perl5/$version.
5960 : Also allow things like /opt/perl/lib/$version, since
5961 : /opt/perl/lib/perl5... would be redundant.
5962 : The default "style" setting is made in installstyle.U
5963 case "$installstyle" in
5964 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5965 *) set dflt privlib lib/$version ;;
5970 There are some auxiliary files for $package that need to be put into a
5971 private library directory that is accessible by everyone.
5975 rp='Pathname where the private library files will reside?'
5978 privlibexp="$ansexp"
5979 : Change installation prefix, if necessary.
5980 if $test X"$prefix" != X"$installprefix"; then
5981 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5983 installprivlib="$privlibexp"
5986 : set the prefixup variable, to restore leading tilda escape
5987 prefixup='case "$prefixexp" in
5989 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5992 : determine where public architecture dependent libraries go
5995 : privlib default is /usr/local/lib/$package/$version
5996 : archlib default is /usr/local/lib/$package/$version/$archname
5997 : privlib may have an optional trailing /share.
5998 tdflt=`echo $privlib | $sed 's,/share$,,'`
5999 tdflt=$tdflt/$archname
6008 $spackage contains architecture-dependent library files. If you are
6009 sharing libraries in a heterogeneous environment, you might store
6010 these files in a separate location. Otherwise, you can just include
6011 them with the rest of the public library files.
6015 rp='Where do you want to put the public architecture-dependent libraries?'
6018 archlibexp="$ansexp"
6019 if $test X"$archlib" = X"$privlib"; then
6024 : Change installation prefix, if necessary.
6025 if $test X"$prefix" != X"$installprefix"; then
6026 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6028 installarchlib="$archlibexp"
6031 : see if setuid scripts can be secure
6034 Some kernels have a bug that prevents setuid #! scripts from being
6035 secure. Some sites have disabled setuid #! scripts because of this.
6037 First let's decide if your kernel supports secure setuid #! scripts.
6038 (If setuid #! scripts would be secure but have been disabled anyway,
6039 don't say that they are secure if asked.)
6044 if $test -d /dev/fd; then
6045 echo "#!$ls" >reflect
6046 chmod +x,u+s reflect
6047 ./reflect >flect 2>&1
6048 if $contains "/dev/fd" flect >/dev/null; then
6049 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6053 If you are not sure if they are secure, I can check but I'll need a
6054 username and password different from the one you are using right now.
6055 If you don't have such a username or don't want me to test, simply
6059 rp='Other username to test security of setuid scripts with?'
6064 case "$d_suidsafe" in
6065 '') echo "I'll assume setuid scripts are *not* secure." >&4
6068 echo "Well, the $hint value is *not* secure." >&4
6070 *) echo "Well, the $hint value *is* secure." >&4
6075 $rm -f reflect flect
6076 echo "#!$ls" >reflect
6077 chmod +x,u+s reflect
6080 echo '"su" will (probably) prompt you for '"$ans's password."
6081 su $ans -c './reflect >flect'
6082 if $contains "/dev/fd" flect >/dev/null; then
6083 echo "Okay, it looks like setuid scripts are secure." >&4
6086 echo "I don't think setuid scripts are secure." >&4
6091 rp='Does your kernel have *secure* setuid scripts?'
6094 [yY]*) val="$define";;
6099 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6100 echo "(That's for file descriptors, not floppy disks.)"
6106 $rm -f reflect flect
6108 : now see if they want to do setuid emulation
6111 case "$d_suidsafe" in
6114 echo "No need to emulate SUID scripts since they are secure here." >&4
6118 Some systems have disabled setuid scripts, especially systems where
6119 setuid scripts cannot be secure. On systems where setuid scripts have
6120 been disabled, the setuid/setgid bits on scripts are currently
6121 useless. It is possible for $package to detect those bits and emulate
6122 setuid/setgid in a secure fashion. This emulation will only work if
6123 setuid scripts have been disabled in your kernel.
6127 "$define") dflt=y ;;
6130 rp="Do you want to do setuid/setgid emulation?"
6133 [yY]*) val="$define";;
6141 : see if this is a malloc.h system
6142 : we want a real compile instead of Inhdr because some systems have a
6143 : malloc.h that just gives a compile error saying to use stdlib.h instead
6148 int main () { return 0; }
6151 if eval $compile; then
6152 echo "<malloc.h> found." >&4
6155 echo "<malloc.h> NOT found." >&4
6162 : check for void type
6164 echo "Checking to see how well your C compiler groks the void type..." >&4
6165 case "$voidflags" in
6177 extern void moo(); /* function returning void */
6178 void (*goo)(); /* ptr to func returning void */
6180 void *hue; /* generic ptr */
6193 int main() { sub(); }
6195 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6196 voidflags=$defvoidused
6197 echo "Good. It appears to support void to the level $package wants.">&4
6198 if $contains warning .out >/dev/null 2>&1; then
6199 echo "However, you might get some warnings that look like this:"
6203 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6204 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6205 echo "It supports 1..."
6206 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6207 echo "It also supports 2..."
6208 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6210 echo "And it supports 4 but not 8 definitely."
6212 echo "It doesn't support 4..."
6213 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6215 echo "But it supports 8."
6218 echo "Neither does it support 8."
6222 echo "It does not support 2..."
6223 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6225 echo "But it supports 4 and 8."
6227 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6229 echo "And it supports 4 but has not heard about 8."
6231 echo "However it supports 8 but not 4."
6236 echo "There is no support at all for void."
6241 case "$voidflags" in
6244 Support flag bits are:
6245 1: basic void declarations.
6246 2: arrays of pointers to functions returning void.
6247 4: operations between pointers to and addresses of void functions.
6248 8: generic void pointers.
6251 rp="Your void support flags add up to what?"
6258 : check for length of pointer
6262 echo "Checking to see how big your pointers are..." >&4
6263 if test "$voidflags" -gt 7; then
6264 echo '#define VOID_PTR char *' > try.c
6266 echo '#define VOID_PTR void *' > try.c
6276 printf("%d\n", (int)sizeof(VOID_PTR));
6281 if eval $compile_ok; then
6282 ptrsize=`$run ./try`
6283 echo "Your pointers are $ptrsize bytes long."
6286 echo "(I can't seem to compile the test program. Guessing...)" >&4
6287 rp="What is the size of a pointer (in bytes)?"
6294 case "$use64bitall" in
6295 "$define"|true|[yY]*)
6299 *** You have chosen a maximally 64-bit build,
6300 *** but your pointers are only 4 bytes wide.
6301 *** Please rerun Configure without -Duse64bitall.
6306 *** Since you have quads, you could possibly try with -Duse64bitint.
6311 *** Cannot continue, aborting.
6322 : determine whether to use malloc wrapping
6324 case "$usemallocwrap" in
6325 [yY]*|true|$define) dflt='y' ;;
6326 [nN]*|false|$undef) dflt='n' ;;
6327 *) case "$usedevel" in
6328 [yY]*|true|$define) dflt='y' ;;
6333 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6335 usemallocwrap="$ans"
6338 usemallocwrap="$define" ;;
6340 usemallocwrap="$undef" ;;
6343 : determine which malloc to compile in
6345 case "$usemymalloc" in
6346 [yY]*|true|$define) dflt='y' ;;
6347 [nN]*|false|$undef) dflt='n' ;;
6348 *) case "$ptrsize" in
6354 rp="Do you wish to attempt to use the malloc that comes with $package?"
6360 mallocsrc='malloc.c'
6361 mallocobj="malloc$_o"
6362 d_mymalloc="$define"
6365 : Remove malloc from list of libraries to use
6366 echo "Removing unneeded -lmalloc from library list" >&4
6367 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6370 echo "libs = $libs" >&4
6382 : compute the return types of malloc and free
6384 $cat >malloc.c <<END
6388 #include <sys/types.h>
6402 case "$malloctype" in
6404 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6411 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6415 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6422 echo "Your system uses $freetype free(), it would seem." >&4
6426 After $package is installed, you may wish to install various
6427 add-on modules and utilities. Typically, these add-ons will
6428 be installed under $prefix with the rest
6429 of this package. However, you may wish to install such add-ons
6430 elsewhere under a different prefix.
6432 If you do not wish to put everything under a single prefix, that's
6433 ok. You will be prompted for the individual locations; this siteprefix
6434 is only used to suggest the defaults.
6436 The default should be fine for most people.
6440 rp='Installation prefix to use for add-on modules and utilities?'
6441 : XXX Here might be another good place for an installstyle setting.
6442 case "$siteprefix" in
6444 *) dflt=$siteprefix ;;
6447 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6449 case "$siteprefix" in
6453 *) oldsiteprefix="$prefix";;
6458 siteprefixexp="$ansexp"
6460 : determine where site specific libraries go.
6461 : Usual default is /usr/local/lib/perl5/site_perl/$version
6462 : The default "style" setting is made in installstyle.U
6463 : XXX No longer works with Prefixit stuff.
6464 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6466 '') case "$installstyle" in
6467 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6468 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6476 The installation process will create a directory for
6477 site-specific extensions and modules. Most users find it convenient
6478 to place all site-specific files in this directory rather than in the
6479 main distribution directory.
6483 rp='Pathname for the site-specific library files?'
6486 sitelibexp="$ansexp"
6487 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6488 : Change installation prefix, if necessary.
6489 if $test X"$prefix" != X"$installprefix"; then
6490 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6492 installsitelib="$sitelibexp"
6495 : determine where site specific architecture-dependent libraries go.
6496 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6497 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6498 : sitelib may have an optional trailing /share.
6500 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6501 dflt="$dflt/$archname"
6506 set sitearch sitearch none
6510 The installation process will also create a directory for
6511 architecture-dependent site-specific extensions and modules.
6515 rp='Pathname for the site-specific architecture-dependent library files?'
6518 sitearchexp="$ansexp"
6519 : Change installation prefix, if necessary.
6520 if $test X"$prefix" != X"$installprefix"; then
6521 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6523 installsitearch="$sitearchexp"
6528 The installation process will also create a directory for
6529 vendor-supplied add-ons. Vendors who supply perl with their system
6530 may find it convenient to place all vendor-supplied files in this
6531 directory rather than in the main distribution directory. This will
6532 ease upgrades between binary-compatible maintenance versions of perl.
6534 Of course you may also use these directories in whatever way you see
6535 fit. For example, you might use them to access modules shared over a
6536 company-wide network.
6538 The default answer should be fine for most people.
6539 This causes further questions about vendor add-ons to be skipped
6540 and no vendor-specific directories will be configured for perl.
6543 rp='Do you want to configure vendor-specific add-on directories?'
6544 case "$usevendorprefix" in
6545 define|true|[yY]*) dflt=y ;;
6546 *) : User may have set vendorprefix directly on Configure command line.
6547 case "$vendorprefix" in
6556 rp='Installation prefix to use for vendor-supplied add-ons?'
6557 case "$vendorprefix" in
6559 *) dflt=$vendorprefix ;;
6562 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6564 case "$vendorprefix" in
6568 *) oldvendorprefix="$prefix";;
6572 usevendorprefix="$define"
6574 vendorprefixexp="$ansexp"
6576 *) usevendorprefix="$undef"
6582 case "$vendorprefix" in
6583 '') d_vendorlib="$undef"
6587 *) d_vendorlib="$define"
6588 : determine where vendor-supplied modules go.
6589 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6590 case "$vendorlib" in
6592 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6593 case "$installstyle" in
6594 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6595 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6598 *) dflt="$vendorlib"
6602 rp='Pathname for the vendor-supplied library files?'
6605 vendorlibexp="$ansexp"
6608 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6609 : Change installation prefix, if necessary.
6610 if $test X"$prefix" != X"$installprefix"; then
6611 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6613 installvendorlib="$vendorlibexp"
6616 case "$vendorprefix" in
6617 '') d_vendorarch="$undef"
6621 *) d_vendorarch="$define"
6622 : determine where vendor-supplied architecture-dependent libraries go.
6623 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6624 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6625 : vendorlib may have an optional trailing /share.
6626 case "$vendorarch" in
6627 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6628 dflt="$dflt/$archname"
6630 *) dflt="$vendorarch" ;;
6633 rp='Pathname for vendor-supplied architecture-dependent files?'
6636 vendorarchexp="$ansexp"
6639 : Change installation prefix, if necessary.
6640 if $test X"$prefix" != X"$installprefix"; then
6641 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6643 installvendorarch="$vendorarchexp"
6646 : Final catch-all directories to search
6649 Lastly, you can have perl look in other directories for extensions and
6650 modules in addition to those already specified.
6651 These directories will be searched after
6655 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6656 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6658 case "$otherlibdirs" in
6659 ''|' ') dflt='none' ;;
6660 *) dflt="$otherlibdirs" ;;
6663 Enter a colon-separated set of extra paths to include in perl's @INC
6664 search path, or enter 'none' for no extra paths.
6668 rp='Colon-separated list of additional directories for perl to search?'
6671 ' '|''|none) otherlibdirs=' ' ;;
6672 *) otherlibdirs="$ans" ;;
6674 case "$otherlibdirs" in
6678 set d_perl_otherlibdirs
6681 : Cruising for prototypes
6683 echo "Checking out function prototypes..." >&4
6684 $cat >prototype.c <<EOCP
6689 int main(int argc, char *argv[]) {
6692 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6693 echo "Your C compiler appears to support function prototypes."
6696 echo "Your C compiler doesn't seem to understand function prototypes."
6703 case "$prototype" in
6705 *) ansi2knr='ansi2knr'
6710 This version of $package can only be compiled by a compiler that
6711 understands function prototypes. Unfortunately, your C compiler
6713 doesn't seem to understand them. Sorry about that.
6715 If GNU cc is available for your system, perhaps you could try that instead.
6717 Eventually, we hope to support building Perl with pre-ANSI compilers.
6718 If you would like to help in that effort, please contact <perlbug@perl.org>.
6720 Aborting Configure now.
6726 : determine where public executables go
6731 rp='Pathname where the public executables will reside?'
6733 if $test "X$ansexp" != "X$binexp"; then
6738 : Change installation prefix, if necessary.
6739 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6740 if $test X"$prefix" != X"$installprefix"; then
6741 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6743 installbin="$binexp"
6752 Perl can be built with extra modules or bundles of modules which
6753 will be fetched from the CPAN and installed alongside Perl.
6755 Notice that you will need access to the CPAN; either via the Internet,
6756 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6757 be asked later to configure the CPAN.pm module which will in turn do
6758 the installation of the rest of the extra modules or bundles.)
6760 Notice also that if the modules require any external software such as
6761 libraries and headers (the libz library and the zlib.h header for the
6762 Compress::Zlib module, for example) you MUST have any such software
6763 already installed, this configuration process will NOT install such
6766 If this doesn't make any sense to you, just accept the default '$dflt'.
6768 rp='Install any extra modules (y or n)?'
6774 Please list any extra modules or bundles to be installed from CPAN,
6775 with spaces between the names. The names can be in any format the
6776 'install' command of CPAN.pm will understand. (Answer 'none',
6777 without the quotes, to install no extra modules or bundles.)
6787 $rm -f ../extras.lst
6789 *) echo "(Saving the list of extras for later...)"
6790 echo "$extras" > ../extras.lst
6798 : determine where html pages for programs go
6799 set html1dir html1dir none
6803 If you wish to install html files for programs in $spackage, indicate
6804 the appropriate directory here. To skip installing html files,
6808 ''|none|$undef|' ') dflt=none ;;
6809 *) dflt=$html1dir ;;
6812 rp="Directory for the main $spackage html pages?"
6815 html1direxp="$ansexp"
6816 : Use ' ' for none so value is preserved next time through Configure
6817 $test X"$html1dir" = "X" && html1dir=' '
6818 : Change installation prefix, if necessary.
6819 if $test X"$prefix" != X"$installprefix"; then
6820 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6822 installhtml1dir="$html1direxp"
6825 : determine where html pages for libraries and modules go
6826 set html3dir html3dir none
6830 If you wish to install html files for modules associated with $spackage,
6831 indicate the appropriate directory here. To skip installing html files,
6834 : There is no obvious default. If they have specified html1dir, then
6835 : try to key off that, possibly changing .../html1 into .../html3.
6837 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6838 *) dflt=$html3dir ;;
6841 rp="Directory for the $spackage module html pages?"
6844 html3direxp="$ansexp"
6845 : Use ' ' for none so value is preserved next time through Configure
6846 $test X"$html3dir" = "X" && html3dir=' '
6847 : Change installation prefix, if necessary.
6848 if $test X"$prefix" != X"$installprefix"; then
6849 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6851 installhtml3dir="$html3direxp"
6854 : Find perl5.005 or later.
6855 echo "Looking for a previously installed perl5.005 or later... "
6857 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6858 : Check if this perl is recent and can load a simple module
6859 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6862 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6872 '') echo "None found. That's ok.";;
6873 *) echo "Using $perl5." ;;
6876 : Determine list of previous versions to include in @INC
6877 $cat > getverlist <<EOPL
6880 \$api_versionstring = "$api_versionstring";
6881 \$version = "$version";
6882 \$stem = "$sitelib_stem";
6883 \$archname = "$archname";
6885 $cat >> getverlist <<'EOPL'
6886 # Can't have leading @ because metaconfig interprets it as a command!
6887 ;@inc_version_list=();
6888 # XXX Redo to do opendir/readdir?
6891 ;@candidates = glob("5.*");
6897 # XXX ToDo: These comparisons must be reworked when two-digit
6898 # subversions come along, so that 5.7.10 compares as greater than
6899 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6900 # widespread that we can use the built-in version vectors rather
6901 # than reinventing them here. For 5.6.0, however, we must
6902 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6903 foreach $d (@candidates) {
6904 if ($d lt $version) {
6905 if ($d ge $api_versionstring) {
6906 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6908 elsif ($d ge "5.005") {
6909 unshift(@inc_version_list, grep { -d } $d);
6913 # Skip newer version. I.e. don't look in
6914 # 5.7.0 if we're installing 5.6.1.
6918 if (@inc_version_list) {
6919 print join(' ', @inc_version_list);
6922 # Blank space to preserve value for next Configure run.
6927 case "$inc_version_list" in
6928 '') if test -x "$perl5$exe_ext"; then
6929 dflt=`$perl5 getverlist`
6934 $undef) dflt='none' ;;
6935 *) eval dflt=\"$inc_version_list\" ;;
6938 ''|' ') dflt=none ;;
6945 In order to ease the process of upgrading, this version of perl
6946 can be configured to use modules built and installed with earlier
6947 versions of perl that were installed under $prefix. Specify here
6948 the list of earlier versions that this version of perl should check.
6949 If Configure detected no earlier versions of perl installed under
6950 $prefix, then the list will be empty. Answer 'none' to tell perl
6951 to not search earlier versions.
6953 The default should almost always be sensible, so if you're not sure,
6954 just accept the default.
6957 rp='List of earlier versions to include in @INC?'
6960 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6961 *) inc_version_list="$ans" ;;
6963 case "$inc_version_list" in
6965 inc_version_list_init='0';;
6966 *) inc_version_list_init=`echo $inc_version_list |
6967 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6972 : determine whether to install perl also as /usr/bin/perl
6975 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6977 Many scripts expect perl to be installed as /usr/bin/perl.
6979 If you want to, I can install the perl you are about to compile
6980 as /usr/bin/perl (in addition to $bin/perl).
6982 if test -f /usr/bin/perl; then
6985 However, please note that because you already have a /usr/bin/perl,
6986 overwriting that with a new Perl would very probably cause problems.
6987 Therefore I'm assuming you don't want to do that (unless you insist).
6990 case "$installusrbinperl" in
6991 "$define"|[yY]*) dflt='y';;
6997 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7000 case "$installusrbinperl" in
7001 "$undef"|[nN]*) dflt='n';;
7005 rp="Do you want to install perl as /usr/bin/perl?"
7008 [yY]*) val="$define";;
7014 set installusrbinperl
7018 echo "Checking for GNU C Library..." >&4
7020 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7021 alone are insufficient to distinguish different versions, such as
7022 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7023 libc version 2.1.0. A. Dougherty, June 3, 2002.
7029 # ifdef __GLIBC_MINOR__
7030 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7031 # include <gnu/libc-version.h>
7032 printf("%s\n", gnu_get_libc_version());
7034 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7037 printf("%d\n", __GLIBC__);
7046 if eval $compile_ok && $run ./try > glibc.ver; then
7048 gnulibc_version=`$cat glibc.ver`
7049 echo "You are using the GNU C Library version $gnulibc_version"
7053 echo "You are not using the GNU C Library"
7055 $rm -f try try.* glibc.ver
7059 : see if nm is to be used to determine whether a symbol is defined or not
7063 case "$d_gnulibc" in
7066 echo "nm probably won't work on the GNU C Library." >&4
7072 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7074 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7075 echo "'nm' won't be sufficient on this sytem." >&4
7081 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7082 if $test $dflt -gt 20; then
7092 true|$define) dflt=y;;
7099 I can use $nm to extract the symbols from your C libraries. This
7100 is a time consuming task which may generate huge output on the disk (up
7101 to 3 megabytes) but that should make the symbols extraction faster. The
7102 alternative is to skip the 'nm' extraction part and to compile a small
7103 test program instead to determine whether each symbol is present. If
7104 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7105 this may be the best solution.
7107 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7110 rp="Shall I use $nm to extract C symbols from the libraries?"
7113 [Nn]*) usenm=false;;
7122 : nm options which may be necessary
7124 '') if $test -f /mach_boot; then
7126 elif $test -d /usr/ccs/lib; then
7127 nm_opt='-p' # Solaris (and SunOS?)
7128 elif $test -f /dgux; then
7130 elif $test -f /lib64/rld; then
7131 nm_opt='-p' # 64-bit Irix
7137 : nm options which may be necessary for shared libraries but illegal
7138 : for archive libraries. Thank you, Linux.
7139 case "$nm_so_opt" in
7140 '') case "$myuname" in
7142 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7143 nm_so_opt='--dynamic'
7152 : get list of predefined functions in a handy place
7157 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7163 *) for thislib in $libs; do
7166 : Handle C library specially below.
7169 thislib=`echo $thislib | $sed -e 's/^-l//'`
7170 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7172 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7174 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7176 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7178 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7180 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7182 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7187 libnames="$libnames $try"
7189 *) libnames="$libnames $thislib" ;;
7198 for xxx in $libpth; do
7199 $test -r $1 || set $xxx/libc.$so
7200 : The messy sed command sorts on library version numbers.
7202 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7203 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7205 s/[0-9][0-9]*/0000&/g
7206 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7209 $sort | $sed -e 's/^.* //'`
7212 $test -r $1 || set /usr/ccs/lib/libc.$so
7213 $test -r $1 || set /lib/libsys_s$_a
7219 if $test -r "$1"; then
7220 echo "Your (shared) C library seems to be in $1."
7222 elif $test -r /lib/libc && $test -r /lib/clib; then
7223 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7225 libc='/lib/clib /lib/libc'
7226 if $test -r /lib/syslib; then
7227 echo "(Your math library is in /lib/syslib.)"
7228 libc="$libc /lib/syslib"
7230 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7231 echo "Your C library seems to be in $libc, as you said before."
7232 elif $test -r $incpath/usr/lib/libc$_a; then
7233 libc=$incpath/usr/lib/libc$_a;
7234 echo "Your C library seems to be in $libc. That's fine."
7235 elif $test -r /lib/libc$_a; then
7237 echo "Your C library seems to be in $libc. You're normal."
7239 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7241 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7242 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7243 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7245 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7247 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7250 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7252 if $test -r "$tans"; then
7253 echo "Your C library seems to be in $tans, of all places."
7259 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7263 If the guess above is wrong (which it might be if you're using a strange
7264 compiler, or your machine supports multiple models), you can override it here.
7269 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7271 I can't seem to find your C library. I've looked in the following places:
7274 $sed 's/^/ /' libpath
7277 None of these seems to contain your C library. I need to get its name...
7282 rp='Where is your C library?'
7287 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7288 set X `cat libnames`
7291 case $# in 1) xxx=file; esac
7292 echo "Extracting names from the following $xxx for later perusal:" >&4
7294 $sed 's/^/ /' libnames >&4
7296 $echo $n "This may take a while...$c" >&4
7300 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7301 *) $nm $nm_opt $file 2>/dev/null;;
7306 $grep fprintf libc.tmp > libc.ptf
7307 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7308 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7310 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7312 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7314 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7316 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7318 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7320 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7322 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7324 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7326 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7328 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7330 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7332 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7334 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7335 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7337 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7339 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7341 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7343 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7345 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7347 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7349 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7351 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7353 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7355 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7357 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7359 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7361 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7363 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7365 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7368 $nm -p $* 2>/dev/null >libc.tmp
7369 $grep fprintf libc.tmp > libc.ptf
7370 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7371 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7377 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7379 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7380 for thisname in $libnames $libc; do
7381 $ar t $thisname >>libc.tmp
7383 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7385 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7386 # Repeat libc to extract forwarders to DLL entries too
7387 for thisname in $libnames $libc; do
7388 $ar tv $thisname >>libc.tmp
7389 # Revision 50 of EMX has bug in $ar.
7390 # it will not extract forwarders to DLL entries
7391 # Use emximp which will extract exactly them.
7392 emximp -o tmp.imp $thisname \
7394 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7395 < tmp.imp >>libc.tmp
7398 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7401 echo "$ar didn't seem to work right." >&4
7402 echo "Maybe this is a Cray...trying bld instead..." >&4
7403 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7405 for thisname in $libnames; do
7407 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7408 $ar t $thisname >>libc.tmp
7412 echo "That didn't work either. Giving up." >&4
7422 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7423 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7425 *) if $test -f /lib/syscalls.exp; then
7427 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7428 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7434 $rm -f libnames libpath
7436 : see if dld is available
7440 : is a C symbol defined?
7443 -v) tf=libc.tmp; tdc="";;
7444 -a) tf=libc.tmp; tdc="[]";;
7445 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7448 case "$reuseval-$4" in
7450 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7455 if $test "$runnm" = true; then
7456 if $contains $tlook $tf >/dev/null 2>&1; then
7458 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7459 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7460 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7461 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7462 $rm -f try$_exe try.c core core.* try.core;
7465 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7466 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7467 $rm -f try$_exe try.c;
7472 $define) tval=true;;
7479 : define an is-in-libc? function
7480 inlibc='echo " "; td=$define; tu=$undef;
7481 sym=$1; var=$2; eval "was=\$$2";
7483 case "$reuseval$was" in
7493 echo "$sym() found." >&4;
7494 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7496 echo "$sym() NOT found." >&4;
7497 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7501 $define) echo "$sym() found." >&4;;
7502 *) echo "$sym() NOT found." >&4;;
7506 : see if dlopen exists
7513 : determine which dynamic loading, if any, to compile in
7515 dldir="ext/DynaLoader"
7528 $define) dflt='y' ;;
7531 $define) dflt='y' ;;
7533 : Does a dl_xxx.xs file exist for this operating system
7534 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7537 rp="Do you wish to use dynamic loading?"
7544 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7545 dflt="$dldir/dl_${osname}.xs"
7546 elif $test "$d_dlopen" = "$define" ; then
7547 dflt="$dldir/dl_dlopen.xs"
7548 elif $test "$i_dld" = "$define" ; then
7549 dflt="$dldir/dl_dld.xs"
7554 *) dflt="$dldir/$dlsrc"
7557 echo "The following dynamic loading files are available:"
7558 : Can not go over to $dldir because getfile has path hard-coded in.
7559 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7560 rp="Source file to use for dynamic loading"
7566 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7570 Some systems may require passing special flags to $cc -c to
7571 compile modules that will be used to create a shared library.
7572 To use no flags, say "none".
7575 case "$cccdlflags" in
7576 '') case "$gccversion" in
7577 '') case "$osname" in
7579 next) dflt='none' ;;
7580 irix*) dflt='-KPIC' ;;
7581 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7582 sunos) dflt='-pic' ;;
7586 *) case "$osname" in
7587 darwin) dflt='none' ;;
7588 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7593 *) dflt="$cccdlflags" ;;
7595 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7598 none) cccdlflags=' ' ;;
7599 *) cccdlflags="$ans" ;;
7604 Some systems use ld to create libraries that can be dynamically loaded,
7605 while other systems (such as those using ELF) use $cc.
7609 '') $cat >try.c <<EOM
7610 /* Test for whether ELF binaries are produced */
7618 int i = open("a.out",O_RDONLY);
7621 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7622 exit(0); /* succeed (yes, it's ELF) */
7627 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7629 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7633 echo "I'll use ld to build dynamic libraries."
7642 rp="What command should be used to create dynamic libraries?"
7648 Some systems may require passing special flags to $ld to create a
7649 library that can be dynamically loaded. If your ld flags include
7650 -L/other/path options to locate libraries outside your loader's normal
7651 search path, you may need to specify those -L options here as well. To
7652 use no flags, say "none".
7655 case "$lddlflags" in
7656 '') case "$osname" in
7657 beos) dflt='-nostart' ;;
7659 case "$gccversion" in
7660 '') dflt="$dflt +vnocompatwarnings" ;;
7663 linux|irix*|gnu*) dflt='-shared' ;;
7664 next) dflt='none' ;;
7665 solaris) dflt='-G' ;;
7666 sunos) dflt='-assert nodefinitions' ;;
7667 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7671 *) dflt="$lddlflags" ;;
7674 : Try to guess additional flags to pick up local libraries.
7675 : Be careful not to append to a plain 'none'
7679 for thisflag in $ldflags; do
7684 *) dflt="$dflt $thisflag" ;;
7691 ''|' ') dflt='none' ;;
7694 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7697 none) lddlflags=' ' ;;
7698 *) lddlflags="$ans" ;;
7703 Some systems may require passing special flags to $cc to indicate that
7704 the resulting executable will use dynamic linking. To use no flags,
7708 case "$ccdlflags" in
7709 '') case "$osname" in
7710 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7711 next|sunos) dflt='none' ;;
7715 *) dflt="$ccdlflags" ;;
7717 rp="Any special flags to pass to $cc to use dynamic linking?"
7720 none) ccdlflags=' ' ;;
7721 *) ccdlflags="$ans" ;;
7735 # No dynamic loading being used, so don't bother even to prompt.
7738 *) case "$useshrplib" in
7739 '') case "$osname" in
7740 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7742 also='Building a shared libperl is required for dynamic loading to work on your system.'
7747 also='Building a shared libperl is needed for MAB support.'
7765 The perl executable is normally obtained by linking perlmain.c with
7766 libperl${_a}, any static extensions (usually just DynaLoader), and
7767 any other libraries needed on this system (such as -lm, etc.). Since
7768 your system supports dynamic loading, it is probably possible to build
7769 a shared libperl.$so. If you will have more than one executable linked
7770 to libperl.$so, this will significantly reduce the size of each
7771 executable, but it may have a noticeable effect on performance. The
7772 default is probably sensible for your system.
7776 rp="Build a shared libperl.$so (y/n)"
7780 useshrplib='true' ;;
7781 *) useshrplib='false' ;;
7786 case "$useshrplib" in
7790 # Figure out a good name for libperl.so. Since it gets stored in
7791 # a version-specific architecture-dependent library, the version
7792 # number isn't really that important, except for making cc/ld happy.
7794 # A name such as libperl.so.3.1
7795 majmin="libperl.$so.$patchlevel.$subversion"
7796 # A name such as libperl.so.301
7797 majonly=`echo $patchlevel $subversion |
7798 $awk '{printf "%d%02d", $1, $2}'`
7799 majonly=libperl.$so.$majonly
7800 # I'd prefer to keep the os-specific stuff here to a minimum, and
7801 # rely on figuring it out from the naming of libc.
7802 case "${osname}${osvers}" in
7805 # XXX How handle the --version stuff for MAB?
7807 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7810 cygwin*) # ld links against an importlib
7811 dflt=libperl$lib_ext
7813 *) # Try to guess based on whether libc has major.minor.
7815 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7816 *libc.$so.[0-9]*) dflt=$majonly ;;
7817 *) dflt=libperl.$so ;;
7827 I need to select a good name for the shared libperl. If your system uses
7828 library names with major and minor numbers, then you might want something
7829 like $majmin. Alternatively, if your system uses a single version
7830 number for shared libraries, then you might want to use $majonly.
7831 Or, your system might be quite happy with a simple libperl.$so.
7833 Since the shared libperl will get installed into a version-specific
7834 architecture-dependent directory, the version number of the shared perl
7835 library probably isn't important, so the default should be o.k.
7838 rp='What name do you want to give to the shared libperl?'
7841 echo "Ok, I'll use $libperl"
7844 libperl="libperl${_a}"
7848 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7852 WARNING: Use of the shrpdir variable for the installation location of
7853 the shared $libperl is not supported. It was never documented and
7854 will not work in this version. Let me (perlbug@perl.org)
7855 know of any problems this may cause.
7861 But your current setting of $shrpdir is
7862 the default anyway, so it's harmless.
7867 Further, your current attempted setting of $shrpdir
7868 conflicts with the value of $archlibexp/CORE
7869 that installperl will use.
7876 # How will the perl executable find the installed shared $libperl?
7877 # Add $xxx to ccdlflags.
7878 # If we can't figure out a command-line option, use $shrpenv to
7879 # set env LD_RUN_PATH. The main perl makefile uses this.
7880 shrpdir=$archlibexp/CORE
7883 if "$useshrplib"; then
7886 # We'll set it in Makefile.SH...
7891 freebsd|netbsd|openbsd|interix)
7892 xxx="-Wl,-R$shrpdir"
7894 bsdos|linux|irix*|dec_osf|gnu*)
7895 xxx="-Wl,-rpath,$shrpdir"
7898 # next doesn't like the default...
7901 # beos doesn't like the default, either.
7904 # hpux doesn't like the default, either.
7905 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7908 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7914 # Only add $xxx if it isn't already in ccdlflags.
7915 case " $ccdlflags " in
7917 *) ccdlflags="$ccdlflags $xxx"
7920 Adding $xxx to the flags
7921 passed to $ld so that the perl executable will find the
7922 installed shared $libperl.
7930 # Fix ccdlflags in AIX for building external extensions.
7931 # (For building Perl itself bare -bE:perl.exp is needed,
7932 # Makefile.SH takes care of this.)
7934 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7936 # Respect a hint or command-line value.
7938 '') shrpenv="$tmp_shrpenv" ;;
7940 case "$ldlibpthname" in
7941 '') ldlibpthname=LD_LIBRARY_PATH ;;
7942 none) ldlibpthname='' ;;
7945 : determine where manual pages are on this system
7949 syspath='/usr/share/man/man1 /usr/man/man1'
7950 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7951 syspath="$syspath /usr/man/u_man/man1"
7952 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7953 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7954 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7955 sysman=`./loc . /usr/man/man1 $syspath`
7958 if $test -d "$sysman"; then
7959 echo "System manual is in $sysman." >&4
7961 echo "Could not find manual pages in source form." >&4
7964 : determine where manual pages go
7965 set man1dir man1dir none
7969 $spackage has manual pages available in source form.
7973 echo "However, you don't have nroff, so they're probably useless to you."
7975 '') man1dir="none";;
7978 echo "If you don't want the manual sources installed, answer 'none'."
7983 lookpath="$prefixexp/share/man/man1"
7984 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7985 lookpath="$lookpath $prefixexp/man/p_man/man1"
7986 lookpath="$lookpath $prefixexp/man/u_man/man1"
7987 lookpath="$lookpath $prefixexp/man/man.1"
7989 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7990 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8000 rp="Where do the main $spackage manual pages (source) go?"
8002 if $test "X$man1direxp" != "X$ansexp"; then
8006 man1direxp="$ansexp"
8012 : Change installation prefix, if necessary.
8013 if $test X"$prefix" != X"$installprefix"; then
8014 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8016 installman1dir="$man1direxp"
8019 : What suffix to use on installed man pages
8026 rp="What suffix should be used for the main $spackage man pages?"
8028 '') case "$man1dir" in
8042 *) dflt="$man1ext";;
8049 : see if we can have long filenames
8051 first=123456789abcdef
8053 if (echo hi >$first) 2>/dev/null; then
8054 if $test -f 123456789abcde; then
8055 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8058 echo 'You can have filenames longer than 14 characters.'>&4
8063 You can't have filenames longer than 14 chars.
8064 You can't even think about them!
8070 $rm -rf 123456789abcde*
8072 : determine where library module manual pages go
8073 set man3dir man3dir none
8077 $spackage has manual pages for many of the library modules.
8083 However, you don't have nroff, so they're probably useless to you.
8086 '') man3dir="none";;
8090 case "$d_flexfnam" in
8093 However, your system can't handle the long file names like File::Basename.3.
8096 '') man3dir="none";;
8100 echo "If you don't want the manual sources installed, answer 'none'."
8101 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8103 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8104 if $test -d "$privlib/man/man3"; then
8107 WARNING: Previous versions of perl installed man3 pages into
8108 $privlib/man/man3. This version will suggest a
8109 new default of $dflt.
8113 rp='Do you wish to preserve the old behavior?(y/n)'
8116 y*) dflt="$privlib/man/man3" ;;
8121 *) dflt="$man3dir" ;;
8128 rp="Where do the $package library man pages (source) go?"
8131 man3direxp="$ansexp"
8137 : Change installation prefix, if necessary.
8138 if $test X"$prefix" != X"$installprefix"; then
8139 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8141 installman3dir="$man3direxp"
8144 : What suffix to use on installed man pages
8150 rp="What suffix should be used for the $package library man pages?"
8152 '') case "$man3dir" in
8166 *) dflt="$man3ext";;
8173 : see if we have to deal with yellow pages, now NIS.
8174 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8175 if $test -f /usr/etc/nibindd; then
8177 echo "I'm fairly confident you're on a NeXT."
8179 rp='Do you get the hosts file via NetInfo?'
8188 y*) hostcat='nidump hosts .';;
8189 *) case "$hostcat" in
8190 nidump*) hostcat='';;
8200 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8208 rp='Are you getting the hosts file via yellow pages?'
8211 y*) hostcat='ypcat hosts';;
8212 *) hostcat='cat /etc/hosts';;
8218 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8221 '') test -f /etc/group && groupcat='cat /etc/group';;
8224 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8227 : now get the host name
8229 echo "Figuring out host name..." >&4
8230 case "$myhostname" in
8232 echo 'Maybe "hostname" will work...'
8233 if tans=`sh -c hostname 2>&1` ; then
8241 if $test "$cont"; then
8243 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8244 if tans=`cat /etc/systemid 2>&1` ; then
8246 phostname='cat /etc/systemid'
8247 echo "Whadyaknow. Xenix always was a bit strange..."
8250 elif $test -r /etc/systemid; then
8251 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8254 if $test "$cont"; then
8255 echo 'No, maybe "uuname -l" will work...'
8256 if tans=`sh -c 'uuname -l' 2>&1` ; then
8258 phostname='uuname -l'
8260 echo 'Strange. Maybe "uname -n" will work...'
8261 if tans=`sh -c 'uname -n' 2>&1` ; then
8263 phostname='uname -n'
8265 echo 'Oh well, maybe I can mine it out of whoami.h...'
8266 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8267 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8268 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8270 case "$myhostname" in
8271 '') echo "Does this machine have an identity crisis or something?"
8274 echo "Well, you said $myhostname before..."
8275 phostname='echo $myhostname';;
8281 case "$myhostname" in
8282 '') myhostname=noname ;;
8284 : you do not want to know about this
8289 if $test "$myhostname" ; then
8291 rp='Your host name appears to be "'$myhostname'".'" Right?"
8299 : bad guess or no guess
8300 while $test "X$myhostname" = X ; do
8302 rp="Please type the (one word) name of your host:"
8307 : translate upper to lower if necessary
8308 case "$myhostname" in
8310 echo "(Normalizing case in your host name)"
8311 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8315 case "$myhostname" in
8317 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8318 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8319 echo "(Trimming domain name from host name--host name is now $myhostname)"
8321 *) case "$mydomain" in
8324 test "X$hostcat" = "Xypcat hosts" &&
8325 ypmatch "$myhostname" hosts 2>/dev/null |\
8326 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8329 test "X$hostcat" != "X" &&
8330 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8331 /[ ]$myhostname[ . ]/p" > hosts
8334 if $test -f hosts; then
8335 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8336 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8337 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8338 hosts | $sort | $uniq | \
8339 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8340 case `$echo X$dflt` in
8341 X*\ *) echo "(Several hosts in the database matched hostname)"
8344 X.) echo "(You do not have fully-qualified names in the hosts database)"
8348 echo "(I cannot locate a hosts database anywhere)"
8353 tans=`./loc resolv.conf X /etc /usr/etc`
8354 if $test -f "$tans"; then
8355 echo "(Attempting domain name extraction from $tans)"
8356 dflt=.`$sed -n -e 's/ / /g' \
8357 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8358 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8360 .) dflt=.`$sed -n -e 's/ / /g' \
8361 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8362 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8369 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8370 dflt=.`sh -c domainname 2>/dev/null`
8373 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8377 case "$dflt$osname" in
8378 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8379 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8383 .) echo "(Lost all hope -- silly guess then)"
8389 *) dflt="$mydomain";;
8393 rp="What is your domain name?"
8403 : translate upper to lower if necessary
8406 echo "(Normalizing case in your domain name)"
8407 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8411 : a little sanity check here
8412 case "$phostname" in
8415 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8416 $myhostname$mydomain|$myhostname) ;;
8418 case "$phostname" in
8420 echo "(That doesn't agree with your whoami.h file, by the way.)"
8423 echo "(That doesn't agree with your $phostname command, by the way.)"
8433 I need to get your e-mail address in Internet format if possible, i.e.
8434 something like user@host.domain. Please answer accurately since I have
8435 no easy means to double check it. The default value provided below
8436 is most probably close to reality but may not be valid from outside
8437 your organization...
8441 while test "$cont"; do
8443 '') dflt="$cf_by@$myhostname$mydomain";;
8444 *) dflt="$cf_email";;
8446 rp='What is your e-mail address?'
8452 rp='Address does not look like an Internet one. Use it anyway?'
8468 If you or somebody else will be maintaining perl at your site, please
8469 fill in the correct e-mail address here so that they may be contacted
8470 if necessary. Currently, the "perlbug" program included with perl
8471 will send mail to this address in addition to perlbug@perl.org. You may
8472 enter "none" for no administrator.
8475 case "$perladmin" in
8476 '') dflt="$cf_email";;
8477 *) dflt="$perladmin";;
8479 rp='Perl administrator e-mail address'
8483 : determine whether to only install version-specific parts.
8486 Do you want to install only the version-specific parts of the perl
8487 distribution? Usually you do *not* want to do this.
8489 case "$versiononly" in
8490 "$define"|[Yy]*|true) dflt='y' ;;
8493 rp="Do you want to install only the version-specific parts of perl?"
8496 [yY]*) val="$define";;
8502 case "$versiononly" in
8503 "$define") inc_version_list=''
8504 inc_version_list_init=0
8508 : figure out how to guarantee perl startup
8509 case "$startperl" in
8511 case "$sharpbang" in
8515 I can use the #! construct to start perl on your system. This will
8516 make startup of perl scripts faster, but may cause problems if you
8517 want to share those scripts and perl is not in a standard place
8518 ($binexp/perl) on all your platforms. The alternative is to force
8519 a shell by starting the script with a single ':' character.
8522 case "$versiononly" in
8523 "$define") dflt="$binexp/perl$version";;
8524 *) dflt="$binexp/perl";;
8526 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8529 none) startperl=": # use perl";;
8530 *) startperl="#!$ans"
8531 if $test 30 -lt `echo "$ans" | wc -c`; then
8534 WARNING: Some systems limit the #! command to 32 characters.
8535 If you experience difficulty running Perl scripts with #!, try
8536 installing Perl in a directory with a shorter pathname.
8542 *) startperl=": # use perl"
8547 echo "I'll use $startperl to start perl scripts."
8549 : figure best path for perl in scripts
8552 case "$versiononly" in
8553 "$define") perlpath="$binexp/perl$version";;
8554 *) perlpath="$binexp/perl";;
8556 case "$startperl" in
8561 I will use the "eval 'exec'" idiom to start Perl on your system.
8562 I can use the full path of your Perl binary for this purpose, but
8563 doing so may cause problems if you want to share those scripts and
8564 Perl is not always in a standard place ($binexp/perl).
8568 rp="What path shall I use in \"eval 'exec'\"?"
8575 case "$startperl" in
8577 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8580 : determine where public executable scripts go
8581 set scriptdir scriptdir
8583 case "$scriptdir" in
8586 : guess some guesses
8587 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8588 $test -d /usr/share/bin && dflt=/usr/share/bin
8589 $test -d /usr/local/script && dflt=/usr/local/script
8590 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8591 $test -d $prefixexp/script && dflt=$prefixexp/script
8595 *) dflt="$scriptdir"
8600 Some installations have a separate directory just for executable scripts so
8601 that they can mount it across multiple architectures but keep the scripts in
8602 one spot. You might, for example, have a subdirectory of /usr/share for this.
8603 Or you might just lump your scripts in with all your other executables.
8607 rp='Where do you keep publicly executable scripts?'
8609 if $test "X$ansexp" != "X$scriptdirexp"; then
8613 scriptdirexp="$ansexp"
8614 : Change installation prefix, if necessary.
8615 if $test X"$prefix" != X"$installprefix"; then
8616 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8618 installscript="$scriptdirexp"
8621 : determine where add-on public executables go
8623 '') dflt=$siteprefix/bin ;;
8627 rp='Pathname where the add-on public executables should be installed?'
8630 sitebinexp="$ansexp"
8631 : Change installation prefix, if necessary.
8632 if $test X"$prefix" != X"$installprefix"; then
8633 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8635 installsitebin="$sitebinexp"
8638 : determine where add-on html pages go
8639 : There is no standard location, so try to copy the previously-selected
8640 : directory structure for the core html pages.
8641 case "$sitehtml1dir" in
8642 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8643 *) dflt=$sitehtml1dir ;;
8646 ''|' ') dflt=none ;;
8649 rp='Pathname where the site-specific html pages should be installed?'
8652 sitehtml1direxp="$ansexp"
8653 : Change installation prefix, if necessary.
8654 if $test X"$prefix" != X"$installprefix"; then
8655 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8657 installsitehtml1dir="$sitehtml1direxp"
8660 : determine where add-on library html pages go
8661 : There is no standard location, so try to copy the previously-selected
8662 : directory structure for the core html pages.
8663 case "$sitehtml3dir" in
8664 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8665 *) dflt=$sitehtml3dir ;;
8668 ''|' ') dflt=none ;;
8671 rp='Pathname where the site-specific library html pages should be installed?'
8674 sitehtml3direxp="$ansexp"
8675 : Change installation prefix, if necessary.
8676 if $test X"$prefix" != X"$installprefix"; then
8677 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8679 installsitehtml3dir="$sitehtml3direxp"
8682 : determine where add-on manual pages go
8683 case "$siteman1dir" in
8684 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8685 *) dflt=$siteman1dir ;;
8688 ''|' ') dflt=none ;;
8691 rp='Pathname where the site-specific manual pages should be installed?'
8694 siteman1direxp="$ansexp"
8695 : Change installation prefix, if necessary.
8696 if $test X"$prefix" != X"$installprefix"; then
8697 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8699 installsiteman1dir="$siteman1direxp"
8702 : determine where add-on library man pages go
8703 case "$siteman3dir" in
8704 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8705 *) dflt=$siteman3dir ;;
8708 ''|' ') dflt=none ;;
8711 rp='Pathname where the site-specific library manual pages should be installed?'
8714 siteman3direxp="$ansexp"
8715 : Change installation prefix, if necessary.
8716 if $test X"$prefix" != X"$installprefix"; then
8717 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8719 installsiteman3dir="$siteman3direxp"
8722 : determine where add-on public executable scripts go
8723 case "$sitescript" in
8724 '') dflt=$siteprefix/script
8725 $test -d $dflt || dflt=$sitebin ;;
8726 *) dflt="$sitescript" ;;
8729 rp='Pathname where add-on public executable scripts should be installed?'
8732 sitescriptexp="$ansexp"
8733 : Change installation prefix, if necessary.
8734 if $test X"$prefix" != X"$installprefix"; then
8735 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8737 installsitescript="$sitescriptexp"
8740 case "$usefaststdio" in
8741 $define|true|[yY]*|'')
8742 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8752 Perl can be built to use 'fast stdio', which means using the stdio
8753 library but also directly manipulating the stdio buffers to enable
8754 faster I/O. Using stdio is better for backward compatibility (especially
8755 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8756 interface has been preferred instead of stdio.
8758 If this doesn't make any sense to you, just accept the default '$dflt'.
8760 rp='Use the "fast stdio" if available?'
8763 y|Y) val="$define" ;;
8770 : define an is-a-typedef? function
8771 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8773 "") inclist="sys/types.h";;
8775 eval "varval=\$$var";
8779 for inc in $inclist; do
8780 echo "#include <$inc>" >>temp.c;
8782 echo "#ifdef $type" >> temp.c;
8783 echo "printf(\"We have $type\");" >> temp.c;
8784 echo "#endif" >> temp.c;
8785 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8786 if $contains $type temp.E >/dev/null 2>&1; then
8792 *) eval "$var=\$varval";;
8795 : define an is-a-typedef? function that prompts if the type is not available.
8796 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8798 "") inclist="sys/types.h";;
8800 eval "varval=\$$var";
8804 for inc in $inclist; do
8805 echo "#include <$inc>" >>temp.c;
8807 echo "#ifdef $type" >> temp.c;
8808 echo "printf(\"We have $type\");" >> temp.c;
8809 echo "#endif" >> temp.c;
8810 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8812 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8813 if $contains $type temp.E >/dev/null 2>&1; then
8814 echo "$type found." >&4;
8817 echo "$type NOT found." >&4;
8823 *) eval "$var=\$varval";;
8826 : see what type lseek is declared as in the kernel
8827 rp="What is the type used for lseek's offset on this system?"
8828 set off_t lseektype long stdio.h sys/types.h
8832 echo "Checking to see how big your file offsets are..." >&4
8834 #include <sys/types.h>
8838 printf("%d\n", (int)sizeof($lseektype));
8843 if eval $compile_ok; then
8844 lseeksize=`$run ./try`
8845 echo "Your file offsets are $lseeksize bytes long."
8849 echo "(I can't seem to compile the test program. Guessing...)"
8850 rp="What is the size of your file offsets (in bytes)?"
8856 : see what type file positions are declared as in the library
8857 rp="What is the type for file position used by fsetpos()?"
8858 set fpos_t fpostype long stdio.h sys/types.h
8863 *_t) zzz="$fpostype" ;;
8866 echo "Checking the size of $zzz..." >&4
8868 #include <sys/types.h>
8875 printf("%d\n", (int)sizeof($fpostype));
8880 if eval $compile_ok; then
8884 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8887 echo "Your $zzz is $fpossize bytes long."
8893 echo "(I can't compile the test program. Guessing...)" >&4
8894 rp="What is the size of your file positions (in bytes)?"
8899 # Backward compatibility (uselfs is deprecated).
8901 "$define"|true|[yY]*)
8904 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8906 uselargefiles="$define"
8910 case "$lseeksize:$fpossize" in
8913 You can have files larger than 2 gigabytes.
8916 *) case "$uselargefiles" in
8917 "$undef"|false|[nN]*) dflt='n' ;;
8922 Perl can be built to understand large files (files larger than 2 gigabytes)
8923 on some systems. To do so, Configure can be run with -Duselargefiles.
8925 If this doesn't make any sense to you, just accept the default '$dflt'.
8927 rp='Try to understand large files, if available?'
8930 y|Y) val="$define" ;;
8937 : Look for a hint-file generated 'call-back-unit'. If the
8938 : user has specified that a large files perl is to be built,
8939 : we may need to set or change some other defaults.
8940 if $test -f uselargefiles.cbu; then
8941 echo "Your platform has some specific hints regarding large file builds, using them..."
8942 . ./uselargefiles.cbu
8944 case "$uselargefiles" in
8946 if $test -f uselargefiles.cbu; then
8948 echo "Rechecking to see how big your file offsets are..." >&4
8950 #include <sys/types.h>
8954 printf("%d\n", (int)sizeof($lseektype));
8959 if eval $compile_ok; then
8960 lseeksize=`$run ./try`
8961 $echo "Your file offsets are now $lseeksize bytes long."
8965 echo "(I can't seem to compile the test program. Guessing...)"
8966 rp="What is the size of your file offsets (in bytes)?"
8971 *_t) zzz="$fpostype" ;;
8974 $echo $n "Rechecking the size of $zzz...$c" >&4
8976 #include <sys/types.h>
8983 printf("%d\n", (int)sizeof($fpostype));
8988 if eval $compile_ok; then
8993 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8996 echo " $fpossize bytes." >&4
9002 echo "(I can't compile the test program. Guessing...)" >&4
9003 rp="What is the size of your file positions (in bytes)?"
9012 # probably will refer to
9013 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9015 userelocatableinc=undef
9017 case "$vendorprefix" in
9018 '') d_vendorbin="$undef"
9022 *) d_vendorbin="$define"
9023 : determine where vendor-supplied executables go.
9024 case "$vendorbin" in
9025 '') dflt=$vendorprefix/bin ;;
9026 *) dflt="$vendorbin" ;;
9029 rp='Pathname for the vendor-supplied executables directory?'
9032 vendorbinexp="$ansexp"
9035 : Change installation prefix, if necessary.
9036 if $test X"$prefix" != X"$installprefix"; then
9037 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9039 installvendorbin="$vendorbinexp"
9042 case "$vendorprefix" in
9043 '') vendorhtml1dir=''
9044 vendorhtml1direxp=''
9046 *) : determine where vendor-supplied html pages go.
9047 : There is no standard location, so try to copy the previously-selected
9048 : directory structure for the core html pages.
9049 : XXX Better default suggestions would be welcome.
9050 case "$vendorhtml1dir" in
9051 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9052 *) dflt=$vendorhtml1dir ;;
9055 ''|' ') dflt=none ;;
9058 rp='Pathname for the vendor-supplied html pages?'
9060 vendorhtml1dir="$ans"
9061 vendorhtml1direxp="$ansexp"
9064 : Use ' ' for none so value is preserved next time through Configure
9065 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9066 : Change installation prefix, if necessary.
9067 if $test X"$prefix" != X"$installprefix"; then
9068 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9070 installvendorhtml1dir="$vendorhtml1direxp"
9073 case "$vendorprefix" in
9074 '') vendorhtml3dir=''
9075 vendorhtml3direxp=''
9077 *) : determine where vendor-supplied module html pages go.
9078 : There is no standard location, so try to copy the previously-selected
9079 : directory structure for the core html pages.
9080 : XXX Better default suggestions would be welcome.
9081 case "$vendorhtml3dir" in
9082 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9083 *) dflt=$vendorhtml3dir ;;
9086 ''|' ') dflt=none ;;
9089 rp='Pathname for the vendor-supplied html pages?'
9091 vendorhtml3dir="$ans"
9092 vendorhtml3direxp="$ansexp"
9095 : Use ' ' for none so value is preserved next time through Configure
9096 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9097 : Change installation prefix, if necessary.
9098 if $test X"$prefix" != X"$installprefix"; then
9099 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9101 installvendorhtml3dir="$vendorhtml3direxp"
9104 case "$vendorprefix" in
9105 '') vendorman1dir=''
9108 *) : determine where vendor-supplied manual pages go.
9109 case "$vendorman1dir" in
9110 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9111 *) dflt=$vendorman1dir ;;
9114 ''|' ') dflt=none ;;
9117 rp='Pathname for the vendor-supplied manual section 1 pages?'
9119 vendorman1dir="$ans"
9120 vendorman1direxp="$ansexp"
9123 : Use ' ' for none so value is preserved next time through Configure
9124 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9125 : Change installation prefix, if necessary.
9126 if $test X"$prefix" != X"$installprefix"; then
9127 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9129 installvendorman1dir="$vendorman1direxp"
9132 case "$vendorprefix" in
9133 '') vendorman3dir=''
9136 *) : determine where vendor-supplied module manual pages go.
9137 case "$vendorman3dir" in
9138 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9139 *) dflt=$vendorman3dir ;;
9142 ''|' ') dflt=none ;;
9145 rp='Pathname for the vendor-supplied manual section 3 pages?'
9147 vendorman3dir="$ans"
9148 vendorman3direxp="$ansexp"
9151 : Use ' ' for none so value is preserved next time through Configure
9152 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9153 : Change installation prefix, if necessary.
9154 if $test X"$prefix" != X"$installprefix"; then
9155 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9157 installvendorman3dir="$vendorman3direxp"
9160 case "$vendorprefix" in
9161 '') d_vendorscript="$undef"
9165 *) d_vendorscript="$define"
9166 : determine where vendor-supplied scripts go.
9167 case "$vendorscript" in
9168 '') dflt=$vendorprefix/script
9169 $test -d $dflt || dflt=$vendorbin ;;
9170 *) dflt="$vendorscript" ;;
9174 The installation process will create a directory for
9175 vendor-supplied scripts.
9179 rp='Pathname for the vendor-supplied scripts directory?'
9182 vendorscriptexp="$ansexp"
9185 : Change installation prefix, if necessary.
9186 if $test X"$prefix" != X"$installprefix"; then
9187 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9189 installvendorscript="$vendorscriptexp"
9192 : see if qgcvt exists
9198 if $test X"$d_longdbl" = X"$define"; then
9200 echo "Checking how to print long doubles..." >&4
9202 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9203 $cat >try.c <<'EOCP'
9204 #include <sys/types.h>
9208 printf("%.3f\n", d);
9212 if eval $compile; then
9216 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9217 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9218 echo "We will use %f."
9224 if $test X"$sPRIfldbl" = X; then
9225 $cat >try.c <<'EOCP'
9226 #include <sys/types.h>
9229 long double d = 123.456;
9230 printf("%.3Lf\n", d);
9234 if eval $compile; then
9238 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9239 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9240 echo "We will use %Lf."
9246 if $test X"$sPRIfldbl" = X; then
9247 $cat >try.c <<'EOCP'
9248 #include <sys/types.h>
9251 long double d = 123.456;
9252 printf("%.3llf\n", d);
9256 if eval $compile; then
9260 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9261 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9262 echo "We will use %llf."
9268 if $test X"$sPRIfldbl" = X; then
9269 $cat >try.c <<'EOCP'
9270 #include <sys/types.h>
9273 long double d = 123.456;
9274 printf("%.3lf\n", d);
9278 if eval $compile; then
9282 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9283 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9284 echo "We will use %lf."
9290 if $test X"$sPRIfldbl" = X; then
9291 echo "Cannot figure out how to print long doubles." >&4
9293 sSCNfldbl=$sPRIfldbl # expect consistency
9300 case "$sPRIfldbl" in
9301 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9302 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9303 d_SCNfldbl="$undef";
9305 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9306 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9307 d_SCNfldbl="$define";
9311 : Check how to convert floats to strings.
9313 if test "X$d_Gconvert" = X; then
9316 echo "Checking for an efficient way to convert floats to strings."
9318 case "$uselongdouble" in
9319 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9321 case "$d_longdbl" in
9322 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9324 case "$d_PRIgldbl" in
9325 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9329 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9330 char *myname = "gconvert";
9333 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9334 char *myname = "gcvt";
9337 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9338 char *myname = "qgcvt";
9339 #define DOUBLETYPE long double
9342 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9344 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9346 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9349 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9351 char *myname = "sprintf";
9355 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9356 #define DOUBLETYPE long double
9358 #define DOUBLETYPE double
9364 #define I_STDLIB $i_stdlib
9370 checkit(expect, got)
9374 if (strcmp(expect, got)) {
9375 printf("%s oddity: Expected %s, got %s\n",
9376 myname, expect, got);
9386 /* This must be 1st test on (which?) platform */
9387 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9388 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9389 checkit("0.1", buf);
9391 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9392 checkit("0.01", buf);
9394 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9395 checkit("0.001", buf);
9397 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9398 checkit("0.0001", buf);
9400 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9401 if (strlen(buf) > 5)
9402 checkit("9e-005", buf); /* for Microsoft ?? */
9404 checkit("9e-05", buf);
9406 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9409 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9410 checkit("1.1", buf);
9412 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9413 checkit("1.01", buf);
9415 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9416 checkit("1.001", buf);
9418 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9419 checkit("1.0001", buf);
9421 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9422 checkit("1.00001", buf);
9424 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9425 checkit("1.000001", buf);
9427 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9430 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9433 /* Some Linux gcvt's give 1.e+5 here. */
9434 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9435 checkit("100000", buf);
9437 /* Some Linux gcvt's give -1.e+5 here. */
9438 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9439 checkit("-100000", buf);
9441 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9442 checkit("123.456", buf);
9444 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9445 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9446 /* 34 should be enough to scare even long double
9447 * places into using the e notation. */
9448 if (strlen(buf) > 5)
9449 checkit("1e+034", buf); /* for Microsoft */
9451 checkit("1e+34", buf);
9453 /* For Perl, if you add additional tests here, also add them to
9454 * t/base/num.t for benefit of platforms not using Configure or
9455 * overriding d_Gconvert */
9460 : first add preferred functions to our list
9462 for xxx_convert in $gconvert_preference; do
9463 case $xxx_convert in
9464 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9465 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9468 : then add any others
9469 for xxx_convert in gconvert gcvt sprintf; do
9472 *) xxx_list="$xxx_list $xxx_convert" ;;
9476 case "$d_longdbl$uselongdouble" in
9478 : again, add prefered functions to our list first
9480 for xxx_convert in $gconvert_ld_preference; do
9481 case $xxx_convert in
9482 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9483 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9486 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9487 for xxx_convert in qgcvt sprintf $xxx_list; do
9488 case "$xxx_ld_list" in
9489 $xxx_convert*|*" $xxx_convert"*) ;;
9490 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9493 : if sprintf cannot do long doubles, move it to the end
9494 if test "$d_PRIgldbl" != "$define"; then
9495 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9497 : if no qgcvt, remove it
9498 if test "$d_qgcvt" != "$define"; then
9499 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9502 xxx_list="$xxx_ld_list"
9506 for xxx_convert in $xxx_list; do
9507 echo "Trying $xxx_convert..."
9509 set try -DTRY_$xxx_convert
9510 if eval $compile; then
9511 echo "$xxx_convert() found." >&4
9513 echo "I'll use $xxx_convert to convert floats into a string." >&4
9516 echo "...But $xxx_convert didn't work as I expected."
9520 echo "$xxx_convert NOT found." >&4
9524 if test X$xxx_convert = X; then
9525 echo "*** WHOA THERE!!! ***" >&4
9526 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9530 case "$xxx_convert" in
9531 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9532 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9533 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9534 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9535 "$define$define$define")
9536 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9537 "$define$define$undef")
9538 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9539 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9546 : see if _fwalk exists
9550 : Initialize h_fcntl
9553 : Initialize h_sysfile
9556 : access call always available on UNIX
9560 : locate the flags for 'access()'
9564 $cat >access.c <<EOCP
9565 #include <sys/types.h>
9570 #include <sys/file.h>
9583 : check sys/file.h first, no particular reason here
9584 if $test `./findhdr sys/file.h` && \
9585 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9587 echo "<sys/file.h> defines the *_OK access constants." >&4
9588 elif $test `./findhdr fcntl.h` && \
9589 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9591 echo "<fcntl.h> defines the *_OK access constants." >&4
9592 elif $test `./findhdr unistd.h` && \
9593 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9594 echo "<unistd.h> defines the *_OK access constants." >&4
9596 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9602 : see if accessx exists
9603 set accessx d_accessx
9606 : see if aintl exists
9610 : see if alarm exists
9614 : see if POSIX threads are available
9615 set pthread.h i_pthread
9618 : define a fucntion to check prototypes
9619 $cat > protochk <<EOSH
9622 optimize="$optimize"
9624 prototype="$prototype"
9627 usethreads=$usethreads
9628 i_pthread=$i_pthread
9629 pthread_h_first=$pthread_h_first
9632 $cat >> protochk <<'EOSH'
9637 while test $# -ge 2; do
9639 $define) echo "#include <$2>" >> try.c ;;
9640 literal) echo "$2" >> try.c ;;
9642 # Extra magic for the benefit of systems that need pthread.h
9643 # to be included early to correctly detect threadsafe functions.
9644 # Such functions must guarantee themselves, though, that the usethreads
9645 # and i_pthread have been defined, before calling protochk.
9646 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9647 echo "#include <pthread.h>" >> try.c
9652 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9653 cat >> try.c <<'EOCP'
9654 #ifdef CAN_PROTOTYPE
9655 #define _(args) args
9660 echo "$foo" >> try.c
9661 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9662 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9670 hasproto='varname=$1; func=$2; shift; shift;
9671 while $test $# -ge 2; do
9673 $define) echo "#include <$2>";;
9677 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9678 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9679 echo "$func() prototype found.";
9682 echo "$func() prototype NOT found.";
9687 $rm -f try.c tryout.c'
9689 : see if sys/types.h has to be included
9690 set sys/types.h i_systypes
9693 : see if sys/select.h has to be included
9694 set sys/select.h i_sysselct
9697 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9698 while $test $# -ge 2; do
9700 $define) echo "#include <$2>";;
9704 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9706 if eval $compile; then
9715 : see if we should include time.h, sys/time.h, or both
9717 if test "X$timeincl" = X; then
9718 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9719 $echo $n "I'm now running the test program...$c"
9721 #include <sys/types.h>
9726 #ifdef SYSTIMEKERNEL
9729 #include <sys/time.h>
9732 #include <sys/select.h>
9745 struct timezone tzp;
9747 if (foo.tm_sec == foo.tm_sec)
9750 if (bar.tv_sec == bar.tv_sec)
9757 for s_timezone in '-DS_TIMEZONE' ''; do
9759 for s_timeval in '-DS_TIMEVAL' ''; do
9760 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9761 for i_time in '' '-DI_TIME'; do
9762 for i_systime in '-DI_SYSTIME' ''; do
9765 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9766 if eval $compile; then
9767 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9771 $echo $n "Succeeded with $flags$c"
9783 *SYSTIMEKERNEL*) i_systimek="$define"
9784 timeincl=`./findhdr sys/time.h`
9785 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9786 *) i_systimek="$undef";;
9789 *I_TIME*) i_time="$define"
9790 timeincl=`./findhdr time.h`" $timeincl"
9791 echo "We'll include <time.h>." >&4;;
9792 *) i_time="$undef";;
9795 *I_SYSTIME*) i_systime="$define"
9796 timeincl=`./findhdr sys/time.h`" $timeincl"
9797 echo "We'll include <sys/time.h>." >&4;;
9798 *) i_systime="$undef";;
9802 : see if struct tm knows about tm_zone
9803 case "$i_systime$i_time" in
9806 echo "Checking to see if your struct tm has tm_zone field..." >&4
9807 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9815 case "$d_tm_tm_zone" in
9816 "$define") echo "Yes, it does." ;;
9817 *) echo "No, it doesn't." ;;
9819 : see if struct tm knows about tm_gmtoff
9820 case "$i_systime$i_time" in
9823 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9824 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9832 case "$d_tm_tm_gmtoff" in
9833 "$define") echo "Yes, it does." ;;
9834 *) echo "No, it doesn't." ;;
9837 : see if asctime_r exists
9838 set asctime_r d_asctime_r
9840 case "$d_asctime_r" in
9842 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9843 case "$d_asctime_r_proto:$usethreads" in
9844 ":define") d_asctime_r_proto=define
9845 set d_asctime_r_proto asctime_r $hdrs
9849 case "$d_asctime_r_proto" in
9851 case "$asctime_r_proto" in
9852 ''|0) try='char* asctime_r(const struct tm*, char*);'
9853 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9855 case "$asctime_r_proto" in
9856 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9857 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9859 case "$asctime_r_proto" in
9860 ''|0) try='int asctime_r(const struct tm*, char*);'
9861 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9863 case "$asctime_r_proto" in
9864 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9865 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9867 case "$asctime_r_proto" in
9868 ''|0) d_asctime_r=undef
9870 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9871 * ) case "$asctime_r_proto" in
9872 REENTRANT_PROTO*) ;;
9873 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9875 echo "Prototype: $try" ;;
9878 *) case "$usethreads" in
9879 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9886 *) asctime_r_proto=0
9890 : see if atolf exists
9894 : see if atoll exists
9898 : Look for GCC-style attribute format
9899 case "$d_attribute_format" in
9902 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9903 $cat >attrib.c <<'EOCP'
9905 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9907 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9908 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9909 echo "Your C compiler doesn't support __attribute__((format))."
9912 echo "Your C compiler supports __attribute__((format))."
9916 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9920 *) val="$d_attribute_format" ;;
9922 set d_attribute_format
9926 : Look for GCC-style attribute malloc
9927 case "$d_attribute_malloc" in
9930 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9931 $cat >attrib.c <<'EOCP'
9933 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9935 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9936 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9937 echo "Your C compiler doesn't support __attribute__((malloc))."
9940 echo "Your C compiler supports __attribute__((malloc))."
9944 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9948 *) val="$d_attribute_malloc" ;;
9950 set d_attribute_malloc
9954 : Look for GCC-style attribute nonnull
9955 case "$d_attribute_nonnull" in
9958 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9959 $cat >attrib.c <<'EOCP'
9961 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9963 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9964 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9965 echo "Your C compiler doesn't support __attribute__((nonnull))."
9968 echo "Your C compiler supports __attribute__((nonnull))."
9972 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9976 *) val="$d_attribute_nonnull" ;;
9978 set d_attribute_nonnull
9982 : Look for GCC-style attribute noreturn
9983 case "$d_attribute_noreturn" in
9986 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9987 $cat >attrib.c <<'EOCP'
9989 void fall_over_dead( void ) __attribute__((noreturn));
9991 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9992 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9993 echo "Your C compiler doesn't support __attribute__((noreturn))."
9996 echo "Your C compiler supports __attribute__((noreturn))."
10000 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10004 *) val="$d_attribute_noreturn" ;;
10006 set d_attribute_noreturn
10010 : Look for GCC-style attribute pure
10011 case "$d_attribute_pure" in
10014 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10015 $cat >attrib.c <<'EOCP'
10017 int square( int n ) __attribute__((pure));
10019 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10020 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10021 echo "Your C compiler doesn't support __attribute__((pure))."
10024 echo "Your C compiler supports __attribute__((pure))."
10028 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10032 *) val="$d_attribute_pure" ;;
10034 set d_attribute_pure
10038 : Look for GCC-style attribute unused
10039 case "$d_attribute_unused" in
10042 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10043 $cat >attrib.c <<'EOCP'
10045 int do_something( int dummy __attribute__((unused)), int n );
10047 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10048 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10049 echo "Your C compiler doesn't support __attribute__((unused))."
10052 echo "Your C compiler supports __attribute__((unused))."
10056 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10060 *) val="$d_attribute_unused" ;;
10062 set d_attribute_unused
10066 : Look for GCC-style attribute warn_unused_result
10067 case "$d_attribute_warn_unused_result" in
10070 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10071 $cat >attrib.c <<'EOCP'
10073 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10075 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10076 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10077 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10080 echo "Your C compiler supports __attribute__((warn_unused_result))."
10084 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10088 *) val="$d_attribute_warn_unused_result" ;;
10090 set d_attribute_warn_unused_result
10094 : see if bcmp exists
10098 : see if bcopy exists
10102 : see if this is a unistd.h system
10103 set unistd.h i_unistd
10106 : see if getpgrp exists
10107 set getpgrp d_getpgrp
10110 case "$d_getpgrp" in
10113 echo "Checking to see which flavor of getpgrp is in use..."
10115 #$i_unistd I_UNISTD
10116 #include <sys/types.h>
10118 # include <unistd.h>
10120 #$i_stdlib I_STDLIB
10122 #include <stdlib.h>
10126 if (getuid() == 0) {
10127 printf("(I see you are running Configure as super-user...)\n");
10130 #ifdef TRY_BSD_PGRP
10131 if (getpgrp(1) == 0)
10140 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10141 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10143 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10144 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10147 echo "I can't seem to compile and run the test program."
10149 xxx="a USG one, i.e. you use getpgrp()."
10151 # SVR4 systems can appear rather BSD-ish.
10152 case "$i_unistd" in
10154 xxx="a BSD one, i.e. you use getpgrp(pid)."
10158 xxx="probably a USG one, i.e. you use getpgrp()."
10163 echo "Assuming your getpgrp is $xxx" >&4
10172 : see if setpgrp exists
10173 set setpgrp d_setpgrp
10176 case "$d_setpgrp" in
10179 echo "Checking to see which flavor of setpgrp is in use..."
10181 #$i_unistd I_UNISTD
10182 #include <sys/types.h>
10184 # include <unistd.h>
10186 #$i_stdlib I_STDLIB
10188 #include <stdlib.h>
10192 if (getuid() == 0) {
10193 printf("(I see you are running Configure as super-user...)\n");
10196 #ifdef TRY_BSD_PGRP
10197 if (-1 == setpgrp(1, 1))
10200 if (setpgrp() != -1)
10206 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10207 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10209 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10210 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10213 echo "(I can't seem to compile and run the test program.)"
10215 xxx="a USG one, i.e. you use setpgrp()."
10217 # SVR4 systems can appear rather BSD-ish.
10218 case "$i_unistd" in
10220 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10224 xxx="probably a USG one, i.e. you use setpgrp()."
10229 echo "Assuming your setpgrp is $xxx" >&4
10237 : see if bzero exists
10241 : see if signal is declared as pointer to function returning int or void
10243 xxx=`./findhdr signal.h`
10244 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10245 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10246 echo "You have int (*signal())() instead of void." >&4
10248 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10249 echo "You have void (*signal())()." >&4
10251 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10252 echo "You have int (*signal())() instead of void." >&4
10254 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10255 echo "You have void (*signal())()." >&4
10258 case "$d_voidsig" in
10260 echo "I can't determine whether signal handler returns void or int..." >&4
10262 rp="What type does your signal handler return?"
10265 v*) val="$define";;
10269 echo "As you already told me, signal handler returns void." >&4
10272 *) echo "As you already told me, signal handler returns int." >&4
10279 case "$d_voidsig" in
10280 "$define") signal_t="void";;
10281 *) signal_t="int";;
10285 : check for ability to cast large floats to 32-bit ints.
10287 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10288 if $test "$intsize" -ge 4; then
10295 #$i_stdlib I_STDLIB
10297 #include <stdlib.h>
10299 #include <sys/types.h>
10300 #include <signal.h>
10301 $signal_t blech(s) int s; { exit(3); }
10308 signal(SIGFPE, blech);
10310 /* Don't let compiler optimize the test away. Store the number
10311 in a writable string for gcc to pass to sscanf under HP/UX.
10313 sprintf(str, "2147483647");
10314 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10318 /* x86 processors will probably give 0x8000 0000, which is a
10319 sign change. We don't want that. We want to mimic SPARC
10320 behavior here, which is to preserve the sign and give
10323 if (i32 != ($xxx) f)
10329 if eval $compile_ok; then
10333 echo "(I can't seem to compile the test program--assuming it can't)"
10338 echo "Yup, it can."
10341 echo "Nope, it can't."
10348 : check for ability to cast negative floats to unsigned
10350 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10353 #$i_stdlib I_STDLIB
10355 #include <stdlib.h>
10357 #include <sys/types.h>
10358 #include <signal.h>
10359 $signal_t blech(s) int s; { exit(7); }
10360 $signal_t blech_in_list(s) int s; { exit(4); }
10361 unsigned long dummy_long(p) unsigned long p; { return p; }
10362 unsigned int dummy_int(p) unsigned int p; { return p; }
10363 unsigned short dummy_short(p) unsigned short p; { return p; }
10367 unsigned long along;
10369 unsigned short ashort;
10373 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10374 a direct f = -123. assignment. gcc-2.8.0 reportedly
10375 optimized the whole file away
10377 /* Store the number in a writable string for gcc to pass to
10378 sscanf under HP/UX.
10380 sprintf(str, "-123");
10381 sscanf(str, "%lf", &f); /* f = -123.; */
10383 signal(SIGFPE, blech);
10384 along = (unsigned long)f;
10385 aint = (unsigned int)f;
10386 ashort = (unsigned short)f;
10387 if (along != (unsigned long)-123)
10389 if (aint != (unsigned int)-123)
10391 if (ashort != (unsigned short)-123)
10393 sprintf(str, "1073741824.");
10394 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10397 along = (unsigned long)f;
10398 if (along != 0x80000000)
10402 along = (unsigned long)f;
10403 if (along != 0x7fffffff)
10407 along = (unsigned long)f;
10408 if (along != 0x80000001)
10412 signal(SIGFPE, blech_in_list);
10413 sprintf(str, "123.");
10414 sscanf(str, "%lf", &f); /* f = 123.; */
10415 along = dummy_long((unsigned long)f);
10416 aint = dummy_int((unsigned int)f);
10417 ashort = dummy_short((unsigned short)f);
10418 if (along != (unsigned long)123)
10420 if (aint != (unsigned int)123)
10422 if (ashort != (unsigned short)123)
10429 if eval $compile_ok; then
10433 echo "(I can't seem to compile the test program--assuming it can't)"
10436 case "$castflags" in
10438 echo "Yup, it can."
10441 echo "Nope, it can't."
10448 : see if vprintf exists
10450 if set vprintf val -f d_vprintf; eval $csym; $val; then
10451 echo 'vprintf() found.' >&4
10454 #include <varargs.h>
10455 #$i_stdlib I_STDLIB
10457 #include <stdlib.h>
10460 int main() { xxx("foo"); }
10469 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10473 if eval $compile && $run ./try; then
10474 echo "Your vsprintf() returns (int)." >&4
10477 echo "Your vsprintf() returns (char*)." >&4
10481 echo 'vprintf() NOT found.' >&4
10492 : see if chown exists
10496 : see if chroot exists
10497 set chroot d_chroot
10500 : see if chsize exists
10501 set chsize d_chsize
10504 : see if class exists
10508 : see if clearenv exists
10509 set clearenv d_clearenv
10512 hasstruct='varname=$1; struct=$2; shift; shift;
10513 while $test $# -ge 2; do
10515 $define) echo "#include <$2>";;
10519 echo "int main () { struct $struct foo; }" >> try.c;
10521 if eval $compile; then
10528 $rm -f try.c try.o'
10532 : see whether socket exists
10534 $echo $n "Hmm... $c" >&4
10535 if set socket val -f d_socket; eval $csym; $val; then
10536 echo "Looks like you have Berkeley networking support." >&4
10538 if set setsockopt val -f; eval $csym; $val; then
10541 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10542 d_oldsock="$define"
10545 if $contains socklib libc.list >/dev/null 2>&1; then
10546 echo "Looks like you have Berkeley networking support." >&4
10548 : we will have to assume that it supports the 4.2 BSD interface
10551 echo "You don't have Berkeley networking in libc$_a..." >&4
10552 if test "X$d_socket" = "X$define"; then
10553 echo "...but you seem to believe that you have sockets." >&4
10555 for net in net socket
10557 if test -f /usr/lib/lib$net$_a; then
10558 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10559 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10560 if $contains socket libc.list >/dev/null 2>&1; then
10565 echo "...but the Wollongong group seems to have hacked it in." >&4
10566 sockethdr="-I/usr/netinclude"
10569 echo "Found Berkeley sockets interface in lib$net." >&4
10570 if $contains setsockopt libc.list >/dev/null 2>&1; then
10573 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10574 d_oldsock="$define"
10580 if test "X$d_socket" != "X$define"; then
10581 echo "or anywhere else I see." >&4
10589 : see if socketpair exists
10590 set socketpair d_sockpair
10595 echo "Checking the availability of certain socket constants..." >&4
10596 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10597 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10599 #include <sys/types.h>
10600 #include <sys/socket.h>
10606 set try; if eval $compile; then
10609 set d_${enum}; eval $setvar
10613 : see if this is a sys/uio.h system
10614 set sys/uio.h i_sysuio
10619 echo "Checking to see if your system supports struct cmsghdr..." >&4
10620 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10622 case "$d_cmsghdr_s" in
10623 "$define") echo "Yes, it does." ;;
10624 *) echo "No, it doesn't." ;;
10628 : check for const keyword
10630 echo 'Checking to see if your C compiler knows about "const"...' >&4
10631 $cat >const.c <<'EOCP'
10632 typedef struct spug { int drokk; } spug;
10639 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10641 echo "Yup, it does."
10644 echo "Nope, it doesn't."
10649 : see if copysignl exists
10650 set copysignl d_copysignl
10653 : see if crypt exists
10658 $define) cryptlib='' ;;
10659 *) if set crypt val -f d_crypt; eval $csym; $val; then
10660 echo 'crypt() found.' >&4
10664 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10665 if $test -z "$cryptlib"; then
10666 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10670 if $test -z "$cryptlib"; then
10671 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10675 if $test -z "$cryptlib"; then
10676 cryptlib=`./loc libcrypt$_a "" $libpth`
10680 if $test -z "$cryptlib"; then
10681 echo 'crypt() NOT found.' >&4
10692 : see if this is a crypt.h system
10693 set crypt.h i_crypt
10696 : see if crypt_r exists
10697 set crypt_r d_crypt_r
10699 case "$d_crypt_r" in
10701 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10702 case "$d_crypt_r_proto:$usethreads" in
10703 ":define") d_crypt_r_proto=define
10704 set d_crypt_r_proto crypt_r $hdrs
10708 case "$d_crypt_r_proto" in
10710 case "$crypt_r_proto" in
10711 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10712 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10714 case "$crypt_r_proto" in
10715 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10716 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10718 case "$crypt_r_proto" in
10719 ''|0) d_crypt_r=undef
10721 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10722 * ) case "$crypt_r_proto" in
10723 REENTRANT_PROTO*) ;;
10724 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10726 echo "Prototype: $try" ;;
10729 *) case "$usethreads" in
10730 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10741 : get csh whereabouts
10743 'csh') val="$undef" ;;
10744 *) val="$define" ;;
10748 : Respect a hint or command line value for full_csh.
10749 case "$full_csh" in
10750 '') full_csh=$csh ;;
10753 : see if ctermid_r exists
10754 set ctermid_r d_ctermid_r
10756 case "$d_ctermid_r" in
10758 hdrs="$i_systypes sys/types.h define stdio.h "
10759 case "$d_ctermid_r_proto:$usethreads" in
10760 ":define") d_ctermid_r_proto=define
10761 set d_ctermid_r_proto ctermid_r $hdrs
10765 case "$d_ctermid_r_proto" in
10767 case "$ctermid_r_proto" in
10768 ''|0) try='char* ctermid_r(char*);'
10769 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10771 case "$ctermid_r_proto" in
10772 ''|0) d_ctermid_r=undef
10774 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10775 * ) case "$ctermid_r_proto" in
10776 REENTRANT_PROTO*) ;;
10777 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10779 echo "Prototype: $try" ;;
10782 *) case "$usethreads" in
10783 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10790 *) ctermid_r_proto=0
10794 : see if ctime_r exists
10795 set ctime_r d_ctime_r
10797 case "$d_ctime_r" in
10799 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10800 case "$d_ctime_r_proto:$usethreads" in
10801 ":define") d_ctime_r_proto=define
10802 set d_ctime_r_proto ctime_r $hdrs
10806 case "$d_ctime_r_proto" in
10808 case "$ctime_r_proto" in
10809 ''|0) try='char* ctime_r(const time_t*, char*);'
10810 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10812 case "$ctime_r_proto" in
10813 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10814 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10816 case "$ctime_r_proto" in
10817 ''|0) try='int ctime_r(const time_t*, char*);'
10818 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10820 case "$ctime_r_proto" in
10821 ''|0) try='int ctime_r(const time_t*, char*, int);'
10822 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10824 case "$ctime_r_proto" in
10825 ''|0) d_ctime_r=undef
10827 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10828 * ) case "$ctime_r_proto" in
10829 REENTRANT_PROTO*) ;;
10830 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10832 echo "Prototype: $try" ;;
10835 *) case "$usethreads" in
10836 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10847 : see if cuserid exists
10848 set cuserid d_cuserid
10851 : see if this is a limits.h system
10852 set limits.h i_limits
10855 : see if this is a float.h system
10856 set float.h i_float
10859 : See if number of significant digits in a double precision number is known
10861 $cat >dbl_dig.c <<EOM
10862 #$i_limits I_LIMITS
10865 #include <limits.h>
10871 printf("Contains DBL_DIG");
10874 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10875 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10876 echo "DBL_DIG found." >&4
10879 echo "DBL_DIG NOT found." >&4
10886 : see if dbm.h is available
10887 : see if dbmclose exists
10888 set dbmclose d_dbmclose
10891 case "$d_dbmclose" in
10901 *) set rpcsvc/dbm.h i_rpcsvcdbm
10906 *) echo "We won't be including <dbm.h>"
10916 : see if prototype for dbminit is available
10918 set d_dbminitproto dbminit $i_dbm dbm.h
10921 : see if difftime exists
10922 set difftime d_difftime
10925 : see if this is a dirent system
10927 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10929 echo "<dirent.h> found." >&4
10932 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10933 echo "<sys/dir.h> found." >&4
10936 xinc=`./findhdr sys/ndir.h`
10938 echo "<dirent.h> NOT found." >&4
10943 : Look for type of directory structure.
10945 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10947 case "$direntrytype" in
10949 case "$i_dirent" in
10950 $define) guess1='struct dirent' ;;
10951 *) guess1='struct direct' ;;
10954 *) guess1="$direntrytype"
10959 'struct dirent') guess2='struct direct' ;;
10960 *) guess2='struct dirent' ;;
10963 if $contains "$guess1" try.c >/dev/null 2>&1; then
10964 direntrytype="$guess1"
10965 echo "Your directory entries are $direntrytype." >&4
10966 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10967 direntrytype="$guess2"
10968 echo "Your directory entries seem to be $direntrytype." >&4
10970 echo "I don't recognize your system's directory entries." >&4
10971 rp="What type is used for directory entries on this system?"
10974 direntrytype="$ans"
10979 : see if the directory entry stores field length
10981 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10982 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10983 echo "Good, your directory entry keeps length information in d_namlen." >&4
10986 echo "Your directory entry does not know about the d_namlen field." >&4
10993 : see if this is an sysdir system
10994 set sys/dir.h i_sysdir
10997 : see if this is an sysndir system
10998 set sys/ndir.h i_sysndir
11003 $cat >dirfd.c <<EOM
11005 #$i_stdlib I_STDLIB
11007 #include <stdlib.h>
11009 #$i_dirent I_DIRENT /**/
11010 #$i_sysdir I_SYS_DIR /**/
11011 #$i_sysndir I_SYS_NDIR /**/
11012 #$i_systypes I_SYS_TYPES /**/
11013 #if defined(I_SYS_TYPES)
11014 #include <sys/types.h>
11016 #if defined(I_DIRENT)
11017 #include <dirent.h>
11018 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11019 #include <sys/dir.h>
11023 #include <sys/ndir.h>
11027 #include <ndir.h> /* may be wrong in the future */
11029 #include <sys/dir.h>
11035 DIR *dirp = opendir(".");
11036 if (dirfd(dirp) >= 0)
11044 if eval $compile; then
11048 $define) echo "dirfd() found." >&4 ;;
11049 *) echo "dirfd() NOT found." >&4 ;;
11055 : see if dlerror exists
11058 set dlerror d_dlerror
11062 : see if dlfcn is available
11063 set dlfcn.h i_dlfcn
11070 On a few systems, the dynamically loaded modules that perl generates and uses
11071 will need a different extension than shared libs. The default will probably
11077 *) dflt="$dlext" ;;
11079 rp='What is the extension of dynamically loaded modules'
11088 : Check if dlsym need a leading underscore
11094 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11095 $cat >dyna.c <<'EOM'
11102 #$i_stdlib I_STDLIB
11104 #include <stdlib.h>
11108 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11110 #include <sys/types.h>
11115 extern int fred() ;
11124 int mode = RTLD_LAZY ;
11126 handle = dlopen("./dyna.$dlext", mode) ;
11127 if (handle == NULL) {
11132 symbol = dlsym(handle, "fred") ;
11133 if (symbol == NULL) {
11134 /* try putting a leading underscore */
11135 symbol = dlsym(handle, "_fred") ;
11136 if (symbol == NULL) {
11149 : Call the object file tmp-dyna.o in case dlext=o.
11150 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11151 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11152 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11153 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11156 1) echo "Test program failed using dlopen." >&4
11157 echo "Perhaps you should not use dynamic loading." >&4;;
11158 2) echo "Test program failed using dlsym." >&4
11159 echo "Perhaps you should not use dynamic loading." >&4;;
11160 3) echo "dlsym needs a leading underscore" >&4
11162 4) echo "dlsym doesn't need a leading underscore." >&4;;
11165 echo "I can't compile and run the test program." >&4
11166 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11171 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11176 : see if drand48_r exists
11177 set drand48_r d_drand48_r
11179 case "$d_drand48_r" in
11181 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11182 case "$d_drand48_r_proto:$usethreads" in
11183 ":define") d_drand48_r_proto=define
11184 set d_drand48_r_proto drand48_r $hdrs
11188 case "$d_drand48_r_proto" in
11190 case "$drand48_r_proto" in
11191 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11192 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11194 case "$drand48_r_proto" in
11195 ''|0) d_drand48_r=undef
11197 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11198 * ) case "$drand48_r_proto" in
11199 REENTRANT_PROTO*) ;;
11200 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11202 echo "Prototype: $try" ;;
11205 *) case "$usethreads" in
11206 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11213 *) drand48_r_proto=0
11217 : see if prototype for drand48 is available
11219 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11222 : see if dup2 exists
11226 : see if eaccess exists
11227 set eaccess d_eaccess
11230 : see if endgrent exists
11231 set endgrent d_endgrent
11234 : see if this is an grp system
11240 xxx=`./findhdr grp.h`
11241 $cppstdin $cppflags $cppminus < $xxx >$$.h
11243 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11255 set d_grpasswd; eval $setvar
11259 : see if endgrent_r exists
11260 set endgrent_r d_endgrent_r
11262 case "$d_endgrent_r" in
11264 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11265 case "$d_endgrent_r_proto:$usethreads" in
11266 ":define") d_endgrent_r_proto=define
11267 set d_endgrent_r_proto endgrent_r $hdrs
11271 case "$d_endgrent_r_proto" in
11273 case "$endgrent_r_proto" in
11274 ''|0) try='int endgrent_r(FILE**);'
11275 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11277 case "$endgrent_r_proto" in
11278 ''|0) try='void endgrent_r(FILE**);'
11279 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11281 case "$endgrent_r_proto" in
11282 ''|0) d_endgrent_r=undef
11284 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11285 * ) case "$endgrent_r_proto" in
11286 REENTRANT_PROTO*) ;;
11287 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11289 echo "Prototype: $try" ;;
11292 *) case "$usethreads" in
11293 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11300 *) endgrent_r_proto=0
11304 : see if endhostent exists
11305 set endhostent d_endhent
11308 : see if this is a netdb.h system
11309 set netdb.h i_netdb
11312 : see if endhostent_r exists
11313 set endhostent_r d_endhostent_r
11315 case "$d_endhostent_r" in
11317 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11318 case "$d_endhostent_r_proto:$usethreads" in
11319 ":define") d_endhostent_r_proto=define
11320 set d_endhostent_r_proto endhostent_r $hdrs
11324 case "$d_endhostent_r_proto" in
11326 case "$endhostent_r_proto" in
11327 ''|0) try='int endhostent_r(struct hostent_data*);'
11328 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11330 case "$endhostent_r_proto" in
11331 ''|0) try='void endhostent_r(struct hostent_data*);'
11332 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11334 case "$endhostent_r_proto" in
11335 ''|0) d_endhostent_r=undef
11336 endhostent_r_proto=0
11337 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11338 * ) case "$endhostent_r_proto" in
11339 REENTRANT_PROTO*) ;;
11340 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11342 echo "Prototype: $try" ;;
11345 *) case "$usethreads" in
11346 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11348 d_endhostent_r=undef
11349 endhostent_r_proto=0
11353 *) endhostent_r_proto=0
11357 : see if endnetent exists
11358 set endnetent d_endnent
11361 : see if endnetent_r exists
11362 set endnetent_r d_endnetent_r
11364 case "$d_endnetent_r" in
11366 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11367 case "$d_endnetent_r_proto:$usethreads" in
11368 ":define") d_endnetent_r_proto=define
11369 set d_endnetent_r_proto endnetent_r $hdrs
11373 case "$d_endnetent_r_proto" in
11375 case "$endnetent_r_proto" in
11376 ''|0) try='int endnetent_r(struct netent_data*);'
11377 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11379 case "$endnetent_r_proto" in
11380 ''|0) try='void endnetent_r(struct netent_data*);'
11381 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11383 case "$endnetent_r_proto" in
11384 ''|0) d_endnetent_r=undef
11385 endnetent_r_proto=0
11386 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11387 * ) case "$endnetent_r_proto" in
11388 REENTRANT_PROTO*) ;;
11389 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11391 echo "Prototype: $try" ;;
11394 *) case "$usethreads" in
11395 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11397 d_endnetent_r=undef
11398 endnetent_r_proto=0
11402 *) endnetent_r_proto=0
11406 : see if endprotoent exists
11407 set endprotoent d_endpent
11410 : see if endprotoent_r exists
11411 set endprotoent_r d_endprotoent_r
11413 case "$d_endprotoent_r" in
11415 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11416 case "$d_endprotoent_r_proto:$usethreads" in
11417 ":define") d_endprotoent_r_proto=define
11418 set d_endprotoent_r_proto endprotoent_r $hdrs
11422 case "$d_endprotoent_r_proto" in
11424 case "$endprotoent_r_proto" in
11425 ''|0) try='int endprotoent_r(struct protoent_data*);'
11426 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11428 case "$endprotoent_r_proto" in
11429 ''|0) try='void endprotoent_r(struct protoent_data*);'
11430 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11432 case "$endprotoent_r_proto" in
11433 ''|0) d_endprotoent_r=undef
11434 endprotoent_r_proto=0
11435 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11436 * ) case "$endprotoent_r_proto" in
11437 REENTRANT_PROTO*) ;;
11438 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11440 echo "Prototype: $try" ;;
11443 *) case "$usethreads" in
11444 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11446 d_endprotoent_r=undef
11447 endprotoent_r_proto=0
11451 *) endprotoent_r_proto=0
11455 : see if endpwent exists
11456 set endpwent d_endpwent
11459 : see if this is a pwd.h system
11465 xxx=`./findhdr pwd.h`
11466 $cppstdin $cppflags $cppminus < $xxx >$$.h
11468 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11476 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11484 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11492 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11500 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11508 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11516 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11524 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11536 set d_pwquota; eval $setvar
11537 set d_pwage; eval $setvar
11538 set d_pwchange; eval $setvar
11539 set d_pwclass; eval $setvar
11540 set d_pwexpire; eval $setvar
11541 set d_pwcomment; eval $setvar
11542 set d_pwgecos; eval $setvar
11543 set d_pwpasswd; eval $setvar
11547 : see if endpwent_r exists
11548 set endpwent_r d_endpwent_r
11550 case "$d_endpwent_r" in
11552 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11553 case "$d_endpwent_r_proto:$usethreads" in
11554 ":define") d_endpwent_r_proto=define
11555 set d_endpwent_r_proto endpwent_r $hdrs
11559 case "$d_endpwent_r_proto" in
11561 case "$endpwent_r_proto" in
11562 ''|0) try='int endpwent_r(FILE**);'
11563 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11565 case "$endpwent_r_proto" in
11566 ''|0) try='void endpwent_r(FILE**);'
11567 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11569 case "$endpwent_r_proto" in
11570 ''|0) d_endpwent_r=undef
11572 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11573 * ) case "$endpwent_r_proto" in
11574 REENTRANT_PROTO*) ;;
11575 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11577 echo "Prototype: $try" ;;
11580 *) case "$usethreads" in
11581 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11588 *) endpwent_r_proto=0
11592 : see if endservent exists
11593 set endservent d_endsent
11596 : see if endservent_r exists
11597 set endservent_r d_endservent_r
11599 case "$d_endservent_r" in
11601 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11602 case "$d_endservent_r_proto:$usethreads" in
11603 ":define") d_endservent_r_proto=define
11604 set d_endservent_r_proto endservent_r $hdrs
11608 case "$d_endservent_r_proto" in
11610 case "$endservent_r_proto" in
11611 ''|0) try='int endservent_r(struct servent_data*);'
11612 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11614 case "$endservent_r_proto" in
11615 ''|0) try='void endservent_r(struct servent_data*);'
11616 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11618 case "$endservent_r_proto" in
11619 ''|0) d_endservent_r=undef
11620 endservent_r_proto=0
11621 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11622 * ) case "$endservent_r_proto" in
11623 REENTRANT_PROTO*) ;;
11624 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11626 echo "Prototype: $try" ;;
11629 *) case "$usethreads" in
11630 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11632 d_endservent_r=undef
11633 endservent_r_proto=0
11637 *) endservent_r_proto=0
11641 : Locate the flags for 'open()'
11644 #include <sys/types.h>
11649 #include <sys/file.h>
11651 #$i_stdlib I_STDLIB
11653 #include <stdlib.h>
11664 : check sys/file.h first to get FREAD on Sun
11665 if $test `./findhdr sys/file.h` && \
11666 set try -DI_SYS_FILE && eval $compile; then
11668 echo "<sys/file.h> defines the O_* constants..." >&4
11669 if $run ./try; then
11670 echo "and you have the 3 argument form of open()." >&4
11673 echo "but not the 3 argument form of open(). Oh, well." >&4
11676 elif $test `./findhdr fcntl.h` && \
11677 set try -DI_FCNTL && eval $compile; then
11679 echo "<fcntl.h> defines the O_* constants..." >&4
11680 if $run ./try; then
11681 echo "and you have the 3 argument form of open()." >&4
11684 echo "but not the 3 argument form of open(). Oh, well." >&4
11689 echo "I can't find the O_* constant definitions! You got problems." >&4
11695 : see which of string.h or strings.h is needed
11697 strings=`./findhdr string.h`
11698 if $test "$strings" && $test -r "$strings"; then
11699 echo "Using <string.h> instead of <strings.h>." >&4
11703 strings=`./findhdr strings.h`
11704 if $test "$strings" && $test -r "$strings"; then
11705 echo "Using <strings.h> instead of <string.h>." >&4
11707 echo "No string header found -- You'll surely have problems." >&4
11712 case "$i_string" in
11713 "$undef") strings=`./findhdr strings.h`;;
11714 *) strings=`./findhdr string.h`;;
11717 : see if this is a sys/file.h system
11722 : do we need to include sys/file.h ?
11726 if $h_sysfile; then
11728 echo "We'll be including <sys/file.h>." >&4
11731 echo "We won't be including <sys/file.h>." >&4
11741 : see if fcntl.h is there
11746 : see if we can include fcntl.h
11752 echo "We'll be including <fcntl.h>." >&4
11755 if $h_sysfile; then
11756 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11758 echo "We won't be including <fcntl.h>." >&4
11770 : check for non-blocking I/O stuff
11771 case "$h_sysfile" in
11772 true) echo "#include <sys/file.h>" > head.c;;
11775 true) echo "#include <fcntl.h>" > head.c;;
11776 *) echo "#include <sys/fcntl.h>" > head.c;;
11781 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11782 case "$o_nonblock" in
11784 $cat head.c > try.c
11785 $cat >>try.c <<EOCP
11787 #$i_stdlib I_STDLIB
11789 #include <stdlib.h>
11797 printf("O_NONBLOCK\n");
11801 printf("O_NDELAY\n");
11805 printf("FNDELAY\n");
11812 if eval $compile_ok; then
11813 o_nonblock=`$run ./try`
11814 case "$o_nonblock" in
11815 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11816 *) echo "Seems like we can use $o_nonblock.";;
11819 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11822 *) echo "Using $hint value $o_nonblock.";;
11824 $rm -f try try.* .out core
11827 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11830 $cat head.c > try.c
11831 $cat >>try.c <<EOCP
11833 #include <sys/types.h>
11834 #include <signal.h>
11836 #$i_stdlib I_STDLIB
11838 #include <stdlib.h>
11844 #define MY_O_NONBLOCK $o_nonblock
11845 #ifndef errno /* XXX need better Configure test */
11848 #$i_unistd I_UNISTD
11850 #include <unistd.h>
11852 #$i_string I_STRING
11854 #include <string.h>
11856 #include <strings.h>
11858 $signal_t blech(x) int x; { exit(3); }
11860 $cat >> try.c <<'EOCP'
11868 pipe(pd); /* Down: child -> parent */
11869 pipe(pu); /* Up: parent -> child */
11872 close(pd[1]); /* Parent reads from pd[0] */
11873 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11875 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11880 signal(SIGALRM, blech);
11882 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11884 sprintf(string, "%d\n", ret);
11885 write(2, string, strlen(string));
11888 if (errno == EAGAIN) {
11889 printf("EAGAIN\n");
11894 if (errno == EWOULDBLOCK)
11895 printf("EWOULDBLOCK\n");
11898 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11899 sleep(2); /* Give it time to close our pipe */
11901 ret = read(pd[0], buf, 1); /* Should read EOF */
11903 sprintf(string, "%d\n", ret);
11904 write(4, string, strlen(string));
11908 close(pd[0]); /* We write to pd[1] */
11909 close(pu[1]); /* We read from pu[0] */
11910 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11911 close(pd[1]); /* Pipe pd is now fully closed! */
11912 exit(0); /* Bye bye, thank you for playing! */
11916 if eval $compile_ok; then
11917 echo "$startsh" >mtry
11918 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11920 ./mtry >/dev/null 2>&1
11922 0) eagain=`$cat try.out`;;
11923 1) echo "Could not perform non-blocking setting!";;
11924 2) echo "I did a successful read() for something that was not there!";;
11925 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11926 4) echo "Could not find F_SETFL!";;
11927 *) echo "Something terribly wrong happened during testing.";;
11929 rd_nodata=`$cat try.ret`
11930 echo "A read() system call with no data present returns $rd_nodata."
11931 case "$rd_nodata" in
11934 echo "(That's peculiar, fixing that to be -1.)"
11940 echo "Forcing errno EAGAIN on read() with no data available."
11944 echo "Your read() sets errno to $eagain when no data is available."
11947 status=`$cat try.err`
11949 0) echo "And it correctly returns 0 to signal EOF.";;
11950 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11951 *) echo "However, your read() returns '$status' on EOF??";;
11954 if test "$status" = "$rd_nodata"; then
11955 echo "WARNING: you can't distinguish between EOF and no data!"
11959 echo "I can't compile the test program--assuming errno EAGAIN will do."
11966 echo "Using $hint value $eagain."
11967 echo "Your read() returns $rd_nodata when no data is present."
11968 case "$d_eofnblk" in
11969 "$define") echo "And you can see EOF because read() returns 0.";;
11970 "$undef") echo "But you can't see EOF status from read() returned value.";;
11972 echo "(Assuming you can't see EOF status from read anyway.)"
11978 $rm -f try try.* .out core head.c mtry
11980 : see if _ptr and _cnt from stdio act std
11983 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11984 echo "(Looks like you have stdio.h from BSD.)"
11985 case "$stdio_ptr" in
11986 '') stdio_ptr='((fp)->_p)'
11989 *) ptr_lval=$d_stdio_ptr_lval;;
11991 case "$stdio_cnt" in
11992 '') stdio_cnt='((fp)->_r)'
11995 *) cnt_lval=$d_stdio_cnt_lval;;
11997 case "$stdio_base" in
11998 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12000 case "$stdio_bufsiz" in
12001 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12003 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12004 echo "(Looks like you have stdio.h from Linux.)"
12005 case "$stdio_ptr" in
12006 '') stdio_ptr='((fp)->_IO_read_ptr)'
12009 *) ptr_lval=$d_stdio_ptr_lval;;
12011 case "$stdio_cnt" in
12012 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12015 *) cnt_lval=$d_stdio_cnt_lval;;
12017 case "$stdio_base" in
12018 '') stdio_base='((fp)->_IO_read_base)';;
12020 case "$stdio_bufsiz" in
12021 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12024 case "$stdio_ptr" in
12025 '') stdio_ptr='((fp)->_ptr)'
12028 *) ptr_lval=$d_stdio_ptr_lval;;
12030 case "$stdio_cnt" in
12031 '') stdio_cnt='((fp)->_cnt)'
12034 *) cnt_lval=$d_stdio_cnt_lval;;
12036 case "$stdio_base" in
12037 '') stdio_base='((fp)->_base)';;
12039 case "$stdio_bufsiz" in
12040 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12044 : test whether _ptr and _cnt really work
12045 echo "Checking how std your stdio is..." >&4
12048 #$i_stdlib I_STDLIB
12050 #include <stdlib.h>
12052 #define FILE_ptr(fp) $stdio_ptr
12053 #define FILE_cnt(fp) $stdio_cnt
12055 FILE *fp = fopen("try.c", "r");
12058 18 <= FILE_cnt(fp) &&
12059 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12067 if eval $compile && $to try.c; then
12068 if $run ./try; then
12069 echo "Your stdio acts pretty std."
12072 echo "Your stdio isn't very std."
12075 echo "Your stdio doesn't appear very std."
12079 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12080 # direct buffer manipulation no longer works. The Configure tests
12081 # should be changed to correctly detect this, but until then,
12082 # the following check should at least let perl compile and run.
12083 # (This quick fix should be updated before 5.8.1.)
12084 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12085 # A. Dougherty, June 3, 2002.
12086 case "$d_gnulibc" in
12088 case "$gnulibc_version" in
12092 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12101 : Can _ptr be used as an lvalue?
12102 case "$d_stdstdio$ptr_lval" in
12103 $define$define) val=$define ;;
12106 set d_stdio_ptr_lval
12109 : Can _cnt be used as an lvalue?
12110 case "$d_stdstdio$cnt_lval" in
12111 $define$define) val=$define ;;
12114 set d_stdio_cnt_lval
12118 : test whether setting _ptr sets _cnt as a side effect
12119 d_stdio_ptr_lval_sets_cnt="$undef"
12120 d_stdio_ptr_lval_nochange_cnt="$undef"
12121 case "$d_stdio_ptr_lval$d_stdstdio" in
12123 echo "Checking to see what happens if we set the stdio ptr..." >&4
12126 /* Can we scream? */
12127 /* Eat dust sed :-) */
12128 /* In the buffer space, no one can hear you scream. */
12129 #$i_stdlib I_STDLIB
12131 #include <stdlib.h>
12133 #define FILE_ptr(fp) $stdio_ptr
12134 #define FILE_cnt(fp) $stdio_cnt
12135 #include <sys/types.h>
12137 FILE *fp = fopen("try.c", "r");
12142 puts("Fail even to read");
12145 c = getc(fp); /* Read away the first # */
12147 puts("Fail even to read");
12151 18 <= FILE_cnt(fp) &&
12152 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12154 puts("Fail even to read");
12157 ptr = (char*) FILE_ptr(fp);
12158 cnt = (size_t)FILE_cnt(fp);
12160 FILE_ptr(fp) += 42;
12162 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12163 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12166 if (FILE_cnt(fp) <= 20) {
12167 printf ("Fail (<20 chars to test)");
12170 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12171 puts("Fail compare");
12174 if (cnt == FILE_cnt(fp)) {
12175 puts("Pass_unchanged");
12178 if (FILE_cnt(fp) == (cnt - 42)) {
12179 puts("Pass_changed");
12182 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12188 if eval $compile && $to try.c; then
12189 case `$run ./try` in
12191 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12192 d_stdio_ptr_lval_sets_cnt="$define" ;;
12194 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12195 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12197 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12199 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12202 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12208 : see if _base is also standard
12210 case "$d_stdstdio" in
12214 #$i_stdlib I_STDLIB
12216 #include <stdlib.h>
12218 #define FILE_base(fp) $stdio_base
12219 #define FILE_bufsiz(fp) $stdio_bufsiz
12221 FILE *fp = fopen("try.c", "r");
12224 19 <= FILE_bufsiz(fp) &&
12225 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12232 if eval $compile && $to try.c; then
12233 if $run ./try; then
12234 echo "And its _base field acts std."
12237 echo "But its _base field isn't std."
12240 echo "However, it seems to be lacking the _base field."
12248 : see if fast_stdio exists
12250 case "$d_stdstdio:$d_stdio_ptr_lval" in
12252 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12254 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12265 : see if fchdir exists
12266 set fchdir d_fchdir
12269 : see if fchmod exists
12270 set fchmod d_fchmod
12273 : see if fchown exists
12274 set fchown d_fchown
12277 : see if this is an fcntl system
12282 : See if fcntl-based locking works.
12284 #$i_stdlib I_STDLIB
12286 #include <stdlib.h>
12288 #include <unistd.h>
12290 #include <signal.h>
12291 $signal_t blech(x) int x; { exit(3); }
12293 #if defined(F_SETLK) && defined(F_SETLKW)
12294 struct flock flock;
12296 fd = open("try.c", O_RDONLY);
12297 flock.l_type = F_RDLCK;
12298 flock.l_whence = SEEK_SET;
12299 flock.l_start = flock.l_len = 0;
12300 signal(SIGALRM, blech);
12302 retval = fcntl(fd, F_SETLK, &flock);
12304 (retval < 0 ? exit(2) : exit(0));
12310 echo "Checking if fcntl-based file locking works... "
12314 if eval $compile_ok; then
12315 if $run ./try; then
12316 echo "Yes, it seems to work."
12319 echo "Nope, it didn't work."
12324 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12325 *** This is (almost) impossible.
12326 *** If your NFS lock daemons are not feeling well, something like
12327 *** this may happen, please investigate. Cannot continue, aborting.
12335 echo "I'm unable to compile the test program, so I'll assume not."
12340 echo "Nope, since you don't even have fcntl()."
12343 set d_fcntl_can_lock
12348 : check for fd_set items
12351 Checking to see how well your C compiler handles fd_set and friends ...
12354 #$i_stdlib I_STDLIB
12356 #include <stdlib.h>
12358 #$i_systime I_SYS_TIME
12359 #$i_sysselct I_SYS_SELECT
12360 #$d_socket HAS_SOCKET
12361 #include <sys/types.h>
12363 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12366 #include <sys/time.h>
12368 #ifdef I_SYS_SELECT
12369 #include <sys/select.h>
12378 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12386 if eval $compile; then
12387 d_fds_bits="$define"
12389 echo "Well, your system knows about the normal fd_set typedef..." >&4
12390 if $run ./try; then
12391 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12392 d_fd_macros="$define"
12395 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12397 d_fd_macros="$undef"
12401 Hmm, your compiler has some difficulty with fd_set. Checking further...
12404 if eval $compile; then
12405 d_fds_bits="$undef"
12407 echo "Well, your system has some sort of fd_set available..." >&4
12408 if $run ./try; then
12409 echo "and you have the normal fd_set macros." >&4
12410 d_fd_macros="$define"
12413 but not the normal fd_set macros! Gross! More work for me...
12415 d_fd_macros="$undef"
12418 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12420 d_fds_bits="$undef"
12421 d_fd_macros="$undef"
12426 : see if fgetpos exists
12427 set fgetpos d_fgetpos
12430 : see if finite exists
12431 set finite d_finite
12434 : see if finitel exists
12435 set finitel d_finitel
12438 : see if flock exists
12442 : see if prototype for flock is available
12444 set d_flockproto flock $i_sysfile sys/file.h
12447 : see if fork exists
12451 : see if fp_class exists
12452 set fp_class d_fp_class
12455 : see if pathconf exists
12456 set pathconf d_pathconf
12459 : see if fpathconf exists
12460 set fpathconf d_fpathconf
12463 : see if fpclass exists
12464 set fpclass d_fpclass
12467 : see if fpclassify exists
12468 set fpclassify d_fpclassify
12471 : see if fpclassl exists
12472 set fpclassl d_fpclassl
12476 : check for fpos64_t
12478 echo "Checking to see if you have fpos64_t..." >&4
12481 int main() { fpos64_t x = 7; }
12484 if eval $compile; then
12486 echo "You have fpos64_t."
12489 echo "You do not have fpos64_t."
12490 case "$fpossize" in
12491 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12498 : see if frexpl exists
12499 set frexpl d_frexpl
12502 : see if this is a sys/param system
12503 set sys/param.h i_sysparam
12506 : see if this is a sys/mount.h system
12507 set sys/mount.h i_sysmount
12512 echo "Checking to see if your system supports struct fs_data..." >&4
12513 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12515 case "$d_fs_data_s" in
12516 "$define") echo "Yes, it does." ;;
12517 *) echo "No, it doesn't." ;;
12520 : see if fseeko exists
12521 set fseeko d_fseeko
12523 case "$longsize" in
12524 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12527 : see if fsetpos exists
12528 set fsetpos d_fsetpos
12532 : see if fstatfs exists
12533 set fstatfs d_fstatfs
12537 : see if statvfs exists
12538 set statvfs d_statvfs
12541 : see if fstatvfs exists
12542 set fstatvfs d_fstatvfs
12546 : see if fsync exists
12550 : see if ftello exists
12551 set ftello d_ftello
12553 case "$longsize" in
12554 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12557 : see if getcwd exists
12558 set getcwd d_getcwd
12561 : see if getespwnam exists
12562 set getespwnam d_getespwnam
12566 : see if getfsstat exists
12567 set getfsstat d_getfsstat
12570 : see if getgrent exists
12571 set getgrent d_getgrent
12574 : see if getgrent_r exists
12575 set getgrent_r d_getgrent_r
12577 case "$d_getgrent_r" in
12579 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12580 case "$d_getgrent_r_proto:$usethreads" in
12581 ":define") d_getgrent_r_proto=define
12582 set d_getgrent_r_proto getgrent_r $hdrs
12586 case "$d_getgrent_r_proto" in
12588 case "$getgrent_r_proto" in
12589 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12590 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12592 case "$getgrent_r_proto" in
12593 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12594 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12596 case "$getgrent_r_proto" in
12597 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12598 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12600 case "$getgrent_r_proto" in
12601 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12602 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12604 case "$getgrent_r_proto" in
12605 ''|0) try='int getgrent_r(struct group*, char*, int);'
12606 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12608 case "$getgrent_r_proto" in
12609 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12610 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12612 case "$getgrent_r_proto" in
12613 ''|0) d_getgrent_r=undef
12615 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12616 * ) case "$getgrent_r_proto" in
12617 REENTRANT_PROTO*) ;;
12618 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12620 echo "Prototype: $try" ;;
12623 *) case "$usethreads" in
12624 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12631 *) getgrent_r_proto=0
12635 : see if getgrgid_r exists
12636 set getgrgid_r d_getgrgid_r
12638 case "$d_getgrgid_r" in
12640 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12641 case "$d_getgrgid_r_proto:$usethreads" in
12642 ":define") d_getgrgid_r_proto=define
12643 set d_getgrgid_r_proto getgrgid_r $hdrs
12647 case "$d_getgrgid_r_proto" in
12649 case "$getgrgid_r_proto" in
12650 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12651 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12653 case "$getgrgid_r_proto" in
12654 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12655 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12657 case "$getgrgid_r_proto" in
12658 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12659 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12661 case "$getgrgid_r_proto" in
12662 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12663 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12665 case "$getgrgid_r_proto" in
12666 ''|0) d_getgrgid_r=undef
12668 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12669 * ) case "$getgrgid_r_proto" in
12670 REENTRANT_PROTO*) ;;
12671 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12673 echo "Prototype: $try" ;;
12676 *) case "$usethreads" in
12677 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12684 *) getgrgid_r_proto=0
12688 : see if getgrnam_r exists
12689 set getgrnam_r d_getgrnam_r
12691 case "$d_getgrnam_r" in
12693 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12694 case "$d_getgrnam_r_proto:$usethreads" in
12695 ":define") d_getgrnam_r_proto=define
12696 set d_getgrnam_r_proto getgrnam_r $hdrs
12700 case "$d_getgrnam_r_proto" in
12702 case "$getgrnam_r_proto" in
12703 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12704 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12706 case "$getgrnam_r_proto" in
12707 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12708 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12710 case "$getgrnam_r_proto" in
12711 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12712 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12714 case "$getgrnam_r_proto" in
12715 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12716 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12718 case "$getgrnam_r_proto" in
12719 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12720 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12722 case "$getgrnam_r_proto" in
12723 ''|0) d_getgrnam_r=undef
12725 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12726 * ) case "$getgrnam_r_proto" in
12727 REENTRANT_PROTO*) ;;
12728 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12730 echo "Prototype: $try" ;;
12733 *) case "$usethreads" in
12734 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12741 *) getgrnam_r_proto=0
12745 : see if gethostbyaddr exists
12746 set gethostbyaddr d_gethbyaddr
12749 : see if gethostbyname exists
12750 set gethostbyname d_gethbyname
12753 : see if gethostent exists
12754 set gethostent d_gethent
12757 : see how we will look up host name
12760 if set gethostname val -f d_gethname; eval $csym; $val; then
12761 echo 'gethostname() found.' >&4
12762 d_gethname="$define"
12765 if set uname val -f d_uname; eval $csym; $val; then
12768 uname() was found, but you're running xenix, and older versions of xenix
12769 have a broken uname(). If you don't really know whether your xenix is old
12770 enough to have a broken system call, use the default answer.
12775 "$define") dflt=n;;
12777 rp='Is your uname() broken?'
12780 n*) d_uname="$define"; call=uname;;
12783 echo 'uname() found.' >&4
12790 case "$d_gethname" in
12791 '') d_gethname="$undef";;
12794 '') d_uname="$undef";;
12796 case "$d_uname$d_gethname" in
12801 Every now and then someone has a $call() that lies about the hostname
12802 but can't be fixed for political or economic reasons. If you wish, I can
12803 pretend $call() isn't there and maybe compute hostname at run-time
12804 thanks to the '$phostname' command.
12807 rp="Shall I ignore $call() from now on?"
12810 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12813 case "$phostname" in
12814 '') aphostname='';;
12815 *) case "$aphostname" in
12817 *) set X $phostname
12821 file=`./loc $file $file $pth`
12822 aphostname=`echo $file $*`
12827 case "$d_uname$d_gethname" in
12830 case "$phostname" in
12832 echo "There will be no way for $package to get your hostname." >&4;;
12834 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12838 case "$d_phostname" in
12839 '') d_phostname="$undef";;
12842 : see if gethostbyaddr_r exists
12843 set gethostbyaddr_r d_gethostbyaddr_r
12845 case "$d_gethostbyaddr_r" in
12847 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12848 case "$d_gethostbyaddr_r_proto:$usethreads" in
12849 ":define") d_gethostbyaddr_r_proto=define
12850 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12854 case "$d_gethostbyaddr_r_proto" in
12856 case "$gethostbyaddr_r_proto" in
12857 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12858 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12860 case "$gethostbyaddr_r_proto" in
12861 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12862 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12864 case "$gethostbyaddr_r_proto" in
12865 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12866 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12868 case "$gethostbyaddr_r_proto" in
12869 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12870 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12872 case "$gethostbyaddr_r_proto" in
12873 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12874 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12876 case "$gethostbyaddr_r_proto" in
12877 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12878 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12880 case "$gethostbyaddr_r_proto" in
12881 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12882 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12884 case "$gethostbyaddr_r_proto" in
12885 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12886 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12888 case "$gethostbyaddr_r_proto" in
12889 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12890 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12892 case "$gethostbyaddr_r_proto" in
12893 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12894 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12896 case "$gethostbyaddr_r_proto" in
12897 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12898 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12900 case "$gethostbyaddr_r_proto" in
12901 ''|0) d_gethostbyaddr_r=undef
12902 gethostbyaddr_r_proto=0
12903 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12904 * ) case "$gethostbyaddr_r_proto" in
12905 REENTRANT_PROTO*) ;;
12906 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12908 echo "Prototype: $try" ;;
12911 *) case "$usethreads" in
12912 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12914 d_gethostbyaddr_r=undef
12915 gethostbyaddr_r_proto=0
12919 *) gethostbyaddr_r_proto=0
12923 : see if gethostbyname_r exists
12924 set gethostbyname_r d_gethostbyname_r
12926 case "$d_gethostbyname_r" in
12928 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12929 case "$d_gethostbyname_r_proto:$usethreads" in
12930 ":define") d_gethostbyname_r_proto=define
12931 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12935 case "$d_gethostbyname_r_proto" in
12937 case "$gethostbyname_r_proto" in
12938 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12939 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12941 case "$gethostbyname_r_proto" in
12942 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12943 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12945 case "$gethostbyname_r_proto" in
12946 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12947 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12949 case "$gethostbyname_r_proto" in
12950 ''|0) d_gethostbyname_r=undef
12951 gethostbyname_r_proto=0
12952 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12953 * ) case "$gethostbyname_r_proto" in
12954 REENTRANT_PROTO*) ;;
12955 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12957 echo "Prototype: $try" ;;
12960 *) case "$usethreads" in
12961 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12963 d_gethostbyname_r=undef
12964 gethostbyname_r_proto=0
12968 *) gethostbyname_r_proto=0
12972 : see if gethostent_r exists
12973 set gethostent_r d_gethostent_r
12975 case "$d_gethostent_r" in
12977 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12978 case "$d_gethostent_r_proto:$usethreads" in
12979 ":define") d_gethostent_r_proto=define
12980 set d_gethostent_r_proto gethostent_r $hdrs
12984 case "$d_gethostent_r_proto" in
12986 case "$gethostent_r_proto" in
12987 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12988 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12990 case "$gethostent_r_proto" in
12991 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12992 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12994 case "$gethostent_r_proto" in
12995 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12996 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12998 case "$gethostent_r_proto" in
12999 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13000 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13002 case "$gethostent_r_proto" in
13003 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13004 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13006 case "$gethostent_r_proto" in
13007 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13008 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13010 case "$gethostent_r_proto" in
13011 ''|0) d_gethostent_r=undef
13012 gethostent_r_proto=0
13013 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13014 * ) case "$gethostent_r_proto" in
13015 REENTRANT_PROTO*) ;;
13016 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13018 echo "Prototype: $try" ;;
13021 *) case "$usethreads" in
13022 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13024 d_gethostent_r=undef
13025 gethostent_r_proto=0
13029 *) gethostent_r_proto=0
13033 : see if prototypes for various gethostxxx netdb.h functions are available
13035 set d_gethostprotos gethostent $i_netdb netdb.h
13038 : see if getitimer exists
13039 set getitimer d_getitimer
13042 : see if getlogin exists
13043 set getlogin d_getlogin
13046 : see if getlogin_r exists
13047 set getlogin_r d_getlogin_r
13049 case "$d_getlogin_r" in
13051 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13052 case "$d_getlogin_r_proto:$usethreads" in
13053 ":define") d_getlogin_r_proto=define
13054 set d_getlogin_r_proto getlogin_r $hdrs
13058 case "$d_getlogin_r_proto" in
13060 case "$getlogin_r_proto" in
13061 ''|0) try='int getlogin_r(char*, size_t);'
13062 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13064 case "$getlogin_r_proto" in
13065 ''|0) try='int getlogin_r(char*, int);'
13066 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13068 case "$getlogin_r_proto" in
13069 ''|0) try='char* getlogin_r(char*, size_t);'
13070 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13072 case "$getlogin_r_proto" in
13073 ''|0) try='char* getlogin_r(char*, int);'
13074 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13076 case "$getlogin_r_proto" in
13077 ''|0) d_getlogin_r=undef
13079 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13080 * ) case "$getlogin_r_proto" in
13081 REENTRANT_PROTO*) ;;
13082 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13084 echo "Prototype: $try" ;;
13087 *) case "$usethreads" in
13088 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13095 *) getlogin_r_proto=0
13099 : see if getmnt exists
13100 set getmnt d_getmnt
13103 : see if getmntent exists
13104 set getmntent d_getmntent
13107 : see if getnetbyaddr exists
13108 set getnetbyaddr d_getnbyaddr
13111 : see if getnetbyname exists
13112 set getnetbyname d_getnbyname
13115 : see if getnetent exists
13116 set getnetent d_getnent
13119 : see if getnetbyaddr_r exists
13120 set getnetbyaddr_r d_getnetbyaddr_r
13122 case "$d_getnetbyaddr_r" in
13124 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13125 case "$d_getnetbyaddr_r_proto:$usethreads" in
13126 ":define") d_getnetbyaddr_r_proto=define
13127 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13131 case "$d_getnetbyaddr_r_proto" in
13133 case "$getnetbyaddr_r_proto" in
13134 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13135 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13137 case "$getnetbyaddr_r_proto" in
13138 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13139 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13141 case "$getnetbyaddr_r_proto" in
13142 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13143 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13145 case "$getnetbyaddr_r_proto" in
13146 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13147 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13149 case "$getnetbyaddr_r_proto" in
13150 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13151 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13153 case "$getnetbyaddr_r_proto" in
13154 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13155 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13157 case "$getnetbyaddr_r_proto" in
13158 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13159 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13161 case "$getnetbyaddr_r_proto" in
13162 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13163 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13165 case "$getnetbyaddr_r_proto" in
13166 ''|0) d_getnetbyaddr_r=undef
13167 getnetbyaddr_r_proto=0
13168 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13169 * ) case "$getnetbyaddr_r_proto" in
13170 REENTRANT_PROTO*) ;;
13171 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13173 echo "Prototype: $try" ;;
13176 *) case "$usethreads" in
13177 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13179 d_getnetbyaddr_r=undef
13180 getnetbyaddr_r_proto=0
13184 *) getnetbyaddr_r_proto=0
13188 : see if getnetbyname_r exists
13189 set getnetbyname_r d_getnetbyname_r
13191 case "$d_getnetbyname_r" in
13193 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13194 case "$d_getnetbyname_r_proto:$usethreads" in
13195 ":define") d_getnetbyname_r_proto=define
13196 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13200 case "$d_getnetbyname_r_proto" in
13202 case "$getnetbyname_r_proto" in
13203 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13204 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13206 case "$getnetbyname_r_proto" in
13207 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13208 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13210 case "$getnetbyname_r_proto" in
13211 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13212 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13214 case "$getnetbyname_r_proto" in
13215 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13216 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13218 case "$getnetbyname_r_proto" in
13219 ''|0) d_getnetbyname_r=undef
13220 getnetbyname_r_proto=0
13221 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13222 * ) case "$getnetbyname_r_proto" in
13223 REENTRANT_PROTO*) ;;
13224 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13226 echo "Prototype: $try" ;;
13229 *) case "$usethreads" in
13230 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13232 d_getnetbyname_r=undef
13233 getnetbyname_r_proto=0
13237 *) getnetbyname_r_proto=0
13241 : see if getnetent_r exists
13242 set getnetent_r d_getnetent_r
13244 case "$d_getnetent_r" in
13246 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13247 case "$d_getnetent_r_proto:$usethreads" in
13248 ":define") d_getnetent_r_proto=define
13249 set d_getnetent_r_proto getnetent_r $hdrs
13253 case "$d_getnetent_r_proto" in
13255 case "$getnetent_r_proto" in
13256 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13257 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13259 case "$getnetent_r_proto" in
13260 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13261 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13263 case "$getnetent_r_proto" in
13264 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13265 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13267 case "$getnetent_r_proto" in
13268 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13269 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13271 case "$getnetent_r_proto" in
13272 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13273 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13275 case "$getnetent_r_proto" in
13276 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13277 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13279 case "$getnetent_r_proto" in
13280 ''|0) d_getnetent_r=undef
13281 getnetent_r_proto=0
13282 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13283 * ) case "$getnetent_r_proto" in
13284 REENTRANT_PROTO*) ;;
13285 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13287 echo "Prototype: $try" ;;
13290 *) case "$usethreads" in
13291 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13293 d_getnetent_r=undef
13294 getnetent_r_proto=0
13298 *) getnetent_r_proto=0
13302 : see if prototypes for various getnetxxx netdb.h functions are available
13304 set d_getnetprotos getnetent $i_netdb netdb.h
13307 : see if getpagesize exists
13308 set getpagesize d_getpagsz
13312 : see if getprotobyname exists
13313 set getprotobyname d_getpbyname
13316 : see if getprotobynumber exists
13317 set getprotobynumber d_getpbynumber
13320 : see if getprotoent exists
13321 set getprotoent d_getpent
13324 : see if getpgid exists
13325 set getpgid d_getpgid
13328 : see if getpgrp2 exists
13329 set getpgrp2 d_getpgrp2
13332 : see if getppid exists
13333 set getppid d_getppid
13336 : see if getpriority exists
13337 set getpriority d_getprior
13340 : see if getprotobyname_r exists
13341 set getprotobyname_r d_getprotobyname_r
13343 case "$d_getprotobyname_r" in
13345 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13346 case "$d_getprotobyname_r_proto:$usethreads" in
13347 ":define") d_getprotobyname_r_proto=define
13348 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13352 case "$d_getprotobyname_r_proto" in
13354 case "$getprotobyname_r_proto" in
13355 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13356 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13358 case "$getprotobyname_r_proto" in
13359 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13360 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13362 case "$getprotobyname_r_proto" in
13363 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13364 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13366 case "$getprotobyname_r_proto" in
13367 ''|0) d_getprotobyname_r=undef
13368 getprotobyname_r_proto=0
13369 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13370 * ) case "$getprotobyname_r_proto" in
13371 REENTRANT_PROTO*) ;;
13372 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13374 echo "Prototype: $try" ;;
13377 *) case "$usethreads" in
13378 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13380 d_getprotobyname_r=undef
13381 getprotobyname_r_proto=0
13385 *) getprotobyname_r_proto=0
13389 : see if getprotobynumber_r exists
13390 set getprotobynumber_r d_getprotobynumber_r
13392 case "$d_getprotobynumber_r" in
13394 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13395 case "$d_getprotobynumber_r_proto:$usethreads" in
13396 ":define") d_getprotobynumber_r_proto=define
13397 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13401 case "$d_getprotobynumber_r_proto" in
13403 case "$getprotobynumber_r_proto" in
13404 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13405 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13407 case "$getprotobynumber_r_proto" in
13408 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13409 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13411 case "$getprotobynumber_r_proto" in
13412 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13413 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13415 case "$getprotobynumber_r_proto" in
13416 ''|0) d_getprotobynumber_r=undef
13417 getprotobynumber_r_proto=0
13418 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13419 * ) case "$getprotobynumber_r_proto" in
13420 REENTRANT_PROTO*) ;;
13421 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13423 echo "Prototype: $try" ;;
13426 *) case "$usethreads" in
13427 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13429 d_getprotobynumber_r=undef
13430 getprotobynumber_r_proto=0
13434 *) getprotobynumber_r_proto=0
13438 : see if getprotoent_r exists
13439 set getprotoent_r d_getprotoent_r
13441 case "$d_getprotoent_r" in
13443 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13444 case "$d_getprotoent_r_proto:$usethreads" in
13445 ":define") d_getprotoent_r_proto=define
13446 set d_getprotoent_r_proto getprotoent_r $hdrs
13450 case "$d_getprotoent_r_proto" in
13452 case "$getprotoent_r_proto" in
13453 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13454 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13456 case "$getprotoent_r_proto" in
13457 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13458 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13460 case "$getprotoent_r_proto" in
13461 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13462 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13464 case "$getprotoent_r_proto" in
13465 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13466 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13468 case "$getprotoent_r_proto" in
13469 ''|0) d_getprotoent_r=undef
13470 getprotoent_r_proto=0
13471 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13472 * ) case "$getprotoent_r_proto" in
13473 REENTRANT_PROTO*) ;;
13474 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13476 echo "Prototype: $try" ;;
13479 *) case "$usethreads" in
13480 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13482 d_getprotoent_r=undef
13483 getprotoent_r_proto=0
13487 *) getprotoent_r_proto=0
13491 : see if prototypes for various getprotoxxx netdb.h functions are available
13493 set d_getprotoprotos getprotoent $i_netdb netdb.h
13496 : see if getprpwnam exists
13497 set getprpwnam d_getprpwnam
13500 : see if getpwent exists
13501 set getpwent d_getpwent
13504 : see if getpwent_r exists
13505 set getpwent_r d_getpwent_r
13507 case "$d_getpwent_r" in
13509 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13510 case "$d_getpwent_r_proto:$usethreads" in
13511 ":define") d_getpwent_r_proto=define
13512 set d_getpwent_r_proto getpwent_r $hdrs
13516 case "$d_getpwent_r_proto" in
13518 case "$getpwent_r_proto" in
13519 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13520 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13522 case "$getpwent_r_proto" in
13523 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13524 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13526 case "$getpwent_r_proto" in
13527 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13528 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13530 case "$getpwent_r_proto" in
13531 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13532 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13534 case "$getpwent_r_proto" in
13535 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13536 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13538 case "$getpwent_r_proto" in
13539 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13540 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13542 case "$getpwent_r_proto" in
13543 ''|0) d_getpwent_r=undef
13545 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13546 * ) case "$getpwent_r_proto" in
13547 REENTRANT_PROTO*) ;;
13548 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13550 echo "Prototype: $try" ;;
13553 *) case "$usethreads" in
13554 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13561 *) getpwent_r_proto=0
13565 : see if getpwnam_r exists
13566 set getpwnam_r d_getpwnam_r
13568 case "$d_getpwnam_r" in
13570 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13571 case "$d_getpwnam_r_proto:$usethreads" in
13572 ":define") d_getpwnam_r_proto=define
13573 set d_getpwnam_r_proto getpwnam_r $hdrs
13577 case "$d_getpwnam_r_proto" in
13579 case "$getpwnam_r_proto" in
13580 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13581 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13583 case "$getpwnam_r_proto" in
13584 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13585 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13587 case "$getpwnam_r_proto" in
13588 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13589 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13591 case "$getpwnam_r_proto" in
13592 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13593 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13595 case "$getpwnam_r_proto" in
13596 ''|0) d_getpwnam_r=undef
13598 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13599 * ) case "$getpwnam_r_proto" in
13600 REENTRANT_PROTO*) ;;
13601 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13603 echo "Prototype: $try" ;;
13606 *) case "$usethreads" in
13607 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13614 *) getpwnam_r_proto=0
13618 : see if getpwuid_r exists
13619 set getpwuid_r d_getpwuid_r
13621 case "$d_getpwuid_r" in
13623 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13624 case "$d_getpwuid_r_proto:$usethreads" in
13625 ":define") d_getpwuid_r_proto=define
13626 set d_getpwuid_r_proto getpwuid_r $hdrs
13630 case "$d_getpwuid_r_proto" in
13632 case "$getpwuid_r_proto" in
13633 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13634 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13636 case "$getpwuid_r_proto" in
13637 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13638 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13640 case "$getpwuid_r_proto" in
13641 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13642 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13644 case "$getpwuid_r_proto" in
13645 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13646 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13648 case "$getpwuid_r_proto" in
13649 ''|0) d_getpwuid_r=undef
13651 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13652 * ) case "$getpwuid_r_proto" in
13653 REENTRANT_PROTO*) ;;
13654 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13656 echo "Prototype: $try" ;;
13659 *) case "$usethreads" in
13660 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13667 *) getpwuid_r_proto=0
13672 : see if getservbyname exists
13673 set getservbyname d_getsbyname
13676 : see if getservbyport exists
13677 set getservbyport d_getsbyport
13680 : see if getservent exists
13681 set getservent d_getsent
13684 : see if getservbyname_r exists
13685 set getservbyname_r d_getservbyname_r
13687 case "$d_getservbyname_r" in
13689 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13690 case "$d_getservbyname_r_proto:$usethreads" in
13691 ":define") d_getservbyname_r_proto=define
13692 set d_getservbyname_r_proto getservbyname_r $hdrs
13696 case "$d_getservbyname_r_proto" in
13698 case "$getservbyname_r_proto" in
13699 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13700 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13702 case "$getservbyname_r_proto" in
13703 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13704 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13706 case "$getservbyname_r_proto" in
13707 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13708 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13710 case "$getservbyname_r_proto" in
13711 ''|0) d_getservbyname_r=undef
13712 getservbyname_r_proto=0
13713 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13714 * ) case "$getservbyname_r_proto" in
13715 REENTRANT_PROTO*) ;;
13716 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13718 echo "Prototype: $try" ;;
13721 *) case "$usethreads" in
13722 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13724 d_getservbyname_r=undef
13725 getservbyname_r_proto=0
13729 *) getservbyname_r_proto=0
13733 : see if getservbyport_r exists
13734 set getservbyport_r d_getservbyport_r
13736 case "$d_getservbyport_r" in
13738 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13739 case "$d_getservbyport_r_proto:$usethreads" in
13740 ":define") d_getservbyport_r_proto=define
13741 set d_getservbyport_r_proto getservbyport_r $hdrs
13745 case "$d_getservbyport_r_proto" in
13747 case "$getservbyport_r_proto" in
13748 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13749 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13751 case "$getservbyport_r_proto" in
13752 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13753 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13755 case "$getservbyport_r_proto" in
13756 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13757 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13759 case "$getservbyport_r_proto" in
13760 ''|0) d_getservbyport_r=undef
13761 getservbyport_r_proto=0
13762 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13763 * ) case "$getservbyport_r_proto" in
13764 REENTRANT_PROTO*) ;;
13765 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13767 echo "Prototype: $try" ;;
13770 *) case "$usethreads" in
13771 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13773 d_getservbyport_r=undef
13774 getservbyport_r_proto=0
13778 *) getservbyport_r_proto=0
13782 : see if getservent_r exists
13783 set getservent_r d_getservent_r
13785 case "$d_getservent_r" in
13787 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13788 case "$d_getservent_r_proto:$usethreads" in
13789 ":define") d_getservent_r_proto=define
13790 set d_getservent_r_proto getservent_r $hdrs
13794 case "$d_getservent_r_proto" in
13796 case "$getservent_r_proto" in
13797 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13798 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13800 case "$getservent_r_proto" in
13801 ''|0) try='int getservent_r(struct servent*, char*, int);'
13802 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13804 case "$getservent_r_proto" in
13805 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13806 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13808 case "$getservent_r_proto" in
13809 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13810 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13812 case "$getservent_r_proto" in
13813 ''|0) d_getservent_r=undef
13814 getservent_r_proto=0
13815 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13816 * ) case "$getservent_r_proto" in
13817 REENTRANT_PROTO*) ;;
13818 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13820 echo "Prototype: $try" ;;
13823 *) case "$usethreads" in
13824 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13826 d_getservent_r=undef
13827 getservent_r_proto=0
13831 *) getservent_r_proto=0
13835 : see if prototypes for various getservxxx netdb.h functions are available
13837 set d_getservprotos getservent $i_netdb netdb.h
13840 : see if getspnam exists
13841 set getspnam d_getspnam
13844 : see if this is a shadow.h system
13845 set shadow.h i_shadow
13848 : see if getspnam_r exists
13849 set getspnam_r d_getspnam_r
13851 case "$d_getspnam_r" in
13853 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13854 case "$d_getspnam_r_proto:$usethreads" in
13855 ":define") d_getspnam_r_proto=define
13856 set d_getspnam_r_proto getspnam_r $hdrs
13860 case "$d_getspnam_r_proto" in
13862 case "$getspnam_r_proto" in
13863 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13864 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13866 case "$getspnam_r_proto" in
13867 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13868 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13870 case "$getspnam_r_proto" in
13871 ''|0) d_getspnam_r=undef
13873 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13874 * ) case "$getspnam_r_proto" in
13875 REENTRANT_PROTO*) ;;
13876 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13878 echo "Prototype: $try" ;;
13881 *) case "$usethreads" in
13882 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13889 *) getspnam_r_proto=0
13893 : see if gettimeofday or ftime exists
13894 set gettimeofday d_gettimeod
13896 case "$d_gettimeod" in
13902 val="$undef"; set d_ftime; eval $setvar
13905 case "$d_gettimeod$d_ftime" in
13908 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13912 : see if gmtime_r exists
13913 set gmtime_r d_gmtime_r
13915 case "$d_gmtime_r" in
13917 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13918 case "$d_gmtime_r_proto:$usethreads" in
13919 ":define") d_gmtime_r_proto=define
13920 set d_gmtime_r_proto gmtime_r $hdrs
13924 case "$d_gmtime_r_proto" in
13926 case "$gmtime_r_proto" in
13927 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13928 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13930 case "$gmtime_r_proto" in
13931 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13932 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13934 case "$gmtime_r_proto" in
13935 ''|0) d_gmtime_r=undef
13937 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13938 * ) case "$gmtime_r_proto" in
13939 REENTRANT_PROTO*) ;;
13940 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13942 echo "Prototype: $try" ;;
13945 *) case "$usethreads" in
13946 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13953 *) gmtime_r_proto=0
13957 : see if hasmntopt exists
13958 set hasmntopt d_hasmntopt
13961 : see if this is a netinet/in.h or sys/in.h system
13962 set netinet/in.h i_niin sys/in.h i_sysin
13965 : see if arpa/inet.h has to be included
13966 set arpa/inet.h i_arpainet
13969 : see if htonl --and friends-- exists
13974 : Maybe they are macros.
13977 $cat >htonl.c <<EOM
13979 #include <sys/types.h>
13980 #$i_niin I_NETINET_IN
13982 #$i_arpainet I_ARPA_INET
13983 #ifdef I_NETINET_IN
13984 #include <netinet/in.h>
13987 #include <sys/in.h>
13990 #include <arpa/inet.h>
13993 printf("Defined as a macro.");
13996 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13997 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13999 echo "But it seems to be defined as a macro." >&4
14007 : see if ilogbl exists
14008 set ilogbl d_ilogbl
14013 if set index val -f; eval $csym; $val; then
14014 if set strchr val -f d_strchr; eval $csym; $val; then
14015 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14018 echo "strchr() found." >&4
14022 echo "index() found." >&4
14027 echo "index() found." >&4
14030 if set strchr val -f d_strchr; eval $csym; $val; then
14033 echo "strchr() found." >&4
14035 echo "No index() or strchr() found!" >&4
14040 set d_strchr; eval $setvar
14042 set d_index; eval $setvar
14044 : check whether inet_aton exists
14045 set inet_aton d_inetaton
14050 $cat >isascii.c <<EOCP
14053 #$i_stdlib I_STDLIB
14055 #include <stdlib.h>
14066 if eval $compile; then
14067 echo "isascii() found." >&4
14070 echo "isascii() NOT found." >&4
14077 : see if isfinite exists
14078 set isfinite d_isfinite
14081 : see if isinf exists
14085 : see if isnan exists
14089 : see if isnanl exists
14090 set isnanl d_isnanl
14093 : see if killpg exists
14094 set killpg d_killpg
14097 : see if lchown exists
14099 $cat > try.c <<'EOCP'
14100 /* System header to define __stub macros and hopefully few prototypes,
14101 which can conflict with char lchown(); below. */
14102 #include <assert.h>
14103 /* Override any gcc2 internal prototype to avoid an error. */
14104 /* We use char because int might match the return type of a gcc2
14105 builtin and then its argument prototype would still apply. */
14108 /* The GNU C library defines this for functions which it implements
14109 to always fail with ENOSYS. Some functions are actually named
14110 something starting with __ and the normal name is an alias. */
14111 #if defined (__stub_lchown) || defined (__stub___lchown)
14119 if eval $compile; then
14120 $echo "lchown() found." >&4
14123 $echo "lchown() NOT found." >&4
14129 : See if number of significant digits in a double precision number is known
14131 $cat >ldbl_dig.c <<EOM
14132 #$i_limits I_LIMITS
14135 #include <limits.h>
14141 printf("Contains LDBL_DIG");
14144 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14145 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14146 echo "LDBL_DIG found." >&4
14149 echo "LDBL_DIG NOT found." >&4
14156 : see if this is a math.h system
14160 d_libm_lib_version="$undef"
14163 : check to see if math.h defines _LIB_VERSION
14165 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14167 #include <unistd.h>
14169 int main (int argc, char *argv[])
14171 printf ("%d\n", _LIB_VERSION);
14176 if eval $compile; then
14178 echo "Yes, it does ($foo)" >&4
14179 d_libm_lib_version="$define"
14181 echo "No, it does not (probably harmless)\n" >&4
14183 $rm -f try.* try core core.try.*
14188 : see if link exists
14192 : see if localtime_r exists
14193 set localtime_r d_localtime_r
14195 case "$d_localtime_r" in
14197 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14198 case "$d_localtime_r_proto:$usethreads" in
14199 ":define") d_localtime_r_proto=define
14200 set d_localtime_r_proto localtime_r $hdrs
14204 case "$d_localtime_r_proto" in
14206 case "$localtime_r_proto" in
14207 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14208 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14210 case "$localtime_r_proto" in
14211 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14212 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14214 case "$localtime_r_proto" in
14215 ''|0) d_localtime_r=undef
14216 localtime_r_proto=0
14217 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14218 * ) case "$localtime_r_proto" in
14219 REENTRANT_PROTO*) ;;
14220 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14222 echo "Prototype: $try" ;;
14225 *) case "$usethreads" in
14226 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14228 d_localtime_r=undef
14229 localtime_r_proto=0
14233 *) localtime_r_proto=0
14237 : see if localeconv exists
14238 set localeconv d_locconv
14241 : see if lockf exists
14245 : see if prototype for lseek is available
14247 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14250 : see if lstat exists
14254 : see if madvise exists
14255 set madvise d_madvise
14258 : see if malloc_size exists
14259 set malloc_size d_malloc_size
14262 : see if malloc_size_good exists
14263 set malloc_good_size d_malloc_good_size
14266 : see if mblen exists
14270 : see if mbstowcs exists
14271 set mbstowcs d_mbstowcs
14274 : see if mbtowc exists
14275 set mbtowc d_mbtowc
14278 : see if memchr exists
14279 set memchr d_memchr
14282 : see if memcmp exists
14283 set memcmp d_memcmp
14286 : see if memcpy exists
14287 set memcpy d_memcpy
14290 : see if memmove exists
14291 set memmove d_memmove
14294 : see if memset exists
14295 set memset d_memset
14298 : see if mkdir exists
14302 : see if mkdtemp exists
14303 set mkdtemp d_mkdtemp
14306 : see if mkfifo exists
14307 set mkfifo d_mkfifo
14310 : see if mkstemp exists
14311 set mkstemp d_mkstemp
14314 : see if mkstemps exists
14315 set mkstemps d_mkstemps
14318 : see if mktime exists
14319 set mktime d_mktime
14322 : see if this is a sys/mman.h system
14323 set sys/mman.h i_sysmman
14326 : see if mmap exists
14329 : see what shmat returns
14330 : default to something harmless
14332 case "$i_sysmman$d_mmap" in
14334 $cat >mmap.c <<'END'
14335 #include <sys/mman.h>
14338 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14343 echo "and it returns ($mmaptype)." >&4
14349 : see if sqrtl exists
14353 : see if scalbnl exists
14354 set scalbnl d_scalbnl
14357 : see if modfl exists
14361 : see if prototype for modfl is available
14363 set d_modflproto modfl $i_math math.h
14366 d_modfl_pow32_bug="$undef"
14368 case "$d_longdbl$d_modfl" in
14371 Checking to see whether your modfl() is okay for large values...
14377 if $test "X$d_modflproto" != "X$define"; then
14378 $cat >>try.c <<EOCP
14379 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14380 long double modfl (long double, long double *);
14383 $cat >>try.c <<EOCP
14385 long double nv = 4294967303.15;
14391 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14395 case "$osname:$gccversion" in
14396 aix:) saveccflags="$ccflags"
14397 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14400 if eval $compile; then
14403 *" 4294967303.150000 1.150000 4294967302.000000")
14404 echo >&4 "Your modfl() is broken for large values."
14405 d_modfl_pow32_bug="$define"
14407 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14411 *" 4294967303.150000 0.150000 4294967303.000000")
14412 echo >&4 "Your modfl() seems okay for large values."
14414 *) echo >&4 "I don't understand your modfl() at all."
14418 $rm -f try.* try core core.try.*
14420 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14423 case "$osname:$gccversion" in
14424 aix:) ccflags="$saveccflags" ;; # restore
14429 if $test "$uselongdouble" = "$define"; then
14431 if $test "$d_sqrtl" != "$define"; then
14432 message="$message sqrtl"
14434 if $test "$d_modfl" != "$define"; then
14435 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14436 echo "You have both aintl and copysignl, so I can emulate modfl."
14438 message="$message modfl"
14441 if $test "$d_frexpl" != "$define"; then
14442 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14443 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14445 message="$message frexpl"
14449 if $test "$message" != ""; then
14452 *** You requested the use of long doubles but you do not seem to have
14453 *** the following mathematical functions needed for long double support:
14455 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14456 *** Cannot continue, aborting.
14464 : see if mprotect exists
14465 set mprotect d_mprotect
14468 : see if msgctl exists
14469 set msgctl d_msgctl
14472 : see if msgget exists
14473 set msgget d_msgget
14476 : see if msgsnd exists
14477 set msgsnd d_msgsnd
14480 : see if msgrcv exists
14481 set msgrcv d_msgrcv
14484 : see how much of the 'msg*(2)' library is present.
14487 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14488 *"$undef"*) h_msg=false;;
14492 case "`ipcs 2>&1`" in
14493 "SVID messages"*"not configured"*)
14494 echo "Your $osname does not have the msg*(2) configured." >&4
14497 set msgctl d_msgctl
14499 set msgget d_msgget
14501 set msgsnd d_msgsnd
14503 set msgrcv d_msgrcv
14509 : we could also check for sys/ipc.h ...
14510 if $h_msg && $test `./findhdr sys/msg.h`; then
14511 echo "You have the full msg*(2) library." >&4
14514 echo "You don't have the full msg*(2) library." >&4
14522 echo "Checking to see if your system supports struct msghdr..." >&4
14523 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14525 case "$d_msghdr_s" in
14526 "$define") echo "Yes, it does." ;;
14527 *) echo "No, it doesn't." ;;
14531 : see if msync exists
14535 : see if munmap exists
14536 set munmap d_munmap
14539 : see if nice exists
14543 : see if this is a langinfo.h system
14544 set langinfo.h i_langinfo
14547 : see if nl_langinfo exists
14548 set nl_langinfo d_nl_langinfo
14551 : check for length of character
14553 case "$charsize" in
14555 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14558 #$i_stdlib I_STDLIB
14560 #include <stdlib.h>
14564 printf("%d\n", (int)sizeof(char));
14569 if eval $compile_ok; then
14573 echo "(I can't seem to compile the test program. Guessing...)"
14580 rp="What is the size of a character (in bytes)?"
14585 : check for volatile keyword
14587 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14588 $cat >try.c <<'EOCP'
14591 typedef struct _goo_struct goo_struct;
14592 goo_struct * volatile goo = ((goo_struct *)0);
14593 struct _goo_struct {
14598 typedef unsigned short foo_t;
14599 char *volatile foo;
14601 volatile foo_t blech;
14605 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14607 echo "Yup, it does."
14610 echo "Nope, it doesn't."
14618 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14620 case "$use64bitint:$d_quad:$quadtype" in
14623 uvtype="$uquadtype"
14628 uvtype="unsigned long"
14634 case "$uselongdouble:$d_longdbl" in
14636 nvtype="long double"
14637 nvsize=$longdblsize
14644 $echo "(IV will be "$ivtype", $ivsize bytes)"
14645 $echo "(UV will be "$uvtype", $uvsize bytes)"
14646 $echo "(NV will be "$nvtype", $nvsize bytes)"
14649 #$i_inttypes I_INTTYPES
14651 #include <inttypes.h>
14656 int8_t i = INT8_MAX;
14657 uint8_t u = UINT8_MAX;
14658 printf("int8_t\n");
14661 int16_t i = INT16_MAX;
14662 uint16_t i = UINT16_MAX;
14663 printf("int16_t\n");
14666 int32_t i = INT32_MAX;
14667 uint32_t u = UINT32_MAX;
14668 printf("int32_t\n");
14674 '') case "$charsize" in
14676 u8type="unsigned char"
14685 if eval $compile; then
14686 case "`$run ./try`" in
14687 int8_t) i8type=int8_t
14697 '') if $test $charsize -ge 1; then
14699 u8type="unsigned char"
14707 '') case "$shortsize" in
14709 u16type="unsigned short"
14717 '') set try -DINT16
14718 if eval $compile; then
14719 case "`$run ./try`" in
14731 '') if $test $shortsize -ge 2; then
14733 u16type="unsigned short"
14741 '') case "$longsize" in
14743 u32type="unsigned long"
14747 *) case "$intsize" in
14749 u32type="unsigned int"
14759 '') set try -DINT32
14760 if eval $compile; then
14761 case "`$run ./try`" in
14773 '') if $test $intsize -ge 4; then
14775 u32type="unsigned int"
14783 '') case "$d_quad:$quadtype" in
14785 i64type="$quadtype"
14786 u64type="$uquadtype"
14794 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14795 : volatile so that the compiler has to store it out to memory.
14796 if test X"$d_volatile" = X"$define"; then
14801 #$i_stdlib I_STDLIB
14803 #include <stdlib.h>
14805 #include <sys/types.h>
14806 #include <signal.h>
14808 $volatile int bletched = 0;
14809 $signal_t blech(s) int s; { bletched = 1; }
14814 int n = 8 * $uvsize;
14817 signal(SIGFPE, blech);
14820 for (i = 0; i < n; i++) {
14821 u = u << 1 | ($uvtype)1;
14823 if (($uvtype)d != u)
14827 d = ($nvtype)(u - 1);
14828 if (($uvtype)d != (u - 1))
14836 printf("%d\n", ((i == n) ? -n : i));
14842 d_nv_preserves_uv="$undef"
14843 if eval $compile; then
14844 nv_preserves_uv_bits="`$run ./try`"
14846 case "$nv_preserves_uv_bits" in
14848 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14849 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14850 d_nv_preserves_uv="$define"
14852 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14853 d_nv_preserves_uv="$undef" ;;
14854 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14855 nv_preserves_uv_bits="$undef" ;;
14860 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14861 : volatile so that the compiler has to store it out to memory.
14862 if test X"$d_volatile" = X"$define"; then
14867 #$i_stdlib I_STDLIB
14869 #include <stdlib.h>
14871 #$i_string I_STRING
14873 # include <string.h>
14875 # include <strings.h>
14877 #include <sys/types.h>
14878 #include <signal.h>
14880 $volatile int bletched = 0;
14881 $signal_t blech(s) int s; { bletched = 1; }
14884 int checkit($nvtype d, char *where) {
14885 unsigned char *p = (char *)&d;
14886 unsigned char *end = p + sizeof(d);
14896 printf("No - %s: 0x", where);
14898 printf ("%02X", *p++);
14903 int main(int argc, char **argv) {
14906 fail += checkit(d, "0.0");
14908 /* The compiler shouldn't be assuming that bletched is 0 */
14911 fail += checkit(d, "bleched");
14914 signal(SIGFPE, blech);
14917 /* Paranoia - the compiler should have no way of knowing that ANSI says
14918 that argv[argc] will always be NULL. Actually, if it did assume this it
14919 would be buggy, as this is C and main() can be called from elsewhere in
14921 d = argv[argc] ? 1 : 0;
14924 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14927 fail += checkit(d, "ternary");
14929 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14932 printf("No - memset doesn't give 0.0\n");
14933 /* This might just blow up: */
14934 printf("(gives %g)\n", d);
14940 printf("No - something bleched\n");
14945 printf("No - %d fail(s)\n", fail);
14954 d_nv_zero_is_allbits_zero="$undef"
14955 if eval $compile; then
14961 0.0 is represented as all bits zero in memory
14963 d_nv_zero_is_allbits_zero="$define"
14966 0.0 is not represented as all bits zero in memory
14968 d_nv_zero_is_allbits_zero="$undef"
14973 0.0 is not represented as all bits zero in memory
14975 d_nv_zero_is_allbits_zero="$undef"
14983 : check for off64_t
14985 echo "Checking to see if you have off64_t..." >&4
14987 #include <sys/types.h>
14988 #include <unistd.h>
14989 int main() { off64_t x = 7; }
14992 if eval $compile; then
14994 echo "You have off64_t."
14997 echo "You do not have off64_t."
14998 case "$lseeksize" in
14999 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15006 : how to create joinable pthreads
15007 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15009 echo "Checking what constant to use for creating joinable pthreads..." >&4
15010 $cat >try.c <<'EOCP'
15011 #include <pthread.h>
15013 int detachstate = JOINABLE;
15016 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15017 if eval $compile; then
15018 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15019 val="$undef" # Yes, undef.
15020 set d_old_pthread_create_joinable
15023 set old_pthread_create_joinable
15026 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15027 if eval $compile; then
15028 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15030 set d_old_pthread_create_joinable
15032 val=PTHREAD_CREATE_UNDETACHED
15033 set old_pthread_create_joinable
15036 set try -DJOINABLE=__UNDETACHED
15037 if eval $compile; then
15038 echo "You seem to use __UNDETACHED." >&4
15040 set d_old_pthread_create_joinable
15043 set old_pthread_create_joinable
15046 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15048 set d_old_pthread_create_joinable
15051 set old_pthread_create_joinable
15058 d_old_pthread_create_joinable="$undef"
15059 old_pthread_create_joinable=""
15062 : see if pause exists
15066 : see if pipe exists
15070 : see if poll exists
15074 : see if readlink exists
15075 set readlink d_readlink
15081 case "$d_readlink" in
15083 if $issymlink /proc/self/exe ; then
15084 $ls -l /proc/self/exe > reflect
15085 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15086 echo "You have Linux-like /proc/self/exe."
15087 procselfexe='"/proc/self/exe"'
15091 if $issymlink /proc/curproc/file ; then
15092 $ls -l /proc/curproc/file > reflect
15093 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15094 echo "You have BSD-like /proc/curproc/file."
15095 procselfexe='"/proc/curproc/file"'
15105 : see whether the pthread_atfork exists
15107 #include <pthread.h>
15110 #ifdef PTHREAD_ATFORK
15111 pthread_atfork(NULL,NULL,NULL);
15116 : see if pthread_atfork exists
15117 set try -DPTHREAD_ATFORK
15118 if eval $compile; then
15123 case "$usethreads" in
15126 $define) echo 'pthread_atfork found.' >&4 ;;
15127 *) echo 'pthread_atfork NOT found.' >&4 ;;
15130 set d_pthread_atfork
15133 : see if pthread_attr_setscope exists
15134 set pthread_attr_setscope d_pthread_attr_setscope
15138 : see whether the various POSIXish _yields exist
15140 #include <pthread.h>
15146 #ifdef PTHREAD_YIELD
15149 #ifdef PTHREAD_YIELD_NULL
15150 pthread_yield(NULL);
15156 : see if sched_yield exists
15157 set try -DSCHED_YIELD
15158 if eval $compile; then
15160 sched_yield='sched_yield()'
15164 case "$usethreads" in
15167 $define) echo 'sched_yield() found.' >&4 ;;
15168 *) echo 'sched_yield() NOT found.' >&4 ;;
15174 : see if pthread_yield exists
15175 set try -DPTHREAD_YIELD
15176 if eval $compile; then
15178 case "$sched_yield" in
15179 '') sched_yield='pthread_yield()' ;;
15182 set try -DPTHREAD_YIELD_NULL
15183 if eval $compile; then
15185 case "$sched_yield" in
15186 '') sched_yield='pthread_yield(NULL)' ;;
15192 case "$usethreads" in
15195 $define) echo 'pthread_yield() found.' >&4 ;;
15196 *) echo 'pthread_yield() NOT found.' >&4 ;;
15200 set d_pthread_yield
15203 case "$sched_yield" in
15204 '') sched_yield=undef ;;
15209 : see if random_r exists
15210 set random_r d_random_r
15212 case "$d_random_r" in
15214 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15215 case "$d_random_r_proto:$usethreads" in
15216 ":define") d_random_r_proto=define
15217 set d_random_r_proto random_r $hdrs
15221 case "$d_random_r_proto" in
15223 case "$random_r_proto" in
15224 ''|0) try='int random_r(int*, struct random_data*);'
15225 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15227 case "$random_r_proto" in
15228 ''|0) try='int random_r(long*, struct random_data*);'
15229 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15231 case "$random_r_proto" in
15232 ''|0) try='int random_r(struct random_data*, int32_t*);'
15233 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15235 case "$random_r_proto" in
15236 ''|0) d_random_r=undef
15238 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15239 * ) case "$random_r_proto" in
15240 REENTRANT_PROTO*) ;;
15241 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15243 echo "Prototype: $try" ;;
15246 *) case "$usethreads" in
15247 define) echo "random_r has no prototype, not using it." >&4 ;;
15254 *) random_r_proto=0
15258 : see if readdir and friends exist
15259 set readdir d_readdir
15261 set seekdir d_seekdir
15263 set telldir d_telldir
15265 set rewinddir d_rewinddir
15268 : see if readdir64_r exists
15269 set readdir64_r d_readdir64_r
15271 case "$d_readdir64_r" in
15273 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15274 case "$d_readdir64_r_proto:$usethreads" in
15275 ":define") d_readdir64_r_proto=define
15276 set d_readdir64_r_proto readdir64_r $hdrs
15280 case "$d_readdir64_r_proto" in
15282 case "$readdir64_r_proto" in
15283 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15284 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15286 case "$readdir64_r_proto" in
15287 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15288 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15290 case "$readdir64_r_proto" in
15291 ''|0) d_readdir64_r=undef
15292 readdir64_r_proto=0
15293 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15294 * ) case "$readdir64_r_proto" in
15295 REENTRANT_PROTO*) ;;
15296 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15298 echo "Prototype: $try" ;;
15301 *) case "$usethreads" in
15302 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15304 d_readdir64_r=undef
15305 readdir64_r_proto=0
15309 *) readdir64_r_proto=0
15313 : see if readdir_r exists
15314 set readdir_r d_readdir_r
15316 case "$d_readdir_r" in
15318 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15319 case "$d_readdir_r_proto:$usethreads" in
15320 ":define") d_readdir_r_proto=define
15321 set d_readdir_r_proto readdir_r $hdrs
15325 case "$d_readdir_r_proto" in
15327 case "$readdir_r_proto" in
15328 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15329 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15331 case "$readdir_r_proto" in
15332 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15333 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15335 case "$readdir_r_proto" in
15336 ''|0) d_readdir_r=undef
15338 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15339 * ) case "$readdir_r_proto" in
15340 REENTRANT_PROTO*) ;;
15341 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15343 echo "Prototype: $try" ;;
15346 *) case "$usethreads" in
15347 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15354 *) readdir_r_proto=0
15358 : see if readv exists
15362 : see if recvmsg exists
15363 set recvmsg d_recvmsg
15366 : see if rename exists
15367 set rename d_rename
15370 : see if rmdir exists
15374 : see if memory.h is available.
15379 : See if it conflicts with string.h
15385 $cppstdin $cppflags $cppminus < $strings > mem.h
15386 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15388 echo "We won't be including <memory.h>."
15398 : can bcopy handle overlapping blocks?
15401 case "$d_memmove" in
15402 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15403 *) case "$d_bcopy" in
15405 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15407 #$i_memory I_MEMORY
15408 #$i_stdlib I_STDLIB
15409 #$i_string I_STRING
15410 #$i_unistd I_UNISTD
15412 $cat >>try.c <<'EOCP'
15415 # include <memory.h>
15418 # include <stdlib.h>
15421 # include <string.h>
15423 # include <strings.h>
15426 # include <unistd.h> /* Needed for NetBSD */
15430 char buf[128], abc[128];
15436 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15437 try to store the string in read-only memory. */
15438 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15440 for (align = 7; align >= 0; align--) {
15441 for (len = 36; len; len--) {
15443 bcopy(abc, b, len);
15444 for (off = 1; off <= len; off++) {
15445 bcopy(b, b+off, len);
15446 bcopy(b+off, b, len);
15447 if (bcmp(b, abc, len))
15456 if eval $compile_ok; then
15457 if ./try 2>/dev/null; then
15458 echo "Yes, it can."
15461 echo "It can't, sorry."
15464 echo "(I can't compile the test program, so we'll assume not...)"
15468 $rm -f try.* try core
15474 : can memcpy handle overlapping blocks?
15477 case "$d_memmove" in
15478 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15479 *) case "$d_memcpy" in
15481 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15483 #$i_memory I_MEMORY
15484 #$i_stdlib I_STDLIB
15485 #$i_string I_STRING
15486 #$i_unistd I_UNISTD
15488 $cat >>try.c <<'EOCP'
15491 # include <memory.h>
15494 # include <stdlib.h>
15497 # include <string.h>
15499 # include <strings.h>
15502 # include <unistd.h> /* Needed for NetBSD */
15506 char buf[128], abc[128];
15512 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15513 try to store the string in read-only memory. */
15514 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15516 for (align = 7; align >= 0; align--) {
15517 for (len = 36; len; len--) {
15519 memcpy(b, abc, len);
15520 for (off = 1; off <= len; off++) {
15521 memcpy(b+off, b, len);
15522 memcpy(b, b+off, len);
15523 if (memcmp(b, abc, len))
15532 if eval $compile_ok; then
15533 if ./try 2>/dev/null; then
15534 echo "Yes, it can."
15537 echo "It can't, sorry."
15540 echo "(I can't compile the test program, so we'll assume not...)"
15544 $rm -f try.* try core
15550 : can memcmp be trusted to compare relative magnitude?
15552 case "$d_memcmp" in
15555 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15557 #$i_memory I_MEMORY
15558 #$i_stdlib I_STDLIB
15559 #$i_string I_STRING
15560 #$i_unistd I_UNISTD
15562 $cat >>try.c <<'EOCP'
15565 # include <memory.h>
15568 # include <stdlib.h>
15571 # include <string.h>
15573 # include <strings.h>
15576 # include <unistd.h> /* Needed for NetBSD */
15582 if ((a < b) && memcmp(&a, &b, 1) < 0)
15588 if eval $compile_ok; then
15589 if $run ./try 2>/dev/null; then
15590 echo "Yes, it can."
15593 echo "No, it can't (it uses signed chars)."
15596 echo "(I can't compile the test program, so we'll assume not...)"
15600 $rm -f try.* try core
15604 : see if prototype for sbrk is available
15606 set d_sbrkproto sbrk $i_unistd unistd.h
15609 : see if select exists
15610 set select d_select
15613 : see if semctl exists
15614 set semctl d_semctl
15617 : see if semget exists
15618 set semget d_semget
15621 : see if semop exists
15625 : see how much of the 'sem*(2)' library is present.
15628 case "$d_semctl$d_semget$d_semop" in
15629 *"$undef"*) h_sem=false;;
15633 case "`ipcs 2>&1`" in
15634 "SVID messages"*"not configured"*)
15635 echo "Your $osname does not have the sem*(2) configured." >&4
15638 set semctl d_semctl
15640 set semget d_semget
15648 : we could also check for sys/ipc.h ...
15649 if $h_sem && $test `./findhdr sys/sem.h`; then
15650 echo "You have the full sem*(2) library." >&4
15653 echo "You don't have the full sem*(2) library." >&4
15659 : see whether sys/sem.h defines union semun
15661 $cat > try.c <<'END'
15662 #include <sys/types.h>
15663 #include <sys/ipc.h>
15664 #include <sys/sem.h>
15665 int main () { union semun semun; semun.buf = 0; }
15668 if eval $compile; then
15669 echo "You have union semun in <sys/sem.h>." >&4
15672 echo "You do not have union semun in <sys/sem.h>." >&4
15679 : see how to do semctl IPC_STAT
15686 # define S_IRUSR S_IREAD
15687 # define S_IWUSR S_IWRITE
15688 # define S_IXUSR S_IEXEC
15690 # define S_IRUSR 0400
15691 # define S_IWUSR 0200
15692 # define S_IXUSR 0100
15694 # define S_IRGRP (S_IRUSR>>3)
15695 # define S_IWGRP (S_IWUSR>>3)
15696 # define S_IXGRP (S_IXUSR>>3)
15697 # define S_IROTH (S_IRUSR>>6)
15698 # define S_IWOTH (S_IWUSR>>6)
15699 # define S_IXOTH (S_IXUSR>>6)
15702 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15703 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15704 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15707 : see whether semctl IPC_STAT can use union semun
15709 case "$d_semctl_semun" in
15712 #include <sys/types.h>
15713 #include <sys/ipc.h>
15714 #include <sys/sem.h>
15715 #include <sys/stat.h>
15722 #$d_union_semun HAS_UNION_SEMUN
15725 #ifndef HAS_UNION_SEMUN
15728 struct semid_ds *buf;
15729 unsigned short *array;
15735 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15736 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15738 struct semid_ds argbuf;
15741 st = semctl(sem, 0, IPC_STAT, arg);
15745 # endif /* IPC_STAT */
15746 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15748 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15749 # endif /* IPC_RMID */
15750 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15752 #endif /* IPC_PRIVATE && ... */
15753 printf("semget failed: errno = %d\n", errno);
15758 if eval $compile; then
15761 semun) val="$define" ;;
15769 case "$d_semctl_semun" in
15771 echo "You can use union semun for semctl IPC_STAT." >&4
15774 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15779 : see whether semctl IPC_STAT can use struct semid_ds pointer
15781 case "$d_semctl_semid_ds" in
15783 $cat > try.c <<'END'
15784 #include <sys/types.h>
15785 #include <sys/ipc.h>
15786 #include <sys/sem.h>
15787 #include <sys/stat.h>
15795 struct semid_ds arg;
15798 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15799 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15802 st = semctl(sem, 0, IPC_STAT, &arg);
15804 printf("semid_ds\n");
15806 # endif /* IPC_STAT */
15807 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15809 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15810 # endif /* IPC_RMID */
15811 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15813 #endif /* IPC_PRIVATE && ... */
15814 printf("semget failed: errno = %d\n", errno);
15820 if eval $compile; then
15823 semid_ds) val="$define" ;;
15829 set d_semctl_semid_ds
15831 case "$d_semctl_semid_ds" in
15833 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15835 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15842 # We do not have the full sem*(2) library, so assume we can not
15848 set d_semctl_semid_ds
15853 : see if sendmsg exists
15854 set sendmsg d_sendmsg
15857 : see if setegid exists
15858 set setegid d_setegid
15861 : see if seteuid exists
15862 set seteuid d_seteuid
15865 : see if setgrent exists
15866 set setgrent d_setgrent
15869 : see if setgrent_r exists
15870 set setgrent_r d_setgrent_r
15872 case "$d_setgrent_r" in
15874 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15875 case "$d_setgrent_r_proto:$usethreads" in
15876 ":define") d_setgrent_r_proto=define
15877 set d_setgrent_r_proto setgrent_r $hdrs
15881 case "$d_setgrent_r_proto" in
15883 case "$setgrent_r_proto" in
15884 ''|0) try='int setgrent_r(FILE**);'
15885 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15887 case "$setgrent_r_proto" in
15888 ''|0) try='void setgrent_r(FILE**);'
15889 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15891 case "$setgrent_r_proto" in
15892 ''|0) d_setgrent_r=undef
15894 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15895 * ) case "$setgrent_r_proto" in
15896 REENTRANT_PROTO*) ;;
15897 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15899 echo "Prototype: $try" ;;
15902 *) case "$usethreads" in
15903 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15910 *) setgrent_r_proto=0
15914 : see if sethostent exists
15915 set sethostent d_sethent
15918 : see if sethostent_r exists
15919 set sethostent_r d_sethostent_r
15921 case "$d_sethostent_r" in
15923 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15924 case "$d_sethostent_r_proto:$usethreads" in
15925 ":define") d_sethostent_r_proto=define
15926 set d_sethostent_r_proto sethostent_r $hdrs
15930 case "$d_sethostent_r_proto" in
15932 case "$sethostent_r_proto" in
15933 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15934 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15936 case "$sethostent_r_proto" in
15937 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15938 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15940 case "$sethostent_r_proto" in
15941 ''|0) d_sethostent_r=undef
15942 sethostent_r_proto=0
15943 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15944 * ) case "$sethostent_r_proto" in
15945 REENTRANT_PROTO*) ;;
15946 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15948 echo "Prototype: $try" ;;
15951 *) case "$usethreads" in
15952 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15954 d_sethostent_r=undef
15955 sethostent_r_proto=0
15959 *) sethostent_r_proto=0
15963 : see if setitimer exists
15964 set setitimer d_setitimer
15967 : see if setlinebuf exists
15968 set setlinebuf d_setlinebuf
15971 : see if setlocale exists
15972 set setlocale d_setlocale
15975 : see if locale.h is available
15976 set locale.h i_locale
15979 : see if setlocale_r exists
15980 set setlocale_r d_setlocale_r
15982 case "$d_setlocale_r" in
15984 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15985 case "$d_setlocale_r_proto:$usethreads" in
15986 ":define") d_setlocale_r_proto=define
15987 set d_setlocale_r_proto setlocale_r $hdrs
15991 case "$d_setlocale_r_proto" in
15993 case "$setlocale_r_proto" in
15994 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15995 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15997 case "$setlocale_r_proto" in
15998 ''|0) d_setlocale_r=undef
15999 setlocale_r_proto=0
16000 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16001 * ) case "$setlocale_r_proto" in
16002 REENTRANT_PROTO*) ;;
16003 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16005 echo "Prototype: $try" ;;
16008 *) case "$usethreads" in
16009 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16011 d_setlocale_r=undef
16012 setlocale_r_proto=0
16016 *) setlocale_r_proto=0
16020 : see if setnetent exists
16021 set setnetent d_setnent
16024 : see if setnetent_r exists
16025 set setnetent_r d_setnetent_r
16027 case "$d_setnetent_r" in
16029 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16030 case "$d_setnetent_r_proto:$usethreads" in
16031 ":define") d_setnetent_r_proto=define
16032 set d_setnetent_r_proto setnetent_r $hdrs
16036 case "$d_setnetent_r_proto" in
16038 case "$setnetent_r_proto" in
16039 ''|0) try='int setnetent_r(int, struct netent_data*);'
16040 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16042 case "$setnetent_r_proto" in
16043 ''|0) try='void setnetent_r(int, struct netent_data*);'
16044 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16046 case "$setnetent_r_proto" in
16047 ''|0) d_setnetent_r=undef
16048 setnetent_r_proto=0
16049 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16050 * ) case "$setnetent_r_proto" in
16051 REENTRANT_PROTO*) ;;
16052 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16054 echo "Prototype: $try" ;;
16057 *) case "$usethreads" in
16058 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16060 d_setnetent_r=undef
16061 setnetent_r_proto=0
16065 *) setnetent_r_proto=0
16069 : see if setprotoent exists
16070 set setprotoent d_setpent
16073 : see if setpgid exists
16074 set setpgid d_setpgid
16077 : see if setpgrp2 exists
16078 set setpgrp2 d_setpgrp2
16081 : see if setpriority exists
16082 set setpriority d_setprior
16085 : see if setproctitle exists
16086 set setproctitle d_setproctitle
16089 : see if setprotoent_r exists
16090 set setprotoent_r d_setprotoent_r
16092 case "$d_setprotoent_r" in
16094 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16095 case "$d_setprotoent_r_proto:$usethreads" in
16096 ":define") d_setprotoent_r_proto=define
16097 set d_setprotoent_r_proto setprotoent_r $hdrs
16101 case "$d_setprotoent_r_proto" in
16103 case "$setprotoent_r_proto" in
16104 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16105 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16107 case "$setprotoent_r_proto" in
16108 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16109 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16111 case "$setprotoent_r_proto" in
16112 ''|0) d_setprotoent_r=undef
16113 setprotoent_r_proto=0
16114 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16115 * ) case "$setprotoent_r_proto" in
16116 REENTRANT_PROTO*) ;;
16117 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16119 echo "Prototype: $try" ;;
16122 *) case "$usethreads" in
16123 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16125 d_setprotoent_r=undef
16126 setprotoent_r_proto=0
16130 *) setprotoent_r_proto=0
16134 : see if setpwent exists
16135 set setpwent d_setpwent
16138 : see if setpwent_r exists
16139 set setpwent_r d_setpwent_r
16141 case "$d_setpwent_r" in
16143 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16144 case "$d_setpwent_r_proto:$usethreads" in
16145 ":define") d_setpwent_r_proto=define
16146 set d_setpwent_r_proto setpwent_r $hdrs
16150 case "$d_setpwent_r_proto" in
16152 case "$setpwent_r_proto" in
16153 ''|0) try='int setpwent_r(FILE**);'
16154 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16156 case "$setpwent_r_proto" in
16157 ''|0) try='void setpwent_r(FILE**);'
16158 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16160 case "$setpwent_r_proto" in
16161 ''|0) d_setpwent_r=undef
16163 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16164 * ) case "$setpwent_r_proto" in
16165 REENTRANT_PROTO*) ;;
16166 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16168 echo "Prototype: $try" ;;
16171 *) case "$usethreads" in
16172 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16179 *) setpwent_r_proto=0
16183 : see if setregid exists
16184 set setregid d_setregid
16186 set setresgid d_setresgid
16189 : see if setreuid exists
16190 set setreuid d_setreuid
16192 set setresuid d_setresuid
16195 : see if setrgid exists
16196 set setrgid d_setrgid
16199 : see if setruid exists
16200 set setruid d_setruid
16203 : see if setservent exists
16204 set setservent d_setsent
16207 : see if setservent_r exists
16208 set setservent_r d_setservent_r
16210 case "$d_setservent_r" in
16212 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16213 case "$d_setservent_r_proto:$usethreads" in
16214 ":define") d_setservent_r_proto=define
16215 set d_setservent_r_proto setservent_r $hdrs
16219 case "$d_setservent_r_proto" in
16221 case "$setservent_r_proto" in
16222 ''|0) try='int setservent_r(int, struct servent_data*);'
16223 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16225 case "$setservent_r_proto" in
16226 ''|0) try='void setservent_r(int, struct servent_data*);'
16227 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16229 case "$setservent_r_proto" in
16230 ''|0) d_setservent_r=undef
16231 setservent_r_proto=0
16232 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16233 * ) case "$setservent_r_proto" in
16234 REENTRANT_PROTO*) ;;
16235 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16237 echo "Prototype: $try" ;;
16240 *) case "$usethreads" in
16241 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16243 d_setservent_r=undef
16244 setservent_r_proto=0
16248 *) setservent_r_proto=0
16252 : see if setsid exists
16253 set setsid d_setsid
16256 : see if setvbuf exists
16257 set setvbuf d_setvbuf
16260 : see if sfio.h is available
16265 : see if sfio library is available
16276 : Ok, but do we want to use it.
16280 true|$define|[yY]*) dflt='y';;
16283 echo "$package can use the sfio library, but it is experimental."
16284 case "$useperlio" in
16286 echo "For sfio also the PerlIO abstraction layer is needed."
16287 echo "Earlier you said you wouldn't want that."
16290 rp="You seem to have sfio available, do you want to try using it?"
16293 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16294 useperlio="$define"
16297 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16302 *) case "$usesfio" in
16303 true|$define|[yY]*)
16304 echo "Sorry, cannot find sfio on this machine." >&4
16305 echo "Ignoring your setting of usesfio=$usesfio." >&4
16314 $define) usesfio='true';;
16315 *) usesfio='false';;
16319 *) : Remove sfio from list of libraries to use
16322 echo "Removing unneeded -lsfio from library list" >&4
16323 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16326 echo "libs = $libs" >&4
16333 : see if shmctl exists
16334 set shmctl d_shmctl
16337 : see if shmget exists
16338 set shmget d_shmget
16341 : see if shmat exists
16344 : see what shmat returns
16347 $cat >shmat.c <<'END'
16348 #include <sys/shm.h>
16351 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16356 echo "and it returns ($shmattype)." >&4
16357 : see if a prototype for shmat is available
16358 xxx=`./findhdr sys/shm.h`
16359 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16360 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16371 set d_shmatprototype
16374 : see if shmdt exists
16378 : see how much of the 'shm*(2)' library is present.
16381 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16382 *"$undef"*) h_shm=false;;
16386 case "`ipcs 2>&1`" in
16387 "SVID shared memory"*"not configured"*)
16388 echo "Your $osname does not have the shm*(2) configured." >&4
16391 set shmctl d_shmctl
16393 set shmget d_shmget
16403 : we could also check for sys/ipc.h ...
16404 if $h_shm && $test `./findhdr sys/shm.h`; then
16405 echo "You have the full shm*(2) library." >&4
16408 echo "You don't have the full shm*(2) library." >&4
16415 : see if we have sigaction
16416 if set sigaction val -f d_sigaction; eval $csym; $val; then
16417 echo 'sigaction() found.' >&4
16420 #include <sys/types.h>
16421 #include <signal.h>
16422 #$i_stdlib I_STDLIB
16424 #include <stdlib.h>
16428 struct sigaction act, oact;
16430 oact.sa_handler = 0;
16431 /* so that act and oact are used */
16432 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16436 if eval $compile_ok; then
16439 echo "But you don't seem to have a useable struct sigaction." >&4
16443 echo 'sigaction NOT found.' >&4
16446 set d_sigaction; eval $setvar
16447 $rm -f try try$_o try.c
16449 : see if sigprocmask exists
16450 set sigprocmask d_sigprocmask
16453 : see if sigsetjmp exists
16455 case "$d_sigsetjmp" in
16458 #include <setjmp.h>
16459 #$i_stdlib I_STDLIB
16461 #include <stdlib.h>
16467 if (sigsetjmp(env,1))
16470 siglongjmp(env, 1);
16475 if eval $compile; then
16476 if $run ./try >/dev/null 2>&1; then
16477 echo "POSIX sigsetjmp found." >&4
16481 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16487 echo "sigsetjmp not found." >&4
16491 *) val="$d_sigsetjmp"
16492 case "$d_sigsetjmp" in
16493 $define) echo "POSIX sigsetjmp found." >&4;;
16494 $undef) echo "sigsetjmp not found." >&4;;
16502 : see if sockatmark exists
16503 set sockatmark d_sockatmark
16506 : see if prototype for sockatmark is available
16508 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16511 : see if socks5_init exists
16512 set socks5_init d_socks5_init
16515 : see if srand48_r exists
16516 set srand48_r d_srand48_r
16518 case "$d_srand48_r" in
16520 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16521 case "$d_srand48_r_proto:$usethreads" in
16522 ":define") d_srand48_r_proto=define
16523 set d_srand48_r_proto srand48_r $hdrs
16527 case "$d_srand48_r_proto" in
16529 case "$srand48_r_proto" in
16530 ''|0) try='int srand48_r(long, struct drand48_data*);'
16531 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16533 case "$srand48_r_proto" in
16534 ''|0) d_srand48_r=undef
16536 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16537 * ) case "$srand48_r_proto" in
16538 REENTRANT_PROTO*) ;;
16539 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16541 echo "Prototype: $try" ;;
16544 *) case "$usethreads" in
16545 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16552 *) srand48_r_proto=0
16556 : see if srandom_r exists
16557 set srandom_r d_srandom_r
16559 case "$d_srandom_r" in
16561 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16562 case "$d_srandom_r_proto:$usethreads" in
16563 ":define") d_srandom_r_proto=define
16564 set d_srandom_r_proto srandom_r $hdrs
16568 case "$d_srandom_r_proto" in
16570 case "$srandom_r_proto" in
16571 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16572 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16574 case "$srandom_r_proto" in
16575 ''|0) d_srandom_r=undef
16577 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16578 * ) case "$srandom_r_proto" in
16579 REENTRANT_PROTO*) ;;
16580 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16582 echo "Prototype: $try" ;;
16585 *) case "$usethreads" in
16586 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16593 *) srandom_r_proto=0
16597 : see if prototype for setresgid is available
16599 set d_sresgproto setresgid $i_unistd unistd.h
16602 : see if prototype for setresuid is available
16604 set d_sresuproto setresuid $i_unistd unistd.h
16607 : see if sys/stat.h is available
16608 set sys/stat.h i_sysstat
16612 : see if stat knows about block sizes
16614 echo "Checking to see if your struct stat has st_blocks field..." >&4
16615 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16619 : see if this is a sys/vfs.h system
16620 set sys/vfs.h i_sysvfs
16624 : see if this is a sys/statfs.h system
16625 set sys/statfs.h i_sysstatfs
16630 echo "Checking to see if your system supports struct statfs..." >&4
16631 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
16633 case "$d_statfs_s" in
16634 "$define") echo "Yes, it does." ;;
16635 *) echo "No, it doesn't." ;;
16640 : see if struct statfs knows about f_flags
16641 case "$d_statfs_s" in
16644 echo "Checking to see if your struct statfs has f_flags field..." >&4
16645 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
16649 set d_statfs_f_flags
16653 case "$d_statfs_f_flags" in
16654 "$define") echo "Yes, it does." ;;
16655 *) echo "No, it doesn't." ;;
16659 Checking how to access stdio streams by file descriptor number...
16661 case "$stdio_stream_array" in
16662 '') $cat >try.c <<EOCP
16665 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16669 for s in _iob __iob __sF
16671 set try -DSTDIO_STREAM_ARRAY=$s
16672 if eval $compile; then
16673 case "`$run ./try`" in
16674 yes) stdio_stream_array=$s; break ;;
16678 $rm -f try.* try$exe_ext
16680 case "$stdio_stream_array" in
16682 I can't figure out how to access stdio streams by file descriptor number.
16684 d_stdio_stream_array="$undef"
16687 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16689 d_stdio_stream_array="$define"
16693 : see if strcoll exists
16694 set strcoll d_strcoll
16697 : check for structure copying
16699 echo "Checking to see if your C compiler can copy structs..." >&4
16700 $cat >try.c <<'EOCP'
16710 if $cc -c try.c >/dev/null 2>&1 ; then
16712 echo "Yup, it can."
16715 echo "Nope, it can't."
16721 : see if strerror and/or sys_errlist[] exist
16723 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16724 if set strerror val -f d_strerror; eval $csym; $val; then
16725 echo 'strerror() found.' >&4
16726 d_strerror="$define"
16727 d_strerrm='strerror(e)'
16728 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16729 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16730 d_syserrlst="$define"
16732 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16733 d_syserrlst="$undef"
16735 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16736 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16737 echo 'strerror() found in string header.' >&4
16738 d_strerror="$define"
16739 d_strerrm='strerror(e)'
16740 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16741 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16742 d_syserrlst="$define"
16744 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16745 d_syserrlst="$undef"
16747 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16748 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16749 d_strerror="$undef"
16750 d_syserrlst="$define"
16751 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16753 echo 'strerror() and sys_errlist[] NOT found.' >&4
16754 d_strerror="$undef"
16755 d_syserrlst="$undef"
16756 d_strerrm='"unknown"'
16760 : see if strerror_r exists
16761 set strerror_r d_strerror_r
16763 case "$d_strerror_r" in
16765 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16766 case "$d_strerror_r_proto:$usethreads" in
16767 ":define") d_strerror_r_proto=define
16768 set d_strerror_r_proto strerror_r $hdrs
16772 case "$d_strerror_r_proto" in
16774 case "$strerror_r_proto" in
16775 ''|0) try='int strerror_r(int, char*, size_t);'
16776 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16778 case "$strerror_r_proto" in
16779 ''|0) try='int strerror_r(int, char*, int);'
16780 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16782 case "$strerror_r_proto" in
16783 ''|0) try='char* strerror_r(int, char*, size_t);'
16784 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16786 case "$strerror_r_proto" in
16787 ''|0) d_strerror_r=undef
16789 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16790 * ) case "$strerror_r_proto" in
16791 REENTRANT_PROTO*) ;;
16792 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16794 echo "Prototype: $try" ;;
16797 *) case "$usethreads" in
16798 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16805 *) strerror_r_proto=0
16809 : see if strftime exists
16810 set strftime d_strftime
16813 : see if strlcat exists
16814 set strlcat d_strlcat
16817 : see if strlcpy exists
16818 set strlcpy d_strlcpy
16821 : see if strtod exists
16822 set strtod d_strtod
16825 : see if strtol exists
16826 set strtol d_strtol
16829 : see if strtold exists
16830 set strtold d_strtold
16833 : see if strtoll exists
16834 set strtoll d_strtoll
16837 case "$d_longlong-$d_strtoll" in
16840 Checking whether your strtoll() works okay...
16842 $cat >try.c <<'EOCP'
16845 #define strtoll __strtoll
16848 #define strtoll _strtoll
16851 extern long long int strtoll(char *s, char **, int);
16852 static int bad = 0;
16853 int check(char *s, long long ell, int een) {
16856 gll = strtoll(s, 0, 10);
16857 if (!((gll == ell) && (errno == een)))
16861 check(" 1", 1LL, 0);
16862 check(" 0", 0LL, 0);
16863 check("-1", -1LL, 0);
16864 check("-9223372036854775808", -9223372036854775808LL, 0);
16865 check("-9223372036854775808", -9223372036854775808LL, 0);
16866 check(" 9223372036854775807", 9223372036854775807LL, 0);
16867 check("-9223372036854775808", -9223372036854775808LL, 0);
16868 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16869 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16875 if eval $compile; then
16878 ok) echo "Your strtoll() seems to be working okay." ;;
16880 Your strtoll() doesn't seem to be working okay.
16886 echo "(I can't seem to compile the test program--assuming it doesn't)"
16892 : see if strtoq exists
16893 set strtoq d_strtoq
16896 : see if strtoul exists
16897 set strtoul d_strtoul
16900 case "$d_strtoul" in
16903 Checking whether your strtoul() works okay...
16905 $cat >try.c <<'EOCP'
16908 extern unsigned long int strtoul(char *s, char **, int);
16909 static int bad = 0;
16910 void check(char *s, unsigned long eul, int een) {
16913 gul = strtoul(s, 0, 10);
16914 if (!((gul == eul) && (errno == een)))
16918 check(" 1", 1L, 0);
16919 check(" 0", 0L, 0);
16921 case "$longsize" in
16923 $cat >>try.c <<'EOCP'
16924 check("18446744073709551615", 18446744073709551615UL, 0);
16925 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16926 #if 0 /* strtoul() for /^-/ strings is undefined. */
16927 check("-1", 18446744073709551615UL, 0);
16928 check("-18446744073709551614", 2, 0);
16929 check("-18446744073709551615", 1, 0);
16930 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16931 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16936 $cat >>try.c <<'EOCP'
16937 check("4294967295", 4294967295UL, 0);
16938 check("4294967296", 4294967295UL, ERANGE);
16939 #if 0 /* strtoul() for /^-/ strings is undefined. */
16940 check("-1", 4294967295UL, 0);
16941 check("-4294967294", 2, 0);
16942 check("-4294967295", 1, 0);
16943 check("-4294967296", 4294967295UL, ERANGE);
16944 check("-4294967297", 4294967295UL, ERANGE);
16949 : Should we write these tests to be more portable by sprintf-ing
16950 : ~0 and then manipulating that char string as input for strtol?
16953 $cat >>try.c <<'EOCP'
16960 if eval $compile; then
16961 case "`$run ./try`" in
16962 ok) echo "Your strtoul() seems to be working okay." ;;
16964 Your strtoul() doesn't seem to be working okay.
16973 : see if strtoull exists
16974 set strtoull d_strtoull
16977 case "$d_longlong-$d_strtoull" in
16980 Checking whether your strtoull() works okay...
16982 $cat >try.c <<'EOCP'
16985 #define strtoull __strtoull
16988 extern unsigned long long int strtoull(char *s, char **, int);
16989 static int bad = 0;
16990 int check(char *s, long long eull, int een) {
16993 gull = strtoull(s, 0, 10);
16994 if (!((gull == eull) && (errno == een)))
16998 check(" 1", 1LL, 0);
16999 check(" 0", 0LL, 0);
17000 check("18446744073709551615", 18446744073709551615ULL, 0);
17001 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17002 #if 0 /* strtoull() for /^-/ strings is undefined. */
17003 check("-1", 18446744073709551615ULL, 0);
17004 check("-18446744073709551614", 2LL, 0);
17005 check("-18446744073709551615", 1LL, 0);
17006 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17007 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17014 if eval $compile; then
17015 case "`$run ./try`" in
17016 ok) echo "Your strtoull() seems to be working okay." ;;
17018 Your strtoull() doesn't seem to be working okay.
17020 d_strtoull="$undef"
17027 : see if strtouq exists
17028 set strtouq d_strtouq
17031 case "$d_strtouq" in
17034 Checking whether your strtouq() works okay...
17036 $cat >try.c <<'EOCP'
17039 extern unsigned long long int strtouq(char *s, char **, int);
17040 static int bad = 0;
17041 void check(char *s, unsigned long long eull, int een) {
17042 unsigned long long gull;
17044 gull = strtouq(s, 0, 10);
17045 if (!((gull == eull) && (errno == een)))
17049 check(" 1", 1LL, 0);
17050 check(" 0", 0LL, 0);
17051 check("18446744073709551615", 18446744073709551615ULL, 0);
17052 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17053 #if 0 /* strtouq() for /^-/ strings is undefined. */
17054 check("-1", 18446744073709551615ULL, 0);
17055 check("-18446744073709551614", 2LL, 0);
17056 check("-18446744073709551615", 1LL, 0);
17057 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17058 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17066 if eval $compile; then
17067 case "`$run ./try`" in
17068 ok) echo "Your strtouq() seems to be working okay." ;;
17070 Your strtouq() doesn't seem to be working okay.
17079 : see if strxfrm exists
17080 set strxfrm d_strxfrm
17083 : see if symlink exists
17084 set symlink d_symlink
17087 : see if syscall exists
17088 set syscall d_syscall
17091 : see if prototype for syscall is available
17093 set d_syscallproto syscall $i_unistd unistd.h
17096 : see if sysconf exists
17097 set sysconf d_sysconf
17100 : see if system exists
17101 set system d_system
17104 : see if tcgetpgrp exists
17105 set tcgetpgrp d_tcgetpgrp
17108 : see if tcsetpgrp exists
17109 set tcsetpgrp d_tcsetpgrp
17112 : see if prototype for telldir is available
17114 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17117 : see if time exists
17119 if test "X$d_time" = X -o X"$timetype" = X; then
17120 if set time val -f d_time; eval $csym; $val; then
17121 echo 'time() found.' >&4
17123 rp="What is the type returned by time() on this system?"
17124 set time_t timetype long stdio.h sys/types.h
17127 echo 'time() not found, hope that will do.' >&4
17135 : see if this is a sys/times.h system
17136 set sys/times.h i_systimes
17139 : see if times exists
17141 if set times val -f d_times; eval $csym; $val; then
17142 echo 'times() found.' >&4
17145 case "$i_systimes" in
17146 "$define") inc='sys/times.h';;
17148 rp="What is the type returned by times() on this system?"
17149 set clock_t clocktype long stdio.h sys/types.h $inc
17152 echo 'times() NOT found, hope that will do.' >&4
17157 : see if tmpnam_r exists
17158 set tmpnam_r d_tmpnam_r
17160 case "$d_tmpnam_r" in
17162 hdrs="$i_systypes sys/types.h define stdio.h "
17163 case "$d_tmpnam_r_proto:$usethreads" in
17164 ":define") d_tmpnam_r_proto=define
17165 set d_tmpnam_r_proto tmpnam_r $hdrs
17169 case "$d_tmpnam_r_proto" in
17171 case "$tmpnam_r_proto" in
17172 ''|0) try='char* tmpnam_r(char*);'
17173 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17175 case "$tmpnam_r_proto" in
17176 ''|0) d_tmpnam_r=undef
17178 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17179 * ) case "$tmpnam_r_proto" in
17180 REENTRANT_PROTO*) ;;
17181 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17183 echo "Prototype: $try" ;;
17186 *) case "$usethreads" in
17187 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17194 *) tmpnam_r_proto=0
17198 : see if truncate exists
17199 set truncate d_truncate
17202 : see if ttyname_r exists
17203 set ttyname_r d_ttyname_r
17205 case "$d_ttyname_r" in
17207 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17208 case "$d_ttyname_r_proto:$usethreads" in
17209 ":define") d_ttyname_r_proto=define
17210 set d_ttyname_r_proto ttyname_r $hdrs
17214 case "$d_ttyname_r_proto" in
17216 case "$ttyname_r_proto" in
17217 ''|0) try='int ttyname_r(int, char*, size_t);'
17218 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17220 case "$ttyname_r_proto" in
17221 ''|0) try='int ttyname_r(int, char*, int);'
17222 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17224 case "$ttyname_r_proto" in
17225 ''|0) try='char* ttyname_r(int, char*, int);'
17226 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17228 case "$ttyname_r_proto" in
17229 ''|0) d_ttyname_r=undef
17231 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17232 * ) case "$ttyname_r_proto" in
17233 REENTRANT_PROTO*) ;;
17234 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17236 echo "Prototype: $try" ;;
17239 *) case "$usethreads" in
17240 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17247 *) ttyname_r_proto=0
17251 : see if tzname[] exists
17253 if set tzname val -a d_tzname; eval $csym; $val; then
17255 echo 'tzname[] found.' >&4
17258 echo 'tzname[] NOT found.' >&4
17264 next|rhapsody|darwin) multiarch="$define" ;;
17266 case "$multiarch" in
17267 ''|[nN]*) multiarch="$undef" ;;
17270 : check for ordering of bytes in a UV
17272 case "$usecrosscompile$multiarch" in
17275 You seem to be either cross-compiling or doing a multiarchitecture build,
17276 skipping the byteorder check.
17282 case "$byteorder" in
17285 In the following, larger digits indicate more significance. A big-endian
17286 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17287 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17288 machines may have weird orders like 3412. A Cray will report 87654321,
17289 an Alpha will report 12345678. If the test program works the default is
17291 I'm now running the test program...
17295 #$i_stdlib I_STDLIB
17297 #include <stdlib.h>
17299 #include <sys/types.h>
17300 typedef $uvtype UV;
17310 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17312 u.l = (UV)0x04030201;
17313 for (i = 0; i < $uvsize; i++)
17314 printf("%c", u.c[i]+'0');
17321 if eval $compile && ./try > /dev/null; then
17324 [1-4][1-4][1-4][1-4]|12345678|87654321)
17325 echo "(The test program ran ok.)"
17326 echo "byteorder=$dflt"
17329 ????|????????) echo "(The test program ran ok.)" ;;
17330 *) echo "(The test program didn't run right for some reason.)" ;;
17335 (I can't seem to compile the test program. Guessing big-endian...)
17338 case "$xxx_prompt" in
17340 rp="What is the order of bytes in $uvtype?"
17356 Checking to see whether you can access character data unalignedly...
17358 case "$d_u32align" in
17359 '') $cat >try.c <<EOCP
17361 #$i_stdlib I_STDLIB
17363 #include <stdlib.h>
17365 #define U32 $u32type
17366 #define BYTEORDER 0x$byteorder
17368 #include <signal.h>
17370 $signal_t bletch(s) int s; { exit(4); }
17373 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17378 if (sizeof(U32) != 4) {
17379 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17386 signal(SIGBUS, bletch);
17398 for (i = 0; i < 4; i++) {
17399 up = (U32*)(buf + i);
17400 if (! ((*up == 1 << (8*i)) || /* big-endian */
17401 (*up == 1 << (8*(3-i))) /* little-endian */
17405 printf("read failed (%x)\n", *up);
17411 for (i = 0; i < 4; i++) {
17412 up = (U32*)(buf + i);
17414 if (*up != 0xBeef) {
17415 printf("write failed (%x)\n", *up);
17429 if eval $compile_ok; then
17430 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17431 $run ./try 2>&1 >/dev/null
17434 You can access character data pretty unalignedly.
17436 d_u32align="$undef"
17439 It seems that you must access character data in an aligned manner.
17441 d_u32align="$define"
17445 rp='Can you access character data at unaligned addresses?'
17449 [yY]*) d_u32align="$undef" ;;
17450 *) d_u32align="$define" ;;
17453 $rm -f core core.try.* try.core
17457 : see if ualarm exists
17458 set ualarm d_ualarm
17461 : see if umask exists
17465 : see if unordered exists
17466 set unordered d_unordered
17469 : see if unsetenv exists
17470 set unsetenv d_unsetenv
17473 : see if usleep exists
17474 set usleep d_usleep
17477 : see if prototype for usleep is available
17479 set d_usleepproto usleep $i_unistd unistd.h
17482 : see if ustat exists
17486 : backward compatibility for d_hvfork
17487 if test X$d_hvfork != X; then
17488 d_vfork="$d_hvfork"
17491 : see if there is a vfork
17496 : Ok, but do we want to use it. vfork is reportedly unreliable in
17497 : perl on Solaris 2.x, and probably elsewhere.
17501 case "$usevfork" in
17507 Perl can only use a vfork() that doesn't suffer from strict
17508 restrictions on calling functions or modifying global data in
17509 the child. For example, glibc-2.1 contains such a vfork()
17510 that is unsuitable. If your system provides a proper fork()
17511 call, chances are that you do NOT want perl to use vfork().
17514 rp="Do you still want to use vfork()?"
17519 echo "Ok, we won't use vfork()."
17528 $define) usevfork='true';;
17529 *) usevfork='false';;
17532 : see if closedir exists
17533 set closedir d_closedir
17536 case "$d_closedir" in
17539 echo "Checking whether closedir() returns a status..." >&4
17541 #$i_dirent I_DIRENT /**/
17542 #$i_sysdir I_SYS_DIR /**/
17543 #$i_sysndir I_SYS_NDIR /**/
17544 #$i_systypes I_SYS_TYPES /**/
17546 #if defined(I_SYS_TYPES)
17547 #include <sys/types.h>
17549 #if defined(I_DIRENT)
17550 #include <dirent.h>
17551 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17552 #include <sys/dir.h>
17556 #include <sys/ndir.h>
17560 #include <ndir.h> /* may be wrong in the future */
17562 #include <sys/dir.h>
17567 int main() { return closedir(opendir(".")); }
17570 if eval $compile_ok; then
17571 if $run ./try > /dev/null 2>&1 ; then
17572 echo "Yes, it does."
17575 echo "No, it doesn't."
17579 echo "(I can't seem to compile the test program--assuming it doesn't)"
17587 set d_void_closedir
17590 : see if there is a wait4
17594 : see if waitpid exists
17595 set waitpid d_waitpid
17598 : see if wcstombs exists
17599 set wcstombs d_wcstombs
17602 : see if wctomb exists
17603 set wctomb d_wctomb
17606 : see if writev exists
17607 set writev d_writev
17610 : preserve RCS keywords in files with variable substitution, grrr
17615 Revision='$Revision'
17617 : check for alignment requirements
17619 case "$usecrosscompile$multiarch" in
17622 You seem to be either cross-compiling or doing a multiarchitecture build,
17623 skipping the memory alignment check.
17626 case "$alignbytes" in
17627 '') alignbytes=8 ;;
17631 case "$alignbytes" in
17632 '') echo "Checking alignment constraints..." >&4
17633 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17634 $cat >try.c <<'EOCP'
17635 typedef long double NV;
17638 $cat >try.c <<'EOCP'
17642 $cat >>try.c <<'EOCP'
17650 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17655 if eval $compile_ok; then
17659 echo "(I can't seem to compile the test program...)"
17662 *) dflt="$alignbytes"
17665 rp="Doubles must be aligned on a how-many-byte boundary?"
17673 : set the base revision
17676 : how do we concatenate cpp tokens here?
17678 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17679 $cat >cpp_stuff.c <<'EOCP'
17680 #define RCAT(a,b)a/**/b
17681 #define ACAT(a,b)a ## b
17685 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17686 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17687 echo "Oh! Smells like ANSI's been here." >&4
17688 echo "We can catify or stringify, separately or together!"
17690 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17691 echo "Ah, yes! The good old days!" >&4
17692 echo "However, in the good old days we don't know how to stringify and"
17693 echo "catify at the same time."
17697 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17698 You're going to have to edit the values of CAT[2-5] in config.h...
17700 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17704 : see if this is a db.h system
17710 : Check db version.
17712 echo "Checking Berkeley DB version ..." >&4
17718 #include <sys/types.h>
17720 #$i_stdlib I_STDLIB
17722 #include <stdlib.h>
17725 int main(int argc, char *argv[])
17727 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17728 int Major, Minor, Patch ;
17729 unsigned long Version ;
17730 (void)db_version(&Major, &Minor, &Patch) ;
17732 printf("%d %d %d %d %d %d\n",
17733 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17734 Major, Minor, Patch);
17737 printf("You have Berkeley DB Version 2 or greater.\n");
17739 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17740 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17741 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17742 Major, Minor, Patch) ;
17744 /* check that db.h & libdb are compatible */
17745 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17746 printf("db.h and libdb are incompatible.\n") ;
17750 printf("db.h and libdb are compatible.\n") ;
17752 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17753 + DB_VERSION_PATCH ;
17755 /* needs to be >= 2.3.4 */
17756 if (Version < 2003004) {
17757 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17758 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17764 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17769 printf("You have Berkeley DB Version 1.\n");
17770 exit(0); /* DB version < 2: the coast is clear. */
17772 exit(1); /* <db.h> not Berkeley DB? */
17778 if eval $compile_ok && $run ./try; then
17779 echo 'Looks OK.' >&4
17781 db_version_major=$1
17782 db_version_minor=$2
17783 db_version_patch=$3
17785 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17789 : Remove db from list of libraries to use
17790 echo "Removing unusable -ldb from library list" >&4
17791 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17794 echo "libs = $libs" >&4
17804 : Check the return type needed for hash
17806 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17812 #include <sys/types.h>
17815 #ifndef DB_VERSION_MAJOR
17816 u_int32_t hash_cb (ptr, size)
17824 info.hash = hash_cb;
17828 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17829 if $contains warning try.out >>/dev/null 2>&1 ; then
17832 db_hashtype='u_int32_t'
17835 : XXX Maybe we should just give up here.
17836 db_hashtype=u_int32_t
17838 echo "Help: I can't seem to compile the db test program." >&4
17839 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17842 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17844 *) db_hashtype=u_int32_t
17849 : Check the return type needed for prefix
17851 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17857 #include <sys/types.h>
17860 #ifndef DB_VERSION_MAJOR
17861 size_t prefix_cb (key1, key2)
17869 info.prefix = prefix_cb;
17873 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17874 if $contains warning try.out >>/dev/null 2>&1 ; then
17875 db_prefixtype='int'
17877 db_prefixtype='size_t'
17880 db_prefixtype='size_t'
17881 : XXX Maybe we should just give up here.
17883 echo "Help: I can't seem to compile the db test program." >&4
17884 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17887 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17889 *) db_prefixtype='size_t'
17894 : How can we generate normalized random numbers ?
17896 echo "Looking for a random number function..." >&4
17897 case "$randfunc" in
17899 if set drand48 val -f; eval $csym; $val; then
17901 echo "Good, found drand48()." >&4
17902 elif set random val -f; eval $csym; $val; then
17904 echo "OK, found random()." >&4
17907 echo "Yick, looks like I have to use rand()." >&4
17918 *-Dmy_rand=*|*-Dmy_srand=*)
17919 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17920 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17921 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17922 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17926 while $test "$cont"; do
17927 rp="Use which function to generate random numbers?"
17929 if $test "$ans" = "$dflt"; then
17935 if set $ans val -f; eval $csym; $val; then
17939 rp="I cannot find function $ans. Use that name anyway?"
17948 case "$randfunc" in
17950 drand01="drand48()"
17956 case "$randbits" in
17958 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17960 #$i_unistd I_UNISTD
17961 #$i_stdlib I_STDLIB
17964 # include <unistd.h>
17967 # include <stdlib.h>
17972 register unsigned long tmp;
17973 register unsigned long max = 0L;
17975 for (i = 1000; i; i--) {
17976 tmp = (unsigned long) $randfunc();
17977 if (tmp > max) max = tmp;
17979 for (i = 0; max; i++)
17985 if eval $compile_ok; then
17989 echo "(I can't seem to compile the test program...)"
17996 rp="How many bits does your $randfunc() function produce?"
18000 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18001 seedfunc="s$randfunc"
18002 randseedtype=unsigned
18006 rp="How many bits does your $randfunc() function produce?"
18009 seedfunc="s$randfunc"
18010 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18011 if set $seedfunc val -f; eval $csym; $val; then
18012 echo "(Using $seedfunc() to seed random generator)"
18014 echo "(Warning: no $seedfunc() to seed random generator)"
18017 randseedtype=unsigned
18025 echo "Determining whether or not we are on an EBCDIC system..." >&4
18026 $cat >try.c <<'EOM'
18029 if ('M'==0xd4) return 0;
18036 if eval $compile_ok; then
18037 if $run ./try; then
18038 echo "You seem to speak EBCDIC." >&4
18041 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18044 echo "I'm unable to compile the test program." >&4
18045 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18053 Checking how to flush all pending stdio output...
18055 # I only know how to find the first 32 possibly open files on SunOS.
18056 # See also hints/sunos_4_1.sh and util.c --AD
18058 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18060 $cat >>try.c <<EOCP
18062 #$i_stdlib I_STDLIB
18064 #include <stdlib.h>
18066 #$i_unistd I_UNISTD
18068 # include <unistd.h>
18070 #$d_sysconf HAS_SYSCONF
18071 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18072 #ifdef HAS_STDIO_STREAM_ARRAY
18073 # define STDIO_STREAM_ARRAY $stdio_stream_array
18078 p = fopen("try.out", "w");
18082 # ifdef TRY_FPRINTF
18086 #ifdef TRY_FFLUSH_NULL
18089 #ifdef TRY_FFLUSH_ALL
18091 long open_max = -1;
18092 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18093 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18095 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18096 open_max = sysconf(_SC_OPEN_MAX);
18099 open_max = FOPEN_MAX;
18102 open_max = OPEN_MAX;
18111 # ifdef HAS_STDIO_STREAM_ARRAY
18112 if (open_max > 0) {
18114 for (i = 0; i < open_max; i++)
18115 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18116 STDIO_STREAM_ARRAY[i]._file < open_max &&
18117 STDIO_STREAM_ARRAY[i]._flag)
18118 fflush(&STDIO_STREAM_ARRAY[i]);
18126 : first we have to find out how _not_ to flush
18128 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18130 set try -DTRY_FPUTC
18131 if eval $compile; then
18132 $run ./try 2>/dev/null
18135 if $test ! -s try.out -a "X$code" = X42; then
18141 set try -DTRY_FPRINTF
18142 if eval $compile; then
18143 $run ./try 2>/dev/null
18146 if $test ! -s try.out -a "X$code" = X42; then
18147 output=-DTRY_FPRINTF
18153 : check for fflush NULL behaviour
18154 case "$fflushNULL" in
18155 '') set try -DTRY_FFLUSH_NULL $output
18156 if eval $compile; then
18157 $run ./try 2>/dev/null
18160 if $test -s try.out -a "X$code" = X42; then
18161 fflushNULL="`$cat try.out`"
18163 if $test "X$code" != X42; then
18165 (If this test failed, don't worry, we'll try another method shortly.)
18170 $rm -f core try.core core.try.*
18171 case "$fflushNULL" in
18173 Your fflush(NULL) works okay for output streams.
18174 Let's see if it clobbers input pipes...
18176 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18177 # bug that improperly flushes the input end of pipes. So we avoid the
18178 # autoflush on fork/system/exec support for now. :-(
18179 $cat >tryp.c <<EOCP
18182 main(int argc, char **argv)
18188 while ((i = getc(stdin)) != -1
18189 && (*bp++ = i) != '\n'
18190 && bp < &buf[1024])
18193 fprintf(stdout, "%s", buf);
18201 fflushNULL="$define"
18203 if eval $compile; then
18205 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18206 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18208 fflush(NULL) seems to behave okay with input streams.
18210 fflushNULL="$define"
18213 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18215 fflushNULL="$undef"
18218 $rm -f core tryp.c tryp.core core.tryp.*
18221 Your fflush(NULL) isn't working (contrary to ANSI C).
18223 fflushNULL="$undef"
18226 Cannot figure out whether your fflush(NULL) works or not.
18227 I'm assuming it doesn't (contrary to ANSI C).
18229 fflushNULL="$undef"
18233 $define|true|[yY]*)
18234 fflushNULL="$define"
18237 fflushNULL="$undef"
18240 : check explicit looping only if NULL did not work, and if the pipe
18241 : bug does not show up on an explicit flush too
18242 case "$fflushNULL" in
18244 $cat >tryp.c <<EOCP
18247 main(int argc, char **argv)
18253 while ((i = getc(stdin)) != -1
18254 && (*bp++ = i) != '\n'
18255 && bp < &buf[1024])
18258 fprintf(stdout, "%s", buf);
18267 if eval $compile; then
18269 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18270 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18272 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18274 : now check for fflushall behaviour
18275 case "$fflushall" in
18276 '') set try -DTRY_FFLUSH_ALL $output
18277 if eval $compile; then
18279 (Now testing the other method--but note that this also may fail.)
18281 $run ./try 2>/dev/null
18284 if $test -s try.out -a "X$code" = X42; then
18285 fflushall="`$cat try.out`"
18288 $rm -f core try.core core.try.*
18289 case "$fflushall" in
18291 Whew. Flushing explicitly all the stdio streams works.
18293 fflushall="$define"
18296 Sigh. Flushing explicitly all the stdio streams doesn't work.
18301 Cannot figure out whether flushing stdio streams explicitly works or not.
18302 I'm assuming it doesn't.
18308 "$define"|true|[yY]*)
18309 fflushall="$define"
18317 All is futile. Even fflush(stdin) clobbers input pipes!
18324 $rm -f core tryp.c tryp.core core.tryp.*
18326 *) fflushall="$undef"
18330 case "$fflushNULL$fflushall" in
18333 OK, I give up. I cannot figure out how to flush pending stdio output.
18334 We won't be flushing handles at all before fork/exec/popen.
18338 $rm -f try.* try$exe_ext
18340 : Store the full pathname to the ar program for use in the C program
18341 : Respect a hint or command line value for full_ar.
18346 : Store the full pathname to the sed program for use in the C program
18349 : see what type gids are declared as in the kernel
18351 echo "Looking for the type for group ids returned by getgid()."
18352 set gid_t gidtype xxx stdio.h sys/types.h
18356 xxx=`./findhdr sys/user.h`
18357 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18359 unsigned) dflt="$1 $2" ;;
18363 *) dflt="$gidtype";;
18366 gid_t) echo "gid_t found." ;;
18367 *) rp="What is the type for group ids returned by getgid()?"
18375 *_t) zzz="$gidtype" ;;
18378 echo "Checking the size of $zzz..." >&4
18380 #include <sys/types.h>
18382 #$i_stdlib I_STDLIB
18384 #include <stdlib.h>
18387 printf("%d\n", (int)sizeof($gidtype));
18392 if eval $compile_ok; then
18396 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18399 echo "Your $zzz is $gidsize bytes long."
18404 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18410 *_t) zzz="$gidtype" ;;
18413 echo "Checking the sign of $zzz..." >&4
18415 #include <sys/types.h>
18426 if eval $compile; then
18430 echo "(I can't execute the test program--guessing unsigned.)" >&4
18434 1) echo "Your $zzz is unsigned." ;;
18435 -1) echo "Your $zzz is signed." ;;
18441 echo "(I can't compile the test program--guessing unsigned.)" >&4
18447 if $test X"$quadtype" != X; then
18449 echo "Checking how to print 64-bit integers..." >&4
18451 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18452 $cat >try.c <<'EOCP'
18453 #include <sys/types.h>
18456 int q = 12345678901;
18457 printf("%ld\n", q);
18461 if eval $compile; then
18465 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18466 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18467 echo "We will use %d."
18473 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18474 $cat >try.c <<'EOCP'
18475 #include <sys/types.h>
18478 long q = 12345678901;
18479 printf("%ld\n", q);
18483 if eval $compile; then
18487 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18488 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18489 echo "We will use %ld."
18495 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18496 $cat >try.c <<'EOCP'
18497 #include <sys/types.h>
18498 #include <inttypes.h>
18501 int64_t q = 12345678901;
18502 printf("%" PRId64 "\n", q);
18506 if eval $compile; then
18510 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18511 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18512 echo "We will use the C9X style."
18518 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18520 #include <sys/types.h>
18523 $quadtype q = 12345678901;
18524 printf("%Ld\n", q);
18528 if eval $compile; then
18532 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18533 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18534 echo "We will use %Ld."
18540 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18541 $cat >try.c <<'EOCP'
18542 #include <sys/types.h>
18545 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18546 printf("%lld\n", q);
18550 if eval $compile; then
18554 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18555 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18556 echo "We will use the %lld style."
18562 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18564 #include <sys/types.h>
18567 $quadtype q = 12345678901;
18568 printf("%qd\n", q);
18572 if eval $compile; then
18576 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18577 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18578 echo "We will use %qd."
18584 if $test X"$sPRId64" = X; then
18585 echo "Cannot figure out how to print 64-bit integers." >&4
18593 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18594 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18596 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18597 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18603 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18605 if $test X"$ivsize" = X8; then
18606 ivdformat="$sPRId64"
18607 uvuformat="$sPRIu64"
18608 uvoformat="$sPRIo64"
18609 uvxformat="$sPRIx64"
18610 uvXUformat="$sPRIXU64"
18612 if $test X"$ivsize" = X"$longsize"; then
18619 if $test X"$ivsize" = X"$intsize"; then
18627 if $test X"$ivsize" = X"$shortsize"; then
18638 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18639 nveformat="$sPRIeldbl"
18640 nvfformat="$sPRIfldbl"
18641 nvgformat="$sPRIgldbl"
18642 nvEUformat="$sPRIEUldbl"
18643 nvFUformat="$sPRIFUldbl"
18644 nvGUformat="$sPRIGUldbl"
18654 case "$ivdformat" in
18655 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18662 $echo "Checking the format string to be used for gids..." >&4
18665 -1) if $test X"$gidsize" = X"$ivsize"; then
18666 gidformat="$ivdformat"
18668 if $test X"$gidsize" = X"$longsize"; then
18671 if $test X"$gidsize" = X"$intsize"; then
18674 if $test X"$gidsize" = X"$shortsize"; then
18681 *) if $test X"$gidsize" = X"$uvsize"; then
18682 gidformat="$uvuformat"
18684 if $test X"$gidsize" = X"$longsize"; then
18687 if $test X"$gidsize" = X"$intsize"; then
18690 if $test X"$gidsize" = X"$shortsize"; then
18699 : see if getgroups exists
18700 set getgroups d_getgrps
18703 : see if setgroups exists
18704 set setgroups d_setgrps
18708 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18710 case "$d_getgrps$d_setgrps" in
18712 case "$groupstype" in
18713 '') dflt="$gidtype" ;;
18714 *) dflt="$groupstype" ;;
18717 What type of pointer is the second argument to getgroups() and setgroups()?
18718 Usually this is the same as group ids, $gidtype, but not always.
18721 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18725 *) groupstype="$gidtype";;
18729 echo "Checking if your $make program sets \$(MAKE)..." >&4
18730 case "$make_set_make" in
18732 $sed 's/^X //' > testmake.mak << 'EOF'
18734 X @echo 'maketemp="$(MAKE)"'
18736 case "`$make -f testmake.mak 2>/dev/null`" in
18737 *maketemp=*) make_set_make='#' ;;
18738 *) make_set_make="MAKE=$make" ;;
18740 $rm -f testmake.mak
18743 case "$make_set_make" in
18744 '#') echo "Yup, it does.";;
18745 *) echo "Nope, it doesn't.";;
18748 : see what type is used for mode_t
18749 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18750 set mode_t modetype int stdio.h sys/types.h
18753 : see if stdarg is available
18755 if $test `./findhdr stdarg.h`; then
18756 echo "<stdarg.h> found." >&4
18759 echo "<stdarg.h> NOT found." >&4
18763 : see if varags is available
18765 if $test `./findhdr varargs.h`; then
18766 echo "<varargs.h> found." >&4
18768 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18771 : set up the varargs testing programs
18772 $cat > varargs.c <<EOP
18774 #include <stdarg.h>
18777 #include <varargs.h>
18781 int f(char *p, ...)
18795 p = va_arg(ap, char *);
18800 $cat > varargs <<EOP
18802 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18811 : now check which varargs header should be included
18816 if `./varargs I_STDARG`; then
18818 elif `./varargs I_VARARGS`; then
18823 if `./varargs I_VARARGS`; then
18830 echo "I could not find the definition for va_dcl... You have problems..." >&4
18831 val="$undef"; set i_stdarg; eval $setvar
18832 val="$undef"; set i_varargs; eval $setvar
18837 case "$i_varhdr" in
18839 val="$define"; set i_stdarg; eval $setvar
18840 val="$undef"; set i_varargs; eval $setvar
18843 val="$undef"; set i_stdarg; eval $setvar
18844 val="$define"; set i_varargs; eval $setvar
18847 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18851 : see if we need va_copy
18853 case "$i_stdarg" in
18856 #include <stdarg.h>
18858 #$i_stdlib I_STDLIB
18860 #include <stdlib.h>
18862 #include <signal.h>
18865 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18867 return vfprintf(f, fmt, *valp);
18871 myvfprintf(FILE *f, const char *fmt, va_list val)
18873 return ivfprintf(f, fmt, &val);
18877 myprintf(char *fmt, ...)
18880 va_start(val, fmt);
18881 return myvfprintf(stdout, fmt, val);
18885 main(int ac, char **av)
18887 signal(SIGSEGV, exit);
18889 myprintf("%s%cs all right, then\n", "that", '\'');
18894 if eval $compile && $run ./try 2>&1 >/dev/null; then
18895 case "`$run ./try`" in
18896 "that's all right, then")
18902 yes) echo "It seems that you don't need va_copy()." >&4
18903 need_va_copy="$undef"
18905 *) echo "It seems that va_copy() or similar will be needed." >&4
18906 need_va_copy="$define"
18909 $rm -f try.* core core.* *.core *.core.*
18911 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18915 : see what type is used for size_t
18916 rp="What is the type used for the length parameter for string functions?"
18917 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18920 : check for type of arguments to gethostbyaddr.
18921 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18922 case "$d_gethbyaddr" in
18926 Checking to see what type of arguments are accepted by gethostbyaddr().
18928 hdrs="$define sys/types.h
18929 $d_socket sys/socket.h
18930 $i_niin netinet/in.h
18932 $i_unistd unistd.h"
18933 : The first arg can 'char *' or 'void *'
18934 : The second arg is some of integral type
18935 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18936 for yyy in size_t long int; do
18937 case "$netdb_host_type" in
18938 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18939 if ./protochk "$try" $hdrs; then
18940 echo "Your system accepts $xxx for the first arg."
18941 echo "...and $yyy for the second arg."
18942 netdb_host_type="$xxx"
18943 netdb_hlen_type="$yyy"
18949 : In case none of those worked, prompt the user.
18950 case "$netdb_host_type" in
18951 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18954 netdb_host_type=$ans
18955 rp='What is the type for the 2nd argument to gethostbyaddr?'
18958 netdb_hlen_type=$ans
18962 *) : no gethostbyaddr, so pick harmless defaults
18963 netdb_host_type='char *'
18964 netdb_hlen_type="$sizetype"
18967 # Remove the "const" if needed. -- but then we'll have a
18969 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18972 : check for type of argument to gethostbyname.
18973 if test "X$netdb_name_type" = X ; then
18974 case "$d_gethbyname" in
18978 Checking to see what type of argument is accepted by gethostbyname().
18980 hdrs="$define sys/types.h
18981 $d_socket sys/socket.h
18982 $i_niin netinet/in.h
18984 $i_unistd unistd.h"
18985 for xxx in "const char *" "char *"; do
18986 case "$netdb_name_type" in
18987 '') try="extern struct hostent *gethostbyname($xxx);"
18988 if ./protochk "$try" $hdrs; then
18989 echo "Your system accepts $xxx."
18990 netdb_name_type="$xxx"
18995 : In case none of those worked, prompt the user.
18996 case "$netdb_name_type" in
18997 '') rp='What is the type for the 1st argument to gethostbyname?'
19000 netdb_name_type=$ans
19004 *) : no gethostbyname, so pick harmless default
19005 netdb_name_type='char *'
19010 : check for type of 1st argument to getnetbyaddr.
19011 if test "X$netdb_net_type" = X ; then
19012 case "$d_getnbyaddr" in
19016 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19018 hdrs="$define sys/types.h
19019 $d_socket sys/socket.h
19020 $i_niin netinet/in.h
19022 $i_unistd unistd.h"
19023 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19024 case "$netdb_net_type" in
19025 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19026 if ./protochk "$try" $hdrs; then
19027 echo "Your system accepts $xxx."
19028 netdb_net_type="$xxx"
19033 : In case none of those worked, prompt the user.
19034 case "$netdb_net_type" in
19035 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19038 netdb_net_type=$ans
19042 *) : no getnetbyaddr, so pick harmless default
19043 netdb_net_type='long'
19047 : locate the preferred pager for this system
19054 [a-zA-Z]:/*) dflt=$pg;;
19058 [a-zA-Z]:/*) dflt=$more;;
19062 [a-zA-Z]:/*) dflt=$less;;
19065 '') dflt=/usr/ucb/more;;
19069 : Instruct ./getfile to trust the hinted or previous pager value,
19070 : even if it does not begin with a slash. For example, on os2,
19071 : pager might be cmd /c more. See comments in UU/getfile.
19076 rp='What pager is used on your system?'
19080 : see what type pids are declared as in the kernel
19081 rp="What is the type of process ids on this system?"
19082 set pid_t pidtype int stdio.h sys/types.h
19085 : see if ar generates random libraries by itself
19087 echo "Checking how to generate random libraries on your machine..." >&4
19088 echo 'int bar1() { return bar2(); }' > bar1.c
19089 echo 'int bar2() { return 2; }' > bar2.c
19091 #$i_stdlib I_STDLIB
19093 #include <stdlib.h>
19095 int main() { printf("%d\n", bar1()); exit(0); }
19097 $cc $ccflags -c bar1.c >/dev/null 2>&1
19098 $cc $ccflags -c bar2.c >/dev/null 2>&1
19099 $cc $ccflags -c foo.c >/dev/null 2>&1
19100 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19101 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19102 $run ./foobar >/dev/null 2>&1; then
19103 echo "$ar appears to generate random libraries itself."
19105 if [ "X$ranlib" = "X" ]; then
19108 elif $ar ts bar$_a >/dev/null 2>&1 &&
19109 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19110 $run ./foobar >/dev/null 2>&1; then
19111 echo "a table of contents needs to be added with '$ar ts'."
19118 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19119 $test -f $ranlib || ranlib=''
19122 if $test -n "$ranlib"; then
19123 echo "your system has '$ranlib'; we'll use that."
19126 echo "your system doesn't seem to support random libraries"
19127 echo "so we'll use lorder and tsort to order the libraries."
19134 : check for type of arguments to select.
19135 case "$selecttype" in
19136 '') case "$d_select" in
19140 Checking to see what type of arguments are accepted by select().
19142 hdrs="$define sys/types.h
19143 $i_systime sys/time.h
19144 $i_sysselct sys/select.h
19145 $d_socket sys/socket.h"
19146 : The first arg can be int, unsigned, or size_t
19147 : The last arg may or may not be 'const'
19149 : void pointer has been seen but using that
19150 : breaks the selectminbits test
19151 for xxx in 'fd_set *' 'int *'; do
19152 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19153 for tmo in 'struct timeval *' 'const struct timeval *'; do
19155 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19156 if ./protochk "$try" $hdrs; then
19157 echo "Your system accepts $xxx."
19166 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19167 case "$d_fd_set" in
19168 $define) dflt="fd_set *" ;;
19177 *) : no select, so pick a harmless default
19184 : check for the select 'width'
19185 case "$selectminbits" in
19186 '') safebits=`expr $ptrsize \* 8`
19187 case "$d_select" in
19191 Checking to see on how many bits at a time your select() operates...
19194 #include <sys/types.h>
19196 #$i_systime I_SYS_TIME
19197 #$i_systimek I_SYS_TIME_KERNEL
19202 # ifdef I_SYS_TIME_KERNEL
19205 # include <sys/time.h>
19206 # ifdef I_SYS_TIME_KERNEL
19210 #$i_sysselct I_SYS_SELECT
19211 #ifdef I_SYS_SELECT
19212 #include <sys/select.h>
19214 #$d_socket HAS_SOCKET
19216 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19219 #$i_stdlib I_STDLIB
19221 #include <stdlib.h>
19224 #define S sizeof(*(b))
19226 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19227 #define NBITS (NBYTES * 8)
19229 char *s = malloc(NBYTES);
19238 fp = fopen("try.c", "r");
19244 b = ($selecttype)s;
19245 for (i = 0; i < NBITS; i++)
19249 select(fd + 1, b, 0, 0, &t);
19250 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19252 printf("%d\n", i + 1);
19257 if eval $compile_ok; then
19258 selectminbits=`$run ./try`
19259 case "$selectminbits" in
19261 Cannot figure out on how many bits at a time your select() operates.
19262 I'll play safe and guess it is $safebits bits.
19264 selectminbits=$safebits
19265 bits="$safebits bits"
19268 *) bits="$selectminbits bits" ;;
19270 echo "Your select() operates on $bits at a time." >&4
19272 rp='What is the minimum number of bits your select() operates on?'
19273 case "$byteorder" in
19274 12345678) dflt=64 ;;
19280 selectminbits="$val"
19284 *) : no select, so pick a harmless default
19285 selectminbits=$safebits
19291 : Trace out the files included by signal.h, then look for SIGxxx names.
19292 : Remove SIGARRAYSIZE used by HPUX.
19293 : Remove SIGSTKSIZE used by Linux.
19294 : Remove SIGSTKSZ used by Posix.
19295 : Remove SIGTYP void lines used by OS2.
19296 : Some cpps, like os390, dont give the file name anywhere
19297 if [ "X$fieldn" = X ]; then
19298 : Just make some guesses. We check them later.
19299 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19301 xxx=`echo '#include <signal.h>' |
19302 $cppstdin $cppminus $cppflags 2>/dev/null |
19303 $grep '^[ ]*#.*include' |
19304 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19306 : Check this list of files to be sure we have parsed the cpp output ok.
19307 : This will also avoid potentially non-existent files, such
19310 for xx in $xxx /dev/null ; do
19311 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19313 : If we have found no files, at least try signal.h
19314 case "$xxxfiles" in
19315 '') xxxfiles=`./findhdr signal.h` ;;
19318 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19319 print substr($2, 4, 20)
19321 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19322 print substr($3, 4, 20)
19324 : Append some common names just in case the awk scan failed.
19325 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19326 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19327 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19328 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19329 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19331 : generate a few handy files for later
19332 $cat > signal.c <<EOCP
19333 #include <sys/types.h>
19334 #include <signal.h>
19335 #$i_stdlib I_STDLIB
19337 #include <stdlib.h>
19342 /* Strange style to avoid deeply-nested #if/#else/#endif */
19345 # define NSIG (_NSIG)
19351 # define NSIG (SIGMAX+1)
19357 # define NSIG (SIG_MAX+1)
19363 # define NSIG (_SIG_MAX+1)
19369 # define NSIG (MAXSIG+1)
19375 # define NSIG (MAX_SIG+1)
19380 # ifdef SIGARRAYSIZE
19381 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19387 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19391 /* Default to some arbitrary number that's big enough to get most
19392 of the common signals.
19398 printf("NSIG %d\n", NSIG);
19404 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19406 printf "#ifdef SIG"; printf $1; printf "\n"
19407 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19408 printf $1; printf ");\n"
19412 printf "#endif /* JUST_NSIG */\n";
19413 printf "exit(0);\n}\n";
19416 $cat >signal.awk <<'EOP'
19417 BEGIN { ndups = 0 }
19418 $1 ~ /^NSIG$/ { nsig = $2 }
19419 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19420 if ($2 > maxsig) { maxsig = $2 }
19421 if (sig_name[$2]) {
19422 dup_name[ndups] = $1
19423 dup_num[ndups] = $2
19435 printf("NSIG %d\n", nsig);
19436 for (n = 1; n < nsig; n++) {
19438 printf("%s %d\n", sig_name[n], sig_num[n])
19441 printf("NUM%d %d\n", n, n)
19444 for (n = 0; n < ndups; n++) {
19445 printf("%s %d\n", dup_name[n], dup_num[n])
19449 $cat >signal_cmd <<EOS
19451 if $test -s signal.lst; then
19452 echo "Using your existing signal.lst file"
19457 $cat >>signal_cmd <<'EOS'
19460 if eval $compile_ok; then
19461 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19463 echo "(I can't seem be able to compile the whole test program)" >&4
19464 echo "(I'll try it in little pieces.)" >&4
19465 set signal -DJUST_NSIG
19466 if eval $compile_ok; then
19467 $run ./signal$_exe > signal.nsg
19470 echo "I can't seem to figure out how many signals you have." >&4
19471 echo "Guessing 50." >&4
19472 echo 'NSIG 50' > signal.nsg
19474 : Now look at all the signal names, one at a time.
19475 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19476 $cat > signal.c <<EOCP
19477 #include <sys/types.h>
19478 #include <signal.h>
19481 printf("$xx %d\n", SIG${xx});
19486 if eval $compile; then
19487 echo "SIG${xx} found."
19488 $run ./signal$_exe >> signal.ls1
19490 echo "SIG${xx} NOT found."
19493 if $test -s signal.ls1; then
19494 $cat signal.nsg signal.ls1 |
19495 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19499 if $test -s signal.lst; then
19502 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19503 echo 'kill -l' >signal
19504 set X `csh -f <signal`
19508 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19510 echo $@ | $tr ' ' $trnl | \
19511 $awk '{ printf "%s %d\n", $1, ++s; }
19512 END { printf "NSIG %d\n", ++s }' >signal.lst
19514 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19516 chmod a+x signal_cmd
19517 $eunicefix signal_cmd
19519 : generate list of signal names
19521 case "$sig_name_init" in
19523 *) case "$sig_num_init" in
19524 ''|*,*) doinit=yes ;;
19529 echo "Generating a list of signal names and numbers..." >&4
19531 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19532 sig_name=`$awk 'BEGIN { printf "ZERO " }
19533 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19534 sig_num=`$awk 'BEGIN { printf "0 " }
19535 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19536 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19537 !/^NSIG/ { printf "\"%s\", ", $1 }
19538 END { printf "0\n" }' signal.lst`
19539 sig_num_init=`$awk 'BEGIN { printf "0, " }
19540 !/^NSIG/ { printf "%d, ", $2}
19541 END { printf "0\n"}' signal.lst`
19544 echo "The following $sig_count signals are available:"
19546 echo $sig_name | $awk \
19547 'BEGIN { linelen = 0 }
19549 for (i = 1; i <= NF; i++) {
19550 name = "SIG" $i " "
19551 linelen = linelen + length(name)
19552 if (linelen > 70) {
19554 linelen = length(name)
19560 sig_size=`echo $sig_name | awk '{print NF}'`
19561 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19564 case "$sizetype" in
19565 *_t) zzz="$sizetype" ;;
19566 *) zzz="filesize" ;;
19568 echo "Checking the size of $zzz..." >&4
19570 #include <sys/types.h>
19572 #$i_stdlib I_STDLIB
19574 #include <stdlib.h>
19577 printf("%d\n", (int)sizeof($sizetype));
19582 if eval $compile_ok; then
19586 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19589 echo "Your $zzz size is $sizesize bytes."
19594 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19598 : check for socklen_t
19600 echo "Checking to see if you have socklen_t..." >&4
19602 #include <sys/types.h>
19603 #$d_socket HAS_SOCKET
19605 #include <sys/socket.h>
19607 int main() { socklen_t x = 16; }
19610 if eval $compile; then
19612 echo "You have socklen_t."
19615 echo "You do not have socklen_t."
19616 case "$sizetype" in
19617 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19624 : see if this is a socks.h system
19625 set socks.h i_socks
19628 : check for type of the size argument to socket calls
19629 case "$d_socket" in
19633 Checking to see what type is the last argument of accept().
19636 case "$d_socklen_t" in
19637 "$define") yyy="$yyy socklen_t"
19639 yyy="$yyy $sizetype int long unsigned"
19640 for xxx in $yyy; do
19641 case "$socksizetype" in
19642 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19643 case "$usesocks" in
19645 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19646 echo "Your system accepts '$xxx *' for the last argument of accept()."
19647 socksizetype="$xxx"
19650 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19651 echo "Your system accepts '$xxx *' for the last argument of accept()."
19652 socksizetype="$xxx"
19659 : In case none of those worked, prompt the user.
19660 case "$socksizetype" in
19661 '') rp='What is the type for socket address structure sizes?'
19668 *) : no sockets, so pick relatively harmless default
19673 : see what type is used for signed size_t
19674 set ssize_t ssizetype int stdio.h sys/types.h
19679 #$i_stdlib I_STDLIB
19681 #include <stdlib.h>
19683 #include <sys/types.h>
19684 #define Size_t $sizetype
19685 #define SSize_t $dflt
19688 if (sizeof(Size_t) == sizeof(SSize_t))
19690 else if (sizeof(Size_t) == sizeof(int))
19699 if eval $compile_ok && $run ./try > /dev/null; then
19700 ssizetype=`$run ./try`
19701 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19704 Help! I can't compile and run the ssize_t test program: please enlighten me!
19705 (This is probably a misconfiguration in your system or libraries, and
19706 you really ought to fix it. Still, I'll try anyway.)
19708 I need a type that is the same size as $sizetype, but is guaranteed to
19709 be signed. Common values are ssize_t, int and long.
19712 rp="What signed type is the same size as $sizetype?"
19718 : see what type of char stdio uses.
19720 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19721 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19722 echo "Your stdio uses unsigned chars." >&4
19723 stdchar="unsigned char"
19725 echo "Your stdio uses signed chars." >&4
19732 : see what type uids are declared as in the kernel
19734 echo "Looking for the type for user ids returned by getuid()."
19735 set uid_t uidtype xxx stdio.h sys/types.h
19739 xxx=`./findhdr sys/user.h`
19740 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19742 unsigned) dflt="$1 $2" ;;
19746 *) dflt="$uidtype";;
19749 uid_t) echo "uid_t found." ;;
19750 *) rp="What is the type for user ids returned by getuid()?"
19758 *_t) zzz="$uidtype" ;;
19761 echo "Checking the size of $zzz..." >&4
19763 #include <sys/types.h>
19765 #$i_stdlib I_STDLIB
19767 #include <stdlib.h>
19770 printf("%d\n", (int)sizeof($uidtype));
19775 if eval $compile_ok; then
19779 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19782 echo "Your $zzz is $uidsize bytes long."
19787 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19792 *_t) zzz="$uidtype" ;;
19795 echo "Checking the sign of $zzz..." >&4
19797 #include <sys/types.h>
19808 if eval $compile; then
19812 echo "(I can't execute the test program--guessing unsigned.)" >&4
19816 1) echo "Your $zzz is unsigned." ;;
19817 -1) echo "Your $zzz is signed." ;;
19823 echo "(I can't compile the test program--guessing unsigned.)" >&4
19829 $echo "Checking the format string to be used for uids..." >&4
19832 -1) if $test X"$uidsize" = X"$ivsize"; then
19833 uidformat="$ivdformat"
19835 if $test X"$uidsize" = X"$longsize"; then
19838 if $test X"$uidsize" = X"$intsize"; then
19841 if $test X"$uidsize" = X"$shortsize"; then
19848 *) if $test X"$uidsize" = X"$uvsize"; then
19849 uidformat="$uvuformat"
19851 if $test X"$uidsize" = X"$longsize"; then
19854 if $test X"$uidsize" = X"$intsize"; then
19857 if $test X"$uidsize" = X"$shortsize"; then
19867 case "$usesitecustomize" in
19868 $define|true|[Yy]*)
19869 usesitecustomize="$define"
19872 usesitecustomize="$undef"
19876 : determine compiler compiler
19885 if $test -f "$byacc$_exe"; then
19887 comp="byacc or $comp"
19889 if $test -f "$bison$_exe"; then
19890 comp="$comp or bison -y"
19892 rp="Which compiler compiler ($comp) shall I use?"
19901 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19907 : see if this is a fp.h system
19911 : see if this is a fp_class.h system
19912 set fp_class.h i_fp_class
19915 : see if this is a ieeefp.h system
19916 case "$i_ieeefp" in
19917 '' ) set ieeefp.h i_ieeefp
19922 : see if this is a libutil.h system
19923 set libutil.h i_libutil
19926 : see if mach cthreads are available
19927 if test "X$usethreads" = "X$define"; then
19928 set mach/cthreads.h i_machcthr
19931 i_machcthr="$undef"
19936 : see if this is a mntent.h system
19937 set mntent.h i_mntent
19940 : see if ndbm.h is available
19946 # Some Linux distributions such as RedHat 7.1 put the
19947 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19948 if $test -f /usr/include/gdbm/ndbm.h; then
19949 echo '<gdbm/ndbm.h> found.'
19950 ccflags="$ccflags -I/usr/include/gdbm"
19951 cppflags="$cppflags -I/usr/include/gdbm"
19959 : see if dbm_open exists
19960 set dbm_open d_dbm_open
19962 case "$d_dbm_open" in
19965 echo "We won't be including <ndbm.h>"
19974 : see if net/errno.h is available
19976 set net/errno.h val
19979 : Unfortunately, it causes problems on some systems. Arrgh.
19982 cat > try.c <<'EOM'
19985 #include <net/errno.h>
19991 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19992 echo "We'll be including <net/errno.h>." >&4
19994 echo "We won't be including <net/errno.h>." >&4
20003 : see if netinet/tcp.h is available
20004 set netinet/tcp.h i_netinettcp
20007 : see if this is a poll.h system
20011 : see if this is a prot.h system
20016 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20017 $cat <<'EOSH' > Cppsym.know
20018 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20019 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20020 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20021 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20022 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20023 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20024 bull c cadmus clipper CMU COFF COMPILER_VERSION
20025 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20026 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20027 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20028 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20030 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20031 H3050R H3050RX hbullx20 hcx host_mips
20032 hp200 hp300 hp700 HP700 hp800 hp9000
20033 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20034 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20035 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20036 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20037 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20038 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20039 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20040 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20041 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20042 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20043 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20044 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20045 MATH_HAS_NO_SIDE_EFFECTS
20046 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20047 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20048 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20049 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20050 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20051 NetBSD news1500 news1700 news1800 news1900 news3700
20052 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20053 ns32016 ns32332 ns32k nsc32000
20054 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20055 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20056 pc532 pdp11 PGC PIC plexus PORTAR posix
20057 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20058 POSIX_C_SOURCE POSIX_SOURCE POWER
20059 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20060 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20061 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20062 sony sony_news sonyrisc sparc sparclite spectrum
20063 stardent stdc STDC_EXT stratos sun sun3 sun386
20064 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20065 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20066 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20067 sysV68 sysV88 Tek4132 Tek4300 titan
20068 TM3200 TM5400 TM5600
20069 tower tower32 tower32_200 tower32_600 tower32_700
20070 tower32_800 tower32_850 tss
20071 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20072 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20073 unix UNIX95 UNIX99 unixpc unos
20074 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20075 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20076 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20078 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20079 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20080 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20083 # Maybe put other stuff here too.
20084 cat <<EOSH >>Cppsym.know
20087 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20088 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20089 $cat Cppsym.know > Cppsym.c
20090 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20091 $rm -f Cppsym.a Cppsym.b Cppsym.c
20092 cat <<EOSH > Cppsym
20094 if $test \$# -gt 0; then
20095 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20096 if $test -s Cppsym.got; then
20103 $tr " " "$trnl" | ./Cppsym.try
20109 cat <<EOSH > Cppsym.try
20111 cat <<'EOCP' > try.c
20117 cat <<'EOSH' >> Cppsym.try
20119 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
20120 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
20121 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
20122 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
20124 echo 'return 0;}' >> try.c
20126 cat <<EOSH >> Cppsym.try
20128 case "$osname-$gccversion" in
20129 irix-) ccflags="\$ccflags -woff 1178" ;;
20130 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20132 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
20134 chmod +x Cppsym.try
20135 $eunicefix Cppsym.try
20136 ./Cppsym < Cppsym.know > Cppsym.true
20137 : now check the C compiler for additional symbols
20138 postprocess_cc_v=''
20140 aix) postprocess_cc_v="|$tr , ' '" ;;
20147 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20150 -D*) echo "\$i" | $sed 's/^-D//';;
20151 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20156 postprocess_cc_v=''
20159 ./ccsym > ccsym1.raw
20160 if $test -s ccsym1.raw; then
20161 $sort ccsym1.raw | $uniq >ccsym.raw
20163 mv ccsym1.raw ccsym.raw
20166 $awk '/\=/ { print $0; next }
20167 { print $0"=1" }' ccsym.raw >ccsym.list
20168 $awk '/\=/ { print $0; next }
20169 { print $0"=1" }' Cppsym.true >ccsym.true
20170 $comm -13 ccsym.true ccsym.list >ccsym.own
20171 $comm -12 ccsym.true ccsym.list >ccsym.com
20172 $comm -23 ccsym.true ccsym.list >ccsym.cpp
20174 if $test -z ccsym.raw; then
20175 echo "Your C compiler doesn't seem to define any symbols!" >&4
20177 echo "However, your C preprocessor defines the following symbols:"
20180 cppsymbols=`$cat Cppsym.true`
20181 cppsymbols=`echo $cppsymbols`
20182 cppccsymbols="$cppsymbols"
20184 if $test -s ccsym.com; then
20185 echo "Your C compiler and pre-processor define these symbols:"
20186 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20189 cppccsymbols=`$cat ccsym.com`
20190 cppccsymbols=`echo $cppccsymbols`
20191 $test "$silent" || sleep 1
20193 if $test -s ccsym.cpp; then
20194 $test "$also" && echo " "
20195 echo "Your C pre-processor ${also}defines the following symbols:"
20196 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20198 cppsymbols=`$cat ccsym.cpp`
20199 cppsymbols=`echo $cppsymbols`
20200 $test "$silent" || sleep 1
20202 if $test -s ccsym.own; then
20203 $test "$also" && echo " "
20204 echo "Your C compiler ${also}defines the following cpp symbols:"
20205 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20206 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20207 ccsymbols=`$cat ccsym.own`
20208 ccsymbols=`echo $ccsymbols`
20209 $test "$silent" || sleep 1
20213 : see if this is a termio system
20217 if $test `./findhdr termios.h`; then
20218 set tcsetattr i_termios
20224 "$define") echo "You have POSIX termios.h... good!" >&4;;
20225 *) if ./Cppsym pyr; then
20226 case "`/bin/universe`" in
20227 ucb) if $test `./findhdr sgtty.h`; then
20229 echo "<sgtty.h> found." >&4
20231 echo "System is pyramid with BSD universe."
20232 echo "<sgtty.h> not found--you could have problems." >&4
20234 *) if $test `./findhdr termio.h`; then
20236 echo "<termio.h> found." >&4
20238 echo "System is pyramid with USG universe."
20239 echo "<termio.h> not found--you could have problems." >&4
20243 if $test `./findhdr termio.h`; then
20244 echo "<termio.h> found." >&4
20246 elif $test `./findhdr sgtty.h`; then
20247 echo "<sgtty.h> found." >&4
20250 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20253 if $test `./findhdr sgtty.h`; then
20254 echo "<sgtty.h> found." >&4
20256 elif $test `./findhdr termio.h`; then
20257 echo "<termio.h> found." >&4
20260 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20264 set i_termio; eval $setvar
20265 val=$val2; set i_sgtty; eval $setvar
20266 val=$val3; set i_termios; eval $setvar
20268 : see if stddef is available
20269 set stddef.h i_stddef
20272 : see if this is a sunmath.h system
20273 set sunmath.h i_sunmath
20276 : see if sys/access.h is available
20277 set sys/access.h i_sysaccess
20280 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20281 set sys/filio.h i_sysfilio
20284 if $test `./findhdr sys/ioctl.h`; then
20286 echo '<sys/ioctl.h> found.' >&4
20289 if $test $i_sysfilio = "$define"; then
20290 echo '<sys/ioctl.h> NOT found.' >&4
20292 $test $i_sgtty = "$define" && xxx="sgtty.h"
20293 $test $i_termio = "$define" && xxx="termio.h"
20294 $test $i_termios = "$define" && xxx="termios.h"
20295 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20301 : see if socket ioctl defs are in sys/sockio.h
20303 xxx=`./findhdr sys/sockio.h`
20304 if $test "$xxx"; then
20305 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20307 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20310 echo "No socket ioctls found in <sys/sockio.h>." >&4
20315 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20322 : see if this is a syslog.h system
20323 set syslog.h i_syslog
20327 : see if this is a sys/mode.h system
20328 set sys/mode.h i_sysmode
20331 : see if sys/resource.h has to be included
20332 set sys/resource.h i_sysresrc
20335 : see if sys/security.h is available
20336 set sys/security.h i_syssecrt
20339 : see if this is a sys/statvfs.h system
20340 set sys/statvfs.h i_sysstatvfs
20343 : see if this is a sys/un.h system
20344 set sys/un.h i_sysun
20348 : see if this is a sys/utsname.h system
20349 set sys/utsname.h i_sysutsname
20352 : see if this is a syswait system
20353 set sys/wait.h i_syswait
20356 : see if this is a ustat.h system
20357 set ustat.h i_ustat
20360 : see if this is an utime system
20361 set utime.h i_utime
20364 : see if this is a values.h system
20365 set values.h i_values
20368 : see if this is a vfork system
20371 set vfork.h i_vfork
20379 : see if gdbm.h is available
20384 : see if gdbm_open exists
20385 set gdbm_open d_gdbm_open
20387 case "$d_gdbm_open" in
20390 echo "We won't be including <gdbm.h>"
20400 echo "Looking for extensions..." >&4
20401 : If we are using the old config.sh, known_extensions may contain
20402 : old or inaccurate or duplicate values.
20403 known_extensions=''
20404 nonxs_extensions=''
20405 : We do not use find because it might not be available.
20406 : We do not just use MANIFEST because the user may have dropped
20407 : some additional extensions into the source tree and expect them
20410 : Function to recursively find available extensions, ignoring DynaLoader
20411 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20415 DynaLoader|dynaload) ;;
20417 if $test -f $xxx/$xxx.xs; then
20418 known_extensions="$known_extensions $1$xxx";
20419 elif $test -f $xxx/Makefile.PL; then
20420 nonxs_extensions="$nonxs_extensions $1$xxx";
20422 if $test -d $xxx -a $# -lt 10; then
20425 eval $find_extensions;
20437 eval $find_extensions
20438 # Special case: Add in threads/shared since it is not picked up by the
20439 # recursive find above (and adding in general recursive finding breaks
20440 # SDBM_File/sdbm). A.D. 10/25/2001.
20441 known_extensions="$known_extensions threads/shared"
20442 set X $nonxs_extensions
20444 nonxs_extensions="$*"
20445 set X $known_extensions
20447 known_extensions="$*"
20450 : Now see which are supported on this system.
20452 for xxx in $known_extensions ; do
20456 $define) avail_ext="$avail_ext $xxx" ;;
20459 GDBM_File|gdbm_fil)
20461 $define) avail_ext="$avail_ext $xxx" ;;
20464 I18N/Langinfo|i18n_lan)
20465 case "$i_langinfo$d_nl_langinfo" in
20466 $define$define) avail_ext="$avail_ext $xxx" ;;
20469 NDBM_File|ndbm_fil)
20472 case "$osname-$use64bitint" in
20475 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20478 *) avail_ext="$avail_ext $xxx" ;;
20483 ODBM_File|odbm_fil)
20484 case "${i_dbm}${i_rpcsvcdbm}" in
20486 case "$osname-$use64bitint" in
20489 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20492 *) avail_ext="$avail_ext $xxx" ;;
20498 case "$useposix" in
20499 true|define|y) avail_ext="$avail_ext $xxx" ;;
20503 case "$useopcode" in
20504 true|define|y) avail_ext="$avail_ext $xxx" ;;
20508 case "$d_socket" in
20511 beos) ;; # not unless BONE
20512 *) avail_ext="$avail_ext $xxx" ;;
20517 Sys/Syslog|sys/syslog)
20518 : XXX syslog requires socket
20519 case "$d_socket" in
20520 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20524 case "$usethreads" in
20526 case "$useithreads" in
20527 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20531 XS/APItest|xs/apitest)
20532 # This is just for testing. Skip it unless we have dynamic loading.
20535 $define) avail_ext="$avail_ext $xxx" ;;
20538 XS/Typemap|xs/typemap)
20539 # This is just for testing. Skip it unless we have dynamic loading.
20541 $define) avail_ext="$avail_ext $xxx" ;;
20544 threads|threads/shared)
20545 # threads and threads::shared are special cases.
20546 # To stop people from asking "Perl 5.8.0 was supposed
20547 # to have this new fancy threads implementation but my
20548 # perl doesn't have it" and from people trying to
20549 # (re)install the threads module using CPAN.pm and
20550 # CPAN.pm then offering to reinstall Perl 5.8.0,
20551 # the threads.pm and threads/shared.pm will always be
20552 # there, croaking informatively ("you need to rebuild
20553 # all of Perl with threads, sorry") when threads haven't
20554 # been compiled in.
20556 avail_ext="$avail_ext $xxx"
20559 : XXX Do we need a useipcsysv variable here
20560 case "${d_msg}${d_sem}${d_shm}" in
20561 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20564 *) avail_ext="$avail_ext $xxx"
20573 case "$onlyextensions" in
20575 *) keepextensions=''
20576 echo "You have requested that only certains extensions be included..." >&4
20577 for i in $onlyextensions; do
20578 case " $avail_ext " in
20580 echo "Keeping extension $i."
20581 keepextensions="$keepextensions $i"
20583 *) echo "Ignoring extension $i." ;;
20586 avail_ext="$keepextensions"
20590 case "$noextensions" in
20592 *) keepextensions=''
20593 echo "You have requested that certain extensions be ignored..." >&4
20594 for i in $avail_ext; do
20595 case " $noextensions " in
20596 *" $i "*) echo "Ignoring extension $i." ;;
20597 *) echo "Keeping extension $i.";
20598 keepextensions="$keepextensions $i"
20602 avail_ext="$keepextensions"
20606 : Now see which nonxs extensions are supported on this system.
20607 : For now assume all are.
20609 for xxx in $nonxs_extensions ; do
20611 *) nonxs_ext="$nonxs_ext $xxx"
20623 A number of extensions are supplied with $package. You may choose to
20624 compile these extensions for dynamic loading (the default), compile
20625 them into the $package executable (static loading), or not include
20626 them at all. Answer "none" to include no extensions.
20627 Note that DynaLoader is always built and need not be mentioned here.
20630 case "$dynamic_ext" in
20632 : Exclude those listed in static_ext
20634 for xxx in $avail_ext; do
20635 case " $static_ext " in
20637 *) dflt="$dflt $xxx" ;;
20644 *) dflt="$dynamic_ext"
20645 # Perhaps we are reusing an old out-of-date config.sh.
20648 if test X"$dynamic_ext" != X"$avail_ext"; then
20650 NOTICE: Your previous config.sh list may be incorrect.
20651 The extensions now available to you are
20653 but the default list from your previous config.sh is
20665 rp="What extensions do you wish to load dynamically?"
20668 none) dynamic_ext=' ' ;;
20669 *) dynamic_ext="$ans" ;;
20672 case "$static_ext" in
20674 : Exclude those already listed in dynamic linking
20676 for xxx in $avail_ext; do
20677 case " $dynamic_ext " in
20679 *) dflt="$dflt $xxx" ;;
20686 *) dflt="$static_ext"
20693 rp="What extensions do you wish to load statically?"
20696 none) static_ext=' ' ;;
20697 *) static_ext="$ans" ;;
20702 A number of extensions are supplied with $package. Answer "none"
20703 to include no extensions.
20704 Note that DynaLoader is always built and need not be mentioned here.
20707 case "$static_ext" in
20708 '') dflt="$avail_ext" ;;
20709 *) dflt="$static_ext"
20710 # Perhaps we are reusing an old out-of-date config.sh.
20713 if test X"$static_ext" != X"$avail_ext"; then
20715 NOTICE: Your previous config.sh list may be incorrect.
20716 The extensions now available to you are
20718 but the default list from your previous config.sh is
20727 : Exclude those that are not xs extensions
20731 rp="What extensions do you wish to include?"
20734 none) static_ext=' ' ;;
20735 *) static_ext="$ans" ;;
20740 # Encode is a special case. If we are building Encode as a static
20741 # extension, we need to explicitly list its subextensions as well.
20742 # For other nested extensions, this is handled automatically by
20743 # the appropriate Makefile.PL.
20744 case " $static_ext " in
20745 *" Encode "*) # Add the subextensions of Encode
20747 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20748 static_ext="$static_ext Encode/$xxx"
20754 set X $dynamic_ext $static_ext $nonxs_ext
20758 # Sanity check: We require an extension suitable for use with
20759 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20760 # should show up as failures in the test suite, but it's helpful to
20761 # catch them now.) The 'extensions' list is normally sorted
20762 # alphabetically, so we need to accept either
20763 # DB_File ... Fcntl ... IO ....
20764 # or something like
20765 # Fcntl ... NDBM_File ... IO ....
20766 case " $extensions" in
20767 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20768 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20769 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20770 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20771 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20775 : Remove libraries needed only for extensions
20776 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20777 : The exception is SunOS 4.x, which needs them.
20778 case "${osname}X${osvers}" in
20782 *) case "$usedl" in
20783 $define|true|[yY]*)
20784 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20788 *) perllibs="$libs"
20794 : Remove build directory name from cppstdin so it can be used from
20795 : either the present location or the final installed location.
20797 : Get out of the UU directory to get correct path name.
20799 case "$cppstdin" in
20801 echo "Stripping down cppstdin path name"
20807 : end of configuration questions
20809 echo "End of configuration questions."
20812 : back to where it started
20813 if test -d ../UU; then
20817 : configuration may be patched via a 'config.arch' file
20818 if $test -f config.arch; then
20819 echo "I see a config.arch file, loading it."
20823 : configuration may be patched via a 'config.over' file
20824 if $test -f config.over; then
20827 rp='I see a config.over file. Do you wish to load it?'
20830 n*) echo "OK, I'll ignore it.";;
20832 echo "Configuration override changes have been loaded."
20837 : in case they want portability, strip down executable paths
20838 case "$d_portable" in
20841 echo "Stripping down executable paths..." >&4
20842 for file in $loclist $trylist; do
20844 eval $file=`basename $temp`
20849 : create config.sh file
20851 echo "Creating config.sh..." >&4
20852 $spitshell <<EOT >config.sh
20855 # This file was produced by running the Configure script. It holds all the
20856 # definitions figured out by Configure. Should you modify one of these values,
20857 # do not forget to propagate your changes by running "Configure -der". You may
20858 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20861 # Package name : $package
20862 # Source directory : $src
20863 # Configuration time: $cf_time
20864 # Configured by : $cf_by
20865 # Target system : $myuname
20875 Revision='$Revision'
20883 alignbytes='$alignbytes'
20884 ansi2knr='$ansi2knr'
20885 aphostname='$aphostname'
20886 api_revision='$api_revision'
20887 api_subversion='$api_subversion'
20888 api_version='$api_version'
20889 api_versionstring='$api_versionstring'
20892 archlibexp='$archlibexp'
20893 archname64='$archname64'
20894 archname='$archname'
20895 archobjs='$archobjs'
20896 asctime_r_proto='$asctime_r_proto'
20904 byteorder='$byteorder'
20906 castflags='$castflags'
20909 cccdlflags='$cccdlflags'
20910 ccdlflags='$ccdlflags'
20912 ccflags_uselargefiles='$ccflags_uselargefiles'
20914 ccsymbols='$ccsymbols'
20915 ccversion='$ccversion'
20917 cf_email='$cf_email'
20919 charsize='$charsize'
20923 clocktype='$clocktype'
20925 compress='$compress'
20926 contains='$contains'
20930 cpp_stuff='$cpp_stuff'
20931 cppccsymbols='$cppccsymbols'
20932 cppflags='$cppflags'
20934 cppminus='$cppminus'
20936 cppstdin='$cppstdin'
20937 cppsymbols='$cppsymbols'
20938 crypt_r_proto='$crypt_r_proto'
20939 cryptlib='$cryptlib'
20941 ctermid_r_proto='$ctermid_r_proto'
20942 ctime_r_proto='$ctime_r_proto'
20943 d_Gconvert='$d_Gconvert'
20944 d_PRIEUldbl='$d_PRIEUldbl'
20945 d_PRIFUldbl='$d_PRIFUldbl'
20946 d_PRIGUldbl='$d_PRIGUldbl'
20947 d_PRIXU64='$d_PRIXU64'
20948 d_PRId64='$d_PRId64'
20949 d_PRIeldbl='$d_PRIeldbl'
20950 d_PRIfldbl='$d_PRIfldbl'
20951 d_PRIgldbl='$d_PRIgldbl'
20952 d_PRIi64='$d_PRIi64'
20953 d_PRIo64='$d_PRIo64'
20954 d_PRIu64='$d_PRIu64'
20955 d_PRIx64='$d_PRIx64'
20956 d_SCNfldbl='$d_SCNfldbl'
20957 d__fwalk='$d__fwalk'
20958 d_access='$d_access'
20959 d_accessx='$d_accessx'
20962 d_archlib='$d_archlib'
20963 d_asctime_r='$d_asctime_r'
20966 d_attribute_format='$d_attribute_format'
20967 d_attribute_malloc='$d_attribute_malloc'
20968 d_attribute_nonnull='$d_attribute_nonnull'
20969 d_attribute_noreturn='$d_attribute_noreturn'
20970 d_attribute_pure='$d_attribute_pure'
20971 d_attribute_unused='$d_attribute_unused'
20972 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
20976 d_bsdgetpgrp='$d_bsdgetpgrp'
20977 d_bsdsetpgrp='$d_bsdsetpgrp'
20979 d_casti32='$d_casti32'
20980 d_castneg='$d_castneg'
20981 d_charvspr='$d_charvspr'
20983 d_chroot='$d_chroot'
20984 d_chsize='$d_chsize'
20986 d_clearenv='$d_clearenv'
20987 d_closedir='$d_closedir'
20988 d_cmsghdr_s='$d_cmsghdr_s'
20990 d_copysignl='$d_copysignl'
20992 d_crypt_r='$d_crypt_r'
20994 d_ctermid_r='$d_ctermid_r'
20995 d_ctime_r='$d_ctime_r'
20996 d_cuserid='$d_cuserid'
20997 d_dbl_dig='$d_dbl_dig'
20998 d_dbminitproto='$d_dbminitproto'
20999 d_difftime='$d_difftime'
21001 d_dirnamlen='$d_dirnamlen'
21002 d_dlerror='$d_dlerror'
21003 d_dlopen='$d_dlopen'
21004 d_dlsymun='$d_dlsymun'
21005 d_dosuid='$d_dosuid'
21006 d_drand48_r='$d_drand48_r'
21007 d_drand48proto='$d_drand48proto'
21009 d_eaccess='$d_eaccess'
21010 d_endgrent='$d_endgrent'
21011 d_endgrent_r='$d_endgrent_r'
21012 d_endhent='$d_endhent'
21013 d_endhostent_r='$d_endhostent_r'
21014 d_endnent='$d_endnent'
21015 d_endnetent_r='$d_endnetent_r'
21016 d_endpent='$d_endpent'
21017 d_endprotoent_r='$d_endprotoent_r'
21018 d_endpwent='$d_endpwent'
21019 d_endpwent_r='$d_endpwent_r'
21020 d_endsent='$d_endsent'
21021 d_endservent_r='$d_endservent_r'
21022 d_eofnblk='$d_eofnblk'
21023 d_eunice='$d_eunice'
21024 d_faststdio='$d_faststdio'
21025 d_fchdir='$d_fchdir'
21026 d_fchmod='$d_fchmod'
21027 d_fchown='$d_fchown'
21029 d_fcntl_can_lock='$d_fcntl_can_lock'
21030 d_fd_macros='$d_fd_macros'
21031 d_fd_set='$d_fd_set'
21032 d_fds_bits='$d_fds_bits'
21033 d_fgetpos='$d_fgetpos'
21034 d_finite='$d_finite'
21035 d_finitel='$d_finitel'
21036 d_flexfnam='$d_flexfnam'
21038 d_flockproto='$d_flockproto'
21040 d_fp_class='$d_fp_class'
21041 d_fpathconf='$d_fpathconf'
21042 d_fpclass='$d_fpclass'
21043 d_fpclassify='$d_fpclassify'
21044 d_fpclassl='$d_fpclassl'
21045 d_fpos64_t='$d_fpos64_t'
21046 d_frexpl='$d_frexpl'
21047 d_fs_data_s='$d_fs_data_s'
21048 d_fseeko='$d_fseeko'
21049 d_fsetpos='$d_fsetpos'
21050 d_fstatfs='$d_fstatfs'
21051 d_fstatvfs='$d_fstatvfs'
21053 d_ftello='$d_ftello'
21055 d_getcwd='$d_getcwd'
21056 d_getespwnam='$d_getespwnam'
21057 d_getfsstat='$d_getfsstat'
21058 d_getgrent='$d_getgrent'
21059 d_getgrent_r='$d_getgrent_r'
21060 d_getgrgid_r='$d_getgrgid_r'
21061 d_getgrnam_r='$d_getgrnam_r'
21062 d_getgrps='$d_getgrps'
21063 d_gethbyaddr='$d_gethbyaddr'
21064 d_gethbyname='$d_gethbyname'
21065 d_gethent='$d_gethent'
21066 d_gethname='$d_gethname'
21067 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21068 d_gethostbyname_r='$d_gethostbyname_r'
21069 d_gethostent_r='$d_gethostent_r'
21070 d_gethostprotos='$d_gethostprotos'
21071 d_getitimer='$d_getitimer'
21072 d_getlogin='$d_getlogin'
21073 d_getlogin_r='$d_getlogin_r'
21074 d_getmnt='$d_getmnt'
21075 d_getmntent='$d_getmntent'
21076 d_getnbyaddr='$d_getnbyaddr'
21077 d_getnbyname='$d_getnbyname'
21078 d_getnent='$d_getnent'
21079 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21080 d_getnetbyname_r='$d_getnetbyname_r'
21081 d_getnetent_r='$d_getnetent_r'
21082 d_getnetprotos='$d_getnetprotos'
21083 d_getpagsz='$d_getpagsz'
21084 d_getpbyname='$d_getpbyname'
21085 d_getpbynumber='$d_getpbynumber'
21086 d_getpent='$d_getpent'
21087 d_getpgid='$d_getpgid'
21088 d_getpgrp2='$d_getpgrp2'
21089 d_getpgrp='$d_getpgrp'
21090 d_getppid='$d_getppid'
21091 d_getprior='$d_getprior'
21092 d_getprotobyname_r='$d_getprotobyname_r'
21093 d_getprotobynumber_r='$d_getprotobynumber_r'
21094 d_getprotoent_r='$d_getprotoent_r'
21095 d_getprotoprotos='$d_getprotoprotos'
21096 d_getprpwnam='$d_getprpwnam'
21097 d_getpwent='$d_getpwent'
21098 d_getpwent_r='$d_getpwent_r'
21099 d_getpwnam_r='$d_getpwnam_r'
21100 d_getpwuid_r='$d_getpwuid_r'
21101 d_getsbyname='$d_getsbyname'
21102 d_getsbyport='$d_getsbyport'
21103 d_getsent='$d_getsent'
21104 d_getservbyname_r='$d_getservbyname_r'
21105 d_getservbyport_r='$d_getservbyport_r'
21106 d_getservent_r='$d_getservent_r'
21107 d_getservprotos='$d_getservprotos'
21108 d_getspnam='$d_getspnam'
21109 d_getspnam_r='$d_getspnam_r'
21110 d_gettimeod='$d_gettimeod'
21111 d_gmtime_r='$d_gmtime_r'
21112 d_gnulibc='$d_gnulibc'
21113 d_grpasswd='$d_grpasswd'
21114 d_hasmntopt='$d_hasmntopt'
21116 d_ilogbl='$d_ilogbl'
21118 d_inetaton='$d_inetaton'
21119 d_int64_t='$d_int64_t'
21120 d_isascii='$d_isascii'
21121 d_isfinite='$d_isfinite'
21124 d_isnanl='$d_isnanl'
21125 d_killpg='$d_killpg'
21126 d_lchown='$d_lchown'
21127 d_ldbl_dig='$d_ldbl_dig'
21128 d_libm_lib_version='$d_libm_lib_version'
21130 d_localtime_r='$d_localtime_r'
21131 d_locconv='$d_locconv'
21133 d_longdbl='$d_longdbl'
21134 d_longlong='$d_longlong'
21135 d_lseekproto='$d_lseekproto'
21137 d_madvise='$d_madvise'
21138 d_malloc_good_size='$d_malloc_good_size'
21139 d_malloc_size='$d_malloc_size'
21141 d_mbstowcs='$d_mbstowcs'
21142 d_mbtowc='$d_mbtowc'
21143 d_memchr='$d_memchr'
21144 d_memcmp='$d_memcmp'
21145 d_memcpy='$d_memcpy'
21146 d_memmove='$d_memmove'
21147 d_memset='$d_memset'
21149 d_mkdtemp='$d_mkdtemp'
21150 d_mkfifo='$d_mkfifo'
21151 d_mkstemp='$d_mkstemp'
21152 d_mkstemps='$d_mkstemps'
21153 d_mktime='$d_mktime'
21156 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21157 d_modflproto='$d_modflproto'
21158 d_mprotect='$d_mprotect'
21160 d_msg_ctrunc='$d_msg_ctrunc'
21161 d_msg_dontroute='$d_msg_dontroute'
21162 d_msg_oob='$d_msg_oob'
21163 d_msg_peek='$d_msg_peek'
21164 d_msg_proxy='$d_msg_proxy'
21165 d_msgctl='$d_msgctl'
21166 d_msgget='$d_msgget'
21167 d_msghdr_s='$d_msghdr_s'
21168 d_msgrcv='$d_msgrcv'
21169 d_msgsnd='$d_msgsnd'
21171 d_munmap='$d_munmap'
21172 d_mymalloc='$d_mymalloc'
21174 d_nl_langinfo='$d_nl_langinfo'
21175 d_nv_preserves_uv='$d_nv_preserves_uv'
21176 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21177 d_off64_t='$d_off64_t'
21178 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21179 d_oldpthreads='$d_oldpthreads'
21180 d_oldsock='$d_oldsock'
21182 d_pathconf='$d_pathconf'
21184 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21185 d_phostname='$d_phostname'
21188 d_portable='$d_portable'
21189 d_procselfexe='$d_procselfexe'
21190 d_pthread_atfork='$d_pthread_atfork'
21191 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21192 d_pthread_yield='$d_pthread_yield'
21194 d_pwchange='$d_pwchange'
21195 d_pwclass='$d_pwclass'
21196 d_pwcomment='$d_pwcomment'
21197 d_pwexpire='$d_pwexpire'
21198 d_pwgecos='$d_pwgecos'
21199 d_pwpasswd='$d_pwpasswd'
21200 d_pwquota='$d_pwquota'
21203 d_random_r='$d_random_r'
21204 d_readdir64_r='$d_readdir64_r'
21205 d_readdir='$d_readdir'
21206 d_readdir_r='$d_readdir_r'
21207 d_readlink='$d_readlink'
21209 d_recvmsg='$d_recvmsg'
21210 d_rename='$d_rename'
21211 d_rewinddir='$d_rewinddir'
21213 d_safebcpy='$d_safebcpy'
21214 d_safemcpy='$d_safemcpy'
21215 d_sanemcmp='$d_sanemcmp'
21216 d_sbrkproto='$d_sbrkproto'
21217 d_scalbnl='$d_scalbnl'
21218 d_sched_yield='$d_sched_yield'
21219 d_scm_rights='$d_scm_rights'
21220 d_seekdir='$d_seekdir'
21221 d_select='$d_select'
21223 d_semctl='$d_semctl'
21224 d_semctl_semid_ds='$d_semctl_semid_ds'
21225 d_semctl_semun='$d_semctl_semun'
21226 d_semget='$d_semget'
21228 d_sendmsg='$d_sendmsg'
21229 d_setegid='$d_setegid'
21230 d_seteuid='$d_seteuid'
21231 d_setgrent='$d_setgrent'
21232 d_setgrent_r='$d_setgrent_r'
21233 d_setgrps='$d_setgrps'
21234 d_sethent='$d_sethent'
21235 d_sethostent_r='$d_sethostent_r'
21236 d_setitimer='$d_setitimer'
21237 d_setlinebuf='$d_setlinebuf'
21238 d_setlocale='$d_setlocale'
21239 d_setlocale_r='$d_setlocale_r'
21240 d_setnent='$d_setnent'
21241 d_setnetent_r='$d_setnetent_r'
21242 d_setpent='$d_setpent'
21243 d_setpgid='$d_setpgid'
21244 d_setpgrp2='$d_setpgrp2'
21245 d_setpgrp='$d_setpgrp'
21246 d_setprior='$d_setprior'
21247 d_setproctitle='$d_setproctitle'
21248 d_setprotoent_r='$d_setprotoent_r'
21249 d_setpwent='$d_setpwent'
21250 d_setpwent_r='$d_setpwent_r'
21251 d_setregid='$d_setregid'
21252 d_setresgid='$d_setresgid'
21253 d_setresuid='$d_setresuid'
21254 d_setreuid='$d_setreuid'
21255 d_setrgid='$d_setrgid'
21256 d_setruid='$d_setruid'
21257 d_setsent='$d_setsent'
21258 d_setservent_r='$d_setservent_r'
21259 d_setsid='$d_setsid'
21260 d_setvbuf='$d_setvbuf'
21264 d_shmatprototype='$d_shmatprototype'
21265 d_shmctl='$d_shmctl'
21267 d_shmget='$d_shmget'
21268 d_sigaction='$d_sigaction'
21269 d_sigprocmask='$d_sigprocmask'
21270 d_sigsetjmp='$d_sigsetjmp'
21271 d_sockatmark='$d_sockatmark'
21272 d_sockatmarkproto='$d_sockatmarkproto'
21273 d_socket='$d_socket'
21274 d_socklen_t='$d_socklen_t'
21275 d_sockpair='$d_sockpair'
21276 d_socks5_init='$d_socks5_init'
21278 d_srand48_r='$d_srand48_r'
21279 d_srandom_r='$d_srandom_r'
21280 d_sresgproto='$d_sresgproto'
21281 d_sresuproto='$d_sresuproto'
21282 d_statblks='$d_statblks'
21283 d_statfs_f_flags='$d_statfs_f_flags'
21284 d_statfs_s='$d_statfs_s'
21285 d_statvfs='$d_statvfs'
21286 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21287 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21288 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21289 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21290 d_stdio_stream_array='$d_stdio_stream_array'
21291 d_stdiobase='$d_stdiobase'
21292 d_stdstdio='$d_stdstdio'
21293 d_strchr='$d_strchr'
21294 d_strcoll='$d_strcoll'
21295 d_strctcpy='$d_strctcpy'
21296 d_strerrm='$d_strerrm'
21297 d_strerror='$d_strerror'
21298 d_strerror_r='$d_strerror_r'
21299 d_strftime='$d_strftime'
21300 d_strlcat='$d_strlcat'
21301 d_strlcpy='$d_strlcpy'
21302 d_strtod='$d_strtod'
21303 d_strtol='$d_strtol'
21304 d_strtold='$d_strtold'
21305 d_strtoll='$d_strtoll'
21306 d_strtoq='$d_strtoq'
21307 d_strtoul='$d_strtoul'
21308 d_strtoull='$d_strtoull'
21309 d_strtouq='$d_strtouq'
21310 d_strxfrm='$d_strxfrm'
21311 d_suidsafe='$d_suidsafe'
21312 d_symlink='$d_symlink'
21313 d_syscall='$d_syscall'
21314 d_syscallproto='$d_syscallproto'
21315 d_sysconf='$d_sysconf'
21316 d_sysernlst='$d_sysernlst'
21317 d_syserrlst='$d_syserrlst'
21318 d_system='$d_system'
21319 d_tcgetpgrp='$d_tcgetpgrp'
21320 d_tcsetpgrp='$d_tcsetpgrp'
21321 d_telldir='$d_telldir'
21322 d_telldirproto='$d_telldirproto'
21325 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21326 d_tm_tm_zone='$d_tm_tm_zone'
21327 d_tmpnam_r='$d_tmpnam_r'
21328 d_truncate='$d_truncate'
21329 d_ttyname_r='$d_ttyname_r'
21330 d_tzname='$d_tzname'
21331 d_u32align='$d_u32align'
21332 d_ualarm='$d_ualarm'
21335 d_union_semun='$d_union_semun'
21336 d_unordered='$d_unordered'
21337 d_unsetenv='$d_unsetenv'
21338 d_usleep='$d_usleep'
21339 d_usleepproto='$d_usleepproto'
21341 d_vendorarch='$d_vendorarch'
21342 d_vendorbin='$d_vendorbin'
21343 d_vendorlib='$d_vendorlib'
21344 d_vendorscript='$d_vendorscript'
21346 d_void_closedir='$d_void_closedir'
21347 d_voidsig='$d_voidsig'
21348 d_voidtty='$d_voidtty'
21349 d_volatile='$d_volatile'
21350 d_vprintf='$d_vprintf'
21352 d_waitpid='$d_waitpid'
21353 d_wcstombs='$d_wcstombs'
21354 d_wctomb='$d_wctomb'
21355 d_writev='$d_writev'
21358 db_hashtype='$db_hashtype'
21359 db_prefixtype='$db_prefixtype'
21360 db_version_major='$db_version_major'
21361 db_version_minor='$db_version_minor'
21362 db_version_patch='$db_version_patch'
21363 defvoidused='$defvoidused'
21364 direntrytype='$direntrytype'
21367 doublesize='$doublesize'
21369 drand48_r_proto='$drand48_r_proto'
21370 dynamic_ext='$dynamic_ext'
21376 endgrent_r_proto='$endgrent_r_proto'
21377 endhostent_r_proto='$endhostent_r_proto'
21378 endnetent_r_proto='$endnetent_r_proto'
21379 endprotoent_r_proto='$endprotoent_r_proto'
21380 endpwent_r_proto='$endpwent_r_proto'
21381 endservent_r_proto='$endservent_r_proto'
21382 eunicefix='$eunicefix'
21385 extensions='$extensions'
21387 fflushNULL='$fflushNULL'
21388 fflushall='$fflushall'
21390 firstmakefile='$firstmakefile'
21392 fpossize='$fpossize'
21393 fpostype='$fpostype'
21394 freetype='$freetype'
21397 full_csh='$full_csh'
21398 full_sed='$full_sed'
21399 gccansipedantic='$gccansipedantic'
21400 gccosandvers='$gccosandvers'
21401 gccversion='$gccversion'
21402 getgrent_r_proto='$getgrent_r_proto'
21403 getgrgid_r_proto='$getgrgid_r_proto'
21404 getgrnam_r_proto='$getgrnam_r_proto'
21405 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21406 gethostbyname_r_proto='$gethostbyname_r_proto'
21407 gethostent_r_proto='$gethostent_r_proto'
21408 getlogin_r_proto='$getlogin_r_proto'
21409 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21410 getnetbyname_r_proto='$getnetbyname_r_proto'
21411 getnetent_r_proto='$getnetent_r_proto'
21412 getprotobyname_r_proto='$getprotobyname_r_proto'
21413 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21414 getprotoent_r_proto='$getprotoent_r_proto'
21415 getpwent_r_proto='$getpwent_r_proto'
21416 getpwnam_r_proto='$getpwnam_r_proto'
21417 getpwuid_r_proto='$getpwuid_r_proto'
21418 getservbyname_r_proto='$getservbyname_r_proto'
21419 getservbyport_r_proto='$getservbyport_r_proto'
21420 getservent_r_proto='$getservent_r_proto'
21421 getspnam_r_proto='$getspnam_r_proto'
21422 gidformat='$gidformat'
21428 gmtime_r_proto='$gmtime_r_proto'
21429 gnulibc_version='$gnulibc_version'
21431 groupcat='$groupcat'
21432 groupstype='$groupstype'
21435 h_sysfile='$h_sysfile'
21438 html1dir='$html1dir'
21439 html1direxp='$html1direxp'
21440 html3dir='$html3dir'
21441 html3direxp='$html3direxp'
21450 i_arpainet='$i_arpainet'
21451 i_bsdioctl='$i_bsdioctl'
21455 i_dirent='$i_dirent'
21461 i_fp_class='$i_fp_class'
21464 i_ieeefp='$i_ieeefp'
21465 i_inttypes='$i_inttypes'
21466 i_langinfo='$i_langinfo'
21467 i_libutil='$i_libutil'
21468 i_limits='$i_limits'
21469 i_locale='$i_locale'
21470 i_machcthr='$i_machcthr'
21471 i_malloc='$i_malloc'
21473 i_memory='$i_memory'
21474 i_mntent='$i_mntent'
21477 i_neterrno='$i_neterrno'
21478 i_netinettcp='$i_netinettcp'
21482 i_pthread='$i_pthread'
21484 i_rpcsvcdbm='$i_rpcsvcdbm'
21487 i_shadow='$i_shadow'
21489 i_stdarg='$i_stdarg'
21490 i_stddef='$i_stddef'
21491 i_stdlib='$i_stdlib'
21492 i_string='$i_string'
21493 i_sunmath='$i_sunmath'
21494 i_sysaccess='$i_sysaccess'
21495 i_sysdir='$i_sysdir'
21496 i_sysfile='$i_sysfile'
21497 i_sysfilio='$i_sysfilio'
21499 i_sysioctl='$i_sysioctl'
21500 i_syslog='$i_syslog'
21501 i_sysmman='$i_sysmman'
21502 i_sysmode='$i_sysmode'
21503 i_sysmount='$i_sysmount'
21504 i_sysndir='$i_sysndir'
21505 i_sysparam='$i_sysparam'
21506 i_sysresrc='$i_sysresrc'
21507 i_syssecrt='$i_syssecrt'
21508 i_sysselct='$i_sysselct'
21509 i_syssockio='$i_syssockio'
21510 i_sysstat='$i_sysstat'
21511 i_sysstatfs='$i_sysstatfs'
21512 i_sysstatvfs='$i_sysstatvfs'
21513 i_systime='$i_systime'
21514 i_systimek='$i_systimek'
21515 i_systimes='$i_systimes'
21516 i_systypes='$i_systypes'
21517 i_sysuio='$i_sysuio'
21519 i_sysutsname='$i_sysutsname'
21520 i_sysvfs='$i_sysvfs'
21521 i_syswait='$i_syswait'
21522 i_termio='$i_termio'
21523 i_termios='$i_termios'
21525 i_unistd='$i_unistd'
21528 i_values='$i_values'
21529 i_varargs='$i_varargs'
21530 i_varhdr='$i_varhdr'
21532 ignore_versioned_solibs='$ignore_versioned_solibs'
21533 inc_version_list='$inc_version_list'
21534 inc_version_list_init='$inc_version_list_init'
21537 installarchlib='$installarchlib'
21538 installbin='$installbin'
21539 installhtml1dir='$installhtml1dir'
21540 installhtml3dir='$installhtml3dir'
21541 installman1dir='$installman1dir'
21542 installman3dir='$installman3dir'
21543 installprefix='$installprefix'
21544 installprefixexp='$installprefixexp'
21545 installprivlib='$installprivlib'
21546 installscript='$installscript'
21547 installsitearch='$installsitearch'
21548 installsitebin='$installsitebin'
21549 installsitehtml1dir='$installsitehtml1dir'
21550 installsitehtml3dir='$installsitehtml3dir'
21551 installsitelib='$installsitelib'
21552 installsiteman1dir='$installsiteman1dir'
21553 installsiteman3dir='$installsiteman3dir'
21554 installsitescript='$installsitescript'
21555 installstyle='$installstyle'
21556 installusrbinperl='$installusrbinperl'
21557 installvendorarch='$installvendorarch'
21558 installvendorbin='$installvendorbin'
21559 installvendorhtml1dir='$installvendorhtml1dir'
21560 installvendorhtml3dir='$installvendorhtml3dir'
21561 installvendorlib='$installvendorlib'
21562 installvendorman1dir='$installvendorman1dir'
21563 installvendorman3dir='$installvendorman3dir'
21564 installvendorscript='$installvendorscript'
21566 issymlink='$issymlink'
21567 ivdformat='$ivdformat'
21570 known_extensions='$known_extensions'
21573 lddlflags='$lddlflags'
21575 ldflags_uselargefiles='$ldflags_uselargefiles'
21576 ldlibpthname='$ldlibpthname'
21583 libsdirs='$libsdirs'
21584 libsfiles='$libsfiles'
21585 libsfound='$libsfound'
21586 libspath='$libspath'
21587 libswanted='$libswanted'
21588 libswanted_uselargefiles='$libswanted_uselargefiles'
21594 localtime_r_proto='$localtime_r_proto'
21595 locincpth='$locincpth'
21596 loclibpth='$loclibpth'
21597 longdblsize='$longdblsize'
21598 longlongsize='$longlongsize'
21599 longsize='$longsize'
21603 lseeksize='$lseeksize'
21604 lseektype='$lseektype'
21608 make_set_make='$make_set_make'
21609 mallocobj='$mallocobj'
21610 mallocsrc='$mallocsrc'
21611 malloctype='$malloctype'
21613 man1direxp='$man1direxp'
21616 man3direxp='$man3direxp'
21618 mips_type='$mips_type'
21619 mistrustnm='$mistrustnm'
21621 mmaptype='$mmaptype'
21622 modetype='$modetype'
21624 multiarch='$multiarch'
21626 myarchname='$myarchname'
21627 mydomain='$mydomain'
21628 myhostname='$myhostname'
21631 need_va_copy='$need_va_copy'
21632 netdb_hlen_type='$netdb_hlen_type'
21633 netdb_host_type='$netdb_host_type'
21634 netdb_name_type='$netdb_name_type'
21635 netdb_net_type='$netdb_net_type'
21638 nm_so_opt='$nm_so_opt'
21639 nonxs_ext='$nonxs_ext'
21641 nvEUformat='$nvEUformat'
21642 nvFUformat='$nvFUformat'
21643 nvGUformat='$nvGUformat'
21644 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21645 nveformat='$nveformat'
21646 nvfformat='$nvfformat'
21647 nvgformat='$nvgformat'
21650 o_nonblock='$o_nonblock'
21652 old_pthread_create_joinable='$old_pthread_create_joinable'
21653 optimize='$optimize'
21654 orderlib='$orderlib'
21657 otherlibdirs='$otherlibdirs'
21661 patchlevel='$patchlevel'
21662 path_sep='$path_sep'
21665 perl_patchlevel='$perl_patchlevel'
21666 perladmin='$perladmin'
21667 perllibs='$perllibs'
21668 perlpath='$perlpath'
21670 phostname='$phostname'
21676 prefixexp='$prefixexp'
21678 privlibexp='$privlibexp'
21679 procselfexe='$procselfexe'
21680 prototype='$prototype'
21682 quadkind='$quadkind'
21683 quadtype='$quadtype'
21684 randbits='$randbits'
21685 randfunc='$randfunc'
21686 random_r_proto='$random_r_proto'
21687 randseedtype='$randseedtype'
21689 rd_nodata='$rd_nodata'
21690 readdir64_r_proto='$readdir64_r_proto'
21691 readdir_r_proto='$readdir_r_proto'
21692 revision='$revision'
21697 sPRIEUldbl='$sPRIEUldbl'
21698 sPRIFUldbl='$sPRIFUldbl'
21699 sPRIGUldbl='$sPRIGUldbl'
21700 sPRIXU64='$sPRIXU64'
21702 sPRIeldbl='$sPRIeldbl'
21703 sPRIfldbl='$sPRIfldbl'
21704 sPRIgldbl='$sPRIgldbl'
21709 sSCNfldbl='$sSCNfldbl'
21710 sched_yield='$sched_yield'
21711 scriptdir='$scriptdir'
21712 scriptdirexp='$scriptdirexp'
21714 seedfunc='$seedfunc'
21715 selectminbits='$selectminbits'
21716 selecttype='$selecttype'
21717 sendmail='$sendmail'
21718 setgrent_r_proto='$setgrent_r_proto'
21719 sethostent_r_proto='$sethostent_r_proto'
21720 setlocale_r_proto='$setlocale_r_proto'
21721 setnetent_r_proto='$setnetent_r_proto'
21722 setprotoent_r_proto='$setprotoent_r_proto'
21723 setpwent_r_proto='$setpwent_r_proto'
21724 setservent_r_proto='$setservent_r_proto'
21727 sharpbang='$sharpbang'
21728 shmattype='$shmattype'
21729 shortsize='$shortsize'
21732 sig_count='$sig_count'
21733 sig_name='$sig_name'
21734 sig_name_init='$sig_name_init'
21736 sig_num_init='$sig_num_init'
21737 sig_size='$sig_size'
21738 signal_t='$signal_t'
21739 sitearch='$sitearch'
21740 sitearchexp='$sitearchexp'
21742 sitebinexp='$sitebinexp'
21743 sitehtml1dir='$sitehtml1dir'
21744 sitehtml1direxp='$sitehtml1direxp'
21745 sitehtml3dir='$sitehtml3dir'
21746 sitehtml3direxp='$sitehtml3direxp'
21748 sitelib_stem='$sitelib_stem'
21749 sitelibexp='$sitelibexp'
21750 siteman1dir='$siteman1dir'
21751 siteman1direxp='$siteman1direxp'
21752 siteman3dir='$siteman3dir'
21753 siteman3direxp='$siteman3direxp'
21754 siteprefix='$siteprefix'
21755 siteprefixexp='$siteprefixexp'
21756 sitescript='$sitescript'
21757 sitescriptexp='$sitescriptexp'
21758 sizesize='$sizesize'
21759 sizetype='$sizetype'
21763 sockethdr='$sockethdr'
21764 socketlib='$socketlib'
21765 socksizetype='$socksizetype'
21767 spackage='$spackage'
21768 spitshell='$spitshell'
21769 srand48_r_proto='$srand48_r_proto'
21770 srandom_r_proto='$srandom_r_proto'
21772 ssizetype='$ssizetype'
21773 startperl='$startperl'
21775 static_ext='$static_ext'
21777 stdio_base='$stdio_base'
21778 stdio_bufsiz='$stdio_bufsiz'
21779 stdio_cnt='$stdio_cnt'
21780 stdio_filbuf='$stdio_filbuf'
21781 stdio_ptr='$stdio_ptr'
21782 stdio_stream_array='$stdio_stream_array'
21783 strerror_r_proto='$strerror_r_proto'
21786 subversion='$subversion'
21790 targetarch='$targetarch'
21794 timeincl='$timeincl'
21795 timetype='$timetype'
21796 tmpnam_r_proto='$tmpnam_r_proto'
21802 ttyname_r_proto='$ttyname_r_proto'
21811 uidformat='$uidformat'
21817 uquadtype='$uquadtype'
21818 use5005threads='$use5005threads'
21819 use64bitall='$use64bitall'
21820 use64bitint='$use64bitint'
21821 usecrosscompile='$usecrosscompile'
21823 usefaststdio='$usefaststdio'
21824 useithreads='$useithreads'
21825 uselargefiles='$uselargefiles'
21826 uselongdouble='$uselongdouble'
21827 usemallocwrap='$usemallocwrap'
21828 usemorebits='$usemorebits'
21829 usemultiplicity='$usemultiplicity'
21830 usemymalloc='$usemymalloc'
21832 useopcode='$useopcode'
21833 useperlio='$useperlio'
21834 useposix='$useposix'
21835 usereentrant='$usereentrant'
21836 userelocatableinc='$userelocatableinc'
21838 useshrplib='$useshrplib'
21839 usesitecustomize='$usesitecustomize'
21840 usesocks='$usesocks'
21841 usethreads='$usethreads'
21842 usevendorprefix='$usevendorprefix'
21843 usevfork='$usevfork'
21846 uvXUformat='$uvXUformat'
21847 uvoformat='$uvoformat'
21850 uvuformat='$uvuformat'
21851 uvxformat='$uvxformat'
21852 vendorarch='$vendorarch'
21853 vendorarchexp='$vendorarchexp'
21854 vendorbin='$vendorbin'
21855 vendorbinexp='$vendorbinexp'
21856 vendorhtml1dir='$vendorhtml1dir'
21857 vendorhtml1direxp='$vendorhtml1direxp'
21858 vendorhtml3dir='$vendorhtml3dir'
21859 vendorhtml3direxp='$vendorhtml3direxp'
21860 vendorlib='$vendorlib'
21861 vendorlib_stem='$vendorlib_stem'
21862 vendorlibexp='$vendorlibexp'
21863 vendorman1dir='$vendorman1dir'
21864 vendorman1direxp='$vendorman1direxp'
21865 vendorman3dir='$vendorman3dir'
21866 vendorman3direxp='$vendorman3direxp'
21867 vendorprefix='$vendorprefix'
21868 vendorprefixexp='$vendorprefixexp'
21869 vendorscript='$vendorscript'
21870 vendorscriptexp='$vendorscriptexp'
21872 version_patchlevel_string='$version_patchlevel_string'
21873 versiononly='$versiononly'
21875 voidflags='$voidflags'
21878 yaccflags='$yaccflags'
21883 : Add in command line options if available
21884 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21886 : add special variables
21887 $test -f $src/patchlevel.h && \
21888 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21889 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21890 echo "PERL_CONFIG_SH=true" >>config.sh
21892 : propagate old symbols
21893 if $test -f UU/config.sh; then
21894 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21895 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21896 $sort | $uniq -u >UU/oldsyms
21897 set X `cat UU/oldsyms`
21903 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21905 echo "# Variables propagated from previous config.sh file." >>config.sh
21906 for sym in `cat UU/oldsyms`; do
21907 echo " Propagating $hint variable "'$'"$sym..."
21908 eval 'tmp="$'"${sym}"'"'
21910 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21916 : Finish up by extracting the .SH files
21920 echo "Extraction done."
21930 If you'd like to make any changes to the config.sh file before I begin
21931 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21934 rp="Press return or use a shell escape to edit config.sh:"
21939 *) : in case they cannot read
21940 sh 1>&4 -c "$ans";;
21945 : if this fails, just run all the .SH files by hand
21954 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21961 Now you need to generate make dependencies by running "$make depend".
21962 You might prefer to run it in background: "$make depend > makedepend.out &"
21963 It can take a while, so you might not want to run it right now.
21968 rp="Run $make depend now?"
21972 $make depend && echo "Now you must run '$make'."
21975 echo "You must run '$make depend' then '$make'."
21978 elif test -f [Mm]akefile; then
21980 echo "Now you must run a $make."
21982 echo "Configure done."
21985 if $test -f Policy.sh; then
21988 If you compile $package on a different machine or from a different object
21989 directory, copy the Policy.sh file from this object directory to the
21990 new one before you run Configure -- this will help you with most of
21991 the policy defaults.
21995 if $test -f config.msg; then
21996 echo "Hmm. I also noted the following information while running:"
21998 $cat config.msg >&4
22001 $rm -f kit*isdone ark*isdone