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 Wed Mar 8 09:08:03 CET 2006 [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=''
357 d_builtin_choose_expr=''
403 endhostent_r_proto=''
409 endprotoent_r_proto=''
415 endservent_r_proto=''
467 gethostbyaddr_r_proto=''
469 gethostbyname_r_proto=''
471 gethostent_r_proto=''
483 getnetbyaddr_r_proto=''
485 getnetbyname_r_proto=''
499 d_getprotobyname_r=''
500 getprotobyname_r_proto=''
501 d_getprotobynumber_r=''
502 getprotobynumber_r_proto=''
504 getprotoent_r_proto=''
516 getservbyname_r_proto=''
518 getservbyport_r_proto=''
520 getservent_r_proto=''
544 d_libm_lib_version=''
557 d_malloc_good_size=''
599 d_old_pthread_create_joinable=''
600 old_pthread_create_joinable=''
602 d_pthread_attr_setscope=''
641 sethostent_r_proto=''
658 setprotoent_r_proto=''
670 setservent_r_proto=''
703 d_sprintf_returns_strlen=''
718 d_stdio_ptr_lval_nochange_cnt=''
719 d_stdio_ptr_lval_sets_cnt=''
923 inc_version_list_init=''
942 ignore_versioned_solibs=''
1006 d_perl_otherlibdirs=''
1014 api_versionstring=''
1020 version_patchlevel_string=''
1024 d_nv_preserves_uv=''
1025 d_nv_zero_is_allbits_zero=''
1036 nv_preserves_uv_bits=''
1107 installsitehtml1dir=''
1110 installsitehtml3dir=''
1117 installsiteman1dir=''
1120 installsiteman3dir=''
1125 installsitescript=''
1140 d_stdio_stream_array=''
1141 stdio_stream_array=''
1152 ccflags_uselargefiles=''
1153 ldflags_uselargefiles=''
1154 libswanted_uselargefiles=''
1164 userelocatableinc=''
1175 installvendorarch=''
1182 installvendorhtml1dir=''
1184 vendorhtml1direxp=''
1185 installvendorhtml3dir=''
1187 vendorhtml3direxp=''
1193 installvendorman1dir=''
1196 installvendorman3dir=''
1203 installvendorscript=''
1215 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1218 : We must find out about Eunice early
1220 if test -f /etc/unixtovms; then
1221 eunicefix=/etc/unixtovms
1223 if test -f /etc/unixtovms.exe; then
1224 eunicefix=/etc/unixtovms.exe
1227 : Set executable suffix now -- needed before hints available
1228 if test -f "/libs/version.library"; then
1231 elif test -f "/system/gnu_library/bin/ar.pm"; then
1234 elif test -n "$DJGPP"; then
1237 elif test -d c:/. -o -n "$is_os2" ; then
1246 : set useposix=false in your hint file to disable the POSIX extension.
1248 : set useopcode=false in your hint file to disable the Opcode extension.
1250 : Trailing extension. Override this in a hint file, if needed.
1251 : Extra object files, if any, needed on this platform.
1254 : Possible local include directories to search.
1255 : Set locincpth to "" in a hint file to defeat local include searches.
1256 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1257 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1259 : no include file wanted by default
1264 : change the next line if compiling for Xenix/286 on Xenix/386
1265 xlibpth='/usr/lib/386 /lib/386'
1266 : Possible local library directories to search.
1267 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1268 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1270 : general looking path for locating libraries
1271 glibpth="/lib /usr/lib $xlibpth"
1272 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1273 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1274 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1276 : Private path used by Configure to find libraries. Its value
1277 : is prepended to libpth. This variable takes care of special
1278 : machines, like the mips. Usually, it should be empty.
1281 : default library list
1283 : some systems want to use only the non-versioned libso:s
1284 ignore_versioned_solibs=''
1289 ccflags_uselargefiles=''
1290 ldflags_uselargefiles=''
1291 libswanted_uselargefiles=''
1292 : set usemultiplicity on the Configure command line to enable multiplicity.
1293 : set usesocks on the Configure command line to enable socks.
1294 : set usethreads on the Configure command line to enable threads.
1295 usereentrant='undef'
1296 : full support for void wanted by default
1299 : List of libraries we want.
1300 : If anyone needs extra -lxxx, put those in a hint file.
1301 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1302 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1303 : We probably want to search /usr/shlib before most other libraries.
1304 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1305 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1306 glibpth="/usr/shlib $glibpth"
1307 : Do not use vfork unless overridden by a hint file.
1310 : Find the basic shell for Bourne shell scripts
1314 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1317 if test -f "$xxx"; then
1320 : Build up a list and do a single loop so we can 'break' out.
1321 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1322 for xxx in sh bash ksh pdksh ash; do
1324 try="$try ${p}/${xxx}"
1328 if test -f "$xxx"; then
1331 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1334 elif test -f "$xxx.exe"; then
1345 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1347 Usually it's in /bin/sh. How did you even get this far?
1348 Please contact me (Perl Maintainers) at perlbug@perl.org and
1349 we'll try to straighten this all out.
1355 : see if sh knows # comments
1356 if `$sh -c '#' >/dev/null 2>&1`; then
1360 test -f $xcat$_exe || xcat=/usr/bin/cat
1361 if test ! -f $xcat$_exe; then
1362 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1363 if test -f $p/cat$_exe; then
1368 if test ! -f $xcat$_exe; then
1369 echo "Can't find cat anywhere!"
1373 echo "#!$xcat" >sharp
1377 if test -s today; then
1380 echo "#! $xcat" > sharp
1384 if test -s today; then
1392 echo "Your $sh doesn't grok # comments--I will strip them later on."
1395 echo "exec grep -v '^[ ]*#'" >spitshell
1397 $eunicefix spitshell
1398 spitshell=`pwd`/spitshell
1400 echo "I presume that if # doesn't work, #! won't work either!"
1405 : figure out how to guarantee sh startup
1407 '') startsh=${sharpbang}${sh} ;;
1419 : echo "Yup, it does."
1421 echo "Hmm... '$startsh' does not guarantee sh startup..."
1422 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1427 : Save command line options in file UU/cmdline.opt for later use in
1428 : generating config.sh.
1429 cat > cmdline.opt <<EOSH
1430 # Configure command line arguments.
1439 cat >>cmdline.opt <<EOSH
1440 config_arg$argn='$arg'
1442 # Extreme backslashitis: replace each ' by '"'"'
1443 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1446 arg_exp=`cat cmdl.opt`
1447 args_exp="$args_exp$args_sep'$arg_exp'"
1448 argn=`expr $argn + 1`
1451 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1452 # used by ./hints/os2.sh
1455 : produce awk script to parse command line options
1456 cat >options.awk <<'EOF'
1458 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1460 len = length(optstr);
1461 for (i = 1; i <= len; i++) {
1462 c = substr(optstr, i, 1);
1463 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1474 if (substr(str, 1, 1) != "-") {
1475 printf("'%s'\n", str);
1479 for (i = 2; i <= len; i++) {
1480 c = substr(str, i, 1);
1482 printf("-%s\n", substr(str, i));
1488 printf("'%s'\n", substr(str, i + 1));
1501 : process the command line options
1502 set X `for arg in "$@"; do echo "X$arg"; done |
1503 sed -e s/X// | awk -f options.awk`
1508 : set up default values
1518 rm -f optdef.sh posthint.sh
1519 cat >optdef.sh <<EOS
1525 while test $# -gt 0; do
1527 -d) shift; fastread=yes;;
1528 -e) shift; alldone=cont;;
1532 if test -r "$1"; then
1535 echo "$me: cannot read config file $1." >&2
1540 -h) shift; error=true;;
1541 -r) shift; reuseval=true;;
1542 -s) shift; silent=true; realsilent=true;;
1543 -E) shift; alldone=exit;;
1544 -K) shift; knowitall=true;;
1545 -O) shift; override=true;;
1546 -S) shift; silent=true; extractsh=true;;
1551 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1552 echo "$me: ignoring -D $1" >&2
1555 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1556 *) echo "$1='define'" >> optdef.sh;;
1563 *=) echo "$1" >> optdef.sh;;
1565 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1566 echo "$me: ignoring -U $1" >&2
1568 *) echo "$1='undef'" >> optdef.sh;;
1579 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1583 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1584 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1590 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1591 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1592 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1593 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1594 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1595 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1601 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1603 echo "$yyy=''" >> posthint.sh ;;
1608 echo "$yyy='$zzz'" >> posthint.sh ;;
1610 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1612 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1617 echo "$yyy=$zzz" >> posthint.sh ;;
1618 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1622 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1625 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1633 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1634 [-U symbol] [-U symbol=] [-A command:symbol...]
1635 -d : use defaults for all answers.
1636 -e : go on without questioning past the production of config.sh.
1637 -f : specify an alternate default configuration file.
1638 -h : print this help message and exit (with an error status).
1639 -r : reuse C symbols value if possible (skips costly nm extraction).
1640 -s : silent mode, only echoes questions and essential information.
1641 -D : define symbol to have some value:
1642 -D symbol symbol gets the value 'define'
1643 -D symbol=value symbol gets the value 'value'
1644 -E : stop at the end of questions, after having produced config.sh.
1645 -K : do not use unless you know what you are doing.
1646 -O : let -D and -U override definitions from loaded configuration file.
1647 -S : perform variable substitutions on all .SH files (can mix with -f)
1648 -U : undefine symbol:
1649 -U symbol symbol gets the value 'undef'
1650 -U symbol= symbol gets completely empty
1651 -A : manipulate symbol after the platform specific hints have been applied:
1652 -A symbol=value append " "value to symbol
1653 -A append:symbol=value append value to symbol
1654 -A define:symbol=value define symbol to have value
1655 -A clear:symbol define symbol to be ''
1656 -A define:symbol define symbol to be 'define'
1657 -A eval:symbol=value define symbol to be eval of value
1658 -A prepend:symbol=value prepend value to symbol
1659 -A undef:symbol define symbol to be 'undef'
1660 -A undef:symbol= define symbol to be ''
1661 -V : print version number and exit (with a zero status).
1668 case "$fastread$alldone" in
1671 case "$extractsh" in
1674 if test ! -t 0; then
1675 echo "Say 'sh Configure', not 'sh <Configure'"
1685 true) exec 1>/dev/null;;
1688 : run the defines and the undefines, if any, but leave the file out there...
1691 : create the posthint manipulation script and leave the file out there...
1696 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1697 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1698 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1699 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1700 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1703 : Some greps do not return status, grrr.
1704 echo "grimblepritz" >grimble
1705 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1707 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1713 : the following should work in any shell
1717 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1718 cat >contains <<'EOSS'
1719 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1724 : Find the path to the source tree
1727 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1731 *) src=`cd ../$src && pwd` ;;
1744 if test -f $rsrc/Configure && \
1745 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1747 : found it, so we are ok.
1750 for src in . .. ../.. ../../.. ../../../..; do
1751 if test -f ../$src/Configure && \
1752 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1763 Sorry, I can't seem to locate the source dir for $package. Please start
1764 Configure with an explicit path -- i.e. /some/path/Configure.
1772 echo "Sources for $package found in \"$src\"." >&4
1776 : script used to extract .SH files with variable substitutions
1777 cat >extract <<'EOS'
1779 echo "Doing variable substitutions on .SH files..."
1780 if test -f MANIFEST; then
1781 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1783 echo "(Looking for .SH files under the source directory.)"
1784 set x `(cd "$src"; find . -name "*.SH" -print)`
1788 0) set x `(cd "$src"; echo *.SH)`; shift;;
1790 if test ! -f "$src/$1"; then
1796 while test $name; do
1797 if test ! -d "$name"; then
1798 create="$name $create";
1799 name=`echo $name | sed -e "s|^[^/]*$||"`;
1800 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1805 for file in $create; do
1814 dir=`expr X$file : 'X\(.*\)/'`
1815 file=`expr X$file : 'X.*/\(.*\)'`
1816 (cd "$dir" && . ./$file)
1826 dir=`expr X$file : 'X\(.*\)/'`
1827 file=`expr X$file : 'X.*/\(.*\)'`
1828 (set x $dir; shift; eval $mkdir_p)
1829 sh <"$src/$dir/$file"
1838 if test -f "$src/config_h.SH"; then
1839 if test ! -f config.h; then
1840 : oops, they left it out of MANIFEST, probably, so do it anyway.
1841 . "$src/config_h.SH"
1846 : extract files and exit if asked to do so
1847 case "$extractsh" in
1849 case "$realsilent" in
1853 case "$config_sh" in
1854 '') config_sh='config.sh';;
1857 echo "Fetching answers from $config_sh..."
1860 test "$override" && . ./optdef.sh
1864 echo "Extraction done."
1869 : Eunice requires " " instead of "", can you believe it
1872 echo "Beginning of configuration questions for $package."
1874 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1876 : first determine how to suppress newline on echo command
1878 echo "Checking echo to see how to suppress newlines..."
1879 (echo "hi there\c" ; echo " ") >.echotmp
1880 if $contains c .echotmp >/dev/null 2>&1 ; then
1891 echo $n "The star should be here-->$c"
1895 : Now test for existence of everything in MANIFEST
1897 if test -f "$rsrc/MANIFEST"; then
1898 echo "First let's make sure your kit is complete. Checking..." >&4
1899 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1902 for filelist in x??; do
1903 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1905 if test -s missing; then
1909 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1911 You have the option of continuing the configuration process, despite the
1912 distinct possibility that your kit is damaged, by typing 'y'es. If you
1913 do, don't blame me if something goes wrong. I advise you to type 'n'o
1914 and contact the author (perlbug@perl.org).
1917 echo $n "Continue? [n] $c" >&4
1921 echo "Continuing..." >&4
1925 echo "ABORTING..." >&4
1930 echo "Looks good..."
1933 echo "There is no MANIFEST file. I hope your kit is complete !"
1938 : Find the appropriate value for a newline for tr
1939 if test -n "$DJGPP"; then
1942 if test X"$trnl" = X; then
1943 case "`echo foo|tr '\n' x 2>/dev/null`" in
1947 if test X"$trnl" = X; then
1948 case "`echo foo|tr '\012' x 2>/dev/null`" in
1949 foox) trnl='\012' ;;
1952 if test X"$trnl" = X; then
1953 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1954 fooxy) trnl='\n\r' ;;
1957 if test X"$trnl" = X; then
1960 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1966 : compute the number of columns on the terminal for proper question formatting
1971 : set up the echo used in my read
1972 myecho="case \"\$xxxm\" in
1973 '') echo $n \"\$rp $c\" >&4;;
1975 '') echo $n \"[\$xxxm] $c\";;
1977 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1979 echo $n \"[\$xxxm] $c\" >&4
1981 echo $n \"\$rp [\$xxxm] $c\" >&4
1987 : now set up to do reads with possible shell escape and default assignment
1993 case "\$fastread" in
1994 yes) case "\$dflt" in
1997 case "\$silent-\$rp" in
2002 *) case "\$silent" in
2003 true) case "\$rp" in
2008 while expr "X\$ans" : "X!" >/dev/null; do
2012 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2020 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2029 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2034 echo "(OK, I'll run with -d after this question.)" >&4
2037 echo "*** Sorry, \$1 not supported yet." >&4
2047 echo "*** Substitution done -- please confirm."
2049 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2054 echo "*** Error -- try again."
2061 case "\$ans\$xxxm\$nostick" in
2073 : create .config dir to save info across Configure sessions
2074 test -d ../.config || mkdir ../.config
2075 cat >../.config/README <<EOF
2076 This directory created by Configure to save information that should
2077 persist across sessions for $package.
2079 You may safely delete it if you wish.
2082 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2084 $define|true|[yY]*) ;;
2085 *) case "$xversion" in
2088 *** WHOA THERE!!! ***
2090 This is an UNSTABLE DEVELOPMENT release.
2091 The version of this $package distribution is $xversion, that is, odd,
2092 (as opposed to even) and that signifies a development release.
2093 If you want a maintenance release, you want an even-numbered version.
2095 Do ***NOT*** install this into production use.
2096 Data corruption and crashes are possible.
2098 It is most seriously suggested that you do not continue any further
2099 unless you want to help in developing and debugging Perl.
2101 If you *still* want to build perl, you can answer 'y' now,
2102 or pass -Dusedevel to Configure.
2105 rp='Do you really want to continue?'
2109 [yY]) echo >&4 "Okay, continuing."
2110 usedevel="$define" ;;
2111 *) echo >&4 "Okay, bye."
2121 case "$versiononly" in
2122 '') versiononly="$define" ;;
2124 case "$installusrbinperl" in
2125 '') installusrbinperl="$undef" ;;
2130 : general instructions
2133 user=`(logname) 2>/dev/null`
2135 '') user=`whoami 2>&1`;;
2137 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2140 rp='Would you like to see the instructions?'
2151 This installation shell script will examine your system and ask you questions
2152 to determine how the perl5 package should be installed. If you get
2153 stuck on a question, you may use a ! shell escape to start a subshell or
2154 execute a command. Many of the questions will have default answers in square
2155 brackets; typing carriage return will give you the default.
2157 On some of the questions which ask for file or directory names you are allowed
2158 to use the ~name construct to specify the login directory belonging to "name",
2159 even if you don't have a shell which knows about that. Questions where this is
2160 allowed will be marked "(~name ok)".
2164 dflt='Type carriage return to continue'
2168 The prompter used in this script allows you to use shell variables and
2169 backticks in your answers. You may use $1, $2, etc... to refer to the words
2170 in the default answer, as if the default line was a set of arguments given to a
2171 script shell. This means you may also use $* to repeat the whole default line,
2172 so you do not have to re-type everything to add something to the default.
2174 Everytime there is a substitution, you will have to confirm. If there is an
2175 error (e.g. an unmatched backtick), the default answer will remain unchanged
2176 and you will be prompted again.
2178 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2179 the questions and use the computed defaults (or the previous answers if there
2180 was already a config.sh file). Type 'Configure -h' for a list of options.
2181 You may also start interactively and then answer '& -d' at any prompt to turn
2182 on the non-interactive behaviour for the remainder of the execution.
2188 Much effort has been expended to ensure that this shell script will run on any
2189 Unix system. If despite that it blows up on yours, your best bet is to edit
2190 Configure and run it again. If you can't run Configure for some reason,
2191 you'll have to generate a config.sh file by hand. Whatever problems you
2192 have, let me (perlbug@perl.org) know how I blew it.
2194 This installation script affects things in two ways:
2196 1) it may do direct variable substitutions on some of the files included
2198 2) it builds a config.h file for inclusion in C programs. You may edit
2199 any of these files as the need arises after running this script.
2201 If you make a mistake on a question, there is no easy way to back up to it
2202 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2203 files. Configure will offer to let you do this before it runs the SH files.
2206 dflt='Type carriage return to continue'
2208 case "$firsttime" in
2209 true) echo $user >>../.config/instruct;;
2213 : find out where common programs are
2215 echo "Locating common programs..." >&4
2228 if test -d \$dir/\$thing; then
2234 for thisthing in \$dir/\$thing; do
2235 : just loop through to pick last item
2237 if test -f \$thisthing; then
2240 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2243 elif test -f \$dir/\$thing.exe; then
2244 if test -n "$DJGPP"; then
2245 echo \$dir/\$thing.exe
2246 elif test "$eunicefix" != ":"; then
2247 : on Eunice apparently
2301 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2302 pth="$pth /lib /usr/lib"
2303 for file in $loclist; do
2307 if test -f "$xxx"; then
2310 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2311 xxx=`./loc $file $file $pth`
2314 '') xxx=`./loc $file $file $pth`;;
2315 *) xxx=`./loc $xxx $xxx $pth`;;
2317 eval $file=$xxx$_exe
2321 echo $file is in $xxx.
2324 echo $file is in $xxx.
2327 echo "I don't know where '$file' is, and my life depends on it." >&4
2328 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2334 echo "Don't worry if any of the following aren't found..."
2336 for file in $trylist; do
2340 if test -f "$xxx"; then
2343 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2344 xxx=`./loc $file $file $pth`
2347 '') xxx=`./loc $file $file $pth`;;
2348 *) xxx=`./loc $xxx $xxx $pth`;;
2350 eval $file=$xxx$_exe
2354 echo $file is in $xxx.
2357 echo $file is in $xxx.
2360 echo "I don't see $file out there, $say."
2367 echo "Substituting grep for egrep."
2374 echo "Substituting cp for ln."
2383 echo "I can't find make or gmake, and my life depends on it." >&4
2384 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2392 *) # We can't have osname yet.
2393 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2394 # Assume that gmake, if found, is definitely GNU make
2395 # and prefer it over the system make.
2396 echo "Substituting gmake for make."
2404 echo "Hopefully test is built into your sh."
2407 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2408 echo "Using the test built into your sh."
2416 echo "Hopefully echo is built into your sh."
2421 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2422 $echo $n "hi there$c" >foo1
2423 echo $n "hi there$c" >foo2
2424 if cmp foo1 foo2 >/dev/null 2>&1; then
2425 echo "They are compatible. In fact, they may be identical."
2432 They are not compatible! You are probably running ksh on a non-USG system.
2433 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2434 have echo built in and we may have to run some Bourne shell scripts. That
2435 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2438 $echo $n "The star should be here-->$c"
2448 cat <<'EOSC' >>trygcc
2453 int main(int argc, char *argv[]) {
2457 if $cc -o try $ccflags $ldflags try.c; then
2460 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2466 case "`$cc -v -c try.c 2>&1`" in
2469 if $test X"$trygcc" = Xyes; then
2470 if gcc -o try -c try.c; then
2472 echo "You seem to have a working gcc, though." >&4
2473 rp="Would you like to use it?"
2475 if $test -f myread; then
2478 if $test -f UU/myread; then
2481 echo "Cannot find myread, sorry. Aborting." >&2
2486 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2487 if $test -f usethreads.cbu; then
2490 *** However, any setting of the C compiler flags (e.g. for thread support)
2491 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2492 *** (together with e.g. -Dusethreads).
2508 cat <<'EOSC' >>checkcc
2513 int main(int argc, char *argv[]) {
2517 if $cc -o try $ccflags $ldflags try.c; then
2520 if $test X"$despair" = Xyes; then
2521 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2524 You need to find a working C compiler.
2525 Either (purchase and) install the C compiler supplied by your OS vendor,
2526 or for a free C compiler try http://gcc.gnu.org/
2527 I cannot continue any further, aborting.
2536 : determine whether symbolic links are supported
2539 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2540 echo "Symbolic links are supported." >&4
2543 echo "Symbolic links are NOT supported." >&4
2548 : determine whether symbolic links are supported
2552 echo "Checking how to test for symbolic links..." >&4
2554 if $test "X$issymlink" = X; then
2556 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2557 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2559 if test $? = 0; then
2562 echo "Your builtin 'test -h' may be broken." >&4
2565 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2568 if test -f "$p/$test"; then
2577 echo "Trying external '$test -h'." >&4
2578 issymlink="$test -h"
2579 if $test ! -h sym >/dev/null 2>&1; then
2580 echo "External '$test -h' is broken, too." >&4
2588 if $test "X$issymlink" = X; then
2589 if $test -L sym 2>/dev/null; then
2590 issymlink="$test -L"
2591 echo "The builtin '$test -L' worked." >&4
2594 if $test "X$issymlink" != X; then
2595 echo "You can test for symbolic links with '$issymlink'." >&4
2597 echo "I do not know how you can test for symbolic links." >&4
2601 *) echo "No symbolic links, so not testing for their testing..." >&4
2607 case "$mksymlinks" in
2610 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2613 *) case "$lns:$issymlink" in
2614 *"ln"*" -s:"*"test -"?)
2615 echo "Creating the symbolic links..." >&4
2616 echo "(First creating the subdirectories...)" >&4
2618 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2620 test -z "$directory" && break
2624 if test ! -d t/base; then
2625 echo "Failed to create the subdirectories. Aborting." >&4
2628 echo "(Then creating the symlinks...)" >&4
2629 awk '{print $1}' $src/MANIFEST | while true; do
2631 test -z "$filename" && break
2632 if test -f $filename; then
2633 if $issymlink $filename; then
2637 if test -f $filename; then
2638 echo "$filename already exists, not symlinking."
2640 ln -s $src/$filename $filename
2644 if test ! -f t/base/lex.t; then
2645 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2650 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2659 case "$usecrosscompile" in
2661 $echo "Cross-compiling..."
2664 *-*-gcc) # A cross-compiling gcc, probably.
2665 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2667 # leave out ld, choosing it is more complex
2669 ranlib=$targetarch-ranlib
2670 $echo 'extern int foo;' > try.c
2671 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2673 if $test $# -gt 0; then
2675 incpth="`$echo $incpth|$sed 's/^ //'`"
2676 echo "Guessing incpth '$incpth'." >&4
2678 j="`$echo $i|$sed 's,/include$,/lib,'`"
2679 if $test -d $j; then
2683 libpth="`$echo $libpth|$sed 's/^ //'`"
2684 echo "Guessing libpth '$libpth'." >&4
2689 case "$targetarch" in
2690 '') echo "Targetarch not defined." >&4; croak=y ;;
2691 *) echo "Using targetarch $targetarch." >&4 ;;
2694 '') echo "Incpth not defined." >&4; croak=y ;;
2695 *) echo "Using incpth '$incpth'." >&4 ;;
2698 '') echo "Libpth not defined." >&4; croak=y ;;
2699 *) echo "Using libpth '$libpth'." >&4 ;;
2702 '') for i in $incpth; do
2703 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2705 echo "Guessing usrinc $usrinc." >&4
2710 '') echo "Usrinc not defined." >&4; croak=y ;;
2713 *) echo "Using usrinc $usrinc." >&4 ;;
2715 case "$targethost" in
2716 '') echo "Targethost not defined." >&4; croak=y ;;
2717 *) echo "Using targethost $targethost." >&4
2722 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2725 /*) run=$src/Cross/run
2726 targetmkdir=$src/Cross/mkdir
2728 from=$src/Cross/from
2730 *) pwd=`$test -f ../Configure & cd ..; pwd`
2732 targetmkdir=$pwd/Cross/mkdir
2734 from=$pwd/Cross/from
2737 case "$targetrun" in
2738 '') targetrun=ssh ;;
2743 case "$targetfrom" in
2744 '') targetfrom=scp ;;
2748 from=$from-$targetfrom
2749 case "$targetdir" in
2751 echo "Guessing targetdir $targetdir." >&4
2754 case "$targetuser" in
2756 echo "Guessing targetuser $targetuser." >&4
2759 case "$targetfrom" in
2763 case "$targetrun" in
2775 '') cwd=$targetdir ;;
2779 if $test ! -f \$exe.xok; then
2783 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2786 *) echo "Unknown targetrun '$targetrun'" >&4
2790 case "$targetmkdir" in
2792 cat >$targetmkdir <<EOF
2794 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2796 $chmod a+rx $targetmkdir
2798 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2810 $targetmkdir \`dirname \$f\`
2811 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2814 $targetmkdir $targetdir/\`dirname \$f\`
2815 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2828 $mkdir -p $targetdir/\`dirname \$f\`
2829 $cp \$f $targetdir/\$f || exit 1
2832 $targetmkdir $targetdir/\`dirname \$f\`
2833 $cp \$f $targetdir/\$f || exit 1
2840 *) echo "Unknown targetto '$targetto'" >&4
2844 case "$targetfrom" in
2851 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2856 cp) cat >$from <<EOF
2861 cp $targetdir/\$f . || exit 1
2866 *) echo "Unknown targetfrom '$targetfrom'" >&4
2870 if $test ! -f $run; then
2871 echo "Target 'run' script '$run' not found." >&4
2875 if $test ! -f $to; then
2876 echo "Target 'to' script '$to' not found." >&4
2880 if $test ! -f $from; then
2881 echo "Target 'from' script '$from' not found." >&4
2885 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2889 Using '$run' for remote execution,
2890 and '$from' and '$to'
2891 for remote file transfer.
2897 usecrosscompile='undef'
2902 : see whether [:lower:] and [:upper:] are supported character classes
2904 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2906 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2910 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2911 # (0xd9 and 0xe2), therefore that is a nice testing point.
2912 if test "X$up" = X -o "X$low" = X; then
2913 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2919 if test "X$up" = X -o "X$low" = X; then
2920 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2926 if test "X$up" = X -o "X$low" = X; then
2927 case "`echo RS | od -x 2>/dev/null`" in
2929 echo "Hey, this might be EBCDIC." >&4
2930 if test "X$up" = X -o "X$low" = X; then
2931 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2932 rs) up='[A-IJ-RS-Z]'
2937 if test "X$up" = X -o "X$low" = X; then
2938 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2948 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2950 echo "Using $up and $low to convert case." >&4
2953 echo "I don't know how to translate letters from upper to lower case." >&4
2954 echo "Your tr is not acting any way I know of." >&4
2958 : set up the translation script tr, must be called with ./tr of course
2962 '[A-Z][a-z]') exec $tr '$up' '$low';;
2963 '[a-z][A-Z]') exec $tr '$low' '$up';;
2970 : Try to determine whether config.sh was made on this system
2971 case "$config_sh" in
2973 myuname=`$uname -a 2>/dev/null`
2974 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2975 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2976 # because the A-Z/a-z are not consecutive.
2977 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2978 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2979 newmyuname="$myuname"
2981 case "$knowitall" in
2983 if test -f ../config.sh; then
2984 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2985 eval "`grep myuname= ../config.sh`"
2987 if test "X$myuname" = "X$newmyuname"; then
2995 : Get old answers from old config file if Configure was run on the
2996 : same system, otherwise use the hints.
2999 if test -f config.sh; then
3001 rp="I see a config.sh file. Shall I use it to set the defaults?"
3004 n*|N*) echo "OK, I'll ignore it."
3005 mv config.sh config.sh.old
3006 myuname="$newmyuname"
3008 *) echo "Fetching default answers from your old config.sh file..." >&4
3016 : Older versions did not always set $sh. Catch re-use of such
3026 if test ! -f config.sh; then
3029 First time through, eh? I have some defaults handy for some systems
3030 that need some extra help getting the Configure answers right:
3033 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3035 : Half the following guesses are probably wrong... If you have better
3036 : tests or hints, please send them to perlbug@perl.org
3037 : The metaconfig authors would also appreciate a copy...
3038 $test -f /irix && osname=irix
3039 $test -f /xenix && osname=sco_xenix
3040 $test -f /dynix && osname=dynix
3041 $test -f /dnix && osname=dnix
3042 $test -f /lynx.os && osname=lynxos
3043 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3044 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3045 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3046 $test -f /bin/mips && /bin/mips && osname=mips
3047 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3048 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3049 $test -d /usr/apollo/bin && osname=apollo
3050 $test -f /etc/saf/_sactab && osname=svr4
3051 $test -d /usr/include/minix && osname=minix
3052 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3053 if $test -d /MachTen -o -d /MachTen_Folder; then
3055 if $test -x /sbin/version; then
3056 osvers=`/sbin/version | $awk '{print $2}' |
3057 $sed -e 's/[A-Za-z]$//'`
3058 elif $test -x /usr/etc/version; then
3059 osvers=`/usr/etc/version | $awk '{print $2}' |
3060 $sed -e 's/[A-Za-z]$//'`
3066 $test -f /sys/posix.dll &&
3067 $test -f /usr/bin/what &&
3068 set X `/usr/bin/what /sys/posix.dll` &&
3069 $test "$3" = UWIN &&
3073 if $test -f $uname; then
3081 umips) osname=umips ;;
3084 [23]100) osname=mips ;;
3085 next*) osname=next ;;
3087 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3088 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3091 elif $test -f /etc/kconfig; then
3093 if test "$lns" = "$ln -s"; then
3095 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3097 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3104 if test -n "$DJGPP"; then
3113 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3115 # oslevel can fail with:
3116 # oslevel: Unable to acquire lock.
3117 *not\ found) osvers="$4"."$3" ;;
3118 '<3240'|'<>3240') osvers=3.2.0 ;;
3119 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3120 '=3250'|'>3250') osvers=3.2.5 ;;
3124 bsd386) osname=bsd386
3127 cygwin*) osname=cygwin
3130 *dc.osx) osname=dcosx
3136 domainos) osname=apollo
3142 dragonfly) osname=dragonfly
3145 dynixptx*) osname=dynixptx
3146 osvers=`echo "$4"|sed 's/^v//'`
3148 freebsd) osname=freebsd
3150 genix) osname=genix ;;
3154 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3170 netbsd*) osname=netbsd
3173 news-os) osvers="$3"
3175 4*) osname=newsos4 ;;
3179 next*) osname=next ;;
3180 nonstop-ux) osname=nonstopux ;;
3181 openbsd) osname=openbsd
3187 POSIX-BC | posix-bc ) osname=posix-bc
3190 powerux | power_ux | powermax_os | powermaxos | \
3191 powerunix | power_unix) osname=powerux
3197 solaris) osname=solaris
3199 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3206 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3210 titanos) osname=titanos
3219 ultrix) osname=ultrix
3222 osf1|mls+) case "$5" in
3225 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3228 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3231 hp*) osname=hp_osf1 ;;
3232 mips) osname=mips_osf1 ;;
3235 # UnixWare 7.1.2 is known as Open UNIX 8
3236 openunix|unixware) osname=svr5
3244 $2) case "$osname" in
3248 : svr4.x or possibly later
3258 if test -f /stand/boot ; then
3259 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3260 if test -n "$INITPROG" -a -f "$INITPROG"; then
3261 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3262 if test -n "$isesix"; then
3270 *) if test -f /etc/systemid; then
3272 set `echo $3 | $sed 's/\./ /g'` $4
3273 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3275 elif $test -f $src/hints/sco_$1_$2.sh; then
3277 elif $test -f $src/hints/sco_$1.sh; then
3282 '') : Still unknown. Probably a generic Sys V.
3291 *) case "$osname" in
3292 '') : Still unknown. Probably a generic BSD.
3300 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3301 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3302 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3305 $rm -f UU/kernel.what
3306 elif test -d c:/. -o -n "$is_os2" ; then
3313 case "$targetarch" in
3316 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3321 : Now look for a hint file osname_osvers, unless one has been
3322 : specified already.
3325 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3326 : Also try without trailing minor version numbers.
3327 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3328 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3329 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3330 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3333 *) case "$osvers" in
3336 *) if $test -f $src/hints/$file.sh ; then
3338 elif $test -f $src/hints/$xfile.sh ; then
3340 elif $test -f $src/hints/$xxfile.sh ; then
3342 elif $test -f $src/hints/$xxxfile.sh ; then
3344 elif $test -f $src/hints/$xxxxfile.sh ; then
3346 elif $test -f "$src/hints/${osname}.sh" ; then
3355 if $test -f Policy.sh ; then
3358 none) dflt="Policy" ;;
3359 *) dflt="Policy $dflt" ;;
3364 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3368 if $test -f Policy.sh ; then
3371 There's also a Policy hint file available, which should make the
3372 site-specific (policy) questions easier to answer.
3379 You may give one or more space-separated answers, or "none" if appropriate.
3380 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3381 is a good thing. DO NOT give a wrong version or a wrong OS.
3385 rp="Which of these apply, if any?"
3388 for file in $tans; do
3389 if $test X$file = XPolicy -a -f Policy.sh; then
3391 $cat Policy.sh >> UU/config.sh
3392 elif $test -f $src/hints/$file.sh; then
3393 . $src/hints/$file.sh
3394 $cat $src/hints/$file.sh >> UU/config.sh
3395 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3398 : Give one chance to correct a possible typo.
3399 echo "$file.sh does not exist"
3401 rp="hint to use instead?"
3403 for file in $ans; do
3404 if $test -f "$src/hints/$file.sh"; then
3405 . $src/hints/$file.sh
3406 $cat $src/hints/$file.sh >> UU/config.sh
3407 elif $test X$ans = X -o X$ans = Xnone ; then
3410 echo "$file.sh does not exist -- ignored."
3417 : Remember our hint file for later.
3418 if $test -f "$src/hints/$file.sh" ; then
3428 echo "Fetching default answers from $config_sh..." >&4
3432 cp $config_sh config.sh 2>/dev/null
3442 test "$override" && . ./optdef.sh
3444 : Restore computed paths
3445 for file in $loclist $trylist; do
3446 eval $file="\$_$file"
3451 Configure uses the operating system name and version to set some defaults.
3452 The default value is probably right if the name rings a bell. Otherwise,
3453 since spelling matters for me, either accept the default or answer "none"
3460 ''|' '|none) dflt=none ;;
3461 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3464 *) dflt="$osname" ;;
3466 rp="Operating system name?"
3470 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3476 ''|' '|none) dflt=none ;;
3477 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3478 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3480 ''|' ') dflt=none ;;
3485 *) dflt="$osvers" ;;
3487 rp="Operating system version?"
3497 : who configured the system
3498 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3501 cf_by=`(logname) 2>/dev/null`
3504 cf_by=`(whoami) 2>/dev/null`
3506 "") cf_by=unknown ;;
3511 : set up the script used to warn in case of inconsistency
3518 echo "*** WHOA THERE!!! ***" >&4
3519 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3520 rp=" Keep the $hint value?"
3523 y) td=$was; tu=$was;;
3527 : function used to set $1 to $val
3528 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3530 $define$undef) . ./whoa; eval "$var=\$td";;
3531 $undef$define) . ./whoa; eval "$var=\$tu";;
3532 *) eval "$var=$val";;
3536 $define|true|[yY]*) dflt='y';;
3541 Perl can be built to use the SOCKS proxy protocol library. To do so,
3542 Configure must be run with -Dusesocks. If you use SOCKS you also need
3543 to use the PerlIO abstraction layer, this will be implicitly selected.
3545 If this doesn't make any sense to you, just accept the default '$dflt'.
3547 rp='Build Perl for SOCKS?'
3550 y|Y) val="$define" ;;
3557 $define|true|[yY]*) useperlio="$define";;
3560 case "$useperlio" in
3561 $define|true|[yY]*|'') dflt='y';;
3566 Previous version of $package used the standard IO mechanisms as
3567 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3568 alternate IO mechanisms via the PerlIO abstraction layer, but the
3569 stdio mechanism is still available if needed. The abstraction layer
3570 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3571 Using PerlIO with sfio may cause problems with some extension modules.
3573 If this doesn't make any sense to you, just accept the default '$dflt'.
3575 rp='Use the PerlIO abstraction layer?'
3582 echo "Ok, doing things the stdio way."
3591 case "$useperlio" in
3592 $define|true|[yY]*) ;;
3595 You are using the SOCKS proxy protocol library which means that you
3596 should also use the PerlIO layer. You may be headed for trouble.
3605 case "$usethreads" in
3606 $define|true|[yY]*) dflt='y';;
3607 *) # Catch case where user specified ithreads or 5005threads but
3608 # forgot -Dusethreads (A.D. 4/2002)
3609 case "$useithreads$use5005threads" in
3611 case "$useperlio" in
3612 "$define") dflt='y' ;;
3622 Perl can be built to take advantage of threads on some systems.
3623 To do so, Configure can be run with -Dusethreads.
3625 Note that Perl built with threading support runs slightly slower
3626 and uses more memory than plain Perl. The current implementation
3627 is believed to be stable, but it is fairly new, and so should be
3628 treated with caution.
3630 If this doesn't make any sense to you, just accept the default '$dflt'.
3632 rp='Build a threading Perl?'
3635 y|Y) val="$define" ;;
3641 case "$usethreads" in
3645 Since release 5.6, Perl has had two different threading implementations,
3646 the newer interpreter-based version (ithreads) with one interpreter per
3647 thread, and the older 5.005 version (5005threads).
3648 The 5005threads version is effectively unmaintained and will probably be
3649 removed in Perl 5.10, so there should be no need to build a Perl using it
3650 unless needed for backwards compatibility with some existing 5.005threads
3654 : Default to ithreads unless overridden on command line or with
3657 case "$use5005threads" in
3658 $define|true|[yY]*) dflt='n';;
3660 case "$useithreads" in
3661 $undef|false|[nN]*) dflt='n';;
3663 rp='Use the newer interpreter-based ithreads?'
3666 y|Y) val="$define" ;;
3671 : Now set use5005threads to the opposite value.
3672 case "$useithreads" in
3673 $define) val="$undef" ;;
3680 useithreads="$undef"
3681 use5005threads="$undef"
3685 case "$useithreads$use5005threads" in
3689 You cannot have both the ithreads and the 5.005 threads enabled
3690 at the same time. Disabling the 5.005 threads since they are
3691 much less stable than the ithreads.
3694 use5005threads="$undef"
3698 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3701 *** To build with ithreads you must also use the PerlIO layer.
3702 *** Cannot continue, aborting.
3708 case "$d_oldpthreads" in
3709 '') : Configure tests would be welcome here. For now, assume undef.
3711 *) val="$d_oldpthreads" ;;
3717 : Look for a hint-file generated 'call-back-unit'. If the
3718 : user has specified that a threading perl is to be built,
3719 : we may need to set or change some other defaults.
3720 if $test -f usethreads.cbu; then
3721 echo "Your platform has some specific hints regarding threaded builds, using them..."
3724 case "$usethreads" in
3725 "$define"|true|[yY]*)
3727 (Your platform does not have any specific hints for threaded builds.
3728 Assuming POSIX threads, then.)
3736 Perl can be built so that multiple Perl interpreters can coexist
3737 within the same Perl executable.
3740 case "$useithreads" in
3743 This multiple interpreter support is required for interpreter-based threads.
3747 *) case "$usemultiplicity" in
3748 $define|true|[yY]*) dflt='y';;
3752 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3753 rp='Build Perl for multiplicity?'
3756 y|Y) val="$define" ;;
3765 case "$usemorebits" in
3766 "$define"|true|[yY]*)
3767 use64bitint="$define"
3768 uselongdouble="$define"
3769 usemorebits="$define"
3771 *) usemorebits="$undef"
3775 : make some quick guesses about what we are up against
3777 $echo $n "Hmm... $c"
3787 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3788 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3790 echo "Looks kind of like an OSF/1 system, but we'll see..."
3792 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3793 xxx=`./loc addbib blurfl $pth`
3794 if $test -f $xxx; then
3795 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3799 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3800 echo "Looks kind of like an extended USG system, but we'll see..."
3802 echo "Looks kind of like a USG system, but we'll see..."
3806 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3807 echo "Looks kind of like a BSD system, but we'll see..."
3811 echo "Looks kind of like a Version 7 system, but we'll see..."
3814 case "$eunicefix" in
3817 There is, however, a strange, musty smell in the air that reminds me of
3818 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3822 : it so happens the Eunice I know will not run shell scripts in Unix format
3826 echo "Congratulations. You aren't running Eunice."
3830 : Detect OS2. The p_ variable is set above in the Head.U unit.
3831 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3832 : semicolon as a patch separator
3837 I have the feeling something is not exactly right, however...don't tell me...
3838 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3839 (Or you may be running DOS with DJGPP.)
3844 if test -f /xenix; then
3845 echo "Actually, this looks more like a XENIX system..."
3850 echo "It's not Xenix..."
3855 if test -f /venix; then
3856 echo "Actually, this looks more like a VENIX system..."
3863 echo "Nor is it Venix..."
3866 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3867 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3874 rp="Use which C compiler?"
3878 : See if they have not cc but they do have gcc
3880 : Look for a hint-file generated 'call-back-unit'. Now that the
3881 : user has specified the compiler, we may need to set or change some
3883 if $test -f cc.cbu; then
3889 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3895 printf("%s\n", __VERSION__);
3897 printf("%s\n", "1");
3903 if $cc -o try $ccflags $ldflags try.c; then
3904 gccversion=`$run ./try`
3905 case "$gccversion" in
3906 '') echo "You are not using GNU cc." ;;
3907 *) echo "You are using GNU cc $gccversion."
3913 echo "*** WHOA THERE!!! ***" >&4
3914 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3915 case "$knowitall" in
3917 echo " You'd better start hunting for one and let me know about it." >&4
3923 case "$gccversion" in
3924 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3926 case "$gccversion" in
3927 '') gccosandvers='' ;;
3928 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3929 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3931 case "$gccosandvers" in
3932 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3933 $osname$osvers) ;; # looking good
3934 $osname*) cat <<EOM >&4
3936 *** WHOA THERE!!! ***
3938 Your gcc has not been compiled for the exact release of
3939 your operating system ($gccosandvers versus $osname$osvers).
3941 In general it is a good idea to keep gcc synchronized with
3942 the operating system because otherwise serious problems
3943 may ensue when trying to compile software, like Perl.
3945 I'm trying to be optimistic here, though, and will continue.
3946 If later during the configuration and build icky compilation
3947 problems appear (headerfile conflicts being the most common
3948 manifestation), I suggest reinstalling the gcc to match
3949 your operating system release.
3953 *) gccosandvers='' ;; # failed to parse, better be silent
3961 # gcc 3.* complain about adding -Idirectories that they already know about,
3962 # so we will take those off from locincpth.
3963 case "$gccversion" in
3965 echo "main(){}">try.c
3966 for incdir in $locincpth; do
3967 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3968 grep '^c[cp]p*[01]: warning: changing search order '`
3969 if test "X$warn" != X; then
3970 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3976 : decide how portable to be. Allow command line overrides.
3977 case "$d_portable" in
3979 *) d_portable="$define" ;;
3982 : set up shell script to do ~ expansion
3988 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3991 if $test -f /bin/csh; then
3992 /bin/csh -f -c "glob \$1"
3997 name=\`$expr x\$1 : '..\([^/]*\)'\`
3998 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3999 if $test ! -d "\$dir"; then
4001 echo "\$me: can't locate home directory for: \$name" >&2
4006 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4022 : now set up to get a file name
4026 cat <<'EOSC' >>getfile
4042 : getfile will accept an answer from the comma-separated list
4043 : enclosed in parentheses even if it does not meet other criteria.
4044 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4045 fn=`echo $fn | sed 's/(.*)//'`
4051 loc_file=`expr $fn : '.*:\(.*\)'`
4052 fn=`expr $fn : '\(.*\):.*'`
4060 */*) fullpath=true;;
4069 *e*) exp_file=true;;
4072 *p*) nopath_ok=true;;
4077 *d*) type='Directory';;
4078 *l*) type='Locate';;
4083 Locate) what='File';;
4088 case "$d_portable" in
4096 while test "$type"; do
4101 true) rp="$rp (~name ok)";;
4104 if test -f UU/getfile.ok && \
4105 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4124 value=`UU/filexp $ans`
4127 if test "$ans" != "$value"; then
4128 echo "(That expands to $value on this system.)"
4142 /*) value="$ansexp" ;;
4143 [a-zA-Z]:/*) value="$ansexp" ;;
4148 echo "I shall only accept a full path name, as in /bin/ls." >&4
4149 echo "Use a ! shell escape if you wish to check pathnames." >&4
4152 echo "Please give a full path name, starting with slash." >&4
4155 echo "Note that using ~name is ok provided it expands well." >&4
4168 for fp in $gfpth; do
4169 if test "X$fp" = X.; then
4174 if test -f "$pf"; then
4176 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4178 echo "($value is not a plain file, but that's ok.)"
4181 if test X"$type" = X; then
4188 for fp in $gfpth; do
4189 if test "X$fp" = X.; then
4194 direxp="$fp/$ansexp"
4196 if test -d "$direxp"; then
4204 if test -d "$ansexp"; then
4205 echo "(Looking for $loc_file in directory $value.)"
4206 value="$value/$loc_file"
4207 ansexp="$ansexp/$loc_file"
4209 if test -f "$ansexp"; then
4212 case "$nopath_ok" in
4213 true) case "$value" in
4215 *) echo "Assuming $value will be in people's path."
4231 if test "$fastread" = yes; then
4236 rp="$what $value doesn't exist. Use that name anyway?"
4255 test "X$gfpthkeep" != Xy && gfpth=""
4258 : What should the include directory be ?
4260 $echo $n "Hmm... $c"
4264 if $test -f /bin/mips && /bin/mips; then
4265 echo "Looks like a MIPS system..."
4266 $cat >usr.c <<'EOCP'
4267 #ifdef SYSTYPE_BSD43
4271 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4272 dflt='/bsd43/usr/include'
4276 mips_type='System V'
4278 $rm -f usr.c usr.out
4279 echo "and you're compiling with the $mips_type compiler and libraries."
4283 echo "Doesn't look like a MIPS system."
4293 case "$xxx_prompt" in
4296 rp='Where are the include files you want to use?'
4304 : see how we invoke the C preprocessor
4306 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4307 cat <<'EOT' >testcpp.c
4313 if test ! -f cppstdin; then
4314 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4315 # AIX cc -E doesn't show the absolute headerfile
4316 # locations but we'll cheat by using the -M flag.
4317 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
4319 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4322 echo "Keeping your $hint cppstdin wrapper."
4325 wrapper=`pwd`/cppstdin
4329 if $test "X$cppstdin" != "X" && \
4330 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4331 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4333 echo "You used to use $cppstdin $cppminus so we'll use that again."
4335 '') echo "But let's see if we can live without a wrapper..." ;;
4337 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4338 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4340 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4343 echo "(However, $cpprun $cpplast does not work, let's see...)"
4351 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4358 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4359 $cc -E <testcpp.c >testcpp.out 2>&1; \
4360 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4361 echo "Yup, it does."
4364 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4365 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4366 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4367 echo "Yup, it does."
4370 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4371 $cc -P <testcpp.c >testcpp.out 2>&1; \
4372 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4373 echo "Yipee, that works!"
4376 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4377 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4378 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4379 echo "At long last!"
4382 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4383 $cpp <testcpp.c >testcpp.out 2>&1; \
4384 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4388 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4389 $cpp - <testcpp.c >testcpp.out 2>&1; \
4390 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4391 echo "Hooray, it works! I was beginning to wonder."
4394 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4395 $wrapper <testcpp.c >testcpp.out 2>&1; \
4396 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4402 rp="No dice. I can't find a C preprocessor. Name one:"
4406 $x_cpp <testcpp.c >testcpp.out 2>&1
4407 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4408 echo "OK, that will do." >&4
4410 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4425 echo "Perhaps can we force $cc -E using a wrapper..."
4426 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4427 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4433 echo "Nope, we'll have to live without it..."
4447 "$wrapper"|'cppstdin') ;;
4448 *) $rm -f $wrapper;;
4450 $rm -f testcpp.c testcpp.out
4452 : Set private lib path
4455 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4460 '') dlist="$loclibpth $plibpth $glibpth";;
4461 *) dlist="$libpth";;
4464 : Now check and see which directories actually exist, avoiding duplicates
4468 if $test -d $xxx; then
4471 *) libpth="$libpth $xxx";;
4477 Some systems have incompatible or broken versions of libraries. Among
4478 the directories listed in the question below, please remove any you
4479 know not to be holding relevant libraries, and add any that are needed.
4480 Say "none" for none.
4491 rp="Directories to use for library searches?"
4498 : compute shared library extension
4501 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4511 On some systems, shared libraries may be available. Answer 'none' if
4512 you want to suppress searching of shared libraries for the remainder
4513 of this configuration.
4516 rp='What is the file extension used for shared libraries?'
4520 : Define several unixisms.
4521 : Hints files or command line option can be used to override them.
4522 : The convoluted testing is in case hints files set either the old
4525 '') case "$exe_ext" in
4527 *) _exe="$exe_ext" ;;
4532 '') case "$lib_ext" in
4539 '') case "$obj_ext" in
4546 '') case "$path_sep" in
4557 : Which makefile gets called first. This is used by make depend.
4558 case "$firstmakefile" in
4559 '') firstmakefile='makefile';;
4563 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4566 case "$uselongdouble" in
4567 $define|true|[yY]*) dflt='y';;
4572 Perl can be built to take advantage of long doubles which
4573 (if available) may give more accuracy and range for floating point numbers.
4575 If this doesn't make any sense to you, just accept the default '$dflt'.
4577 rp='Try to use long doubles if available?'
4580 y|Y) val="$define" ;;
4586 case "$uselongdouble" in
4587 true|[yY]*) uselongdouble="$define" ;;
4590 : Look for a hint-file generated 'call-back-unit'. If the
4591 : user has specified that long doubles should be used,
4592 : we may need to set or change some other defaults.
4593 if $test -f uselongdouble.cbu; then
4594 echo "Your platform has some specific hints regarding long doubles, using them..."
4595 . ./uselongdouble.cbu
4597 case "$uselongdouble" in
4600 (Your platform does not have any specific hints for long doubles.)
4606 : Looking for optional libraries
4608 echo "Checking for optional libraries..." >&4
4613 case "$libswanted" in
4614 '') libswanted='c_s';;
4617 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4623 for thisdir in $libpth $xlibpth; do
4624 test -d $thisdir && libspath="$libspath $thisdir"
4626 for thislib in $libswanted; do
4627 for thisdir in $libspath; do
4629 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4630 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4631 $test -f "$xxx" && eval $libscheck
4632 $test -f "$xxx" && libstyle=shared
4634 if test ! -f "$xxx"; then
4635 xxx=$thisdir/lib$thislib.$so
4636 $test -f "$xxx" && eval $libscheck
4637 $test -f "$xxx" && libstyle=shared
4639 if test ! -f "$xxx"; then
4640 xxx=$thisdir/lib$thislib$_a
4641 $test -f "$xxx" && eval $libscheck
4642 $test -f "$xxx" && libstyle=static
4644 if test ! -f "$xxx"; then
4645 xxx=$thisdir/$thislib$_a
4646 $test -f "$xxx" && eval $libscheck
4647 $test -f "$xxx" && libstyle=static
4649 if test ! -f "$xxx"; then
4650 xxx=$thisdir/lib${thislib}_s$_a
4651 $test -f "$xxx" && eval $libscheck
4652 $test -f "$xxx" && libstyle=static
4653 $test -f "$xxx" && thislib=${thislib}_s
4655 if test ! -f "$xxx"; then
4656 xxx=$thisdir/Slib$thislib$_a
4657 $test -f "$xxx" && eval $libscheck
4658 $test -f "$xxx" && libstyle=static
4660 if $test -f "$xxx"; then
4662 shared) echo "Found -l$thislib (shared)." ;;
4663 static) echo "Found -l$thislib." ;;
4664 *) echo "Found -l$thislib ($libstyle)." ;;
4668 *) dflt="$dflt -l$thislib"
4669 libsfound="$libsfound $xxx"
4671 libsfiles="$libsfiles $yyy"
4672 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4673 case " $libsdirs " in
4675 *) libsdirs="$libsdirs $yyy" ;;
4682 if $test ! -f "$xxx"; then
4683 echo "No -l$thislib."
4694 ' '|'') dflt='none';;
4699 In order to compile $package on your machine, a number of libraries
4700 are usually needed. Include any other special libraries here as well.
4701 Say "none" for none. The default list is almost always right.
4705 rp="What libraries to use?"
4712 : determine optimization, if desired, or use for debug flag also
4714 ' '|$undef) dflt='none';;
4716 *) dflt="$optimize";;
4720 By default, $package compiles with the -O flag to use the optimizer.
4721 Alternately, you might want to use the symbolic debugger, which uses
4722 the -g flag (on traditional Unix systems). Either flag can be
4723 specified here. To use neither flag, specify the word "none".
4726 rp="What optimizer/debugger flag should be used?"
4730 'none') optimize=" ";;
4734 : We will not override a previous value, but we might want to
4735 : augment a hint file
4737 default|recommended)
4738 case "$gccversion" in
4739 1*) dflt='-fpcc-struct-return' ;;
4742 *-g*) dflt="$dflt -DDEBUGGING";;
4744 case "$gccversion" in
4745 2*) if test -d /etc/conf/kconfig.d &&
4746 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4748 # Interactive Systems (ISC) POSIX mode.
4753 case "$gccversion" in
4757 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4758 echo 'int main(void) { return 0; }' > gcctest.c
4759 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4760 echo "Yes, it does." 2>&1
4763 echo "Leaving current flags $ccflags alone." 2>&1
4765 *) dflt="$dflt -fno-strict-aliasing" ;;
4768 echo "Nope, it doesn't, but that's ok." 2>&1
4772 # For gcc, adding -pipe speeds up compilations for some, but apparently
4773 # some assemblers can't read from stdin. (It also slows down compilations
4774 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4775 case "$gccversion" in
4777 echo "Checking if your compiler accepts -pipe" 2>&1
4778 echo 'int main(void) { return 0; }' > gcctest.c
4779 if $cc -pipe -o gcctest gcctest.c; then
4780 echo "Yes, it does." 2>&1
4783 echo "Leaving current flags $ccflags alone." 2>&1
4785 *) dflt="$dflt -pipe" ;;
4788 echo "Nope, it doesn't, but that's ok." 2>&1
4791 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4792 echo 'int main(void) { return 0; }' > gcctest.c
4793 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4794 echo "Yes, it does." 2>&1
4796 *-Wdeclaration-after-statement*)
4797 echo "Leaving current flags $ccflags alone." 2>&1
4799 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4802 echo "Nope, it doesn't, but that's ok." 2>&1
4809 case "$mips_type" in
4810 *BSD*|'') inclwanted="$locincpth $usrinc";;
4811 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4813 for thisincl in $inclwanted; do
4814 if $test -d $thisincl; then
4815 if $test x$thisincl != x$usrinc; then
4817 *" -I$thisincl "*);;
4818 *) dflt="$dflt -I$thisincl ";;
4824 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4826 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4834 *) dflt="$dflt -D$2";;
4838 set signal.h LANGUAGE_C; eval $inctest
4842 ccflags="$ccflags -DSOCKS"
4847 default|recommended) dflt="$ccflags $dflt" ;;
4848 *) dflt="$ccflags";;
4857 Your C compiler may want other flags. For this question you should include
4858 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4859 but you should NOT include libraries or ld flags like -lwhatever. If you
4860 want $package to honor its debug switch, you should include -DDEBUGGING here.
4861 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4863 To use no flags, specify the word "none".
4869 rp="Any additional cc flags?"
4876 : the following weeds options from ccflags that are of no interest to cpp
4878 '') cppflags="$ccflags" ;;
4879 *) cppflags="$cppflags $ccflags" ;;
4881 case "$gccversion" in
4882 1*) cppflags="$cppflags -D__GNUC__"
4884 case "$mips_type" in
4886 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4892 echo "Let me guess what the preprocessor flags are..." >&4
4906 *) ftry="$previous $flag";;
4908 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4909 >cpp1.out 2>/dev/null && \
4910 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4911 >cpp2.out 2>/dev/null && \
4912 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4913 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4915 cppflags="$cppflags $ftry"
4925 *-*) echo "They appear to be: $cppflags";;
4927 $rm -f cpp.c cpp?.out
4931 : flags used in final linking phase
4933 '') if ./venix; then
4939 *-posix*) dflt="$dflt -posix" ;;
4942 *) dflt="$ldflags";;
4945 : Try to guess additional flags to pick up local libraries.
4946 for thislibdir in $libpth; do
4947 case " $loclibpth " in
4950 *"-L$thislibdir "*) ;;
4951 *) dflt="$dflt -L$thislibdir" ;;
4963 Your C linker may need flags. For this question you should
4964 include -L/whatever and any other flags used by the C linker, but you
4965 should NOT include libraries like -lwhatever.
4967 Make sure you include the appropriate -L/path flags if your C linker
4968 does not normally search all of the directories you specified above,
4971 To use no flags, specify the word "none".
4975 rp="Any additional ld flags (NOT including libraries)?"
4981 rmlist="$rmlist pdp11"
4985 echo "Checking your choice of C compiler and flags for coherency..." >&4
4986 $cat > try.c <<'EOF'
4988 int main() { printf("Ok\n"); return(0); }
4990 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4992 $cat >try.msg <<'EOM'
4993 I've tried to compile and run the following simple program:
4996 $cat try.c >> try.msg
4998 $cat >> try.msg <<EOM
5005 and I got the following output:
5009 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5010 if $sh -c "$run ./try" >>try.msg 2>&1; then
5014 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5017 cat >> try.msg <<'EOQS'
5018 If $libs contains -lsfio, and sfio is mis-configured, then it
5019 sometimes (apparently) runs and exits with a 0 status, but with no
5020 output! It may have to do with sfio's use of _exit vs. exit.
5023 rp="You have a big problem. Shall I abort Configure"
5030 echo "The program compiled OK, but exited with status $?." >>try.msg
5031 rp="You have a problem. Shall I abort Configure"
5035 echo "I can't compile the test program." >>try.msg
5036 rp="You have a BIG problem. Shall I abort Configure"
5042 case "$knowitall" in
5044 echo "(The supplied flags or libraries might be incorrect.)"
5052 *) echo "Ok. Stopping Configure." >&4
5057 n) echo "OK, that should do.";;
5059 $rm -f try try.* core
5061 : define a shorthand compile call
5065 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5066 : define a shorthand compile call for compilations that should be ok.
5070 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5072 : determine filename position in cpp output
5074 echo "Computing filename position in cpp output for #include directives..." >&4
5076 vos) testaccess=-e ;;
5079 echo '#include <stdio.h>' > foo.c
5082 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5083 $grep '^[ ]*#.*stdio\.h' | \
5084 while read cline; do
5087 while $test \$# -gt 0; do
5088 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5093 pos=\`expr \$pos + 1\`
5105 *) pos="${fieldn}th";;
5107 echo "Your cpp writes the filename in the $pos field of the line."
5110 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5111 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5114 : locate header file
5119 for usrincdir in $usrinc
5121 if test -f \$usrincdir/\$wanted; then
5122 echo "\$usrincdir/\$wanted"
5126 awkprg='{ print \$$fieldn }'
5127 echo "#include <\$wanted>" > foo\$\$.c
5128 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5129 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5130 while read cline; do
5131 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5133 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5134 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5139 # status = 0: grep returned 0 lines, case statement not executed
5140 # status = 1: headerfile found
5141 # status = 2: while loop executed, no headerfile found
5145 if test \$status -eq 1; then
5152 : define an alternate in-header-list? function
5153 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5154 cont=true; xxf="echo \"<\$1> found.\" >&4";
5155 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5156 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5158 case $# in 4) instead=instead;; *) instead="at last";; esac;
5159 while $test "$cont"; do
5161 var=$2; eval "was=\$$2";
5162 if $test "$xxx" && $test -r "$xxx";
5164 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5167 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5168 set $yyy; shift; shift; yyy=$@;
5169 case $# in 0) cont="";;
5170 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5171 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5172 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5173 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5177 do set $yyy; var=$2; eval "was=\$$2";
5178 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5179 set $yyy; shift; shift; yyy=$@;
5182 : see if stdlib is available
5183 set stdlib.h i_stdlib
5186 : check for lengths of integral types
5190 echo "Checking to see how big your integers are..." >&4
5199 printf("intsize=%d;\n", (int)sizeof(int));
5200 printf("longsize=%d;\n", (int)sizeof(long));
5201 printf("shortsize=%d;\n", (int)sizeof(short));
5206 if eval $compile_ok && $run ./try > /dev/null; then
5208 echo "Your integers are $intsize bytes long."
5209 echo "Your long integers are $longsize bytes long."
5210 echo "Your short integers are $shortsize bytes long."
5214 Help! I can't compile and run the intsize test program: please enlighten me!
5215 (This is probably a misconfiguration in your system or libraries, and
5216 you really ought to fix it. Still, I'll try anyway.)
5220 rp="What is the size of an integer (in bytes)?"
5224 rp="What is the size of a long integer (in bytes)?"
5228 rp="What is the size of a short integer (in bytes)?"
5236 : check for long long
5238 echo "Checking to see if you have long long..." >&4
5239 echo 'int main() { long long x = 7; return 0; }' > try.c
5241 if eval $compile; then
5243 echo "You have long long."
5246 echo "You do not have long long."
5252 : check for length of long long
5253 case "${d_longlong}${longlongsize}" in
5256 echo "Checking to see how big your long longs are..." >&4
5257 $cat >try.c <<'EOCP'
5261 printf("%d\n", (int)sizeof(long long));
5266 if eval $compile_ok; then
5267 longlongsize=`$run ./try`
5268 echo "Your long longs are $longlongsize bytes long."
5272 echo "(I can't seem to compile the test program. Guessing...)"
5273 rp="What is the size of a long long (in bytes)?"
5277 if $test "X$longsize" = "X$longlongsize"; then
5278 echo "(That isn't any different from an ordinary long.)"
5284 : see if inttypes.h is available
5285 : we want a real compile instead of Inhdr because some systems
5286 : have an inttypes.h which includes non-existent headers
5289 #include <inttypes.h>
5291 static int32_t foo32 = 0x12345678;
5295 if eval $compile; then
5296 echo "<inttypes.h> found." >&4
5299 echo "<inttypes.h> NOT found." >&4
5308 echo "Checking to see if you have int64_t..." >&4
5310 #include <sys/types.h>
5311 #$i_inttypes I_INTTYPES
5313 #include <inttypes.h>
5315 int main() { int64_t x = 7; }
5318 if eval $compile; then
5320 echo "You have int64_t."
5323 echo "You do not have int64_t."
5331 echo "Checking which 64-bit integer type we could use..." >&4
5337 val='"unsigned int"'
5342 *) case "$longsize" in
5346 val='"unsigned long"'
5351 *) case "$d_longlong:$longlongsize" in
5356 val='"unsigned long long"'
5361 *) case "$d_int64_t" in
5380 '') echo "Alas, no 64-bit integer types in sight." >&4
5383 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5389 case "$uselonglong" in
5390 "$define"|true|[yY]*)
5393 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5395 use64bitint="$define"
5398 case "$use64bits" in
5399 "$define"|true|[yY]*)
5402 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5404 use64bitint="$define"
5407 case "$use64bitints" in
5408 "$define"|true|[yY]*)
5411 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5413 use64bitint="$define"
5416 case "$use64bitsint" in
5417 "$define"|true|[yY]*)
5420 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5422 use64bitint="$define"
5425 case "$uselonglongs" in
5426 "$define"|true|[yY]*)
5429 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5431 use64bitint="$define"
5434 case "$use64bitsall" in
5435 "$define"|true|[yY]*)
5438 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5440 use64bitall="$define"
5445 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5447 case "$use64bitall" in
5448 "$define"|true|[yY]*) use64bitint="$define" ;;
5454 You have natively 64-bit long integers.
5458 *) case "$use64bitint" in
5459 "$define"|true|[yY]*) dflt='y';;
5468 Perl can be built to take advantage of 64-bit integer types
5469 on some systems. To do so, Configure can be run with -Duse64bitint.
5470 Choosing this option will most probably introduce binary incompatibilities.
5472 If this doesn't make any sense to you, just accept the default '$dflt'.
5473 (The default has been chosen based on your configuration.)
5475 rp='Try to use 64-bit integers, if available?'
5478 [yY]*) val="$define" ;;
5486 case "$use64bitall" in
5487 "$define"|true|[yY]*) dflt='y' ;;
5488 *) case "$longsize" in
5496 You may also choose to try maximal 64-bitness. It means using as much
5497 64-bitness as possible on the platform. This in turn means even more
5498 binary incompatibilities. On the other hand, your platform may not
5499 have any more 64-bitness available than what you already have chosen.
5501 If this doesn't make any sense to you, just accept the default '$dflt'.
5502 (The default has been chosen based on your configuration.)
5504 rp='Try to use maximal 64-bit support, if available?'
5507 [yY]*) val="$define" ;;
5512 case "$use64bitall" in
5514 case "$use64bitint" in
5518 Since you have chosen a maximally 64-bit build, I'm also turning on
5519 the use of 64-bit integers.
5521 use64bitint="$define" ;;
5526 : Look for a hint-file generated 'call-back-unit'. If the
5527 : user has specified that a 64-bit perl is to be built,
5528 : we may need to set or change some other defaults.
5529 if $test -f use64bitint.cbu; then
5530 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5533 case "$use64bitint" in
5534 "$define"|true|[yY]*)
5536 4) case "$archname64" in
5537 '') archname64=64int ;;
5544 : Look for a hint-file generated 'call-back-unit'. If the
5545 : user has specified that a maximally 64-bit perl is to be built,
5546 : we may need to set or change some other defaults.
5547 if $test -f use64bitall.cbu; then
5548 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5551 case "$use64bitall" in
5552 "$define"|true|[yY]*)
5554 4) case "$archname64" in
5555 ''|64int) archname64=64all ;;
5562 case "$d_quad:$use64bitint" in
5566 *** You have chosen to use 64-bit integers,
5567 *** but none can be found.
5568 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5569 *** Cannot continue, aborting.
5576 : check for length of double
5578 case "$doublesize" in
5580 echo "Checking to see how big your double precision numbers are..." >&4
5589 printf("%d\n", (int)sizeof(double));
5594 if eval $compile_ok; then
5595 doublesize=`$run ./try`
5596 echo "Your double is $doublesize bytes long."
5599 echo "(I can't seem to compile the test program. Guessing...)"
5600 rp="What is the size of a double precision number (in bytes)?"
5608 : check for long doubles
5610 echo "Checking to see if you have long double..." >&4
5611 echo 'int main() { long double x = 7.0; }' > try.c
5613 if eval $compile; then
5615 echo "You have long double."
5618 echo "You do not have long double."
5624 : check for length of long double
5625 case "${d_longdbl}${longdblsize}" in
5628 echo "Checking to see how big your long doubles are..." >&4
5629 $cat >try.c <<'EOCP'
5633 printf("%d\n", sizeof(long double));
5638 if eval $compile; then
5639 longdblsize=`$run ./try`
5640 echo "Your long doubles are $longdblsize bytes long."
5644 echo "(I can't seem to compile the test program. Guessing...)" >&4
5645 rp="What is the size of a long double (in bytes)?"
5649 if $test "X$doublesize" = "X$longdblsize"; then
5650 echo "That isn't any different from an ordinary double."
5651 echo "I'll keep your setting anyway, but you may see some"
5652 echo "harmless compilation warnings."
5658 : determine the architecture name
5660 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5661 tarch=`arch`"-$osname"
5662 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5663 if uname -m > tmparch 2>&1 ; then
5664 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5665 -e 's/$/'"-$osname/" tmparch`
5673 case "$myarchname" in
5676 echo "(Your architecture name used to be $myarchname.)"
5680 case "$targetarch" in
5682 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5687 *) dflt="$archname";;
5689 rp='What is your architecture name'
5692 case "$usethreads" in
5694 echo "Threads selected." >&4
5696 *-thread*) echo "...and architecture name already has -thread." >&4
5698 *) archname="$archname-thread"
5699 echo "...setting architecture name to $archname." >&4
5704 case "$usemultiplicity" in
5706 echo "Multiplicity selected." >&4
5708 *-multi*) echo "...and architecture name already has -multi." >&4
5710 *) archname="$archname-multi"
5711 echo "...setting architecture name to $archname." >&4
5716 case "$use64bitint$use64bitall" in
5718 case "$archname64" in
5720 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5723 case "$use64bitint" in
5724 "$define") echo "64 bit integers selected." >&4 ;;
5726 case "$use64bitall" in
5727 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5730 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5732 *) archname="$archname-$archname64"
5733 echo "...setting architecture name to $archname." >&4
5739 case "$uselongdouble" in
5741 echo "Long doubles selected." >&4
5742 case "$longdblsize" in
5744 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5748 *-ld*) echo "...and architecture name already has -ld." >&4
5750 *) archname="$archname-ld"
5751 echo "...setting architecture name to $archname." >&4
5758 case "$useperlio" in
5760 echo "Perlio selected." >&4
5763 echo "Perlio not selected, using stdio." >&4
5765 *-stdio*) echo "...and architecture name already has -stdio." >&4
5767 *) archname="$archname-stdio"
5768 echo "...setting architecture name to $archname." >&4
5773 if $test -f archname.cbu; then
5774 echo "Your platform has some specific hints for architecture name, using them..."
5778 : determine root of directory hierarchy where package will be installed.
5781 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5784 dflt=`echo "$prefix" | sed 's/.$//'`
5792 By default, $package will be installed in $dflt/bin, manual pages
5793 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5794 installation directories. Typically this is something like /usr/local.
5795 If you wish to have binaries under /usr/bin but other parts of the
5796 installation under /usr/local, that's ok: you will be prompted
5797 separately for each of the installation directories, the prefix being
5798 only used to set the defaults.
5802 rp='Installation prefix to use?'
5810 *) oldprefix="$prefix";;
5819 *) afsroot=$afsroot ;;
5825 $define|true) afs=true ;;
5826 $undef|false) afs=false ;;
5827 *) if test -d $afsroot; then
5835 echo "AFS may be running... I'll be extra cautious then..." >&4
5837 echo "AFS does not seem to be running..." >&4
5840 : determine installation prefix for where package is to be installed.
5844 Since you are running AFS, I need to distinguish the directory in which
5845 files will reside from the directory in which they are installed (and from
5846 which they are presumably copied to the former directory by occult means).
5849 case "$installprefix" in
5850 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5851 *) dflt="$installprefix";;
5856 In some special cases, particularly when building $package for distribution,
5857 it is convenient to distinguish the directory in which files should be
5858 installed from the directory ($prefix) in which they will
5859 eventually reside. For most users, these two directories are the same.
5862 case "$installprefix" in
5864 *) dflt=$installprefix;;
5868 rp='What installation prefix should I use for installing files?'
5870 installprefix="$ans"
5871 installprefixexp="$ansexp"
5873 : set the prefixit variable, to compute a suitable default value
5874 prefixit='case "$3" in
5876 case "$oldprefix" in
5877 "") eval "$1=\"\$$2\"";;
5884 ""|" ") eval "$1=\"\$$2\"";;
5890 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5892 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5893 /*-$oldprefix/*|\~*-$oldprefix/*)
5894 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5895 *) eval "$1=\"\$$2\"";;
5899 : get the patchlevel
5901 echo "Getting the current patchlevel..." >&4
5902 if $test -r $rsrc/patchlevel.h;then
5903 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5904 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5905 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5906 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5907 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5908 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5909 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5918 $echo "(You do not have patchlevel.h. Eek.)"
5920 if $test -r $rsrc/.patch ; then
5921 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5922 perl_patchlevel=`cat $rsrc/.patch`
5925 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5926 version_patchlevel_string="version $patchlevel subversion $subversion"
5927 case "$perl_patchlevel" in
5929 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5932 $echo "(You have $package $version_patchlevel_string.)"
5936 : XXX Should be a Configure test for double-dots in filenames.
5937 version=`echo $revision $patchlevel $subversion | \
5938 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5939 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5940 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5943 version=`echo $revision $patchlevel $subversion | \
5944 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5945 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5946 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5949 : Special case the 5.005_xx maintenance series, which used 5.005
5950 : without any subversion label as a subdirectory in $sitelib
5951 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5952 api_versionstring='5.005'
5955 : determine installation style
5956 : For now, try to deduce it from prefix unless it is already set.
5957 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5958 case "$installstyle" in
5959 '') case "$prefix" in
5960 *perl*) dflt='lib';;
5961 *) dflt='lib/perl5' ;;
5964 *) dflt="$installstyle" ;;
5966 : Probably not worth prompting for this since we prompt for all
5967 : the directories individually, and the prompt would be too long and
5972 : Set variables such as privlib and privlibexp from the output of ./getfile
5973 : performing the prefixexp/installprefixexp correction if necessary.
5974 cat <<EOS >setprefixvar
5977 cat <<'EOSC' >>setprefixvar
5978 eval "${prefixvar}=\"\$ans\""
5979 eval "${prefixvar}exp=\"\$ansexp\""
5980 : Change installation prefix, if necessary.
5981 if $test X"$prefix" != X"$installprefix"; then
5982 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
5984 eval "install${prefixvar}=\"\$${prefixvar}exp\""
5988 : determine where private library files go
5989 : Usual default is /usr/local/lib/perl5/$version.
5990 : Also allow things like /opt/perl/lib/$version, since
5991 : /opt/perl/lib/perl5... would be redundant.
5992 : The default "style" setting is made in installstyle.U
5993 case "$installstyle" in
5994 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5995 *) set dflt privlib lib/$version ;;
6000 There are some auxiliary files for $package that need to be put into a
6001 private library directory that is accessible by everyone.
6005 rp='Pathname where the private library files will reside?'
6010 : set the prefixup variable, to restore leading tilda escape
6011 prefixup='case "$prefixexp" in
6013 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6016 : determine where public architecture dependent libraries go
6019 : privlib default is /usr/local/lib/$package/$version
6020 : archlib default is /usr/local/lib/$package/$version/$archname
6021 : privlib may have an optional trailing /share.
6022 tdflt=`echo $privlib | $sed 's,/share$,,'`
6023 tdflt=$tdflt/$archname
6032 $spackage contains architecture-dependent library files. If you are
6033 sharing libraries in a heterogeneous environment, you might store
6034 these files in a separate location. Otherwise, you can just include
6035 them with the rest of the public library files.
6039 rp='Where do you want to put the public architecture-dependent libraries?'
6043 if $test X"$archlib" = X"$privlib"; then
6049 : see if setuid scripts can be secure
6052 Some kernels have a bug that prevents setuid #! scripts from being
6053 secure. Some sites have disabled setuid #! scripts because of this.
6055 First let's decide if your kernel supports secure setuid #! scripts.
6056 (If setuid #! scripts would be secure but have been disabled anyway,
6057 don't say that they are secure if asked.)
6062 if $test -d /dev/fd; then
6063 echo "#!$ls" >reflect
6064 chmod +x,u+s reflect
6065 ./reflect >flect 2>&1
6066 if $contains "/dev/fd" flect >/dev/null; then
6067 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6071 If you are not sure if they are secure, I can check but I'll need a
6072 username and password different from the one you are using right now.
6073 If you don't have such a username or don't want me to test, simply
6077 rp='Other username to test security of setuid scripts with?'
6082 case "$d_suidsafe" in
6083 '') echo "I'll assume setuid scripts are *not* secure." >&4
6086 echo "Well, the $hint value is *not* secure." >&4
6088 *) echo "Well, the $hint value *is* secure." >&4
6093 $rm -f reflect flect
6094 echo "#!$ls" >reflect
6095 chmod +x,u+s reflect
6098 echo '"su" will (probably) prompt you for '"$ans's password."
6099 su $ans -c './reflect >flect'
6100 if $contains "/dev/fd" flect >/dev/null; then
6101 echo "Okay, it looks like setuid scripts are secure." >&4
6104 echo "I don't think setuid scripts are secure." >&4
6109 rp='Does your kernel have *secure* setuid scripts?'
6112 [yY]*) val="$define";;
6117 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6118 echo "(That's for file descriptors, not floppy disks.)"
6124 $rm -f reflect flect
6126 : now see if they want to do setuid emulation
6129 case "$d_suidsafe" in
6132 echo "No need to emulate SUID scripts since they are secure here." >&4
6136 Some systems have disabled setuid scripts, especially systems where
6137 setuid scripts cannot be secure. On systems where setuid scripts have
6138 been disabled, the setuid/setgid bits on scripts are currently
6139 useless. It is possible for $package to detect those bits and emulate
6140 setuid/setgid in a secure fashion. This emulation will only work if
6141 setuid scripts have been disabled in your kernel.
6145 "$define") dflt=y ;;
6148 rp="Do you want to do setuid/setgid emulation?"
6151 [yY]*) val="$define";;
6159 : see if this is a malloc.h system
6160 : we want a real compile instead of Inhdr because some systems have a
6161 : malloc.h that just gives a compile error saying to use stdlib.h instead
6166 int main () { return 0; }
6169 if eval $compile; then
6170 echo "<malloc.h> found." >&4
6173 echo "<malloc.h> NOT found." >&4
6180 : check for void type
6182 echo "Checking to see how well your C compiler groks the void type..." >&4
6183 case "$voidflags" in
6195 extern void moo(); /* function returning void */
6196 void (*goo)(); /* ptr to func returning void */
6198 void *hue; /* generic ptr */
6211 int main() { sub(); }
6213 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6214 voidflags=$defvoidused
6215 echo "Good. It appears to support void to the level $package wants.">&4
6216 if $contains warning .out >/dev/null 2>&1; then
6217 echo "However, you might get some warnings that look like this:"
6221 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6222 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6223 echo "It supports 1..."
6224 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6225 echo "It also supports 2..."
6226 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6228 echo "And it supports 4 but not 8 definitely."
6230 echo "It doesn't support 4..."
6231 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6233 echo "But it supports 8."
6236 echo "Neither does it support 8."
6240 echo "It does not support 2..."
6241 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6243 echo "But it supports 4 and 8."
6245 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6247 echo "And it supports 4 but has not heard about 8."
6249 echo "However it supports 8 but not 4."
6254 echo "There is no support at all for void."
6259 case "$voidflags" in
6262 Support flag bits are:
6263 1: basic void declarations.
6264 2: arrays of pointers to functions returning void.
6265 4: operations between pointers to and addresses of void functions.
6266 8: generic void pointers.
6269 rp="Your void support flags add up to what?"
6276 : check for length of pointer
6280 echo "Checking to see how big your pointers are..." >&4
6281 if test "$voidflags" -gt 7; then
6282 echo '#define VOID_PTR char *' > try.c
6284 echo '#define VOID_PTR void *' > try.c
6294 printf("%d\n", (int)sizeof(VOID_PTR));
6299 if eval $compile_ok; then
6300 ptrsize=`$run ./try`
6301 echo "Your pointers are $ptrsize bytes long."
6304 echo "(I can't seem to compile the test program. Guessing...)" >&4
6305 rp="What is the size of a pointer (in bytes)?"
6312 case "$use64bitall" in
6313 "$define"|true|[yY]*)
6317 *** You have chosen a maximally 64-bit build,
6318 *** but your pointers are only 4 bytes wide.
6319 *** Please rerun Configure without -Duse64bitall.
6324 *** Since you have quads, you could possibly try with -Duse64bitint.
6329 *** Cannot continue, aborting.
6340 : determine whether to use malloc wrapping
6342 case "$usemallocwrap" in
6343 [yY]*|true|$define) dflt='y' ;;
6344 [nN]*|false|$undef) dflt='n' ;;
6345 *) case "$usedevel" in
6346 [yY]*|true|$define) dflt='y' ;;
6351 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6353 usemallocwrap="$ans"
6356 usemallocwrap="$define" ;;
6358 usemallocwrap="$undef" ;;
6361 : determine which malloc to compile in
6363 case "$usemymalloc" in
6364 [yY]*|true|$define) dflt='y' ;;
6365 [nN]*|false|$undef) dflt='n' ;;
6366 *) case "$ptrsize" in
6372 rp="Do you wish to attempt to use the malloc that comes with $package?"
6378 mallocsrc='malloc.c'
6379 mallocobj="malloc$_o"
6380 d_mymalloc="$define"
6383 : Remove malloc from list of libraries to use
6384 echo "Removing unneeded -lmalloc from library list" >&4
6385 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6388 echo "libs = $libs" >&4
6400 : compute the return types of malloc and free
6402 $cat >malloc.c <<END
6406 #include <sys/types.h>
6420 case "$malloctype" in
6422 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6429 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6433 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6440 echo "Your system uses $freetype free(), it would seem." >&4
6444 After $package is installed, you may wish to install various
6445 add-on modules and utilities. Typically, these add-ons will
6446 be installed under $prefix with the rest
6447 of this package. However, you may wish to install such add-ons
6448 elsewhere under a different prefix.
6450 If you do not wish to put everything under a single prefix, that's
6451 ok. You will be prompted for the individual locations; this siteprefix
6452 is only used to suggest the defaults.
6454 The default should be fine for most people.
6458 rp='Installation prefix to use for add-on modules and utilities?'
6459 : XXX Here might be another good place for an installstyle setting.
6460 case "$siteprefix" in
6462 *) dflt=$siteprefix ;;
6465 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6467 case "$siteprefix" in
6471 *) oldsiteprefix="$prefix";;
6476 siteprefixexp="$ansexp"
6478 : determine where site specific libraries go.
6479 : Usual default is /usr/local/lib/perl5/site_perl/$version
6480 : The default "style" setting is made in installstyle.U
6481 : XXX No longer works with Prefixit stuff.
6482 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6484 '') case "$installstyle" in
6485 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6486 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6494 The installation process will create a directory for
6495 site-specific extensions and modules. Most users find it convenient
6496 to place all site-specific files in this directory rather than in the
6497 main distribution directory.
6501 rp='Pathname for the site-specific library files?'
6505 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6507 : determine where site specific architecture-dependent libraries go.
6508 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6509 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6510 : sitelib may have an optional trailing /share.
6512 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6513 dflt="$dflt/$archname"
6518 set sitearch sitearch none
6522 The installation process will also create a directory for
6523 architecture-dependent site-specific extensions and modules.
6527 rp='Pathname for the site-specific architecture-dependent library files?'
6534 The installation process will also create a directory for
6535 vendor-supplied add-ons. Vendors who supply perl with their system
6536 may find it convenient to place all vendor-supplied files in this
6537 directory rather than in the main distribution directory. This will
6538 ease upgrades between binary-compatible maintenance versions of perl.
6540 Of course you may also use these directories in whatever way you see
6541 fit. For example, you might use them to access modules shared over a
6542 company-wide network.
6544 The default answer should be fine for most people.
6545 This causes further questions about vendor add-ons to be skipped
6546 and no vendor-specific directories will be configured for perl.
6549 rp='Do you want to configure vendor-specific add-on directories?'
6550 case "$usevendorprefix" in
6551 define|true|[yY]*) dflt=y ;;
6552 *) : User may have set vendorprefix directly on Configure command line.
6553 case "$vendorprefix" in
6562 rp='Installation prefix to use for vendor-supplied add-ons?'
6563 case "$vendorprefix" in
6565 *) dflt=$vendorprefix ;;
6568 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6570 case "$vendorprefix" in
6574 *) oldvendorprefix="$prefix";;
6578 usevendorprefix="$define"
6580 vendorprefixexp="$ansexp"
6582 *) usevendorprefix="$undef"
6588 case "$vendorprefix" in
6589 '') d_vendorlib="$undef"
6593 *) d_vendorlib="$define"
6594 : determine where vendor-supplied modules go.
6595 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6596 case "$vendorlib" in
6598 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6599 case "$installstyle" in
6600 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6601 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6604 *) dflt="$vendorlib"
6608 rp='Pathname for the vendor-supplied library files?'
6611 vendorlibexp="$ansexp"
6614 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6615 : Change installation prefix, if necessary.
6616 if $test X"$prefix" != X"$installprefix"; then
6617 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefixexp#$installprefixexp#"`
6619 installvendorlib="$vendorlibexp"
6622 case "$vendorprefix" in
6623 '') d_vendorarch="$undef"
6627 *) d_vendorarch="$define"
6628 : determine where vendor-supplied architecture-dependent libraries go.
6629 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6630 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6631 : vendorlib may have an optional trailing /share.
6632 case "$vendorarch" in
6633 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6634 dflt="$dflt/$archname"
6636 *) dflt="$vendorarch" ;;
6639 rp='Pathname for vendor-supplied architecture-dependent files?'
6642 vendorarchexp="$ansexp"
6645 : Change installation prefix, if necessary.
6646 if $test X"$prefix" != X"$installprefix"; then
6647 installvendorarch=`echo $vendorarchexp | sed "s#^$prefixexp#$installprefixexp#"`
6649 installvendorarch="$vendorarchexp"
6652 : Final catch-all directories to search
6655 Lastly, you can have perl look in other directories for extensions and
6656 modules in addition to those already specified.
6657 These directories will be searched after
6661 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6662 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6664 case "$otherlibdirs" in
6665 ''|' ') dflt='none' ;;
6666 *) dflt="$otherlibdirs" ;;
6669 Enter a colon-separated set of extra paths to include in perl's @INC
6670 search path, or enter 'none' for no extra paths.
6674 rp='Colon-separated list of additional directories for perl to search?'
6677 ' '|''|none) otherlibdirs=' ' ;;
6678 *) otherlibdirs="$ans" ;;
6680 case "$otherlibdirs" in
6684 set d_perl_otherlibdirs
6687 : Cruising for prototypes
6689 echo "Checking out function prototypes..." >&4
6690 $cat >prototype.c <<EOCP
6695 int main(int argc, char *argv[]) {
6698 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6699 echo "Your C compiler appears to support function prototypes."
6702 echo "Your C compiler doesn't seem to understand function prototypes."
6709 case "$prototype" in
6711 *) ansi2knr='ansi2knr'
6716 This version of $package can only be compiled by a compiler that
6717 understands function prototypes. Unfortunately, your C compiler
6719 doesn't seem to understand them. Sorry about that.
6721 If GNU cc is available for your system, perhaps you could try that instead.
6723 Eventually, we hope to support building Perl with pre-ANSI compilers.
6724 If you would like to help in that effort, please contact <perlbug@perl.org>.
6726 Aborting Configure now.
6732 : determine where public executables go
6737 rp='Pathname where the public executables will reside?'
6739 if $test "X$ansexp" != "X$binexp"; then
6743 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
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?"
6816 : Use ' ' for none so value is preserved next time through Configure
6817 $test X"$html1dir" = "X" && html1dir=' '
6819 : determine where html pages for libraries and modules go
6820 set html3dir html3dir none
6824 If you wish to install html files for modules associated with $spackage,
6825 indicate the appropriate directory here. To skip installing html files,
6828 : There is no obvious default. If they have specified html1dir, then
6829 : try to key off that, possibly changing .../html1 into .../html3.
6831 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6832 *) dflt=$html3dir ;;
6835 rp="Directory for the $spackage module html pages?"
6839 : Use ' ' for none so value is preserved next time through Configure
6840 $test X"$html3dir" = "X" && html3dir=' '
6842 : Find perl5.005 or later.
6843 echo "Looking for a previously installed perl5.005 or later... "
6845 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6846 : Check if this perl is recent and can load a simple module
6847 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6850 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6860 '') echo "None found. That's ok.";;
6861 *) echo "Using $perl5." ;;
6864 : Determine list of previous versions to include in @INC
6865 $cat > getverlist <<EOPL
6868 \$api_versionstring = "$api_versionstring";
6869 \$version = "$version";
6870 \$stem = "$sitelib_stem";
6871 \$archname = "$archname";
6873 $cat >> getverlist <<'EOPL'
6874 # Can't have leading @ because metaconfig interprets it as a command!
6875 ;@inc_version_list=();
6876 # XXX Redo to do opendir/readdir?
6879 ;@candidates = glob("5.*");
6885 # XXX ToDo: These comparisons must be reworked when two-digit
6886 # subversions come along, so that 5.7.10 compares as greater than
6887 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6888 # widespread that we can use the built-in version vectors rather
6889 # than reinventing them here. For 5.6.0, however, we must
6890 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6891 foreach $d (@candidates) {
6892 if ($d lt $version) {
6893 if ($d ge $api_versionstring) {
6894 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6896 elsif ($d ge "5.005") {
6897 unshift(@inc_version_list, grep { -d } $d);
6901 # Skip newer version. I.e. don't look in
6902 # 5.7.0 if we're installing 5.6.1.
6906 if (@inc_version_list) {
6907 print join(' ', @inc_version_list);
6910 # Blank space to preserve value for next Configure run.
6915 case "$inc_version_list" in
6916 '') if test -x "$perl5$exe_ext"; then
6917 dflt=`$perl5 getverlist`
6922 $undef) dflt='none' ;;
6923 *) eval dflt=\"$inc_version_list\" ;;
6926 ''|' ') dflt=none ;;
6933 In order to ease the process of upgrading, this version of perl
6934 can be configured to use modules built and installed with earlier
6935 versions of perl that were installed under $prefix. Specify here
6936 the list of earlier versions that this version of perl should check.
6937 If Configure detected no earlier versions of perl installed under
6938 $prefix, then the list will be empty. Answer 'none' to tell perl
6939 to not search earlier versions.
6941 The default should almost always be sensible, so if you're not sure,
6942 just accept the default.
6945 rp='List of earlier versions to include in @INC?'
6948 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6949 *) inc_version_list="$ans" ;;
6951 case "$inc_version_list" in
6953 inc_version_list_init='0';;
6954 *) inc_version_list_init=`echo $inc_version_list |
6955 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6960 : determine whether to install perl also as /usr/bin/perl
6963 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6965 Many scripts expect perl to be installed as /usr/bin/perl.
6967 If you want to, I can install the perl you are about to compile
6968 as /usr/bin/perl (in addition to $bin/perl).
6970 if test -f /usr/bin/perl; then
6973 However, please note that because you already have a /usr/bin/perl,
6974 overwriting that with a new Perl would very probably cause problems.
6975 Therefore I'm assuming you don't want to do that (unless you insist).
6978 case "$installusrbinperl" in
6979 "$define"|[yY]*) dflt='y';;
6985 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
6988 case "$installusrbinperl" in
6989 "$undef"|[nN]*) dflt='n';;
6993 rp="Do you want to install perl as /usr/bin/perl?"
6996 [yY]*) val="$define";;
7002 set installusrbinperl
7006 echo "Checking for GNU C Library..." >&4
7008 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7009 alone are insufficient to distinguish different versions, such as
7010 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7011 libc version 2.1.0. A. Dougherty, June 3, 2002.
7017 # ifdef __GLIBC_MINOR__
7018 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7019 # include <gnu/libc-version.h>
7020 printf("%s\n", gnu_get_libc_version());
7022 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7025 printf("%d\n", __GLIBC__);
7034 if eval $compile_ok && $run ./try > glibc.ver; then
7036 gnulibc_version=`$cat glibc.ver`
7037 echo "You are using the GNU C Library version $gnulibc_version"
7041 echo "You are not using the GNU C Library"
7043 $rm -f try try.* glibc.ver
7047 : see if nm is to be used to determine whether a symbol is defined or not
7051 case "$d_gnulibc" in
7054 echo "nm probably won't work on the GNU C Library." >&4
7060 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7062 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7063 echo "'nm' won't be sufficient on this sytem." >&4
7069 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7070 if $test $dflt -gt 20; then
7080 true|$define) dflt=y;;
7087 I can use $nm to extract the symbols from your C libraries. This
7088 is a time consuming task which may generate huge output on the disk (up
7089 to 3 megabytes) but that should make the symbols extraction faster. The
7090 alternative is to skip the 'nm' extraction part and to compile a small
7091 test program instead to determine whether each symbol is present. If
7092 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7093 this may be the best solution.
7095 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7098 rp="Shall I use $nm to extract C symbols from the libraries?"
7101 [Nn]*) usenm=false;;
7110 : nm options which may be necessary
7112 '') if $test -f /mach_boot; then
7114 elif $test -d /usr/ccs/lib; then
7115 nm_opt='-p' # Solaris (and SunOS?)
7116 elif $test -f /dgux; then
7118 elif $test -f /lib64/rld; then
7119 nm_opt='-p' # 64-bit Irix
7125 : nm options which may be necessary for shared libraries but illegal
7126 : for archive libraries. Thank you, Linux.
7127 case "$nm_so_opt" in
7128 '') case "$myuname" in
7130 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7131 nm_so_opt='--dynamic'
7140 : get list of predefined functions in a handy place
7145 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7151 *) for thislib in $libs; do
7154 : Handle C library specially below.
7157 thislib=`echo $thislib | $sed -e 's/^-l//'`
7158 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7160 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7162 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7164 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7166 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7168 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7170 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7175 libnames="$libnames $try"
7177 *) libnames="$libnames $thislib" ;;
7186 for xxx in $libpth; do
7187 $test -r $1 || set $xxx/libc.$so
7188 : The messy sed command sorts on library version numbers.
7190 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7191 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7193 s/[0-9][0-9]*/0000&/g
7194 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7197 $sort | $sed -e 's/^.* //'`
7200 $test -r $1 || set /usr/ccs/lib/libc.$so
7201 $test -r $1 || set /lib/libsys_s$_a
7207 if $test -r "$1"; then
7208 echo "Your (shared) C library seems to be in $1."
7210 elif $test -r /lib/libc && $test -r /lib/clib; then
7211 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7213 libc='/lib/clib /lib/libc'
7214 if $test -r /lib/syslib; then
7215 echo "(Your math library is in /lib/syslib.)"
7216 libc="$libc /lib/syslib"
7218 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7219 echo "Your C library seems to be in $libc, as you said before."
7220 elif $test -r $incpath/usr/lib/libc$_a; then
7221 libc=$incpath/usr/lib/libc$_a;
7222 echo "Your C library seems to be in $libc. That's fine."
7223 elif $test -r /lib/libc$_a; then
7225 echo "Your C library seems to be in $libc. You're normal."
7227 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7229 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7230 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7231 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7233 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7235 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7238 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7240 if $test -r "$tans"; then
7241 echo "Your C library seems to be in $tans, of all places."
7247 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7251 If the guess above is wrong (which it might be if you're using a strange
7252 compiler, or your machine supports multiple models), you can override it here.
7257 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7259 I can't seem to find your C library. I've looked in the following places:
7262 $sed 's/^/ /' libpath
7265 None of these seems to contain your C library. I need to get its name...
7270 rp='Where is your C library?'
7275 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7276 set X `cat libnames`
7279 case $# in 1) xxx=file; esac
7280 echo "Extracting names from the following $xxx for later perusal:" >&4
7282 $sed 's/^/ /' libnames >&4
7284 $echo $n "This may take a while...$c" >&4
7288 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7289 *) $nm $nm_opt $file 2>/dev/null;;
7294 $grep fprintf libc.tmp > libc.ptf
7295 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7296 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7298 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7300 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7302 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7304 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7306 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7308 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7310 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //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.*text.*/\1/p'";\
7316 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7318 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7320 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7322 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7323 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7325 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7327 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7329 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7331 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7333 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7335 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7337 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7339 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7341 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7343 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7345 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7347 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7349 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7351 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7353 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7356 $nm -p $* 2>/dev/null >libc.tmp
7357 $grep fprintf libc.tmp > libc.ptf
7358 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7359 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7365 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7367 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7368 for thisname in $libnames $libc; do
7369 $ar t $thisname >>libc.tmp
7371 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7373 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7374 # Repeat libc to extract forwarders to DLL entries too
7375 for thisname in $libnames $libc; do
7376 $ar tv $thisname >>libc.tmp
7377 # Revision 50 of EMX has bug in $ar.
7378 # it will not extract forwarders to DLL entries
7379 # Use emximp which will extract exactly them.
7380 emximp -o tmp.imp $thisname \
7382 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7383 < tmp.imp >>libc.tmp
7386 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7389 echo "$ar didn't seem to work right." >&4
7390 echo "Maybe this is a Cray...trying bld instead..." >&4
7391 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7393 for thisname in $libnames; do
7395 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7396 $ar t $thisname >>libc.tmp
7400 echo "That didn't work either. Giving up." >&4
7410 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7411 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7413 *) if $test -f /lib/syscalls.exp; then
7415 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7416 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7422 $rm -f libnames libpath
7424 : see if dld is available
7428 : is a C symbol defined?
7431 -v) tf=libc.tmp; tdc="";;
7432 -a) tf=libc.tmp; tdc="[]";;
7433 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7436 case "$reuseval-$4" in
7438 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7443 if $test "$runnm" = true; then
7444 if $contains $tlook $tf >/dev/null 2>&1; then
7446 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7447 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7448 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7449 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7450 $rm -f try$_exe try.c core core.* try.core;
7453 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7454 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7455 $rm -f try$_exe try.c;
7460 $define) tval=true;;
7467 : define an is-in-libc? function
7468 inlibc='echo " "; td=$define; tu=$undef;
7469 sym=$1; var=$2; eval "was=\$$2";
7471 case "$reuseval$was" in
7481 echo "$sym() found." >&4;
7482 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7484 echo "$sym() NOT found." >&4;
7485 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7489 $define) echo "$sym() found." >&4;;
7490 *) echo "$sym() NOT found." >&4;;
7494 : see if dlopen exists
7501 : determine which dynamic loading, if any, to compile in
7503 dldir="ext/DynaLoader"
7516 $define) dflt='y' ;;
7519 $define) dflt='y' ;;
7521 : Does a dl_xxx.xs file exist for this operating system
7522 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7525 rp="Do you wish to use dynamic loading?"
7532 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7533 dflt="$dldir/dl_${osname}.xs"
7534 elif $test "$d_dlopen" = "$define" ; then
7535 dflt="$dldir/dl_dlopen.xs"
7536 elif $test "$i_dld" = "$define" ; then
7537 dflt="$dldir/dl_dld.xs"
7542 *) dflt="$dldir/$dlsrc"
7545 echo "The following dynamic loading files are available:"
7546 : Can not go over to $dldir because getfile has path hard-coded in.
7547 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7548 rp="Source file to use for dynamic loading"
7554 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7558 Some systems may require passing special flags to $cc -c to
7559 compile modules that will be used to create a shared library.
7560 To use no flags, say "none".
7563 case "$cccdlflags" in
7564 '') case "$gccversion" in
7565 '') case "$osname" in
7567 next) dflt='none' ;;
7568 irix*) dflt='-KPIC' ;;
7569 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7570 sunos) dflt='-pic' ;;
7574 *) case "$osname" in
7575 darwin) dflt='none' ;;
7576 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7581 *) dflt="$cccdlflags" ;;
7583 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7586 none) cccdlflags=' ' ;;
7587 *) cccdlflags="$ans" ;;
7592 Some systems use ld to create libraries that can be dynamically loaded,
7593 while other systems (such as those using ELF) use $cc.
7597 '') $cat >try.c <<EOM
7598 /* Test for whether ELF binaries are produced */
7606 int i = open("a.out",O_RDONLY);
7609 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7610 exit(0); /* succeed (yes, it's ELF) */
7615 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7617 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7621 echo "I'll use ld to build dynamic libraries."
7630 rp="What command should be used to create dynamic libraries?"
7636 Some systems may require passing special flags to $ld to create a
7637 library that can be dynamically loaded. If your ld flags include
7638 -L/other/path options to locate libraries outside your loader's normal
7639 search path, you may need to specify those -L options here as well. To
7640 use no flags, say "none".
7643 case "$lddlflags" in
7644 '') case "$osname" in
7645 beos) dflt='-nostart' ;;
7647 case "$gccversion" in
7648 '') dflt="$dflt +vnocompatwarnings" ;;
7651 linux|irix*|gnu*) dflt='-shared' ;;
7652 next) dflt='none' ;;
7653 solaris) dflt='-G' ;;
7654 sunos) dflt='-assert nodefinitions' ;;
7655 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7659 *) dflt="$lddlflags" ;;
7662 : Try to guess additional flags to pick up local libraries.
7663 : Be careful not to append to a plain 'none'
7667 for thisflag in $ldflags; do
7672 *) dflt="$dflt $thisflag" ;;
7679 ''|' ') dflt='none' ;;
7682 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7685 none) lddlflags=' ' ;;
7686 *) lddlflags="$ans" ;;
7691 Some systems may require passing special flags to $cc to indicate that
7692 the resulting executable will use dynamic linking. To use no flags,
7696 case "$ccdlflags" in
7697 '') case "$osname" in
7698 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7699 next|sunos) dflt='none' ;;
7703 *) dflt="$ccdlflags" ;;
7705 rp="Any special flags to pass to $cc to use dynamic linking?"
7708 none) ccdlflags=' ' ;;
7709 *) ccdlflags="$ans" ;;
7723 # No dynamic loading being used, so don't bother even to prompt.
7726 *) case "$useshrplib" in
7727 '') case "$osname" in
7728 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7730 also='Building a shared libperl is required for dynamic loading to work on your system.'
7735 also='Building a shared libperl is needed for MAB support.'
7753 The perl executable is normally obtained by linking perlmain.c with
7754 libperl${_a}, any static extensions (usually just DynaLoader), and
7755 any other libraries needed on this system (such as -lm, etc.). Since
7756 your system supports dynamic loading, it is probably possible to build
7757 a shared libperl.$so. If you will have more than one executable linked
7758 to libperl.$so, this will significantly reduce the size of each
7759 executable, but it may have a noticeable effect on performance. The
7760 default is probably sensible for your system.
7764 rp="Build a shared libperl.$so (y/n)"
7768 useshrplib='true' ;;
7769 *) useshrplib='false' ;;
7774 case "$useshrplib" in
7778 # Figure out a good name for libperl.so. Since it gets stored in
7779 # a version-specific architecture-dependent library, the version
7780 # number isn't really that important, except for making cc/ld happy.
7782 # A name such as libperl.so.3.1
7783 majmin="libperl.$so.$patchlevel.$subversion"
7784 # A name such as libperl.so.301
7785 majonly=`echo $patchlevel $subversion |
7786 $awk '{printf "%d%02d", $1, $2}'`
7787 majonly=libperl.$so.$majonly
7788 # I'd prefer to keep the os-specific stuff here to a minimum, and
7789 # rely on figuring it out from the naming of libc.
7790 case "${osname}${osvers}" in
7793 # XXX How handle the --version stuff for MAB?
7795 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7798 cygwin*) # ld links against an importlib
7799 dflt=libperl$lib_ext
7801 *) # Try to guess based on whether libc has major.minor.
7803 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7804 *libc.$so.[0-9]*) dflt=$majonly ;;
7805 *) dflt=libperl.$so ;;
7815 I need to select a good name for the shared libperl. If your system uses
7816 library names with major and minor numbers, then you might want something
7817 like $majmin. Alternatively, if your system uses a single version
7818 number for shared libraries, then you might want to use $majonly.
7819 Or, your system might be quite happy with a simple libperl.$so.
7821 Since the shared libperl will get installed into a version-specific
7822 architecture-dependent directory, the version number of the shared perl
7823 library probably isn't important, so the default should be o.k.
7826 rp='What name do you want to give to the shared libperl?'
7829 echo "Ok, I'll use $libperl"
7832 libperl="libperl${_a}"
7836 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7840 WARNING: Use of the shrpdir variable for the installation location of
7841 the shared $libperl is not supported. It was never documented and
7842 will not work in this version. Let me (perlbug@perl.org)
7843 know of any problems this may cause.
7849 But your current setting of $shrpdir is
7850 the default anyway, so it's harmless.
7855 Further, your current attempted setting of $shrpdir
7856 conflicts with the value of $archlibexp/CORE
7857 that installperl will use.
7864 # How will the perl executable find the installed shared $libperl?
7865 # Add $xxx to ccdlflags.
7866 # If we can't figure out a command-line option, use $shrpenv to
7867 # set env LD_RUN_PATH. The main perl makefile uses this.
7868 shrpdir=$archlibexp/CORE
7871 if "$useshrplib"; then
7874 # We'll set it in Makefile.SH...
7879 freebsd|netbsd|openbsd|interix|dragonfly)
7880 xxx="-Wl,-R$shrpdir"
7882 bsdos|linux|irix*|dec_osf|gnu*)
7883 xxx="-Wl,-rpath,$shrpdir"
7886 # next doesn't like the default...
7889 # beos doesn't like the default, either.
7892 # hpux doesn't like the default, either.
7893 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7896 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7902 # Only add $xxx if it isn't already in ccdlflags.
7903 case " $ccdlflags " in
7905 *) ccdlflags="$ccdlflags $xxx"
7908 Adding $xxx to the flags
7909 passed to $ld so that the perl executable will find the
7910 installed shared $libperl.
7918 # Fix ccdlflags in AIX for building external extensions.
7919 # (For building Perl itself bare -bE:perl.exp is needed,
7920 # Makefile.SH takes care of this.)
7922 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7924 # Respect a hint or command-line value.
7926 '') shrpenv="$tmp_shrpenv" ;;
7928 case "$ldlibpthname" in
7929 '') ldlibpthname=LD_LIBRARY_PATH ;;
7930 none) ldlibpthname='' ;;
7933 : determine where manual pages are on this system
7937 syspath='/usr/share/man/man1 /usr/man/man1'
7938 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7939 syspath="$syspath /usr/man/u_man/man1"
7940 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7941 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7942 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7943 sysman=`./loc . /usr/man/man1 $syspath`
7946 if $test -d "$sysman"; then
7947 echo "System manual is in $sysman." >&4
7949 echo "Could not find manual pages in source form." >&4
7952 : determine where manual pages go
7953 set man1dir man1dir none
7957 $spackage has manual pages available in source form.
7961 echo "However, you don't have nroff, so they're probably useless to you."
7963 '') man1dir="none";;
7966 echo "If you don't want the manual sources installed, answer 'none'."
7971 lookpath="$prefixexp/share/man/man1"
7972 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7973 lookpath="$lookpath $prefixexp/man/p_man/man1"
7974 lookpath="$lookpath $prefixexp/man/u_man/man1"
7975 lookpath="$lookpath $prefixexp/man/man.1"
7977 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7978 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7988 rp="Where do the main $spackage manual pages (source) go?"
7990 if $test "X$man1direxp" != "X$ansexp"; then
8001 : What suffix to use on installed man pages
8008 rp="What suffix should be used for the main $spackage man pages?"
8010 '') case "$man1dir" in
8024 *) dflt="$man1ext";;
8031 : see if we can have long filenames
8033 first=123456789abcdef
8035 if (echo hi >$first) 2>/dev/null; then
8036 if $test -f 123456789abcde; then
8037 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8040 echo 'You can have filenames longer than 14 characters.'>&4
8045 You can't have filenames longer than 14 chars.
8046 You can't even think about them!
8052 $rm -rf 123456789abcde*
8054 : determine where library module manual pages go
8055 set man3dir man3dir none
8059 $spackage has manual pages for many of the library modules.
8065 However, you don't have nroff, so they're probably useless to you.
8068 '') man3dir="none";;
8072 case "$d_flexfnam" in
8075 However, your system can't handle the long file names like File::Basename.3.
8078 '') man3dir="none";;
8082 echo "If you don't want the manual sources installed, answer 'none'."
8083 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8085 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8086 if $test -d "$privlib/man/man3"; then
8089 WARNING: Previous versions of perl installed man3 pages into
8090 $privlib/man/man3. This version will suggest a
8091 new default of $dflt.
8095 rp='Do you wish to preserve the old behavior?(y/n)'
8098 y*) dflt="$privlib/man/man3" ;;
8103 *) dflt="$man3dir" ;;
8110 rp="Where do the $package library man pages (source) go?"
8120 : What suffix to use on installed man pages
8126 rp="What suffix should be used for the $package library man pages?"
8128 '') case "$man3dir" in
8142 *) dflt="$man3ext";;
8149 : see if we have to deal with yellow pages, now NIS.
8150 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8151 if $test -f /usr/etc/nibindd; then
8153 echo "I'm fairly confident you're on a NeXT."
8155 rp='Do you get the hosts file via NetInfo?'
8164 y*) hostcat='nidump hosts .';;
8165 *) case "$hostcat" in
8166 nidump*) hostcat='';;
8176 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8184 rp='Are you getting the hosts file via yellow pages?'
8187 y*) hostcat='ypcat hosts';;
8188 *) hostcat='cat /etc/hosts';;
8194 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8197 '') test -f /etc/group && groupcat='cat /etc/group';;
8200 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8203 : now get the host name
8205 echo "Figuring out host name..." >&4
8206 case "$myhostname" in
8208 echo 'Maybe "hostname" will work...'
8209 if tans=`sh -c hostname 2>&1` ; then
8217 if $test "$cont"; then
8219 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8220 if tans=`cat /etc/systemid 2>&1` ; then
8222 phostname='cat /etc/systemid'
8223 echo "Whadyaknow. Xenix always was a bit strange..."
8226 elif $test -r /etc/systemid; then
8227 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8230 if $test "$cont"; then
8231 echo 'No, maybe "uuname -l" will work...'
8232 if tans=`sh -c 'uuname -l' 2>&1` ; then
8234 phostname='uuname -l'
8236 echo 'Strange. Maybe "uname -n" will work...'
8237 if tans=`sh -c 'uname -n' 2>&1` ; then
8239 phostname='uname -n'
8241 echo 'Oh well, maybe I can mine it out of whoami.h...'
8242 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8243 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8244 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8246 case "$myhostname" in
8247 '') echo "Does this machine have an identity crisis or something?"
8250 echo "Well, you said $myhostname before..."
8251 phostname='echo $myhostname';;
8257 case "$myhostname" in
8258 '') myhostname=noname ;;
8260 : you do not want to know about this
8265 if $test "$myhostname" ; then
8267 rp='Your host name appears to be "'$myhostname'".'" Right?"
8275 : bad guess or no guess
8276 while $test "X$myhostname" = X ; do
8278 rp="Please type the (one word) name of your host:"
8283 : translate upper to lower if necessary
8284 case "$myhostname" in
8286 echo "(Normalizing case in your host name)"
8287 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8291 case "$myhostname" in
8293 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8294 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8295 echo "(Trimming domain name from host name--host name is now $myhostname)"
8297 *) case "$mydomain" in
8300 test "X$hostcat" = "Xypcat hosts" &&
8301 ypmatch "$myhostname" hosts 2>/dev/null |\
8302 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8305 test "X$hostcat" != "X" &&
8306 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8307 /[ ]$myhostname[ . ]/p" > hosts
8310 if $test -f hosts; then
8311 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8312 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8313 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8314 hosts | $sort | $uniq | \
8315 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8316 case `$echo X$dflt` in
8317 X*\ *) echo "(Several hosts in the database matched hostname)"
8320 X.) echo "(You do not have fully-qualified names in the hosts database)"
8324 echo "(I cannot locate a hosts database anywhere)"
8329 tans=`./loc resolv.conf X /etc /usr/etc`
8330 if $test -f "$tans"; then
8331 echo "(Attempting domain name extraction from $tans)"
8332 dflt=.`$sed -n -e 's/ / /g' \
8333 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8334 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8336 .) dflt=.`$sed -n -e 's/ / /g' \
8337 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8338 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8345 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8346 dflt=.`sh -c domainname 2>/dev/null`
8349 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8353 case "$dflt$osname" in
8354 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8355 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8359 .) echo "(Lost all hope -- silly guess then)"
8365 *) dflt="$mydomain";;
8369 rp="What is your domain name?"
8379 : translate upper to lower if necessary
8382 echo "(Normalizing case in your domain name)"
8383 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8387 : a little sanity check here
8388 case "$phostname" in
8391 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8392 $myhostname$mydomain|$myhostname) ;;
8394 case "$phostname" in
8396 echo "(That doesn't agree with your whoami.h file, by the way.)"
8399 echo "(That doesn't agree with your $phostname command, by the way.)"
8409 I need to get your e-mail address in Internet format if possible, i.e.
8410 something like user@host.domain. Please answer accurately since I have
8411 no easy means to double check it. The default value provided below
8412 is most probably close to reality but may not be valid from outside
8413 your organization...
8417 while test "$cont"; do
8419 '') dflt="$cf_by@$myhostname$mydomain";;
8420 *) dflt="$cf_email";;
8422 rp='What is your e-mail address?'
8428 rp='Address does not look like an Internet one. Use it anyway?'
8444 If you or somebody else will be maintaining perl at your site, please
8445 fill in the correct e-mail address here so that they may be contacted
8446 if necessary. Currently, the "perlbug" program included with perl
8447 will send mail to this address in addition to perlbug@perl.org. You may
8448 enter "none" for no administrator.
8451 case "$perladmin" in
8452 '') dflt="$cf_email";;
8453 *) dflt="$perladmin";;
8455 rp='Perl administrator e-mail address'
8459 : determine whether to only install version-specific parts.
8462 Do you want to install only the version-specific parts of the perl
8463 distribution? Usually you do *not* want to do this.
8465 case "$versiononly" in
8466 "$define"|[Yy]*|true) dflt='y' ;;
8469 rp="Do you want to install only the version-specific parts of perl?"
8472 [yY]*) val="$define";;
8478 case "$versiononly" in
8479 "$define") inc_version_list=''
8480 inc_version_list_init=0
8484 : figure out how to guarantee perl startup
8485 case "$startperl" in
8487 case "$sharpbang" in
8491 I can use the #! construct to start perl on your system. This will
8492 make startup of perl scripts faster, but may cause problems if you
8493 want to share those scripts and perl is not in a standard place
8494 ($binexp/perl) on all your platforms. The alternative is to force
8495 a shell by starting the script with a single ':' character.
8498 case "$versiononly" in
8499 "$define") dflt="$binexp/perl$version";;
8500 *) dflt="$binexp/perl";;
8502 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8505 none) startperl=": # use perl";;
8506 *) startperl="#!$ans"
8507 if $test 30 -lt `echo "$ans" | wc -c`; then
8510 WARNING: Some systems limit the #! command to 32 characters.
8511 If you experience difficulty running Perl scripts with #!, try
8512 installing Perl in a directory with a shorter pathname.
8518 *) startperl=": # use perl"
8523 echo "I'll use $startperl to start perl scripts."
8525 : figure best path for perl in scripts
8528 case "$versiononly" in
8529 "$define") perlpath="$binexp/perl$version";;
8530 *) perlpath="$binexp/perl";;
8532 case "$startperl" in
8537 I will use the "eval 'exec'" idiom to start Perl on your system.
8538 I can use the full path of your Perl binary for this purpose, but
8539 doing so may cause problems if you want to share those scripts and
8540 Perl is not always in a standard place ($binexp/perl).
8544 rp="What path shall I use in \"eval 'exec'\"?"
8551 case "$startperl" in
8553 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8556 : determine where public executable scripts go
8557 set scriptdir scriptdir
8559 case "$scriptdir" in
8562 : guess some guesses
8563 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8564 $test -d /usr/share/bin && dflt=/usr/share/bin
8565 $test -d /usr/local/script && dflt=/usr/local/script
8566 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8567 $test -d $prefixexp/script && dflt=$prefixexp/script
8571 *) dflt="$scriptdir"
8576 Some installations have a separate directory just for executable scripts so
8577 that they can mount it across multiple architectures but keep the scripts in
8578 one spot. You might, for example, have a subdirectory of /usr/share for this.
8579 Or you might just lump your scripts in with all your other executables.
8583 rp='Where do you keep publicly executable scripts?'
8585 if $test "X$ansexp" != "X$scriptdirexp"; then
8590 : A little fix up for an irregularly named variable.
8591 installscript="$installscriptdir"
8594 : determine where add-on public executables go
8596 '') dflt=$siteprefix/bin ;;
8600 rp='Pathname where the add-on public executables should be installed?'
8605 : determine where add-on html pages go
8606 : There is no standard location, so try to copy the previously-selected
8607 : directory structure for the core html pages.
8608 case "$sitehtml1dir" in
8609 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8610 *) dflt=$sitehtml1dir ;;
8613 ''|' ') dflt=none ;;
8616 rp='Pathname where the site-specific html pages should be installed?'
8618 prefixvar=sitehtml1dir
8621 : determine where add-on library html pages go
8622 : There is no standard location, so try to copy the previously-selected
8623 : directory structure for the core html pages.
8624 case "$sitehtml3dir" in
8625 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8626 *) dflt=$sitehtml3dir ;;
8629 ''|' ') dflt=none ;;
8632 rp='Pathname where the site-specific library html pages should be installed?'
8634 prefixvar=sitehtml3dir
8637 : determine where add-on manual pages go
8638 case "$siteman1dir" in
8639 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8640 *) dflt=$siteman1dir ;;
8643 ''|' ') dflt=none ;;
8646 rp='Pathname where the site-specific manual pages should be installed?'
8648 prefixvar=siteman1dir
8651 : determine where add-on library man pages go
8652 case "$siteman3dir" in
8653 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8654 *) dflt=$siteman3dir ;;
8657 ''|' ') dflt=none ;;
8660 rp='Pathname where the site-specific library manual pages should be installed?'
8662 prefixvar=siteman3dir
8665 : determine where add-on public executable scripts go
8666 case "$sitescript" in
8667 '') dflt=$siteprefix/script
8668 $test -d $dflt || dflt=$sitebin ;;
8669 *) dflt="$sitescript" ;;
8672 rp='Pathname where add-on public executable scripts should be installed?'
8674 prefixvar=sitescript
8677 case "$usefaststdio" in
8678 $define|true|[yY]*|'')
8679 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8689 Perl can be built to use 'fast stdio', which means using the stdio
8690 library but also directly manipulating the stdio buffers to enable
8691 faster I/O. Using stdio is better for backward compatibility (especially
8692 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8693 interface has been preferred instead of stdio.
8695 If this doesn't make any sense to you, just accept the default '$dflt'.
8697 rp='Use the "fast stdio" if available?'
8700 y|Y) val="$define" ;;
8707 : define an is-a-typedef? function
8708 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8710 "") inclist="sys/types.h";;
8712 eval "varval=\$$var";
8716 for inc in $inclist; do
8717 echo "#include <$inc>" >>temp.c;
8719 echo "#ifdef $type" >> temp.c;
8720 echo "printf(\"We have $type\");" >> temp.c;
8721 echo "#endif" >> temp.c;
8722 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8723 if $contains $type temp.E >/dev/null 2>&1; then
8729 *) eval "$var=\$varval";;
8732 : define an is-a-typedef? function that prompts if the type is not available.
8733 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8735 "") inclist="sys/types.h";;
8737 eval "varval=\$$var";
8741 for inc in $inclist; do
8742 echo "#include <$inc>" >>temp.c;
8744 echo "#ifdef $type" >> temp.c;
8745 echo "printf(\"We have $type\");" >> temp.c;
8746 echo "#endif" >> temp.c;
8747 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8749 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8750 if $contains $type temp.E >/dev/null 2>&1; then
8751 echo "$type found." >&4;
8754 echo "$type NOT found." >&4;
8760 *) eval "$var=\$varval";;
8763 : see what type lseek is declared as in the kernel
8764 rp="What is the type used for lseek's offset on this system?"
8765 set off_t lseektype long stdio.h sys/types.h
8769 echo "Checking to see how big your file offsets are..." >&4
8771 #include <sys/types.h>
8775 printf("%d\n", (int)sizeof($lseektype));
8780 if eval $compile_ok; then
8781 lseeksize=`$run ./try`
8782 echo "Your file offsets are $lseeksize bytes long."
8786 echo "(I can't seem to compile the test program. Guessing...)"
8787 rp="What is the size of your file offsets (in bytes)?"
8793 : see what type file positions are declared as in the library
8794 rp="What is the type for file position used by fsetpos()?"
8795 set fpos_t fpostype long stdio.h sys/types.h
8800 *_t) zzz="$fpostype" ;;
8803 echo "Checking the size of $zzz..." >&4
8805 #include <sys/types.h>
8812 printf("%d\n", (int)sizeof($fpostype));
8817 if eval $compile_ok; then
8821 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8824 echo "Your $zzz is $fpossize bytes long."
8830 echo "(I can't compile the test program. Guessing...)" >&4
8831 rp="What is the size of your file positions (in bytes)?"
8836 # Backward compatibility (uselfs is deprecated).
8838 "$define"|true|[yY]*)
8841 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8843 uselargefiles="$define"
8847 case "$lseeksize:$fpossize" in
8850 You can have files larger than 2 gigabytes.
8853 *) case "$uselargefiles" in
8854 "$undef"|false|[nN]*) dflt='n' ;;
8859 Perl can be built to understand large files (files larger than 2 gigabytes)
8860 on some systems. To do so, Configure can be run with -Duselargefiles.
8862 If this doesn't make any sense to you, just accept the default '$dflt'.
8864 rp='Try to understand large files, if available?'
8867 y|Y) val="$define" ;;
8874 : Look for a hint-file generated 'call-back-unit'. If the
8875 : user has specified that a large files perl is to be built,
8876 : we may need to set or change some other defaults.
8877 if $test -f uselargefiles.cbu; then
8878 echo "Your platform has some specific hints regarding large file builds, using them..."
8879 . ./uselargefiles.cbu
8881 case "$uselargefiles" in
8883 if $test -f uselargefiles.cbu; then
8885 echo "Rechecking to see how big your file offsets are..." >&4
8887 #include <sys/types.h>
8891 printf("%d\n", (int)sizeof($lseektype));
8896 if eval $compile_ok; then
8897 lseeksize=`$run ./try`
8898 $echo "Your file offsets are now $lseeksize bytes long."
8902 echo "(I can't seem to compile the test program. Guessing...)"
8903 rp="What is the size of your file offsets (in bytes)?"
8908 *_t) zzz="$fpostype" ;;
8911 $echo $n "Rechecking the size of $zzz...$c" >&4
8913 #include <sys/types.h>
8920 printf("%d\n", (int)sizeof($fpostype));
8925 if eval $compile_ok; then
8930 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8933 echo " $fpossize bytes." >&4
8939 echo "(I can't compile the test program. Guessing...)" >&4
8940 rp="What is the size of your file positions (in bytes)?"
8949 # probably will refer to
8950 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
8952 userelocatableinc=undef
8954 case "$vendorprefix" in
8955 '') d_vendorbin="$undef"
8959 *) d_vendorbin="$define"
8960 : determine where vendor-supplied executables go.
8961 case "$vendorbin" in
8962 '') dflt=$vendorprefix/bin ;;
8963 *) dflt="$vendorbin" ;;
8966 rp='Pathname for the vendor-supplied executables directory?'
8969 vendorbinexp="$ansexp"
8972 : Change installation prefix, if necessary.
8973 if $test X"$prefix" != X"$installprefix"; then
8974 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefixexp#$installprefixexp#"`
8976 installvendorbin="$vendorbinexp"
8979 case "$vendorprefix" in
8980 '') vendorhtml1dir=''
8981 vendorhtml1direxp=''
8983 *) : determine where vendor-supplied html pages go.
8984 : There is no standard location, so try to copy the previously-selected
8985 : directory structure for the core html pages.
8986 : XXX Better default suggestions would be welcome.
8987 case "$vendorhtml1dir" in
8988 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
8989 *) dflt=$vendorhtml1dir ;;
8992 ''|' ') dflt=none ;;
8995 rp='Pathname for the vendor-supplied html pages?'
8997 vendorhtml1dir="$ans"
8998 vendorhtml1direxp="$ansexp"
9001 : Use ' ' for none so value is preserved next time through Configure
9002 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9003 : Change installation prefix, if necessary.
9004 if $test X"$prefix" != X"$installprefix"; then
9005 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefixexp#$installprefixexp#"`
9007 installvendorhtml1dir="$vendorhtml1direxp"
9010 case "$vendorprefix" in
9011 '') vendorhtml3dir=''
9012 vendorhtml3direxp=''
9014 *) : determine where vendor-supplied module html pages go.
9015 : There is no standard location, so try to copy the previously-selected
9016 : directory structure for the core html pages.
9017 : XXX Better default suggestions would be welcome.
9018 case "$vendorhtml3dir" in
9019 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9020 *) dflt=$vendorhtml3dir ;;
9023 ''|' ') dflt=none ;;
9026 rp='Pathname for the vendor-supplied html pages?'
9028 vendorhtml3dir="$ans"
9029 vendorhtml3direxp="$ansexp"
9032 : Use ' ' for none so value is preserved next time through Configure
9033 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9034 : Change installation prefix, if necessary.
9035 if $test X"$prefix" != X"$installprefix"; then
9036 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefixexp#$installprefixexp#"`
9038 installvendorhtml3dir="$vendorhtml3direxp"
9041 case "$vendorprefix" in
9042 '') vendorman1dir=''
9045 *) : determine where vendor-supplied manual pages go.
9046 case "$vendorman1dir" in
9047 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9048 *) dflt=$vendorman1dir ;;
9051 ''|' ') dflt=none ;;
9054 rp='Pathname for the vendor-supplied manual section 1 pages?'
9056 vendorman1dir="$ans"
9057 vendorman1direxp="$ansexp"
9060 : Use ' ' for none so value is preserved next time through Configure
9061 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9062 : Change installation prefix, if necessary.
9063 if $test X"$prefix" != X"$installprefix"; then
9064 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefixexp#$installprefixexp#"`
9066 installvendorman1dir="$vendorman1direxp"
9069 case "$vendorprefix" in
9070 '') vendorman3dir=''
9073 *) : determine where vendor-supplied module manual pages go.
9074 case "$vendorman3dir" in
9075 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9076 *) dflt=$vendorman3dir ;;
9079 ''|' ') dflt=none ;;
9082 rp='Pathname for the vendor-supplied manual section 3 pages?'
9084 vendorman3dir="$ans"
9085 vendorman3direxp="$ansexp"
9088 : Use ' ' for none so value is preserved next time through Configure
9089 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9090 : Change installation prefix, if necessary.
9091 if $test X"$prefix" != X"$installprefix"; then
9092 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefixexp#$installprefixexp#"`
9094 installvendorman3dir="$vendorman3direxp"
9097 case "$vendorprefix" in
9098 '') d_vendorscript="$undef"
9102 *) d_vendorscript="$define"
9103 : determine where vendor-supplied scripts go.
9104 case "$vendorscript" in
9105 '') dflt=$vendorprefix/script
9106 $test -d $dflt || dflt=$vendorbin ;;
9107 *) dflt="$vendorscript" ;;
9111 The installation process will create a directory for
9112 vendor-supplied scripts.
9116 rp='Pathname for the vendor-supplied scripts directory?'
9119 vendorscriptexp="$ansexp"
9122 : Change installation prefix, if necessary.
9123 if $test X"$prefix" != X"$installprefix"; then
9124 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefixexp#$installprefixexp#"`
9126 installvendorscript="$vendorscriptexp"
9129 : see if qgcvt exists
9135 if $test X"$d_longdbl" = X"$define"; then
9137 echo "Checking how to print long doubles..." >&4
9139 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9140 $cat >try.c <<'EOCP'
9141 #include <sys/types.h>
9145 printf("%.3f\n", d);
9149 if eval $compile; then
9153 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9154 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9155 echo "We will use %f."
9161 if $test X"$sPRIfldbl" = X; then
9162 $cat >try.c <<'EOCP'
9163 #include <sys/types.h>
9166 long double d = 123.456;
9167 printf("%.3Lf\n", d);
9171 if eval $compile; then
9175 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9176 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9177 echo "We will use %Lf."
9183 if $test X"$sPRIfldbl" = X; then
9184 $cat >try.c <<'EOCP'
9185 #include <sys/types.h>
9188 long double d = 123.456;
9189 printf("%.3llf\n", d);
9193 if eval $compile; then
9197 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9198 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9199 echo "We will use %llf."
9205 if $test X"$sPRIfldbl" = X; then
9206 $cat >try.c <<'EOCP'
9207 #include <sys/types.h>
9210 long double d = 123.456;
9211 printf("%.3lf\n", d);
9215 if eval $compile; then
9219 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9220 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9221 echo "We will use %lf."
9227 if $test X"$sPRIfldbl" = X; then
9228 echo "Cannot figure out how to print long doubles." >&4
9230 sSCNfldbl=$sPRIfldbl # expect consistency
9237 case "$sPRIfldbl" in
9238 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9239 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9240 d_SCNfldbl="$undef";
9242 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9243 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9244 d_SCNfldbl="$define";
9248 : Check how to convert floats to strings.
9250 if test "X$d_Gconvert" = X; then
9253 echo "Checking for an efficient way to convert floats to strings."
9255 case "$uselongdouble" in
9256 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9258 case "$d_longdbl" in
9259 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9261 case "$d_PRIgldbl" in
9262 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9266 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9267 char *myname = "gconvert";
9270 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9271 char *myname = "gcvt";
9274 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9275 char *myname = "qgcvt";
9276 #define DOUBLETYPE long double
9279 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9281 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9283 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9286 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9288 char *myname = "sprintf";
9292 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9293 #define DOUBLETYPE long double
9295 #define DOUBLETYPE double
9301 #define I_STDLIB $i_stdlib
9307 checkit(expect, got)
9311 if (strcmp(expect, got)) {
9312 printf("%s oddity: Expected %s, got %s\n",
9313 myname, expect, got);
9323 /* This must be 1st test on (which?) platform */
9324 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9325 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9326 checkit("0.1", buf);
9328 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9329 checkit("0.01", buf);
9331 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9332 checkit("0.001", buf);
9334 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9335 checkit("0.0001", buf);
9337 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9338 if (strlen(buf) > 5)
9339 checkit("9e-005", buf); /* for Microsoft ?? */
9341 checkit("9e-05", buf);
9343 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9346 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9347 checkit("1.1", buf);
9349 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9350 checkit("1.01", buf);
9352 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9353 checkit("1.001", buf);
9355 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9356 checkit("1.0001", buf);
9358 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9359 checkit("1.00001", buf);
9361 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9362 checkit("1.000001", buf);
9364 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9367 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9370 /* Some Linux gcvt's give 1.e+5 here. */
9371 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9372 checkit("100000", buf);
9374 /* Some Linux gcvt's give -1.e+5 here. */
9375 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9376 checkit("-100000", buf);
9378 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9379 checkit("123.456", buf);
9381 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9382 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9383 /* 34 should be enough to scare even long double
9384 * places into using the e notation. */
9385 if (strlen(buf) > 5)
9386 checkit("1e+034", buf); /* for Microsoft */
9388 checkit("1e+34", buf);
9390 /* For Perl, if you add additional tests here, also add them to
9391 * t/base/num.t for benefit of platforms not using Configure or
9392 * overriding d_Gconvert */
9397 : first add preferred functions to our list
9399 for xxx_convert in $gconvert_preference; do
9400 case $xxx_convert in
9401 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9402 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9405 : then add any others
9406 for xxx_convert in gconvert gcvt sprintf; do
9409 *) xxx_list="$xxx_list $xxx_convert" ;;
9413 case "$d_longdbl$uselongdouble" in
9415 : again, add prefered functions to our list first
9417 for xxx_convert in $gconvert_ld_preference; do
9418 case $xxx_convert in
9419 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9420 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9423 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9424 for xxx_convert in qgcvt sprintf $xxx_list; do
9425 case "$xxx_ld_list" in
9426 $xxx_convert*|*" $xxx_convert"*) ;;
9427 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9430 : if sprintf cannot do long doubles, move it to the end
9431 if test "$d_PRIgldbl" != "$define"; then
9432 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9434 : if no qgcvt, remove it
9435 if test "$d_qgcvt" != "$define"; then
9436 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9439 xxx_list="$xxx_ld_list"
9443 for xxx_convert in $xxx_list; do
9444 echo "Trying $xxx_convert..."
9446 set try -DTRY_$xxx_convert
9447 if eval $compile; then
9448 echo "$xxx_convert() found." >&4
9450 echo "I'll use $xxx_convert to convert floats into a string." >&4
9453 echo "...But $xxx_convert didn't work as I expected."
9457 echo "$xxx_convert NOT found." >&4
9461 if test X$xxx_convert = X; then
9462 echo "*** WHOA THERE!!! ***" >&4
9463 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9467 case "$xxx_convert" in
9468 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9469 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9470 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9471 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9472 "$define$define$define")
9473 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9474 "$define$define$undef")
9475 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9476 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9483 : see if _fwalk exists
9487 : Initialize h_fcntl
9490 : Initialize h_sysfile
9493 : access call always available on UNIX
9497 : locate the flags for 'access()'
9501 $cat >access.c <<EOCP
9502 #include <sys/types.h>
9507 #include <sys/file.h>
9520 : check sys/file.h first, no particular reason here
9521 if $test `./findhdr sys/file.h` && \
9522 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9524 echo "<sys/file.h> defines the *_OK access constants." >&4
9525 elif $test `./findhdr fcntl.h` && \
9526 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9528 echo "<fcntl.h> defines the *_OK access constants." >&4
9529 elif $test `./findhdr unistd.h` && \
9530 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9531 echo "<unistd.h> defines the *_OK access constants." >&4
9533 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9539 : see if accessx exists
9540 set accessx d_accessx
9543 : see if aintl exists
9547 : see if alarm exists
9551 : see if POSIX threads are available
9552 set pthread.h i_pthread
9555 : define a fucntion to check prototypes
9556 $cat > protochk <<EOSH
9559 optimize="$optimize"
9561 prototype="$prototype"
9564 usethreads=$usethreads
9565 i_pthread=$i_pthread
9566 pthread_h_first=$pthread_h_first
9569 $cat >> protochk <<'EOSH'
9574 while test $# -ge 2; do
9576 $define) echo "#include <$2>" >> try.c ;;
9577 literal) echo "$2" >> try.c ;;
9579 # Extra magic for the benefit of systems that need pthread.h
9580 # to be included early to correctly detect threadsafe functions.
9581 # Such functions must guarantee themselves, though, that the usethreads
9582 # and i_pthread have been defined, before calling protochk.
9583 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9584 echo "#include <pthread.h>" >> try.c
9589 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9590 cat >> try.c <<'EOCP'
9591 #ifdef CAN_PROTOTYPE
9592 #define _(args) args
9597 echo "$foo" >> try.c
9598 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9599 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9607 hasproto='varname=$1; func=$2; shift; shift;
9608 while $test $# -ge 2; do
9610 $define) echo "#include <$2>";;
9614 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9615 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9616 echo "$func() prototype found.";
9619 echo "$func() prototype NOT found.";
9624 $rm -f try.c tryout.c'
9626 : see if sys/types.h has to be included
9627 set sys/types.h i_systypes
9630 : see if sys/select.h has to be included
9631 set sys/select.h i_sysselct
9634 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9635 while $test $# -ge 2; do
9637 $define) echo "#include <$2>";;
9641 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9643 if eval $compile; then
9652 : see if we should include time.h, sys/time.h, or both
9654 if test "X$timeincl" = X; then
9655 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9656 $echo $n "I'm now running the test program...$c"
9658 #include <sys/types.h>
9663 #ifdef SYSTIMEKERNEL
9666 #include <sys/time.h>
9669 #include <sys/select.h>
9682 struct timezone tzp;
9684 if (foo.tm_sec == foo.tm_sec)
9687 if (bar.tv_sec == bar.tv_sec)
9694 for s_timezone in '-DS_TIMEZONE' ''; do
9696 for s_timeval in '-DS_TIMEVAL' ''; do
9697 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9698 for i_time in '' '-DI_TIME'; do
9699 for i_systime in '-DI_SYSTIME' ''; do
9702 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9703 if eval $compile; then
9704 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9708 $echo $n "Succeeded with $flags$c"
9720 *SYSTIMEKERNEL*) i_systimek="$define"
9721 timeincl=`./findhdr sys/time.h`
9722 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9723 *) i_systimek="$undef";;
9726 *I_TIME*) i_time="$define"
9727 timeincl=`./findhdr time.h`" $timeincl"
9728 echo "We'll include <time.h>." >&4;;
9729 *) i_time="$undef";;
9732 *I_SYSTIME*) i_systime="$define"
9733 timeincl=`./findhdr sys/time.h`" $timeincl"
9734 echo "We'll include <sys/time.h>." >&4;;
9735 *) i_systime="$undef";;
9739 : see if struct tm knows about tm_zone
9740 case "$i_systime$i_time" in
9743 echo "Checking to see if your struct tm has tm_zone field..." >&4
9744 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9752 case "$d_tm_tm_zone" in
9753 "$define") echo "Yes, it does." ;;
9754 *) echo "No, it doesn't." ;;
9756 : see if struct tm knows about tm_gmtoff
9757 case "$i_systime$i_time" in
9760 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9761 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9769 case "$d_tm_tm_gmtoff" in
9770 "$define") echo "Yes, it does." ;;
9771 *) echo "No, it doesn't." ;;
9774 : see if asctime_r exists
9775 set asctime_r d_asctime_r
9777 case "$d_asctime_r" in
9779 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9780 case "$d_asctime_r_proto:$usethreads" in
9781 ":define") d_asctime_r_proto=define
9782 set d_asctime_r_proto asctime_r $hdrs
9786 case "$d_asctime_r_proto" in
9788 case "$asctime_r_proto" in
9789 ''|0) try='char* asctime_r(const struct tm*, char*);'
9790 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9792 case "$asctime_r_proto" in
9793 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9794 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9796 case "$asctime_r_proto" in
9797 ''|0) try='int asctime_r(const struct tm*, char*);'
9798 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9800 case "$asctime_r_proto" in
9801 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9802 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9804 case "$asctime_r_proto" in
9805 ''|0) d_asctime_r=undef
9807 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9808 * ) case "$asctime_r_proto" in
9809 REENTRANT_PROTO*) ;;
9810 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9812 echo "Prototype: $try" ;;
9815 *) case "$usethreads" in
9816 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9823 *) asctime_r_proto=0
9827 : see if atolf exists
9831 : see if atoll exists
9835 : Look for GCC-style attribute format
9836 case "$d_attribute_format" in
9839 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9840 $cat >attrib.c <<'EOCP'
9842 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9844 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9845 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9846 echo "Your C compiler doesn't support __attribute__((format))."
9849 echo "Your C compiler supports __attribute__((format))."
9853 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9857 *) val="$d_attribute_format" ;;
9859 set d_attribute_format
9863 : Look for GCC-style attribute malloc
9864 case "$d_attribute_malloc" in
9867 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9868 $cat >attrib.c <<'EOCP'
9870 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9872 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9873 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9874 echo "Your C compiler doesn't support __attribute__((malloc))."
9877 echo "Your C compiler supports __attribute__((malloc))."
9881 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9885 *) val="$d_attribute_malloc" ;;
9887 set d_attribute_malloc
9891 : Look for GCC-style attribute nonnull
9892 case "$d_attribute_nonnull" in
9895 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9896 $cat >attrib.c <<'EOCP'
9898 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9900 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9901 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9902 echo "Your C compiler doesn't support __attribute__((nonnull))."
9905 echo "Your C compiler supports __attribute__((nonnull))."
9909 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9913 *) val="$d_attribute_nonnull" ;;
9915 set d_attribute_nonnull
9919 : Look for GCC-style attribute noreturn
9920 case "$d_attribute_noreturn" in
9923 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
9924 $cat >attrib.c <<'EOCP'
9926 void fall_over_dead( void ) __attribute__((noreturn));
9928 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9929 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9930 echo "Your C compiler doesn't support __attribute__((noreturn))."
9933 echo "Your C compiler supports __attribute__((noreturn))."
9937 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9941 *) val="$d_attribute_noreturn" ;;
9943 set d_attribute_noreturn
9947 : Look for GCC-style attribute pure
9948 case "$d_attribute_pure" in
9951 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
9952 $cat >attrib.c <<'EOCP'
9954 int square( int n ) __attribute__((pure));
9956 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9957 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9958 echo "Your C compiler doesn't support __attribute__((pure))."
9961 echo "Your C compiler supports __attribute__((pure))."
9965 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9969 *) val="$d_attribute_pure" ;;
9971 set d_attribute_pure
9975 : Look for GCC-style attribute unused
9976 case "$d_attribute_unused" in
9979 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
9980 $cat >attrib.c <<'EOCP'
9982 int do_something( int dummy __attribute__((unused)), int n );
9984 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9985 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9986 echo "Your C compiler doesn't support __attribute__((unused))."
9989 echo "Your C compiler supports __attribute__((unused))."
9993 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9997 *) val="$d_attribute_unused" ;;
9999 set d_attribute_unused
10003 : Look for GCC-style attribute warn_unused_result
10004 case "$d_attribute_warn_unused_result" in
10007 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10008 $cat >attrib.c <<'EOCP'
10010 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10012 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10013 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10014 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10017 echo "Your C compiler supports __attribute__((warn_unused_result))."
10021 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10025 *) val="$d_attribute_warn_unused_result" ;;
10027 set d_attribute_warn_unused_result
10031 : see if bcmp exists
10035 : see if bcopy exists
10039 : see if this is a unistd.h system
10040 set unistd.h i_unistd
10043 : see if getpgrp exists
10044 set getpgrp d_getpgrp
10047 case "$d_getpgrp" in
10050 echo "Checking to see which flavor of getpgrp is in use..."
10052 #$i_unistd I_UNISTD
10053 #include <sys/types.h>
10055 # include <unistd.h>
10057 #$i_stdlib I_STDLIB
10059 #include <stdlib.h>
10063 if (getuid() == 0) {
10064 printf("(I see you are running Configure as super-user...)\n");
10067 #ifdef TRY_BSD_PGRP
10068 if (getpgrp(1) == 0)
10077 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10078 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10080 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10081 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10084 echo "I can't seem to compile and run the test program."
10086 xxx="a USG one, i.e. you use getpgrp()."
10088 # SVR4 systems can appear rather BSD-ish.
10089 case "$i_unistd" in
10091 xxx="a BSD one, i.e. you use getpgrp(pid)."
10095 xxx="probably a USG one, i.e. you use getpgrp()."
10100 echo "Assuming your getpgrp is $xxx" >&4
10109 : see if setpgrp exists
10110 set setpgrp d_setpgrp
10113 case "$d_setpgrp" in
10116 echo "Checking to see which flavor of setpgrp is in use..."
10118 #$i_unistd I_UNISTD
10119 #include <sys/types.h>
10121 # include <unistd.h>
10123 #$i_stdlib I_STDLIB
10125 #include <stdlib.h>
10129 if (getuid() == 0) {
10130 printf("(I see you are running Configure as super-user...)\n");
10133 #ifdef TRY_BSD_PGRP
10134 if (-1 == setpgrp(1, 1))
10137 if (setpgrp() != -1)
10143 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10144 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10146 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10147 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10150 echo "(I can't seem to compile and run the test program.)"
10152 xxx="a USG one, i.e. you use setpgrp()."
10154 # SVR4 systems can appear rather BSD-ish.
10155 case "$i_unistd" in
10157 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10161 xxx="probably a USG one, i.e. you use setpgrp()."
10166 echo "Assuming your setpgrp is $xxx" >&4
10174 : Look for GCC-style __builtin_choose_expr
10175 case "$d_builtin_choose_expr" in
10178 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10179 $cat >try.c <<'EOCP'
10180 #include <assert.h>
10181 #include <stdlib.h>
10184 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10187 assert( SYRINX(1) == 2112 );
10188 assert( SYRINX(1) != 5150 );
10189 assert( SYRINX(0) == 5150 );
10190 assert( SYRINX(0) != 2112 );
10191 puts( "All good!" );
10197 if eval $compile; then
10198 echo "Your C compiler supports __builtin_choose_expr."
10201 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10205 *) val="$d_builtin_choose_expr" ;;
10208 set d_builtin_choose_expr
10210 $rm -f try.* try core core.try.*
10212 : Look for GCC-style __builtin_expect
10213 case "$d_builtin_expect" in
10216 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10217 $cat >builtin.c <<'EOCP'
10220 if ( __builtin_expect(n, 0) ) n = 1;
10224 if eval $compile; then
10225 echo "Your C compiler supports __builtin_choose_expr."
10228 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10232 *) val="$d_builtin_expect" ;;
10235 set d_builtin_expect
10237 $rm -f try.* try core core.try.*
10239 : see if bzero exists
10243 : see if signal is declared as pointer to function returning int or void
10245 xxx=`./findhdr signal.h`
10246 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10247 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10248 echo "You have int (*signal())() instead of void." >&4
10250 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10251 echo "You have void (*signal())()." >&4
10253 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10254 echo "You have int (*signal())() instead of void." >&4
10256 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10257 echo "You have void (*signal())()." >&4
10260 case "$d_voidsig" in
10262 echo "I can't determine whether signal handler returns void or int..." >&4
10264 rp="What type does your signal handler return?"
10267 v*) val="$define";;
10271 echo "As you already told me, signal handler returns void." >&4
10274 *) echo "As you already told me, signal handler returns int." >&4
10281 case "$d_voidsig" in
10282 "$define") signal_t="void";;
10283 *) signal_t="int";;
10287 : check for ability to cast large floats to 32-bit ints.
10289 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10290 if $test "$intsize" -ge 4; then
10297 #$i_stdlib I_STDLIB
10299 #include <stdlib.h>
10301 #include <sys/types.h>
10302 #include <signal.h>
10303 $signal_t blech(s) int s; { exit(3); }
10310 signal(SIGFPE, blech);
10312 /* Don't let compiler optimize the test away. Store the number
10313 in a writable string for gcc to pass to sscanf under HP/UX.
10315 sprintf(str, "2147483647");
10316 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10320 /* x86 processors will probably give 0x8000 0000, which is a
10321 sign change. We don't want that. We want to mimic SPARC
10322 behavior here, which is to preserve the sign and give
10325 if (i32 != ($xxx) f)
10331 if eval $compile_ok; then
10335 echo "(I can't seem to compile the test program--assuming it can't)"
10340 echo "Yup, it can."
10343 echo "Nope, it can't."
10350 : check for ability to cast negative floats to unsigned
10352 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10355 #$i_stdlib I_STDLIB
10357 #include <stdlib.h>
10359 #include <sys/types.h>
10360 #include <signal.h>
10361 $signal_t blech(s) int s; { exit(7); }
10362 $signal_t blech_in_list(s) int s; { exit(4); }
10363 unsigned long dummy_long(p) unsigned long p; { return p; }
10364 unsigned int dummy_int(p) unsigned int p; { return p; }
10365 unsigned short dummy_short(p) unsigned short p; { return p; }
10369 unsigned long along;
10371 unsigned short ashort;
10375 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10376 a direct f = -123. assignment. gcc-2.8.0 reportedly
10377 optimized the whole file away
10379 /* Store the number in a writable string for gcc to pass to
10380 sscanf under HP/UX.
10382 sprintf(str, "-123");
10383 sscanf(str, "%lf", &f); /* f = -123.; */
10385 signal(SIGFPE, blech);
10386 along = (unsigned long)f;
10387 aint = (unsigned int)f;
10388 ashort = (unsigned short)f;
10389 if (along != (unsigned long)-123)
10391 if (aint != (unsigned int)-123)
10393 if (ashort != (unsigned short)-123)
10395 sprintf(str, "1073741824.");
10396 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10399 along = (unsigned long)f;
10400 if (along != 0x80000000)
10404 along = (unsigned long)f;
10405 if (along != 0x7fffffff)
10409 along = (unsigned long)f;
10410 if (along != 0x80000001)
10414 signal(SIGFPE, blech_in_list);
10415 sprintf(str, "123.");
10416 sscanf(str, "%lf", &f); /* f = 123.; */
10417 along = dummy_long((unsigned long)f);
10418 aint = dummy_int((unsigned int)f);
10419 ashort = dummy_short((unsigned short)f);
10420 if (along != (unsigned long)123)
10422 if (aint != (unsigned int)123)
10424 if (ashort != (unsigned short)123)
10431 if eval $compile_ok; then
10435 echo "(I can't seem to compile the test program--assuming it can't)"
10438 case "$castflags" in
10440 echo "Yup, it can."
10443 echo "Nope, it can't."
10450 : see if vprintf exists
10452 if set vprintf val -f d_vprintf; eval $csym; $val; then
10453 echo 'vprintf() found.' >&4
10456 #include <varargs.h>
10457 #$i_stdlib I_STDLIB
10459 #include <stdlib.h>
10462 int main() { xxx("foo"); }
10471 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10475 if eval $compile && $run ./try; then
10476 echo "Your vsprintf() returns (int)." >&4
10479 echo "Your vsprintf() returns (char*)." >&4
10483 echo 'vprintf() NOT found.' >&4
10494 : see if chown exists
10498 : see if chroot exists
10499 set chroot d_chroot
10502 : see if chsize exists
10503 set chsize d_chsize
10506 : see if class exists
10510 : see if clearenv exists
10511 set clearenv d_clearenv
10514 hasstruct='varname=$1; struct=$2; shift; shift;
10515 while $test $# -ge 2; do
10517 $define) echo "#include <$2>";;
10521 echo "int main () { struct $struct foo; }" >> try.c;
10523 if eval $compile; then
10530 $rm -f try.c try.o'
10534 : see whether socket exists
10536 $echo $n "Hmm... $c" >&4
10537 if set socket val -f d_socket; eval $csym; $val; then
10538 echo "Looks like you have Berkeley networking support." >&4
10540 if set setsockopt val -f; eval $csym; $val; then
10543 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10544 d_oldsock="$define"
10547 if $contains socklib libc.list >/dev/null 2>&1; then
10548 echo "Looks like you have Berkeley networking support." >&4
10550 : we will have to assume that it supports the 4.2 BSD interface
10553 echo "You don't have Berkeley networking in libc$_a..." >&4
10554 if test "X$d_socket" = "X$define"; then
10555 echo "...but you seem to believe that you have sockets." >&4
10557 for net in net socket
10559 if test -f /usr/lib/lib$net$_a; then
10560 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10561 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10562 if $contains socket libc.list >/dev/null 2>&1; then
10567 echo "...but the Wollongong group seems to have hacked it in." >&4
10568 sockethdr="-I/usr/netinclude"
10571 echo "Found Berkeley sockets interface in lib$net." >&4
10572 if $contains setsockopt libc.list >/dev/null 2>&1; then
10575 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10576 d_oldsock="$define"
10582 if test "X$d_socket" != "X$define"; then
10583 echo "or anywhere else I see." >&4
10591 : see if socketpair exists
10592 set socketpair d_sockpair
10597 echo "Checking the availability of certain socket constants..." >&4
10598 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10599 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10601 #include <sys/types.h>
10602 #include <sys/socket.h>
10608 set try; if eval $compile; then
10611 set d_${enum}; eval $setvar
10615 : see if this is a sys/uio.h system
10616 set sys/uio.h i_sysuio
10621 echo "Checking to see if your system supports struct cmsghdr..." >&4
10622 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10624 case "$d_cmsghdr_s" in
10625 "$define") echo "Yes, it does." ;;
10626 *) echo "No, it doesn't." ;;
10630 : check for const keyword
10632 echo 'Checking to see if your C compiler knows about "const"...' >&4
10633 $cat >const.c <<'EOCP'
10634 typedef struct spug { int drokk; } spug;
10641 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10643 echo "Yup, it does."
10646 echo "Nope, it doesn't."
10651 : see if copysignl exists
10652 set copysignl d_copysignl
10655 : see if crypt exists
10660 $define) cryptlib='' ;;
10661 *) if set crypt val -f d_crypt; eval $csym; $val; then
10662 echo 'crypt() found.' >&4
10666 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10667 if $test -z "$cryptlib"; then
10668 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10672 if $test -z "$cryptlib"; then
10673 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10677 if $test -z "$cryptlib"; then
10678 cryptlib=`./loc libcrypt$_a "" $libpth`
10682 if $test -z "$cryptlib"; then
10683 echo 'crypt() NOT found.' >&4
10694 : see if this is a crypt.h system
10695 set crypt.h i_crypt
10698 : see if crypt_r exists
10699 set crypt_r d_crypt_r
10701 case "$d_crypt_r" in
10703 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10704 case "$d_crypt_r_proto:$usethreads" in
10705 ":define") d_crypt_r_proto=define
10706 set d_crypt_r_proto crypt_r $hdrs
10710 case "$d_crypt_r_proto" in
10712 case "$crypt_r_proto" in
10713 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10714 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10716 case "$crypt_r_proto" in
10717 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10718 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10720 case "$crypt_r_proto" in
10721 ''|0) d_crypt_r=undef
10723 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10724 * ) case "$crypt_r_proto" in
10725 REENTRANT_PROTO*) ;;
10726 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10728 echo "Prototype: $try" ;;
10731 *) case "$usethreads" in
10732 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10743 : get csh whereabouts
10745 'csh') val="$undef" ;;
10746 *) val="$define" ;;
10750 : Respect a hint or command line value for full_csh.
10751 case "$full_csh" in
10752 '') full_csh=$csh ;;
10755 : see if ctermid_r exists
10756 set ctermid_r d_ctermid_r
10758 case "$d_ctermid_r" in
10760 hdrs="$i_systypes sys/types.h define stdio.h "
10761 case "$d_ctermid_r_proto:$usethreads" in
10762 ":define") d_ctermid_r_proto=define
10763 set d_ctermid_r_proto ctermid_r $hdrs
10767 case "$d_ctermid_r_proto" in
10769 case "$ctermid_r_proto" in
10770 ''|0) try='char* ctermid_r(char*);'
10771 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10773 case "$ctermid_r_proto" in
10774 ''|0) d_ctermid_r=undef
10776 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10777 * ) case "$ctermid_r_proto" in
10778 REENTRANT_PROTO*) ;;
10779 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10781 echo "Prototype: $try" ;;
10784 *) case "$usethreads" in
10785 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10792 *) ctermid_r_proto=0
10796 : see if ctime_r exists
10797 set ctime_r d_ctime_r
10799 case "$d_ctime_r" in
10801 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10802 case "$d_ctime_r_proto:$usethreads" in
10803 ":define") d_ctime_r_proto=define
10804 set d_ctime_r_proto ctime_r $hdrs
10808 case "$d_ctime_r_proto" in
10810 case "$ctime_r_proto" in
10811 ''|0) try='char* ctime_r(const time_t*, char*);'
10812 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10814 case "$ctime_r_proto" in
10815 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10816 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10818 case "$ctime_r_proto" in
10819 ''|0) try='int ctime_r(const time_t*, char*);'
10820 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10822 case "$ctime_r_proto" in
10823 ''|0) try='int ctime_r(const time_t*, char*, int);'
10824 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10826 case "$ctime_r_proto" in
10827 ''|0) d_ctime_r=undef
10829 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10830 * ) case "$ctime_r_proto" in
10831 REENTRANT_PROTO*) ;;
10832 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10834 echo "Prototype: $try" ;;
10837 *) case "$usethreads" in
10838 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10849 : see if cuserid exists
10850 set cuserid d_cuserid
10853 : see if this is a limits.h system
10854 set limits.h i_limits
10857 : see if this is a float.h system
10858 set float.h i_float
10861 : See if number of significant digits in a double precision number is known
10863 $cat >dbl_dig.c <<EOM
10864 #$i_limits I_LIMITS
10867 #include <limits.h>
10873 printf("Contains DBL_DIG");
10876 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10877 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10878 echo "DBL_DIG found." >&4
10881 echo "DBL_DIG NOT found." >&4
10888 : see if dbm.h is available
10889 : see if dbmclose exists
10890 set dbmclose d_dbmclose
10893 case "$d_dbmclose" in
10903 *) set rpcsvc/dbm.h i_rpcsvcdbm
10908 *) echo "We won't be including <dbm.h>"
10918 : see if prototype for dbminit is available
10920 set d_dbminitproto dbminit $i_dbm dbm.h
10923 : see if difftime exists
10924 set difftime d_difftime
10927 : see if this is a dirent system
10929 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10931 echo "<dirent.h> found." >&4
10934 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10935 echo "<sys/dir.h> found." >&4
10938 xinc=`./findhdr sys/ndir.h`
10940 echo "<dirent.h> NOT found." >&4
10945 : Look for type of directory structure.
10947 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10949 case "$direntrytype" in
10951 case "$i_dirent" in
10952 $define) guess1='struct dirent' ;;
10953 *) guess1='struct direct' ;;
10956 *) guess1="$direntrytype"
10961 'struct dirent') guess2='struct direct' ;;
10962 *) guess2='struct dirent' ;;
10965 if $contains "$guess1" try.c >/dev/null 2>&1; then
10966 direntrytype="$guess1"
10967 echo "Your directory entries are $direntrytype." >&4
10968 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10969 direntrytype="$guess2"
10970 echo "Your directory entries seem to be $direntrytype." >&4
10972 echo "I don't recognize your system's directory entries." >&4
10973 rp="What type is used for directory entries on this system?"
10976 direntrytype="$ans"
10981 : see if the directory entry stores field length
10983 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10984 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10985 echo "Good, your directory entry keeps length information in d_namlen." >&4
10988 echo "Your directory entry does not know about the d_namlen field." >&4
10995 : see if this is an sysdir system
10996 set sys/dir.h i_sysdir
10999 : see if this is an sysndir system
11000 set sys/ndir.h i_sysndir
11005 $cat >dirfd.c <<EOM
11007 #$i_stdlib I_STDLIB
11009 #include <stdlib.h>
11011 #$i_dirent I_DIRENT /**/
11012 #$i_sysdir I_SYS_DIR /**/
11013 #$i_sysndir I_SYS_NDIR /**/
11014 #$i_systypes I_SYS_TYPES /**/
11015 #if defined(I_SYS_TYPES)
11016 #include <sys/types.h>
11018 #if defined(I_DIRENT)
11019 #include <dirent.h>
11020 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11021 #include <sys/dir.h>
11025 #include <sys/ndir.h>
11029 #include <ndir.h> /* may be wrong in the future */
11031 #include <sys/dir.h>
11037 DIR *dirp = opendir(".");
11038 if (dirfd(dirp) >= 0)
11046 if eval $compile; then
11050 $define) echo "dirfd() found." >&4 ;;
11051 *) echo "dirfd() NOT found." >&4 ;;
11057 : see if dlerror exists
11060 set dlerror d_dlerror
11064 : see if dlfcn is available
11065 set dlfcn.h i_dlfcn
11072 On a few systems, the dynamically loaded modules that perl generates and uses
11073 will need a different extension than shared libs. The default will probably
11079 *) dflt="$dlext" ;;
11081 rp='What is the extension of dynamically loaded modules'
11090 : Check if dlsym need a leading underscore
11096 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11097 $cat >dyna.c <<'EOM'
11104 #$i_stdlib I_STDLIB
11106 #include <stdlib.h>
11110 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11112 #include <sys/types.h>
11117 extern int fred() ;
11126 int mode = RTLD_LAZY ;
11128 handle = dlopen("./dyna.$dlext", mode) ;
11129 if (handle == NULL) {
11134 symbol = dlsym(handle, "fred") ;
11135 if (symbol == NULL) {
11136 /* try putting a leading underscore */
11137 symbol = dlsym(handle, "_fred") ;
11138 if (symbol == NULL) {
11151 : Call the object file tmp-dyna.o in case dlext=o.
11152 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11153 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11154 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11155 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11158 1) echo "Test program failed using dlopen." >&4
11159 echo "Perhaps you should not use dynamic loading." >&4;;
11160 2) echo "Test program failed using dlsym." >&4
11161 echo "Perhaps you should not use dynamic loading." >&4;;
11162 3) echo "dlsym needs a leading underscore" >&4
11164 4) echo "dlsym doesn't need a leading underscore." >&4;;
11167 echo "I can't compile and run the test program." >&4
11168 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11173 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11178 : see if drand48_r exists
11179 set drand48_r d_drand48_r
11181 case "$d_drand48_r" in
11183 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11184 case "$d_drand48_r_proto:$usethreads" in
11185 ":define") d_drand48_r_proto=define
11186 set d_drand48_r_proto drand48_r $hdrs
11190 case "$d_drand48_r_proto" in
11192 case "$drand48_r_proto" in
11193 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11194 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11196 case "$drand48_r_proto" in
11197 ''|0) d_drand48_r=undef
11199 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11200 * ) case "$drand48_r_proto" in
11201 REENTRANT_PROTO*) ;;
11202 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11204 echo "Prototype: $try" ;;
11207 *) case "$usethreads" in
11208 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11215 *) drand48_r_proto=0
11219 : see if prototype for drand48 is available
11221 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11224 : see if dup2 exists
11228 : see if eaccess exists
11229 set eaccess d_eaccess
11232 : see if endgrent exists
11233 set endgrent d_endgrent
11236 : see if this is an grp system
11242 xxx=`./findhdr grp.h`
11243 $cppstdin $cppflags $cppminus < $xxx >$$.h
11245 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11257 set d_grpasswd; eval $setvar
11261 : see if endgrent_r exists
11262 set endgrent_r d_endgrent_r
11264 case "$d_endgrent_r" in
11266 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11267 case "$d_endgrent_r_proto:$usethreads" in
11268 ":define") d_endgrent_r_proto=define
11269 set d_endgrent_r_proto endgrent_r $hdrs
11273 case "$d_endgrent_r_proto" in
11275 case "$endgrent_r_proto" in
11276 ''|0) try='int endgrent_r(FILE**);'
11277 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11279 case "$endgrent_r_proto" in
11280 ''|0) try='void endgrent_r(FILE**);'
11281 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11283 case "$endgrent_r_proto" in
11284 ''|0) d_endgrent_r=undef
11286 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11287 * ) case "$endgrent_r_proto" in
11288 REENTRANT_PROTO*) ;;
11289 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11291 echo "Prototype: $try" ;;
11294 *) case "$usethreads" in
11295 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11302 *) endgrent_r_proto=0
11306 : see if endhostent exists
11307 set endhostent d_endhent
11310 : see if this is a netdb.h system
11311 set netdb.h i_netdb
11314 : see if endhostent_r exists
11315 set endhostent_r d_endhostent_r
11317 case "$d_endhostent_r" in
11319 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11320 case "$d_endhostent_r_proto:$usethreads" in
11321 ":define") d_endhostent_r_proto=define
11322 set d_endhostent_r_proto endhostent_r $hdrs
11326 case "$d_endhostent_r_proto" in
11328 case "$endhostent_r_proto" in
11329 ''|0) try='int endhostent_r(struct hostent_data*);'
11330 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11332 case "$endhostent_r_proto" in
11333 ''|0) try='void endhostent_r(struct hostent_data*);'
11334 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11336 case "$endhostent_r_proto" in
11337 ''|0) d_endhostent_r=undef
11338 endhostent_r_proto=0
11339 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11340 * ) case "$endhostent_r_proto" in
11341 REENTRANT_PROTO*) ;;
11342 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11344 echo "Prototype: $try" ;;
11347 *) case "$usethreads" in
11348 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11350 d_endhostent_r=undef
11351 endhostent_r_proto=0
11355 *) endhostent_r_proto=0
11359 : see if endnetent exists
11360 set endnetent d_endnent
11363 : see if endnetent_r exists
11364 set endnetent_r d_endnetent_r
11366 case "$d_endnetent_r" in
11368 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11369 case "$d_endnetent_r_proto:$usethreads" in
11370 ":define") d_endnetent_r_proto=define
11371 set d_endnetent_r_proto endnetent_r $hdrs
11375 case "$d_endnetent_r_proto" in
11377 case "$endnetent_r_proto" in
11378 ''|0) try='int endnetent_r(struct netent_data*);'
11379 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11381 case "$endnetent_r_proto" in
11382 ''|0) try='void endnetent_r(struct netent_data*);'
11383 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11385 case "$endnetent_r_proto" in
11386 ''|0) d_endnetent_r=undef
11387 endnetent_r_proto=0
11388 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11389 * ) case "$endnetent_r_proto" in
11390 REENTRANT_PROTO*) ;;
11391 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11393 echo "Prototype: $try" ;;
11396 *) case "$usethreads" in
11397 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11399 d_endnetent_r=undef
11400 endnetent_r_proto=0
11404 *) endnetent_r_proto=0
11408 : see if endprotoent exists
11409 set endprotoent d_endpent
11412 : see if endprotoent_r exists
11413 set endprotoent_r d_endprotoent_r
11415 case "$d_endprotoent_r" in
11417 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11418 case "$d_endprotoent_r_proto:$usethreads" in
11419 ":define") d_endprotoent_r_proto=define
11420 set d_endprotoent_r_proto endprotoent_r $hdrs
11424 case "$d_endprotoent_r_proto" in
11426 case "$endprotoent_r_proto" in
11427 ''|0) try='int endprotoent_r(struct protoent_data*);'
11428 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11430 case "$endprotoent_r_proto" in
11431 ''|0) try='void endprotoent_r(struct protoent_data*);'
11432 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11434 case "$endprotoent_r_proto" in
11435 ''|0) d_endprotoent_r=undef
11436 endprotoent_r_proto=0
11437 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11438 * ) case "$endprotoent_r_proto" in
11439 REENTRANT_PROTO*) ;;
11440 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11442 echo "Prototype: $try" ;;
11445 *) case "$usethreads" in
11446 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11448 d_endprotoent_r=undef
11449 endprotoent_r_proto=0
11453 *) endprotoent_r_proto=0
11457 : see if endpwent exists
11458 set endpwent d_endpwent
11461 : see if this is a pwd.h system
11467 xxx=`./findhdr pwd.h`
11468 $cppstdin $cppflags $cppminus < $xxx >$$.h
11470 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11478 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11486 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11494 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11502 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11510 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11518 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11526 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11538 set d_pwquota; eval $setvar
11539 set d_pwage; eval $setvar
11540 set d_pwchange; eval $setvar
11541 set d_pwclass; eval $setvar
11542 set d_pwexpire; eval $setvar
11543 set d_pwcomment; eval $setvar
11544 set d_pwgecos; eval $setvar
11545 set d_pwpasswd; eval $setvar
11549 : see if endpwent_r exists
11550 set endpwent_r d_endpwent_r
11552 case "$d_endpwent_r" in
11554 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11555 case "$d_endpwent_r_proto:$usethreads" in
11556 ":define") d_endpwent_r_proto=define
11557 set d_endpwent_r_proto endpwent_r $hdrs
11561 case "$d_endpwent_r_proto" in
11563 case "$endpwent_r_proto" in
11564 ''|0) try='int endpwent_r(FILE**);'
11565 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11567 case "$endpwent_r_proto" in
11568 ''|0) try='void endpwent_r(FILE**);'
11569 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11571 case "$endpwent_r_proto" in
11572 ''|0) d_endpwent_r=undef
11574 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11575 * ) case "$endpwent_r_proto" in
11576 REENTRANT_PROTO*) ;;
11577 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11579 echo "Prototype: $try" ;;
11582 *) case "$usethreads" in
11583 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11590 *) endpwent_r_proto=0
11594 : see if endservent exists
11595 set endservent d_endsent
11598 : see if endservent_r exists
11599 set endservent_r d_endservent_r
11601 case "$d_endservent_r" in
11603 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11604 case "$d_endservent_r_proto:$usethreads" in
11605 ":define") d_endservent_r_proto=define
11606 set d_endservent_r_proto endservent_r $hdrs
11610 case "$d_endservent_r_proto" in
11612 case "$endservent_r_proto" in
11613 ''|0) try='int endservent_r(struct servent_data*);'
11614 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11616 case "$endservent_r_proto" in
11617 ''|0) try='void endservent_r(struct servent_data*);'
11618 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11620 case "$endservent_r_proto" in
11621 ''|0) d_endservent_r=undef
11622 endservent_r_proto=0
11623 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11624 * ) case "$endservent_r_proto" in
11625 REENTRANT_PROTO*) ;;
11626 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11628 echo "Prototype: $try" ;;
11631 *) case "$usethreads" in
11632 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11634 d_endservent_r=undef
11635 endservent_r_proto=0
11639 *) endservent_r_proto=0
11643 : Locate the flags for 'open()'
11646 #include <sys/types.h>
11651 #include <sys/file.h>
11653 #$i_stdlib I_STDLIB
11655 #include <stdlib.h>
11666 : check sys/file.h first to get FREAD on Sun
11667 if $test `./findhdr sys/file.h` && \
11668 set try -DI_SYS_FILE && eval $compile; then
11670 echo "<sys/file.h> defines the O_* constants..." >&4
11671 if $run ./try; then
11672 echo "and you have the 3 argument form of open()." >&4
11675 echo "but not the 3 argument form of open(). Oh, well." >&4
11678 elif $test `./findhdr fcntl.h` && \
11679 set try -DI_FCNTL && eval $compile; then
11681 echo "<fcntl.h> defines the O_* constants..." >&4
11682 if $run ./try; then
11683 echo "and you have the 3 argument form of open()." >&4
11686 echo "but not the 3 argument form of open(). Oh, well." >&4
11691 echo "I can't find the O_* constant definitions! You got problems." >&4
11697 : see which of string.h or strings.h is needed
11699 strings=`./findhdr string.h`
11700 if $test "$strings" && $test -r "$strings"; then
11701 echo "Using <string.h> instead of <strings.h>." >&4
11705 strings=`./findhdr strings.h`
11706 if $test "$strings" && $test -r "$strings"; then
11707 echo "Using <strings.h> instead of <string.h>." >&4
11709 echo "No string header found -- You'll surely have problems." >&4
11714 case "$i_string" in
11715 "$undef") strings=`./findhdr strings.h`;;
11716 *) strings=`./findhdr string.h`;;
11719 : see if this is a sys/file.h system
11724 : do we need to include sys/file.h ?
11728 if $h_sysfile; then
11730 echo "We'll be including <sys/file.h>." >&4
11733 echo "We won't be including <sys/file.h>." >&4
11743 : see if fcntl.h is there
11748 : see if we can include fcntl.h
11754 echo "We'll be including <fcntl.h>." >&4
11757 if $h_sysfile; then
11758 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11760 echo "We won't be including <fcntl.h>." >&4
11772 : check for non-blocking I/O stuff
11773 case "$h_sysfile" in
11774 true) echo "#include <sys/file.h>" > head.c;;
11777 true) echo "#include <fcntl.h>" > head.c;;
11778 *) echo "#include <sys/fcntl.h>" > head.c;;
11783 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11784 case "$o_nonblock" in
11786 $cat head.c > try.c
11787 $cat >>try.c <<EOCP
11789 #$i_stdlib I_STDLIB
11791 #include <stdlib.h>
11799 printf("O_NONBLOCK\n");
11803 printf("O_NDELAY\n");
11807 printf("FNDELAY\n");
11814 if eval $compile_ok; then
11815 o_nonblock=`$run ./try`
11816 case "$o_nonblock" in
11817 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11818 *) echo "Seems like we can use $o_nonblock.";;
11821 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11824 *) echo "Using $hint value $o_nonblock.";;
11826 $rm -f try try.* .out core
11829 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11832 $cat head.c > try.c
11833 $cat >>try.c <<EOCP
11835 #include <sys/types.h>
11836 #include <signal.h>
11838 #$i_stdlib I_STDLIB
11840 #include <stdlib.h>
11846 #define MY_O_NONBLOCK $o_nonblock
11847 #ifndef errno /* XXX need better Configure test */
11850 #$i_unistd I_UNISTD
11852 #include <unistd.h>
11854 #$i_string I_STRING
11856 #include <string.h>
11858 #include <strings.h>
11860 $signal_t blech(x) int x; { exit(3); }
11862 $cat >> try.c <<'EOCP'
11870 pipe(pd); /* Down: child -> parent */
11871 pipe(pu); /* Up: parent -> child */
11874 close(pd[1]); /* Parent reads from pd[0] */
11875 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11877 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11882 signal(SIGALRM, blech);
11884 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11886 sprintf(string, "%d\n", ret);
11887 write(2, string, strlen(string));
11890 if (errno == EAGAIN) {
11891 printf("EAGAIN\n");
11896 if (errno == EWOULDBLOCK)
11897 printf("EWOULDBLOCK\n");
11900 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11901 sleep(2); /* Give it time to close our pipe */
11903 ret = read(pd[0], buf, 1); /* Should read EOF */
11905 sprintf(string, "%d\n", ret);
11906 write(4, string, strlen(string));
11910 close(pd[0]); /* We write to pd[1] */
11911 close(pu[1]); /* We read from pu[0] */
11912 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11913 close(pd[1]); /* Pipe pd is now fully closed! */
11914 exit(0); /* Bye bye, thank you for playing! */
11918 if eval $compile_ok; then
11919 echo "$startsh" >mtry
11920 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11922 ./mtry >/dev/null 2>&1
11924 0) eagain=`$cat try.out`;;
11925 1) echo "Could not perform non-blocking setting!";;
11926 2) echo "I did a successful read() for something that was not there!";;
11927 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11928 4) echo "Could not find F_SETFL!";;
11929 *) echo "Something terribly wrong happened during testing.";;
11931 rd_nodata=`$cat try.ret`
11932 echo "A read() system call with no data present returns $rd_nodata."
11933 case "$rd_nodata" in
11936 echo "(That's peculiar, fixing that to be -1.)"
11942 echo "Forcing errno EAGAIN on read() with no data available."
11946 echo "Your read() sets errno to $eagain when no data is available."
11949 status=`$cat try.err`
11951 0) echo "And it correctly returns 0 to signal EOF.";;
11952 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11953 *) echo "However, your read() returns '$status' on EOF??";;
11956 if test "$status" = "$rd_nodata"; then
11957 echo "WARNING: you can't distinguish between EOF and no data!"
11961 echo "I can't compile the test program--assuming errno EAGAIN will do."
11968 echo "Using $hint value $eagain."
11969 echo "Your read() returns $rd_nodata when no data is present."
11970 case "$d_eofnblk" in
11971 "$define") echo "And you can see EOF because read() returns 0.";;
11972 "$undef") echo "But you can't see EOF status from read() returned value.";;
11974 echo "(Assuming you can't see EOF status from read anyway.)"
11980 $rm -f try try.* .out core head.c mtry
11982 : see if _ptr and _cnt from stdio act std
11985 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11986 echo "(Looks like you have stdio.h from BSD.)"
11987 case "$stdio_ptr" in
11988 '') stdio_ptr='((fp)->_p)'
11991 *) ptr_lval=$d_stdio_ptr_lval;;
11993 case "$stdio_cnt" in
11994 '') stdio_cnt='((fp)->_r)'
11997 *) cnt_lval=$d_stdio_cnt_lval;;
11999 case "$stdio_base" in
12000 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12002 case "$stdio_bufsiz" in
12003 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12005 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12006 echo "(Looks like you have stdio.h from Linux.)"
12007 case "$stdio_ptr" in
12008 '') stdio_ptr='((fp)->_IO_read_ptr)'
12011 *) ptr_lval=$d_stdio_ptr_lval;;
12013 case "$stdio_cnt" in
12014 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12017 *) cnt_lval=$d_stdio_cnt_lval;;
12019 case "$stdio_base" in
12020 '') stdio_base='((fp)->_IO_read_base)';;
12022 case "$stdio_bufsiz" in
12023 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12026 case "$stdio_ptr" in
12027 '') stdio_ptr='((fp)->_ptr)'
12030 *) ptr_lval=$d_stdio_ptr_lval;;
12032 case "$stdio_cnt" in
12033 '') stdio_cnt='((fp)->_cnt)'
12036 *) cnt_lval=$d_stdio_cnt_lval;;
12038 case "$stdio_base" in
12039 '') stdio_base='((fp)->_base)';;
12041 case "$stdio_bufsiz" in
12042 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12046 : test whether _ptr and _cnt really work
12047 echo "Checking how std your stdio is..." >&4
12050 #$i_stdlib I_STDLIB
12052 #include <stdlib.h>
12054 #define FILE_ptr(fp) $stdio_ptr
12055 #define FILE_cnt(fp) $stdio_cnt
12057 FILE *fp = fopen("try.c", "r");
12060 18 <= FILE_cnt(fp) &&
12061 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12069 if eval $compile && $to try.c; then
12070 if $run ./try; then
12071 echo "Your stdio acts pretty std."
12074 echo "Your stdio isn't very std."
12077 echo "Your stdio doesn't appear very std."
12081 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12082 # direct buffer manipulation no longer works. The Configure tests
12083 # should be changed to correctly detect this, but until then,
12084 # the following check should at least let perl compile and run.
12085 # (This quick fix should be updated before 5.8.1.)
12086 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12087 # A. Dougherty, June 3, 2002.
12088 case "$d_gnulibc" in
12090 case "$gnulibc_version" in
12094 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12103 : Can _ptr be used as an lvalue?
12104 case "$d_stdstdio$ptr_lval" in
12105 $define$define) val=$define ;;
12108 set d_stdio_ptr_lval
12111 : Can _cnt be used as an lvalue?
12112 case "$d_stdstdio$cnt_lval" in
12113 $define$define) val=$define ;;
12116 set d_stdio_cnt_lval
12120 : test whether setting _ptr sets _cnt as a side effect
12121 d_stdio_ptr_lval_sets_cnt="$undef"
12122 d_stdio_ptr_lval_nochange_cnt="$undef"
12123 case "$d_stdio_ptr_lval$d_stdstdio" in
12125 echo "Checking to see what happens if we set the stdio ptr..." >&4
12128 /* Can we scream? */
12129 /* Eat dust sed :-) */
12130 /* In the buffer space, no one can hear you scream. */
12131 #$i_stdlib I_STDLIB
12133 #include <stdlib.h>
12135 #define FILE_ptr(fp) $stdio_ptr
12136 #define FILE_cnt(fp) $stdio_cnt
12137 #include <sys/types.h>
12139 FILE *fp = fopen("try.c", "r");
12144 puts("Fail even to read");
12147 c = getc(fp); /* Read away the first # */
12149 puts("Fail even to read");
12153 18 <= FILE_cnt(fp) &&
12154 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12156 puts("Fail even to read");
12159 ptr = (char*) FILE_ptr(fp);
12160 cnt = (size_t)FILE_cnt(fp);
12162 FILE_ptr(fp) += 42;
12164 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12165 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12168 if (FILE_cnt(fp) <= 20) {
12169 printf ("Fail (<20 chars to test)");
12172 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12173 puts("Fail compare");
12176 if (cnt == FILE_cnt(fp)) {
12177 puts("Pass_unchanged");
12180 if (FILE_cnt(fp) == (cnt - 42)) {
12181 puts("Pass_changed");
12184 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12190 if eval $compile && $to try.c; then
12191 case `$run ./try` in
12193 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12194 d_stdio_ptr_lval_sets_cnt="$define" ;;
12196 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12197 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12199 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12201 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12204 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12210 : see if _base is also standard
12212 case "$d_stdstdio" in
12216 #$i_stdlib I_STDLIB
12218 #include <stdlib.h>
12220 #define FILE_base(fp) $stdio_base
12221 #define FILE_bufsiz(fp) $stdio_bufsiz
12223 FILE *fp = fopen("try.c", "r");
12226 19 <= FILE_bufsiz(fp) &&
12227 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12234 if eval $compile && $to try.c; then
12235 if $run ./try; then
12236 echo "And its _base field acts std."
12239 echo "But its _base field isn't std."
12242 echo "However, it seems to be lacking the _base field."
12250 : see if fast_stdio exists
12252 case "$d_stdstdio:$d_stdio_ptr_lval" in
12254 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12256 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12267 : see if fchdir exists
12268 set fchdir d_fchdir
12271 : see if fchmod exists
12272 set fchmod d_fchmod
12275 : see if fchown exists
12276 set fchown d_fchown
12279 : see if this is an fcntl system
12284 : See if fcntl-based locking works.
12286 #$i_stdlib I_STDLIB
12288 #include <stdlib.h>
12290 #include <unistd.h>
12292 #include <signal.h>
12293 $signal_t blech(x) int x; { exit(3); }
12295 #if defined(F_SETLK) && defined(F_SETLKW)
12296 struct flock flock;
12298 fd = open("try.c", O_RDONLY);
12299 flock.l_type = F_RDLCK;
12300 flock.l_whence = SEEK_SET;
12301 flock.l_start = flock.l_len = 0;
12302 signal(SIGALRM, blech);
12304 retval = fcntl(fd, F_SETLK, &flock);
12306 (retval < 0 ? exit(2) : exit(0));
12312 echo "Checking if fcntl-based file locking works... "
12316 if eval $compile_ok; then
12317 if $run ./try; then
12318 echo "Yes, it seems to work."
12321 echo "Nope, it didn't work."
12326 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12327 *** This is (almost) impossible.
12328 *** If your NFS lock daemons are not feeling well, something like
12329 *** this may happen, please investigate. Cannot continue, aborting.
12337 echo "I'm unable to compile the test program, so I'll assume not."
12342 echo "Nope, since you don't even have fcntl()."
12345 set d_fcntl_can_lock
12350 : check for fd_set items
12353 Checking to see how well your C compiler handles fd_set and friends ...
12356 #$i_stdlib I_STDLIB
12358 #include <stdlib.h>
12360 #$i_systime I_SYS_TIME
12361 #$i_sysselct I_SYS_SELECT
12362 #$d_socket HAS_SOCKET
12363 #include <sys/types.h>
12365 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12368 #include <sys/time.h>
12370 #ifdef I_SYS_SELECT
12371 #include <sys/select.h>
12380 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12388 if eval $compile; then
12389 d_fds_bits="$define"
12391 echo "Well, your system knows about the normal fd_set typedef..." >&4
12392 if $run ./try; then
12393 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12394 d_fd_macros="$define"
12397 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12399 d_fd_macros="$undef"
12403 Hmm, your compiler has some difficulty with fd_set. Checking further...
12406 if eval $compile; then
12407 d_fds_bits="$undef"
12409 echo "Well, your system has some sort of fd_set available..." >&4
12410 if $run ./try; then
12411 echo "and you have the normal fd_set macros." >&4
12412 d_fd_macros="$define"
12415 but not the normal fd_set macros! Gross! More work for me...
12417 d_fd_macros="$undef"
12420 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12422 d_fds_bits="$undef"
12423 d_fd_macros="$undef"
12428 : see if fgetpos exists
12429 set fgetpos d_fgetpos
12432 : see if finite exists
12433 set finite d_finite
12436 : see if finitel exists
12437 set finitel d_finitel
12440 : see if flock exists
12444 : see if prototype for flock is available
12446 set d_flockproto flock $i_sysfile sys/file.h
12449 : see if fork exists
12453 : see if fp_class exists
12454 set fp_class d_fp_class
12457 : see if pathconf exists
12458 set pathconf d_pathconf
12461 : see if fpathconf exists
12462 set fpathconf d_fpathconf
12465 : see if fpclass exists
12466 set fpclass d_fpclass
12469 : see if fpclassify exists
12470 set fpclassify d_fpclassify
12473 : see if fpclassl exists
12474 set fpclassl d_fpclassl
12478 : check for fpos64_t
12480 echo "Checking to see if you have fpos64_t..." >&4
12483 int main() { fpos64_t x = 7; }
12486 if eval $compile; then
12488 echo "You have fpos64_t."
12491 echo "You do not have fpos64_t."
12492 case "$fpossize" in
12493 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12500 : see if frexpl exists
12501 set frexpl d_frexpl
12504 : see if this is a sys/param system
12505 set sys/param.h i_sysparam
12508 : see if this is a sys/mount.h system
12509 set sys/mount.h i_sysmount
12514 echo "Checking to see if your system supports struct fs_data..." >&4
12515 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12517 case "$d_fs_data_s" in
12518 "$define") echo "Yes, it does." ;;
12519 *) echo "No, it doesn't." ;;
12522 : see if fseeko exists
12523 set fseeko d_fseeko
12525 case "$longsize" in
12526 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12529 : see if fsetpos exists
12530 set fsetpos d_fsetpos
12534 : see if fstatfs exists
12535 set fstatfs d_fstatfs
12539 : see if statvfs exists
12540 set statvfs d_statvfs
12543 : see if fstatvfs exists
12544 set fstatvfs d_fstatvfs
12548 : see if fsync exists
12552 : see if ftello exists
12553 set ftello d_ftello
12555 case "$longsize" in
12556 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12560 : check for a working futimes
12562 echo "Checking for a working futimes()" >&4
12565 #include <sys/time.h>
12572 fd = open ("try.c", O_RDWR);
12573 if (-1 == fd) exit (1);
12574 rv = futimes (fd, NULL);
12575 exit (rv == -1 ? errno : 0);
12579 if eval $compile; then
12583 0) echo "Yes, it does" >&4
12584 d_futimes="$define"
12586 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12590 echo "No, it does not (probably harmless)\n" >&4
12592 $rm -f try.* try core core.try.*
12594 : see if getcwd exists
12595 set getcwd d_getcwd
12598 : see if getespwnam exists
12599 set getespwnam d_getespwnam
12603 : see if getfsstat exists
12604 set getfsstat d_getfsstat
12607 : see if getgrent exists
12608 set getgrent d_getgrent
12611 : see if getgrent_r exists
12612 set getgrent_r d_getgrent_r
12614 case "$d_getgrent_r" in
12616 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12617 case "$d_getgrent_r_proto:$usethreads" in
12618 ":define") d_getgrent_r_proto=define
12619 set d_getgrent_r_proto getgrent_r $hdrs
12623 case "$d_getgrent_r_proto" in
12625 case "$getgrent_r_proto" in
12626 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12627 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12629 case "$getgrent_r_proto" in
12630 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12631 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12633 case "$getgrent_r_proto" in
12634 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12635 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12637 case "$getgrent_r_proto" in
12638 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12639 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12641 case "$getgrent_r_proto" in
12642 ''|0) try='int getgrent_r(struct group*, char*, int);'
12643 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12645 case "$getgrent_r_proto" in
12646 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12647 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12649 case "$getgrent_r_proto" in
12650 ''|0) d_getgrent_r=undef
12652 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12653 * ) case "$getgrent_r_proto" in
12654 REENTRANT_PROTO*) ;;
12655 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12657 echo "Prototype: $try" ;;
12660 *) case "$usethreads" in
12661 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12668 *) getgrent_r_proto=0
12672 : see if getgrgid_r exists
12673 set getgrgid_r d_getgrgid_r
12675 case "$d_getgrgid_r" in
12677 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12678 case "$d_getgrgid_r_proto:$usethreads" in
12679 ":define") d_getgrgid_r_proto=define
12680 set d_getgrgid_r_proto getgrgid_r $hdrs
12684 case "$d_getgrgid_r_proto" in
12686 case "$getgrgid_r_proto" in
12687 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12688 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12690 case "$getgrgid_r_proto" in
12691 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12692 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12694 case "$getgrgid_r_proto" in
12695 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12696 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12698 case "$getgrgid_r_proto" in
12699 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12700 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12702 case "$getgrgid_r_proto" in
12703 ''|0) d_getgrgid_r=undef
12705 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12706 * ) case "$getgrgid_r_proto" in
12707 REENTRANT_PROTO*) ;;
12708 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12710 echo "Prototype: $try" ;;
12713 *) case "$usethreads" in
12714 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12721 *) getgrgid_r_proto=0
12725 : see if getgrnam_r exists
12726 set getgrnam_r d_getgrnam_r
12728 case "$d_getgrnam_r" in
12730 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12731 case "$d_getgrnam_r_proto:$usethreads" in
12732 ":define") d_getgrnam_r_proto=define
12733 set d_getgrnam_r_proto getgrnam_r $hdrs
12737 case "$d_getgrnam_r_proto" in
12739 case "$getgrnam_r_proto" in
12740 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12741 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12743 case "$getgrnam_r_proto" in
12744 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12745 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12747 case "$getgrnam_r_proto" in
12748 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12749 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12751 case "$getgrnam_r_proto" in
12752 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12753 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12755 case "$getgrnam_r_proto" in
12756 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12757 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12759 case "$getgrnam_r_proto" in
12760 ''|0) d_getgrnam_r=undef
12762 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12763 * ) case "$getgrnam_r_proto" in
12764 REENTRANT_PROTO*) ;;
12765 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12767 echo "Prototype: $try" ;;
12770 *) case "$usethreads" in
12771 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12778 *) getgrnam_r_proto=0
12782 : see if gethostbyaddr exists
12783 set gethostbyaddr d_gethbyaddr
12786 : see if gethostbyname exists
12787 set gethostbyname d_gethbyname
12790 : see if gethostent exists
12791 set gethostent d_gethent
12794 : see how we will look up host name
12797 if set gethostname val -f d_gethname; eval $csym; $val; then
12798 echo 'gethostname() found.' >&4
12799 d_gethname="$define"
12802 if set uname val -f d_uname; eval $csym; $val; then
12805 uname() was found, but you're running xenix, and older versions of xenix
12806 have a broken uname(). If you don't really know whether your xenix is old
12807 enough to have a broken system call, use the default answer.
12812 "$define") dflt=n;;
12814 rp='Is your uname() broken?'
12817 n*) d_uname="$define"; call=uname;;
12820 echo 'uname() found.' >&4
12827 case "$d_gethname" in
12828 '') d_gethname="$undef";;
12831 '') d_uname="$undef";;
12833 case "$d_uname$d_gethname" in
12838 Every now and then someone has a $call() that lies about the hostname
12839 but can't be fixed for political or economic reasons. If you wish, I can
12840 pretend $call() isn't there and maybe compute hostname at run-time
12841 thanks to the '$phostname' command.
12844 rp="Shall I ignore $call() from now on?"
12847 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12850 case "$phostname" in
12851 '') aphostname='';;
12852 *) case "$aphostname" in
12854 *) set X $phostname
12858 file=`./loc $file $file $pth`
12859 aphostname=`echo $file $*`
12864 case "$d_uname$d_gethname" in
12867 case "$phostname" in
12869 echo "There will be no way for $package to get your hostname." >&4;;
12871 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12875 case "$d_phostname" in
12876 '') d_phostname="$undef";;
12879 : see if gethostbyaddr_r exists
12880 set gethostbyaddr_r d_gethostbyaddr_r
12882 case "$d_gethostbyaddr_r" in
12884 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12885 case "$d_gethostbyaddr_r_proto:$usethreads" in
12886 ":define") d_gethostbyaddr_r_proto=define
12887 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12891 case "$d_gethostbyaddr_r_proto" in
12893 case "$gethostbyaddr_r_proto" in
12894 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12895 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12897 case "$gethostbyaddr_r_proto" in
12898 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12899 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12901 case "$gethostbyaddr_r_proto" in
12902 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12903 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12905 case "$gethostbyaddr_r_proto" in
12906 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12907 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12909 case "$gethostbyaddr_r_proto" in
12910 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12911 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12913 case "$gethostbyaddr_r_proto" in
12914 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12915 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12917 case "$gethostbyaddr_r_proto" in
12918 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12919 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12921 case "$gethostbyaddr_r_proto" in
12922 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12923 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12925 case "$gethostbyaddr_r_proto" in
12926 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12927 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12929 case "$gethostbyaddr_r_proto" in
12930 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12931 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12933 case "$gethostbyaddr_r_proto" in
12934 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12935 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12937 case "$gethostbyaddr_r_proto" in
12938 ''|0) d_gethostbyaddr_r=undef
12939 gethostbyaddr_r_proto=0
12940 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12941 * ) case "$gethostbyaddr_r_proto" in
12942 REENTRANT_PROTO*) ;;
12943 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12945 echo "Prototype: $try" ;;
12948 *) case "$usethreads" in
12949 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12951 d_gethostbyaddr_r=undef
12952 gethostbyaddr_r_proto=0
12956 *) gethostbyaddr_r_proto=0
12960 : see if gethostbyname_r exists
12961 set gethostbyname_r d_gethostbyname_r
12963 case "$d_gethostbyname_r" in
12965 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12966 case "$d_gethostbyname_r_proto:$usethreads" in
12967 ":define") d_gethostbyname_r_proto=define
12968 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12972 case "$d_gethostbyname_r_proto" in
12974 case "$gethostbyname_r_proto" in
12975 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12976 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12978 case "$gethostbyname_r_proto" in
12979 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12980 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12982 case "$gethostbyname_r_proto" in
12983 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12984 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12986 case "$gethostbyname_r_proto" in
12987 ''|0) d_gethostbyname_r=undef
12988 gethostbyname_r_proto=0
12989 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12990 * ) case "$gethostbyname_r_proto" in
12991 REENTRANT_PROTO*) ;;
12992 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12994 echo "Prototype: $try" ;;
12997 *) case "$usethreads" in
12998 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13000 d_gethostbyname_r=undef
13001 gethostbyname_r_proto=0
13005 *) gethostbyname_r_proto=0
13009 : see if gethostent_r exists
13010 set gethostent_r d_gethostent_r
13012 case "$d_gethostent_r" in
13014 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13015 case "$d_gethostent_r_proto:$usethreads" in
13016 ":define") d_gethostent_r_proto=define
13017 set d_gethostent_r_proto gethostent_r $hdrs
13021 case "$d_gethostent_r_proto" in
13023 case "$gethostent_r_proto" in
13024 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13025 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13027 case "$gethostent_r_proto" in
13028 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13029 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13031 case "$gethostent_r_proto" in
13032 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13033 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13035 case "$gethostent_r_proto" in
13036 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13037 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13039 case "$gethostent_r_proto" in
13040 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13041 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13043 case "$gethostent_r_proto" in
13044 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13045 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13047 case "$gethostent_r_proto" in
13048 ''|0) d_gethostent_r=undef
13049 gethostent_r_proto=0
13050 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13051 * ) case "$gethostent_r_proto" in
13052 REENTRANT_PROTO*) ;;
13053 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13055 echo "Prototype: $try" ;;
13058 *) case "$usethreads" in
13059 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13061 d_gethostent_r=undef
13062 gethostent_r_proto=0
13066 *) gethostent_r_proto=0
13070 : see if prototypes for various gethostxxx netdb.h functions are available
13072 set d_gethostprotos gethostent $i_netdb netdb.h
13075 : see if getitimer exists
13076 set getitimer d_getitimer
13079 : see if getlogin exists
13080 set getlogin d_getlogin
13083 : see if getlogin_r exists
13084 set getlogin_r d_getlogin_r
13086 case "$d_getlogin_r" in
13088 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13089 case "$d_getlogin_r_proto:$usethreads" in
13090 ":define") d_getlogin_r_proto=define
13091 set d_getlogin_r_proto getlogin_r $hdrs
13095 case "$d_getlogin_r_proto" in
13097 case "$getlogin_r_proto" in
13098 ''|0) try='int getlogin_r(char*, size_t);'
13099 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13101 case "$getlogin_r_proto" in
13102 ''|0) try='int getlogin_r(char*, int);'
13103 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13105 case "$getlogin_r_proto" in
13106 ''|0) try='char* getlogin_r(char*, size_t);'
13107 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13109 case "$getlogin_r_proto" in
13110 ''|0) try='char* getlogin_r(char*, int);'
13111 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13113 case "$getlogin_r_proto" in
13114 ''|0) d_getlogin_r=undef
13116 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13117 * ) case "$getlogin_r_proto" in
13118 REENTRANT_PROTO*) ;;
13119 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13121 echo "Prototype: $try" ;;
13124 *) case "$usethreads" in
13125 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13132 *) getlogin_r_proto=0
13136 : see if getmnt exists
13137 set getmnt d_getmnt
13140 : see if getmntent exists
13141 set getmntent d_getmntent
13144 : see if getnetbyaddr exists
13145 set getnetbyaddr d_getnbyaddr
13148 : see if getnetbyname exists
13149 set getnetbyname d_getnbyname
13152 : see if getnetent exists
13153 set getnetent d_getnent
13156 : see if getnetbyaddr_r exists
13157 set getnetbyaddr_r d_getnetbyaddr_r
13159 case "$d_getnetbyaddr_r" in
13161 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13162 case "$d_getnetbyaddr_r_proto:$usethreads" in
13163 ":define") d_getnetbyaddr_r_proto=define
13164 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13168 case "$d_getnetbyaddr_r_proto" in
13170 case "$getnetbyaddr_r_proto" in
13171 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13172 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13174 case "$getnetbyaddr_r_proto" in
13175 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13176 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13178 case "$getnetbyaddr_r_proto" in
13179 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13180 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13182 case "$getnetbyaddr_r_proto" in
13183 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13184 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13186 case "$getnetbyaddr_r_proto" in
13187 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13188 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13190 case "$getnetbyaddr_r_proto" in
13191 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13192 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13194 case "$getnetbyaddr_r_proto" in
13195 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13196 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13198 case "$getnetbyaddr_r_proto" in
13199 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13200 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13202 case "$getnetbyaddr_r_proto" in
13203 ''|0) d_getnetbyaddr_r=undef
13204 getnetbyaddr_r_proto=0
13205 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13206 * ) case "$getnetbyaddr_r_proto" in
13207 REENTRANT_PROTO*) ;;
13208 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13210 echo "Prototype: $try" ;;
13213 *) case "$usethreads" in
13214 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13216 d_getnetbyaddr_r=undef
13217 getnetbyaddr_r_proto=0
13221 *) getnetbyaddr_r_proto=0
13225 : see if getnetbyname_r exists
13226 set getnetbyname_r d_getnetbyname_r
13228 case "$d_getnetbyname_r" in
13230 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13231 case "$d_getnetbyname_r_proto:$usethreads" in
13232 ":define") d_getnetbyname_r_proto=define
13233 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13237 case "$d_getnetbyname_r_proto" in
13239 case "$getnetbyname_r_proto" in
13240 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13241 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13243 case "$getnetbyname_r_proto" in
13244 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13245 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13247 case "$getnetbyname_r_proto" in
13248 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13249 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13251 case "$getnetbyname_r_proto" in
13252 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13253 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13255 case "$getnetbyname_r_proto" in
13256 ''|0) d_getnetbyname_r=undef
13257 getnetbyname_r_proto=0
13258 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13259 * ) case "$getnetbyname_r_proto" in
13260 REENTRANT_PROTO*) ;;
13261 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13263 echo "Prototype: $try" ;;
13266 *) case "$usethreads" in
13267 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13269 d_getnetbyname_r=undef
13270 getnetbyname_r_proto=0
13274 *) getnetbyname_r_proto=0
13278 : see if getnetent_r exists
13279 set getnetent_r d_getnetent_r
13281 case "$d_getnetent_r" in
13283 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13284 case "$d_getnetent_r_proto:$usethreads" in
13285 ":define") d_getnetent_r_proto=define
13286 set d_getnetent_r_proto getnetent_r $hdrs
13290 case "$d_getnetent_r_proto" in
13292 case "$getnetent_r_proto" in
13293 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13294 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13296 case "$getnetent_r_proto" in
13297 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13298 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13300 case "$getnetent_r_proto" in
13301 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13302 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13304 case "$getnetent_r_proto" in
13305 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13306 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13308 case "$getnetent_r_proto" in
13309 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13310 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13312 case "$getnetent_r_proto" in
13313 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13314 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13316 case "$getnetent_r_proto" in
13317 ''|0) d_getnetent_r=undef
13318 getnetent_r_proto=0
13319 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13320 * ) case "$getnetent_r_proto" in
13321 REENTRANT_PROTO*) ;;
13322 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13324 echo "Prototype: $try" ;;
13327 *) case "$usethreads" in
13328 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13330 d_getnetent_r=undef
13331 getnetent_r_proto=0
13335 *) getnetent_r_proto=0
13339 : see if prototypes for various getnetxxx netdb.h functions are available
13341 set d_getnetprotos getnetent $i_netdb netdb.h
13344 : see if getpagesize exists
13345 set getpagesize d_getpagsz
13349 : see if getprotobyname exists
13350 set getprotobyname d_getpbyname
13353 : see if getprotobynumber exists
13354 set getprotobynumber d_getpbynumber
13357 : see if getprotoent exists
13358 set getprotoent d_getpent
13361 : see if getpgid exists
13362 set getpgid d_getpgid
13365 : see if getpgrp2 exists
13366 set getpgrp2 d_getpgrp2
13369 : see if getppid exists
13370 set getppid d_getppid
13373 : see if getpriority exists
13374 set getpriority d_getprior
13377 : see if getprotobyname_r exists
13378 set getprotobyname_r d_getprotobyname_r
13380 case "$d_getprotobyname_r" in
13382 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13383 case "$d_getprotobyname_r_proto:$usethreads" in
13384 ":define") d_getprotobyname_r_proto=define
13385 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13389 case "$d_getprotobyname_r_proto" in
13391 case "$getprotobyname_r_proto" in
13392 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13393 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13395 case "$getprotobyname_r_proto" in
13396 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13397 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13399 case "$getprotobyname_r_proto" in
13400 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13401 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13403 case "$getprotobyname_r_proto" in
13404 ''|0) d_getprotobyname_r=undef
13405 getprotobyname_r_proto=0
13406 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13407 * ) case "$getprotobyname_r_proto" in
13408 REENTRANT_PROTO*) ;;
13409 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13411 echo "Prototype: $try" ;;
13414 *) case "$usethreads" in
13415 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13417 d_getprotobyname_r=undef
13418 getprotobyname_r_proto=0
13422 *) getprotobyname_r_proto=0
13426 : see if getprotobynumber_r exists
13427 set getprotobynumber_r d_getprotobynumber_r
13429 case "$d_getprotobynumber_r" in
13431 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13432 case "$d_getprotobynumber_r_proto:$usethreads" in
13433 ":define") d_getprotobynumber_r_proto=define
13434 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13438 case "$d_getprotobynumber_r_proto" in
13440 case "$getprotobynumber_r_proto" in
13441 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13442 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13444 case "$getprotobynumber_r_proto" in
13445 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13446 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13448 case "$getprotobynumber_r_proto" in
13449 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13450 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13452 case "$getprotobynumber_r_proto" in
13453 ''|0) d_getprotobynumber_r=undef
13454 getprotobynumber_r_proto=0
13455 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13456 * ) case "$getprotobynumber_r_proto" in
13457 REENTRANT_PROTO*) ;;
13458 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13460 echo "Prototype: $try" ;;
13463 *) case "$usethreads" in
13464 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13466 d_getprotobynumber_r=undef
13467 getprotobynumber_r_proto=0
13471 *) getprotobynumber_r_proto=0
13475 : see if getprotoent_r exists
13476 set getprotoent_r d_getprotoent_r
13478 case "$d_getprotoent_r" in
13480 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13481 case "$d_getprotoent_r_proto:$usethreads" in
13482 ":define") d_getprotoent_r_proto=define
13483 set d_getprotoent_r_proto getprotoent_r $hdrs
13487 case "$d_getprotoent_r_proto" in
13489 case "$getprotoent_r_proto" in
13490 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13491 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13493 case "$getprotoent_r_proto" in
13494 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13495 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13497 case "$getprotoent_r_proto" in
13498 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13499 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13501 case "$getprotoent_r_proto" in
13502 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13503 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13505 case "$getprotoent_r_proto" in
13506 ''|0) d_getprotoent_r=undef
13507 getprotoent_r_proto=0
13508 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13509 * ) case "$getprotoent_r_proto" in
13510 REENTRANT_PROTO*) ;;
13511 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13513 echo "Prototype: $try" ;;
13516 *) case "$usethreads" in
13517 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13519 d_getprotoent_r=undef
13520 getprotoent_r_proto=0
13524 *) getprotoent_r_proto=0
13528 : see if prototypes for various getprotoxxx netdb.h functions are available
13530 set d_getprotoprotos getprotoent $i_netdb netdb.h
13533 : see if getprpwnam exists
13534 set getprpwnam d_getprpwnam
13537 : see if getpwent exists
13538 set getpwent d_getpwent
13541 : see if getpwent_r exists
13542 set getpwent_r d_getpwent_r
13544 case "$d_getpwent_r" in
13546 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13547 case "$d_getpwent_r_proto:$usethreads" in
13548 ":define") d_getpwent_r_proto=define
13549 set d_getpwent_r_proto getpwent_r $hdrs
13553 case "$d_getpwent_r_proto" in
13555 case "$getpwent_r_proto" in
13556 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13557 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13559 case "$getpwent_r_proto" in
13560 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13561 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13563 case "$getpwent_r_proto" in
13564 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13565 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13567 case "$getpwent_r_proto" in
13568 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13569 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13571 case "$getpwent_r_proto" in
13572 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13573 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13575 case "$getpwent_r_proto" in
13576 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13577 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13579 case "$getpwent_r_proto" in
13580 ''|0) d_getpwent_r=undef
13582 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13583 * ) case "$getpwent_r_proto" in
13584 REENTRANT_PROTO*) ;;
13585 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13587 echo "Prototype: $try" ;;
13590 *) case "$usethreads" in
13591 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13598 *) getpwent_r_proto=0
13602 : see if getpwnam_r exists
13603 set getpwnam_r d_getpwnam_r
13605 case "$d_getpwnam_r" in
13607 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13608 case "$d_getpwnam_r_proto:$usethreads" in
13609 ":define") d_getpwnam_r_proto=define
13610 set d_getpwnam_r_proto getpwnam_r $hdrs
13614 case "$d_getpwnam_r_proto" in
13616 case "$getpwnam_r_proto" in
13617 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13618 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13620 case "$getpwnam_r_proto" in
13621 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13622 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13624 case "$getpwnam_r_proto" in
13625 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13626 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13628 case "$getpwnam_r_proto" in
13629 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13630 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13632 case "$getpwnam_r_proto" in
13633 ''|0) d_getpwnam_r=undef
13635 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13636 * ) case "$getpwnam_r_proto" in
13637 REENTRANT_PROTO*) ;;
13638 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13640 echo "Prototype: $try" ;;
13643 *) case "$usethreads" in
13644 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13651 *) getpwnam_r_proto=0
13655 : see if getpwuid_r exists
13656 set getpwuid_r d_getpwuid_r
13658 case "$d_getpwuid_r" in
13660 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13661 case "$d_getpwuid_r_proto:$usethreads" in
13662 ":define") d_getpwuid_r_proto=define
13663 set d_getpwuid_r_proto getpwuid_r $hdrs
13667 case "$d_getpwuid_r_proto" in
13669 case "$getpwuid_r_proto" in
13670 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13671 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13673 case "$getpwuid_r_proto" in
13674 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13675 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13677 case "$getpwuid_r_proto" in
13678 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13679 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13681 case "$getpwuid_r_proto" in
13682 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13683 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13685 case "$getpwuid_r_proto" in
13686 ''|0) d_getpwuid_r=undef
13688 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13689 * ) case "$getpwuid_r_proto" in
13690 REENTRANT_PROTO*) ;;
13691 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13693 echo "Prototype: $try" ;;
13696 *) case "$usethreads" in
13697 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13704 *) getpwuid_r_proto=0
13709 : see if getservbyname exists
13710 set getservbyname d_getsbyname
13713 : see if getservbyport exists
13714 set getservbyport d_getsbyport
13717 : see if getservent exists
13718 set getservent d_getsent
13721 : see if getservbyname_r exists
13722 set getservbyname_r d_getservbyname_r
13724 case "$d_getservbyname_r" in
13726 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13727 case "$d_getservbyname_r_proto:$usethreads" in
13728 ":define") d_getservbyname_r_proto=define
13729 set d_getservbyname_r_proto getservbyname_r $hdrs
13733 case "$d_getservbyname_r_proto" in
13735 case "$getservbyname_r_proto" in
13736 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13737 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13739 case "$getservbyname_r_proto" in
13740 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13741 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13743 case "$getservbyname_r_proto" in
13744 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13745 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13747 case "$getservbyname_r_proto" in
13748 ''|0) d_getservbyname_r=undef
13749 getservbyname_r_proto=0
13750 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13751 * ) case "$getservbyname_r_proto" in
13752 REENTRANT_PROTO*) ;;
13753 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13755 echo "Prototype: $try" ;;
13758 *) case "$usethreads" in
13759 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13761 d_getservbyname_r=undef
13762 getservbyname_r_proto=0
13766 *) getservbyname_r_proto=0
13770 : see if getservbyport_r exists
13771 set getservbyport_r d_getservbyport_r
13773 case "$d_getservbyport_r" in
13775 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13776 case "$d_getservbyport_r_proto:$usethreads" in
13777 ":define") d_getservbyport_r_proto=define
13778 set d_getservbyport_r_proto getservbyport_r $hdrs
13782 case "$d_getservbyport_r_proto" in
13784 case "$getservbyport_r_proto" in
13785 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13786 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13788 case "$getservbyport_r_proto" in
13789 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13790 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13792 case "$getservbyport_r_proto" in
13793 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13794 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13796 case "$getservbyport_r_proto" in
13797 ''|0) d_getservbyport_r=undef
13798 getservbyport_r_proto=0
13799 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13800 * ) case "$getservbyport_r_proto" in
13801 REENTRANT_PROTO*) ;;
13802 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13804 echo "Prototype: $try" ;;
13807 *) case "$usethreads" in
13808 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13810 d_getservbyport_r=undef
13811 getservbyport_r_proto=0
13815 *) getservbyport_r_proto=0
13819 : see if getservent_r exists
13820 set getservent_r d_getservent_r
13822 case "$d_getservent_r" in
13824 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13825 case "$d_getservent_r_proto:$usethreads" in
13826 ":define") d_getservent_r_proto=define
13827 set d_getservent_r_proto getservent_r $hdrs
13831 case "$d_getservent_r_proto" in
13833 case "$getservent_r_proto" in
13834 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13835 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13837 case "$getservent_r_proto" in
13838 ''|0) try='int getservent_r(struct servent*, char*, int);'
13839 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13841 case "$getservent_r_proto" in
13842 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13843 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13845 case "$getservent_r_proto" in
13846 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13847 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13849 case "$getservent_r_proto" in
13850 ''|0) d_getservent_r=undef
13851 getservent_r_proto=0
13852 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13853 * ) case "$getservent_r_proto" in
13854 REENTRANT_PROTO*) ;;
13855 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13857 echo "Prototype: $try" ;;
13860 *) case "$usethreads" in
13861 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13863 d_getservent_r=undef
13864 getservent_r_proto=0
13868 *) getservent_r_proto=0
13872 : see if prototypes for various getservxxx netdb.h functions are available
13874 set d_getservprotos getservent $i_netdb netdb.h
13877 : see if getspnam exists
13878 set getspnam d_getspnam
13881 : see if this is a shadow.h system
13882 set shadow.h i_shadow
13885 : see if getspnam_r exists
13886 set getspnam_r d_getspnam_r
13888 case "$d_getspnam_r" in
13890 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13891 case "$d_getspnam_r_proto:$usethreads" in
13892 ":define") d_getspnam_r_proto=define
13893 set d_getspnam_r_proto getspnam_r $hdrs
13897 case "$d_getspnam_r_proto" in
13899 case "$getspnam_r_proto" in
13900 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13901 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13903 case "$getspnam_r_proto" in
13904 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13905 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13907 case "$getspnam_r_proto" in
13908 ''|0) d_getspnam_r=undef
13910 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13911 * ) case "$getspnam_r_proto" in
13912 REENTRANT_PROTO*) ;;
13913 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13915 echo "Prototype: $try" ;;
13918 *) case "$usethreads" in
13919 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13926 *) getspnam_r_proto=0
13930 : see if gettimeofday or ftime exists
13931 set gettimeofday d_gettimeod
13933 case "$d_gettimeod" in
13939 val="$undef"; set d_ftime; eval $setvar
13942 case "$d_gettimeod$d_ftime" in
13945 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13949 : see if gmtime_r exists
13950 set gmtime_r d_gmtime_r
13952 case "$d_gmtime_r" in
13954 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13955 case "$d_gmtime_r_proto:$usethreads" in
13956 ":define") d_gmtime_r_proto=define
13957 set d_gmtime_r_proto gmtime_r $hdrs
13961 case "$d_gmtime_r_proto" in
13963 case "$gmtime_r_proto" in
13964 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13965 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13967 case "$gmtime_r_proto" in
13968 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13969 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13971 case "$gmtime_r_proto" in
13972 ''|0) d_gmtime_r=undef
13974 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13975 * ) case "$gmtime_r_proto" in
13976 REENTRANT_PROTO*) ;;
13977 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13979 echo "Prototype: $try" ;;
13982 *) case "$usethreads" in
13983 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13990 *) gmtime_r_proto=0
13994 : see if hasmntopt exists
13995 set hasmntopt d_hasmntopt
13998 : see if this is a netinet/in.h or sys/in.h system
13999 set netinet/in.h i_niin sys/in.h i_sysin
14002 : see if arpa/inet.h has to be included
14003 set arpa/inet.h i_arpainet
14006 : see if htonl --and friends-- exists
14011 : Maybe they are macros.
14014 $cat >htonl.c <<EOM
14016 #include <sys/types.h>
14017 #$i_niin I_NETINET_IN
14019 #$i_arpainet I_ARPA_INET
14020 #ifdef I_NETINET_IN
14021 #include <netinet/in.h>
14024 #include <sys/in.h>
14027 #include <arpa/inet.h>
14030 printf("Defined as a macro.");
14033 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14034 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14036 echo "But it seems to be defined as a macro." >&4
14044 : see if ilogbl exists
14045 set ilogbl d_ilogbl
14050 if set index val -f; eval $csym; $val; then
14051 if set strchr val -f d_strchr; eval $csym; $val; then
14052 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14055 echo "strchr() found." >&4
14059 echo "index() found." >&4
14064 echo "index() found." >&4
14067 if set strchr val -f d_strchr; eval $csym; $val; then
14070 echo "strchr() found." >&4
14072 echo "No index() or strchr() found!" >&4
14077 set d_strchr; eval $setvar
14079 set d_index; eval $setvar
14081 : check whether inet_aton exists
14082 set inet_aton d_inetaton
14087 $cat >isascii.c <<EOCP
14090 #$i_stdlib I_STDLIB
14092 #include <stdlib.h>
14103 if eval $compile; then
14104 echo "isascii() found." >&4
14107 echo "isascii() NOT found." >&4
14114 : see if isfinite exists
14115 set isfinite d_isfinite
14118 : see if isinf exists
14122 : see if isnan exists
14126 : see if isnanl exists
14127 set isnanl d_isnanl
14130 : see if killpg exists
14131 set killpg d_killpg
14134 : see if lchown exists
14136 $cat > try.c <<'EOCP'
14137 /* System header to define __stub macros and hopefully few prototypes,
14138 which can conflict with char lchown(); below. */
14139 #include <assert.h>
14140 /* Override any gcc2 internal prototype to avoid an error. */
14141 /* We use char because int might match the return type of a gcc2
14142 builtin and then its argument prototype would still apply. */
14145 /* The GNU C library defines this for functions which it implements
14146 to always fail with ENOSYS. Some functions are actually named
14147 something starting with __ and the normal name is an alias. */
14148 #if defined (__stub_lchown) || defined (__stub___lchown)
14156 if eval $compile; then
14157 $echo "lchown() found." >&4
14160 $echo "lchown() NOT found." >&4
14166 : See if number of significant digits in a double precision number is known
14168 $cat >ldbl_dig.c <<EOM
14169 #$i_limits I_LIMITS
14172 #include <limits.h>
14178 printf("Contains LDBL_DIG");
14181 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14182 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14183 echo "LDBL_DIG found." >&4
14186 echo "LDBL_DIG NOT found." >&4
14193 : see if this is a math.h system
14197 d_libm_lib_version="$undef"
14200 : check to see if math.h defines _LIB_VERSION
14202 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14204 #include <unistd.h>
14206 int main (int argc, char *argv[])
14208 printf ("%d\n", _LIB_VERSION);
14213 if eval $compile; then
14215 echo "Yes, it does ($foo)" >&4
14216 d_libm_lib_version="$define"
14218 echo "No, it does not (probably harmless)\n" >&4
14220 $rm -f try.* try core core.try.*
14225 : see if link exists
14229 : see if localtime_r exists
14230 set localtime_r d_localtime_r
14232 case "$d_localtime_r" in
14234 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14235 case "$d_localtime_r_proto:$usethreads" in
14236 ":define") d_localtime_r_proto=define
14237 set d_localtime_r_proto localtime_r $hdrs
14241 case "$d_localtime_r_proto" in
14243 case "$localtime_r_proto" in
14244 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14245 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14247 case "$localtime_r_proto" in
14248 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14249 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14251 case "$localtime_r_proto" in
14252 ''|0) d_localtime_r=undef
14253 localtime_r_proto=0
14254 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14255 * ) case "$localtime_r_proto" in
14256 REENTRANT_PROTO*) ;;
14257 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14259 echo "Prototype: $try" ;;
14262 *) case "$usethreads" in
14263 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14265 d_localtime_r=undef
14266 localtime_r_proto=0
14270 *) localtime_r_proto=0
14274 : see if localeconv exists
14275 set localeconv d_locconv
14278 : see if lockf exists
14282 : see if prototype for lseek is available
14284 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14287 : see if lstat exists
14291 : see if madvise exists
14292 set madvise d_madvise
14295 : see if malloc_size exists
14296 set malloc_size d_malloc_size
14299 : see if malloc_size_good exists
14300 set malloc_good_size d_malloc_good_size
14303 : see if mblen exists
14307 : see if mbstowcs exists
14308 set mbstowcs d_mbstowcs
14311 : see if mbtowc exists
14312 set mbtowc d_mbtowc
14315 : see if memchr exists
14316 set memchr d_memchr
14319 : see if memcmp exists
14320 set memcmp d_memcmp
14323 : see if memcpy exists
14324 set memcpy d_memcpy
14327 : see if memmove exists
14328 set memmove d_memmove
14331 : see if memset exists
14332 set memset d_memset
14335 : see if mkdir exists
14339 : see if mkdtemp exists
14340 set mkdtemp d_mkdtemp
14343 : see if mkfifo exists
14344 set mkfifo d_mkfifo
14347 : see if mkstemp exists
14348 set mkstemp d_mkstemp
14351 : see if mkstemps exists
14352 set mkstemps d_mkstemps
14355 : see if mktime exists
14356 set mktime d_mktime
14359 : see if this is a sys/mman.h system
14360 set sys/mman.h i_sysmman
14363 : see if mmap exists
14366 : see what shmat returns
14367 : default to something harmless
14369 case "$i_sysmman$d_mmap" in
14371 $cat >mmap.c <<'END'
14372 #include <sys/mman.h>
14375 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14380 echo "and it returns ($mmaptype)." >&4
14386 : see if sqrtl exists
14390 : see if scalbnl exists
14391 set scalbnl d_scalbnl
14394 : see if modfl exists
14398 : see if prototype for modfl is available
14400 set d_modflproto modfl $i_math math.h
14403 d_modfl_pow32_bug="$undef"
14405 case "$d_longdbl$d_modfl" in
14408 Checking to see whether your modfl() is okay for large values...
14414 if $test "X$d_modflproto" != "X$define"; then
14415 $cat >>try.c <<EOCP
14416 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14417 long double modfl (long double, long double *);
14420 $cat >>try.c <<EOCP
14422 long double nv = 4294967303.15;
14428 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14432 case "$osname:$gccversion" in
14433 aix:) saveccflags="$ccflags"
14434 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14437 if eval $compile; then
14440 *" 4294967303.150000 1.150000 4294967302.000000")
14441 echo >&4 "Your modfl() is broken for large values."
14442 d_modfl_pow32_bug="$define"
14444 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14448 *" 4294967303.150000 0.150000 4294967303.000000")
14449 echo >&4 "Your modfl() seems okay for large values."
14451 *) echo >&4 "I don't understand your modfl() at all."
14455 $rm -f try.* try core core.try.*
14457 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14460 case "$osname:$gccversion" in
14461 aix:) ccflags="$saveccflags" ;; # restore
14466 if $test "$uselongdouble" = "$define"; then
14468 if $test "$d_sqrtl" != "$define"; then
14469 message="$message sqrtl"
14471 if $test "$d_modfl" != "$define"; then
14472 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14473 echo "You have both aintl and copysignl, so I can emulate modfl."
14475 message="$message modfl"
14478 if $test "$d_frexpl" != "$define"; then
14479 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14480 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14482 message="$message frexpl"
14486 if $test "$message" != ""; then
14489 *** You requested the use of long doubles but you do not seem to have
14490 *** the following mathematical functions needed for long double support:
14492 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14493 *** Cannot continue, aborting.
14501 : see if mprotect exists
14502 set mprotect d_mprotect
14505 : see if msgctl exists
14506 set msgctl d_msgctl
14509 : see if msgget exists
14510 set msgget d_msgget
14513 : see if msgsnd exists
14514 set msgsnd d_msgsnd
14517 : see if msgrcv exists
14518 set msgrcv d_msgrcv
14521 : see how much of the 'msg*(2)' library is present.
14524 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14525 *"$undef"*) h_msg=false;;
14529 case "`ipcs 2>&1`" in
14530 "SVID messages"*"not configured"*)
14531 echo "Your $osname does not have the msg*(2) configured." >&4
14534 set msgctl d_msgctl
14536 set msgget d_msgget
14538 set msgsnd d_msgsnd
14540 set msgrcv d_msgrcv
14546 : we could also check for sys/ipc.h ...
14547 if $h_msg && $test `./findhdr sys/msg.h`; then
14548 echo "You have the full msg*(2) library." >&4
14551 echo "You don't have the full msg*(2) library." >&4
14559 echo "Checking to see if your system supports struct msghdr..." >&4
14560 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14562 case "$d_msghdr_s" in
14563 "$define") echo "Yes, it does." ;;
14564 *) echo "No, it doesn't." ;;
14568 : see if msync exists
14572 : see if munmap exists
14573 set munmap d_munmap
14576 : see if nice exists
14580 : see if this is a langinfo.h system
14581 set langinfo.h i_langinfo
14584 : see if nl_langinfo exists
14585 set nl_langinfo d_nl_langinfo
14588 : check for length of character
14590 case "$charsize" in
14592 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14595 #$i_stdlib I_STDLIB
14597 #include <stdlib.h>
14601 printf("%d\n", (int)sizeof(char));
14606 if eval $compile_ok; then
14610 echo "(I can't seem to compile the test program. Guessing...)"
14617 rp="What is the size of a character (in bytes)?"
14622 : check for volatile keyword
14624 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14625 $cat >try.c <<'EOCP'
14628 typedef struct _goo_struct goo_struct;
14629 goo_struct * volatile goo = ((goo_struct *)0);
14630 struct _goo_struct {
14635 typedef unsigned short foo_t;
14636 char *volatile foo;
14638 volatile foo_t blech;
14642 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14644 echo "Yup, it does."
14647 echo "Nope, it doesn't."
14655 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14657 case "$use64bitint:$d_quad:$quadtype" in
14660 uvtype="$uquadtype"
14665 uvtype="unsigned long"
14671 case "$uselongdouble:$d_longdbl" in
14673 nvtype="long double"
14674 nvsize=$longdblsize
14681 $echo "(IV will be "$ivtype", $ivsize bytes)"
14682 $echo "(UV will be "$uvtype", $uvsize bytes)"
14683 $echo "(NV will be "$nvtype", $nvsize bytes)"
14686 #$i_inttypes I_INTTYPES
14688 #include <inttypes.h>
14693 int8_t i = INT8_MAX;
14694 uint8_t u = UINT8_MAX;
14695 printf("int8_t\n");
14698 int16_t i = INT16_MAX;
14699 uint16_t i = UINT16_MAX;
14700 printf("int16_t\n");
14703 int32_t i = INT32_MAX;
14704 uint32_t u = UINT32_MAX;
14705 printf("int32_t\n");
14711 '') case "$charsize" in
14713 u8type="unsigned char"
14722 if eval $compile; then
14723 case "`$run ./try`" in
14724 int8_t) i8type=int8_t
14734 '') if $test $charsize -ge 1; then
14736 u8type="unsigned char"
14744 '') case "$shortsize" in
14746 u16type="unsigned short"
14754 '') set try -DINT16
14755 if eval $compile; then
14756 case "`$run ./try`" in
14768 '') if $test $shortsize -ge 2; then
14770 u16type="unsigned short"
14778 '') case "$longsize" in
14780 u32type="unsigned long"
14784 *) case "$intsize" in
14786 u32type="unsigned int"
14796 '') set try -DINT32
14797 if eval $compile; then
14798 case "`$run ./try`" in
14810 '') if $test $intsize -ge 4; then
14812 u32type="unsigned int"
14820 '') case "$d_quad:$quadtype" in
14822 i64type="$quadtype"
14823 u64type="$uquadtype"
14831 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14832 : volatile so that the compiler has to store it out to memory.
14833 if test X"$d_volatile" = X"$define"; then
14838 #$i_stdlib I_STDLIB
14840 #include <stdlib.h>
14842 #include <sys/types.h>
14843 #include <signal.h>
14845 $volatile int bletched = 0;
14846 $signal_t blech(s) int s; { bletched = 1; }
14851 int n = 8 * $uvsize;
14854 signal(SIGFPE, blech);
14857 for (i = 0; i < n; i++) {
14858 u = u << 1 | ($uvtype)1;
14860 if (($uvtype)d != u)
14864 d = ($nvtype)(u - 1);
14865 if (($uvtype)d != (u - 1))
14873 printf("%d\n", ((i == n) ? -n : i));
14879 d_nv_preserves_uv="$undef"
14880 if eval $compile; then
14881 nv_preserves_uv_bits="`$run ./try`"
14883 case "$nv_preserves_uv_bits" in
14885 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14886 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14887 d_nv_preserves_uv="$define"
14889 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14890 d_nv_preserves_uv="$undef" ;;
14891 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14892 nv_preserves_uv_bits="$undef" ;;
14897 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14898 : volatile so that the compiler has to store it out to memory.
14899 if test X"$d_volatile" = X"$define"; then
14904 #$i_stdlib I_STDLIB
14906 #include <stdlib.h>
14908 #$i_string I_STRING
14910 # include <string.h>
14912 # include <strings.h>
14914 #include <sys/types.h>
14915 #include <signal.h>
14917 $volatile int bletched = 0;
14918 $signal_t blech(s) int s; { bletched = 1; }
14921 int checkit($nvtype d, char *where) {
14922 unsigned char *p = (char *)&d;
14923 unsigned char *end = p + sizeof(d);
14933 printf("No - %s: 0x", where);
14935 printf ("%02X", *p++);
14940 int main(int argc, char **argv) {
14943 fail += checkit(d, "0.0");
14945 /* The compiler shouldn't be assuming that bletched is 0 */
14948 fail += checkit(d, "bleched");
14951 signal(SIGFPE, blech);
14954 /* Paranoia - the compiler should have no way of knowing that ANSI says
14955 that argv[argc] will always be NULL. Actually, if it did assume this it
14956 would be buggy, as this is C and main() can be called from elsewhere in
14958 d = argv[argc] ? 1 : 0;
14961 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
14964 fail += checkit(d, "ternary");
14966 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
14969 printf("No - memset doesn't give 0.0\n");
14970 /* This might just blow up: */
14971 printf("(gives %g)\n", d);
14977 printf("No - something bleched\n");
14982 printf("No - %d fail(s)\n", fail);
14991 d_nv_zero_is_allbits_zero="$undef"
14992 if eval $compile; then
14998 0.0 is represented as all bits zero in memory
15000 d_nv_zero_is_allbits_zero="$define"
15003 0.0 is not represented as all bits zero in memory
15005 d_nv_zero_is_allbits_zero="$undef"
15010 0.0 is not represented as all bits zero in memory
15012 d_nv_zero_is_allbits_zero="$undef"
15020 : check for off64_t
15022 echo "Checking to see if you have off64_t..." >&4
15024 #include <sys/types.h>
15025 #include <unistd.h>
15026 int main() { off64_t x = 7; }
15029 if eval $compile; then
15031 echo "You have off64_t."
15034 echo "You do not have off64_t."
15035 case "$lseeksize" in
15036 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15043 : how to create joinable pthreads
15044 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15046 echo "Checking what constant to use for creating joinable pthreads..." >&4
15047 $cat >try.c <<'EOCP'
15048 #include <pthread.h>
15050 int detachstate = JOINABLE;
15053 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15054 if eval $compile; then
15055 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15056 val="$undef" # Yes, undef.
15057 set d_old_pthread_create_joinable
15060 set old_pthread_create_joinable
15063 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15064 if eval $compile; then
15065 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15067 set d_old_pthread_create_joinable
15069 val=PTHREAD_CREATE_UNDETACHED
15070 set old_pthread_create_joinable
15073 set try -DJOINABLE=__UNDETACHED
15074 if eval $compile; then
15075 echo "You seem to use __UNDETACHED." >&4
15077 set d_old_pthread_create_joinable
15080 set old_pthread_create_joinable
15083 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15085 set d_old_pthread_create_joinable
15088 set old_pthread_create_joinable
15095 d_old_pthread_create_joinable="$undef"
15096 old_pthread_create_joinable=""
15099 : see if pause exists
15103 : see if pipe exists
15107 : see if poll exists
15111 : see if readlink exists
15112 set readlink d_readlink
15118 case "$d_readlink" in
15120 if $issymlink /proc/self/exe ; then
15121 $ls -l /proc/self/exe > reflect
15122 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15123 echo "You have Linux-like /proc/self/exe."
15124 procselfexe='"/proc/self/exe"'
15128 if $issymlink /proc/curproc/file ; then
15129 $ls -l /proc/curproc/file > reflect
15130 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15131 echo "You have BSD-like /proc/curproc/file."
15132 procselfexe='"/proc/curproc/file"'
15142 : see whether the pthread_atfork exists
15144 #include <pthread.h>
15147 #ifdef PTHREAD_ATFORK
15148 pthread_atfork(NULL,NULL,NULL);
15153 : see if pthread_atfork exists
15154 set try -DPTHREAD_ATFORK
15155 if eval $compile; then
15160 case "$usethreads" in
15163 $define) echo 'pthread_atfork found.' >&4 ;;
15164 *) echo 'pthread_atfork NOT found.' >&4 ;;
15167 set d_pthread_atfork
15170 : see if pthread_attr_setscope exists
15171 set pthread_attr_setscope d_pthread_attr_setscope
15175 : see whether the various POSIXish _yields exist
15177 #include <pthread.h>
15183 #ifdef PTHREAD_YIELD
15186 #ifdef PTHREAD_YIELD_NULL
15187 pthread_yield(NULL);
15193 : see if sched_yield exists
15194 set try -DSCHED_YIELD
15195 if eval $compile; then
15197 sched_yield='sched_yield()'
15201 case "$usethreads" in
15204 $define) echo 'sched_yield() found.' >&4 ;;
15205 *) echo 'sched_yield() NOT found.' >&4 ;;
15211 : see if pthread_yield exists
15212 set try -DPTHREAD_YIELD
15213 if eval $compile; then
15215 case "$sched_yield" in
15216 '') sched_yield='pthread_yield()' ;;
15219 set try -DPTHREAD_YIELD_NULL
15220 if eval $compile; then
15222 case "$sched_yield" in
15223 '') sched_yield='pthread_yield(NULL)' ;;
15229 case "$usethreads" in
15232 $define) echo 'pthread_yield() found.' >&4 ;;
15233 *) echo 'pthread_yield() NOT found.' >&4 ;;
15237 set d_pthread_yield
15240 case "$sched_yield" in
15241 '') sched_yield=undef ;;
15246 : see if random_r exists
15247 set random_r d_random_r
15249 case "$d_random_r" in
15251 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15252 case "$d_random_r_proto:$usethreads" in
15253 ":define") d_random_r_proto=define
15254 set d_random_r_proto random_r $hdrs
15258 case "$d_random_r_proto" in
15260 case "$random_r_proto" in
15261 ''|0) try='int random_r(int*, struct random_data*);'
15262 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15264 case "$random_r_proto" in
15265 ''|0) try='int random_r(long*, struct random_data*);'
15266 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15268 case "$random_r_proto" in
15269 ''|0) try='int random_r(struct random_data*, int32_t*);'
15270 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15272 case "$random_r_proto" in
15273 ''|0) d_random_r=undef
15275 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15276 * ) case "$random_r_proto" in
15277 REENTRANT_PROTO*) ;;
15278 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15280 echo "Prototype: $try" ;;
15283 *) case "$usethreads" in
15284 define) echo "random_r has no prototype, not using it." >&4 ;;
15291 *) random_r_proto=0
15295 : see if readdir and friends exist
15296 set readdir d_readdir
15298 set seekdir d_seekdir
15300 set telldir d_telldir
15302 set rewinddir d_rewinddir
15305 : see if readdir64_r exists
15306 set readdir64_r d_readdir64_r
15308 case "$d_readdir64_r" in
15310 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15311 case "$d_readdir64_r_proto:$usethreads" in
15312 ":define") d_readdir64_r_proto=define
15313 set d_readdir64_r_proto readdir64_r $hdrs
15317 case "$d_readdir64_r_proto" in
15319 case "$readdir64_r_proto" in
15320 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15321 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15323 case "$readdir64_r_proto" in
15324 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15325 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15327 case "$readdir64_r_proto" in
15328 ''|0) d_readdir64_r=undef
15329 readdir64_r_proto=0
15330 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15331 * ) case "$readdir64_r_proto" in
15332 REENTRANT_PROTO*) ;;
15333 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15335 echo "Prototype: $try" ;;
15338 *) case "$usethreads" in
15339 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15341 d_readdir64_r=undef
15342 readdir64_r_proto=0
15346 *) readdir64_r_proto=0
15350 : see if readdir_r exists
15351 set readdir_r d_readdir_r
15353 case "$d_readdir_r" in
15355 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15356 case "$d_readdir_r_proto:$usethreads" in
15357 ":define") d_readdir_r_proto=define
15358 set d_readdir_r_proto readdir_r $hdrs
15362 case "$d_readdir_r_proto" in
15364 case "$readdir_r_proto" in
15365 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15366 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15368 case "$readdir_r_proto" in
15369 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15370 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15372 case "$readdir_r_proto" in
15373 ''|0) d_readdir_r=undef
15375 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15376 * ) case "$readdir_r_proto" in
15377 REENTRANT_PROTO*) ;;
15378 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15380 echo "Prototype: $try" ;;
15383 *) case "$usethreads" in
15384 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15391 *) readdir_r_proto=0
15395 : see if readv exists
15399 : see if recvmsg exists
15400 set recvmsg d_recvmsg
15403 : see if rename exists
15404 set rename d_rename
15407 : see if rmdir exists
15411 : see if memory.h is available.
15416 : See if it conflicts with string.h
15422 $cppstdin $cppflags $cppminus < $strings > mem.h
15423 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15425 echo "We won't be including <memory.h>."
15435 : can bcopy handle overlapping blocks?
15438 case "$d_memmove" in
15439 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15440 *) case "$d_bcopy" in
15442 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15444 #$i_memory I_MEMORY
15445 #$i_stdlib I_STDLIB
15446 #$i_string I_STRING
15447 #$i_unistd I_UNISTD
15449 $cat >>try.c <<'EOCP'
15452 # include <memory.h>
15455 # include <stdlib.h>
15458 # include <string.h>
15460 # include <strings.h>
15463 # include <unistd.h> /* Needed for NetBSD */
15467 char buf[128], abc[128];
15473 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15474 try to store the string in read-only memory. */
15475 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15477 for (align = 7; align >= 0; align--) {
15478 for (len = 36; len; len--) {
15480 bcopy(abc, b, len);
15481 for (off = 1; off <= len; off++) {
15482 bcopy(b, b+off, len);
15483 bcopy(b+off, b, len);
15484 if (bcmp(b, abc, len))
15493 if eval $compile_ok; then
15494 if ./try 2>/dev/null; then
15495 echo "Yes, it can."
15498 echo "It can't, sorry."
15501 echo "(I can't compile the test program, so we'll assume not...)"
15505 $rm -f try.* try core
15511 : can memcpy handle overlapping blocks?
15514 case "$d_memmove" in
15515 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15516 *) case "$d_memcpy" in
15518 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15520 #$i_memory I_MEMORY
15521 #$i_stdlib I_STDLIB
15522 #$i_string I_STRING
15523 #$i_unistd I_UNISTD
15525 $cat >>try.c <<'EOCP'
15528 # include <memory.h>
15531 # include <stdlib.h>
15534 # include <string.h>
15536 # include <strings.h>
15539 # include <unistd.h> /* Needed for NetBSD */
15543 char buf[128], abc[128];
15549 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15550 try to store the string in read-only memory. */
15551 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15553 for (align = 7; align >= 0; align--) {
15554 for (len = 36; len; len--) {
15556 memcpy(b, abc, len);
15557 for (off = 1; off <= len; off++) {
15558 memcpy(b+off, b, len);
15559 memcpy(b, b+off, len);
15560 if (memcmp(b, abc, len))
15569 if eval $compile_ok; then
15570 if ./try 2>/dev/null; then
15571 echo "Yes, it can."
15574 echo "It can't, sorry."
15577 echo "(I can't compile the test program, so we'll assume not...)"
15581 $rm -f try.* try core
15587 : can memcmp be trusted to compare relative magnitude?
15589 case "$d_memcmp" in
15592 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15594 #$i_memory I_MEMORY
15595 #$i_stdlib I_STDLIB
15596 #$i_string I_STRING
15597 #$i_unistd I_UNISTD
15599 $cat >>try.c <<'EOCP'
15602 # include <memory.h>
15605 # include <stdlib.h>
15608 # include <string.h>
15610 # include <strings.h>
15613 # include <unistd.h> /* Needed for NetBSD */
15619 if ((a < b) && memcmp(&a, &b, 1) < 0)
15625 if eval $compile_ok; then
15626 if $run ./try 2>/dev/null; then
15627 echo "Yes, it can."
15630 echo "No, it can't (it uses signed chars)."
15633 echo "(I can't compile the test program, so we'll assume not...)"
15637 $rm -f try.* try core
15641 : see if prototype for sbrk is available
15643 set d_sbrkproto sbrk $i_unistd unistd.h
15646 : see if select exists
15647 set select d_select
15650 : see if semctl exists
15651 set semctl d_semctl
15654 : see if semget exists
15655 set semget d_semget
15658 : see if semop exists
15662 : see how much of the 'sem*(2)' library is present.
15665 case "$d_semctl$d_semget$d_semop" in
15666 *"$undef"*) h_sem=false;;
15670 case "`ipcs 2>&1`" in
15671 "SVID messages"*"not configured"*)
15672 echo "Your $osname does not have the sem*(2) configured." >&4
15675 set semctl d_semctl
15677 set semget d_semget
15685 : we could also check for sys/ipc.h ...
15686 if $h_sem && $test `./findhdr sys/sem.h`; then
15687 echo "You have the full sem*(2) library." >&4
15690 echo "You don't have the full sem*(2) library." >&4
15696 : see whether sys/sem.h defines union semun
15698 $cat > try.c <<'END'
15699 #include <sys/types.h>
15700 #include <sys/ipc.h>
15701 #include <sys/sem.h>
15702 int main () { union semun semun; semun.buf = 0; }
15705 if eval $compile; then
15706 echo "You have union semun in <sys/sem.h>." >&4
15709 echo "You do not have union semun in <sys/sem.h>." >&4
15716 : see how to do semctl IPC_STAT
15723 # define S_IRUSR S_IREAD
15724 # define S_IWUSR S_IWRITE
15725 # define S_IXUSR S_IEXEC
15727 # define S_IRUSR 0400
15728 # define S_IWUSR 0200
15729 # define S_IXUSR 0100
15731 # define S_IRGRP (S_IRUSR>>3)
15732 # define S_IWGRP (S_IWUSR>>3)
15733 # define S_IXGRP (S_IXUSR>>3)
15734 # define S_IROTH (S_IRUSR>>6)
15735 # define S_IWOTH (S_IWUSR>>6)
15736 # define S_IXOTH (S_IXUSR>>6)
15739 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15740 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15741 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15744 : see whether semctl IPC_STAT can use union semun
15745 case "$d_semctl_semun" in
15749 #include <sys/types.h>
15750 #include <sys/ipc.h>
15751 #include <sys/sem.h>
15752 #include <sys/stat.h>
15759 #$d_union_semun HAS_UNION_SEMUN
15762 #ifndef HAS_UNION_SEMUN
15765 struct semid_ds *buf;
15766 unsigned short *array;
15772 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15773 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15775 struct semid_ds argbuf;
15778 st = semctl(sem, 0, IPC_STAT, arg);
15782 # endif /* IPC_STAT */
15783 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15785 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15786 # endif /* IPC_RMID */
15787 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15789 #endif /* IPC_PRIVATE && ... */
15790 printf("semget failed: errno = %d\n", errno);
15795 if eval $compile; then
15798 semun) val="$define" ;;
15806 case "$d_semctl_semun" in
15808 echo "You can use union semun for semctl IPC_STAT." >&4
15811 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15816 : see whether semctl IPC_STAT can use struct semid_ds pointer
15817 case "$d_semctl_semid_ds" in
15820 $cat > try.c <<'END'
15821 #include <sys/types.h>
15822 #include <sys/ipc.h>
15823 #include <sys/sem.h>
15824 #include <sys/stat.h>
15832 struct semid_ds arg;
15835 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15836 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15839 st = semctl(sem, 0, IPC_STAT, &arg);
15841 printf("semid_ds\n");
15843 # endif /* IPC_STAT */
15844 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15846 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15847 # endif /* IPC_RMID */
15848 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15850 #endif /* IPC_PRIVATE && ... */
15851 printf("semget failed: errno = %d\n", errno);
15857 if eval $compile; then
15860 semid_ds) val="$define" ;;
15864 set d_semctl_semid_ds
15868 case "$d_semctl_semid_ds" in
15870 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15872 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15879 # We do not have the full sem*(2) library, so assume we can not
15885 set d_semctl_semid_ds
15890 : see if sendmsg exists
15891 set sendmsg d_sendmsg
15894 : see if setegid exists
15895 set setegid d_setegid
15898 : see if seteuid exists
15899 set seteuid d_seteuid
15902 : see if setgrent exists
15903 set setgrent d_setgrent
15906 : see if setgrent_r exists
15907 set setgrent_r d_setgrent_r
15909 case "$d_setgrent_r" in
15911 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15912 case "$d_setgrent_r_proto:$usethreads" in
15913 ":define") d_setgrent_r_proto=define
15914 set d_setgrent_r_proto setgrent_r $hdrs
15918 case "$d_setgrent_r_proto" in
15920 case "$setgrent_r_proto" in
15921 ''|0) try='int setgrent_r(FILE**);'
15922 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15924 case "$setgrent_r_proto" in
15925 ''|0) try='void setgrent_r(FILE**);'
15926 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15928 case "$setgrent_r_proto" in
15929 ''|0) d_setgrent_r=undef
15931 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15932 * ) case "$setgrent_r_proto" in
15933 REENTRANT_PROTO*) ;;
15934 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15936 echo "Prototype: $try" ;;
15939 *) case "$usethreads" in
15940 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15947 *) setgrent_r_proto=0
15951 : see if sethostent exists
15952 set sethostent d_sethent
15955 : see if sethostent_r exists
15956 set sethostent_r d_sethostent_r
15958 case "$d_sethostent_r" in
15960 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15961 case "$d_sethostent_r_proto:$usethreads" in
15962 ":define") d_sethostent_r_proto=define
15963 set d_sethostent_r_proto sethostent_r $hdrs
15967 case "$d_sethostent_r_proto" in
15969 case "$sethostent_r_proto" in
15970 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15971 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15973 case "$sethostent_r_proto" in
15974 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15975 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15977 case "$sethostent_r_proto" in
15978 ''|0) d_sethostent_r=undef
15979 sethostent_r_proto=0
15980 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15981 * ) case "$sethostent_r_proto" in
15982 REENTRANT_PROTO*) ;;
15983 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15985 echo "Prototype: $try" ;;
15988 *) case "$usethreads" in
15989 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15991 d_sethostent_r=undef
15992 sethostent_r_proto=0
15996 *) sethostent_r_proto=0
16000 : see if setitimer exists
16001 set setitimer d_setitimer
16004 : see if setlinebuf exists
16005 set setlinebuf d_setlinebuf
16008 : see if setlocale exists
16009 set setlocale d_setlocale
16012 : see if locale.h is available
16013 set locale.h i_locale
16016 : see if setlocale_r exists
16017 set setlocale_r d_setlocale_r
16019 case "$d_setlocale_r" in
16021 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16022 case "$d_setlocale_r_proto:$usethreads" in
16023 ":define") d_setlocale_r_proto=define
16024 set d_setlocale_r_proto setlocale_r $hdrs
16028 case "$d_setlocale_r_proto" in
16030 case "$setlocale_r_proto" in
16031 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16032 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16034 case "$setlocale_r_proto" in
16035 ''|0) d_setlocale_r=undef
16036 setlocale_r_proto=0
16037 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16038 * ) case "$setlocale_r_proto" in
16039 REENTRANT_PROTO*) ;;
16040 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16042 echo "Prototype: $try" ;;
16045 *) case "$usethreads" in
16046 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16048 d_setlocale_r=undef
16049 setlocale_r_proto=0
16053 *) setlocale_r_proto=0
16057 : see if setnetent exists
16058 set setnetent d_setnent
16061 : see if setnetent_r exists
16062 set setnetent_r d_setnetent_r
16064 case "$d_setnetent_r" in
16066 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16067 case "$d_setnetent_r_proto:$usethreads" in
16068 ":define") d_setnetent_r_proto=define
16069 set d_setnetent_r_proto setnetent_r $hdrs
16073 case "$d_setnetent_r_proto" in
16075 case "$setnetent_r_proto" in
16076 ''|0) try='int setnetent_r(int, struct netent_data*);'
16077 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16079 case "$setnetent_r_proto" in
16080 ''|0) try='void setnetent_r(int, struct netent_data*);'
16081 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16083 case "$setnetent_r_proto" in
16084 ''|0) d_setnetent_r=undef
16085 setnetent_r_proto=0
16086 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16087 * ) case "$setnetent_r_proto" in
16088 REENTRANT_PROTO*) ;;
16089 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16091 echo "Prototype: $try" ;;
16094 *) case "$usethreads" in
16095 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16097 d_setnetent_r=undef
16098 setnetent_r_proto=0
16102 *) setnetent_r_proto=0
16106 : see if setprotoent exists
16107 set setprotoent d_setpent
16110 : see if setpgid exists
16111 set setpgid d_setpgid
16114 : see if setpgrp2 exists
16115 set setpgrp2 d_setpgrp2
16118 : see if setpriority exists
16119 set setpriority d_setprior
16122 : see if setproctitle exists
16123 set setproctitle d_setproctitle
16126 : see if setprotoent_r exists
16127 set setprotoent_r d_setprotoent_r
16129 case "$d_setprotoent_r" in
16131 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16132 case "$d_setprotoent_r_proto:$usethreads" in
16133 ":define") d_setprotoent_r_proto=define
16134 set d_setprotoent_r_proto setprotoent_r $hdrs
16138 case "$d_setprotoent_r_proto" in
16140 case "$setprotoent_r_proto" in
16141 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16142 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16144 case "$setprotoent_r_proto" in
16145 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16146 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16148 case "$setprotoent_r_proto" in
16149 ''|0) d_setprotoent_r=undef
16150 setprotoent_r_proto=0
16151 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16152 * ) case "$setprotoent_r_proto" in
16153 REENTRANT_PROTO*) ;;
16154 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16156 echo "Prototype: $try" ;;
16159 *) case "$usethreads" in
16160 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16162 d_setprotoent_r=undef
16163 setprotoent_r_proto=0
16167 *) setprotoent_r_proto=0
16171 : see if setpwent exists
16172 set setpwent d_setpwent
16175 : see if setpwent_r exists
16176 set setpwent_r d_setpwent_r
16178 case "$d_setpwent_r" in
16180 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16181 case "$d_setpwent_r_proto:$usethreads" in
16182 ":define") d_setpwent_r_proto=define
16183 set d_setpwent_r_proto setpwent_r $hdrs
16187 case "$d_setpwent_r_proto" in
16189 case "$setpwent_r_proto" in
16190 ''|0) try='int setpwent_r(FILE**);'
16191 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16193 case "$setpwent_r_proto" in
16194 ''|0) try='void setpwent_r(FILE**);'
16195 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16197 case "$setpwent_r_proto" in
16198 ''|0) d_setpwent_r=undef
16200 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16201 * ) case "$setpwent_r_proto" in
16202 REENTRANT_PROTO*) ;;
16203 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16205 echo "Prototype: $try" ;;
16208 *) case "$usethreads" in
16209 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16216 *) setpwent_r_proto=0
16220 : see if setregid exists
16221 set setregid d_setregid
16223 set setresgid d_setresgid
16226 : see if setreuid exists
16227 set setreuid d_setreuid
16229 set setresuid d_setresuid
16232 : see if setrgid exists
16233 set setrgid d_setrgid
16236 : see if setruid exists
16237 set setruid d_setruid
16240 : see if setservent exists
16241 set setservent d_setsent
16244 : see if setservent_r exists
16245 set setservent_r d_setservent_r
16247 case "$d_setservent_r" in
16249 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16250 case "$d_setservent_r_proto:$usethreads" in
16251 ":define") d_setservent_r_proto=define
16252 set d_setservent_r_proto setservent_r $hdrs
16256 case "$d_setservent_r_proto" in
16258 case "$setservent_r_proto" in
16259 ''|0) try='int setservent_r(int, struct servent_data*);'
16260 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16262 case "$setservent_r_proto" in
16263 ''|0) try='void setservent_r(int, struct servent_data*);'
16264 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16266 case "$setservent_r_proto" in
16267 ''|0) d_setservent_r=undef
16268 setservent_r_proto=0
16269 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16270 * ) case "$setservent_r_proto" in
16271 REENTRANT_PROTO*) ;;
16272 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16274 echo "Prototype: $try" ;;
16277 *) case "$usethreads" in
16278 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16280 d_setservent_r=undef
16281 setservent_r_proto=0
16285 *) setservent_r_proto=0
16289 : see if setsid exists
16290 set setsid d_setsid
16293 : see if setvbuf exists
16294 set setvbuf d_setvbuf
16297 : see if sfio.h is available
16302 : see if sfio library is available
16313 : Ok, but do we want to use it.
16317 true|$define|[yY]*) dflt='y';;
16320 echo "$package can use the sfio library, but it is experimental."
16321 case "$useperlio" in
16323 echo "For sfio also the PerlIO abstraction layer is needed."
16324 echo "Earlier you said you wouldn't want that."
16327 rp="You seem to have sfio available, do you want to try using it?"
16330 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16331 useperlio="$define"
16334 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16339 *) case "$usesfio" in
16340 true|$define|[yY]*)
16341 echo "Sorry, cannot find sfio on this machine." >&4
16342 echo "Ignoring your setting of usesfio=$usesfio." >&4
16351 $define) usesfio='true';;
16352 *) usesfio='false';;
16356 *) : Remove sfio from list of libraries to use
16359 echo "Removing unneeded -lsfio from library list" >&4
16360 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16363 echo "libs = $libs" >&4
16370 : see if shmctl exists
16371 set shmctl d_shmctl
16374 : see if shmget exists
16375 set shmget d_shmget
16378 : see if shmat exists
16381 : see what shmat returns
16384 $cat >shmat.c <<'END'
16385 #include <sys/shm.h>
16388 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16393 echo "and it returns ($shmattype)." >&4
16394 : see if a prototype for shmat is available
16395 xxx=`./findhdr sys/shm.h`
16396 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16397 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16408 set d_shmatprototype
16411 : see if shmdt exists
16415 : see how much of the 'shm*(2)' library is present.
16418 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16419 *"$undef"*) h_shm=false;;
16423 case "`ipcs 2>&1`" in
16424 "SVID shared memory"*"not configured"*)
16425 echo "Your $osname does not have the shm*(2) configured." >&4
16428 set shmctl d_shmctl
16430 set shmget d_shmget
16440 : we could also check for sys/ipc.h ...
16441 if $h_shm && $test `./findhdr sys/shm.h`; then
16442 echo "You have the full shm*(2) library." >&4
16445 echo "You don't have the full shm*(2) library." >&4
16452 : see if we have sigaction
16453 if set sigaction val -f d_sigaction; eval $csym; $val; then
16454 echo 'sigaction() found.' >&4
16457 #include <sys/types.h>
16458 #include <signal.h>
16459 #$i_stdlib I_STDLIB
16461 #include <stdlib.h>
16465 struct sigaction act, oact;
16467 oact.sa_handler = 0;
16468 /* so that act and oact are used */
16469 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16473 if eval $compile_ok; then
16476 echo "But you don't seem to have a useable struct sigaction." >&4
16480 echo 'sigaction NOT found.' >&4
16483 set d_sigaction; eval $setvar
16484 $rm -f try try$_o try.c
16486 : see if sigprocmask exists
16487 set sigprocmask d_sigprocmask
16490 : see if sigsetjmp exists
16492 case "$d_sigsetjmp" in
16495 #include <setjmp.h>
16496 #$i_stdlib I_STDLIB
16498 #include <stdlib.h>
16504 if (sigsetjmp(env,1))
16507 siglongjmp(env, 1);
16512 if eval $compile; then
16513 if $run ./try >/dev/null 2>&1; then
16514 echo "POSIX sigsetjmp found." >&4
16518 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16524 echo "sigsetjmp not found." >&4
16528 *) val="$d_sigsetjmp"
16529 case "$d_sigsetjmp" in
16530 $define) echo "POSIX sigsetjmp found." >&4;;
16531 $undef) echo "sigsetjmp not found." >&4;;
16539 : see if snprintf exists
16540 set snprintf d_snprintf
16543 : see if vsnprintf exists
16544 set vsnprintf d_vsnprintf
16547 case "$d_snprintf-$d_vsnprintf" in
16550 Checking whether your snprintf() and vsnprintf() work okay...
16552 $cat >try.c <<'EOCP'
16553 /* v?snprintf testing logic courtesy of Russ Allbery.
16554 * According to C99:
16555 * - if the buffer is too short it still must be \0-terminated
16556 * - if the buffer is too short the potentially required length
16557 * must be returned and not -1
16558 * - if the buffer is NULL the potentially required length
16559 * must be returned and not -1 or core dump
16562 #include <stdarg.h>
16566 int test (char *format, ...)
16571 va_start (args, format);
16572 count = vsnprintf (buf, sizeof buf, format, args);
16579 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16580 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16584 if eval $compile; then
16587 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16589 Your snprintf() and snprintf() don't seem to be working okay.
16591 d_snprintf="$undef"
16592 d_vsnprintf="$undef"
16596 echo "(I can't seem to compile the test program--assuming they don't)"
16597 d_snprintf="$undef"
16598 d_vsnprintf="$undef"
16600 $rm -f try.* try core core.try.*
16604 : see if sockatmark exists
16605 set sockatmark d_sockatmark
16608 : see if prototype for sockatmark is available
16610 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16613 : see if socks5_init exists
16614 set socks5_init d_socks5_init
16617 : see if sprintf returns the length of the string in the buffer as per ANSI
16618 $echo "Checking whether sprintf returns the length of the string..." >&4
16621 #$i_stdlib I_STDLIB
16623 #include <stdlib.h>
16625 #$i_string I_STRING
16627 # include <string.h>
16629 # include <strings.h>
16638 int check (size_t expect, int test) {
16639 size_t got = strlen(buffer);
16643 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16648 int main(int argc, char **argv) {
16651 check(sprintf(buffer, ""), ++test);
16652 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16653 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16660 d_sprintf_returns_strlen="$undef"
16661 if eval $compile; then
16665 sprintf returns the length of the string (as ANSI says it should)
16667 d_sprintf_returns_strlen="$define"
16670 sprintf does not return the length of the string (how old is this system?)
16672 d_sprintf_returns_strlen="$undef"
16679 : see if srand48_r exists
16680 set srand48_r d_srand48_r
16682 case "$d_srand48_r" in
16684 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16685 case "$d_srand48_r_proto:$usethreads" in
16686 ":define") d_srand48_r_proto=define
16687 set d_srand48_r_proto srand48_r $hdrs
16691 case "$d_srand48_r_proto" in
16693 case "$srand48_r_proto" in
16694 ''|0) try='int srand48_r(long, struct drand48_data*);'
16695 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16697 case "$srand48_r_proto" in
16698 ''|0) d_srand48_r=undef
16700 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16701 * ) case "$srand48_r_proto" in
16702 REENTRANT_PROTO*) ;;
16703 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16705 echo "Prototype: $try" ;;
16708 *) case "$usethreads" in
16709 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16716 *) srand48_r_proto=0
16720 : see if srandom_r exists
16721 set srandom_r d_srandom_r
16723 case "$d_srandom_r" in
16725 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16726 case "$d_srandom_r_proto:$usethreads" in
16727 ":define") d_srandom_r_proto=define
16728 set d_srandom_r_proto srandom_r $hdrs
16732 case "$d_srandom_r_proto" in
16734 case "$srandom_r_proto" in
16735 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16736 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16738 case "$srandom_r_proto" in
16739 ''|0) d_srandom_r=undef
16741 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16742 * ) case "$srandom_r_proto" in
16743 REENTRANT_PROTO*) ;;
16744 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16746 echo "Prototype: $try" ;;
16749 *) case "$usethreads" in
16750 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16757 *) srandom_r_proto=0
16761 : see if prototype for setresgid is available
16763 set d_sresgproto setresgid $i_unistd unistd.h
16766 : see if prototype for setresuid is available
16768 set d_sresuproto setresuid $i_unistd unistd.h
16771 : see if sys/stat.h is available
16772 set sys/stat.h i_sysstat
16776 : see if stat knows about block sizes
16778 echo "Checking to see if your struct stat has st_blocks field..." >&4
16779 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16783 : see if this is a sys/vfs.h system
16784 set sys/vfs.h i_sysvfs
16788 : see if this is a sys/statfs.h system
16789 set sys/statfs.h i_sysstatfs
16794 echo "Checking to see if your system supports struct statfs..." >&4
16795 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
16797 case "$d_statfs_s" in
16798 "$define") echo "Yes, it does." ;;
16799 *) echo "No, it doesn't." ;;
16804 : see if struct statfs knows about f_flags
16805 case "$d_statfs_s" in
16808 echo "Checking to see if your struct statfs has f_flags field..." >&4
16809 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
16813 set d_statfs_f_flags
16817 case "$d_statfs_f_flags" in
16818 "$define") echo "Yes, it does." ;;
16819 *) echo "No, it doesn't." ;;
16823 Checking how to access stdio streams by file descriptor number...
16825 case "$stdio_stream_array" in
16826 '') $cat >try.c <<EOCP
16829 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16833 for s in _iob __iob __sF
16835 set try -DSTDIO_STREAM_ARRAY=$s
16836 if eval $compile; then
16837 case "`$run ./try`" in
16838 yes) stdio_stream_array=$s; break ;;
16842 $rm -f try.* try$exe_ext
16844 case "$stdio_stream_array" in
16846 I can't figure out how to access stdio streams by file descriptor number.
16848 d_stdio_stream_array="$undef"
16851 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16853 d_stdio_stream_array="$define"
16857 : see if strcoll exists
16858 set strcoll d_strcoll
16861 : check for structure copying
16863 echo "Checking to see if your C compiler can copy structs..." >&4
16864 $cat >try.c <<'EOCP'
16874 if $cc -c try.c >/dev/null 2>&1 ; then
16876 echo "Yup, it can."
16879 echo "Nope, it can't."
16885 : see if strerror and/or sys_errlist[] exist
16887 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16888 if set strerror val -f d_strerror; eval $csym; $val; then
16889 echo 'strerror() found.' >&4
16890 d_strerror="$define"
16891 d_strerrm='strerror(e)'
16892 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16893 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16894 d_syserrlst="$define"
16896 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16897 d_syserrlst="$undef"
16899 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16900 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16901 echo 'strerror() found in string header.' >&4
16902 d_strerror="$define"
16903 d_strerrm='strerror(e)'
16904 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16905 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16906 d_syserrlst="$define"
16908 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16909 d_syserrlst="$undef"
16911 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16912 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16913 d_strerror="$undef"
16914 d_syserrlst="$define"
16915 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16917 echo 'strerror() and sys_errlist[] NOT found.' >&4
16918 d_strerror="$undef"
16919 d_syserrlst="$undef"
16920 d_strerrm='"unknown"'
16924 : see if strerror_r exists
16925 set strerror_r d_strerror_r
16927 case "$d_strerror_r" in
16929 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16930 case "$d_strerror_r_proto:$usethreads" in
16931 ":define") d_strerror_r_proto=define
16932 set d_strerror_r_proto strerror_r $hdrs
16936 case "$d_strerror_r_proto" in
16938 case "$strerror_r_proto" in
16939 ''|0) try='int strerror_r(int, char*, size_t);'
16940 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16942 case "$strerror_r_proto" in
16943 ''|0) try='int strerror_r(int, char*, int);'
16944 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16946 case "$strerror_r_proto" in
16947 ''|0) try='char* strerror_r(int, char*, size_t);'
16948 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16950 case "$strerror_r_proto" in
16951 ''|0) d_strerror_r=undef
16953 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16954 * ) case "$strerror_r_proto" in
16955 REENTRANT_PROTO*) ;;
16956 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16958 echo "Prototype: $try" ;;
16961 *) case "$usethreads" in
16962 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16969 *) strerror_r_proto=0
16973 : see if strftime exists
16974 set strftime d_strftime
16977 : see if strlcat exists
16978 set strlcat d_strlcat
16981 : see if strlcpy exists
16982 set strlcpy d_strlcpy
16985 : see if strtod exists
16986 set strtod d_strtod
16989 : see if strtol exists
16990 set strtol d_strtol
16993 : see if strtold exists
16994 set strtold d_strtold
16997 : see if strtoll exists
16998 set strtoll d_strtoll
17001 case "$d_longlong-$d_strtoll" in
17004 Checking whether your strtoll() works okay...
17006 $cat >try.c <<'EOCP'
17009 #define strtoll __strtoll
17012 #define strtoll _strtoll
17015 extern long long int strtoll(char *s, char **, int);
17016 static int bad = 0;
17017 int check(char *s, long long ell, int een) {
17020 gll = strtoll(s, 0, 10);
17021 if (!((gll == ell) && (errno == een)))
17025 check(" 1", 1LL, 0);
17026 check(" 0", 0LL, 0);
17027 check("-1", -1LL, 0);
17028 check("-9223372036854775808", -9223372036854775808LL, 0);
17029 check("-9223372036854775808", -9223372036854775808LL, 0);
17030 check(" 9223372036854775807", 9223372036854775807LL, 0);
17031 check("-9223372036854775808", -9223372036854775808LL, 0);
17032 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17033 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17039 if eval $compile; then
17042 ok) echo "Your strtoll() seems to be working okay." ;;
17044 Your strtoll() doesn't seem to be working okay.
17050 echo "(I can't seem to compile the test program--assuming it doesn't)"
17056 : see if strtoq exists
17057 set strtoq d_strtoq
17060 : see if strtoul exists
17061 set strtoul d_strtoul
17064 case "$d_strtoul" in
17067 Checking whether your strtoul() works okay...
17069 $cat >try.c <<'EOCP'
17072 extern unsigned long int strtoul(char *s, char **, int);
17073 static int bad = 0;
17074 void check(char *s, unsigned long eul, int een) {
17077 gul = strtoul(s, 0, 10);
17078 if (!((gul == eul) && (errno == een)))
17082 check(" 1", 1L, 0);
17083 check(" 0", 0L, 0);
17085 case "$longsize" in
17087 $cat >>try.c <<'EOCP'
17088 check("18446744073709551615", 18446744073709551615UL, 0);
17089 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17090 #if 0 /* strtoul() for /^-/ strings is undefined. */
17091 check("-1", 18446744073709551615UL, 0);
17092 check("-18446744073709551614", 2, 0);
17093 check("-18446744073709551615", 1, 0);
17094 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17095 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17100 $cat >>try.c <<'EOCP'
17101 check("4294967295", 4294967295UL, 0);
17102 check("4294967296", 4294967295UL, ERANGE);
17103 #if 0 /* strtoul() for /^-/ strings is undefined. */
17104 check("-1", 4294967295UL, 0);
17105 check("-4294967294", 2, 0);
17106 check("-4294967295", 1, 0);
17107 check("-4294967296", 4294967295UL, ERANGE);
17108 check("-4294967297", 4294967295UL, ERANGE);
17113 : Should we write these tests to be more portable by sprintf-ing
17114 : ~0 and then manipulating that char string as input for strtol?
17117 $cat >>try.c <<'EOCP'
17124 if eval $compile; then
17125 case "`$run ./try`" in
17126 ok) echo "Your strtoul() seems to be working okay." ;;
17128 Your strtoul() doesn't seem to be working okay.
17137 : see if strtoull exists
17138 set strtoull d_strtoull
17141 case "$d_longlong-$d_strtoull" in
17144 Checking whether your strtoull() works okay...
17146 $cat >try.c <<'EOCP'
17149 #define strtoull __strtoull
17152 extern unsigned long long int strtoull(char *s, char **, int);
17153 static int bad = 0;
17154 int check(char *s, long long eull, int een) {
17157 gull = strtoull(s, 0, 10);
17158 if (!((gull == eull) && (errno == een)))
17162 check(" 1", 1LL, 0);
17163 check(" 0", 0LL, 0);
17164 check("18446744073709551615", 18446744073709551615ULL, 0);
17165 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17166 #if 0 /* strtoull() for /^-/ strings is undefined. */
17167 check("-1", 18446744073709551615ULL, 0);
17168 check("-18446744073709551614", 2LL, 0);
17169 check("-18446744073709551615", 1LL, 0);
17170 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17171 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17178 if eval $compile; then
17179 case "`$run ./try`" in
17180 ok) echo "Your strtoull() seems to be working okay." ;;
17182 Your strtoull() doesn't seem to be working okay.
17184 d_strtoull="$undef"
17191 : see if strtouq exists
17192 set strtouq d_strtouq
17195 case "$d_strtouq" in
17198 Checking whether your strtouq() works okay...
17200 $cat >try.c <<'EOCP'
17203 extern unsigned long long int strtouq(char *s, char **, int);
17204 static int bad = 0;
17205 void check(char *s, unsigned long long eull, int een) {
17206 unsigned long long gull;
17208 gull = strtouq(s, 0, 10);
17209 if (!((gull == eull) && (errno == een)))
17213 check(" 1", 1LL, 0);
17214 check(" 0", 0LL, 0);
17215 check("18446744073709551615", 18446744073709551615ULL, 0);
17216 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17217 #if 0 /* strtouq() for /^-/ strings is undefined. */
17218 check("-1", 18446744073709551615ULL, 0);
17219 check("-18446744073709551614", 2LL, 0);
17220 check("-18446744073709551615", 1LL, 0);
17221 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17222 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17230 if eval $compile; then
17231 case "`$run ./try`" in
17232 ok) echo "Your strtouq() seems to be working okay." ;;
17234 Your strtouq() doesn't seem to be working okay.
17243 : see if strxfrm exists
17244 set strxfrm d_strxfrm
17247 : see if symlink exists
17248 set symlink d_symlink
17251 : see if syscall exists
17252 set syscall d_syscall
17255 : see if prototype for syscall is available
17257 set d_syscallproto syscall $i_unistd unistd.h
17260 : see if sysconf exists
17261 set sysconf d_sysconf
17264 : see if system exists
17265 set system d_system
17268 : see if tcgetpgrp exists
17269 set tcgetpgrp d_tcgetpgrp
17272 : see if tcsetpgrp exists
17273 set tcsetpgrp d_tcsetpgrp
17276 : see if prototype for telldir is available
17278 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17281 : see if time exists
17283 if test "X$d_time" = X -o X"$timetype" = X; then
17284 if set time val -f d_time; eval $csym; $val; then
17285 echo 'time() found.' >&4
17287 rp="What is the type returned by time() on this system?"
17288 set time_t timetype long stdio.h sys/types.h
17291 echo 'time() not found, hope that will do.' >&4
17299 : see if this is a sys/times.h system
17300 set sys/times.h i_systimes
17303 : see if times exists
17305 if set times val -f d_times; eval $csym; $val; then
17306 echo 'times() found.' >&4
17309 case "$i_systimes" in
17310 "$define") inc='sys/times.h';;
17312 rp="What is the type returned by times() on this system?"
17313 set clock_t clocktype long stdio.h sys/types.h $inc
17316 echo 'times() NOT found, hope that will do.' >&4
17321 : see if tmpnam_r exists
17322 set tmpnam_r d_tmpnam_r
17324 case "$d_tmpnam_r" in
17326 hdrs="$i_systypes sys/types.h define stdio.h "
17327 case "$d_tmpnam_r_proto:$usethreads" in
17328 ":define") d_tmpnam_r_proto=define
17329 set d_tmpnam_r_proto tmpnam_r $hdrs
17333 case "$d_tmpnam_r_proto" in
17335 case "$tmpnam_r_proto" in
17336 ''|0) try='char* tmpnam_r(char*);'
17337 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17339 case "$tmpnam_r_proto" in
17340 ''|0) d_tmpnam_r=undef
17342 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17343 * ) case "$tmpnam_r_proto" in
17344 REENTRANT_PROTO*) ;;
17345 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17347 echo "Prototype: $try" ;;
17350 *) case "$usethreads" in
17351 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17358 *) tmpnam_r_proto=0
17362 : see if truncate exists
17363 set truncate d_truncate
17366 : see if ttyname_r exists
17367 set ttyname_r d_ttyname_r
17369 case "$d_ttyname_r" in
17371 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17372 case "$d_ttyname_r_proto:$usethreads" in
17373 ":define") d_ttyname_r_proto=define
17374 set d_ttyname_r_proto ttyname_r $hdrs
17378 case "$d_ttyname_r_proto" in
17380 case "$ttyname_r_proto" in
17381 ''|0) try='int ttyname_r(int, char*, size_t);'
17382 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17384 case "$ttyname_r_proto" in
17385 ''|0) try='int ttyname_r(int, char*, int);'
17386 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17388 case "$ttyname_r_proto" in
17389 ''|0) try='char* ttyname_r(int, char*, int);'
17390 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17392 case "$ttyname_r_proto" in
17393 ''|0) d_ttyname_r=undef
17395 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17396 * ) case "$ttyname_r_proto" in
17397 REENTRANT_PROTO*) ;;
17398 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17400 echo "Prototype: $try" ;;
17403 *) case "$usethreads" in
17404 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17411 *) ttyname_r_proto=0
17415 : see if tzname[] exists
17417 if set tzname val -a d_tzname; eval $csym; $val; then
17419 echo 'tzname[] found.' >&4
17422 echo 'tzname[] NOT found.' >&4
17428 next|rhapsody|darwin) multiarch="$define" ;;
17430 case "$multiarch" in
17431 ''|[nN]*) multiarch="$undef" ;;
17434 : check for ordering of bytes in a UV
17436 case "$usecrosscompile$multiarch" in
17439 You seem to be either cross-compiling or doing a multiarchitecture build,
17440 skipping the byteorder check.
17446 case "$byteorder" in
17449 In the following, larger digits indicate more significance. A big-endian
17450 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17451 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17452 machines may have weird orders like 3412. A Cray will report 87654321,
17453 an Alpha will report 12345678. If the test program works the default is
17455 I'm now running the test program...
17459 #$i_stdlib I_STDLIB
17461 #include <stdlib.h>
17463 #include <sys/types.h>
17464 typedef $uvtype UV;
17474 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17476 u.l = (UV)0x04030201;
17477 for (i = 0; i < $uvsize; i++)
17478 printf("%c", u.c[i]+'0');
17485 if eval $compile && ./try > /dev/null; then
17488 [1-4][1-4][1-4][1-4]|12345678|87654321)
17489 echo "(The test program ran ok.)"
17490 echo "byteorder=$dflt"
17493 ????|????????) echo "(The test program ran ok.)" ;;
17494 *) echo "(The test program didn't run right for some reason.)" ;;
17499 (I can't seem to compile the test program. Guessing big-endian...)
17502 case "$xxx_prompt" in
17504 rp="What is the order of bytes in $uvtype?"
17520 Checking to see whether you can access character data unalignedly...
17522 case "$d_u32align" in
17523 '') $cat >try.c <<EOCP
17525 #$i_stdlib I_STDLIB
17527 #include <stdlib.h>
17529 #define U32 $u32type
17530 #define BYTEORDER 0x$byteorder
17532 #include <signal.h>
17534 $signal_t bletch(s) int s; { exit(4); }
17537 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17542 if (sizeof(U32) != 4) {
17543 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17550 signal(SIGBUS, bletch);
17562 for (i = 0; i < 4; i++) {
17563 up = (U32*)(buf + i);
17564 if (! ((*up == 1 << (8*i)) || /* big-endian */
17565 (*up == 1 << (8*(3-i))) /* little-endian */
17569 printf("read failed (%x)\n", *up);
17575 for (i = 0; i < 4; i++) {
17576 up = (U32*)(buf + i);
17578 if (*up != 0xBeef) {
17579 printf("write failed (%x)\n", *up);
17593 if eval $compile_ok; then
17594 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17595 $run ./try 2>&1 >/dev/null
17598 You can access character data pretty unalignedly.
17600 d_u32align="$undef"
17603 It seems that you must access character data in an aligned manner.
17605 d_u32align="$define"
17609 rp='Can you access character data at unaligned addresses?'
17613 [yY]*) d_u32align="$undef" ;;
17614 *) d_u32align="$define" ;;
17617 $rm -f core core.try.* try.core
17621 : see if ualarm exists
17622 set ualarm d_ualarm
17625 : see if umask exists
17629 : see if unordered exists
17630 set unordered d_unordered
17633 : see if unsetenv exists
17634 set unsetenv d_unsetenv
17637 : see if usleep exists
17638 set usleep d_usleep
17641 : see if prototype for usleep is available
17643 set d_usleepproto usleep $i_unistd unistd.h
17646 : see if ustat exists
17650 : backward compatibility for d_hvfork
17651 if test X$d_hvfork != X; then
17652 d_vfork="$d_hvfork"
17655 : see if there is a vfork
17660 : Ok, but do we want to use it. vfork is reportedly unreliable in
17661 : perl on Solaris 2.x, and probably elsewhere.
17665 case "$usevfork" in
17671 Perl can only use a vfork() that doesn't suffer from strict
17672 restrictions on calling functions or modifying global data in
17673 the child. For example, glibc-2.1 contains such a vfork()
17674 that is unsuitable. If your system provides a proper fork()
17675 call, chances are that you do NOT want perl to use vfork().
17678 rp="Do you still want to use vfork()?"
17683 echo "Ok, we won't use vfork()."
17692 $define) usevfork='true';;
17693 *) usevfork='false';;
17696 : see if closedir exists
17697 set closedir d_closedir
17700 case "$d_closedir" in
17703 echo "Checking whether closedir() returns a status..." >&4
17705 #$i_dirent I_DIRENT /**/
17706 #$i_sysdir I_SYS_DIR /**/
17707 #$i_sysndir I_SYS_NDIR /**/
17708 #$i_systypes I_SYS_TYPES /**/
17710 #if defined(I_SYS_TYPES)
17711 #include <sys/types.h>
17713 #if defined(I_DIRENT)
17714 #include <dirent.h>
17715 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17716 #include <sys/dir.h>
17720 #include <sys/ndir.h>
17724 #include <ndir.h> /* may be wrong in the future */
17726 #include <sys/dir.h>
17731 int main() { return closedir(opendir(".")); }
17734 if eval $compile_ok; then
17735 if $run ./try > /dev/null 2>&1 ; then
17736 echo "Yes, it does."
17739 echo "No, it doesn't."
17743 echo "(I can't seem to compile the test program--assuming it doesn't)"
17751 set d_void_closedir
17754 : see if there is a wait4
17758 : see if waitpid exists
17759 set waitpid d_waitpid
17762 : see if wcstombs exists
17763 set wcstombs d_wcstombs
17766 : see if wctomb exists
17767 set wctomb d_wctomb
17770 : see if writev exists
17771 set writev d_writev
17774 : preserve RCS keywords in files with variable substitution, grrr
17779 Revision='$Revision'
17781 : check for alignment requirements
17783 case "$usecrosscompile$multiarch" in
17786 You seem to be either cross-compiling or doing a multiarchitecture build,
17787 skipping the memory alignment check.
17790 case "$alignbytes" in
17791 '') alignbytes=8 ;;
17795 case "$alignbytes" in
17796 '') echo "Checking alignment constraints..." >&4
17797 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17798 $cat >try.c <<'EOCP'
17799 typedef long double NV;
17802 $cat >try.c <<'EOCP'
17806 $cat >>try.c <<'EOCP'
17814 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17819 if eval $compile_ok; then
17823 echo "(I can't seem to compile the test program...)"
17826 *) dflt="$alignbytes"
17829 rp="Doubles must be aligned on a how-many-byte boundary?"
17837 : set the base revision
17840 : how do we concatenate cpp tokens here?
17842 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17843 $cat >cpp_stuff.c <<'EOCP'
17844 #define RCAT(a,b)a/**/b
17845 #define ACAT(a,b)a ## b
17849 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17850 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17851 echo "Oh! Smells like ANSI's been here." >&4
17852 echo "We can catify or stringify, separately or together!"
17854 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17855 echo "Ah, yes! The good old days!" >&4
17856 echo "However, in the good old days we don't know how to stringify and"
17857 echo "catify at the same time."
17861 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17862 You're going to have to edit the values of CAT[2-5] in config.h...
17864 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17868 : see if this is a db.h system
17874 : Check db version.
17876 echo "Checking Berkeley DB version ..." >&4
17882 #include <sys/types.h>
17884 #$i_stdlib I_STDLIB
17886 #include <stdlib.h>
17889 int main(int argc, char *argv[])
17891 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17892 int Major, Minor, Patch ;
17893 unsigned long Version ;
17894 (void)db_version(&Major, &Minor, &Patch) ;
17896 printf("%d %d %d %d %d %d\n",
17897 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17898 Major, Minor, Patch);
17901 printf("You have Berkeley DB Version 2 or greater.\n");
17903 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17904 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17905 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17906 Major, Minor, Patch) ;
17908 /* check that db.h & libdb are compatible */
17909 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17910 printf("db.h and libdb are incompatible.\n") ;
17914 printf("db.h and libdb are compatible.\n") ;
17916 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17917 + DB_VERSION_PATCH ;
17919 /* needs to be >= 2.3.4 */
17920 if (Version < 2003004) {
17921 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17922 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17928 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17933 printf("You have Berkeley DB Version 1.\n");
17934 exit(0); /* DB version < 2: the coast is clear. */
17936 exit(1); /* <db.h> not Berkeley DB? */
17942 if eval $compile_ok && $run ./try; then
17943 echo 'Looks OK.' >&4
17945 db_version_major=$1
17946 db_version_minor=$2
17947 db_version_patch=$3
17949 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17953 : Remove db from list of libraries to use
17954 echo "Removing unusable -ldb from library list" >&4
17955 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17958 echo "libs = $libs" >&4
17968 : Check the return type needed for hash
17970 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17976 #include <sys/types.h>
17979 #ifndef DB_VERSION_MAJOR
17980 u_int32_t hash_cb (ptr, size)
17988 info.hash = hash_cb;
17992 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17993 if $contains warning try.out >>/dev/null 2>&1 ; then
17996 db_hashtype='u_int32_t'
17999 : XXX Maybe we should just give up here.
18000 db_hashtype=u_int32_t
18002 echo "Help: I can't seem to compile the db test program." >&4
18003 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18006 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18008 *) db_hashtype=u_int32_t
18013 : Check the return type needed for prefix
18015 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18021 #include <sys/types.h>
18024 #ifndef DB_VERSION_MAJOR
18025 size_t prefix_cb (key1, key2)
18033 info.prefix = prefix_cb;
18037 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18038 if $contains warning try.out >>/dev/null 2>&1 ; then
18039 db_prefixtype='int'
18041 db_prefixtype='size_t'
18044 db_prefixtype='size_t'
18045 : XXX Maybe we should just give up here.
18047 echo "Help: I can't seem to compile the db test program." >&4
18048 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18051 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18053 *) db_prefixtype='size_t'
18058 : How can we generate normalized random numbers ?
18060 echo "Looking for a random number function..." >&4
18061 case "$randfunc" in
18063 if set drand48 val -f; eval $csym; $val; then
18065 echo "Good, found drand48()." >&4
18066 elif set random val -f; eval $csym; $val; then
18068 echo "OK, found random()." >&4
18071 echo "Yick, looks like I have to use rand()." >&4
18082 *-Dmy_rand=*|*-Dmy_srand=*)
18083 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18084 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18085 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18086 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18090 while $test "$cont"; do
18091 rp="Use which function to generate random numbers?"
18093 if $test "$ans" = "$dflt"; then
18099 if set $ans val -f; eval $csym; $val; then
18103 rp="I cannot find function $ans. Use that name anyway?"
18112 case "$randfunc" in
18114 drand01="drand48()"
18120 case "$randbits" in
18122 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18124 #$i_unistd I_UNISTD
18125 #$i_stdlib I_STDLIB
18128 # include <unistd.h>
18131 # include <stdlib.h>
18136 register unsigned long tmp;
18137 register unsigned long max = 0L;
18139 for (i = 1000; i; i--) {
18140 tmp = (unsigned long) $randfunc();
18141 if (tmp > max) max = tmp;
18143 for (i = 0; max; i++)
18149 if eval $compile_ok; then
18153 echo "(I can't seem to compile the test program...)"
18160 rp="How many bits does your $randfunc() function produce?"
18164 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18165 seedfunc="s$randfunc"
18166 randseedtype=unsigned
18170 rp="How many bits does your $randfunc() function produce?"
18173 seedfunc="s$randfunc"
18174 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18175 if set $seedfunc val -f; eval $csym; $val; then
18176 echo "(Using $seedfunc() to seed random generator)"
18178 echo "(Warning: no $seedfunc() to seed random generator)"
18181 randseedtype=unsigned
18189 echo "Determining whether or not we are on an EBCDIC system..." >&4
18190 $cat >try.c <<'EOM'
18193 if ('M'==0xd4) return 0;
18200 if eval $compile_ok; then
18201 if $run ./try; then
18202 echo "You seem to speak EBCDIC." >&4
18205 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18208 echo "I'm unable to compile the test program." >&4
18209 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18217 Checking how to flush all pending stdio output...
18219 # I only know how to find the first 32 possibly open files on SunOS.
18220 # See also hints/sunos_4_1.sh and util.c --AD
18222 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18224 $cat >>try.c <<EOCP
18226 #$i_stdlib I_STDLIB
18228 #include <stdlib.h>
18230 #$i_unistd I_UNISTD
18232 # include <unistd.h>
18234 #$d_sysconf HAS_SYSCONF
18235 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18236 #ifdef HAS_STDIO_STREAM_ARRAY
18237 # define STDIO_STREAM_ARRAY $stdio_stream_array
18242 p = fopen("try.out", "w");
18246 # ifdef TRY_FPRINTF
18250 #ifdef TRY_FFLUSH_NULL
18253 #ifdef TRY_FFLUSH_ALL
18255 long open_max = -1;
18256 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18257 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18259 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18260 open_max = sysconf(_SC_OPEN_MAX);
18263 open_max = FOPEN_MAX;
18266 open_max = OPEN_MAX;
18275 # ifdef HAS_STDIO_STREAM_ARRAY
18276 if (open_max > 0) {
18278 for (i = 0; i < open_max; i++)
18279 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18280 STDIO_STREAM_ARRAY[i]._file < open_max &&
18281 STDIO_STREAM_ARRAY[i]._flag)
18282 fflush(&STDIO_STREAM_ARRAY[i]);
18290 : first we have to find out how _not_ to flush
18292 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18294 set try -DTRY_FPUTC
18295 if eval $compile; then
18296 $run ./try 2>/dev/null
18299 if $test ! -s try.out -a "X$code" = X42; then
18305 set try -DTRY_FPRINTF
18306 if eval $compile; then
18307 $run ./try 2>/dev/null
18310 if $test ! -s try.out -a "X$code" = X42; then
18311 output=-DTRY_FPRINTF
18317 : check for fflush NULL behaviour
18318 case "$fflushNULL" in
18319 '') set try -DTRY_FFLUSH_NULL $output
18320 if eval $compile; then
18321 $run ./try 2>/dev/null
18324 if $test -s try.out -a "X$code" = X42; then
18325 fflushNULL="`$cat try.out`"
18327 if $test "X$code" != X42; then
18329 (If this test failed, don't worry, we'll try another method shortly.)
18334 $rm -f core try.core core.try.*
18335 case "$fflushNULL" in
18337 Your fflush(NULL) works okay for output streams.
18338 Let's see if it clobbers input pipes...
18340 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18341 # bug that improperly flushes the input end of pipes. So we avoid the
18342 # autoflush on fork/system/exec support for now. :-(
18343 $cat >tryp.c <<EOCP
18346 main(int argc, char **argv)
18352 while ((i = getc(stdin)) != -1
18353 && (*bp++ = i) != '\n'
18354 && bp < &buf[1024])
18357 fprintf(stdout, "%s", buf);
18365 fflushNULL="$define"
18367 if eval $compile; then
18369 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18370 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18372 fflush(NULL) seems to behave okay with input streams.
18374 fflushNULL="$define"
18377 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18379 fflushNULL="$undef"
18382 $rm -f core tryp.c tryp.core core.tryp.*
18385 Your fflush(NULL) isn't working (contrary to ANSI C).
18387 fflushNULL="$undef"
18390 Cannot figure out whether your fflush(NULL) works or not.
18391 I'm assuming it doesn't (contrary to ANSI C).
18393 fflushNULL="$undef"
18397 $define|true|[yY]*)
18398 fflushNULL="$define"
18401 fflushNULL="$undef"
18404 : check explicit looping only if NULL did not work, and if the pipe
18405 : bug does not show up on an explicit flush too
18406 case "$fflushNULL" in
18408 $cat >tryp.c <<EOCP
18411 main(int argc, char **argv)
18417 while ((i = getc(stdin)) != -1
18418 && (*bp++ = i) != '\n'
18419 && bp < &buf[1024])
18422 fprintf(stdout, "%s", buf);
18431 if eval $compile; then
18433 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18434 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18436 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18438 : now check for fflushall behaviour
18439 case "$fflushall" in
18440 '') set try -DTRY_FFLUSH_ALL $output
18441 if eval $compile; then
18443 (Now testing the other method--but note that this also may fail.)
18445 $run ./try 2>/dev/null
18448 if $test -s try.out -a "X$code" = X42; then
18449 fflushall="`$cat try.out`"
18452 $rm -f core try.core core.try.*
18453 case "$fflushall" in
18455 Whew. Flushing explicitly all the stdio streams works.
18457 fflushall="$define"
18460 Sigh. Flushing explicitly all the stdio streams doesn't work.
18465 Cannot figure out whether flushing stdio streams explicitly works or not.
18466 I'm assuming it doesn't.
18472 "$define"|true|[yY]*)
18473 fflushall="$define"
18481 All is futile. Even fflush(stdin) clobbers input pipes!
18488 $rm -f core tryp.c tryp.core core.tryp.*
18490 *) fflushall="$undef"
18494 case "$fflushNULL$fflushall" in
18497 OK, I give up. I cannot figure out how to flush pending stdio output.
18498 We won't be flushing handles at all before fork/exec/popen.
18502 $rm -f try.* try$exe_ext
18504 : Store the full pathname to the ar program for use in the C program
18505 : Respect a hint or command line value for full_ar.
18510 : Store the full pathname to the sed program for use in the C program
18513 : see what type gids are declared as in the kernel
18515 echo "Looking for the type for group ids returned by getgid()."
18516 set gid_t gidtype xxx stdio.h sys/types.h
18520 xxx=`./findhdr sys/user.h`
18521 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18523 unsigned) dflt="$1 $2" ;;
18527 *) dflt="$gidtype";;
18530 gid_t) echo "gid_t found." ;;
18531 *) rp="What is the type for group ids returned by getgid()?"
18539 *_t) zzz="$gidtype" ;;
18542 echo "Checking the size of $zzz..." >&4
18544 #include <sys/types.h>
18546 #$i_stdlib I_STDLIB
18548 #include <stdlib.h>
18551 printf("%d\n", (int)sizeof($gidtype));
18556 if eval $compile_ok; then
18560 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18563 echo "Your $zzz is $gidsize bytes long."
18568 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18574 *_t) zzz="$gidtype" ;;
18577 echo "Checking the sign of $zzz..." >&4
18579 #include <sys/types.h>
18590 if eval $compile; then
18594 echo "(I can't execute the test program--guessing unsigned.)" >&4
18598 1) echo "Your $zzz is unsigned." ;;
18599 -1) echo "Your $zzz is signed." ;;
18605 echo "(I can't compile the test program--guessing unsigned.)" >&4
18611 if $test X"$quadtype" != X; then
18613 echo "Checking how to print 64-bit integers..." >&4
18615 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18616 $cat >try.c <<'EOCP'
18617 #include <sys/types.h>
18620 int q = 12345678901;
18621 printf("%ld\n", q);
18625 if eval $compile; then
18629 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18630 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18631 echo "We will use %d."
18637 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18638 $cat >try.c <<'EOCP'
18639 #include <sys/types.h>
18642 long q = 12345678901;
18643 printf("%ld\n", q);
18647 if eval $compile; then
18651 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18652 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18653 echo "We will use %ld."
18659 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18660 $cat >try.c <<'EOCP'
18661 #include <sys/types.h>
18662 #include <inttypes.h>
18665 int64_t q = 12345678901;
18666 printf("%" PRId64 "\n", q);
18670 if eval $compile; then
18674 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18675 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18676 echo "We will use the C9X style."
18682 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18684 #include <sys/types.h>
18687 $quadtype q = 12345678901;
18688 printf("%Ld\n", q);
18692 if eval $compile; then
18696 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18697 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18698 echo "We will use %Ld."
18704 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18705 $cat >try.c <<'EOCP'
18706 #include <sys/types.h>
18709 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18710 printf("%lld\n", q);
18714 if eval $compile; then
18718 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18719 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18720 echo "We will use the %lld style."
18726 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18728 #include <sys/types.h>
18731 $quadtype q = 12345678901;
18732 printf("%qd\n", q);
18736 if eval $compile; then
18740 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18741 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18742 echo "We will use %qd."
18748 if $test X"$sPRId64" = X; then
18749 echo "Cannot figure out how to print 64-bit integers." >&4
18757 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18758 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18760 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18761 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18767 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18769 if $test X"$ivsize" = X8; then
18770 ivdformat="$sPRId64"
18771 uvuformat="$sPRIu64"
18772 uvoformat="$sPRIo64"
18773 uvxformat="$sPRIx64"
18774 uvXUformat="$sPRIXU64"
18776 if $test X"$ivsize" = X"$longsize"; then
18783 if $test X"$ivsize" = X"$intsize"; then
18791 if $test X"$ivsize" = X"$shortsize"; then
18802 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18803 nveformat="$sPRIeldbl"
18804 nvfformat="$sPRIfldbl"
18805 nvgformat="$sPRIgldbl"
18806 nvEUformat="$sPRIEUldbl"
18807 nvFUformat="$sPRIFUldbl"
18808 nvGUformat="$sPRIGUldbl"
18818 case "$ivdformat" in
18819 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18826 $echo "Checking the format string to be used for gids..." >&4
18829 -1) if $test X"$gidsize" = X"$ivsize"; then
18830 gidformat="$ivdformat"
18832 if $test X"$gidsize" = X"$longsize"; then
18835 if $test X"$gidsize" = X"$intsize"; then
18838 if $test X"$gidsize" = X"$shortsize"; then
18845 *) if $test X"$gidsize" = X"$uvsize"; then
18846 gidformat="$uvuformat"
18848 if $test X"$gidsize" = X"$longsize"; then
18851 if $test X"$gidsize" = X"$intsize"; then
18854 if $test X"$gidsize" = X"$shortsize"; then
18863 : see if getgroups exists
18864 set getgroups d_getgrps
18867 : see if setgroups exists
18868 set setgroups d_setgrps
18872 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18874 case "$d_getgrps$d_setgrps" in
18876 case "$groupstype" in
18877 '') dflt="$gidtype" ;;
18878 *) dflt="$groupstype" ;;
18881 What type of pointer is the second argument to getgroups() and setgroups()?
18882 Usually this is the same as group ids, $gidtype, but not always.
18885 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18889 *) groupstype="$gidtype";;
18894 $define|true|[yY]*) dflt='y' ;;
18899 Would you like to build with Misc Attribute Decoration? This is development
18900 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
18901 overhead on the interpreter.
18903 If this doesn't make any sense to you, just accept the default '$dflt'.
18905 rp='Build Perl with MAD?'
18909 madlyh='madly.h madly.act madly.tab'
18911 madlyobj="madly$_o" ;;
18921 echo "Checking if your $make program sets \$(MAKE)..." >&4
18922 case "$make_set_make" in
18924 $sed 's/^X //' > testmake.mak << 'EOF'
18926 X @echo 'maketemp="$(MAKE)"'
18928 case "`$make -f testmake.mak 2>/dev/null`" in
18929 *maketemp=*) make_set_make='#' ;;
18930 *) make_set_make="MAKE=$make" ;;
18932 $rm -f testmake.mak
18935 case "$make_set_make" in
18936 '#') echo "Yup, it does.";;
18937 *) echo "Nope, it doesn't.";;
18940 : see what type is used for mode_t
18941 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18942 set mode_t modetype int stdio.h sys/types.h
18945 : see if stdarg is available
18947 if $test `./findhdr stdarg.h`; then
18948 echo "<stdarg.h> found." >&4
18951 echo "<stdarg.h> NOT found." >&4
18955 : see if varags is available
18957 if $test `./findhdr varargs.h`; then
18958 echo "<varargs.h> found." >&4
18960 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18963 : set up the varargs testing programs
18964 $cat > varargs.c <<EOP
18966 #include <stdarg.h>
18969 #include <varargs.h>
18973 int f(char *p, ...)
18987 p = va_arg(ap, char *);
18992 $cat > varargs <<EOP
18994 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
19003 : now check which varargs header should be included
19008 if `./varargs I_STDARG`; then
19010 elif `./varargs I_VARARGS`; then
19015 if `./varargs I_VARARGS`; then
19022 echo "I could not find the definition for va_dcl... You have problems..." >&4
19023 val="$undef"; set i_stdarg; eval $setvar
19024 val="$undef"; set i_varargs; eval $setvar
19029 case "$i_varhdr" in
19031 val="$define"; set i_stdarg; eval $setvar
19032 val="$undef"; set i_varargs; eval $setvar
19035 val="$undef"; set i_stdarg; eval $setvar
19036 val="$define"; set i_varargs; eval $setvar
19039 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19043 : see if we need va_copy
19045 case "$i_stdarg" in
19048 #include <stdarg.h>
19050 #$i_stdlib I_STDLIB
19052 #include <stdlib.h>
19054 #include <signal.h>
19057 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19059 return vfprintf(f, fmt, *valp);
19063 myvfprintf(FILE *f, const char *fmt, va_list val)
19065 return ivfprintf(f, fmt, &val);
19069 myprintf(char *fmt, ...)
19072 va_start(val, fmt);
19073 return myvfprintf(stdout, fmt, val);
19077 main(int ac, char **av)
19079 signal(SIGSEGV, exit);
19081 myprintf("%s%cs all right, then\n", "that", '\'');
19086 if eval $compile && $run ./try 2>&1 >/dev/null; then
19087 case "`$run ./try`" in
19088 "that's all right, then")
19094 yes) echo "It seems that you don't need va_copy()." >&4
19095 need_va_copy="$undef"
19097 *) echo "It seems that va_copy() or similar will be needed." >&4
19098 need_va_copy="$define"
19101 $rm -f try.* core core.* *.core *.core.*
19103 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19107 : see what type is used for size_t
19108 rp="What is the type used for the length parameter for string functions?"
19109 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19112 : check for type of arguments to gethostbyaddr.
19113 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19114 case "$d_gethbyaddr" in
19118 Checking to see what type of arguments are accepted by gethostbyaddr().
19120 hdrs="$define sys/types.h
19121 $d_socket sys/socket.h
19122 $i_niin netinet/in.h
19124 $i_unistd unistd.h"
19125 : The first arg can 'char *' or 'void *'
19126 : The second arg is some of integral type
19127 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19128 for yyy in size_t long int; do
19129 case "$netdb_host_type" in
19130 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19131 if ./protochk "$try" $hdrs; then
19132 echo "Your system accepts $xxx for the first arg."
19133 echo "...and $yyy for the second arg."
19134 netdb_host_type="$xxx"
19135 netdb_hlen_type="$yyy"
19141 : In case none of those worked, prompt the user.
19142 case "$netdb_host_type" in
19143 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19146 netdb_host_type=$ans
19147 rp='What is the type for the 2nd argument to gethostbyaddr?'
19150 netdb_hlen_type=$ans
19154 *) : no gethostbyaddr, so pick harmless defaults
19155 netdb_host_type='char *'
19156 netdb_hlen_type="$sizetype"
19159 # Remove the "const" if needed. -- but then we'll have a
19161 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19164 : check for type of argument to gethostbyname.
19165 if test "X$netdb_name_type" = X ; then
19166 case "$d_gethbyname" in
19170 Checking to see what type of argument is accepted by gethostbyname().
19172 hdrs="$define sys/types.h
19173 $d_socket sys/socket.h
19174 $i_niin netinet/in.h
19176 $i_unistd unistd.h"
19177 for xxx in "const char *" "char *"; do
19178 case "$netdb_name_type" in
19179 '') try="extern struct hostent *gethostbyname($xxx);"
19180 if ./protochk "$try" $hdrs; then
19181 echo "Your system accepts $xxx."
19182 netdb_name_type="$xxx"
19187 : In case none of those worked, prompt the user.
19188 case "$netdb_name_type" in
19189 '') rp='What is the type for the 1st argument to gethostbyname?'
19192 netdb_name_type=$ans
19196 *) : no gethostbyname, so pick harmless default
19197 netdb_name_type='char *'
19202 : check for type of 1st argument to getnetbyaddr.
19203 if test "X$netdb_net_type" = X ; then
19204 case "$d_getnbyaddr" in
19208 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19210 hdrs="$define sys/types.h
19211 $d_socket sys/socket.h
19212 $i_niin netinet/in.h
19214 $i_unistd unistd.h"
19215 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19216 case "$netdb_net_type" in
19217 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19218 if ./protochk "$try" $hdrs; then
19219 echo "Your system accepts $xxx."
19220 netdb_net_type="$xxx"
19225 : In case none of those worked, prompt the user.
19226 case "$netdb_net_type" in
19227 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19230 netdb_net_type=$ans
19234 *) : no getnetbyaddr, so pick harmless default
19235 netdb_net_type='long'
19239 : locate the preferred pager for this system
19246 [a-zA-Z]:/*) dflt=$pg;;
19250 [a-zA-Z]:/*) dflt=$more;;
19254 [a-zA-Z]:/*) dflt=$less;;
19257 '') dflt=/usr/ucb/more;;
19261 : Instruct ./getfile to trust the hinted or previous pager value,
19262 : even if it does not begin with a slash. For example, on os2,
19263 : pager might be cmd /c more. See comments in UU/getfile.
19268 rp='What pager is used on your system?'
19272 : see what type pids are declared as in the kernel
19273 rp="What is the type of process ids on this system?"
19274 set pid_t pidtype int stdio.h sys/types.h
19277 : see if ar generates random libraries by itself
19279 echo "Checking how to generate random libraries on your machine..." >&4
19280 echo 'int bar1() { return bar2(); }' > bar1.c
19281 echo 'int bar2() { return 2; }' > bar2.c
19283 #$i_stdlib I_STDLIB
19285 #include <stdlib.h>
19287 int main() { printf("%d\n", bar1()); exit(0); }
19289 $cc $ccflags -c bar1.c >/dev/null 2>&1
19290 $cc $ccflags -c bar2.c >/dev/null 2>&1
19291 $cc $ccflags -c foo.c >/dev/null 2>&1
19292 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19293 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19294 $run ./foobar >/dev/null 2>&1; then
19295 echo "$ar appears to generate random libraries itself."
19297 if [ "X$ranlib" = "X" ]; then
19300 elif $ar s bar$_a >/dev/null 2>&1 &&
19301 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19302 $run ./foobar >/dev/null 2>&1; then
19303 echo "a table of contents needs to be added with '$ar s'."
19306 elif $ar ts bar$_a >/dev/null 2>&1 &&
19307 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19308 $run ./foobar >/dev/null 2>&1; then
19309 echo "a table of contents needs to be added with '$ar ts'."
19316 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19317 $test -f $ranlib || ranlib=''
19320 if $test -n "$ranlib"; then
19321 echo "your system has '$ranlib'; we'll use that."
19324 echo "your system doesn't seem to support random libraries"
19325 echo "so we'll use lorder and tsort to order the libraries."
19332 : check for type of arguments to select.
19333 case "$selecttype" in
19334 '') case "$d_select" in
19338 Checking to see what type of arguments are accepted by select().
19340 hdrs="$define sys/types.h
19341 $i_systime sys/time.h
19342 $i_sysselct sys/select.h
19343 $d_socket sys/socket.h"
19344 : The first arg can be int, unsigned, or size_t
19345 : The last arg may or may not be 'const'
19347 : void pointer has been seen but using that
19348 : breaks the selectminbits test
19349 for xxx in 'fd_set *' 'int *'; do
19350 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19351 for tmo in 'struct timeval *' 'const struct timeval *'; do
19353 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19354 if ./protochk "$try" $hdrs; then
19355 echo "Your system accepts $xxx."
19364 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19365 case "$d_fd_set" in
19366 $define) dflt="fd_set *" ;;
19375 *) : no select, so pick a harmless default
19382 : check for the select 'width'
19383 case "$selectminbits" in
19384 '') safebits=`expr $ptrsize \* 8`
19385 case "$d_select" in
19389 Checking to see on how many bits at a time your select() operates...
19392 #include <sys/types.h>
19394 #$i_systime I_SYS_TIME
19395 #$i_systimek I_SYS_TIME_KERNEL
19400 # ifdef I_SYS_TIME_KERNEL
19403 # include <sys/time.h>
19404 # ifdef I_SYS_TIME_KERNEL
19408 #$i_sysselct I_SYS_SELECT
19409 #ifdef I_SYS_SELECT
19410 #include <sys/select.h>
19412 #$d_socket HAS_SOCKET
19414 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19417 #$i_stdlib I_STDLIB
19419 #include <stdlib.h>
19422 #define S sizeof(*(b))
19424 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19425 #define NBITS (NBYTES * 8)
19427 char *s = malloc(NBYTES);
19436 fp = fopen("try.c", "r");
19442 b = ($selecttype)s;
19443 for (i = 0; i < NBITS; i++)
19447 select(fd + 1, b, 0, 0, &t);
19448 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19450 printf("%d\n", i + 1);
19455 if eval $compile_ok; then
19456 selectminbits=`$run ./try`
19457 case "$selectminbits" in
19459 Cannot figure out on how many bits at a time your select() operates.
19460 I'll play safe and guess it is $safebits bits.
19462 selectminbits=$safebits
19463 bits="$safebits bits"
19466 *) bits="$selectminbits bits" ;;
19468 echo "Your select() operates on $bits at a time." >&4
19470 rp='What is the minimum number of bits your select() operates on?'
19471 case "$byteorder" in
19472 12345678) dflt=64 ;;
19478 selectminbits="$val"
19482 *) : no select, so pick a harmless default
19483 selectminbits=$safebits
19489 : Trace out the files included by signal.h, then look for SIGxxx names.
19490 : Remove SIGARRAYSIZE used by HPUX.
19491 : Remove SIGSTKSIZE used by Linux.
19492 : Remove SIGSTKSZ used by Posix.
19493 : Remove SIGTYP void lines used by OS2.
19494 : Some cpps, like os390, dont give the file name anywhere
19495 if [ "X$fieldn" = X ]; then
19496 : Just make some guesses. We check them later.
19497 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19499 xxx=`echo '#include <signal.h>' |
19500 $cppstdin $cppminus $cppflags 2>/dev/null |
19501 $grep '^[ ]*#.*include' |
19502 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19504 : Check this list of files to be sure we have parsed the cpp output ok.
19505 : This will also avoid potentially non-existent files, such
19508 for xx in $xxx /dev/null ; do
19509 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19511 : If we have found no files, at least try signal.h
19512 case "$xxxfiles" in
19513 '') xxxfiles=`./findhdr signal.h` ;;
19516 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19517 print substr($2, 4, 20)
19519 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19520 print substr($3, 4, 20)
19522 : Append some common names just in case the awk scan failed.
19523 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19524 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19525 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19526 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19527 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19529 : generate a few handy files for later
19530 $cat > signal.c <<EOCP
19531 #include <sys/types.h>
19532 #include <signal.h>
19533 #$i_stdlib I_STDLIB
19535 #include <stdlib.h>
19540 /* Strange style to avoid deeply-nested #if/#else/#endif */
19543 # define NSIG (_NSIG)
19549 # define NSIG (SIGMAX+1)
19555 # define NSIG (SIG_MAX+1)
19561 # define NSIG (_SIG_MAX+1)
19567 # define NSIG (MAXSIG+1)
19573 # define NSIG (MAX_SIG+1)
19578 # ifdef SIGARRAYSIZE
19579 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19585 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19589 /* Default to some arbitrary number that's big enough to get most
19590 of the common signals.
19596 printf("NSIG %d\n", NSIG);
19602 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19604 printf "#ifdef SIG"; printf $1; printf "\n"
19605 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19606 printf $1; printf ");\n"
19610 printf "#endif /* JUST_NSIG */\n";
19611 printf "exit(0);\n}\n";
19614 $cat >signal.awk <<'EOP'
19615 BEGIN { ndups = 0 }
19616 $1 ~ /^NSIG$/ { nsig = $2 }
19617 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19618 if ($2 > maxsig) { maxsig = $2 }
19619 if (sig_name[$2]) {
19620 dup_name[ndups] = $1
19621 dup_num[ndups] = $2
19633 printf("NSIG %d\n", nsig);
19634 for (n = 1; n < nsig; n++) {
19636 printf("%s %d\n", sig_name[n], sig_num[n])
19639 printf("NUM%d %d\n", n, n)
19642 for (n = 0; n < ndups; n++) {
19643 printf("%s %d\n", dup_name[n], dup_num[n])
19647 $cat >signal_cmd <<EOS
19649 if $test -s signal.lst; then
19650 echo "Using your existing signal.lst file"
19655 $cat >>signal_cmd <<'EOS'
19658 if eval $compile_ok; then
19659 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19661 echo "(I can't seem be able to compile the whole test program)" >&4
19662 echo "(I'll try it in little pieces.)" >&4
19663 set signal -DJUST_NSIG
19664 if eval $compile_ok; then
19665 $run ./signal$_exe > signal.nsg
19668 echo "I can't seem to figure out how many signals you have." >&4
19669 echo "Guessing 50." >&4
19670 echo 'NSIG 50' > signal.nsg
19672 : Now look at all the signal names, one at a time.
19673 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19674 $cat > signal.c <<EOCP
19675 #include <sys/types.h>
19676 #include <signal.h>
19679 printf("$xx %d\n", SIG${xx});
19684 if eval $compile; then
19685 echo "SIG${xx} found."
19686 $run ./signal$_exe >> signal.ls1
19688 echo "SIG${xx} NOT found."
19691 if $test -s signal.ls1; then
19692 $cat signal.nsg signal.ls1 |
19693 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19697 if $test -s signal.lst; then
19700 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19701 echo 'kill -l' >signal
19702 set X `csh -f <signal`
19706 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19708 echo $@ | $tr ' ' $trnl | \
19709 $awk '{ printf "%s %d\n", $1, ++s; }
19710 END { printf "NSIG %d\n", ++s }' >signal.lst
19712 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19714 chmod a+x signal_cmd
19715 $eunicefix signal_cmd
19717 : generate list of signal names
19719 case "$sig_name_init" in
19721 *) case "$sig_num_init" in
19722 ''|*,*) doinit=yes ;;
19727 echo "Generating a list of signal names and numbers..." >&4
19729 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19730 sig_name=`$awk 'BEGIN { printf "ZERO " }
19731 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19732 sig_num=`$awk 'BEGIN { printf "0 " }
19733 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19734 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19735 !/^NSIG/ { printf "\"%s\", ", $1 }
19736 END { printf "0\n" }' signal.lst`
19737 sig_num_init=`$awk 'BEGIN { printf "0, " }
19738 !/^NSIG/ { printf "%d, ", $2}
19739 END { printf "0\n"}' signal.lst`
19742 echo "The following $sig_count signals are available:"
19744 echo $sig_name | $awk \
19745 'BEGIN { linelen = 0 }
19747 for (i = 1; i <= NF; i++) {
19748 name = "SIG" $i " "
19749 linelen = linelen + length(name)
19750 if (linelen > 70) {
19752 linelen = length(name)
19758 sig_size=`echo $sig_name | awk '{print NF}'`
19759 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19762 case "$sizetype" in
19763 *_t) zzz="$sizetype" ;;
19764 *) zzz="filesize" ;;
19766 echo "Checking the size of $zzz..." >&4
19768 #include <sys/types.h>
19770 #$i_stdlib I_STDLIB
19772 #include <stdlib.h>
19775 printf("%d\n", (int)sizeof($sizetype));
19780 if eval $compile_ok; then
19784 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19787 echo "Your $zzz size is $sizesize bytes."
19792 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19796 : check for socklen_t
19798 echo "Checking to see if you have socklen_t..." >&4
19800 #include <sys/types.h>
19801 #$d_socket HAS_SOCKET
19803 #include <sys/socket.h>
19805 int main() { socklen_t x = 16; }
19808 if eval $compile; then
19810 echo "You have socklen_t."
19813 echo "You do not have socklen_t."
19814 case "$sizetype" in
19815 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19822 : see if this is a socks.h system
19823 set socks.h i_socks
19826 : check for type of the size argument to socket calls
19827 case "$d_socket" in
19831 Checking to see what type is the last argument of accept().
19834 case "$d_socklen_t" in
19835 "$define") yyy="$yyy socklen_t"
19837 yyy="$yyy $sizetype int long unsigned"
19838 for xxx in $yyy; do
19839 case "$socksizetype" in
19840 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19841 case "$usesocks" in
19843 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19844 echo "Your system accepts '$xxx *' for the last argument of accept()."
19845 socksizetype="$xxx"
19848 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19849 echo "Your system accepts '$xxx *' for the last argument of accept()."
19850 socksizetype="$xxx"
19857 : In case none of those worked, prompt the user.
19858 case "$socksizetype" in
19859 '') rp='What is the type for socket address structure sizes?'
19866 *) : no sockets, so pick relatively harmless default
19871 : see what type is used for signed size_t
19872 set ssize_t ssizetype int stdio.h sys/types.h
19877 #$i_stdlib I_STDLIB
19879 #include <stdlib.h>
19881 #include <sys/types.h>
19882 #define Size_t $sizetype
19883 #define SSize_t $dflt
19886 if (sizeof(Size_t) == sizeof(SSize_t))
19888 else if (sizeof(Size_t) == sizeof(int))
19897 if eval $compile_ok && $run ./try > /dev/null; then
19898 ssizetype=`$run ./try`
19899 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19902 Help! I can't compile and run the ssize_t test program: please enlighten me!
19903 (This is probably a misconfiguration in your system or libraries, and
19904 you really ought to fix it. Still, I'll try anyway.)
19906 I need a type that is the same size as $sizetype, but is guaranteed to
19907 be signed. Common values are ssize_t, int and long.
19910 rp="What signed type is the same size as $sizetype?"
19916 : see what type of char stdio uses.
19918 echo '#include <stdio.h>' > stdio.c
19919 $cppstdin $cppminus < stdio.c > stdioh
19920 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19921 echo "Your stdio uses unsigned chars." >&4
19922 stdchar="unsigned char"
19924 echo "Your stdio uses signed chars." >&4
19927 $rm -f stdio.* stdioh
19929 : see what type uids are declared as in the kernel
19931 echo "Looking for the type for user ids returned by getuid()."
19932 set uid_t uidtype xxx stdio.h sys/types.h
19936 xxx=`./findhdr sys/user.h`
19937 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19939 unsigned) dflt="$1 $2" ;;
19943 *) dflt="$uidtype";;
19946 uid_t) echo "uid_t found." ;;
19947 *) rp="What is the type for user ids returned by getuid()?"
19955 *_t) zzz="$uidtype" ;;
19958 echo "Checking the size of $zzz..." >&4
19960 #include <sys/types.h>
19962 #$i_stdlib I_STDLIB
19964 #include <stdlib.h>
19967 printf("%d\n", (int)sizeof($uidtype));
19972 if eval $compile_ok; then
19976 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19979 echo "Your $zzz is $uidsize bytes long."
19984 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19989 *_t) zzz="$uidtype" ;;
19992 echo "Checking the sign of $zzz..." >&4
19994 #include <sys/types.h>
20005 if eval $compile; then
20009 echo "(I can't execute the test program--guessing unsigned.)" >&4
20013 1) echo "Your $zzz is unsigned." ;;
20014 -1) echo "Your $zzz is signed." ;;
20020 echo "(I can't compile the test program--guessing unsigned.)" >&4
20026 $echo "Checking the format string to be used for uids..." >&4
20029 -1) if $test X"$uidsize" = X"$ivsize"; then
20030 uidformat="$ivdformat"
20032 if $test X"$uidsize" = X"$longsize"; then
20035 if $test X"$uidsize" = X"$intsize"; then
20038 if $test X"$uidsize" = X"$shortsize"; then
20045 *) if $test X"$uidsize" = X"$uvsize"; then
20046 uidformat="$uvuformat"
20048 if $test X"$uidsize" = X"$longsize"; then
20051 if $test X"$uidsize" = X"$intsize"; then
20054 if $test X"$uidsize" = X"$shortsize"; then
20064 case "$usesitecustomize" in
20065 $define|true|[Yy]*)
20066 usesitecustomize="$define"
20069 usesitecustomize="$undef"
20073 : determine compiler compiler
20082 if $test -f "$byacc$_exe"; then
20084 comp="byacc or $comp"
20086 if $test -f "$bison$_exe"; then
20087 comp="$comp or bison -y"
20089 rp="Which compiler compiler ($comp) shall I use?"
20098 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20104 : see if this is a fp.h system
20108 : see if this is a fp_class.h system
20109 set fp_class.h i_fp_class
20112 : see if this is a ieeefp.h system
20113 case "$i_ieeefp" in
20114 '' ) set ieeefp.h i_ieeefp
20119 : see if this is a libutil.h system
20120 set libutil.h i_libutil
20123 : see if mach cthreads are available
20124 if test "X$usethreads" = "X$define"; then
20125 set mach/cthreads.h i_machcthr
20128 i_machcthr="$undef"
20133 : see if this is a mntent.h system
20134 set mntent.h i_mntent
20137 : see if ndbm.h is available
20143 # Some Linux distributions such as RedHat 7.1 put the
20144 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20145 if $test -f /usr/include/gdbm/ndbm.h; then
20146 echo '<gdbm/ndbm.h> found.'
20147 ccflags="$ccflags -I/usr/include/gdbm"
20148 cppflags="$cppflags -I/usr/include/gdbm"
20156 : see if dbm_open exists
20157 set dbm_open d_dbm_open
20159 case "$d_dbm_open" in
20162 echo "We won't be including <ndbm.h>"
20171 : see if net/errno.h is available
20173 set net/errno.h val
20176 : Unfortunately, it causes problems on some systems. Arrgh.
20179 cat > try.c <<'EOM'
20182 #include <net/errno.h>
20188 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20189 echo "We'll be including <net/errno.h>." >&4
20191 echo "We won't be including <net/errno.h>." >&4
20200 : see if netinet/tcp.h is available
20201 set netinet/tcp.h i_netinettcp
20204 : see if this is a poll.h system
20208 : see if this is a prot.h system
20213 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20214 $cat <<'EOSH' > Cppsym.know
20215 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20216 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20217 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20218 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20219 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20220 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20221 bull c cadmus clipper CMU COFF COMPILER_VERSION
20222 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20223 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20224 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20225 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20227 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20228 H3050R H3050RX hbullx20 hcx host_mips
20229 hp200 hp300 hp700 HP700 hp800 hp9000
20230 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20231 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20232 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20233 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20234 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20235 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20236 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20237 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20238 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20239 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20240 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20241 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20242 MATH_HAS_NO_SIDE_EFFECTS
20243 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20244 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20245 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20246 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20247 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20248 NetBSD news1500 news1700 news1800 news1900 news3700
20249 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20250 ns32016 ns32332 ns32k nsc32000
20251 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20252 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20253 pc532 pdp11 PGC PIC plexus PORTAR posix
20254 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20255 POSIX_C_SOURCE POSIX_SOURCE POWER
20256 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20257 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20258 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20259 sony sony_news sonyrisc sparc sparclite spectrum
20260 stardent stdc STDC_EXT stratos sun sun3 sun386
20261 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20262 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20263 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20264 sysV68 sysV88 Tek4132 Tek4300 titan
20265 TM3200 TM5400 TM5600
20266 tower tower32 tower32_200 tower32_600 tower32_700
20267 tower32_800 tower32_850 tss
20268 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20269 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20270 unix UNIX95 UNIX99 unixpc unos
20271 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20272 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20273 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20275 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20276 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20277 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20280 # Maybe put other stuff here too.
20281 cat <<EOSH >>Cppsym.know
20284 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20285 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20286 $cat Cppsym.know > Cppsym.c
20287 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20288 $rm -f Cppsym.a Cppsym.b Cppsym.c
20289 cat <<EOSH > Cppsym
20291 if $test \$# -gt 0; then
20292 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20293 if $test -s Cppsym.got; then
20300 $tr " " "$trnl" | ./Cppsym.try
20306 cat <<EOSH > Cppsym.try
20308 cat <<'EOCP' > try.c
20311 #define STRINGIFY(a) "a"
20313 #if cpp_stuff == 42
20314 #define StGiFy(a) #a
20315 #define STRINGIFY(a) StGiFy(a)
20317 #if $cpp_stuff != 1 && $cpp_stuff != 42
20318 # include "Bletch: How does this C preprocessor stringify macros?"
20324 cat <<'EOSH' >> Cppsym.try
20326 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20327 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20328 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20329 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20331 echo 'return 0;}' >> try.c
20333 cat <<EOSH >> Cppsym.try
20335 case "$osname-$gccversion" in
20336 irix-) ccflags="\$ccflags -woff 1178" ;;
20337 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20339 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20341 chmod +x Cppsym.try
20342 $eunicefix Cppsym.try
20343 ./Cppsym < Cppsym.know > Cppsym.true
20344 : Add in any linux cpp "predefined macros":
20345 case "$osname::$gccversion" in
20348 rm -f $tHdrH'.h' $tHdrH
20350 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20351 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20352 if [ -s $tHdrH'_cppsym.real' ]; then
20353 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20356 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20359 : now check the C compiler for additional symbols
20360 postprocess_cc_v=''
20362 aix) postprocess_cc_v="|$tr , ' '" ;;
20369 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20372 -D*) echo "\$i" | $sed 's/^-D//';;
20373 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20378 postprocess_cc_v=''
20381 ./ccsym > ccsym1.raw
20382 if $test -s ccsym1.raw; then
20383 $sort ccsym1.raw | $uniq >ccsym.raw
20385 mv ccsym1.raw ccsym.raw
20388 $awk '/\=/ { print $0; next }
20389 { print $0"=1" }' ccsym.raw >ccsym.list
20390 $comm -13 Cppsym.true ccsym.list >ccsym.own
20391 $comm -12 Cppsym.true ccsym.list >ccsym.com
20392 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20394 if $test -z ccsym.raw; then
20395 echo "Your C compiler doesn't seem to define any symbols!" >&4
20397 echo "However, your C preprocessor defines the following symbols:"
20400 cppsymbols=`$cat Cppsym.true`
20401 cppsymbols=`echo $cppsymbols`
20402 cppccsymbols="$cppsymbols"
20404 if $test -s ccsym.com; then
20405 echo "Your C compiler and pre-processor define these symbols:"
20406 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20409 cppccsymbols=`$cat ccsym.com`
20410 cppccsymbols=`echo $cppccsymbols`
20411 $test "$silent" || sleep 1
20413 if $test -s ccsym.cpp; then
20414 $test "$also" && echo " "
20415 echo "Your C pre-processor ${also}defines the following symbols:"
20416 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20418 cppsymbols=`$cat ccsym.cpp`
20419 cppsymbols=`echo $cppsymbols`
20420 $test "$silent" || sleep 1
20422 if $test -s ccsym.own; then
20423 $test "$also" && echo " "
20424 echo "Your C compiler ${also}defines the following cpp symbols:"
20425 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20426 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20427 ccsymbols=`$cat ccsym.own`
20428 ccsymbols=`echo $ccsymbols`
20429 $test "$silent" || sleep 1
20433 : see if this is a termio system
20437 if $test `./findhdr termios.h`; then
20438 set tcsetattr i_termios
20444 "$define") echo "You have POSIX termios.h... good!" >&4;;
20445 *) if ./Cppsym pyr; then
20446 case "`/bin/universe`" in
20447 ucb) if $test `./findhdr sgtty.h`; then
20449 echo "<sgtty.h> found." >&4
20451 echo "System is pyramid with BSD universe."
20452 echo "<sgtty.h> not found--you could have problems." >&4
20454 *) if $test `./findhdr termio.h`; then
20456 echo "<termio.h> found." >&4
20458 echo "System is pyramid with USG universe."
20459 echo "<termio.h> not found--you could have problems." >&4
20463 if $test `./findhdr termio.h`; then
20464 echo "<termio.h> found." >&4
20466 elif $test `./findhdr sgtty.h`; then
20467 echo "<sgtty.h> found." >&4
20470 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20473 if $test `./findhdr sgtty.h`; then
20474 echo "<sgtty.h> found." >&4
20476 elif $test `./findhdr termio.h`; then
20477 echo "<termio.h> found." >&4
20480 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20484 set i_termio; eval $setvar
20485 val=$val2; set i_sgtty; eval $setvar
20486 val=$val3; set i_termios; eval $setvar
20488 : see if stddef is available
20489 set stddef.h i_stddef
20492 : see if this is a sunmath.h system
20493 set sunmath.h i_sunmath
20496 : see if sys/access.h is available
20497 set sys/access.h i_sysaccess
20500 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20501 set sys/filio.h i_sysfilio
20504 if $test `./findhdr sys/ioctl.h`; then
20506 echo '<sys/ioctl.h> found.' >&4
20509 if $test $i_sysfilio = "$define"; then
20510 echo '<sys/ioctl.h> NOT found.' >&4
20512 $test $i_sgtty = "$define" && xxx="sgtty.h"
20513 $test $i_termio = "$define" && xxx="termio.h"
20514 $test $i_termios = "$define" && xxx="termios.h"
20515 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20521 : see if socket ioctl defs are in sys/sockio.h
20523 xxx=`./findhdr sys/sockio.h`
20524 if $test "$xxx"; then
20525 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20527 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20530 echo "No socket ioctls found in <sys/sockio.h>." >&4
20535 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20542 : see if this is a syslog.h system
20543 set syslog.h i_syslog
20547 : see if this is a sys/mode.h system
20548 set sys/mode.h i_sysmode
20551 : see if sys/resource.h has to be included
20552 set sys/resource.h i_sysresrc
20555 : see if sys/security.h is available
20556 set sys/security.h i_syssecrt
20559 : see if this is a sys/statvfs.h system
20560 set sys/statvfs.h i_sysstatvfs
20563 : see if this is a sys/un.h system
20564 set sys/un.h i_sysun
20568 : see if this is a sys/utsname.h system
20569 set sys/utsname.h i_sysutsname
20572 : see if this is a syswait system
20573 set sys/wait.h i_syswait
20576 : see if this is a ustat.h system
20577 set ustat.h i_ustat
20580 : see if this is an utime system
20581 set utime.h i_utime
20584 : see if this is a values.h system
20585 set values.h i_values
20588 : see if this is a vfork system
20591 set vfork.h i_vfork
20599 : see if gdbm.h is available
20604 : see if gdbm_open exists
20605 set gdbm_open d_gdbm_open
20607 case "$d_gdbm_open" in
20610 echo "We won't be including <gdbm.h>"
20620 echo "Looking for extensions..." >&4
20621 : If we are using the old config.sh, known_extensions may contain
20622 : old or inaccurate or duplicate values.
20623 known_extensions=''
20624 nonxs_extensions=''
20625 : We do not use find because it might not be available.
20626 : We do not just use MANIFEST because the user may have dropped
20627 : some additional extensions into the source tree and expect them
20630 : Function to recursively find available extensions, ignoring DynaLoader
20631 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20635 DynaLoader|dynaload) ;;
20637 if $test -f $xxx/$xxx.xs; then
20638 known_extensions="$known_extensions $1$xxx";
20639 elif $test -f $xxx/Makefile.PL; then
20640 nonxs_extensions="$nonxs_extensions $1$xxx";
20642 if $test -d $xxx -a $# -lt 10; then
20645 eval $find_extensions;
20657 eval $find_extensions
20658 # Special case: Add in threads/shared since it is not picked up by the
20659 # recursive find above (and adding in general recursive finding breaks
20660 # SDBM_File/sdbm). A.D. 10/25/2001.
20661 known_extensions="$known_extensions threads/shared"
20662 set X $nonxs_extensions
20664 nonxs_extensions="$*"
20665 set X $known_extensions
20667 known_extensions="$*"
20670 : Now see which are supported on this system.
20672 for xxx in $known_extensions ; do
20676 $define) avail_ext="$avail_ext $xxx" ;;
20679 GDBM_File|gdbm_fil)
20681 $define) avail_ext="$avail_ext $xxx" ;;
20684 I18N/Langinfo|i18n_lan)
20685 case "$i_langinfo$d_nl_langinfo" in
20686 $define$define) avail_ext="$avail_ext $xxx" ;;
20689 NDBM_File|ndbm_fil)
20692 case "$osname-$use64bitint" in
20695 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20698 *) avail_ext="$avail_ext $xxx" ;;
20703 ODBM_File|odbm_fil)
20704 case "${i_dbm}${i_rpcsvcdbm}" in
20706 case "$osname-$use64bitint" in
20709 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20712 *) avail_ext="$avail_ext $xxx" ;;
20718 case "$useposix" in
20719 true|define|y) avail_ext="$avail_ext $xxx" ;;
20723 case "$useopcode" in
20724 true|define|y) avail_ext="$avail_ext $xxx" ;;
20728 case "$d_socket" in
20731 beos) ;; # not unless BONE
20732 *) avail_ext="$avail_ext $xxx" ;;
20737 Sys/Syslog|sys/syslog)
20738 : XXX syslog requires socket
20739 case "$d_socket" in
20740 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20744 case "$usethreads" in
20746 case "$useithreads" in
20747 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20751 XS/APItest|xs/apitest)
20752 # This is just for testing. Skip it unless we have dynamic loading.
20755 $define) avail_ext="$avail_ext $xxx" ;;
20758 XS/Typemap|xs/typemap)
20759 # This is just for testing. Skip it unless we have dynamic loading.
20761 $define) avail_ext="$avail_ext $xxx" ;;
20764 threads|threads/shared)
20765 # threads and threads::shared are special cases.
20766 # To stop people from asking "Perl 5.8.0 was supposed
20767 # to have this new fancy threads implementation but my
20768 # perl doesn't have it" and from people trying to
20769 # (re)install the threads module using CPAN.pm and
20770 # CPAN.pm then offering to reinstall Perl 5.8.0,
20771 # the threads.pm and threads/shared.pm will always be
20772 # there, croaking informatively ("you need to rebuild
20773 # all of Perl with threads, sorry") when threads haven't
20774 # been compiled in.
20776 avail_ext="$avail_ext $xxx"
20779 : XXX Do we need a useipcsysv variable here
20780 case "${d_msg}${d_sem}${d_shm}" in
20781 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20784 *) avail_ext="$avail_ext $xxx"
20793 case "$onlyextensions" in
20795 *) keepextensions=''
20796 echo "You have requested that only certains extensions be included..." >&4
20797 for i in $onlyextensions; do
20798 case " $avail_ext " in
20800 echo "Keeping extension $i."
20801 keepextensions="$keepextensions $i"
20803 *) echo "Ignoring extension $i." ;;
20806 avail_ext="$keepextensions"
20810 case "$noextensions" in
20812 *) keepextensions=''
20813 echo "You have requested that certain extensions be ignored..." >&4
20814 for i in $avail_ext; do
20815 case " $noextensions " in
20816 *" $i "*) echo "Ignoring extension $i." ;;
20817 *) echo "Keeping extension $i.";
20818 keepextensions="$keepextensions $i"
20822 avail_ext="$keepextensions"
20826 : Now see which nonxs extensions are supported on this system.
20827 : For now assume all are.
20829 for xxx in $nonxs_extensions ; do
20831 *) nonxs_ext="$nonxs_ext $xxx"
20843 A number of extensions are supplied with $package. You may choose to
20844 compile these extensions for dynamic loading (the default), compile
20845 them into the $package executable (static loading), or not include
20846 them at all. Answer "none" to include no extensions.
20847 Note that DynaLoader is always built and need not be mentioned here.
20850 case "$dynamic_ext" in
20852 : Exclude those listed in static_ext
20854 for xxx in $avail_ext; do
20855 case " $static_ext " in
20857 *) dflt="$dflt $xxx" ;;
20864 *) dflt="$dynamic_ext"
20865 # Perhaps we are reusing an old out-of-date config.sh.
20868 if test X"$dynamic_ext" != X"$avail_ext"; then
20870 NOTICE: Your previous config.sh list may be incorrect.
20871 The extensions now available to you are
20873 but the default list from your previous config.sh is
20885 rp="What extensions do you wish to load dynamically?"
20888 none) dynamic_ext=' ' ;;
20889 *) dynamic_ext="$ans" ;;
20892 case "$static_ext" in
20894 : Exclude those already listed in dynamic linking
20896 for xxx in $avail_ext; do
20897 case " $dynamic_ext " in
20899 *) dflt="$dflt $xxx" ;;
20906 *) dflt="$static_ext"
20913 rp="What extensions do you wish to load statically?"
20916 none) static_ext=' ' ;;
20917 *) static_ext="$ans" ;;
20922 A number of extensions are supplied with $package. Answer "none"
20923 to include no extensions.
20924 Note that DynaLoader is always built and need not be mentioned here.
20927 case "$static_ext" in
20928 '') dflt="$avail_ext" ;;
20929 *) dflt="$static_ext"
20930 # Perhaps we are reusing an old out-of-date config.sh.
20933 if test X"$static_ext" != X"$avail_ext"; then
20935 NOTICE: Your previous config.sh list may be incorrect.
20936 The extensions now available to you are
20938 but the default list from your previous config.sh is
20947 : Exclude those that are not xs extensions
20951 rp="What extensions do you wish to include?"
20954 none) static_ext=' ' ;;
20955 *) static_ext="$ans" ;;
20960 # Encode is a special case. If we are building Encode as a static
20961 # extension, we need to explicitly list its subextensions as well.
20962 # For other nested extensions, this is handled automatically by
20963 # the appropriate Makefile.PL.
20964 case " $static_ext " in
20965 *" Encode "*) # Add the subextensions of Encode
20967 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20968 static_ext="$static_ext Encode/$xxx"
20974 set X $dynamic_ext $static_ext $nonxs_ext
20978 # Sanity check: We require an extension suitable for use with
20979 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20980 # should show up as failures in the test suite, but it's helpful to
20981 # catch them now.) The 'extensions' list is normally sorted
20982 # alphabetically, so we need to accept either
20983 # DB_File ... Fcntl ... IO ....
20984 # or something like
20985 # Fcntl ... NDBM_File ... IO ....
20986 case " $extensions" in
20987 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20988 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20989 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20990 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20991 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20995 : Remove libraries needed only for extensions
20996 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20997 : The exception is SunOS 4.x, which needs them.
20998 case "${osname}X${osvers}" in
21002 *) case "$usedl" in
21003 $define|true|[yY]*)
21004 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21008 *) perllibs="$libs"
21014 : Remove build directory name from cppstdin so it can be used from
21015 : either the present location or the final installed location.
21017 : Get out of the UU directory to get correct path name.
21019 case "$cppstdin" in
21021 echo "Stripping down cppstdin path name"
21027 : end of configuration questions
21029 echo "End of configuration questions."
21032 : back to where it started
21033 if test -d ../UU; then
21037 : configuration may be patched via a 'config.arch' file
21038 if $test -f config.arch; then
21039 echo "I see a config.arch file, loading it."
21043 : configuration may be patched via a 'config.over' file
21044 if $test -f config.over; then
21047 rp='I see a config.over file. Do you wish to load it?'
21050 n*) echo "OK, I'll ignore it.";;
21052 echo "Configuration override changes have been loaded."
21057 : in case they want portability, strip down executable paths
21058 case "$d_portable" in
21061 echo "Stripping down executable paths..." >&4
21062 for file in $loclist $trylist; do
21064 eval $file=`basename $temp`
21069 : create config.sh file
21071 echo "Creating config.sh..." >&4
21072 $spitshell <<EOT >config.sh
21075 # This file was produced by running the Configure script. It holds all the
21076 # definitions figured out by Configure. Should you modify one of these values,
21077 # do not forget to propagate your changes by running "Configure -der". You may
21078 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21081 # Package name : $package
21082 # Source directory : $src
21083 # Configuration time: $cf_time
21084 # Configured by : $cf_by
21085 # Target system : $myuname
21095 Revision='$Revision'
21103 alignbytes='$alignbytes'
21104 ansi2knr='$ansi2knr'
21105 aphostname='$aphostname'
21106 api_revision='$api_revision'
21107 api_subversion='$api_subversion'
21108 api_version='$api_version'
21109 api_versionstring='$api_versionstring'
21112 archlibexp='$archlibexp'
21113 archname64='$archname64'
21114 archname='$archname'
21115 archobjs='$archobjs'
21116 asctime_r_proto='$asctime_r_proto'
21124 byteorder='$byteorder'
21126 castflags='$castflags'
21129 cccdlflags='$cccdlflags'
21130 ccdlflags='$ccdlflags'
21132 ccflags_uselargefiles='$ccflags_uselargefiles'
21134 ccsymbols='$ccsymbols'
21135 ccversion='$ccversion'
21137 cf_email='$cf_email'
21139 charsize='$charsize'
21143 clocktype='$clocktype'
21145 compress='$compress'
21146 contains='$contains'
21150 cpp_stuff='$cpp_stuff'
21151 cppccsymbols='$cppccsymbols'
21152 cppflags='$cppflags'
21154 cppminus='$cppminus'
21156 cppstdin='$cppstdin'
21157 cppsymbols='$cppsymbols'
21158 crypt_r_proto='$crypt_r_proto'
21159 cryptlib='$cryptlib'
21161 ctermid_r_proto='$ctermid_r_proto'
21162 ctime_r_proto='$ctime_r_proto'
21163 d_Gconvert='$d_Gconvert'
21164 d_PRIEUldbl='$d_PRIEUldbl'
21165 d_PRIFUldbl='$d_PRIFUldbl'
21166 d_PRIGUldbl='$d_PRIGUldbl'
21167 d_PRIXU64='$d_PRIXU64'
21168 d_PRId64='$d_PRId64'
21169 d_PRIeldbl='$d_PRIeldbl'
21170 d_PRIfldbl='$d_PRIfldbl'
21171 d_PRIgldbl='$d_PRIgldbl'
21172 d_PRIi64='$d_PRIi64'
21173 d_PRIo64='$d_PRIo64'
21174 d_PRIu64='$d_PRIu64'
21175 d_PRIx64='$d_PRIx64'
21176 d_SCNfldbl='$d_SCNfldbl'
21177 d__fwalk='$d__fwalk'
21178 d_access='$d_access'
21179 d_accessx='$d_accessx'
21182 d_archlib='$d_archlib'
21183 d_asctime_r='$d_asctime_r'
21186 d_attribute_format='$d_attribute_format'
21187 d_attribute_malloc='$d_attribute_malloc'
21188 d_attribute_nonnull='$d_attribute_nonnull'
21189 d_attribute_noreturn='$d_attribute_noreturn'
21190 d_attribute_pure='$d_attribute_pure'
21191 d_attribute_unused='$d_attribute_unused'
21192 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21196 d_bsdgetpgrp='$d_bsdgetpgrp'
21197 d_bsdsetpgrp='$d_bsdsetpgrp'
21198 d_builtin_choose_expr='$d_builtin_choose_expr'
21199 d_builtin_expect='$d_builtin_expect'
21201 d_casti32='$d_casti32'
21202 d_castneg='$d_castneg'
21203 d_charvspr='$d_charvspr'
21205 d_chroot='$d_chroot'
21206 d_chsize='$d_chsize'
21208 d_clearenv='$d_clearenv'
21209 d_closedir='$d_closedir'
21210 d_cmsghdr_s='$d_cmsghdr_s'
21212 d_copysignl='$d_copysignl'
21214 d_crypt_r='$d_crypt_r'
21216 d_ctermid_r='$d_ctermid_r'
21217 d_ctime_r='$d_ctime_r'
21218 d_cuserid='$d_cuserid'
21219 d_dbl_dig='$d_dbl_dig'
21220 d_dbminitproto='$d_dbminitproto'
21221 d_difftime='$d_difftime'
21223 d_dirnamlen='$d_dirnamlen'
21224 d_dlerror='$d_dlerror'
21225 d_dlopen='$d_dlopen'
21226 d_dlsymun='$d_dlsymun'
21227 d_dosuid='$d_dosuid'
21228 d_drand48_r='$d_drand48_r'
21229 d_drand48proto='$d_drand48proto'
21231 d_eaccess='$d_eaccess'
21232 d_endgrent='$d_endgrent'
21233 d_endgrent_r='$d_endgrent_r'
21234 d_endhent='$d_endhent'
21235 d_endhostent_r='$d_endhostent_r'
21236 d_endnent='$d_endnent'
21237 d_endnetent_r='$d_endnetent_r'
21238 d_endpent='$d_endpent'
21239 d_endprotoent_r='$d_endprotoent_r'
21240 d_endpwent='$d_endpwent'
21241 d_endpwent_r='$d_endpwent_r'
21242 d_endsent='$d_endsent'
21243 d_endservent_r='$d_endservent_r'
21244 d_eofnblk='$d_eofnblk'
21245 d_eunice='$d_eunice'
21246 d_faststdio='$d_faststdio'
21247 d_fchdir='$d_fchdir'
21248 d_fchmod='$d_fchmod'
21249 d_fchown='$d_fchown'
21251 d_fcntl_can_lock='$d_fcntl_can_lock'
21252 d_fd_macros='$d_fd_macros'
21253 d_fd_set='$d_fd_set'
21254 d_fds_bits='$d_fds_bits'
21255 d_fgetpos='$d_fgetpos'
21256 d_finite='$d_finite'
21257 d_finitel='$d_finitel'
21258 d_flexfnam='$d_flexfnam'
21260 d_flockproto='$d_flockproto'
21262 d_fp_class='$d_fp_class'
21263 d_fpathconf='$d_fpathconf'
21264 d_fpclass='$d_fpclass'
21265 d_fpclassify='$d_fpclassify'
21266 d_fpclassl='$d_fpclassl'
21267 d_fpos64_t='$d_fpos64_t'
21268 d_frexpl='$d_frexpl'
21269 d_fs_data_s='$d_fs_data_s'
21270 d_fseeko='$d_fseeko'
21271 d_fsetpos='$d_fsetpos'
21272 d_fstatfs='$d_fstatfs'
21273 d_fstatvfs='$d_fstatvfs'
21275 d_ftello='$d_ftello'
21277 d_futimes='$d_futimes'
21278 d_getcwd='$d_getcwd'
21279 d_getespwnam='$d_getespwnam'
21280 d_getfsstat='$d_getfsstat'
21281 d_getgrent='$d_getgrent'
21282 d_getgrent_r='$d_getgrent_r'
21283 d_getgrgid_r='$d_getgrgid_r'
21284 d_getgrnam_r='$d_getgrnam_r'
21285 d_getgrps='$d_getgrps'
21286 d_gethbyaddr='$d_gethbyaddr'
21287 d_gethbyname='$d_gethbyname'
21288 d_gethent='$d_gethent'
21289 d_gethname='$d_gethname'
21290 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21291 d_gethostbyname_r='$d_gethostbyname_r'
21292 d_gethostent_r='$d_gethostent_r'
21293 d_gethostprotos='$d_gethostprotos'
21294 d_getitimer='$d_getitimer'
21295 d_getlogin='$d_getlogin'
21296 d_getlogin_r='$d_getlogin_r'
21297 d_getmnt='$d_getmnt'
21298 d_getmntent='$d_getmntent'
21299 d_getnbyaddr='$d_getnbyaddr'
21300 d_getnbyname='$d_getnbyname'
21301 d_getnent='$d_getnent'
21302 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21303 d_getnetbyname_r='$d_getnetbyname_r'
21304 d_getnetent_r='$d_getnetent_r'
21305 d_getnetprotos='$d_getnetprotos'
21306 d_getpagsz='$d_getpagsz'
21307 d_getpbyname='$d_getpbyname'
21308 d_getpbynumber='$d_getpbynumber'
21309 d_getpent='$d_getpent'
21310 d_getpgid='$d_getpgid'
21311 d_getpgrp2='$d_getpgrp2'
21312 d_getpgrp='$d_getpgrp'
21313 d_getppid='$d_getppid'
21314 d_getprior='$d_getprior'
21315 d_getprotobyname_r='$d_getprotobyname_r'
21316 d_getprotobynumber_r='$d_getprotobynumber_r'
21317 d_getprotoent_r='$d_getprotoent_r'
21318 d_getprotoprotos='$d_getprotoprotos'
21319 d_getprpwnam='$d_getprpwnam'
21320 d_getpwent='$d_getpwent'
21321 d_getpwent_r='$d_getpwent_r'
21322 d_getpwnam_r='$d_getpwnam_r'
21323 d_getpwuid_r='$d_getpwuid_r'
21324 d_getsbyname='$d_getsbyname'
21325 d_getsbyport='$d_getsbyport'
21326 d_getsent='$d_getsent'
21327 d_getservbyname_r='$d_getservbyname_r'
21328 d_getservbyport_r='$d_getservbyport_r'
21329 d_getservent_r='$d_getservent_r'
21330 d_getservprotos='$d_getservprotos'
21331 d_getspnam='$d_getspnam'
21332 d_getspnam_r='$d_getspnam_r'
21333 d_gettimeod='$d_gettimeod'
21334 d_gmtime_r='$d_gmtime_r'
21335 d_gnulibc='$d_gnulibc'
21336 d_grpasswd='$d_grpasswd'
21337 d_hasmntopt='$d_hasmntopt'
21339 d_ilogbl='$d_ilogbl'
21341 d_inetaton='$d_inetaton'
21342 d_int64_t='$d_int64_t'
21343 d_isascii='$d_isascii'
21344 d_isfinite='$d_isfinite'
21347 d_isnanl='$d_isnanl'
21348 d_killpg='$d_killpg'
21349 d_lchown='$d_lchown'
21350 d_ldbl_dig='$d_ldbl_dig'
21351 d_libm_lib_version='$d_libm_lib_version'
21353 d_localtime_r='$d_localtime_r'
21354 d_locconv='$d_locconv'
21356 d_longdbl='$d_longdbl'
21357 d_longlong='$d_longlong'
21358 d_lseekproto='$d_lseekproto'
21360 d_madvise='$d_madvise'
21361 d_malloc_good_size='$d_malloc_good_size'
21362 d_malloc_size='$d_malloc_size'
21364 d_mbstowcs='$d_mbstowcs'
21365 d_mbtowc='$d_mbtowc'
21366 d_memchr='$d_memchr'
21367 d_memcmp='$d_memcmp'
21368 d_memcpy='$d_memcpy'
21369 d_memmove='$d_memmove'
21370 d_memset='$d_memset'
21372 d_mkdtemp='$d_mkdtemp'
21373 d_mkfifo='$d_mkfifo'
21374 d_mkstemp='$d_mkstemp'
21375 d_mkstemps='$d_mkstemps'
21376 d_mktime='$d_mktime'
21379 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21380 d_modflproto='$d_modflproto'
21381 d_mprotect='$d_mprotect'
21383 d_msg_ctrunc='$d_msg_ctrunc'
21384 d_msg_dontroute='$d_msg_dontroute'
21385 d_msg_oob='$d_msg_oob'
21386 d_msg_peek='$d_msg_peek'
21387 d_msg_proxy='$d_msg_proxy'
21388 d_msgctl='$d_msgctl'
21389 d_msgget='$d_msgget'
21390 d_msghdr_s='$d_msghdr_s'
21391 d_msgrcv='$d_msgrcv'
21392 d_msgsnd='$d_msgsnd'
21394 d_munmap='$d_munmap'
21395 d_mymalloc='$d_mymalloc'
21397 d_nl_langinfo='$d_nl_langinfo'
21398 d_nv_preserves_uv='$d_nv_preserves_uv'
21399 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21400 d_off64_t='$d_off64_t'
21401 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21402 d_oldpthreads='$d_oldpthreads'
21403 d_oldsock='$d_oldsock'
21405 d_pathconf='$d_pathconf'
21407 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21408 d_phostname='$d_phostname'
21411 d_portable='$d_portable'
21412 d_procselfexe='$d_procselfexe'
21413 d_pthread_atfork='$d_pthread_atfork'
21414 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21415 d_pthread_yield='$d_pthread_yield'
21417 d_pwchange='$d_pwchange'
21418 d_pwclass='$d_pwclass'
21419 d_pwcomment='$d_pwcomment'
21420 d_pwexpire='$d_pwexpire'
21421 d_pwgecos='$d_pwgecos'
21422 d_pwpasswd='$d_pwpasswd'
21423 d_pwquota='$d_pwquota'
21426 d_random_r='$d_random_r'
21427 d_readdir64_r='$d_readdir64_r'
21428 d_readdir='$d_readdir'
21429 d_readdir_r='$d_readdir_r'
21430 d_readlink='$d_readlink'
21432 d_recvmsg='$d_recvmsg'
21433 d_rename='$d_rename'
21434 d_rewinddir='$d_rewinddir'
21436 d_safebcpy='$d_safebcpy'
21437 d_safemcpy='$d_safemcpy'
21438 d_sanemcmp='$d_sanemcmp'
21439 d_sbrkproto='$d_sbrkproto'
21440 d_scalbnl='$d_scalbnl'
21441 d_sched_yield='$d_sched_yield'
21442 d_scm_rights='$d_scm_rights'
21443 d_seekdir='$d_seekdir'
21444 d_select='$d_select'
21446 d_semctl='$d_semctl'
21447 d_semctl_semid_ds='$d_semctl_semid_ds'
21448 d_semctl_semun='$d_semctl_semun'
21449 d_semget='$d_semget'
21451 d_sendmsg='$d_sendmsg'
21452 d_setegid='$d_setegid'
21453 d_seteuid='$d_seteuid'
21454 d_setgrent='$d_setgrent'
21455 d_setgrent_r='$d_setgrent_r'
21456 d_setgrps='$d_setgrps'
21457 d_sethent='$d_sethent'
21458 d_sethostent_r='$d_sethostent_r'
21459 d_setitimer='$d_setitimer'
21460 d_setlinebuf='$d_setlinebuf'
21461 d_setlocale='$d_setlocale'
21462 d_setlocale_r='$d_setlocale_r'
21463 d_setnent='$d_setnent'
21464 d_setnetent_r='$d_setnetent_r'
21465 d_setpent='$d_setpent'
21466 d_setpgid='$d_setpgid'
21467 d_setpgrp2='$d_setpgrp2'
21468 d_setpgrp='$d_setpgrp'
21469 d_setprior='$d_setprior'
21470 d_setproctitle='$d_setproctitle'
21471 d_setprotoent_r='$d_setprotoent_r'
21472 d_setpwent='$d_setpwent'
21473 d_setpwent_r='$d_setpwent_r'
21474 d_setregid='$d_setregid'
21475 d_setresgid='$d_setresgid'
21476 d_setresuid='$d_setresuid'
21477 d_setreuid='$d_setreuid'
21478 d_setrgid='$d_setrgid'
21479 d_setruid='$d_setruid'
21480 d_setsent='$d_setsent'
21481 d_setservent_r='$d_setservent_r'
21482 d_setsid='$d_setsid'
21483 d_setvbuf='$d_setvbuf'
21487 d_shmatprototype='$d_shmatprototype'
21488 d_shmctl='$d_shmctl'
21490 d_shmget='$d_shmget'
21491 d_sigaction='$d_sigaction'
21492 d_sigprocmask='$d_sigprocmask'
21493 d_sigsetjmp='$d_sigsetjmp'
21494 d_snprintf='$d_snprintf'
21495 d_sockatmark='$d_sockatmark'
21496 d_sockatmarkproto='$d_sockatmarkproto'
21497 d_socket='$d_socket'
21498 d_socklen_t='$d_socklen_t'
21499 d_sockpair='$d_sockpair'
21500 d_socks5_init='$d_socks5_init'
21501 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21503 d_srand48_r='$d_srand48_r'
21504 d_srandom_r='$d_srandom_r'
21505 d_sresgproto='$d_sresgproto'
21506 d_sresuproto='$d_sresuproto'
21507 d_statblks='$d_statblks'
21508 d_statfs_f_flags='$d_statfs_f_flags'
21509 d_statfs_s='$d_statfs_s'
21510 d_statvfs='$d_statvfs'
21511 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21512 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21513 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21514 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21515 d_stdio_stream_array='$d_stdio_stream_array'
21516 d_stdiobase='$d_stdiobase'
21517 d_stdstdio='$d_stdstdio'
21518 d_strchr='$d_strchr'
21519 d_strcoll='$d_strcoll'
21520 d_strctcpy='$d_strctcpy'
21521 d_strerrm='$d_strerrm'
21522 d_strerror='$d_strerror'
21523 d_strerror_r='$d_strerror_r'
21524 d_strftime='$d_strftime'
21525 d_strlcat='$d_strlcat'
21526 d_strlcpy='$d_strlcpy'
21527 d_strtod='$d_strtod'
21528 d_strtol='$d_strtol'
21529 d_strtold='$d_strtold'
21530 d_strtoll='$d_strtoll'
21531 d_strtoq='$d_strtoq'
21532 d_strtoul='$d_strtoul'
21533 d_strtoull='$d_strtoull'
21534 d_strtouq='$d_strtouq'
21535 d_strxfrm='$d_strxfrm'
21536 d_suidsafe='$d_suidsafe'
21537 d_symlink='$d_symlink'
21538 d_syscall='$d_syscall'
21539 d_syscallproto='$d_syscallproto'
21540 d_sysconf='$d_sysconf'
21541 d_sysernlst='$d_sysernlst'
21542 d_syserrlst='$d_syserrlst'
21543 d_system='$d_system'
21544 d_tcgetpgrp='$d_tcgetpgrp'
21545 d_tcsetpgrp='$d_tcsetpgrp'
21546 d_telldir='$d_telldir'
21547 d_telldirproto='$d_telldirproto'
21550 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21551 d_tm_tm_zone='$d_tm_tm_zone'
21552 d_tmpnam_r='$d_tmpnam_r'
21553 d_truncate='$d_truncate'
21554 d_ttyname_r='$d_ttyname_r'
21555 d_tzname='$d_tzname'
21556 d_u32align='$d_u32align'
21557 d_ualarm='$d_ualarm'
21560 d_union_semun='$d_union_semun'
21561 d_unordered='$d_unordered'
21562 d_unsetenv='$d_unsetenv'
21563 d_usleep='$d_usleep'
21564 d_usleepproto='$d_usleepproto'
21566 d_vendorarch='$d_vendorarch'
21567 d_vendorbin='$d_vendorbin'
21568 d_vendorlib='$d_vendorlib'
21569 d_vendorscript='$d_vendorscript'
21571 d_void_closedir='$d_void_closedir'
21572 d_voidsig='$d_voidsig'
21573 d_voidtty='$d_voidtty'
21574 d_volatile='$d_volatile'
21575 d_vprintf='$d_vprintf'
21576 d_vsnprintf='$d_vsnprintf'
21578 d_waitpid='$d_waitpid'
21579 d_wcstombs='$d_wcstombs'
21580 d_wctomb='$d_wctomb'
21581 d_writev='$d_writev'
21584 db_hashtype='$db_hashtype'
21585 db_prefixtype='$db_prefixtype'
21586 db_version_major='$db_version_major'
21587 db_version_minor='$db_version_minor'
21588 db_version_patch='$db_version_patch'
21589 defvoidused='$defvoidused'
21590 direntrytype='$direntrytype'
21593 doublesize='$doublesize'
21595 drand48_r_proto='$drand48_r_proto'
21596 dynamic_ext='$dynamic_ext'
21602 endgrent_r_proto='$endgrent_r_proto'
21603 endhostent_r_proto='$endhostent_r_proto'
21604 endnetent_r_proto='$endnetent_r_proto'
21605 endprotoent_r_proto='$endprotoent_r_proto'
21606 endpwent_r_proto='$endpwent_r_proto'
21607 endservent_r_proto='$endservent_r_proto'
21608 eunicefix='$eunicefix'
21611 extensions='$extensions'
21613 fflushNULL='$fflushNULL'
21614 fflushall='$fflushall'
21616 firstmakefile='$firstmakefile'
21618 fpossize='$fpossize'
21619 fpostype='$fpostype'
21620 freetype='$freetype'
21623 full_csh='$full_csh'
21624 full_sed='$full_sed'
21625 gccansipedantic='$gccansipedantic'
21626 gccosandvers='$gccosandvers'
21627 gccversion='$gccversion'
21628 getgrent_r_proto='$getgrent_r_proto'
21629 getgrgid_r_proto='$getgrgid_r_proto'
21630 getgrnam_r_proto='$getgrnam_r_proto'
21631 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21632 gethostbyname_r_proto='$gethostbyname_r_proto'
21633 gethostent_r_proto='$gethostent_r_proto'
21634 getlogin_r_proto='$getlogin_r_proto'
21635 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21636 getnetbyname_r_proto='$getnetbyname_r_proto'
21637 getnetent_r_proto='$getnetent_r_proto'
21638 getprotobyname_r_proto='$getprotobyname_r_proto'
21639 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21640 getprotoent_r_proto='$getprotoent_r_proto'
21641 getpwent_r_proto='$getpwent_r_proto'
21642 getpwnam_r_proto='$getpwnam_r_proto'
21643 getpwuid_r_proto='$getpwuid_r_proto'
21644 getservbyname_r_proto='$getservbyname_r_proto'
21645 getservbyport_r_proto='$getservbyport_r_proto'
21646 getservent_r_proto='$getservent_r_proto'
21647 getspnam_r_proto='$getspnam_r_proto'
21648 gidformat='$gidformat'
21654 gmtime_r_proto='$gmtime_r_proto'
21655 gnulibc_version='$gnulibc_version'
21657 groupcat='$groupcat'
21658 groupstype='$groupstype'
21661 h_sysfile='$h_sysfile'
21664 html1dir='$html1dir'
21665 html1direxp='$html1direxp'
21666 html3dir='$html3dir'
21667 html3direxp='$html3direxp'
21676 i_arpainet='$i_arpainet'
21677 i_bsdioctl='$i_bsdioctl'
21681 i_dirent='$i_dirent'
21687 i_fp_class='$i_fp_class'
21690 i_ieeefp='$i_ieeefp'
21691 i_inttypes='$i_inttypes'
21692 i_langinfo='$i_langinfo'
21693 i_libutil='$i_libutil'
21694 i_limits='$i_limits'
21695 i_locale='$i_locale'
21696 i_machcthr='$i_machcthr'
21697 i_malloc='$i_malloc'
21699 i_memory='$i_memory'
21700 i_mntent='$i_mntent'
21703 i_neterrno='$i_neterrno'
21704 i_netinettcp='$i_netinettcp'
21708 i_pthread='$i_pthread'
21710 i_rpcsvcdbm='$i_rpcsvcdbm'
21713 i_shadow='$i_shadow'
21715 i_stdarg='$i_stdarg'
21716 i_stddef='$i_stddef'
21717 i_stdlib='$i_stdlib'
21718 i_string='$i_string'
21719 i_sunmath='$i_sunmath'
21720 i_sysaccess='$i_sysaccess'
21721 i_sysdir='$i_sysdir'
21722 i_sysfile='$i_sysfile'
21723 i_sysfilio='$i_sysfilio'
21725 i_sysioctl='$i_sysioctl'
21726 i_syslog='$i_syslog'
21727 i_sysmman='$i_sysmman'
21728 i_sysmode='$i_sysmode'
21729 i_sysmount='$i_sysmount'
21730 i_sysndir='$i_sysndir'
21731 i_sysparam='$i_sysparam'
21732 i_sysresrc='$i_sysresrc'
21733 i_syssecrt='$i_syssecrt'
21734 i_sysselct='$i_sysselct'
21735 i_syssockio='$i_syssockio'
21736 i_sysstat='$i_sysstat'
21737 i_sysstatfs='$i_sysstatfs'
21738 i_sysstatvfs='$i_sysstatvfs'
21739 i_systime='$i_systime'
21740 i_systimek='$i_systimek'
21741 i_systimes='$i_systimes'
21742 i_systypes='$i_systypes'
21743 i_sysuio='$i_sysuio'
21745 i_sysutsname='$i_sysutsname'
21746 i_sysvfs='$i_sysvfs'
21747 i_syswait='$i_syswait'
21748 i_termio='$i_termio'
21749 i_termios='$i_termios'
21751 i_unistd='$i_unistd'
21754 i_values='$i_values'
21755 i_varargs='$i_varargs'
21756 i_varhdr='$i_varhdr'
21758 ignore_versioned_solibs='$ignore_versioned_solibs'
21759 inc_version_list='$inc_version_list'
21760 inc_version_list_init='$inc_version_list_init'
21763 installarchlib='$installarchlib'
21764 installbin='$installbin'
21765 installhtml1dir='$installhtml1dir'
21766 installhtml3dir='$installhtml3dir'
21767 installman1dir='$installman1dir'
21768 installman3dir='$installman3dir'
21769 installprefix='$installprefix'
21770 installprefixexp='$installprefixexp'
21771 installprivlib='$installprivlib'
21772 installscript='$installscript'
21773 installsitearch='$installsitearch'
21774 installsitebin='$installsitebin'
21775 installsitehtml1dir='$installsitehtml1dir'
21776 installsitehtml3dir='$installsitehtml3dir'
21777 installsitelib='$installsitelib'
21778 installsiteman1dir='$installsiteman1dir'
21779 installsiteman3dir='$installsiteman3dir'
21780 installsitescript='$installsitescript'
21781 installstyle='$installstyle'
21782 installusrbinperl='$installusrbinperl'
21783 installvendorarch='$installvendorarch'
21784 installvendorbin='$installvendorbin'
21785 installvendorhtml1dir='$installvendorhtml1dir'
21786 installvendorhtml3dir='$installvendorhtml3dir'
21787 installvendorlib='$installvendorlib'
21788 installvendorman1dir='$installvendorman1dir'
21789 installvendorman3dir='$installvendorman3dir'
21790 installvendorscript='$installvendorscript'
21792 issymlink='$issymlink'
21793 ivdformat='$ivdformat'
21796 known_extensions='$known_extensions'
21799 lddlflags='$lddlflags'
21801 ldflags_uselargefiles='$ldflags_uselargefiles'
21802 ldlibpthname='$ldlibpthname'
21809 libsdirs='$libsdirs'
21810 libsfiles='$libsfiles'
21811 libsfound='$libsfound'
21812 libspath='$libspath'
21813 libswanted='$libswanted'
21814 libswanted_uselargefiles='$libswanted_uselargefiles'
21820 localtime_r_proto='$localtime_r_proto'
21821 locincpth='$locincpth'
21822 loclibpth='$loclibpth'
21823 longdblsize='$longdblsize'
21824 longlongsize='$longlongsize'
21825 longsize='$longsize'
21829 lseeksize='$lseeksize'
21830 lseektype='$lseektype'
21835 make_set_make='$make_set_make'
21836 mallocobj='$mallocobj'
21837 mallocsrc='$mallocsrc'
21839 madlyobj='$madlyobj'
21840 madlysrc='$madlysrc'
21841 malloctype='$malloctype'
21843 man1direxp='$man1direxp'
21846 man3direxp='$man3direxp'
21848 mips_type='$mips_type'
21849 mistrustnm='$mistrustnm'
21851 mmaptype='$mmaptype'
21852 modetype='$modetype'
21854 multiarch='$multiarch'
21856 myarchname='$myarchname'
21857 mydomain='$mydomain'
21858 myhostname='$myhostname'
21861 need_va_copy='$need_va_copy'
21862 netdb_hlen_type='$netdb_hlen_type'
21863 netdb_host_type='$netdb_host_type'
21864 netdb_name_type='$netdb_name_type'
21865 netdb_net_type='$netdb_net_type'
21868 nm_so_opt='$nm_so_opt'
21869 nonxs_ext='$nonxs_ext'
21871 nvEUformat='$nvEUformat'
21872 nvFUformat='$nvFUformat'
21873 nvGUformat='$nvGUformat'
21874 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21875 nveformat='$nveformat'
21876 nvfformat='$nvfformat'
21877 nvgformat='$nvgformat'
21880 o_nonblock='$o_nonblock'
21882 old_pthread_create_joinable='$old_pthread_create_joinable'
21883 optimize='$optimize'
21884 orderlib='$orderlib'
21887 otherlibdirs='$otherlibdirs'
21891 patchlevel='$patchlevel'
21892 path_sep='$path_sep'
21895 perl_patchlevel='$perl_patchlevel'
21896 perladmin='$perladmin'
21897 perllibs='$perllibs'
21898 perlpath='$perlpath'
21900 phostname='$phostname'
21906 prefixexp='$prefixexp'
21908 privlibexp='$privlibexp'
21909 procselfexe='$procselfexe'
21910 prototype='$prototype'
21912 quadkind='$quadkind'
21913 quadtype='$quadtype'
21914 randbits='$randbits'
21915 randfunc='$randfunc'
21916 random_r_proto='$random_r_proto'
21917 randseedtype='$randseedtype'
21919 rd_nodata='$rd_nodata'
21920 readdir64_r_proto='$readdir64_r_proto'
21921 readdir_r_proto='$readdir_r_proto'
21922 revision='$revision'
21927 sPRIEUldbl='$sPRIEUldbl'
21928 sPRIFUldbl='$sPRIFUldbl'
21929 sPRIGUldbl='$sPRIGUldbl'
21930 sPRIXU64='$sPRIXU64'
21932 sPRIeldbl='$sPRIeldbl'
21933 sPRIfldbl='$sPRIfldbl'
21934 sPRIgldbl='$sPRIgldbl'
21939 sSCNfldbl='$sSCNfldbl'
21940 sched_yield='$sched_yield'
21941 scriptdir='$scriptdir'
21942 scriptdirexp='$scriptdirexp'
21944 seedfunc='$seedfunc'
21945 selectminbits='$selectminbits'
21946 selecttype='$selecttype'
21947 sendmail='$sendmail'
21948 setgrent_r_proto='$setgrent_r_proto'
21949 sethostent_r_proto='$sethostent_r_proto'
21950 setlocale_r_proto='$setlocale_r_proto'
21951 setnetent_r_proto='$setnetent_r_proto'
21952 setprotoent_r_proto='$setprotoent_r_proto'
21953 setpwent_r_proto='$setpwent_r_proto'
21954 setservent_r_proto='$setservent_r_proto'
21957 sharpbang='$sharpbang'
21958 shmattype='$shmattype'
21959 shortsize='$shortsize'
21962 sig_count='$sig_count'
21963 sig_name='$sig_name'
21964 sig_name_init='$sig_name_init'
21966 sig_num_init='$sig_num_init'
21967 sig_size='$sig_size'
21968 signal_t='$signal_t'
21969 sitearch='$sitearch'
21970 sitearchexp='$sitearchexp'
21972 sitebinexp='$sitebinexp'
21973 sitehtml1dir='$sitehtml1dir'
21974 sitehtml1direxp='$sitehtml1direxp'
21975 sitehtml3dir='$sitehtml3dir'
21976 sitehtml3direxp='$sitehtml3direxp'
21978 sitelib_stem='$sitelib_stem'
21979 sitelibexp='$sitelibexp'
21980 siteman1dir='$siteman1dir'
21981 siteman1direxp='$siteman1direxp'
21982 siteman3dir='$siteman3dir'
21983 siteman3direxp='$siteman3direxp'
21984 siteprefix='$siteprefix'
21985 siteprefixexp='$siteprefixexp'
21986 sitescript='$sitescript'
21987 sitescriptexp='$sitescriptexp'
21988 sizesize='$sizesize'
21989 sizetype='$sizetype'
21993 sockethdr='$sockethdr'
21994 socketlib='$socketlib'
21995 socksizetype='$socksizetype'
21997 spackage='$spackage'
21998 spitshell='$spitshell'
21999 srand48_r_proto='$srand48_r_proto'
22000 srandom_r_proto='$srandom_r_proto'
22002 ssizetype='$ssizetype'
22003 startperl='$startperl'
22005 static_ext='$static_ext'
22007 stdio_base='$stdio_base'
22008 stdio_bufsiz='$stdio_bufsiz'
22009 stdio_cnt='$stdio_cnt'
22010 stdio_filbuf='$stdio_filbuf'
22011 stdio_ptr='$stdio_ptr'
22012 stdio_stream_array='$stdio_stream_array'
22013 strerror_r_proto='$strerror_r_proto'
22016 subversion='$subversion'
22020 targetarch='$targetarch'
22024 timeincl='$timeincl'
22025 timetype='$timetype'
22026 tmpnam_r_proto='$tmpnam_r_proto'
22032 ttyname_r_proto='$ttyname_r_proto'
22041 uidformat='$uidformat'
22047 uquadtype='$uquadtype'
22048 use5005threads='$use5005threads'
22049 use64bitall='$use64bitall'
22050 use64bitint='$use64bitint'
22051 usecrosscompile='$usecrosscompile'
22053 usefaststdio='$usefaststdio'
22054 useithreads='$useithreads'
22055 uselargefiles='$uselargefiles'
22056 uselongdouble='$uselongdouble'
22057 usemallocwrap='$usemallocwrap'
22058 usemorebits='$usemorebits'
22059 usemultiplicity='$usemultiplicity'
22060 usemymalloc='$usemymalloc'
22062 useopcode='$useopcode'
22063 useperlio='$useperlio'
22064 useposix='$useposix'
22065 usereentrant='$usereentrant'
22066 userelocatableinc='$userelocatableinc'
22068 useshrplib='$useshrplib'
22069 usesitecustomize='$usesitecustomize'
22070 usesocks='$usesocks'
22071 usethreads='$usethreads'
22072 usevendorprefix='$usevendorprefix'
22073 usevfork='$usevfork'
22076 uvXUformat='$uvXUformat'
22077 uvoformat='$uvoformat'
22080 uvuformat='$uvuformat'
22081 uvxformat='$uvxformat'
22082 vendorarch='$vendorarch'
22083 vendorarchexp='$vendorarchexp'
22084 vendorbin='$vendorbin'
22085 vendorbinexp='$vendorbinexp'
22086 vendorhtml1dir='$vendorhtml1dir'
22087 vendorhtml1direxp='$vendorhtml1direxp'
22088 vendorhtml3dir='$vendorhtml3dir'
22089 vendorhtml3direxp='$vendorhtml3direxp'
22090 vendorlib='$vendorlib'
22091 vendorlib_stem='$vendorlib_stem'
22092 vendorlibexp='$vendorlibexp'
22093 vendorman1dir='$vendorman1dir'
22094 vendorman1direxp='$vendorman1direxp'
22095 vendorman3dir='$vendorman3dir'
22096 vendorman3direxp='$vendorman3direxp'
22097 vendorprefix='$vendorprefix'
22098 vendorprefixexp='$vendorprefixexp'
22099 vendorscript='$vendorscript'
22100 vendorscriptexp='$vendorscriptexp'
22102 version_patchlevel_string='$version_patchlevel_string'
22103 versiononly='$versiononly'
22105 voidflags='$voidflags'
22108 yaccflags='$yaccflags'
22113 : Add in command line options if available
22114 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22116 : add special variables
22117 $test -f $src/patchlevel.h && \
22118 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22119 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22120 echo "PERL_CONFIG_SH=true" >>config.sh
22122 : propagate old symbols
22123 if $test -f UU/config.sh; then
22124 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22125 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22126 $sort | $uniq -u >UU/oldsyms
22127 set X `cat UU/oldsyms`
22133 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22135 echo "# Variables propagated from previous config.sh file." >>config.sh
22136 for sym in `cat UU/oldsyms`; do
22137 echo " Propagating $hint variable "'$'"$sym..."
22138 eval 'tmp="$'"${sym}"'"'
22140 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22146 : Finish up by extracting the .SH files
22150 echo "Extraction done."
22160 If you'd like to make any changes to the config.sh file before I begin
22161 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22164 rp="Press return or use a shell escape to edit config.sh:"
22169 *) : in case they cannot read
22170 sh 1>&4 -c "$ans";;
22175 : if this fails, just run all the .SH files by hand
22184 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22191 Now you need to generate make dependencies by running "$make depend".
22192 You might prefer to run it in background: "$make depend > makedepend.out &"
22193 It can take a while, so you might not want to run it right now.
22198 rp="Run $make depend now?"
22202 $make depend && echo "Now you must run '$make'."
22205 echo "You must run '$make depend' then '$make'."
22208 elif test -f [Mm]akefile; then
22210 echo "Now you must run a $make."
22212 echo "Configure done."
22215 if $test -f Policy.sh; then
22218 If you compile $package on a different machine or from a different object
22219 directory, copy the Policy.sh file from this object directory to the
22220 new one before you run Configure -- this will help you with most of
22221 the policy defaults.
22225 if $test -f config.msg; then
22226 echo "Hmm. I also noted the following information while running:"
22228 $cat config.msg >&4
22231 $rm -f kit*isdone ark*isdone