3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Mon Feb 3 15:49:19 EET 2003 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
53 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
54 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
55 *** Please read the README.plan9 for further instructions.
56 *** Cannot continue, aborting.
62 : compute my invocation name
66 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
71 : Proper separator for the PATH environment variable
73 : On OS/2 this directory should exist if this is not floppy only system :-]
74 if test -d c:/. ; then
75 if test -n "$OS2_SHELL"; then
77 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
78 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
79 elif test -n "$DJGPP"; then
80 case "X${MACHTYPE:-nonesuchmach}" in
88 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
89 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
90 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
91 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
92 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
93 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
94 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
95 paths="$paths /sbin /usr/sbin /usr/libexec"
96 paths="$paths /system/gnu_library/bin"
100 case "$p_$PATH$p_" in
102 *) test -d $p && PATH=$PATH$p_$p ;;
109 : shall we be using ksh?
115 if (PATH=.; alias -x) >/dev/null 2>&1; then
118 if test -f /hp-ux -a -f /bin/ksh; then
119 needksh='to avoid sh bug in "here document" expansion'
121 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
122 if test X`/usr/bin/uname -v` = X4; then
123 avoidksh="to avoid AIX 4's /bin/sh"
127 if test -f /osf_boot -a -f /usr/sbin/setld; then
128 if test X`/usr/bin/uname -s` = XOSF1; then
129 avoidksh="to avoid Digital UNIX' ksh"
131 unset BIN_SH # if this is 'xpg4' sh will start up ksh
134 case "$inksh/$needksh" in
141 case "$inksh/$avoidksh" in
147 case "$inksh/$needksh-$avoidksh-" in
150 (I see you are using the Korn shell. Some ksh's blow up on $me,
151 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
158 echo "(Feeding myself to $newsh $reason.)"
160 Configure|*/Configure) exec $newsh $0 "$@";;
161 *) exec $newsh Configure "$@";;
166 : if needed set CDPATH to a harmless value that is not chatty
167 : avoid bash 2.02 problems with empty CDPATH.
171 *bash*) CDPATH='.' ;;
176 : Configure runs within the UU subdirectory
177 test -d UU || mkdir UU
384 endhostent_r_proto=''
390 endprotoent_r_proto=''
396 endservent_r_proto=''
446 gethostbyaddr_r_proto=''
448 gethostbyname_r_proto=''
450 gethostent_r_proto=''
462 getnetbyaddr_r_proto=''
464 getnetbyname_r_proto=''
478 d_getprotobyname_r=''
479 getprotobyname_r_proto=''
480 d_getprotobynumber_r=''
481 getprotobynumber_r_proto=''
483 getprotoent_r_proto=''
495 getservbyname_r_proto=''
497 getservbyport_r_proto=''
499 getservent_r_proto=''
575 d_old_pthread_create_joinable=''
576 old_pthread_create_joinable=''
615 sethostent_r_proto=''
632 setprotoent_r_proto=''
644 setservent_r_proto=''
688 d_stdio_ptr_lval_nochange_cnt=''
689 d_stdio_ptr_lval_sets_cnt=''
890 inc_version_list_init=''
909 ignore_versioned_solibs=''
968 d_perl_otherlibdirs=''
982 version_patchlevel_string=''
997 nv_preserves_uv_bits=''
1086 installsitescript=''
1101 d_stdio_stream_array=''
1102 stdio_stream_array=''
1112 ccflags_uselargefiles=''
1113 ldflags_uselargefiles=''
1114 libswanted_uselargefiles=''
1134 installvendorarch=''
1141 installvendorhtml1=''
1144 installvendorhtml3=''
1152 installvendorman1=''
1155 installvendorman3=''
1162 installvendorscript=''
1176 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1179 : We must find out about Eunice early
1181 if test -f /etc/unixtovms; then
1182 eunicefix=/etc/unixtovms
1184 if test -f /etc/unixtovms.exe; then
1185 eunicefix=/etc/unixtovms.exe
1188 : Set executable suffix now -- needed before hints available
1189 if test -f "/libs/version.library"; then
1192 elif test -f "/system/gnu_library/bin/ar.pm"; then
1195 elif test -n "$DJGPP"; then
1198 elif test -d c:/. ; then
1204 : Possible local include directories to search.
1205 : Set locincpth to "" in a hint file to defeat local include searches.
1206 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1207 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1209 : no include file wanted by default
1215 : Trailing extension. Override this in a hint file, if needed.
1216 : Extra object files, if any, needed on this platform.
1220 : change the next line if compiling for Xenix/286 on Xenix/386
1221 xlibpth='/usr/lib/386 /lib/386'
1222 : Possible local library directories to search.
1223 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1224 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1226 : general looking path for locating libraries
1227 glibpth="/lib /usr/lib $xlibpth"
1228 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1229 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1230 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1232 : Private path used by Configure to find libraries. Its value
1233 : is prepended to libpth. This variable takes care of special
1234 : machines, like the mips. Usually, it should be empty.
1237 : default library list
1239 : some systems want to use only the non-versioned libso:s
1240 ignore_versioned_solibs=''
1241 : full support for void wanted by default
1247 : set useposix=false in your hint file to disable the POSIX extension.
1249 : set useopcode=false in your hint file to disable the Opcode extension.
1252 ccflags_uselargefiles=''
1253 ldflags_uselargefiles=''
1254 libswanted_uselargefiles=''
1255 : set usemultiplicity on the Configure command line to enable multiplicity.
1256 : set usesocks on the Configure command line to enable socks.
1258 : set usethreads on the Configure command line to enable threads.
1259 usereentrant='undef'
1260 : List of libraries we want.
1261 : If anyone needs -lnet, put it in a hint file.
1262 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1263 libswanted="$libswanted dld ld sun m c cposix posix"
1264 libswanted="$libswanted ndir dir crypt sec"
1265 libswanted="$libswanted ucb bsd BSD PW x util rt posix4"
1266 : We probably want to search /usr/shlib before most other libraries.
1267 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1268 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1269 glibpth="/usr/shlib $glibpth"
1270 : Do not use vfork unless overridden by a hint file.
1273 : Find the basic shell for Bourne shell scripts
1277 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1280 if test -f "$xxx"; then
1283 : Build up a list and do a single loop so we can 'break' out.
1284 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1285 for xxx in sh bash ksh pdksh ash; do
1287 try="$try ${p}/${xxx}"
1291 if test -f "$xxx"; then
1294 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1297 elif test -f "$xxx.exe"; then
1308 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1310 Usually it's in /bin/sh. How did you even get this far?
1311 Please contact me (Perl Maintainers) at perlbug@perl.org and
1312 we'll try to straighten this all out.
1318 : see if sh knows # comments
1319 if `$sh -c '#' >/dev/null 2>&1`; then
1323 test -f $xcat$_exe || xcat=/usr/bin/cat
1324 if test ! -f $xcat$_exe; then
1325 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1326 if test -f $p/cat$_exe; then
1331 if test ! -f $xcat$_exe; then
1332 echo "Can't find cat anywhere!"
1336 echo "#!$xcat" >sharp
1340 if test -s today; then
1343 echo "#! $xcat" > sharp
1347 if test -s today; then
1355 echo "Your $sh doesn't grok # comments--I will strip them later on."
1358 echo "exec grep -v '^[ ]*#'" >spitshell
1360 $eunicefix spitshell
1361 spitshell=`pwd`/spitshell
1363 echo "I presume that if # doesn't work, #! won't work either!"
1368 : figure out how to guarantee sh startup
1370 '') startsh=${sharpbang}${sh} ;;
1382 : echo "Yup, it does."
1384 echo "Hmm... '$startsh' does not guarantee sh startup..."
1385 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1390 : Save command line options in file UU/cmdline.opt for later use in
1391 : generating config.sh.
1392 cat > cmdline.opt <<EOSH
1393 # Configure command line arguments.
1402 cat >>cmdline.opt <<EOSH
1403 config_arg$argn='$arg'
1405 # Extreme backslashitis: replace each ' by '"'"'
1406 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1409 arg_exp=`cat cmdl.opt`
1410 args_exp="$args_exp$args_sep'$arg_exp'"
1411 argn=`expr $argn + 1`
1414 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1415 # used by ./hints/os2.sh
1418 : produce awk script to parse command line options
1419 cat >options.awk <<'EOF'
1421 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1423 len = length(optstr);
1424 for (i = 1; i <= len; i++) {
1425 c = substr(optstr, i, 1);
1426 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1437 if (substr(str, 1, 1) != "-") {
1438 printf("'%s'\n", str);
1442 for (i = 2; i <= len; i++) {
1443 c = substr(str, i, 1);
1445 printf("-%s\n", substr(str, i));
1451 printf("'%s'\n", substr(str, i + 1));
1464 : process the command line options
1465 set X `for arg in "$@"; do echo "X$arg"; done |
1466 sed -e s/X// | awk -f options.awk`
1471 : set up default values
1481 rm -f optdef.sh posthint.sh
1482 cat >optdef.sh <<EOS
1488 while test $# -gt 0; do
1490 -d) shift; fastread=yes;;
1491 -e) shift; alldone=cont;;
1495 if test -r "$1"; then
1498 echo "$me: cannot read config file $1." >&2
1503 -h) shift; error=true;;
1504 -r) shift; reuseval=true;;
1505 -s) shift; silent=true; realsilent=true;;
1506 -E) shift; alldone=exit;;
1507 -K) shift; knowitall=true;;
1508 -O) shift; override=true;;
1509 -S) shift; silent=true; extractsh=true;;
1514 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1515 echo "$me: ignoring -D $1" >&2
1518 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1519 *) echo "$1='define'" >> optdef.sh;;
1526 *=) echo "$1" >> optdef.sh;;
1528 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1529 echo "$me: ignoring -U $1" >&2
1531 *) echo "$1='undef'" >> optdef.sh;;
1542 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1546 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1547 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1553 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1554 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1555 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1556 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1557 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1558 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1564 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1566 echo "$yyy=''" >> posthint.sh ;;
1571 echo "$yyy='$zzz'" >> posthint.sh ;;
1573 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1575 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1580 echo "$yyy=$zzz" >> posthint.sh ;;
1581 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1585 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1588 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1596 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1597 [-U symbol] [-U symbol=] [-A command:symbol...]
1598 -d : use defaults for all answers.
1599 -e : go on without questioning past the production of config.sh.
1600 -f : specify an alternate default configuration file.
1601 -h : print this help message and exit (with an error status).
1602 -r : reuse C symbols value if possible (skips costly nm extraction).
1603 -s : silent mode, only echoes questions and essential information.
1604 -D : define symbol to have some value:
1605 -D symbol symbol gets the value 'define'
1606 -D symbol=value symbol gets the value 'value'
1607 -E : stop at the end of questions, after having produced config.sh.
1608 -K : do not use unless you know what you are doing.
1609 -O : let -D and -U override definitions from loaded configuration file.
1610 -S : perform variable substitutions on all .SH files (can mix with -f)
1611 -U : undefine symbol:
1612 -U symbol symbol gets the value 'undef'
1613 -U symbol= symbol gets completely empty
1614 -A : manipulate symbol after the platform specific hints have been applied:
1615 -A symbol=value append " "value to symbol
1616 -A append:symbol=value append value to symbol
1617 -A define:symbol=value define symbol to have value
1618 -A clear:symbol define symbol to be ''
1619 -A define:symbol define symbol to be 'define'
1620 -A eval:symbol=value define symbol to be eval of value
1621 -A prepend:symbol=value prepend value to symbol
1622 -A undef:symbol define symbol to be 'undef'
1623 -A undef:symbol= define symbol to be ''
1624 -V : print version number and exit (with a zero status).
1631 case "$fastread$alldone" in
1634 case "$extractsh" in
1637 if test ! -t 0; then
1638 echo "Say 'sh Configure', not 'sh <Configure'"
1648 true) exec 1>/dev/null;;
1651 : run the defines and the undefines, if any, but leave the file out there...
1654 : create the posthint manipulation script and leave the file out there...
1659 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1660 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1661 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1662 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1663 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1666 : Some greps do not return status, grrr.
1667 echo "grimblepritz" >grimble
1668 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1670 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1676 : the following should work in any shell
1680 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1681 cat >contains <<'EOSS'
1682 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1687 : Find the path to the source tree
1690 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1694 *) src=`cd ../$src && pwd` ;;
1707 if test -f $rsrc/Configure && \
1708 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1710 : found it, so we are ok.
1713 for src in . .. ../.. ../../.. ../../../..; do
1714 if test -f ../$src/Configure && \
1715 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1726 Sorry, I can't seem to locate the source dir for $package. Please start
1727 Configure with an explicit path -- i.e. /some/path/Configure.
1735 echo "Sources for $package found in \"$src\"." >&4
1739 : script used to extract .SH files with variable substitutions
1740 cat >extract <<'EOS'
1742 echo "Doing variable substitutions on .SH files..."
1743 if test -f MANIFEST; then
1744 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1746 echo "(Looking for .SH files under the source directory.)"
1747 set x `(cd "$src"; find . -name "*.SH" -print)`
1751 0) set x `(cd "$src"; echo *.SH)`; shift;;
1753 if test ! -f "$src/$1"; then
1759 while test $name; do
1760 if test ! -d "$name"; then
1761 create="$name $create";
1762 name=`echo $name | sed -e "s|^[^/]*$||"`;
1763 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1768 for file in $create; do
1777 dir=`expr X$file : 'X\(.*\)/'`
1778 file=`expr X$file : 'X.*/\(.*\)'`
1779 (cd "$dir" && . ./$file)
1789 dir=`expr X$file : 'X\(.*\)/'`
1790 file=`expr X$file : 'X.*/\(.*\)'`
1791 (set x $dir; shift; eval $mkdir_p)
1792 sh <"$src/$dir/$file"
1801 if test -f "$src/config_h.SH"; then
1802 if test ! -f config.h; then
1803 : oops, they left it out of MANIFEST, probably, so do it anyway.
1804 . "$src/config_h.SH"
1809 : extract files and exit if asked to do so
1810 case "$extractsh" in
1812 case "$realsilent" in
1816 case "$config_sh" in
1817 '') config_sh='config.sh';;
1820 echo "Fetching answers from $config_sh..."
1823 test "$override" && . ./optdef.sh
1827 echo "Extraction done."
1832 : Eunice requires " " instead of "", can you believe it
1835 echo "Beginning of configuration questions for $package."
1837 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1839 : first determine how to suppress newline on echo command
1841 echo "Checking echo to see how to suppress newlines..."
1842 (echo "hi there\c" ; echo " ") >.echotmp
1843 if $contains c .echotmp >/dev/null 2>&1 ; then
1854 echo $n "The star should be here-->$c"
1858 : Now test for existence of everything in MANIFEST
1860 if test -f "$rsrc/MANIFEST"; then
1861 echo "First let's make sure your kit is complete. Checking..." >&4
1862 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1865 for filelist in x??; do
1866 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1868 if test -s missing; then
1872 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1874 You have the option of continuing the configuration process, despite the
1875 distinct possibility that your kit is damaged, by typing 'y'es. If you
1876 do, don't blame me if something goes wrong. I advise you to type 'n'o
1877 and contact the author (perlbug@perl.org).
1880 echo $n "Continue? [n] $c" >&4
1884 echo "Continuing..." >&4
1888 echo "ABORTING..." >&4
1893 echo "Looks good..."
1896 echo "There is no MANIFEST file. I hope your kit is complete !"
1901 : Find the appropriate value for a newline for tr
1902 if test -n "$DJGPP"; then
1905 if test X"$trnl" = X; then
1906 case "`echo foo|tr '\n' x 2>/dev/null`" in
1910 if test X"$trnl" = X; then
1911 case "`echo foo|tr '\012' x 2>/dev/null`" in
1912 foox) trnl='\012' ;;
1915 if test X"$trnl" = X; then
1916 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1917 fooxy) trnl='\n\r' ;;
1920 if test X"$trnl" = X; then
1923 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1929 : compute the number of columns on the terminal for proper question formatting
1934 : set up the echo used in my read
1935 myecho="case \"\$xxxm\" in
1936 '') echo $n \"\$rp $c\" >&4;;
1938 '') echo $n \"[\$xxxm] $c\";;
1940 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1942 echo $n \"[\$xxxm] $c\" >&4
1944 echo $n \"\$rp [\$xxxm] $c\" >&4
1950 : now set up to do reads with possible shell escape and default assignment
1956 case "\$fastread" in
1957 yes) case "\$dflt" in
1960 case "\$silent-\$rp" in
1965 *) case "\$silent" in
1966 true) case "\$rp" in
1971 while expr "X\$ans" : "X!" >/dev/null; do
1975 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1983 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1992 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1997 echo "(OK, I'll run with -d after this question.)" >&4
2000 echo "*** Sorry, \$1 not supported yet." >&4
2010 echo "*** Substitution done -- please confirm."
2012 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2017 echo "*** Error -- try again."
2024 case "\$ans\$xxxm\$nostick" in
2036 : create .config dir to save info across Configure sessions
2037 test -d ../.config || mkdir ../.config
2038 cat >../.config/README <<EOF
2039 This directory created by Configure to save information that should
2040 persist across sessions for $package.
2042 You may safely delete it if you wish.
2045 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2047 $define|true|[yY]*) ;;
2048 *) case "$xversion" in
2051 *** WHOA THERE!!! ***
2053 This is an UNSTABLE DEVELOPMENT release.
2054 The version of this $package distribution is $xversion, that is, odd,
2055 (as opposed to even) and that signifies a development release.
2056 If you want a maintenance release, you want an even-numbered version.
2058 Do ***NOT*** install this into production use.
2059 Data corruption and crashes are possible.
2061 It is most seriously suggested that you do not continue any further
2062 unless you want to help in developing and debugging Perl.
2064 If you *still* want to build perl, you can answer 'y' now,
2065 or pass -Dusedevel to Configure.
2068 rp='Do you really want to continue?'
2072 [yY]) echo >&4 "Okay, continuing."
2073 usedevel="$define" ;;
2074 *) echo >&4 "Okay, bye."
2084 case "$versiononly" in
2085 '') versiononly="$define" ;;
2087 case "$installusrbinperl" in
2088 '') installusrbinperl="$undef" ;;
2093 : general instructions
2096 user=`(logname) 2>/dev/null`
2098 '') user=`whoami 2>&1`;;
2100 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2103 rp='Would you like to see the instructions?'
2114 This installation shell script will examine your system and ask you questions
2115 to determine how the perl5 package should be installed. If you get
2116 stuck on a question, you may use a ! shell escape to start a subshell or
2117 execute a command. Many of the questions will have default answers in square
2118 brackets; typing carriage return will give you the default.
2120 On some of the questions which ask for file or directory names you are allowed
2121 to use the ~name construct to specify the login directory belonging to "name",
2122 even if you don't have a shell which knows about that. Questions where this is
2123 allowed will be marked "(~name ok)".
2127 dflt='Type carriage return to continue'
2131 The prompter used in this script allows you to use shell variables and
2132 backticks in your answers. You may use $1, $2, etc... to refer to the words
2133 in the default answer, as if the default line was a set of arguments given to a
2134 script shell. This means you may also use $* to repeat the whole default line,
2135 so you do not have to re-type everything to add something to the default.
2137 Everytime there is a substitution, you will have to confirm. If there is an
2138 error (e.g. an unmatched backtick), the default answer will remain unchanged
2139 and you will be prompted again.
2141 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2142 the questions and use the computed defaults (or the previous answers if there
2143 was already a config.sh file). Type 'Configure -h' for a list of options.
2144 You may also start interactively and then answer '& -d' at any prompt to turn
2145 on the non-interactive behaviour for the remainder of the execution.
2151 Much effort has been expended to ensure that this shell script will run on any
2152 Unix system. If despite that it blows up on yours, your best bet is to edit
2153 Configure and run it again. If you can't run Configure for some reason,
2154 you'll have to generate a config.sh file by hand. Whatever problems you
2155 have, let me (perlbug@perl.org) know how I blew it.
2157 This installation script affects things in two ways:
2159 1) it may do direct variable substitutions on some of the files included
2161 2) it builds a config.h file for inclusion in C programs. You may edit
2162 any of these files as the need arises after running this script.
2164 If you make a mistake on a question, there is no easy way to back up to it
2165 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2166 files. Configure will offer to let you do this before it runs the SH files.
2169 dflt='Type carriage return to continue'
2171 case "$firsttime" in
2172 true) echo $user >>../.config/instruct;;
2176 : find out where common programs are
2178 echo "Locating common programs..." >&4
2191 if test -d \$dir/\$thing; then
2197 for thisthing in \$dir/\$thing; do
2198 : just loop through to pick last item
2200 if test -f \$thisthing; then
2203 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2206 elif test -f \$dir/\$thing.exe; then
2207 if test -n "$DJGPP"; then
2208 echo \$dir/\$thing.exe
2209 elif test "$eunicefix" != ":"; then
2210 : on Eunice apparently
2264 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2265 pth="$pth /lib /usr/lib"
2266 for file in $loclist; do
2270 if test -f "$xxx"; then
2273 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2274 xxx=`./loc $file $file $pth`
2277 '') xxx=`./loc $file $file $pth`;;
2278 *) xxx=`./loc $xxx $xxx $pth`;;
2280 eval $file=$xxx$_exe
2284 echo $file is in $xxx.
2287 echo $file is in $xxx.
2290 echo "I don't know where '$file' is, and my life depends on it." >&4
2291 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2297 echo "Don't worry if any of the following aren't found..."
2299 for file in $trylist; do
2303 if test -f "$xxx"; then
2306 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2307 xxx=`./loc $file $file $pth`
2310 '') xxx=`./loc $file $file $pth`;;
2311 *) xxx=`./loc $xxx $xxx $pth`;;
2313 eval $file=$xxx$_exe
2317 echo $file is in $xxx.
2320 echo $file is in $xxx.
2323 echo "I don't see $file out there, $say."
2330 echo "Substituting grep for egrep."
2337 echo "Substituting cp for ln."
2346 echo "I can't find make or gmake, and my life depends on it." >&4
2347 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2355 *) # We can't have osname yet.
2356 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2357 # Assume that gmake, if found, is definitely GNU make
2358 # and prefer it over the system make.
2359 echo "Substituting gmake for make."
2367 echo "Hopefully test is built into your sh."
2370 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2371 echo "Using the test built into your sh."
2379 echo "Hopefully echo is built into your sh."
2384 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2385 $echo $n "hi there$c" >foo1
2386 echo $n "hi there$c" >foo2
2387 if cmp foo1 foo2 >/dev/null 2>&1; then
2388 echo "They are compatible. In fact, they may be identical."
2395 They are not compatible! You are probably running ksh on a non-USG system.
2396 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2397 have echo built in and we may have to run some Bourne shell scripts. That
2398 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2401 $echo $n "The star should be here-->$c"
2411 cat <<'EOSC' >>trygcc
2416 int main(int argc, char *argv[]) {
2420 if $cc -o try $ccflags $ldflags try.c; then
2423 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2429 case "`$cc -v -c try.c 2>&1`" in
2432 if $test X"$trygcc" = Xyes; then
2433 if gcc -o try -c try.c; then
2435 echo "You seem to have a working gcc, though." >&4
2436 rp="Would you like to use it?"
2438 if $test -f myread; then
2441 if $test -f UU/myread; then
2444 echo "Cannot find myread, sorry. Aborting." >&2
2449 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2450 if $test -f usethreads.cbu; then
2453 *** However, any setting of the C compiler flags (e.g. for thread support)
2454 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2455 *** (together with e.g. -Dusethreads).
2471 cat <<'EOSC' >>checkcc
2476 int main(int argc, char *argv[]) {
2480 if $cc -o try $ccflags $ldflags try.c; then
2483 if $test X"$despair" = Xyes; then
2484 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2487 You need to find a working C compiler.
2488 Either (purchase and) install the C compiler supplied by your OS vendor,
2489 or for a free C compiler try http://gcc.gnu.org/
2490 I cannot continue any further, aborting.
2499 : determine whether symbolic links are supported
2502 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2503 echo "Symbolic links are supported." >&4
2506 echo "Symbolic links are NOT supported." >&4
2511 : determine whether symbolic links are supported
2515 echo "Checking how to test for symbolic links..." >&4
2517 if $test "X$issymlink" = X; then
2519 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2520 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2522 if test $? = 0; then
2525 echo "Your builtin 'test -h' may be broken." >&4
2528 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2531 if test -f "$p/$test"; then
2540 echo "Trying external '$test -h'." >&4
2541 issymlink="$test -h"
2542 if $test ! -h sym >/dev/null 2>&1; then
2543 echo "External '$test -h' is broken, too." >&4
2551 if $test "X$issymlink" = X; then
2552 if $test -L sym 2>/dev/null; then
2553 issymlink="$test -L"
2554 echo "The builtin '$test -L' worked." >&4
2557 if $test "X$issymlink" != X; then
2558 echo "You can test for symbolic links with '$issymlink'." >&4
2560 echo "I do not know how you can test for symbolic links." >&4
2564 *) echo "No symbolic links, so not testing for their testing..." >&4
2570 case "$mksymlinks" in
2573 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2576 *) case "$lns:$issymlink" in
2577 *"ln"*" -s:"*"test -"?)
2578 echo "Creating the symbolic links..." >&4
2579 echo "(First creating the subdirectories...)" >&4
2581 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2583 test -z "$directory" && break
2587 if test ! -d t/base; then
2588 echo "Failed to create the subdirectories. Aborting." >&4
2591 echo "(Then creating the symlinks...)" >&4
2592 awk '{print $1}' $src/MANIFEST | while true; do
2594 test -z "$filename" && break
2595 if test -f $filename; then
2596 if $issymlink $filename; then
2600 if test -f $filename; then
2601 echo "$filename already exists, not symlinking."
2603 ln -s $src/$filename $filename
2607 if test ! -f t/base/lex.t; then
2608 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2613 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2622 case "$usecrosscompile" in
2624 $echo "Cross-compiling..."
2627 *-*-gcc) # A cross-compiling gcc, probably.
2628 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2630 # leave out ld, choosing it is more complex
2632 ranlib=$targetarch-ranlib
2633 $echo 'extern int foo;' > try.c
2634 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2636 if $test $# -gt 0; then
2638 incpth="`$echo $incpth|$sed 's/^ //'`"
2639 echo "Guessing incpth '$incpth'." >&4
2641 j="`$echo $i|$sed 's,/include$,/lib,'`"
2642 if $test -d $j; then
2646 libpth="`$echo $libpth|$sed 's/^ //'`"
2647 echo "Guessing libpth '$libpth'." >&4
2652 case "$targetarch" in
2653 '') echo "Targetarch not defined." >&4; croak=y ;;
2654 *) echo "Using targetarch $targetarch." >&4 ;;
2657 '') echo "Incpth not defined." >&4; croak=y ;;
2658 *) echo "Using incpth '$incpth'." >&4 ;;
2661 '') echo "Libpth not defined." >&4; croak=y ;;
2662 *) echo "Using libpth '$libpth'." >&4 ;;
2665 '') for i in $incpth; do
2666 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2668 echo "Guessing usrinc $usrinc." >&4
2673 '') echo "Usrinc not defined." >&4; croak=y ;;
2676 *) echo "Using usrinc $usrinc." >&4 ;;
2678 case "$targethost" in
2679 '') echo "Targethost not defined." >&4; croak=y ;;
2680 *) echo "Using targethost $targethost." >&4
2685 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2688 /*) run=$src/Cross/run
2689 targetmkdir=$src/Cross/mkdir
2691 from=$src/Cross/from
2693 *) pwd=`$test -f ../Configure & cd ..; pwd`
2695 targetmkdir=$pwd/Cross/mkdir
2697 from=$pwd/Cross/from
2700 case "$targetrun" in
2701 '') targetrun=ssh ;;
2706 case "$targetfrom" in
2707 '') targetfrom=scp ;;
2711 from=$from-$targetfrom
2712 case "$targetdir" in
2714 echo "Guessing targetdir $targetdir." >&4
2717 case "$targetuser" in
2719 echo "Guessing targetuser $targetuser." >&4
2722 case "$targetfrom" in
2726 case "$targetrun" in
2738 '') cwd=$targetdir ;;
2742 if $test ! -f \$exe.xok; then
2746 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2749 *) echo "Unknown targetrun '$targetrun'" >&4
2753 case "$targetmkdir" in
2755 cat >$targetmkdir <<EOF
2757 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2759 $chmod a+rx $targetmkdir
2761 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2773 $targetmkdir \`dirname \$f\`
2774 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2777 $targetmkdir $targetdir/\`dirname \$f\`
2778 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2791 $mkdir -p $targetdir/\`dirname \$f\`
2792 $cp \$f $targetdir/\$f || exit 1
2795 $targetmkdir $targetdir/\`dirname \$f\`
2796 $cp \$f $targetdir/\$f || exit 1
2803 *) echo "Unknown targetto '$targetto'" >&4
2807 case "$targetfrom" in
2814 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2819 cp) cat >$from <<EOF
2824 cp $targetdir/\$f . || exit 1
2829 *) echo "Unknown targetfrom '$targetfrom'" >&4
2833 if $test ! -f $run; then
2834 echo "Target 'run' script '$run' not found." >&4
2838 if $test ! -f $to; then
2839 echo "Target 'to' script '$to' not found." >&4
2843 if $test ! -f $from; then
2844 echo "Target 'from' script '$from' not found." >&4
2848 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2852 Using '$run' for remote execution,
2853 and '$from' and '$to'
2854 for remote file transfer.
2860 usecrosscompile='undef'
2865 : see whether [:lower:] and [:upper:] are supported character classes
2867 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2869 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2873 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2874 # (0xc9 and 0xd1), therefore that is a nice testing point.
2875 if test "X$up" = X -o "X$low" = X; then
2876 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2882 if test "X$up" = X -o "X$low" = X; then
2883 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2889 if test "X$up" = X -o "X$low" = X; then
2890 case "`echo IJ | od -x 2>/dev/null`" in
2892 echo "Hey, this might be EBCDIC." >&4
2893 if test "X$up" = X -o "X$low" = X; then
2894 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2895 ij) up='[A-IJ-RS-Z]'
2900 if test "X$up" = X -o "X$low" = X; then
2901 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2911 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2913 echo "Using $up and $low to convert case." >&4
2916 echo "I don't know how to translate letters from upper to lower case." >&4
2917 echo "Your tr is not acting any way I know of." >&4
2921 : set up the translation script tr, must be called with ./tr of course
2925 '[A-Z][a-z]') exec $tr '$up' '$low';;
2926 '[a-z][A-Z]') exec $tr '$low' '$up';;
2933 : Try to determine whether config.sh was made on this system
2934 case "$config_sh" in
2936 myuname=`$uname -a 2>/dev/null`
2937 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2938 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2939 # because the A-Z/a-z are not consecutive.
2940 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2941 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2942 newmyuname="$myuname"
2944 case "$knowitall" in
2946 if test -f ../config.sh; then
2947 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2948 eval "`grep myuname= ../config.sh`"
2950 if test "X$myuname" = "X$newmyuname"; then
2958 : Get old answers from old config file if Configure was run on the
2959 : same system, otherwise use the hints.
2962 if test -f config.sh; then
2964 rp="I see a config.sh file. Shall I use it to set the defaults?"
2967 n*|N*) echo "OK, I'll ignore it."
2968 mv config.sh config.sh.old
2969 myuname="$newmyuname"
2971 *) echo "Fetching default answers from your old config.sh file..." >&4
2979 : Older versions did not always set $sh. Catch re-use of such
2989 if test ! -f config.sh; then
2992 First time through, eh? I have some defaults handy for some systems
2993 that need some extra help getting the Configure answers right:
2996 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2998 : Half the following guesses are probably wrong... If you have better
2999 : tests or hints, please send them to perlbug@perl.org
3000 : The metaconfig authors would also appreciate a copy...
3001 $test -f /irix && osname=irix
3002 $test -f /xenix && osname=sco_xenix
3003 $test -f /dynix && osname=dynix
3004 $test -f /dnix && osname=dnix
3005 $test -f /lynx.os && osname=lynxos
3006 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3007 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3008 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3009 $test -f /bin/mips && /bin/mips && osname=mips
3010 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3011 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3012 $test -d /usr/apollo/bin && osname=apollo
3013 $test -f /etc/saf/_sactab && osname=svr4
3014 $test -d /usr/include/minix && osname=minix
3015 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3016 if $test -d /MachTen -o -d /MachTen_Folder; then
3018 if $test -x /sbin/version; then
3019 osvers=`/sbin/version | $awk '{print $2}' |
3020 $sed -e 's/[A-Za-z]$//'`
3021 elif $test -x /usr/etc/version; then
3022 osvers=`/usr/etc/version | $awk '{print $2}' |
3023 $sed -e 's/[A-Za-z]$//'`
3029 $test -f /sys/posix.dll &&
3030 $test -f /usr/bin/what &&
3031 set X `/usr/bin/what /sys/posix.dll` &&
3032 $test "$3" = UWIN &&
3036 if $test -f $uname; then
3044 umips) osname=umips ;;
3047 [23]100) osname=mips ;;
3048 next*) osname=next ;;
3050 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3051 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3054 elif $test -f /etc/kconfig; then
3056 if test "$lns" = "$ln -s"; then
3058 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3060 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3067 if test -n "$DJGPP"; then
3076 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3078 'not found') osvers="$4"."$3" ;;
3079 '<3240'|'<>3240') osvers=3.2.0 ;;
3080 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3081 '=3250'|'>3250') osvers=3.2.5 ;;
3085 bsd386) osname=bsd386
3088 cygwin*) osname=cygwin
3091 *dc.osx) osname=dcosx
3097 domainos) osname=apollo
3103 dynixptx*) osname=dynixptx
3104 osvers=`echo "$4"|sed 's/^v//'`
3106 freebsd) osname=freebsd
3108 genix) osname=genix ;;
3110 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3126 netbsd*) osname=netbsd
3129 news-os) osvers="$3"
3131 4*) osname=newsos4 ;;
3135 next*) osname=next ;;
3136 nonstop-ux) osname=nonstopux ;;
3137 openbsd) osname=openbsd
3140 POSIX-BC | posix-bc ) osname=posix-bc
3143 powerux | power_ux | powermax_os | powermaxos | \
3144 powerunix | power_unix) osname=powerux
3150 solaris) osname=solaris
3152 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3159 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3163 titanos) osname=titanos
3172 ultrix) osname=ultrix
3175 osf1|mls+) case "$5" in
3178 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3181 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3184 hp*) osname=hp_osf1 ;;
3185 mips) osname=mips_osf1 ;;
3188 unixware) osname=svr5
3196 $2) case "$osname" in
3200 : svr4.x or possibly later
3210 if test -f /stand/boot ; then
3211 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3212 if test -n "$INITPROG" -a -f "$INITPROG"; then
3213 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3214 if test -n "$isesix"; then
3222 *) if test -f /etc/systemid; then
3224 set `echo $3 | $sed 's/\./ /g'` $4
3225 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3227 elif $test -f $src/hints/sco_$1_$2.sh; then
3229 elif $test -f $src/hints/sco_$1.sh; then
3234 '') : Still unknown. Probably a generic Sys V.
3243 *) case "$osname" in
3244 '') : Still unknown. Probably a generic BSD.
3252 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3253 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3254 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3257 $rm -f UU/kernel.what
3258 elif test -d c:/.; then
3265 case "$targetarch" in
3268 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3273 : Now look for a hint file osname_osvers, unless one has been
3274 : specified already.
3277 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3278 : Also try without trailing minor version numbers.
3279 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3280 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3281 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3282 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3285 *) case "$osvers" in
3288 *) if $test -f $src/hints/$file.sh ; then
3290 elif $test -f $src/hints/$xfile.sh ; then
3292 elif $test -f $src/hints/$xxfile.sh ; then
3294 elif $test -f $src/hints/$xxxfile.sh ; then
3296 elif $test -f $src/hints/$xxxxfile.sh ; then
3298 elif $test -f "$src/hints/${osname}.sh" ; then
3307 if $test -f Policy.sh ; then
3310 none) dflt="Policy" ;;
3311 *) dflt="Policy $dflt" ;;
3316 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3320 if $test -f Policy.sh ; then
3323 There's also a Policy hint file available, which should make the
3324 site-specific (policy) questions easier to answer.
3331 You may give one or more space-separated answers, or "none" if appropriate.
3332 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3333 is a good thing. DO NOT give a wrong version or a wrong OS.
3337 rp="Which of these apply, if any?"
3340 for file in $tans; do
3341 if $test X$file = XPolicy -a -f Policy.sh; then
3343 $cat Policy.sh >> UU/config.sh
3344 elif $test -f $src/hints/$file.sh; then
3345 . $src/hints/$file.sh
3346 $cat $src/hints/$file.sh >> UU/config.sh
3347 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3350 : Give one chance to correct a possible typo.
3351 echo "$file.sh does not exist"
3353 rp="hint to use instead?"
3355 for file in $ans; do
3356 if $test -f "$src/hints/$file.sh"; then
3357 . $src/hints/$file.sh
3358 $cat $src/hints/$file.sh >> UU/config.sh
3359 elif $test X$ans = X -o X$ans = Xnone ; then
3362 echo "$file.sh does not exist -- ignored."
3369 : Remember our hint file for later.
3370 if $test -f "$src/hints/$file.sh" ; then
3380 echo "Fetching default answers from $config_sh..." >&4
3384 cp $config_sh config.sh 2>/dev/null
3394 test "$override" && . ./optdef.sh
3396 : Restore computed paths
3397 for file in $loclist $trylist; do
3398 eval $file="\$_$file"
3403 Configure uses the operating system name and version to set some defaults.
3404 The default value is probably right if the name rings a bell. Otherwise,
3405 since spelling matters for me, either accept the default or answer "none"
3412 ''|' '|none) dflt=none ;;
3413 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3416 *) dflt="$osname" ;;
3418 rp="Operating system name?"
3422 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3428 ''|' '|none) dflt=none ;;
3429 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3430 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3432 ''|' ') dflt=none ;;
3437 *) dflt="$osvers" ;;
3439 rp="Operating system version?"
3449 : who configured the system
3450 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3451 cf_by=`(logname) 2>/dev/null`
3454 cf_by=`(whoami) 2>/dev/null`
3456 "") cf_by=unknown ;;
3460 : set up the script used to warn in case of inconsistency
3467 echo "*** WHOA THERE!!! ***" >&4
3468 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3469 rp=" Keep the $hint value?"
3472 y) td=$was; tu=$was;;
3476 : function used to set $1 to $val
3477 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3479 $define$undef) . ./whoa; eval "$var=\$td";;
3480 $undef$define) . ./whoa; eval "$var=\$tu";;
3481 *) eval "$var=$val";;
3485 $define|true|[yY]*) dflt='y';;
3490 Perl can be built to use the SOCKS proxy protocol library. To do so,
3491 Configure must be run with -Dusesocks. If you use SOCKS you also need
3492 to use the PerlIO abstraction layer, this will be implicitly selected.
3494 If this doesn't make any sense to you, just accept the default '$dflt'.
3496 rp='Build Perl for SOCKS?'
3499 y|Y) val="$define" ;;
3506 $define|true|[yY]*) useperlio="$define";;
3509 case "$useperlio" in
3510 $define|true|[yY]*|'') dflt='y';;
3515 Previous version of $package used the standard IO mechanisms as
3516 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3517 alternate IO mechanisms via the PerlIO abstraction layer, but the
3518 stdio mechanism is still available if needed. The abstraction layer
3519 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3520 Using PerlIO with sfio may cause problems with some extension modules.
3522 If this doesn't make any sense to you, just accept the default '$dflt'.
3524 rp='Use the PerlIO abstraction layer?'
3531 echo "Ok, doing things the stdio way."
3540 case "$useperlio" in
3541 $define|true|[yY]*) ;;
3544 You are using the SOCKS proxy protocol library which means that you
3545 should also use the PerlIO layer. You may be headed for trouble.
3554 case "$usethreads" in
3555 $define|true|[yY]*) dflt='y';;
3556 *) # Catch case where user specified ithreads or 5005threads but
3557 # forgot -Dusethreads (A.D. 4/2002)
3558 case "$useithreads$use5005threads" in
3560 case "$useperlio" in
3561 "$define") dflt='y' ;;
3571 Perl can be built to take advantage of threads on some systems.
3572 To do so, Configure can be run with -Dusethreads.
3574 Note that Perl built with threading support runs slightly slower
3575 and uses more memory than plain Perl. The current implementation
3576 is believed to be stable, but it is fairly new, and so should be
3577 treated with caution.
3579 If this doesn't make any sense to you, just accept the default '$dflt'.
3581 rp='Build a threading Perl?'
3584 y|Y) val="$define" ;;
3590 case "$usethreads" in
3594 Since release 5.6, Perl has had two different threading implementations,
3595 the newer interpreter-based version (ithreads) with one interpreter per
3596 thread, and the older 5.005 version (5005threads).
3597 The 5005threads version is effectively unmaintained and will probably be
3598 removed in Perl 5.10, so there should be no need to build a Perl using it
3599 unless needed for backwards compatibility with some existing 5.005threads
3603 : Default to ithreads unless overridden on command line or with
3606 case "$use5005threads" in
3607 $define|true|[yY]*) dflt='n';;
3609 case "$useithreads" in
3610 $undef|false|[nN]*) dflt='n';;
3612 rp='Use the newer interpreter-based ithreads?'
3615 y|Y) val="$define" ;;
3620 : Now set use5005threads to the opposite value.
3621 case "$useithreads" in
3622 $define) val="$undef" ;;
3629 useithreads="$undef"
3630 use5005threads="$undef"
3634 case "$useithreads$use5005threads" in
3638 You cannot have both the ithreads and the 5.005 threads enabled
3639 at the same time. Disabling the 5.005 threads since they are
3640 much less stable than the ithreads.
3643 use5005threads="$undef"
3647 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3650 *** To build with ithreads you must also use the PerlIO layer.
3651 *** Cannot continue, aborting.
3657 case "$d_oldpthreads" in
3658 '') : Configure tests would be welcome here. For now, assume undef.
3660 *) val="$d_oldpthreads" ;;
3666 case "$usethreads" in
3667 "$define"|true|[yY]*)
3668 : Look for a hint-file generated 'call-back-unit'. If the
3669 : user has specified that a threading perl is to be built,
3670 : we may need to set or change some other defaults.
3671 if $test -f usethreads.cbu; then
3672 echo "Your platform has some specific hints for threaded builds, using them..."
3676 (Your platform doesn't have any specific hints for threaded builds.
3677 Assuming POSIX threads, then.)
3685 Perl can be built so that multiple Perl interpreters can coexist
3686 within the same Perl executable.
3689 case "$useithreads" in
3692 This multiple interpreter support is required for interpreter-based threads.
3696 *) case "$usemultiplicity" in
3697 $define|true|[yY]*) dflt='y';;
3701 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3702 rp='Build Perl for multiplicity?'
3705 y|Y) val="$define" ;;
3714 case "$usemorebits" in
3715 "$define"|true|[yY]*)
3716 use64bitint="$define"
3717 uselongdouble="$define"
3718 usemorebits="$define"
3720 *) usemorebits="$undef"
3724 : make some quick guesses about what we are up against
3726 $echo $n "Hmm... $c"
3736 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3737 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3739 echo "Looks kind of like an OSF/1 system, but we'll see..."
3741 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3742 xxx=`./loc addbib blurfl $pth`
3743 if $test -f $xxx; then
3744 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3748 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3749 echo "Looks kind of like an extended USG system, but we'll see..."
3751 echo "Looks kind of like a USG system, but we'll see..."
3755 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3756 echo "Looks kind of like a BSD system, but we'll see..."
3760 echo "Looks kind of like a Version 7 system, but we'll see..."
3763 case "$eunicefix" in
3766 There is, however, a strange, musty smell in the air that reminds me of
3767 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3771 : it so happens the Eunice I know will not run shell scripts in Unix format
3775 echo "Congratulations. You aren't running Eunice."
3779 : Detect OS2. The p_ variable is set above in the Head.U unit.
3780 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3781 : semicolon as a patch separator
3786 I have the feeling something is not exactly right, however...don't tell me...
3787 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3788 (Or you may be running DOS with DJGPP.)
3793 if test -f /xenix; then
3794 echo "Actually, this looks more like a XENIX system..."
3799 echo "It's not Xenix..."
3804 if test -f /venix; then
3805 echo "Actually, this looks more like a VENIX system..."
3812 echo "Nor is it Venix..."
3815 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3816 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3823 rp="Use which C compiler?"
3827 : See if they have not cc but they do have gcc
3829 : Look for a hint-file generated 'call-back-unit'. Now that the
3830 : user has specified the compiler, we may need to set or change some
3832 if $test -f cc.cbu; then
3838 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3844 printf("%s\n", __VERSION__);
3846 printf("%s\n", "1");
3852 if $cc -o try $ccflags $ldflags try.c; then
3853 gccversion=`$run ./try`
3854 case "$gccversion" in
3855 '') echo "You are not using GNU cc." ;;
3856 *) echo "You are using GNU cc $gccversion."
3862 echo "*** WHOA THERE!!! ***" >&4
3863 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3864 case "$knowitall" in
3866 echo " You'd better start hunting for one and let me know about it." >&4
3872 case "$gccversion" in
3873 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3875 case "$gccversion" in
3876 '') gccosandvers='' ;;
3877 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3878 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3880 case "$gccosandvers" in
3881 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3882 $osname$osvers) ;; # looking good
3883 $osname*) cat <<EOM >&4
3885 *** WHOA THERE!!! ***
3887 Your gcc has not been compiled for the exact release of
3888 your operating system ($gccosandvers versus $osname$osvers).
3890 In general it is a good idea to keep gcc synchronized with
3891 the operating system because otherwise serious problems
3892 may ensue when trying to compile software, like Perl.
3894 I'm trying to be optimistic here, though, and will continue.
3895 If later during the configuration and build icky compilation
3896 problems appear (headerfile conflicts being the most common
3897 manifestation), I suggest reinstalling the gcc to match
3898 your operating system release.
3902 *) gccosandvers='' ;; # failed to parse, better be silent
3910 # gcc 3.* complain about adding -Idirectories that they already know about,
3911 # so we will take those off from locincpth.
3912 case "$gccversion" in
3914 echo "main(){}">try.c
3915 for incdir in $locincpth; do
3916 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3917 grep '^c[cp]p*[01]: warning: changing search order '`
3918 if test "X$warn" != X; then
3919 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3925 : decide how portable to be. Allow command line overrides.
3926 case "$d_portable" in
3928 *) d_portable="$define" ;;
3931 : set up shell script to do ~ expansion
3937 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3940 if $test -f /bin/csh; then
3941 /bin/csh -f -c "glob \$1"
3946 name=\`$expr x\$1 : '..\([^/]*\)'\`
3947 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3948 if $test ! -d "\$dir"; then
3950 echo "\$me: can't locate home directory for: \$name" >&2
3955 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3971 : now set up to get a file name
3975 cat <<'EOSC' >>getfile
3991 : getfile will accept an answer from the comma-separated list
3992 : enclosed in parentheses even if it does not meet other criteria.
3993 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3994 fn=`echo $fn | sed 's/(.*)//'`
4000 loc_file=`expr $fn : '.*:\(.*\)'`
4001 fn=`expr $fn : '\(.*\):.*'`
4009 */*) fullpath=true;;
4018 *e*) exp_file=true;;
4021 *p*) nopath_ok=true;;
4026 *d*) type='Directory';;
4027 *l*) type='Locate';;
4032 Locate) what='File';;
4037 case "$d_portable" in
4045 while test "$type"; do
4050 true) rp="$rp (~name ok)";;
4053 if test -f UU/getfile.ok && \
4054 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4073 value=`UU/filexp $ans`
4076 if test "$ans" != "$value"; then
4077 echo "(That expands to $value on this system.)"
4091 /*) value="$ansexp" ;;
4092 [a-zA-Z]:/*) value="$ansexp" ;;
4097 echo "I shall only accept a full path name, as in /bin/ls." >&4
4098 echo "Use a ! shell escape if you wish to check pathnames." >&4
4101 echo "Please give a full path name, starting with slash." >&4
4104 echo "Note that using ~name is ok provided it expands well." >&4
4117 for fp in $gfpth; do
4118 if test "X$fp" = X.; then
4123 if test -f "$pf"; then
4125 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4127 echo "($value is not a plain file, but that's ok.)"
4130 if test X"$type" = X; then
4137 for fp in $gfpth; do
4138 if test "X$fp" = X.; then
4143 direxp="$fp/$ansexp"
4145 if test -d "$direxp"; then
4153 if test -d "$ansexp"; then
4154 echo "(Looking for $loc_file in directory $value.)"
4155 value="$value/$loc_file"
4156 ansexp="$ansexp/$loc_file"
4158 if test -f "$ansexp"; then
4161 case "$nopath_ok" in
4162 true) case "$value" in
4164 *) echo "Assuming $value will be in people's path."
4180 if test "$fastread" = yes; then
4185 rp="$what $value doesn't exist. Use that name anyway?"
4204 test "X$gfpthkeep" != Xy && gfpth=""
4207 : What should the include directory be ?
4209 $echo $n "Hmm... $c"
4213 if $test -f /bin/mips && /bin/mips; then
4214 echo "Looks like a MIPS system..."
4215 $cat >usr.c <<'EOCP'
4216 #ifdef SYSTYPE_BSD43
4220 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4221 dflt='/bsd43/usr/include'
4225 mips_type='System V'
4227 $rm -f usr.c usr.out
4228 echo "and you're compiling with the $mips_type compiler and libraries."
4232 echo "Doesn't look like a MIPS system."
4242 case "$xxx_prompt" in
4245 rp='Where are the include files you want to use?'
4253 : see how we invoke the C preprocessor
4255 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4256 cat <<'EOT' >testcpp.c
4262 if test ! -f cppstdin; then
4263 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4264 # AIX cc -E doesn't show the absolute headerfile
4265 # locations but we'll cheat by using the -M flag.
4266 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
4268 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4271 echo "Keeping your $hint cppstdin wrapper."
4274 wrapper=`pwd`/cppstdin
4278 if $test "X$cppstdin" != "X" && \
4279 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4280 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4282 echo "You used to use $cppstdin $cppminus so we'll use that again."
4284 '') echo "But let's see if we can live without a wrapper..." ;;
4286 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4287 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4289 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4292 echo "(However, $cpprun $cpplast does not work, let's see...)"
4300 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4307 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4308 $cc -E <testcpp.c >testcpp.out 2>&1; \
4309 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4310 echo "Yup, it does."
4313 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4314 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4315 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4316 echo "Yup, it does."
4319 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4320 $cc -P <testcpp.c >testcpp.out 2>&1; \
4321 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4322 echo "Yipee, that works!"
4325 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4326 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4327 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4328 echo "At long last!"
4331 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4332 $cpp <testcpp.c >testcpp.out 2>&1; \
4333 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4337 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4338 $cpp - <testcpp.c >testcpp.out 2>&1; \
4339 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4340 echo "Hooray, it works! I was beginning to wonder."
4343 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4344 $wrapper <testcpp.c >testcpp.out 2>&1; \
4345 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4351 rp="No dice. I can't find a C preprocessor. Name one:"
4355 $x_cpp <testcpp.c >testcpp.out 2>&1
4356 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4357 echo "OK, that will do." >&4
4359 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4374 echo "Perhaps can we force $cc -E using a wrapper..."
4375 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4376 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4382 echo "Nope, we'll have to live without it..."
4396 "$wrapper"|'cppstdin') ;;
4397 *) $rm -f $wrapper;;
4399 $rm -f testcpp.c testcpp.out
4401 : Set private lib path
4404 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4409 '') dlist="$loclibpth $plibpth $glibpth";;
4410 *) dlist="$libpth";;
4413 : Now check and see which directories actually exist, avoiding duplicates
4417 if $test -d $xxx; then
4420 *) libpth="$libpth $xxx";;
4426 Some systems have incompatible or broken versions of libraries. Among
4427 the directories listed in the question below, please remove any you
4428 know not to be holding relevant libraries, and add any that are needed.
4429 Say "none" for none.
4440 rp="Directories to use for library searches?"
4447 : compute shared library extension
4450 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4460 On some systems, shared libraries may be available. Answer 'none' if
4461 you want to suppress searching of shared libraries for the remainder
4462 of this configuration.
4465 rp='What is the file extension used for shared libraries?'
4469 : Define several unixisms.
4470 : Hints files or command line option can be used to override them.
4471 : The convoluted testing is in case hints files set either the old
4474 '') case "$exe_ext" in
4476 *) _exe="$exe_ext" ;;
4481 '') case "$lib_ext" in
4488 '') case "$obj_ext" in
4495 '') case "$path_sep" in
4506 : Which makefile gets called first. This is used by make depend.
4507 case "$firstmakefile" in
4508 '') firstmakefile='makefile';;
4511 : Looking for optional libraries
4513 echo "Checking for optional libraries..." >&4
4518 case "$libswanted" in
4519 '') libswanted='c_s';;
4522 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4528 for thisdir in $libpth $xlibpth; do
4529 test -d $thisdir && libspath="$libspath $thisdir"
4531 for thislib in $libswanted; do
4532 for thisdir in $libspath; do
4534 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4535 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4536 $test -f "$xxx" && eval $libscheck
4537 $test -f "$xxx" && libstyle=shared
4539 if test ! -f "$xxx"; then
4540 xxx=$thisdir/lib$thislib.$so
4541 $test -f "$xxx" && eval $libscheck
4542 $test -f "$xxx" && libstyle=shared
4544 if test ! -f "$xxx"; then
4545 xxx=$thisdir/lib$thislib$_a
4546 $test -f "$xxx" && eval $libscheck
4547 $test -f "$xxx" && libstyle=static
4549 if test ! -f "$xxx"; then
4550 xxx=$thisdir/$thislib$_a
4551 $test -f "$xxx" && eval $libscheck
4552 $test -f "$xxx" && libstyle=static
4554 if test ! -f "$xxx"; then
4555 xxx=$thisdir/lib${thislib}_s$_a
4556 $test -f "$xxx" && eval $libscheck
4557 $test -f "$xxx" && libstyle=static
4558 $test -f "$xxx" && thislib=${thislib}_s
4560 if test ! -f "$xxx"; then
4561 xxx=$thisdir/Slib$thislib$_a
4562 $test -f "$xxx" && eval $libscheck
4563 $test -f "$xxx" && libstyle=static
4565 if $test -f "$xxx"; then
4567 shared) echo "Found -l$thislib (shared)." ;;
4568 static) echo "Found -l$thislib." ;;
4569 *) echo "Found -l$thislib ($libstyle)." ;;
4573 *) dflt="$dflt -l$thislib"
4574 libsfound="$libsfound $xxx"
4576 libsfiles="$libsfiles $yyy"
4577 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4578 case " $libsdirs " in
4580 *) libsdirs="$libsdirs $yyy" ;;
4587 if $test ! -f "$xxx"; then
4588 echo "No -l$thislib."
4599 ' '|'') dflt='none';;
4604 In order to compile $package on your machine, a number of libraries
4605 are usually needed. Include any other special libraries here as well.
4606 Say "none" for none. The default list is almost always right.
4610 rp="What libraries to use?"
4617 : determine optimization, if desired, or use for debug flag also
4619 ' '|$undef) dflt='none';;
4621 *) dflt="$optimize";;
4625 By default, $package compiles with the -O flag to use the optimizer.
4626 Alternately, you might want to use the symbolic debugger, which uses
4627 the -g flag (on traditional Unix systems). Either flag can be
4628 specified here. To use neither flag, specify the word "none".
4631 rp="What optimizer/debugger flag should be used?"
4635 'none') optimize=" ";;
4639 : We will not override a previous value, but we might want to
4640 : augment a hint file
4642 default|recommended)
4643 case "$gccversion" in
4644 1*) dflt='-fpcc-struct-return' ;;
4647 *-g*) dflt="$dflt -DDEBUGGING";;
4649 case "$gccversion" in
4650 2*) if test -d /etc/conf/kconfig.d &&
4651 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4657 case "$gccversion" in
4661 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4662 echo 'int main(void) { return 0; }' > gcctest.c
4663 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4664 echo "Yes, it does." 2>&1
4667 echo "Leaving current flags $ccflags alone." 2>&1
4669 *) dflt="$dflt -fno-strict-aliasing" ;;
4672 echo "Nope, it doesn't, but that's ok." 2>&1
4679 case "$mips_type" in
4680 *BSD*|'') inclwanted="$locincpth $usrinc";;
4681 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4683 for thisincl in $inclwanted; do
4684 if $test -d $thisincl; then
4685 if $test x$thisincl != x$usrinc; then
4687 *" -I$thisincl "*);;
4688 *) dflt="$dflt -I$thisincl ";;
4694 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4696 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4704 *) dflt="$dflt -D$2";;
4708 set signal.h LANGUAGE_C; eval $inctest
4712 ccflags="$ccflags -DSOCKS"
4717 default|recommended) dflt="$ccflags $dflt" ;;
4718 *) dflt="$ccflags";;
4727 Your C compiler may want other flags. For this question you should include
4728 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4729 but you should NOT include libraries or ld flags like -lwhatever. If you
4730 want $package to honor its debug switch, you should include -DDEBUGGING here.
4731 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4733 To use no flags, specify the word "none".
4739 rp="Any additional cc flags?"
4746 : the following weeds options from ccflags that are of no interest to cpp
4748 '') cppflags="$ccflags" ;;
4749 *) cppflags="$cppflags $ccflags" ;;
4751 case "$gccversion" in
4752 1*) cppflags="$cppflags -D__GNUC__"
4754 case "$mips_type" in
4756 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4762 echo "Let me guess what the preprocessor flags are..." >&4
4776 *) ftry="$previous $flag";;
4778 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4779 >cpp1.out 2>/dev/null && \
4780 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4781 >cpp2.out 2>/dev/null && \
4782 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4783 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4785 cppflags="$cppflags $ftry"
4795 *-*) echo "They appear to be: $cppflags";;
4797 $rm -f cpp.c cpp?.out
4801 : flags used in final linking phase
4803 '') if ./venix; then
4809 *-posix*) dflt="$dflt -posix" ;;
4812 *) dflt="$ldflags";;
4815 : Try to guess additional flags to pick up local libraries.
4816 for thislibdir in $libpth; do
4817 case " $loclibpth " in
4820 *"-L$thislibdir "*) ;;
4821 *) dflt="$dflt -L$thislibdir" ;;
4833 Your C linker may need flags. For this question you should
4834 include -L/whatever and any other flags used by the C linker, but you
4835 should NOT include libraries like -lwhatever.
4837 Make sure you include the appropriate -L/path flags if your C linker
4838 does not normally search all of the directories you specified above,
4841 To use no flags, specify the word "none".
4845 rp="Any additional ld flags (NOT including libraries)?"
4851 rmlist="$rmlist pdp11"
4855 echo "Checking your choice of C compiler and flags for coherency..." >&4
4856 $cat > try.c <<'EOF'
4858 int main() { printf("Ok\n"); exit(0); }
4860 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4862 $cat >try.msg <<'EOM'
4863 I've tried to compile and run the following simple program:
4866 $cat try.c >> try.msg
4868 $cat >> try.msg <<EOM
4875 and I got the following output:
4879 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4880 if $sh -c "$run ./try" >>try.msg 2>&1; then
4884 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4887 cat >> try.msg <<'EOQS'
4888 If $libs contains -lsfio, and sfio is mis-configured, then it
4889 sometimes (apparently) runs and exits with a 0 status, but with no
4890 output! It may have to do with sfio's use of _exit vs. exit.
4893 rp="You have a big problem. Shall I abort Configure"
4900 echo "The program compiled OK, but exited with status $?." >>try.msg
4901 rp="You have a problem. Shall I abort Configure"
4905 echo "I can't compile the test program." >>try.msg
4906 rp="You have a BIG problem. Shall I abort Configure"
4912 case "$knowitall" in
4914 echo "(The supplied flags or libraries might be incorrect.)"
4922 *) echo "Ok. Stopping Configure." >&4
4927 n) echo "OK, that should do.";;
4929 $rm -f try try.* core
4931 : define a shorthand compile call
4935 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4936 : define a shorthand compile call for compilations that should be ok.
4940 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4942 : check for lengths of integral types
4946 echo "Checking to see how big your integers are..." >&4
4947 $cat >try.c <<'EOCP'
4951 printf("intsize=%d;\n", (int)sizeof(int));
4952 printf("longsize=%d;\n", (int)sizeof(long));
4953 printf("shortsize=%d;\n", (int)sizeof(short));
4958 if eval $compile_ok && $run ./try > /dev/null; then
4960 echo "Your integers are $intsize bytes long."
4961 echo "Your long integers are $longsize bytes long."
4962 echo "Your short integers are $shortsize bytes long."
4966 Help! I can't compile and run the intsize test program: please enlighten me!
4967 (This is probably a misconfiguration in your system or libraries, and
4968 you really ought to fix it. Still, I'll try anyway.)
4972 rp="What is the size of an integer (in bytes)?"
4976 rp="What is the size of a long integer (in bytes)?"
4980 rp="What is the size of a short integer (in bytes)?"
4988 : check for long long
4990 echo "Checking to see if you have long long..." >&4
4991 echo 'int main() { long long x = 7; return 0; }' > try.c
4993 if eval $compile; then
4995 echo "You have long long."
4998 echo "You do not have long long."
5004 : check for length of long long
5005 case "${d_longlong}${longlongsize}" in
5008 echo "Checking to see how big your long longs are..." >&4
5009 $cat >try.c <<'EOCP'
5013 printf("%d\n", (int)sizeof(long long));
5018 if eval $compile_ok; then
5019 longlongsize=`$run ./try`
5020 echo "Your long longs are $longlongsize bytes long."
5024 echo "(I can't seem to compile the test program. Guessing...)"
5025 rp="What is the size of a long long (in bytes)?"
5029 if $test "X$longsize" = "X$longlongsize"; then
5030 echo "(That isn't any different from an ordinary long.)"
5036 : determine filename position in cpp output
5038 echo "Computing filename position in cpp output for #include directives..." >&4
5040 vos) testaccess=-e ;;
5043 echo '#include <stdio.h>' > foo.c
5046 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5047 $grep '^[ ]*#.*stdio\.h' | \
5048 while read cline; do
5051 while $test \$# -gt 0; do
5052 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5057 pos=\`expr \$pos + 1\`
5069 *) pos="${fieldn}th";;
5071 echo "Your cpp writes the filename in the $pos field of the line."
5074 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5077 : locate header file
5082 for usrincdir in $usrinc
5084 if test -f \$usrincdir/\$wanted; then
5085 echo "\$usrincdir/\$wanted"
5089 awkprg='{ print \$$fieldn }'
5090 echo "#include <\$wanted>" > foo\$\$.c
5091 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5092 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5093 while read cline; do
5094 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5096 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5097 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5102 # status = 0: grep returned 0 lines, case statement not executed
5103 # status = 1: headerfile found
5104 # status = 2: while loop executed, no headerfile found
5108 if test \$status -eq 1; then
5115 : define an alternate in-header-list? function
5116 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5117 cont=true; xxf="echo \"<\$1> found.\" >&4";
5118 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5119 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5121 case $# in 4) instead=instead;; *) instead="at last";; esac;
5122 while $test "$cont"; do
5124 var=$2; eval "was=\$$2";
5125 if $test "$xxx" && $test -r "$xxx";
5127 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5130 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5131 set $yyy; shift; shift; yyy=$@;
5132 case $# in 0) cont="";;
5133 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5134 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5135 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5136 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5140 do set $yyy; var=$2; eval "was=\$$2";
5141 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5142 set $yyy; shift; shift; yyy=$@;
5145 : see if inttypes.h is available
5146 : we want a real compile instead of Inhdr because some systems
5147 : have an inttypes.h which includes non-existent headers
5150 #include <inttypes.h>
5152 static int32_t foo32 = 0x12345678;
5156 if eval $compile; then
5157 echo "<inttypes.h> found." >&4
5160 echo "<inttypes.h> NOT found." >&4
5169 echo "Checking to see if you have int64_t..." >&4
5171 #include <sys/types.h>
5172 #$i_inttypes I_INTTYPES
5174 #include <inttypes.h>
5176 int main() { int64_t x = 7; }
5179 if eval $compile; then
5181 echo "You have int64_t."
5184 echo "You do not have int64_t."
5192 echo "Checking which 64-bit integer type we could use..." >&4
5198 val='"unsigned int"'
5203 *) case "$longsize" in
5207 val='"unsigned long"'
5212 *) case "$d_longlong:$longlongsize" in
5217 val='"unsigned long long"'
5222 *) case "$d_int64_t" in
5241 '') echo "Alas, no 64-bit integer types in sight." >&4
5244 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5250 case "$uselonglong" in
5251 "$define"|true|[yY]*)
5254 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5256 use64bitint="$define"
5259 case "$use64bits" in
5260 "$define"|true|[yY]*)
5263 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5265 use64bitint="$define"
5268 case "$use64bitints" in
5269 "$define"|true|[yY]*)
5272 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5274 use64bitint="$define"
5277 case "$use64bitsint" in
5278 "$define"|true|[yY]*)
5281 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5283 use64bitint="$define"
5286 case "$uselonglongs" in
5287 "$define"|true|[yY]*)
5290 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5292 use64bitint="$define"
5295 case "$use64bitsall" in
5296 "$define"|true|[yY]*)
5299 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5301 use64bitall="$define"
5306 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5308 case "$use64bitall" in
5309 "$define"|true|[yY]*) use64bitint="$define" ;;
5315 You have natively 64-bit long integers.
5319 *) case "$use64bitint" in
5320 "$define"|true|[yY]*) dflt='y';;
5329 Perl can be built to take advantage of 64-bit integer types
5330 on some systems. To do so, Configure can be run with -Duse64bitint.
5331 Choosing this option will most probably introduce binary incompatibilities.
5333 If this doesn't make any sense to you, just accept the default '$dflt'.
5334 (The default has been chosen based on your configuration.)
5336 rp='Try to use 64-bit integers, if available?'
5339 [yY]*) val="$define" ;;
5347 case "$use64bitall" in
5348 "$define"|true|[yY]*) dflt='y' ;;
5349 *) case "$longsize" in
5357 You may also choose to try maximal 64-bitness. It means using as much
5358 64-bitness as possible on the platform. This in turn means even more
5359 binary incompatibilities. On the other hand, your platform may not
5360 have any more 64-bitness available than what you already have chosen.
5362 If this doesn't make any sense to you, just accept the default '$dflt'.
5363 (The default has been chosen based on your configuration.)
5365 rp='Try to use maximal 64-bit support, if available?'
5368 [yY]*) val="$define" ;;
5373 case "$use64bitall" in
5375 case "$use64bitint" in
5379 Since you have chosen a maximally 64-bit build, I'm also turning on
5380 the use of 64-bit integers.
5382 use64bitint="$define" ;;
5387 case "$use64bitint" in
5388 "$define"|true|[yY]*)
5389 : Look for a hint-file generated 'call-back-unit'. If the
5390 : user has specified that a 64-bit perl is to be built,
5391 : we may need to set or change some other defaults.
5392 if $test -f use64bitint.cbu; then
5393 echo "Your platform has some specific hints for 64-bit integers, using them..."
5397 4) case "$archname64" in
5398 '') archname64=64int ;;
5405 case "$use64bitall" in
5406 "$define"|true|[yY]*)
5407 : Look for a hint-file generated 'call-back-unit'. If the
5408 : user has specified that a maximally 64-bit perl is to be built,
5409 : we may need to set or change some other defaults.
5410 if $test -f use64bitall.cbu; then
5411 echo "Your platform has some specific hints for 64-bit builds, using them..."
5415 4) case "$archname64" in
5416 ''|64int) archname64=64all ;;
5424 echo "Checking for GNU C Library..." >&4
5426 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
5427 alone are insufficient to distinguish different versions, such as
5428 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
5429 libc version 2.1.0. A. Dougherty, June 3, 2002.
5435 # ifdef __GLIBC_MINOR__
5436 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
5437 # include <gnu/libc-version.h>
5438 printf("%s\n", gnu_get_libc_version());
5440 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
5443 printf("%d\n", __GLIBC__);
5452 if eval $compile_ok && $run ./try > glibc.ver; then
5454 gnulibc_version=`$cat glibc.ver`
5455 echo "You are using the GNU C Library version $gnulibc_version"
5459 echo "You are not using the GNU C Library"
5461 $rm -f try try.* glibc.ver
5465 : see if nm is to be used to determine whether a symbol is defined or not
5469 case "$d_gnulibc" in
5472 echo "nm probably won't work on the GNU C Library." >&4
5478 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
5480 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5481 echo "'nm' won't be sufficient on this sytem." >&4
5487 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5488 if $test $dflt -gt 20; then
5498 true|$define) dflt=y;;
5505 I can use $nm to extract the symbols from your C libraries. This
5506 is a time consuming task which may generate huge output on the disk (up
5507 to 3 megabytes) but that should make the symbols extraction faster. The
5508 alternative is to skip the 'nm' extraction part and to compile a small
5509 test program instead to determine whether each symbol is present. If
5510 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5511 this may be the best solution.
5513 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5516 rp="Shall I use $nm to extract C symbols from the libraries?"
5519 [Nn]*) usenm=false;;
5528 : nm options which may be necessary
5530 '') if $test -f /mach_boot; then
5532 elif $test -d /usr/ccs/lib; then
5533 nm_opt='-p' # Solaris (and SunOS?)
5534 elif $test -f /dgux; then
5536 elif $test -f /lib64/rld; then
5537 nm_opt='-p' # 64-bit Irix
5543 : nm options which may be necessary for shared libraries but illegal
5544 : for archive libraries. Thank you, Linux.
5545 case "$nm_so_opt" in
5546 '') case "$myuname" in
5548 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5549 nm_so_opt='--dynamic'
5558 : get list of predefined functions in a handy place
5563 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5569 *) for thislib in $libs; do
5572 : Handle C library specially below.
5575 thislib=`echo $thislib | $sed -e 's/^-l//'`
5576 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5578 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5580 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5582 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5584 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5586 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5588 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5593 libnames="$libnames $try"
5595 *) libnames="$libnames $thislib" ;;
5604 for xxx in $libpth; do
5605 $test -r $1 || set $xxx/libc.$so
5606 : The messy sed command sorts on library version numbers.
5608 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5609 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5611 s/[0-9][0-9]*/0000&/g
5612 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5615 $sort | $sed -e 's/^.* //'`
5618 $test -r $1 || set /usr/ccs/lib/libc.$so
5619 $test -r $1 || set /lib/libsys_s$_a
5625 if $test -r "$1"; then
5626 echo "Your (shared) C library seems to be in $1."
5628 elif $test -r /lib/libc && $test -r /lib/clib; then
5629 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5631 libc='/lib/clib /lib/libc'
5632 if $test -r /lib/syslib; then
5633 echo "(Your math library is in /lib/syslib.)"
5634 libc="$libc /lib/syslib"
5636 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5637 echo "Your C library seems to be in $libc, as you said before."
5638 elif $test -r $incpath/usr/lib/libc$_a; then
5639 libc=$incpath/usr/lib/libc$_a;
5640 echo "Your C library seems to be in $libc. That's fine."
5641 elif $test -r /lib/libc$_a; then
5643 echo "Your C library seems to be in $libc. You're normal."
5645 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5647 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5648 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5649 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5651 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5653 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5656 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5658 if $test -r "$tans"; then
5659 echo "Your C library seems to be in $tans, of all places."
5665 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5669 If the guess above is wrong (which it might be if you're using a strange
5670 compiler, or your machine supports multiple models), you can override it here.
5675 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5677 I can't seem to find your C library. I've looked in the following places:
5680 $sed 's/^/ /' libpath
5683 None of these seems to contain your C library. I need to get its name...
5688 rp='Where is your C library?'
5693 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5694 set X `cat libnames`
5697 case $# in 1) xxx=file; esac
5698 echo "Extracting names from the following $xxx for later perusal:" >&4
5700 $sed 's/^/ /' libnames >&4
5702 $echo $n "This may take a while...$c" >&4
5706 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5707 *) $nm $nm_opt $file 2>/dev/null;;
5712 $grep fprintf libc.tmp > libc.ptf
5713 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5714 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5716 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5718 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5720 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5722 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5724 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5726 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5728 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5730 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5732 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5734 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5736 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5738 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5740 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5741 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5743 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5745 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5747 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5749 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5751 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5753 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5755 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5757 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5759 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5761 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5763 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5765 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5767 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5769 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5771 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5774 $nm -p $* 2>/dev/null >libc.tmp
5775 $grep fprintf libc.tmp > libc.ptf
5776 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5777 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5783 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5785 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5786 for thisname in $libnames $libc; do
5787 $ar t $thisname >>libc.tmp
5789 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5791 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5792 # Repeat libc to extract forwarders to DLL entries too
5793 for thisname in $libnames $libc; do
5794 $ar tv $thisname >>libc.tmp
5795 # Revision 50 of EMX has bug in $ar.
5796 # it will not extract forwarders to DLL entries
5797 # Use emximp which will extract exactly them.
5798 emximp -o tmp.imp $thisname \
5800 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5801 < tmp.imp >>libc.tmp
5804 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5807 echo "$ar didn't seem to work right." >&4
5808 echo "Maybe this is a Cray...trying bld instead..." >&4
5809 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5811 for thisname in $libnames; do
5813 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5814 $ar t $thisname >>libc.tmp
5818 echo "That didn't work either. Giving up." >&4
5828 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
5829 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
5831 *) if $test -f /lib/syscalls.exp; then
5833 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5834 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5840 $rm -f libnames libpath
5842 : is a C symbol defined?
5845 -v) tf=libc.tmp; tc=""; tdc="";;
5846 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5847 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5850 case "$reuseval-$4" in
5852 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5858 if $contains $tlook $tf >/dev/null 2>&1;
5863 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5864 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5872 $define) tval=true;;
5878 : define an is-in-libc? function
5879 inlibc='echo " "; td=$define; tu=$undef;
5880 sym=$1; var=$2; eval "was=\$$2";
5882 case "$reuseval$was" in
5892 echo "$sym() found." >&4;
5893 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5895 echo "$sym() NOT found." >&4;
5896 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5900 $define) echo "$sym() found." >&4;;
5901 *) echo "$sym() NOT found." >&4;;
5905 : see if sqrtl exists
5909 hasproto='varname=$1; func=$2; shift; shift;
5910 while $test $# -ge 2; do
5912 $define) echo "#include <$2>";;
5916 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
5917 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
5918 echo "$func() prototype found.";
5921 echo "$func() prototype NOT found.";
5926 $rm -f try.c tryout.c'
5928 : check for length of double
5930 case "$doublesize" in
5932 echo "Checking to see how big your double precision numbers are..." >&4
5933 $cat >try.c <<'EOCP'
5937 printf("%d\n", (int)sizeof(double));
5942 if eval $compile_ok; then
5943 doublesize=`$run ./try`
5944 echo "Your double is $doublesize bytes long."
5947 echo "(I can't seem to compile the test program. Guessing...)"
5948 rp="What is the size of a double precision number (in bytes)?"
5956 : check for long doubles
5958 echo "Checking to see if you have long double..." >&4
5959 echo 'int main() { long double x = 7.0; }' > try.c
5961 if eval $compile; then
5963 echo "You have long double."
5966 echo "You do not have long double."
5972 : check for length of long double
5973 case "${d_longdbl}${longdblsize}" in
5976 echo "Checking to see how big your long doubles are..." >&4
5977 $cat >try.c <<'EOCP'
5981 printf("%d\n", sizeof(long double));
5986 if eval $compile; then
5987 longdblsize=`$run ./try`
5988 echo "Your long doubles are $longdblsize bytes long."
5992 echo "(I can't seem to compile the test program. Guessing...)" >&4
5993 rp="What is the size of a long double (in bytes)?"
5997 if $test "X$doublesize" = "X$longdblsize"; then
5998 echo "(That isn't any different from an ordinary double.)"
6006 if $test X"$d_longdbl" = X"$define"; then
6008 echo "Checking how to print long doubles..." >&4
6010 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6011 $cat >try.c <<'EOCP'
6012 #include <sys/types.h>
6016 printf("%.3f\n", d);
6020 if eval $compile; then
6024 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6025 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
6026 echo "We will use %f."
6032 if $test X"$sPRIfldbl" = X; then
6033 $cat >try.c <<'EOCP'
6034 #include <sys/types.h>
6037 long double d = 123.456;
6038 printf("%.3Lf\n", d);
6042 if eval $compile; then
6046 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
6047 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
6048 echo "We will use %Lf."
6054 if $test X"$sPRIfldbl" = X; then
6055 $cat >try.c <<'EOCP'
6056 #include <sys/types.h>
6059 long double d = 123.456;
6060 printf("%.3llf\n", d);
6064 if eval $compile; then
6068 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
6069 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
6070 echo "We will use %llf."
6076 if $test X"$sPRIfldbl" = X; then
6077 $cat >try.c <<'EOCP'
6078 #include <sys/types.h>
6081 long double d = 123.456;
6082 printf("%.3lf\n", d);
6086 if eval $compile; then
6090 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
6091 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
6092 echo "We will use %lf."
6098 if $test X"$sPRIfldbl" = X; then
6099 echo "Cannot figure out how to print long doubles." >&4
6101 sSCNfldbl=$sPRIfldbl # expect consistency
6108 case "$sPRIfldbl" in
6109 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
6110 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
6111 d_SCNfldbl="$undef";
6113 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
6114 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
6115 d_SCNfldbl="$define";
6119 : see if modfl exists
6123 : see if prototype for modfl is available
6125 set d_modflproto modfl math.h
6128 d_modfl_pow32_bug="$undef"
6130 case "$d_longdbl$d_modfl" in
6133 Checking to see whether your modfl() is okay for large values...
6139 if $test "X$d_modflproto" != "X$define"; then
6141 /* Sigh. many current glibcs provide the function, but do not prototype it. */
6142 long double modfl (long double, long double *);
6147 long double nv = 4294967303.15;
6153 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
6157 case "$osname:$gccversion" in
6158 aix:) saveccflags="$ccflags"
6159 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
6162 if eval $compile; then
6165 *" 4294967303.150000 1.150000 4294967302.000000")
6166 echo >&4 "Your modfl() is broken for large values."
6167 d_modfl_pow32_bug="$define"
6169 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
6173 *" 4294967303.150000 0.150000 4294967303.000000")
6174 echo >&4 "Your modfl() seems okay for large values."
6176 *) echo >&4 "I don't understand your modfl() at all."
6180 $rm -f try.* try core core.try.*
6182 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
6185 case "$osname:$gccversion" in
6186 aix:) ccflags="$saveccflags" ;; # restore
6192 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6195 case "$uselongdouble" in
6196 $define|true|[yY]*) dflt='y';;
6201 Perl can be built to take advantage of long doubles which
6202 (if available) may give more accuracy and range for floating point numbers.
6204 If this doesn't make any sense to you, just accept the default '$dflt'.
6206 rp='Try to use long doubles if available?'
6209 y|Y) val="$define" ;;
6215 case "$uselongdouble" in
6216 true|[yY]*) uselongdouble="$define" ;;
6219 case "$uselongdouble" in
6221 : Look for a hint-file generated 'call-back-unit'. If the
6222 : user has specified that long doubles should be used,
6223 : we may need to set or change some other defaults.
6224 if $test -f uselongdouble.cbu; then
6225 echo "Your platform has some specific hints for long doubles, using them..."
6226 . ./uselongdouble.cbu
6229 (Your platform doesn't have any specific hints for long doubles.)
6236 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6237 $define:$define:$define)
6240 $define:$define:$undef)
6241 message="I could not find modfl"
6243 $define:$undef:$define)
6244 message="I could not find sqrtl"
6246 $define:$undef:$undef)
6247 message="I found neither sqrtl nor modfl"
6251 if $test "$message" != X; then
6254 *** You requested the use of long doubles but you do not seem to have
6255 *** the mathematic functions for long doubles.
6257 *** I'm disabling the use of long doubles.
6261 uselongdouble=$undef
6264 : determine the architecture name
6266 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6267 tarch=`arch`"-$osname"
6268 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6269 if uname -m > tmparch 2>&1 ; then
6270 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6271 -e 's/$/'"-$osname/" tmparch`
6279 case "$myarchname" in
6282 echo "(Your architecture name used to be $myarchname.)"
6286 case "$targetarch" in
6288 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6293 *) dflt="$archname";;
6295 rp='What is your architecture name'
6298 case "$usethreads" in
6300 echo "Threads selected." >&4
6302 *-thread*) echo "...and architecture name already has -thread." >&4
6304 *) archname="$archname-thread"
6305 echo "...setting architecture name to $archname." >&4
6310 case "$usemultiplicity" in
6312 echo "Multiplicity selected." >&4
6314 *-multi*) echo "...and architecture name already has -multi." >&4
6316 *) archname="$archname-multi"
6317 echo "...setting architecture name to $archname." >&4
6322 case "$use64bitint$use64bitall" in
6324 case "$archname64" in
6326 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6329 case "$use64bitint" in
6330 "$define") echo "64 bit integers selected." >&4 ;;
6332 case "$use64bitall" in
6333 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6336 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6338 *) archname="$archname-$archname64"
6339 echo "...setting architecture name to $archname." >&4
6345 case "$uselongdouble" in
6347 echo "Long doubles selected." >&4
6348 case "$longdblsize" in
6350 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6354 *-ld*) echo "...and architecture name already has -ld." >&4
6356 *) archname="$archname-ld"
6357 echo "...setting architecture name to $archname." >&4
6364 case "$useperlio" in
6366 echo "Perlio selected." >&4
6369 echo "Perlio not selected, using stdio." >&4
6371 *-stdio*) echo "...and architecture name already has -stdio." >&4
6373 *) archname="$archname-stdio"
6374 echo "...setting architecture name to $archname." >&4
6380 : determine root of directory hierarchy where package will be installed.
6383 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6386 dflt=`echo "$prefix" | sed 's/.$//'`
6394 By default, $package will be installed in $dflt/bin, manual pages
6395 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6396 installation directories. Typically this is something like /usr/local.
6397 If you wish to have binaries under /usr/bin but other parts of the
6398 installation under /usr/local, that's ok: you will be prompted
6399 separately for each of the installation directories, the prefix being
6400 only used to set the defaults.
6404 rp='Installation prefix to use?'
6412 *) oldprefix="$prefix";;
6421 *) afsroot=$afsroot ;;
6427 $define|true) afs=true ;;
6428 $undef|false) afs=false ;;
6429 *) if test -d $afsroot; then
6437 echo "AFS may be running... I'll be extra cautious then..." >&4
6439 echo "AFS does not seem to be running..." >&4
6442 : determine installation prefix for where package is to be installed.
6446 Since you are running AFS, I need to distinguish the directory in which
6447 files will reside from the directory in which they are installed (and from
6448 which they are presumably copied to the former directory by occult means).
6451 case "$installprefix" in
6452 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6453 *) dflt="$installprefix";;
6458 In some special cases, particularly when building $package for distribution,
6459 it is convenient to distinguish the directory in which files should be
6460 installed from the directory ($prefix) in which they will
6461 eventually reside. For most users, these two directories are the same.
6464 case "$installprefix" in
6466 *) dflt=$installprefix;;
6470 rp='What installation prefix should I use for installing files?'
6472 installprefix="$ans"
6473 installprefixexp="$ansexp"
6475 : set the prefixit variable, to compute a suitable default value
6476 prefixit='case "$3" in
6478 case "$oldprefix" in
6479 "") eval "$1=\"\$$2\"";;
6486 ""|" ") eval "$1=\"\$$2\"";;
6492 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6494 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6495 /*-$oldprefix/*|\~*-$oldprefix/*)
6496 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6497 *) eval "$1=\"\$$2\"";;
6501 : get the patchlevel
6503 echo "Getting the current patchlevel..." >&4
6504 if $test -r $rsrc/patchlevel.h;then
6505 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6506 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6507 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6508 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6509 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6510 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6511 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6520 $echo "(You do not have patchlevel.h. Eek.)"
6522 if $test -r $rsrc/.patch ; then
6523 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6524 perl_patchlevel=`cat $rsrc/.patch`
6527 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6528 version_patchlevel_string="version $patchlevel subversion $subversion"
6529 case "$perl_patchlevel" in
6531 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6534 $echo "(You have $package $version_patchlevel_string.)"
6538 : XXX Should be a Configure test for double-dots in filenames.
6539 version=`echo $revision $patchlevel $subversion | \
6540 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6541 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6542 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6545 version=`echo $revision $patchlevel $subversion | \
6546 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6547 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6548 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6551 : Special case the 5.005_xx maintenance series, which used 5.005
6552 : without any subversion label as a subdirectory in $sitelib
6553 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6554 api_versionstring='5.005'
6557 : determine installation style
6558 : For now, try to deduce it from prefix unless it is already set.
6559 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6560 case "$installstyle" in
6561 '') case "$prefix" in
6562 *perl*) dflt='lib';;
6563 *) dflt='lib/perl5' ;;
6566 *) dflt="$installstyle" ;;
6568 : Probably not worth prompting for this since we prompt for all
6569 : the directories individually, and the prompt would be too long and
6573 : determine where private library files go
6574 : Usual default is /usr/local/lib/perl5/$version.
6575 : Also allow things like /opt/perl/lib/$version, since
6576 : /opt/perl/lib/perl5... would be redundant.
6577 : The default "style" setting is made in installstyle.U
6578 case "$installstyle" in
6579 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6580 *) set dflt privlib lib/$version ;;
6585 There are some auxiliary files for $package that need to be put into a
6586 private library directory that is accessible by everyone.
6590 rp='Pathname where the private library files will reside?'
6593 privlibexp="$ansexp"
6594 : Change installation prefix, if necessary.
6595 if $test X"$prefix" != X"$installprefix"; then
6596 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6598 installprivlib="$privlibexp"
6601 : set the prefixup variable, to restore leading tilda escape
6602 prefixup='case "$prefixexp" in
6604 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6607 : determine where public architecture dependent libraries go
6610 : privlib default is /usr/local/lib/$package/$version
6611 : archlib default is /usr/local/lib/$package/$version/$archname
6612 : privlib may have an optional trailing /share.
6613 tdflt=`echo $privlib | $sed 's,/share$,,'`
6614 tdflt=$tdflt/$archname
6623 $spackage contains architecture-dependent library files. If you are
6624 sharing libraries in a heterogeneous environment, you might store
6625 these files in a separate location. Otherwise, you can just include
6626 them with the rest of the public library files.
6630 rp='Where do you want to put the public architecture-dependent libraries?'
6633 archlibexp="$ansexp"
6634 if $test X"$archlib" = X"$privlib"; then
6639 : Change installation prefix, if necessary.
6640 if $test X"$prefix" != X"$installprefix"; then
6641 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6643 installarchlib="$archlibexp"
6646 : see if setuid scripts can be secure
6649 Some kernels have a bug that prevents setuid #! scripts from being
6650 secure. Some sites have disabled setuid #! scripts because of this.
6652 First let's decide if your kernel supports secure setuid #! scripts.
6653 (If setuid #! scripts would be secure but have been disabled anyway,
6654 don't say that they are secure if asked.)
6659 if $test -d /dev/fd; then
6660 echo "#!$ls" >reflect
6661 chmod +x,u+s reflect
6662 ./reflect >flect 2>&1
6663 if $contains "/dev/fd" flect >/dev/null; then
6664 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6668 If you are not sure if they are secure, I can check but I'll need a
6669 username and password different from the one you are using right now.
6670 If you don't have such a username or don't want me to test, simply
6674 rp='Other username to test security of setuid scripts with?'
6679 case "$d_suidsafe" in
6680 '') echo "I'll assume setuid scripts are *not* secure." >&4
6683 echo "Well, the $hint value is *not* secure." >&4
6685 *) echo "Well, the $hint value *is* secure." >&4
6690 $rm -f reflect flect
6691 echo "#!$ls" >reflect
6692 chmod +x,u+s reflect
6695 echo '"su" will (probably) prompt you for '"$ans's password."
6696 su $ans -c './reflect >flect'
6697 if $contains "/dev/fd" flect >/dev/null; then
6698 echo "Okay, it looks like setuid scripts are secure." >&4
6701 echo "I don't think setuid scripts are secure." >&4
6706 rp='Does your kernel have *secure* setuid scripts?'
6709 [yY]*) val="$define";;
6714 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6715 echo "(That's for file descriptors, not floppy disks.)"
6721 $rm -f reflect flect
6723 : now see if they want to do setuid emulation
6726 case "$d_suidsafe" in
6729 echo "No need to emulate SUID scripts since they are secure here." >&4
6733 Some systems have disabled setuid scripts, especially systems where
6734 setuid scripts cannot be secure. On systems where setuid scripts have
6735 been disabled, the setuid/setgid bits on scripts are currently
6736 useless. It is possible for $package to detect those bits and emulate
6737 setuid/setgid in a secure fashion. This emulation will only work if
6738 setuid scripts have been disabled in your kernel.
6742 "$define") dflt=y ;;
6745 rp="Do you want to do setuid/setgid emulation?"
6748 [yY]*) val="$define";;
6756 : see if this is a malloc.h system
6757 : we want a real compile instead of Inhdr because some systems have a
6758 : malloc.h that just gives a compile error saying to use stdlib.h instead
6763 int main () { return 0; }
6766 if eval $compile; then
6767 echo "<malloc.h> found." >&4
6770 echo "<malloc.h> NOT found." >&4
6777 : see if stdlib is available
6778 set stdlib.h i_stdlib
6781 : check for void type
6783 echo "Checking to see how well your C compiler groks the void type..." >&4
6784 case "$voidflags" in
6786 $cat >try.c <<'EOCP'
6792 extern void moo(); /* function returning void */
6793 void (*goo)(); /* ptr to func returning void */
6795 void *hue; /* generic ptr */
6808 int main() { sub(); }
6810 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6811 voidflags=$defvoidused
6812 echo "Good. It appears to support void to the level $package wants.">&4
6813 if $contains warning .out >/dev/null 2>&1; then
6814 echo "However, you might get some warnings that look like this:"
6818 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6819 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6820 echo "It supports 1..."
6821 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6822 echo "It also supports 2..."
6823 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6825 echo "And it supports 4 but not 8 definitely."
6827 echo "It doesn't support 4..."
6828 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6830 echo "But it supports 8."
6833 echo "Neither does it support 8."
6837 echo "It does not support 2..."
6838 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6840 echo "But it supports 4 and 8."
6842 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6844 echo "And it supports 4 but has not heard about 8."
6846 echo "However it supports 8 but not 4."
6851 echo "There is no support at all for void."
6856 case "$voidflags" in
6859 Support flag bits are:
6860 1: basic void declarations.
6861 2: arrays of pointers to functions returning void.
6862 4: operations between pointers to and addresses of void functions.
6863 8: generic void pointers.
6866 rp="Your void support flags add up to what?"
6873 : check for length of pointer
6877 echo "Checking to see how big your pointers are..." >&4
6878 if test "$voidflags" -gt 7; then
6879 echo '#define VOID_PTR char *' > try.c
6881 echo '#define VOID_PTR void *' > try.c
6883 $cat >>try.c <<'EOCP'
6887 printf("%d\n", (int)sizeof(VOID_PTR));
6892 if eval $compile_ok; then
6893 ptrsize=`$run ./try`
6894 echo "Your pointers are $ptrsize bytes long."
6897 echo "(I can't seem to compile the test program. Guessing...)" >&4
6898 rp="What is the size of a pointer (in bytes)?"
6905 case "$use64bitall" in
6906 "$define"|true|[yY]*)
6910 *** You have chosen a maximally 64-bit build, but your pointers
6911 *** are only 4 bytes wide, disabling maximal 64-bitness.
6914 use64bitall="$undef"
6915 case "$use64bitint" in
6916 "$define"|true|[yY]*) ;;
6919 *** Downgrading from maximal 64-bitness to using 64-bit integers.
6922 use64bitint="$define"
6931 : determine which malloc to compile in
6933 case "$usemymalloc" in
6934 [yY]*|true|$define) dflt='y' ;;
6935 [nN]*|false|$undef) dflt='n' ;;
6936 *) case "$ptrsize" in
6942 rp="Do you wish to attempt to use the malloc that comes with $package?"
6948 mallocsrc='malloc.c'
6949 mallocobj="malloc$_o"
6950 d_mymalloc="$define"
6953 : Remove malloc from list of libraries to use
6954 echo "Removing unneeded -lmalloc from library list" >&4
6955 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6958 echo "libs = $libs" >&4
6970 : compute the return types of malloc and free
6972 $cat >malloc.c <<END
6976 #include <sys/types.h>
6990 case "$malloctype" in
6992 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6999 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7003 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7010 echo "Your system uses $freetype free(), it would seem." >&4
7014 After $package is installed, you may wish to install various
7015 add-on modules and utilities. Typically, these add-ons will
7016 be installed under $prefix with the rest
7017 of this package. However, you may wish to install such add-ons
7018 elsewhere under a different prefix.
7020 If you do not wish to put everything under a single prefix, that's
7021 ok. You will be prompted for the individual locations; this siteprefix
7022 is only used to suggest the defaults.
7024 The default should be fine for most people.
7028 rp='Installation prefix to use for add-on modules and utilities?'
7029 : XXX Here might be another good place for an installstyle setting.
7030 case "$siteprefix" in
7032 *) dflt=$siteprefix ;;
7035 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7037 case "$siteprefix" in
7041 *) oldsiteprefix="$prefix";;
7046 siteprefixexp="$ansexp"
7048 : determine where site specific libraries go.
7049 : Usual default is /usr/local/lib/perl5/site_perl/$version
7050 : The default "style" setting is made in installstyle.U
7051 : XXX No longer works with Prefixit stuff.
7052 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7054 '') case "$installstyle" in
7055 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7056 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7064 The installation process will create a directory for
7065 site-specific extensions and modules. Most users find it convenient
7066 to place all site-specific files in this directory rather than in the
7067 main distribution directory.
7071 rp='Pathname for the site-specific library files?'
7074 sitelibexp="$ansexp"
7075 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7076 : Change installation prefix, if necessary.
7077 if $test X"$prefix" != X"$installprefix"; then
7078 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
7080 installsitelib="$sitelibexp"
7083 : determine where site specific architecture-dependent libraries go.
7084 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7085 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7086 : sitelib may have an optional trailing /share.
7088 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7089 dflt="$dflt/$archname"
7094 set sitearch sitearch none
7098 The installation process will also create a directory for
7099 architecture-dependent site-specific extensions and modules.
7103 rp='Pathname for the site-specific architecture-dependent library files?'
7106 sitearchexp="$ansexp"
7107 : Change installation prefix, if necessary.
7108 if $test X"$prefix" != X"$installprefix"; then
7109 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7111 installsitearch="$sitearchexp"
7116 The installation process will also create a directory for
7117 vendor-supplied add-ons. Vendors who supply perl with their system
7118 may find it convenient to place all vendor-supplied files in this
7119 directory rather than in the main distribution directory. This will
7120 ease upgrades between binary-compatible maintenance versions of perl.
7122 Of course you may also use these directories in whatever way you see
7123 fit. For example, you might use them to access modules shared over a
7124 company-wide network.
7126 The default answer should be fine for most people.
7127 This causes further questions about vendor add-ons to be skipped
7128 and no vendor-specific directories will be configured for perl.
7131 rp='Do you want to configure vendor-specific add-on directories?'
7132 case "$usevendorprefix" in
7133 define|true|[yY]*) dflt=y ;;
7134 *) : User may have set vendorprefix directly on Configure command line.
7135 case "$vendorprefix" in
7144 rp='Installation prefix to use for vendor-supplied add-ons?'
7145 case "$vendorprefix" in
7147 *) dflt=$vendorprefix ;;
7150 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7152 case "$vendorprefix" in
7156 *) oldvendorprefix="$prefix";;
7160 usevendorprefix="$define"
7162 vendorprefixexp="$ansexp"
7164 *) usevendorprefix="$undef"
7170 case "$vendorprefix" in
7171 '') d_vendorlib="$undef"
7175 *) d_vendorlib="$define"
7176 : determine where vendor-supplied modules go.
7177 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7178 case "$vendorlib" in
7180 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7181 case "$installstyle" in
7182 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7183 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7186 *) dflt="$vendorlib"
7190 rp='Pathname for the vendor-supplied library files?'
7193 vendorlibexp="$ansexp"
7196 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7197 : Change installation prefix, if necessary.
7198 if $test X"$prefix" != X"$installprefix"; then
7199 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7201 installvendorlib="$vendorlibexp"
7204 case "$vendorprefix" in
7205 '') d_vendorarch="$undef"
7209 *) d_vendorarch="$define"
7210 : determine where vendor-supplied architecture-dependent libraries go.
7211 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7212 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7213 : vendorlib may have an optional trailing /share.
7214 case "$vendorarch" in
7215 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7216 dflt="$dflt/$archname"
7218 *) dflt="$vendorarch" ;;
7221 rp='Pathname for vendor-supplied architecture-dependent files?'
7224 vendorarchexp="$ansexp"
7227 : Change installation prefix, if necessary.
7228 if $test X"$prefix" != X"$installprefix"; then
7229 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7231 installvendorarch="$vendorarchexp"
7234 : Final catch-all directories to search
7237 Lastly, you can have perl look in other directories for extensions and
7238 modules in addition to those already specified.
7239 These directories will be searched after
7243 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7244 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7246 case "$otherlibdirs" in
7247 ''|' ') dflt='none' ;;
7248 *) dflt="$otherlibdirs" ;;
7251 Enter a colon-separated set of extra paths to include in perl's @INC
7252 search path, or enter 'none' for no extra paths.
7256 rp='Colon-separated list of additional directories for perl to search?'
7259 ' '|''|none) otherlibdirs=' ' ;;
7260 *) otherlibdirs="$ans" ;;
7262 case "$otherlibdirs" in
7266 set d_perl_otherlibdirs
7269 : Cruising for prototypes
7271 echo "Checking out function prototypes..." >&4
7272 $cat >prototype.c <<'EOCP'
7273 int main(int argc, char *argv[]) {
7276 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7277 echo "Your C compiler appears to support function prototypes."
7280 echo "Your C compiler doesn't seem to understand function prototypes."
7287 case "$prototype" in
7289 *) ansi2knr='ansi2knr'
7294 This version of $package can only be compiled by a compiler that
7295 understands function prototypes. Unfortunately, your C compiler
7297 doesn't seem to understand them. Sorry about that.
7299 If GNU cc is available for your system, perhaps you could try that instead.
7301 Eventually, we hope to support building Perl with pre-ANSI compilers.
7302 If you would like to help in that effort, please contact <perlbug@perl.org>.
7304 Aborting Configure now.
7310 : determine where public executables go
7315 rp='Pathname where the public executables will reside?'
7317 if $test "X$ansexp" != "X$binexp"; then
7322 : Change installation prefix, if necessary.
7323 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7324 if $test X"$prefix" != X"$installprefix"; then
7325 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7327 installbin="$binexp"
7336 Perl can be built with extra modules or bundles of modules which
7337 will be fetched from the CPAN and installed alongside Perl.
7339 Notice that you will need access to the CPAN; either via the Internet,
7340 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7341 be asked later to configure the CPAN.pm module which will in turn do
7342 the installation of the rest of the extra modules or bundles.)
7344 Notice also that if the modules require any external software such as
7345 libraries and headers (the libz library and the zlib.h header for the
7346 Compress::Zlib module, for example) you MUST have any such software
7347 already installed, this configuration process will NOT install such
7350 If this doesn't make any sense to you, just accept the default '$dflt'.
7352 rp='Install any extra modules (y or n)?'
7358 Please list any extra modules or bundles to be installed from CPAN,
7359 with spaces between the names. The names can be in any format the
7360 'install' command of CPAN.pm will understand. (Answer 'none',
7361 without the quotes, to install no extra modules or bundles.)
7371 $rm -f ../extras.lst
7373 *) echo "(Saving the list of extras for later...)"
7374 echo "$extras" > ../extras.lst
7382 : determine where html pages for programs go
7383 set html1dir html1dir none
7387 If you wish to install html files for programs in $spackage, indicate
7388 the appropriate directory here. To skip installing html files,
7392 ''|none|$undef|' ') dflt=none ;;
7393 *) dflt=$html1dir ;;
7396 rp="Directory for the main $spackage html pages?"
7399 html1direxp="$ansexp"
7400 : Use ' ' for none so value is preserved next time through Configure
7401 $test X"$html1dir" = "X" && html1dir=' '
7402 : Change installation prefix, if necessary.
7403 if $test X"$prefix" != X"$installprefix"; then
7404 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
7406 installhtml1dir="$html1direxp"
7409 : determine where html pages for libraries and modules go
7410 set html3dir html3dir none
7414 If you wish to install html files for modules associated with $spackage,
7415 indicate the appropriate directory here. To skip installing html files,
7418 : There is no obvious default. If they have specified html1dir, then
7419 : try to key off that, possibly changing .../html1 into .../html3.
7421 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7422 *) dflt=$html3dir ;;
7425 rp="Directory for the $spackage module html pages?"
7428 html3direxp="$ansexp"
7429 : Use ' ' for none so value is preserved next time through Configure
7430 $test X"$html3dir" = "X" && html3dir=' '
7431 : Change installation prefix, if necessary.
7432 if $test X"$prefix" != X"$installprefix"; then
7433 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
7435 installhtml3dir="$html3direxp"
7438 : Find perl5.005 or later.
7439 echo "Looking for a previously installed perl5.005 or later... "
7441 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7442 : Check if this perl is recent and can load a simple module
7443 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7446 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7456 '') echo "None found. That's ok.";;
7457 *) echo "Using $perl5." ;;
7460 : Determine list of previous versions to include in @INC
7461 $cat > getverlist <<EOPL
7464 \$api_versionstring = "$api_versionstring";
7465 \$version = "$version";
7466 \$stem = "$sitelib_stem";
7467 \$archname = "$archname";
7469 $cat >> getverlist <<'EOPL'
7470 # Can't have leading @ because metaconfig interprets it as a command!
7471 ;@inc_version_list=();
7472 # XXX Redo to do opendir/readdir?
7475 ;@candidates = glob("5.*");
7481 # XXX ToDo: These comparisons must be reworked when two-digit
7482 # subversions come along, so that 5.7.10 compares as greater than
7483 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7484 # widespread that we can use the built-in version vectors rather
7485 # than reinventing them here. For 5.6.0, however, we must
7486 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7487 foreach $d (@candidates) {
7488 if ($d lt $version) {
7489 if ($d ge $api_versionstring) {
7490 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7492 elsif ($d ge "5.005") {
7493 unshift(@inc_version_list, grep { -d } $d);
7497 # Skip newer version. I.e. don't look in
7498 # 5.7.0 if we're installing 5.6.1.
7502 if (@inc_version_list) {
7503 print join(' ', @inc_version_list);
7506 # Blank space to preserve value for next Configure run.
7511 case "$inc_version_list" in
7512 '') if test -x "$perl5$exe_ext"; then
7513 dflt=`$perl5 getverlist`
7518 $undef) dflt='none' ;;
7519 *) eval dflt=\"$inc_version_list\" ;;
7522 ''|' ') dflt=none ;;
7529 In order to ease the process of upgrading, this version of perl
7530 can be configured to use modules built and installed with earlier
7531 versions of perl that were installed under $prefix. Specify here
7532 the list of earlier versions that this version of perl should check.
7533 If Configure detected no earlier versions of perl installed under
7534 $prefix, then the list will be empty. Answer 'none' to tell perl
7535 to not search earlier versions.
7537 The default should almost always be sensible, so if you're not sure,
7538 just accept the default.
7541 rp='List of earlier versions to include in @INC?'
7544 [Nn]one|''|' ') inc_version_list=' ' ;;
7545 *) inc_version_list="$ans" ;;
7547 case "$inc_version_list" in
7549 inc_version_list_init='0';;
7550 *) inc_version_list_init=`echo $inc_version_list |
7551 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7556 : determine whether to install perl also as /usr/bin/perl
7559 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7561 Many scripts expect perl to be installed as /usr/bin/perl.
7563 If you want to, I can install the perl you are about to compile
7564 as /usr/bin/perl (in addition to $bin/perl).
7566 if test -f /usr/bin/perl; then
7569 However, please note that because you already have a /usr/bin/perl,
7570 overwriting that with a new Perl would very probably cause problems.
7571 Therefore I'm assuming you don't want to do that (unless you insist).
7574 case "$installusrbinperl" in
7575 "$define"|[yY]*) dflt='y';;
7581 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7584 case "$installusrbinperl" in
7585 "$undef"|[nN]*) dflt='n';;
7589 rp="Do you want to install perl as /usr/bin/perl?"
7592 [yY]*) val="$define";;
7598 set installusrbinperl
7601 : see if dld is available
7605 : see if dlopen exists
7612 : determine which dynamic loading, if any, to compile in
7614 dldir="ext/DynaLoader"
7627 $define) dflt='y' ;;
7630 $define) dflt='y' ;;
7632 : Does a dl_xxx.xs file exist for this operating system
7633 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7636 rp="Do you wish to use dynamic loading?"
7643 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7644 dflt="$dldir/dl_${osname}.xs"
7645 elif $test "$d_dlopen" = "$define" ; then
7646 dflt="$dldir/dl_dlopen.xs"
7647 elif $test "$i_dld" = "$define" ; then
7648 dflt="$dldir/dl_dld.xs"
7653 *) dflt="$dldir/$dlsrc"
7656 echo "The following dynamic loading files are available:"
7657 : Can not go over to $dldir because getfile has path hard-coded in.
7658 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7659 rp="Source file to use for dynamic loading"
7665 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7669 Some systems may require passing special flags to $cc -c to
7670 compile modules that will be used to create a shared library.
7671 To use no flags, say "none".
7674 case "$cccdlflags" in
7675 '') case "$gccversion" in
7676 '') case "$osname" in
7678 next) dflt='none' ;;
7679 irix*) dflt='-KPIC' ;;
7680 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7681 sunos) dflt='-pic' ;;
7685 *) case "$osname" in
7686 darwin) dflt='none' ;;
7687 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7692 *) dflt="$cccdlflags" ;;
7694 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7697 none) cccdlflags=' ' ;;
7698 *) cccdlflags="$ans" ;;
7703 Some systems use ld to create libraries that can be dynamically loaded,
7704 while other systems (such as those using ELF) use $cc.
7708 '') $cat >try.c <<'EOM'
7709 /* Test for whether ELF binaries are produced */
7714 int i = open("a.out",O_RDONLY);
7717 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7718 exit(0); /* succeed (yes, it's ELF) */
7723 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7725 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7729 echo "I'll use ld to build dynamic libraries."
7738 rp="What command should be used to create dynamic libraries?"
7744 Some systems may require passing special flags to $ld to create a
7745 library that can be dynamically loaded. If your ld flags include
7746 -L/other/path options to locate libraries outside your loader's normal
7747 search path, you may need to specify those -L options here as well. To
7748 use no flags, say "none".
7751 case "$lddlflags" in
7752 '') case "$osname" in
7753 beos) dflt='-nostart' ;;
7755 case "$gccversion" in
7756 '') dflt="$dflt +vnocompatwarnings" ;;
7759 linux|irix*) dflt='-shared' ;;
7760 next) dflt='none' ;;
7761 solaris) dflt='-G' ;;
7762 sunos) dflt='-assert nodefinitions' ;;
7763 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7767 *) dflt="$lddlflags" ;;
7770 : Try to guess additional flags to pick up local libraries.
7771 : Be careful not to append to a plain 'none'
7775 for thisflag in $ldflags; do
7780 *) dflt="$dflt $thisflag" ;;
7787 ''|' ') dflt='none' ;;
7790 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7793 none) lddlflags=' ' ;;
7794 *) lddlflags="$ans" ;;
7799 Some systems may require passing special flags to $cc to indicate that
7800 the resulting executable will use dynamic linking. To use no flags,
7804 case "$ccdlflags" in
7805 '') case "$osname" in
7806 hpux) dflt='-Wl,-E' ;;
7807 linux) dflt='-rdynamic' ;;
7808 next) dflt='none' ;;
7809 sunos) dflt='none' ;;
7813 *) dflt="$ccdlflags" ;;
7815 rp="Any special flags to pass to $cc to use dynamic linking?"
7818 none) ccdlflags=' ' ;;
7819 *) ccdlflags="$ans" ;;
7833 # No dynamic loading being used, so don't bother even to prompt.
7836 *) case "$useshrplib" in
7837 '') case "$osname" in
7838 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7840 also='Building a shared libperl is required for dynamic loading to work on your system.'
7845 also='Building a shared libperl is needed for MAB support.'
7863 The perl executable is normally obtained by linking perlmain.c with
7864 libperl${_a}, any static extensions (usually just DynaLoader), and
7865 any other libraries needed on this system (such as -lm, etc.). Since
7866 your system supports dynamic loading, it is probably possible to build
7867 a shared libperl.$so. If you will have more than one executable linked
7868 to libperl.$so, this will significantly reduce the size of each
7869 executable, but it may have a noticeable affect on performance. The
7870 default is probably sensible for your system.
7874 rp="Build a shared libperl.$so (y/n)"
7878 useshrplib='true' ;;
7879 *) useshrplib='false' ;;
7884 case "$useshrplib" in
7888 # Figure out a good name for libperl.so. Since it gets stored in
7889 # a version-specific architecture-dependent library, the version
7890 # number isn't really that important, except for making cc/ld happy.
7892 # A name such as libperl.so.3.1
7893 majmin="libperl.$so.$patchlevel.$subversion"
7894 # A name such as libperl.so.301
7895 majonly=`echo $patchlevel $subversion |
7896 $awk '{printf "%d%02d", $1, $2}'`
7897 majonly=libperl.$so.$majonly
7898 # I'd prefer to keep the os-specific stuff here to a minimum, and
7899 # rely on figuring it out from the naming of libc.
7900 case "${osname}${osvers}" in
7903 # XXX How handle the --version stuff for MAB?
7905 linux*) # ld won't link with a bare -lperl otherwise.
7908 cygwin*) # ld links against an importlib
7909 dflt=libperl$lib_ext
7911 *) # Try to guess based on whether libc has major.minor.
7913 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7914 *libc.$so.[0-9]*) dflt=$majonly ;;
7915 *) dflt=libperl.$so ;;
7925 I need to select a good name for the shared libperl. If your system uses
7926 library names with major and minor numbers, then you might want something
7927 like $majmin. Alternatively, if your system uses a single version
7928 number for shared libraries, then you might want to use $majonly.
7929 Or, your system might be quite happy with a simple libperl.$so.
7931 Since the shared libperl will get installed into a version-specific
7932 architecture-dependent directory, the version number of the shared perl
7933 library probably isn't important, so the default should be o.k.
7936 rp='What name do you want to give to the shared libperl?'
7939 echo "Ok, I'll use $libperl"
7942 libperl="libperl${_a}"
7946 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7950 WARNING: Use of the shrpdir variable for the installation location of
7951 the shared $libperl is not supported. It was never documented and
7952 will not work in this version. Let me (perlbug@perl.org)
7953 know of any problems this may cause.
7959 But your current setting of $shrpdir is
7960 the default anyway, so it's harmless.
7965 Further, your current attempted setting of $shrpdir
7966 conflicts with the value of $archlibexp/CORE
7967 that installperl will use.
7974 # How will the perl executable find the installed shared $libperl?
7975 # Add $xxx to ccdlflags.
7976 # If we can't figure out a command-line option, use $shrpenv to
7977 # set env LD_RUN_PATH. The main perl makefile uses this.
7978 shrpdir=$archlibexp/CORE
7981 if "$useshrplib"; then
7984 # We'll set it in Makefile.SH...
7989 freebsd|netbsd|openbsd)
7990 xxx="-Wl,-R$shrpdir"
7992 bsdos|linux|irix*|dec_osf)
7993 xxx="-Wl,-rpath,$shrpdir"
7996 # next doesn't like the default...
7999 # beos doesn't like the default, either.
8002 # hpux doesn't like the default, either.
8003 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8006 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8012 # Only add $xxx if it isn't already in ccdlflags.
8013 case " $ccdlflags " in
8015 *) ccdlflags="$ccdlflags $xxx"
8018 Adding $xxx to the flags
8019 passed to $ld so that the perl executable will find the
8020 installed shared $libperl.
8028 # Fix ccdlflags in AIX for building external extensions.
8029 # (For building Perl itself bare -bE:perl.exp is needed,
8030 # Makefile.SH takes care of this.)
8032 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8034 # Respect a hint or command-line value.
8036 '') shrpenv="$tmp_shrpenv" ;;
8038 case "$ldlibpthname" in
8039 '') ldlibpthname=LD_LIBRARY_PATH ;;
8040 none) ldlibpthname='' ;;
8043 : determine where manual pages are on this system
8047 syspath='/usr/share/man/man1 /usr/man/man1'
8048 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8049 syspath="$syspath /usr/man/u_man/man1"
8050 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8051 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8052 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8053 sysman=`./loc . /usr/man/man1 $syspath`
8056 if $test -d "$sysman"; then
8057 echo "System manual is in $sysman." >&4
8059 echo "Could not find manual pages in source form." >&4
8062 : determine where manual pages go
8063 set man1dir man1dir none
8067 $spackage has manual pages available in source form.
8071 echo "However, you don't have nroff, so they're probably useless to you."
8073 '') man1dir="none";;
8076 echo "If you don't want the manual sources installed, answer 'none'."
8081 lookpath="$prefixexp/share/man/man1"
8082 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8083 lookpath="$lookpath $prefixexp/man/p_man/man1"
8084 lookpath="$lookpath $prefixexp/man/u_man/man1"
8085 lookpath="$lookpath $prefixexp/man/man.1"
8087 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8088 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8098 rp="Where do the main $spackage manual pages (source) go?"
8100 if $test "X$man1direxp" != "X$ansexp"; then
8104 man1direxp="$ansexp"
8110 : Change installation prefix, if necessary.
8111 if $test X"$prefix" != X"$installprefix"; then
8112 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8114 installman1dir="$man1direxp"
8117 : What suffix to use on installed man pages
8124 rp="What suffix should be used for the main $spackage man pages?"
8126 '') case "$man1dir" in
8140 *) dflt="$man1ext";;
8147 : see if we can have long filenames
8149 first=123456789abcdef
8151 if (echo hi >$first) 2>/dev/null; then
8152 if $test -f 123456789abcde; then
8153 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8156 echo 'You can have filenames longer than 14 characters.'>&4
8161 You can't have filenames longer than 14 chars.
8162 You can't even think about them!
8168 $rm -rf 123456789abcde*
8170 : determine where library module manual pages go
8171 set man3dir man3dir none
8175 $spackage has manual pages for many of the library modules.
8181 However, you don't have nroff, so they're probably useless to you.
8184 '') man3dir="none";;
8188 case "$d_flexfnam" in
8191 However, your system can't handle the long file names like File::Basename.3.
8194 '') man3dir="none";;
8198 echo "If you don't want the manual sources installed, answer 'none'."
8199 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8201 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8202 if $test -d "$privlib/man/man3"; then
8205 WARNING: Previous versions of perl installed man3 pages into
8206 $privlib/man/man3. This version will suggest a
8207 new default of $dflt.
8211 rp='Do you wish to preserve the old behavior?(y/n)'
8214 y*) dflt="$privlib/man/man3" ;;
8219 *) dflt="$man3dir" ;;
8226 rp="Where do the $package library man pages (source) go?"
8229 man3direxp="$ansexp"
8235 : Change installation prefix, if necessary.
8236 if $test X"$prefix" != X"$installprefix"; then
8237 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8239 installman3dir="$man3direxp"
8242 : What suffix to use on installed man pages
8248 rp="What suffix should be used for the $package library man pages?"
8250 '') case "$man3dir" in
8264 *) dflt="$man3ext";;
8271 : see if we have to deal with yellow pages, now NIS.
8272 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8273 if $test -f /usr/etc/nibindd; then
8275 echo "I'm fairly confident you're on a NeXT."
8277 rp='Do you get the hosts file via NetInfo?'
8286 y*) hostcat='nidump hosts .';;
8287 *) case "$hostcat" in
8288 nidump*) hostcat='';;
8298 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8306 rp='Are you getting the hosts file via yellow pages?'
8309 y*) hostcat='ypcat hosts';;
8310 *) hostcat='cat /etc/hosts';;
8316 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8319 '') test -f /etc/group && groupcat='cat /etc/group';;
8322 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8325 : now get the host name
8327 echo "Figuring out host name..." >&4
8328 case "$myhostname" in
8330 echo 'Maybe "hostname" will work...'
8331 if tans=`sh -c hostname 2>&1` ; then
8339 if $test "$cont"; then
8341 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8342 if tans=`cat /etc/systemid 2>&1` ; then
8344 phostname='cat /etc/systemid'
8345 echo "Whadyaknow. Xenix always was a bit strange..."
8348 elif $test -r /etc/systemid; then
8349 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8352 if $test "$cont"; then
8353 echo 'No, maybe "uuname -l" will work...'
8354 if tans=`sh -c 'uuname -l' 2>&1` ; then
8356 phostname='uuname -l'
8358 echo 'Strange. Maybe "uname -n" will work...'
8359 if tans=`sh -c 'uname -n' 2>&1` ; then
8361 phostname='uname -n'
8363 echo 'Oh well, maybe I can mine it out of whoami.h...'
8364 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8365 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8366 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8368 case "$myhostname" in
8369 '') echo "Does this machine have an identity crisis or something?"
8372 echo "Well, you said $myhostname before..."
8373 phostname='echo $myhostname';;
8379 case "$myhostname" in
8380 '') myhostname=noname ;;
8382 : you do not want to know about this
8387 if $test "$myhostname" ; then
8389 rp='Your host name appears to be "'$myhostname'".'" Right?"
8397 : bad guess or no guess
8398 while $test "X$myhostname" = X ; do
8400 rp="Please type the (one word) name of your host:"
8405 : translate upper to lower if necessary
8406 case "$myhostname" in
8408 echo "(Normalizing case in your host name)"
8409 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8413 case "$myhostname" in
8415 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8416 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8417 echo "(Trimming domain name from host name--host name is now $myhostname)"
8419 *) case "$mydomain" in
8422 test "X$hostcat" = "Xypcat hosts" &&
8423 ypmatch "$myhostname" hosts 2>/dev/null |\
8424 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8427 test "X$hostcat" != "X" &&
8428 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8429 /[ ]$myhostname[ . ]/p" > hosts
8432 if $test -f hosts; then
8433 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8434 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8435 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8436 hosts | $sort | $uniq | \
8437 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8438 case `$echo X$dflt` in
8439 X*\ *) echo "(Several hosts in the database matched hostname)"
8442 X.) echo "(You do not have fully-qualified names in the hosts database)"
8446 echo "(I cannot locate a hosts database anywhere)"
8451 tans=`./loc resolv.conf X /etc /usr/etc`
8452 if $test -f "$tans"; then
8453 echo "(Attempting domain name extraction from $tans)"
8454 dflt=.`$sed -n -e 's/ / /g' \
8455 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8456 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8458 .) dflt=.`$sed -n -e 's/ / /g' \
8459 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8460 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8467 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8468 dflt=.`sh -c domainname 2>/dev/null`
8471 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8475 case "$dflt$osname" in
8476 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8477 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8481 .) echo "(Lost all hope -- silly guess then)"
8487 *) dflt="$mydomain";;
8491 rp="What is your domain name?"
8501 : translate upper to lower if necessary
8504 echo "(Normalizing case in your domain name)"
8505 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8509 : a little sanity check here
8510 case "$phostname" in
8513 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8514 $myhostname$mydomain|$myhostname) ;;
8516 case "$phostname" in
8518 echo "(That doesn't agree with your whoami.h file, by the way.)"
8521 echo "(That doesn't agree with your $phostname command, by the way.)"
8531 I need to get your e-mail address in Internet format if possible, i.e.
8532 something like user@host.domain. Please answer accurately since I have
8533 no easy means to double check it. The default value provided below
8534 is most probably close to reality but may not be valid from outside
8535 your organization...
8539 while test "$cont"; do
8541 '') dflt="$cf_by@$myhostname$mydomain";;
8542 *) dflt="$cf_email";;
8544 rp='What is your e-mail address?'
8550 rp='Address does not look like an Internet one. Use it anyway?'
8566 If you or somebody else will be maintaining perl at your site, please
8567 fill in the correct e-mail address here so that they may be contacted
8568 if necessary. Currently, the "perlbug" program included with perl
8569 will send mail to this address in addition to perlbug@perl.org. You may
8570 enter "none" for no administrator.
8573 case "$perladmin" in
8574 '') dflt="$cf_email";;
8575 *) dflt="$perladmin";;
8577 rp='Perl administrator e-mail address'
8581 : determine whether to only install version-specific parts.
8584 Do you want to install only the version-specific parts of the perl
8585 distribution? Usually you do *not* want to do this.
8587 case "$versiononly" in
8588 "$define"|[Yy]*|true) dflt='y' ;;
8591 rp="Do you want to install only the version-specific parts of perl?"
8594 [yY]*) val="$define";;
8600 case "$versiononly" in
8601 "$define") inc_version_list=''
8602 inc_version_list_init=0
8606 : figure out how to guarantee perl startup
8607 case "$startperl" in
8609 case "$sharpbang" in
8613 I can use the #! construct to start perl on your system. This will
8614 make startup of perl scripts faster, but may cause problems if you
8615 want to share those scripts and perl is not in a standard place
8616 ($binexp/perl) on all your platforms. The alternative is to force
8617 a shell by starting the script with a single ':' character.
8620 case "$versiononly" in
8621 "$define") dflt="$binexp/perl$version";;
8622 *) dflt="$binexp/perl";;
8624 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8627 none) startperl=": # use perl";;
8628 *) startperl="#!$ans"
8629 if $test 30 -lt `echo "$ans" | wc -c`; then
8632 WARNING: Some systems limit the #! command to 32 characters.
8633 If you experience difficulty running Perl scripts with #!, try
8634 installing Perl in a directory with a shorter pathname.
8640 *) startperl=": # use perl"
8645 echo "I'll use $startperl to start perl scripts."
8647 : figure best path for perl in scripts
8650 case "$versiononly" in
8651 "$define") perlpath="$binexp/perl$version";;
8652 *) perlpath="$binexp/perl";;
8654 case "$startperl" in
8659 I will use the "eval 'exec'" idiom to start Perl on your system.
8660 I can use the full path of your Perl binary for this purpose, but
8661 doing so may cause problems if you want to share those scripts and
8662 Perl is not always in a standard place ($binexp/perl).
8666 rp="What path shall I use in \"eval 'exec'\"?"
8673 case "$startperl" in
8675 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8678 : determine where public executable scripts go
8679 set scriptdir scriptdir
8681 case "$scriptdir" in
8684 : guess some guesses
8685 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8686 $test -d /usr/share/bin && dflt=/usr/share/bin
8687 $test -d /usr/local/script && dflt=/usr/local/script
8688 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8689 $test -d $prefixexp/script && dflt=$prefixexp/script
8693 *) dflt="$scriptdir"
8698 Some installations have a separate directory just for executable scripts so
8699 that they can mount it across multiple architectures but keep the scripts in
8700 one spot. You might, for example, have a subdirectory of /usr/share for this.
8701 Or you might just lump your scripts in with all your other executables.
8705 rp='Where do you keep publicly executable scripts?'
8707 if $test "X$ansexp" != "X$scriptdirexp"; then
8711 scriptdirexp="$ansexp"
8712 : Change installation prefix, if necessary.
8713 if $test X"$prefix" != X"$installprefix"; then
8714 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8716 installscript="$scriptdirexp"
8719 : determine where add-on public executables go
8721 '') dflt=$siteprefix/bin ;;
8725 rp='Pathname where the add-on public executables should be installed?'
8728 sitebinexp="$ansexp"
8729 : Change installation prefix, if necessary.
8730 if $test X"$prefix" != X"$installprefix"; then
8731 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8733 installsitebin="$sitebinexp"
8736 : determine where add-on html pages go
8737 : There is no standard location, so try to copy the previously-selected
8738 : directory structure for the core html pages.
8739 case "$sitehtml1" in
8740 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8741 *) dflt=$sitehtml1 ;;
8744 ''|' ') dflt=none ;;
8747 rp='Pathname where the site-specific html pages should be installed?'
8750 sitehtml1exp="$ansexp"
8751 : Use ' ' for none so value is preserved next time through Configure
8752 $test X"$sitehtml1" = "X" && sitehtml1=' '
8753 : Change installation prefix, if necessary.
8754 if $test X"$prefix" != X"$installprefix"; then
8755 installsitehtml1=`echo "$sitehtml1exp" | $sed "s#^$prefix#$installprefix#"`
8757 installsitehtml1="$sitehtml1exp"
8760 : determine where add-on library html pages go
8761 : There is no standard location, so try to copy the previously-selected
8762 : directory structure for the core html pages.
8763 case "$sitehtml3" in
8764 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8765 *) dflt=$sitehtml3 ;;
8768 ''|' ') dflt=none ;;
8771 rp='Pathname where the site-specific library html pages should be installed?'
8774 sitehtml3exp="$ansexp"
8775 : Use ' ' for none so value is preserved next time through Configure
8776 $test X"$sitehtml3" = "X" && sitehtml3=' '
8777 : Change installation prefix, if necessary.
8778 if $test X"$prefix" != X"$installprefix"; then
8779 installsitehtml3=`echo "$sitehtml3exp" | $sed "s#^$prefix#$installprefix#"`
8781 installsitehtml3="$sitehtml3exp"
8784 : determine where add-on manual pages go
8786 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8787 *) dflt=$siteman1 ;;
8790 ''|' ') dflt=none ;;
8793 rp='Pathname where the site-specific manual pages should be installed?'
8796 siteman1exp="$ansexp"
8797 : Use ' ' for none so value is preserved next time through Configure
8798 $test X"$siteman1" = "X" && siteman1=' '
8799 : Change installation prefix, if necessary.
8800 if $test X"$prefix" != X"$installprefix"; then
8801 installsiteman1=`echo "$siteman1exp" | $sed "s#^$prefix#$installprefix#"`
8803 installsiteman1="$siteman1exp"
8806 : determine where add-on library man pages go
8808 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8809 *) dflt=$siteman3 ;;
8812 ''|' ') dflt=none ;;
8815 rp='Pathname where the site-specific library manual pages should be installed?'
8818 siteman3exp="$ansexp"
8819 : Use ' ' for none so value is preserved next time through Configure
8820 $test X"$siteman3" = "X" && siteman3=' '
8821 : Change installation prefix, if necessary.
8822 if $test X"$prefix" != X"$installprefix"; then
8823 installsiteman3=`echo "$siteman3exp" | $sed "s#^$prefix#$installprefix#"`
8825 installsiteman3="$siteman3exp"
8828 : determine where add-on public executable scripts go
8829 case "$sitescript" in
8830 '') dflt=$siteprefix/script
8831 $test -d $dflt || dflt=$sitebin ;;
8832 *) dflt="$sitescript" ;;
8835 rp='Pathname where add-on public executable scripts should be installed?'
8838 sitescriptexp="$ansexp"
8839 : Change installation prefix, if necessary.
8840 if $test X"$prefix" != X"$installprefix"; then
8841 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8843 installsitescript="$sitescriptexp"
8846 : define an is-a-typedef? function
8847 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8849 "") inclist="sys/types.h";;
8851 eval "varval=\$$var";
8855 for inc in $inclist; do
8856 echo "#include <$inc>" >>temp.c;
8858 echo "#ifdef $type" >> temp.c;
8859 echo "printf(\"We have $type\");" >> temp.c;
8860 echo "#endif" >> temp.c;
8861 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8862 if $contains $type temp.E >/dev/null 2>&1; then
8868 *) eval "$var=\$varval";;
8871 : define an is-a-typedef? function that prompts if the type is not available.
8872 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8874 "") inclist="sys/types.h";;
8876 eval "varval=\$$var";
8880 for inc in $inclist; do
8881 echo "#include <$inc>" >>temp.c;
8883 echo "#ifdef $type" >> temp.c;
8884 echo "printf(\"We have $type\");" >> temp.c;
8885 echo "#endif" >> temp.c;
8886 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8888 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8889 if $contains $type temp.E >/dev/null 2>&1; then
8890 echo "$type found." >&4;
8893 echo "$type NOT found." >&4;
8899 *) eval "$var=\$varval";;
8902 : see what type lseek is declared as in the kernel
8903 rp="What is the type used for lseek's offset on this system?"
8904 set off_t lseektype long stdio.h sys/types.h
8908 echo "Checking to see how big your file offsets are..." >&4
8910 #include <sys/types.h>
8914 printf("%d\n", (int)sizeof($lseektype));
8919 if eval $compile_ok; then
8920 lseeksize=`$run ./try`
8921 echo "Your file offsets are $lseeksize bytes long."
8925 echo "(I can't seem to compile the test program. Guessing...)"
8926 rp="What is the size of your file offsets (in bytes)?"
8932 : see what type file positions are declared as in the library
8933 rp="What is the type for file position used by fsetpos()?"
8934 set fpos_t fpostype long stdio.h sys/types.h
8939 *_t) zzz="$fpostype" ;;
8942 echo "Checking the size of $zzz..." >&4
8944 #include <sys/types.h>
8947 printf("%d\n", (int)sizeof($fpostype));
8952 if eval $compile_ok; then
8956 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8959 echo "Your $zzz is $fpossize bytes long."
8965 echo "(I can't compile the test program. Guessing...)" >&4
8966 rp="What is the size of your file positions (in bytes)?"
8973 # Backward compatibility (uselfs is deprecated).
8975 "$define"|true|[yY]*)
8978 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8980 uselargefiles="$define"
8984 case "$lseeksize:$fpossize" in
8987 You can have files larger than 2 gigabytes.
8990 *) case "$uselargefiles" in
8991 "$undef"|false|[nN]*) dflt='n' ;;
8996 Perl can be built to understand large files (files larger than 2 gigabytes)
8997 on some systems. To do so, Configure can be run with -Duselargefiles.
8999 If this doesn't make any sense to you, just accept the default '$dflt'.
9001 rp='Try to understand large files, if available?'
9004 y|Y) val="$define" ;;
9011 case "$uselargefiles" in
9013 : Look for a hint-file generated 'call-back-unit'. If the
9014 : user has specified that a large files perl is to be built,
9015 : we may need to set or change some other defaults.
9016 if $test -f uselargefiles.cbu; then
9017 echo "Your platform has some specific hints for large file builds, using them..."
9018 . ./uselargefiles.cbu
9020 echo "Rechecking to see how big your file offsets are..." >&4
9022 #include <sys/types.h>
9026 printf("%d\n", (int)sizeof($lseektype));
9031 if eval $compile_ok; then
9032 lseeksize=`$run ./try`
9033 $echo "Your file offsets are now $lseeksize bytes long."
9037 echo "(I can't seem to compile the test program. Guessing...)"
9038 rp="What is the size of your file offsets (in bytes)?"
9043 *_t) zzz="$fpostype" ;;
9046 $echo $n "Rechecking the size of $zzz...$c" >&4
9048 #include <sys/types.h>
9051 printf("%d\n", (int)sizeof($fpostype));
9056 if eval $compile_ok; then
9061 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9064 echo " $fpossize bytes." >&4
9070 echo "(I can't compile the test program. Guessing...)" >&4
9071 rp="What is the size of your file positions (in bytes)?"
9080 case "$vendorprefix" in
9081 '') d_vendorbin="$undef"
9085 *) d_vendorbin="$define"
9086 : determine where vendor-supplied executables go.
9087 case "$vendorbin" in
9088 '') dflt=$vendorprefix/bin ;;
9089 *) dflt="$vendorbin" ;;
9092 rp='Pathname for the vendor-supplied executables directory?'
9095 vendorbinexp="$ansexp"
9098 : Change installation prefix, if necessary.
9099 if $test X"$prefix" != X"$installprefix"; then
9100 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9102 installvendorbin="$vendorbinexp"
9105 case "$vendorprefix" in
9109 *) : determine where vendor-supplied html pages go.
9110 : There is no standard location, so try to copy the previously-selected
9111 : directory structure for the core html pages.
9112 : XXX Better default suggestions would be welcome.
9113 case "$vendorhtml1" in
9114 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9115 *) dflt=$vendorhtml1 ;;
9118 ''|' ') dflt=none ;;
9121 rp='Pathname for the vendor-supplied html pages?'
9124 vendorhtml1exp="$ansexp"
9127 : Use ' ' for none so value is preserved next time through Configure
9128 $test X"$vendorhtml1" = "X" && vendorhtml1=' '
9129 : Change installation prefix, if necessary.
9130 if $test X"$prefix" != X"$installprefix"; then
9131 installvendorhtml1=`echo $vendorhtml1exp | $sed "s#^$prefix#$installprefix#"`
9133 installvendorhtml1="$vendorhtml1exp"
9136 case "$vendorprefix" in
9140 *) : determine where vendor-supplied module html pages go.
9141 : There is no standard location, so try to copy the previously-selected
9142 : directory structure for the core html pages.
9143 : XXX Better default suggestions would be welcome.
9144 case "$vendorhtml3" in
9145 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9146 *) dflt=$vendorhtml3 ;;
9149 ''|' ') dflt=none ;;
9152 rp='Pathname for the vendor-supplied html pages?'
9155 vendorhtml3exp="$ansexp"
9158 : Use ' ' for none so value is preserved next time through Configure
9159 $test X"$vendorhtml3" = "X" && vendorhtml3=' '
9160 : Change installation prefix, if necessary.
9161 if $test X"$prefix" != X"$installprefix"; then
9162 installvendorhtml3=`echo $vendorhtml3exp | $sed "s#^$prefix#$installprefix#"`
9164 installvendorhtml3="$vendorhtml3exp"
9167 case "$vendorprefix" in
9171 *) : determine where vendor-supplied manual pages go.
9172 case "$vendorman1" in
9173 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9174 *) dflt=$vendorman1 ;;
9177 ''|' ') dflt=none ;;
9180 rp='Pathname for the vendor-supplied manual section 1 pages?'
9183 vendorman1exp="$ansexp"
9186 : Use ' ' for none so value is preserved next time through Configure
9187 $test X"$vendorman1" = "X" && vendorman1=' '
9188 : Change installation prefix, if necessary.
9189 if $test X"$prefix" != X"$installprefix"; then
9190 installvendorman1=`echo "$vendorman1exp" | $sed "s#^$prefix#$installprefix#"`
9192 installvendorman1="$vendorman1exp"
9195 case "$vendorprefix" in
9199 *) : determine where vendor-supplied module manual pages go.
9200 case "$vendorman3" in
9201 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9202 *) dflt=$vendorman3 ;;
9205 ''|' ') dflt=none ;;
9208 rp='Pathname for the vendor-supplied manual section 3 pages?'
9211 vendorman3exp="$ansexp"
9214 : Use ' ' for none so value is preserved next time through Configure
9215 $test X"$vendorman3" = "X" && vendorman3=' '
9216 : Change installation prefix, if necessary.
9217 if $test X"$prefix" != X"$installprefix"; then
9218 installvendorman3=`echo "$vendorman3exp" | $sed "s#^$prefix#$installprefix#"`
9220 installvendorman3="$vendorman3exp"
9223 case "$vendorprefix" in
9224 '') d_vendorscript="$undef"
9228 *) d_vendorscript="$define"
9229 : determine where vendor-supplied scripts go.
9230 case "$vendorscript" in
9231 '') dflt=$vendorprefix/script
9232 $test -d $dflt || dflt=$vendorbin ;;
9233 *) dflt="$vendorscript" ;;
9237 The installation process will create a directory for
9238 vendor-supplied scripts.
9242 rp='Pathname for the vendor-supplied scripts directory?'
9245 vendorscriptexp="$ansexp"
9248 : Change installation prefix, if necessary.
9249 if $test X"$prefix" != X"$installprefix"; then
9250 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9252 installvendorscript="$vendorscriptexp"
9255 : see if qgcvt exists
9259 : Check how to convert floats to strings.
9261 if test "X$d_Gconvert" = X; then
9264 echo "Checking for an efficient way to convert floats to strings."
9266 case "$uselongdouble" in
9267 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9269 case "$d_longdbl" in
9270 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9272 case "$d_PRIgldbl" in
9273 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9277 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9278 char *myname = "gconvert";
9281 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9282 char *myname = "gcvt";
9285 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9286 char *myname = "qgcvt";
9287 #define DOUBLETYPE long double
9290 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9292 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9294 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9297 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9299 char *myname = "sprintf";
9303 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9304 #define DOUBLETYPE long double
9306 #define DOUBLETYPE double
9312 #define I_STDLIB $i_stdlib
9318 checkit(expect, got)
9322 if (strcmp(expect, got)) {
9323 printf("%s oddity: Expected %s, got %s\n",
9324 myname, expect, got);
9334 /* This must be 1st test on (which?) platform */
9335 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9336 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9337 checkit("0.1", buf);
9339 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9340 checkit("0.01", buf);
9342 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9343 checkit("0.001", buf);
9345 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9346 checkit("0.0001", buf);
9348 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9349 if (strlen(buf) > 5)
9350 checkit("9e-005", buf); /* for Microsoft ?? */
9352 checkit("9e-05", buf);
9354 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9357 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9358 checkit("1.1", buf);
9360 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9361 checkit("1.01", buf);
9363 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9364 checkit("1.001", buf);
9366 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9367 checkit("1.0001", buf);
9369 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9370 checkit("1.00001", buf);
9372 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9373 checkit("1.000001", buf);
9375 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9378 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9381 /* Some Linux gcvt's give 1.e+5 here. */
9382 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9383 checkit("100000", buf);
9385 /* Some Linux gcvt's give -1.e+5 here. */
9386 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9387 checkit("-100000", buf);
9389 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9390 checkit("123.456", buf);
9392 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9393 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9394 /* 34 should be enough to scare even long double
9395 * places into using the e notation. */
9396 if (strlen(buf) > 5)
9397 checkit("1e+034", buf); /* for Microsoft */
9399 checkit("1e+34", buf);
9401 /* For Perl, if you add additional tests here, also add them to
9402 * t/base/num.t for benefit of platforms not using Configure or
9403 * overriding d_Gconvert */
9408 : first add preferred functions to our list
9410 for xxx_convert in $gconvert_preference; do
9411 case $xxx_convert in
9412 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9413 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9416 : then add any others
9417 for xxx_convert in gconvert gcvt sprintf; do
9420 *) xxx_list="$xxx_list $xxx_convert" ;;
9424 case "$d_longdbl$uselongdouble" in
9426 : again, add prefered functions to our list first
9428 for xxx_convert in $gconvert_ld_preference; do
9429 case $xxx_convert in
9430 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9431 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9434 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9435 for xxx_convert in qgcvt sprintf $xxx_list; do
9436 case "$xxx_ld_list" in
9437 $xxx_convert*|*" $xxx_convert"*) ;;
9438 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9441 : if sprintf cannot do long doubles, move it to the end
9442 if test "$d_PRIgldbl" != "$define"; then
9443 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9445 : if no qgcvt, remove it
9446 if test "$d_qgcvt" != "$define"; then
9447 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9450 xxx_list="$xxx_ld_list"
9454 for xxx_convert in $xxx_list; do
9455 echo "Trying $xxx_convert..."
9457 set try -DTRY_$xxx_convert
9458 if eval $compile; then
9459 echo "$xxx_convert() found." >&4
9461 echo "I'll use $xxx_convert to convert floats into a string." >&4
9464 echo "...But $xxx_convert didn't work as I expected."
9468 echo "$xxx_convert NOT found." >&4
9472 if test X$xxx_convert = X; then
9473 echo "*** WHOA THERE!!! ***" >&4
9474 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9478 case "$xxx_convert" in
9479 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9480 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9481 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9482 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9483 "$define$define$define")
9484 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9485 "$define$define$undef")
9486 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9487 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9494 : see if _fwalk exists
9498 : Initialize h_fcntl
9501 : Initialize h_sysfile
9504 : access call always available on UNIX
9508 : locate the flags for 'access()'
9512 $cat >access.c <<'EOCP'
9513 #include <sys/types.h>
9518 #include <sys/file.h>
9527 : check sys/file.h first, no particular reason here
9528 if $test `./findhdr sys/file.h` && \
9529 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9531 echo "<sys/file.h> defines the *_OK access constants." >&4
9532 elif $test `./findhdr fcntl.h` && \
9533 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9535 echo "<fcntl.h> defines the *_OK access constants." >&4
9536 elif $test `./findhdr unistd.h` && \
9537 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9538 echo "<unistd.h> defines the *_OK access constants." >&4
9540 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9546 : see if accessx exists
9547 set accessx d_accessx
9550 : see if alarm exists
9554 : see if POSIX threads are available
9555 set pthread.h i_pthread
9558 : define a fucntion to check prototypes
9559 $cat > protochk <<EOSH
9562 optimize="$optimize"
9564 prototype="$prototype"
9567 usethreads=$usethreads
9568 i_pthread=$i_pthread
9569 pthread_h_first=$pthread_h_first
9572 $cat >> protochk <<'EOSH'
9577 while test $# -ge 2; do
9579 $define) echo "#include <$2>" >> try.c ;;
9580 literal) echo "$2" >> try.c ;;
9582 # Extra magic for the benefit of systems that need pthread.h
9583 # to be included early to correctly detect threadsafe functions.
9584 # Such functions must guarantee themselves, though, that the usethreads
9585 # and i_pthread have been defined, before calling protochk.
9586 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9587 echo "#include <pthread.h>" >> try.c
9592 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9593 cat >> try.c <<'EOCP'
9594 #ifdef CAN_PROTOTYPE
9595 #define _(args) args
9600 echo "$foo" >> try.c
9601 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9602 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9610 : see if sys/types.h has to be included
9611 set sys/types.h i_systypes
9614 : see if sys/select.h has to be included
9615 set sys/select.h i_sysselct
9618 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9619 while $test $# -ge 2; do
9621 $define) echo "#include <$2>";;
9625 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9627 if eval $compile; then
9636 : see if we should include time.h, sys/time.h, or both
9638 if test "X$timeincl" = X; then
9639 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9640 $echo $n "I'm now running the test program...$c"
9641 $cat >try.c <<'EOCP'
9642 #include <sys/types.h>
9647 #ifdef SYSTIMEKERNEL
9650 #include <sys/time.h>
9653 #include <sys/select.h>
9662 struct timezone tzp;
9664 if (foo.tm_sec == foo.tm_sec)
9667 if (bar.tv_sec == bar.tv_sec)
9674 for s_timezone in '-DS_TIMEZONE' ''; do
9676 for s_timeval in '-DS_TIMEVAL' ''; do
9677 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9678 for i_time in '' '-DI_TIME'; do
9679 for i_systime in '-DI_SYSTIME' ''; do
9682 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9683 if eval $compile; then
9684 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9688 $echo $n "Succeeded with $flags$c"
9700 *SYSTIMEKERNEL*) i_systimek="$define"
9701 timeincl=`./findhdr sys/time.h`
9702 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9703 *) i_systimek="$undef";;
9706 *I_TIME*) i_time="$define"
9707 timeincl=`./findhdr time.h`" $timeincl"
9708 echo "We'll include <time.h>." >&4;;
9709 *) i_time="$undef";;
9712 *I_SYSTIME*) i_systime="$define"
9713 timeincl=`./findhdr sys/time.h`" $timeincl"
9714 echo "We'll include <sys/time.h>." >&4;;
9715 *) i_systime="$undef";;
9719 : see if struct tm knows about tm_zone
9720 case "$i_systime$i_time" in
9723 echo "Checking to see if your struct tm has tm_zone field..." >&4
9724 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9732 case "$d_tm_tm_zone" in
9733 "$define") echo "Yes, it does." ;;
9734 *) echo "No, it doesn't." ;;
9736 : see if struct tm knows about tm_gmtoff
9737 case "$i_systime$i_time" in
9740 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9741 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9749 case "$d_tm_tm_gmtoff" in
9750 "$define") echo "Yes, it does." ;;
9751 *) echo "No, it doesn't." ;;
9754 : see if asctime_r exists
9755 set asctime_r d_asctime_r
9757 case "$d_asctime_r" in
9759 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9760 case "$d_asctime_r_proto:$usethreads" in
9761 ":define") d_asctime_r_proto=define
9762 set d_asctime_r_proto asctime_r $hdrs
9766 case "$d_asctime_r_proto" in
9768 case "$asctime_r_proto" in
9769 ''|0) try='char* asctime_r(const struct tm*, char*);'
9770 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9772 case "$asctime_r_proto" in
9773 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9774 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9776 case "$asctime_r_proto" in
9777 ''|0) try='int asctime_r(const struct tm*, char*);'
9778 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9780 case "$asctime_r_proto" in
9781 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9782 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9784 case "$asctime_r_proto" in
9785 ''|0) d_asctime_r=undef
9787 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9788 * ) case "$asctime_r_proto" in
9789 REENTRANT_PROTO*) ;;
9790 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9792 echo "Prototype: $try" ;;
9795 *) case "$usethreads" in
9796 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9803 *) asctime_r_proto=0
9807 : see if atolf exists
9811 : see if atoll exists
9815 : Look for GNU-cc style attribute checking
9817 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9818 $cat >attrib.c <<'EOCP'
9820 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9822 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9823 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9824 echo "Your C compiler doesn't fully support __attribute__."
9827 echo "Your C compiler supports __attribute__."
9831 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9838 : see if bcmp exists
9842 : see if bcopy exists
9846 : see if this is a unistd.h system
9847 set unistd.h i_unistd
9850 : see if getpgrp exists
9851 set getpgrp d_getpgrp
9854 case "$d_getpgrp" in
9857 echo "Checking to see which flavor of getpgrp is in use..."
9860 #include <sys/types.h>
9862 # include <unistd.h>
9866 if (getuid() == 0) {
9867 printf("(I see you are running Configure as super-user...)\n");
9871 if (getpgrp(1) == 0)
9880 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9881 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9883 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9884 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9887 echo "I can't seem to compile and run the test program."
9889 xxx="a USG one, i.e. you use getpgrp()."
9891 # SVR4 systems can appear rather BSD-ish.
9894 xxx="a BSD one, i.e. you use getpgrp(pid)."
9898 xxx="probably a USG one, i.e. you use getpgrp()."
9903 echo "Assuming your getpgrp is $xxx" >&4
9912 : see if setpgrp exists
9913 set setpgrp d_setpgrp
9916 case "$d_setpgrp" in
9919 echo "Checking to see which flavor of setpgrp is in use..."
9922 #include <sys/types.h>
9924 # include <unistd.h>
9928 if (getuid() == 0) {
9929 printf("(I see you are running Configure as super-user...)\n");
9933 if (-1 == setpgrp(1, 1))
9936 if (setpgrp() != -1)
9942 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9943 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9945 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9946 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9949 echo "(I can't seem to compile and run the test program.)"
9951 xxx="a USG one, i.e. you use setpgrp()."
9953 # SVR4 systems can appear rather BSD-ish.
9956 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9960 xxx="probably a USG one, i.e. you use setpgrp()."
9965 echo "Assuming your setpgrp is $xxx" >&4
9973 : see if bzero exists
9977 : see if signal is declared as pointer to function returning int or void
9979 xxx=`./findhdr signal.h`
9980 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9981 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9982 echo "You have int (*signal())() instead of void." >&4
9984 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9985 echo "You have void (*signal())()." >&4
9987 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9988 echo "You have int (*signal())() instead of void." >&4
9990 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9991 echo "You have void (*signal())()." >&4
9994 case "$d_voidsig" in
9996 echo "I can't determine whether signal handler returns void or int..." >&4
9998 rp="What type does your signal handler return?"
10001 v*) val="$define";;
10005 echo "As you already told me, signal handler returns void." >&4
10008 *) echo "As you already told me, signal handler returns int." >&4
10015 case "$d_voidsig" in
10016 "$define") signal_t="void";;
10017 *) signal_t="int";;
10021 : check for ability to cast large floats to 32-bit ints.
10023 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10024 if $test "$intsize" -ge 4; then
10031 #include <sys/types.h>
10032 #include <signal.h>
10033 $signal_t blech(s) int s; { exit(3); }
10040 signal(SIGFPE, blech);
10042 /* Don't let compiler optimize the test away. Store the number
10043 in a writable string for gcc to pass to sscanf under HP/UX.
10045 sprintf(str, "2147483647");
10046 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10050 /* x86 processors will probably give 0x8000 0000, which is a
10051 sign change. We don't want that. We want to mimic SPARC
10052 behavior here, which is to preserve the sign and give
10055 if (i32 != ($xxx) f)
10061 if eval $compile_ok; then
10065 echo "(I can't seem to compile the test program--assuming it can't)"
10070 echo "Yup, it can."
10073 echo "Nope, it can't."
10080 : check for ability to cast negative floats to unsigned
10082 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10085 #include <sys/types.h>
10086 #include <signal.h>
10087 $signal_t blech(s) int s; { exit(7); }
10088 $signal_t blech_in_list(s) int s; { exit(4); }
10089 unsigned long dummy_long(p) unsigned long p; { return p; }
10090 unsigned int dummy_int(p) unsigned int p; { return p; }
10091 unsigned short dummy_short(p) unsigned short p; { return p; }
10095 unsigned long along;
10097 unsigned short ashort;
10101 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10102 a direct f = -123. assignment. gcc-2.8.0 reportedly
10103 optimized the whole file away
10105 /* Store the number in a writable string for gcc to pass to
10106 sscanf under HP/UX.
10108 sprintf(str, "-123");
10109 sscanf(str, "%lf", &f); /* f = -123.; */
10111 signal(SIGFPE, blech);
10112 along = (unsigned long)f;
10113 aint = (unsigned int)f;
10114 ashort = (unsigned short)f;
10115 if (along != (unsigned long)-123)
10117 if (aint != (unsigned int)-123)
10119 if (ashort != (unsigned short)-123)
10121 sprintf(str, "1073741824.");
10122 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10125 along = (unsigned long)f;
10126 if (along != 0x80000000)
10130 along = (unsigned long)f;
10131 if (along != 0x7fffffff)
10135 along = (unsigned long)f;
10136 if (along != 0x80000001)
10140 signal(SIGFPE, blech_in_list);
10141 sprintf(str, "123.");
10142 sscanf(str, "%lf", &f); /* f = 123.; */
10143 along = dummy_long((unsigned long)f);
10144 aint = dummy_int((unsigned int)f);
10145 ashort = dummy_short((unsigned short)f);
10146 if (along != (unsigned long)123)
10148 if (aint != (unsigned int)123)
10150 if (ashort != (unsigned short)123)
10157 if eval $compile_ok; then
10161 echo "(I can't seem to compile the test program--assuming it can't)"
10164 case "$castflags" in
10166 echo "Yup, it can."
10169 echo "Nope, it can't."
10176 : see if vprintf exists
10178 if set vprintf val -f d_vprintf; eval $csym; $val; then
10179 echo 'vprintf() found.' >&4
10181 $cat >try.c <<'EOF'
10182 #include <varargs.h>
10184 int main() { xxx("foo"); }
10193 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10197 if eval $compile && $run ./try; then
10198 echo "Your vsprintf() returns (int)." >&4
10201 echo "Your vsprintf() returns (char*)." >&4
10205 echo 'vprintf() NOT found.' >&4
10216 : see if chown exists
10220 : see if chroot exists
10221 set chroot d_chroot
10224 : see if chsize exists
10225 set chsize d_chsize
10228 : see if class exists
10232 hasstruct='varname=$1; struct=$2; shift; shift;
10233 while $test $# -ge 2; do
10235 $define) echo "#include <$2>";;
10239 echo "int main () { struct $struct foo; }" >> try.c;
10241 if eval $compile; then
10248 $rm -f try.c try.o'
10252 : see whether socket exists
10254 $echo $n "Hmm... $c" >&4
10255 if set socket val -f d_socket; eval $csym; $val; then
10256 echo "Looks like you have Berkeley networking support." >&4
10258 if set setsockopt val -f; eval $csym; $val; then
10261 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10262 d_oldsock="$define"
10265 if $contains socklib libc.list >/dev/null 2>&1; then
10266 echo "Looks like you have Berkeley networking support." >&4
10268 : we will have to assume that it supports the 4.2 BSD interface
10271 echo "You don't have Berkeley networking in libc$_a..." >&4
10272 if test "X$d_socket" = "X$define"; then
10273 echo "...but you seem to believe that you have sockets." >&4
10275 for net in net socket
10277 if test -f /usr/lib/lib$net$_a; then
10278 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10279 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10280 if $contains socket libc.list >/dev/null 2>&1; then
10285 echo "...but the Wollongong group seems to have hacked it in." >&4
10286 sockethdr="-I/usr/netinclude"
10289 echo "Found Berkeley sockets interface in lib$net." >&4
10290 if $contains setsockopt libc.list >/dev/null 2>&1; then
10293 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10294 d_oldsock="$define"
10300 if test "X$d_socket" != "X$define"; then
10301 echo "or anywhere else I see." >&4
10309 : see if socketpair exists
10310 set socketpair d_sockpair
10315 echo "Checking the availability of certain socket constants..." >&4
10316 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10317 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10319 #include <sys/types.h>
10320 #include <sys/socket.h>
10326 set try; if eval $compile; then
10329 set d_${enum}; eval $setvar
10333 : see if this is a sys/uio.h system
10334 set sys/uio.h i_sysuio
10339 echo "Checking to see if your system supports struct cmsghdr..." >&4
10340 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10342 case "$d_cmsghdr_s" in
10343 "$define") echo "Yes, it does." ;;
10344 *) echo "No, it doesn't." ;;
10348 : check for const keyword
10350 echo 'Checking to see if your C compiler knows about "const"...' >&4
10351 $cat >const.c <<'EOCP'
10352 typedef struct spug { int drokk; } spug;
10359 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10361 echo "Yup, it does."
10364 echo "Nope, it doesn't."
10369 : see if crypt exists
10374 $define) cryptlib='' ;;
10375 *) if set crypt val -f d_crypt; eval $csym; $val; then
10376 echo 'crypt() found.' >&4
10380 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10381 if $test -z "$cryptlib"; then
10382 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10386 if $test -z "$cryptlib"; then
10387 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10391 if $test -z "$cryptlib"; then
10392 cryptlib=`./loc libcrypt$_a "" $libpth`
10396 if $test -z "$cryptlib"; then
10397 echo 'crypt() NOT found.' >&4
10408 : see if this is a crypt.h system
10409 set crypt.h i_crypt
10412 : see if crypt_r exists
10413 set crypt_r d_crypt_r
10415 case "$d_crypt_r" in
10417 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10418 case "$d_crypt_r_proto:$usethreads" in
10419 ":define") d_crypt_r_proto=define
10420 set d_crypt_r_proto crypt_r $hdrs
10424 case "$d_crypt_r_proto" in
10426 case "$crypt_r_proto" in
10427 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10428 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10430 case "$crypt_r_proto" in
10431 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10432 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10434 case "$crypt_r_proto" in
10435 ''|0) d_crypt_r=undef
10437 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10438 * ) case "$crypt_r_proto" in
10439 REENTRANT_PROTO*) ;;
10440 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10442 echo "Prototype: $try" ;;
10445 *) case "$usethreads" in
10446 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10457 : get csh whereabouts
10459 'csh') val="$undef" ;;
10460 *) val="$define" ;;
10464 : Respect a hint or command line value for full_csh.
10465 case "$full_csh" in
10466 '') full_csh=$csh ;;
10469 : see if ctermid_r exists
10470 set ctermid_r d_ctermid_r
10472 case "$d_ctermid_r" in
10474 hdrs="$i_systypes sys/types.h define stdio.h "
10475 case "$d_ctermid_r_proto:$usethreads" in
10476 ":define") d_ctermid_r_proto=define
10477 set d_ctermid_r_proto ctermid_r $hdrs
10481 case "$d_ctermid_r_proto" in
10483 case "$ctermid_r_proto" in
10484 ''|0) try='char* ctermid_r(char*);'
10485 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10487 case "$ctermid_r_proto" in
10488 ''|0) d_ctermid_r=undef
10490 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10491 * ) case "$ctermid_r_proto" in
10492 REENTRANT_PROTO*) ;;
10493 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10495 echo "Prototype: $try" ;;
10498 *) case "$usethreads" in
10499 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10506 *) ctermid_r_proto=0
10510 : see if ctime_r exists
10511 set ctime_r d_ctime_r
10513 case "$d_ctime_r" in
10515 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10516 case "$d_ctime_r_proto:$usethreads" in
10517 ":define") d_ctime_r_proto=define
10518 set d_ctime_r_proto ctime_r $hdrs
10522 case "$d_ctime_r_proto" in
10524 case "$ctime_r_proto" in
10525 ''|0) try='char* ctime_r(const time_t*, char*);'
10526 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10528 case "$ctime_r_proto" in
10529 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10530 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10532 case "$ctime_r_proto" in
10533 ''|0) try='int ctime_r(const time_t*, char*);'
10534 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10536 case "$ctime_r_proto" in
10537 ''|0) try='int ctime_r(const time_t*, char*, int);'
10538 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10540 case "$ctime_r_proto" in
10541 ''|0) d_ctime_r=undef
10543 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10544 * ) case "$ctime_r_proto" in
10545 REENTRANT_PROTO*) ;;
10546 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10548 echo "Prototype: $try" ;;
10551 *) case "$usethreads" in
10552 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10563 : see if cuserid exists
10564 set cuserid d_cuserid
10567 : see if this is a limits.h system
10568 set limits.h i_limits
10571 : see if this is a float.h system
10572 set float.h i_float
10575 : See if number of significant digits in a double precision number is known
10577 $cat >dbl_dig.c <<EOM
10578 #$i_limits I_LIMITS
10581 #include <limits.h>
10587 printf("Contains DBL_DIG");
10590 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10591 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10592 echo "DBL_DIG found." >&4
10595 echo "DBL_DIG NOT found." >&4
10602 : see if dbm.h is available
10603 : see if dbmclose exists
10604 set dbmclose d_dbmclose
10607 case "$d_dbmclose" in
10617 *) set rpcsvc/dbm.h i_rpcsvcdbm
10622 *) echo "We won't be including <dbm.h>"
10632 : see if prototype for dbminit is available
10634 set d_dbminitproto dbminit $i_dbm dbm.h
10637 : see if difftime exists
10638 set difftime d_difftime
10641 : see if this is a dirent system
10643 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10645 echo "<dirent.h> found." >&4
10648 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10649 echo "<sys/dir.h> found." >&4
10652 xinc=`./findhdr sys/ndir.h`
10654 echo "<dirent.h> NOT found." >&4
10659 : Look for type of directory structure.
10661 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10663 case "$direntrytype" in
10665 case "$i_dirent" in
10666 $define) guess1='struct dirent' ;;
10667 *) guess1='struct direct' ;;
10670 *) guess1="$direntrytype"
10675 'struct dirent') guess2='struct direct' ;;
10676 *) guess2='struct dirent' ;;
10679 if $contains "$guess1" try.c >/dev/null 2>&1; then
10680 direntrytype="$guess1"
10681 echo "Your directory entries are $direntrytype." >&4
10682 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10683 direntrytype="$guess2"
10684 echo "Your directory entries seem to be $direntrytype." >&4
10686 echo "I don't recognize your system's directory entries." >&4
10687 rp="What type is used for directory entries on this system?"
10690 direntrytype="$ans"
10695 : see if the directory entry stores field length
10697 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10698 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10699 echo "Good, your directory entry keeps length information in d_namlen." >&4
10702 echo "Your directory entry does not know about the d_namlen field." >&4
10709 : see if this is an sysdir system
10710 set sys/dir.h i_sysdir
10713 : see if this is an sysndir system
10714 set sys/ndir.h i_sysndir
10719 $cat >dirfd.c <<EOM
10721 #$i_dirent I_DIRENT /**/
10722 #$i_sysdir I_SYS_DIR /**/
10723 #$i_sysndir I_SYS_NDIR /**/
10724 #$i_systypes I_SYS_TYPES /**/
10725 #if defined(I_SYS_TYPES)
10726 #include <sys/types.h>
10728 #if defined(I_DIRENT)
10729 #include <dirent.h>
10730 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10731 #include <sys/dir.h>
10735 #include <sys/ndir.h>
10739 #include <ndir.h> /* may be wrong in the future */
10741 #include <sys/dir.h>
10747 DIR *dirp = opendir(".");
10748 if (dirfd(dirp) >= 0)
10755 if eval $compile; then
10759 $define) echo "dirfd() found." >&4 ;;
10760 *) echo "dirfd() NOT found." >&4 ;;
10766 : see if dlerror exists
10769 set dlerror d_dlerror
10773 : see if dlfcn is available
10774 set dlfcn.h i_dlfcn
10781 On a few systems, the dynamically loaded modules that perl generates and uses
10782 will need a different extension than shared libs. The default will probably
10788 *) dflt="$dlext" ;;
10790 rp='What is the extension of dynamically loaded modules'
10799 : Check if dlsym need a leading underscore
10805 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10806 $cat >dyna.c <<'EOM'
10815 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10817 #include <sys/types.h>
10822 extern int fred() ;
10831 int mode = RTLD_LAZY ;
10833 handle = dlopen("./dyna.$dlext", mode) ;
10834 if (handle == NULL) {
10839 symbol = dlsym(handle, "fred") ;
10840 if (symbol == NULL) {
10841 /* try putting a leading underscore */
10842 symbol = dlsym(handle, "_fred") ;
10843 if (symbol == NULL) {
10856 : Call the object file tmp-dyna.o in case dlext=o.
10857 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10858 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10859 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10860 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10863 1) echo "Test program failed using dlopen." >&4
10864 echo "Perhaps you should not use dynamic loading." >&4;;
10865 2) echo "Test program failed using dlsym." >&4
10866 echo "Perhaps you should not use dynamic loading." >&4;;
10867 3) echo "dlsym needs a leading underscore" >&4
10869 4) echo "dlsym doesn't need a leading underscore." >&4;;
10872 echo "I can't compile and run the test program." >&4
10873 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10878 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10883 : see if drand48_r exists
10884 set drand48_r d_drand48_r
10886 case "$d_drand48_r" in
10888 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10889 case "$d_drand48_r_proto:$usethreads" in
10890 ":define") d_drand48_r_proto=define
10891 set d_drand48_r_proto drand48_r $hdrs
10895 case "$d_drand48_r_proto" in
10897 case "$drand48_r_proto" in
10898 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10899 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10901 case "$drand48_r_proto" in
10902 ''|0) d_drand48_r=undef
10904 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10905 * ) case "$drand48_r_proto" in
10906 REENTRANT_PROTO*) ;;
10907 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10909 echo "Prototype: $try" ;;
10912 *) case "$usethreads" in
10913 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10920 *) drand48_r_proto=0
10924 : see if prototype for drand48 is available
10926 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10929 : see if dup2 exists
10933 : see if eaccess exists
10934 set eaccess d_eaccess
10937 : see if endgrent exists
10938 set endgrent d_endgrent
10941 : see if this is an grp system
10947 xxx=`./findhdr grp.h`
10948 $cppstdin $cppflags $cppminus < $xxx >$$.h
10950 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10962 set d_grpasswd; eval $setvar
10966 : see if endgrent_r exists
10967 set endgrent_r d_endgrent_r
10969 case "$d_endgrent_r" in
10971 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
10972 case "$d_endgrent_r_proto:$usethreads" in
10973 ":define") d_endgrent_r_proto=define
10974 set d_endgrent_r_proto endgrent_r $hdrs
10978 case "$d_endgrent_r_proto" in
10980 case "$endgrent_r_proto" in
10981 ''|0) try='int endgrent_r(FILE**);'
10982 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
10984 case "$endgrent_r_proto" in
10985 ''|0) try='void endgrent_r(FILE**);'
10986 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
10988 case "$endgrent_r_proto" in
10989 ''|0) d_endgrent_r=undef
10991 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
10992 * ) case "$endgrent_r_proto" in
10993 REENTRANT_PROTO*) ;;
10994 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
10996 echo "Prototype: $try" ;;
10999 *) case "$usethreads" in
11000 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11007 *) endgrent_r_proto=0
11011 : see if endhostent exists
11012 set endhostent d_endhent
11015 : see if this is a netdb.h system
11016 set netdb.h i_netdb
11019 : see if endhostent_r exists
11020 set endhostent_r d_endhostent_r
11022 case "$d_endhostent_r" in
11024 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11025 case "$d_endhostent_r_proto:$usethreads" in
11026 ":define") d_endhostent_r_proto=define
11027 set d_endhostent_r_proto endhostent_r $hdrs
11031 case "$d_endhostent_r_proto" in
11033 case "$endhostent_r_proto" in
11034 ''|0) try='int endhostent_r(struct hostent_data*);'
11035 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11037 case "$endhostent_r_proto" in
11038 ''|0) try='void endhostent_r(struct hostent_data*);'
11039 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11041 case "$endhostent_r_proto" in
11042 ''|0) d_endhostent_r=undef
11043 endhostent_r_proto=0
11044 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11045 * ) case "$endhostent_r_proto" in
11046 REENTRANT_PROTO*) ;;
11047 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11049 echo "Prototype: $try" ;;
11052 *) case "$usethreads" in
11053 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11055 d_endhostent_r=undef
11056 endhostent_r_proto=0
11060 *) endhostent_r_proto=0
11064 : see if endnetent exists
11065 set endnetent d_endnent
11068 : see if endnetent_r exists
11069 set endnetent_r d_endnetent_r
11071 case "$d_endnetent_r" in
11073 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11074 case "$d_endnetent_r_proto:$usethreads" in
11075 ":define") d_endnetent_r_proto=define
11076 set d_endnetent_r_proto endnetent_r $hdrs
11080 case "$d_endnetent_r_proto" in
11082 case "$endnetent_r_proto" in
11083 ''|0) try='int endnetent_r(struct netent_data*);'
11084 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11086 case "$endnetent_r_proto" in
11087 ''|0) try='void endnetent_r(struct netent_data*);'
11088 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11090 case "$endnetent_r_proto" in
11091 ''|0) d_endnetent_r=undef
11092 endnetent_r_proto=0
11093 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11094 * ) case "$endnetent_r_proto" in
11095 REENTRANT_PROTO*) ;;
11096 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11098 echo "Prototype: $try" ;;
11101 *) case "$usethreads" in
11102 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11104 d_endnetent_r=undef
11105 endnetent_r_proto=0
11109 *) endnetent_r_proto=0
11113 : see if endprotoent exists
11114 set endprotoent d_endpent
11117 : see if endprotoent_r exists
11118 set endprotoent_r d_endprotoent_r
11120 case "$d_endprotoent_r" in
11122 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11123 case "$d_endprotoent_r_proto:$usethreads" in
11124 ":define") d_endprotoent_r_proto=define
11125 set d_endprotoent_r_proto endprotoent_r $hdrs
11129 case "$d_endprotoent_r_proto" in
11131 case "$endprotoent_r_proto" in
11132 ''|0) try='int endprotoent_r(struct protoent_data*);'
11133 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11135 case "$endprotoent_r_proto" in
11136 ''|0) try='void endprotoent_r(struct protoent_data*);'
11137 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11139 case "$endprotoent_r_proto" in
11140 ''|0) d_endprotoent_r=undef
11141 endprotoent_r_proto=0
11142 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11143 * ) case "$endprotoent_r_proto" in
11144 REENTRANT_PROTO*) ;;
11145 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11147 echo "Prototype: $try" ;;
11150 *) case "$usethreads" in
11151 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11153 d_endprotoent_r=undef
11154 endprotoent_r_proto=0
11158 *) endprotoent_r_proto=0
11162 : see if endpwent exists
11163 set endpwent d_endpwent
11166 : see if this is a pwd.h system
11172 xxx=`./findhdr pwd.h`
11173 $cppstdin $cppflags $cppminus < $xxx >$$.h
11175 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11183 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11191 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11199 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11207 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11215 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11223 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11231 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11243 set d_pwquota; eval $setvar
11244 set d_pwage; eval $setvar
11245 set d_pwchange; eval $setvar
11246 set d_pwclass; eval $setvar
11247 set d_pwexpire; eval $setvar
11248 set d_pwcomment; eval $setvar
11249 set d_pwgecos; eval $setvar
11250 set d_pwpasswd; eval $setvar
11254 : see if endpwent_r exists
11255 set endpwent_r d_endpwent_r
11257 case "$d_endpwent_r" in
11259 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11260 case "$d_endpwent_r_proto:$usethreads" in
11261 ":define") d_endpwent_r_proto=define
11262 set d_endpwent_r_proto endpwent_r $hdrs
11266 case "$d_endpwent_r_proto" in
11268 case "$endpwent_r_proto" in
11269 ''|0) try='int endpwent_r(FILE**);'
11270 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11272 case "$endpwent_r_proto" in
11273 ''|0) try='void endpwent_r(FILE**);'
11274 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11276 case "$endpwent_r_proto" in
11277 ''|0) d_endpwent_r=undef
11279 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11280 * ) case "$endpwent_r_proto" in
11281 REENTRANT_PROTO*) ;;
11282 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11284 echo "Prototype: $try" ;;
11287 *) case "$usethreads" in
11288 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11295 *) endpwent_r_proto=0
11299 : see if endservent exists
11300 set endservent d_endsent
11303 : see if endservent_r exists
11304 set endservent_r d_endservent_r
11306 case "$d_endservent_r" in
11308 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11309 case "$d_endservent_r_proto:$usethreads" in
11310 ":define") d_endservent_r_proto=define
11311 set d_endservent_r_proto endservent_r $hdrs
11315 case "$d_endservent_r_proto" in
11317 case "$endservent_r_proto" in
11318 ''|0) try='int endservent_r(struct servent_data*);'
11319 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11321 case "$endservent_r_proto" in
11322 ''|0) try='void endservent_r(struct servent_data*);'
11323 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11325 case "$endservent_r_proto" in
11326 ''|0) d_endservent_r=undef
11327 endservent_r_proto=0
11328 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11329 * ) case "$endservent_r_proto" in
11330 REENTRANT_PROTO*) ;;
11331 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11333 echo "Prototype: $try" ;;
11336 *) case "$usethreads" in
11337 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11339 d_endservent_r=undef
11340 endservent_r_proto=0
11344 *) endservent_r_proto=0
11348 : Locate the flags for 'open()'
11350 $cat >try.c <<'EOCP'
11351 #include <sys/types.h>
11356 #include <sys/file.h>
11367 : check sys/file.h first to get FREAD on Sun
11368 if $test `./findhdr sys/file.h` && \
11369 set try -DI_SYS_FILE && eval $compile; then
11371 echo "<sys/file.h> defines the O_* constants..." >&4
11372 if $run ./try; then
11373 echo "and you have the 3 argument form of open()." >&4
11376 echo "but not the 3 argument form of open(). Oh, well." >&4
11379 elif $test `./findhdr fcntl.h` && \
11380 set try -DI_FCNTL && eval $compile; then
11382 echo "<fcntl.h> defines the O_* constants..." >&4
11383 if $run ./try; then
11384 echo "and you have the 3 argument form of open()." >&4
11387 echo "but not the 3 argument form of open(). Oh, well." >&4
11392 echo "I can't find the O_* constant definitions! You got problems." >&4
11398 : see which of string.h or strings.h is needed
11400 strings=`./findhdr string.h`
11401 if $test "$strings" && $test -r "$strings"; then
11402 echo "Using <string.h> instead of <strings.h>." >&4
11406 strings=`./findhdr strings.h`
11407 if $test "$strings" && $test -r "$strings"; then
11408 echo "Using <strings.h> instead of <string.h>." >&4
11410 echo "No string header found -- You'll surely have problems." >&4
11415 case "$i_string" in
11416 "$undef") strings=`./findhdr strings.h`;;
11417 *) strings=`./findhdr string.h`;;
11420 : see if this is a sys/file.h system
11425 : do we need to include sys/file.h ?
11429 if $h_sysfile; then
11431 echo "We'll be including <sys/file.h>." >&4
11434 echo "We won't be including <sys/file.h>." >&4
11444 : see if fcntl.h is there
11449 : see if we can include fcntl.h
11455 echo "We'll be including <fcntl.h>." >&4
11458 if $h_sysfile; then
11459 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11461 echo "We won't be including <fcntl.h>." >&4
11473 : check for non-blocking I/O stuff
11474 case "$h_sysfile" in
11475 true) echo "#include <sys/file.h>" > head.c;;
11478 true) echo "#include <fcntl.h>" > head.c;;
11479 *) echo "#include <sys/fcntl.h>" > head.c;;
11484 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11485 case "$o_nonblock" in
11487 $cat head.c > try.c
11488 $cat >>try.c <<EOCP
11490 #include <stdlib.h>
11497 printf("O_NONBLOCK\n");
11501 printf("O_NDELAY\n");
11505 printf("FNDELAY\n");
11512 if eval $compile_ok; then
11513 o_nonblock=`$run ./try`
11514 case "$o_nonblock" in
11515 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11516 *) echo "Seems like we can use $o_nonblock.";;
11519 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11522 *) echo "Using $hint value $o_nonblock.";;
11524 $rm -f try try.* .out core
11527 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11530 $cat head.c > try.c
11531 $cat >>try.c <<EOCP
11533 #include <sys/types.h>
11534 #include <signal.h>
11536 #include <stdlib.h>
11541 #define MY_O_NONBLOCK $o_nonblock
11542 #ifndef errno /* XXX need better Configure test */
11545 #$i_unistd I_UNISTD
11547 #include <unistd.h>
11549 #$i_string I_STRING
11551 #include <string.h>
11553 #include <strings.h>
11555 $signal_t blech(x) int x; { exit(3); }
11557 $cat >> try.c <<'EOCP'
11565 pipe(pd); /* Down: child -> parent */
11566 pipe(pu); /* Up: parent -> child */
11569 close(pd[1]); /* Parent reads from pd[0] */
11570 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11572 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11577 signal(SIGALRM, blech);
11579 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11581 sprintf(string, "%d\n", ret);
11582 write(2, string, strlen(string));
11585 if (errno == EAGAIN) {
11586 printf("EAGAIN\n");
11591 if (errno == EWOULDBLOCK)
11592 printf("EWOULDBLOCK\n");
11595 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11596 sleep(2); /* Give it time to close our pipe */
11598 ret = read(pd[0], buf, 1); /* Should read EOF */
11600 sprintf(string, "%d\n", ret);
11601 write(4, string, strlen(string));
11605 close(pd[0]); /* We write to pd[1] */
11606 close(pu[1]); /* We read from pu[0] */
11607 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11608 close(pd[1]); /* Pipe pd is now fully closed! */
11609 exit(0); /* Bye bye, thank you for playing! */
11613 if eval $compile_ok; then
11614 echo "$startsh" >mtry
11615 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11617 ./mtry >/dev/null 2>&1
11619 0) eagain=`$cat try.out`;;
11620 1) echo "Could not perform non-blocking setting!";;
11621 2) echo "I did a successful read() for something that was not there!";;
11622 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11623 4) echo "Could not find F_SETFL!";;
11624 *) echo "Something terribly wrong happened during testing.";;
11626 rd_nodata=`$cat try.ret`
11627 echo "A read() system call with no data present returns $rd_nodata."
11628 case "$rd_nodata" in
11631 echo "(That's peculiar, fixing that to be -1.)"
11637 echo "Forcing errno EAGAIN on read() with no data available."
11641 echo "Your read() sets errno to $eagain when no data is available."
11644 status=`$cat try.err`
11646 0) echo "And it correctly returns 0 to signal EOF.";;
11647 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11648 *) echo "However, your read() returns '$status' on EOF??";;
11651 if test "$status" = "$rd_nodata"; then
11652 echo "WARNING: you can't distinguish between EOF and no data!"
11656 echo "I can't compile the test program--assuming errno EAGAIN will do."
11663 echo "Using $hint value $eagain."
11664 echo "Your read() returns $rd_nodata when no data is present."
11665 case "$d_eofnblk" in
11666 "$define") echo "And you can see EOF because read() returns 0.";;
11667 "$undef") echo "But you can't see EOF status from read() returned value.";;
11669 echo "(Assuming you can't see EOF status from read anyway.)"
11675 $rm -f try try.* .out core head.c mtry
11677 : see if fchdir exists
11678 set fchdir d_fchdir
11681 : see if fchmod exists
11682 set fchmod d_fchmod
11685 : see if fchown exists
11686 set fchown d_fchown
11689 : see if this is an fcntl system
11694 : See if fcntl-based locking works.
11696 #include <stdlib.h>
11697 #include <unistd.h>
11699 #include <signal.h>
11700 $signal_t blech(x) int x; { exit(3); }
11702 #if defined(F_SETLK) && defined(F_SETLKW)
11703 struct flock flock;
11705 fd = open("try.c", O_RDONLY);
11706 flock.l_type = F_RDLCK;
11707 flock.l_whence = SEEK_SET;
11708 flock.l_start = flock.l_len = 0;
11709 signal(SIGALRM, blech);
11711 retval = fcntl(fd, F_SETLK, &flock);
11713 (retval < 0 ? exit(2) : exit(0));
11719 echo "Checking if fcntl-based file locking works... "
11723 if eval $compile_ok; then
11724 if $run ./try; then
11725 echo "Yes, it seems to work."
11728 echo "Nope, it didn't work."
11733 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11734 *** This is (almost) impossible.
11735 *** If your NFS lock daemons are not feeling well, something like
11736 *** this may happen, please investigate. Cannot continue, aborting.
11744 echo "I'm unable to compile the test program, so I'll assume not."
11749 echo "Nope, since you don't even have fcntl()."
11752 set d_fcntl_can_lock
11757 : check for fd_set items
11760 Checking to see how well your C compiler handles fd_set and friends ...
11763 #$i_systime I_SYS_TIME
11764 #$i_sysselct I_SYS_SELECT
11765 #$d_socket HAS_SOCKET
11766 #include <sys/types.h>
11768 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11771 #include <sys/time.h>
11773 #ifdef I_SYS_SELECT
11774 #include <sys/select.h>
11783 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11791 if eval $compile; then
11792 d_fds_bits="$define"
11794 echo "Well, your system knows about the normal fd_set typedef..." >&4
11795 if $run ./try; then
11796 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11797 d_fd_macros="$define"
11800 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11802 d_fd_macros="$undef"
11806 Hmm, your compiler has some difficulty with fd_set. Checking further...
11809 if eval $compile; then
11810 d_fds_bits="$undef"
11812 echo "Well, your system has some sort of fd_set available..." >&4
11813 if $run ./try; then
11814 echo "and you have the normal fd_set macros." >&4
11815 d_fd_macros="$define"
11818 but not the normal fd_set macros! Gross! More work for me...
11820 d_fd_macros="$undef"
11823 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11825 d_fds_bits="$undef"
11826 d_fd_macros="$undef"
11831 : see if fgetpos exists
11832 set fgetpos d_fgetpos
11835 : see if finite exists
11836 set finite d_finite
11839 : see if finitel exists
11840 set finitel d_finitel
11843 : see if flock exists
11847 : see if prototype for flock is available
11849 set d_flockproto flock $i_sysfile sys/file.h
11852 : see if fork exists
11856 : see if fp_class exists
11857 set fp_class d_fp_class
11860 : see if pathconf exists
11861 set pathconf d_pathconf
11864 : see if fpathconf exists
11865 set fpathconf d_fpathconf
11868 : see if fpclass exists
11869 set fpclass d_fpclass
11872 : see if fpclassify exists
11873 set fpclassify d_fpclassify
11876 : see if fpclassl exists
11877 set fpclassl d_fpclassl
11881 : check for fpos64_t
11883 echo "Checking to see if you have fpos64_t..." >&4
11886 int main() { fpos64_t x = 7; }
11889 if eval $compile; then
11891 echo "You have fpos64_t."
11894 echo "You do not have fpos64_t."
11895 case "$fpossize" in
11896 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11903 : see if frexpl exists
11904 set frexpl d_frexpl
11907 : see if this is a sys/param system
11908 set sys/param.h i_sysparam
11911 : see if this is a sys/mount.h system
11912 set sys/mount.h i_sysmount
11917 echo "Checking to see if your system supports struct fs_data..." >&4
11918 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11920 case "$d_fs_data_s" in
11921 "$define") echo "Yes, it does." ;;
11922 *) echo "No, it doesn't." ;;
11925 : see if fseeko exists
11926 set fseeko d_fseeko
11928 case "$longsize" in
11929 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11932 : see if fsetpos exists
11933 set fsetpos d_fsetpos
11937 : see if fstatfs exists
11938 set fstatfs d_fstatfs
11942 : see if statvfs exists
11943 set statvfs d_statvfs
11946 : see if fstatvfs exists
11947 set fstatvfs d_fstatvfs
11951 : see if fsync exists
11955 : see if ftello exists
11956 set ftello d_ftello
11958 case "$longsize" in
11959 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11962 : see if getcwd exists
11963 set getcwd d_getcwd
11966 : see if getespwnam exists
11967 set getespwnam d_getespwnam
11971 : see if getfsstat exists
11972 set getfsstat d_getfsstat
11975 : see if getgrent exists
11976 set getgrent d_getgrent
11979 : see if getgrent_r exists
11980 set getgrent_r d_getgrent_r
11982 case "$d_getgrent_r" in
11984 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11985 case "$d_getgrent_r_proto:$usethreads" in
11986 ":define") d_getgrent_r_proto=define
11987 set d_getgrent_r_proto getgrent_r $hdrs
11991 case "$d_getgrent_r_proto" in
11993 case "$getgrent_r_proto" in
11994 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
11995 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
11997 case "$getgrent_r_proto" in
11998 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
11999 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12001 case "$getgrent_r_proto" in
12002 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12003 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12005 case "$getgrent_r_proto" in
12006 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12007 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12009 case "$getgrent_r_proto" in
12010 ''|0) try='int getgrent_r(struct group*, char*, int);'
12011 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12013 case "$getgrent_r_proto" in
12014 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12015 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12017 case "$getgrent_r_proto" in
12018 ''|0) d_getgrent_r=undef
12020 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12021 * ) case "$getgrent_r_proto" in
12022 REENTRANT_PROTO*) ;;
12023 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12025 echo "Prototype: $try" ;;
12028 *) case "$usethreads" in
12029 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12036 *) getgrent_r_proto=0
12040 : see if getgrgid_r exists
12041 set getgrgid_r d_getgrgid_r
12043 case "$d_getgrgid_r" in
12045 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12046 case "$d_getgrgid_r_proto:$usethreads" in
12047 ":define") d_getgrgid_r_proto=define
12048 set d_getgrgid_r_proto getgrgid_r $hdrs
12052 case "$d_getgrgid_r_proto" in
12054 case "$getgrgid_r_proto" in
12055 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12056 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12058 case "$getgrgid_r_proto" in
12059 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12060 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12062 case "$getgrgid_r_proto" in
12063 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12064 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12066 case "$getgrgid_r_proto" in
12067 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12068 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12070 case "$getgrgid_r_proto" in
12071 ''|0) d_getgrgid_r=undef
12073 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12074 * ) case "$getgrgid_r_proto" in
12075 REENTRANT_PROTO*) ;;
12076 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12078 echo "Prototype: $try" ;;
12081 *) case "$usethreads" in
12082 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12089 *) getgrgid_r_proto=0
12093 : see if getgrnam_r exists
12094 set getgrnam_r d_getgrnam_r
12096 case "$d_getgrnam_r" in
12098 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12099 case "$d_getgrnam_r_proto:$usethreads" in
12100 ":define") d_getgrnam_r_proto=define
12101 set d_getgrnam_r_proto getgrnam_r $hdrs
12105 case "$d_getgrnam_r_proto" in
12107 case "$getgrnam_r_proto" in
12108 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12109 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12111 case "$getgrnam_r_proto" in
12112 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12113 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12115 case "$getgrnam_r_proto" in
12116 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12117 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12119 case "$getgrnam_r_proto" in
12120 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12121 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12123 case "$getgrnam_r_proto" in
12124 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12125 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12127 case "$getgrnam_r_proto" in
12128 ''|0) d_getgrnam_r=undef
12130 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12131 * ) case "$getgrnam_r_proto" in
12132 REENTRANT_PROTO*) ;;
12133 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12135 echo "Prototype: $try" ;;
12138 *) case "$usethreads" in
12139 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12146 *) getgrnam_r_proto=0
12150 : see if gethostbyaddr exists
12151 set gethostbyaddr d_gethbyaddr
12154 : see if gethostbyname exists
12155 set gethostbyname d_gethbyname
12158 : see if gethostent exists
12159 set gethostent d_gethent
12162 : see how we will look up host name
12165 if set gethostname val -f d_gethname; eval $csym; $val; then
12166 echo 'gethostname() found.' >&4
12167 d_gethname="$define"
12170 if set uname val -f d_uname; eval $csym; $val; then
12173 uname() was found, but you're running xenix, and older versions of xenix
12174 have a broken uname(). If you don't really know whether your xenix is old
12175 enough to have a broken system call, use the default answer.
12180 "$define") dflt=n;;
12182 rp='Is your uname() broken?'
12185 n*) d_uname="$define"; call=uname;;
12188 echo 'uname() found.' >&4
12195 case "$d_gethname" in
12196 '') d_gethname="$undef";;
12199 '') d_uname="$undef";;
12201 case "$d_uname$d_gethname" in
12206 Every now and then someone has a $call() that lies about the hostname
12207 but can't be fixed for political or economic reasons. If you wish, I can
12208 pretend $call() isn't there and maybe compute hostname at run-time
12209 thanks to the '$phostname' command.
12212 rp="Shall I ignore $call() from now on?"
12215 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12218 case "$phostname" in
12219 '') aphostname='';;
12220 *) case "$aphostname" in
12222 *) set X $phostname
12226 file=`./loc $file $file $pth`
12227 aphostname=`echo $file $*`
12232 case "$d_uname$d_gethname" in
12235 case "$phostname" in
12237 echo "There will be no way for $package to get your hostname." >&4;;
12239 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12243 case "$d_phostname" in
12244 '') d_phostname="$undef";;
12247 : see if gethostbyaddr_r exists
12248 set gethostbyaddr_r d_gethostbyaddr_r
12250 case "$d_gethostbyaddr_r" in
12252 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12253 case "$d_gethostbyaddr_r_proto:$usethreads" in
12254 ":define") d_gethostbyaddr_r_proto=define
12255 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12259 case "$d_gethostbyaddr_r_proto" in
12261 case "$gethostbyaddr_r_proto" in
12262 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12263 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12265 case "$gethostbyaddr_r_proto" in
12266 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12267 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12269 case "$gethostbyaddr_r_proto" in
12270 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12271 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12273 case "$gethostbyaddr_r_proto" in
12274 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12275 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12277 case "$gethostbyaddr_r_proto" in
12278 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12279 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12281 case "$gethostbyaddr_r_proto" in
12282 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12283 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12285 case "$gethostbyaddr_r_proto" in
12286 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12287 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12289 case "$gethostbyaddr_r_proto" in
12290 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12291 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12293 case "$gethostbyaddr_r_proto" in
12294 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12295 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12297 case "$gethostbyaddr_r_proto" in
12298 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12299 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12301 case "$gethostbyaddr_r_proto" in
12302 ''|0) d_gethostbyaddr_r=undef
12303 gethostbyaddr_r_proto=0
12304 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12305 * ) case "$gethostbyaddr_r_proto" in
12306 REENTRANT_PROTO*) ;;
12307 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12309 echo "Prototype: $try" ;;
12312 *) case "$usethreads" in
12313 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12315 d_gethostbyaddr_r=undef
12316 gethostbyaddr_r_proto=0
12320 *) gethostbyaddr_r_proto=0
12324 : see if gethostbyname_r exists
12325 set gethostbyname_r d_gethostbyname_r
12327 case "$d_gethostbyname_r" in
12329 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12330 case "$d_gethostbyname_r_proto:$usethreads" in
12331 ":define") d_gethostbyname_r_proto=define
12332 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12336 case "$d_gethostbyname_r_proto" in
12338 case "$gethostbyname_r_proto" in
12339 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12340 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12342 case "$gethostbyname_r_proto" in
12343 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12344 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12346 case "$gethostbyname_r_proto" in
12347 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12348 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12350 case "$gethostbyname_r_proto" in
12351 ''|0) d_gethostbyname_r=undef
12352 gethostbyname_r_proto=0
12353 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12354 * ) case "$gethostbyname_r_proto" in
12355 REENTRANT_PROTO*) ;;
12356 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12358 echo "Prototype: $try" ;;
12361 *) case "$usethreads" in
12362 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12364 d_gethostbyname_r=undef
12365 gethostbyname_r_proto=0
12369 *) gethostbyname_r_proto=0
12373 : see if gethostent_r exists
12374 set gethostent_r d_gethostent_r
12376 case "$d_gethostent_r" in
12378 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12379 case "$d_gethostent_r_proto:$usethreads" in
12380 ":define") d_gethostent_r_proto=define
12381 set d_gethostent_r_proto gethostent_r $hdrs
12385 case "$d_gethostent_r_proto" in
12387 case "$gethostent_r_proto" in
12388 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12389 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12391 case "$gethostent_r_proto" in
12392 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12393 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12395 case "$gethostent_r_proto" in
12396 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12397 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12399 case "$gethostent_r_proto" in
12400 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12401 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12403 case "$gethostent_r_proto" in
12404 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12405 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12407 case "$gethostent_r_proto" in
12408 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
12409 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
12411 case "$gethostent_r_proto" in
12412 ''|0) d_gethostent_r=undef
12413 gethostent_r_proto=0
12414 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
12415 * ) case "$gethostent_r_proto" in
12416 REENTRANT_PROTO*) ;;
12417 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
12419 echo "Prototype: $try" ;;
12422 *) case "$usethreads" in
12423 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
12425 d_gethostent_r=undef
12426 gethostent_r_proto=0
12430 *) gethostent_r_proto=0
12434 : see if prototypes for various gethostxxx netdb.h functions are available
12436 set d_gethostprotos gethostent $i_netdb netdb.h
12439 : see if getitimer exists
12440 set getitimer d_getitimer
12443 : see if getlogin exists
12444 set getlogin d_getlogin
12447 : see if getlogin_r exists
12448 set getlogin_r d_getlogin_r
12450 case "$d_getlogin_r" in
12452 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
12453 case "$d_getlogin_r_proto:$usethreads" in
12454 ":define") d_getlogin_r_proto=define
12455 set d_getlogin_r_proto getlogin_r $hdrs
12459 case "$d_getlogin_r_proto" in
12461 case "$getlogin_r_proto" in
12462 ''|0) try='int getlogin_r(char*, size_t);'
12463 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
12465 case "$getlogin_r_proto" in
12466 ''|0) try='int getlogin_r(char*, int);'
12467 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12469 case "$getlogin_r_proto" in
12470 ''|0) try='char* getlogin_r(char*, size_t);'
12471 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12473 case "$getlogin_r_proto" in
12474 ''|0) try='char* getlogin_r(char*, int);'
12475 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12477 case "$getlogin_r_proto" in
12478 ''|0) d_getlogin_r=undef
12480 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12481 * ) case "$getlogin_r_proto" in
12482 REENTRANT_PROTO*) ;;
12483 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12485 echo "Prototype: $try" ;;
12488 *) case "$usethreads" in
12489 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12496 *) getlogin_r_proto=0
12500 : see if getmnt exists
12501 set getmnt d_getmnt
12504 : see if getmntent exists
12505 set getmntent d_getmntent
12508 : see if getnetbyaddr exists
12509 set getnetbyaddr d_getnbyaddr
12512 : see if getnetbyname exists
12513 set getnetbyname d_getnbyname
12516 : see if getnetent exists
12517 set getnetent d_getnent
12520 : see if getnetbyaddr_r exists
12521 set getnetbyaddr_r d_getnetbyaddr_r
12523 case "$d_getnetbyaddr_r" in
12525 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12526 case "$d_getnetbyaddr_r_proto:$usethreads" in
12527 ":define") d_getnetbyaddr_r_proto=define
12528 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12532 case "$d_getnetbyaddr_r_proto" in
12534 case "$getnetbyaddr_r_proto" in
12535 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12536 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12538 case "$getnetbyaddr_r_proto" in
12539 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12540 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12542 case "$getnetbyaddr_r_proto" in
12543 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12544 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12546 case "$getnetbyaddr_r_proto" in
12547 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12548 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12550 case "$getnetbyaddr_r_proto" in
12551 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12552 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12554 case "$getnetbyaddr_r_proto" in
12555 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12556 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12558 case "$getnetbyaddr_r_proto" in
12559 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12560 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12562 case "$getnetbyaddr_r_proto" in
12563 ''|0) d_getnetbyaddr_r=undef
12564 getnetbyaddr_r_proto=0
12565 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12566 * ) case "$getnetbyaddr_r_proto" in
12567 REENTRANT_PROTO*) ;;
12568 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12570 echo "Prototype: $try" ;;
12573 *) case "$usethreads" in
12574 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12576 d_getnetbyaddr_r=undef
12577 getnetbyaddr_r_proto=0
12581 *) getnetbyaddr_r_proto=0
12585 : see if getnetbyname_r exists
12586 set getnetbyname_r d_getnetbyname_r
12588 case "$d_getnetbyname_r" in
12590 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12591 case "$d_getnetbyname_r_proto:$usethreads" in
12592 ":define") d_getnetbyname_r_proto=define
12593 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12597 case "$d_getnetbyname_r_proto" in
12599 case "$getnetbyname_r_proto" in
12600 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12601 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12603 case "$getnetbyname_r_proto" in
12604 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12605 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12607 case "$getnetbyname_r_proto" in
12608 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12609 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12611 case "$getnetbyname_r_proto" in
12612 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12613 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12615 case "$getnetbyname_r_proto" in
12616 ''|0) d_getnetbyname_r=undef
12617 getnetbyname_r_proto=0
12618 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12619 * ) case "$getnetbyname_r_proto" in
12620 REENTRANT_PROTO*) ;;
12621 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12623 echo "Prototype: $try" ;;
12626 *) case "$usethreads" in
12627 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12629 d_getnetbyname_r=undef
12630 getnetbyname_r_proto=0
12634 *) getnetbyname_r_proto=0
12638 : see if getnetent_r exists
12639 set getnetent_r d_getnetent_r
12641 case "$d_getnetent_r" in
12643 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12644 case "$d_getnetent_r_proto:$usethreads" in
12645 ":define") d_getnetent_r_proto=define
12646 set d_getnetent_r_proto getnetent_r $hdrs
12650 case "$d_getnetent_r_proto" in
12652 case "$getnetent_r_proto" in
12653 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12654 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12656 case "$getnetent_r_proto" in
12657 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12658 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12660 case "$getnetent_r_proto" in
12661 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12662 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12664 case "$getnetent_r_proto" in
12665 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12666 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12668 case "$getnetent_r_proto" in
12669 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12670 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12672 case "$getnetent_r_proto" in
12673 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12674 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12676 case "$getnetent_r_proto" in
12677 ''|0) d_getnetent_r=undef
12678 getnetent_r_proto=0
12679 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12680 * ) case "$getnetent_r_proto" in
12681 REENTRANT_PROTO*) ;;
12682 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12684 echo "Prototype: $try" ;;
12687 *) case "$usethreads" in
12688 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12690 d_getnetent_r=undef
12691 getnetent_r_proto=0
12695 *) getnetent_r_proto=0
12699 : see if prototypes for various getnetxxx netdb.h functions are available
12701 set d_getnetprotos getnetent $i_netdb netdb.h
12704 : see if getpagesize exists
12705 set getpagesize d_getpagsz
12709 : see if getprotobyname exists
12710 set getprotobyname d_getpbyname
12713 : see if getprotobynumber exists
12714 set getprotobynumber d_getpbynumber
12717 : see if getprotoent exists
12718 set getprotoent d_getpent
12721 : see if getpgid exists
12722 set getpgid d_getpgid
12725 : see if getpgrp2 exists
12726 set getpgrp2 d_getpgrp2
12729 : see if getppid exists
12730 set getppid d_getppid
12733 : see if getpriority exists
12734 set getpriority d_getprior
12737 : see if getprotobyname_r exists
12738 set getprotobyname_r d_getprotobyname_r
12740 case "$d_getprotobyname_r" in
12742 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12743 case "$d_getprotobyname_r_proto:$usethreads" in
12744 ":define") d_getprotobyname_r_proto=define
12745 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12749 case "$d_getprotobyname_r_proto" in
12751 case "$getprotobyname_r_proto" in
12752 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12753 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12755 case "$getprotobyname_r_proto" in
12756 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12757 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12759 case "$getprotobyname_r_proto" in
12760 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12761 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12763 case "$getprotobyname_r_proto" in
12764 ''|0) d_getprotobyname_r=undef
12765 getprotobyname_r_proto=0
12766 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12767 * ) case "$getprotobyname_r_proto" in
12768 REENTRANT_PROTO*) ;;
12769 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12771 echo "Prototype: $try" ;;
12774 *) case "$usethreads" in
12775 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12777 d_getprotobyname_r=undef
12778 getprotobyname_r_proto=0
12782 *) getprotobyname_r_proto=0
12786 : see if getprotobynumber_r exists
12787 set getprotobynumber_r d_getprotobynumber_r
12789 case "$d_getprotobynumber_r" in
12791 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12792 case "$d_getprotobynumber_r_proto:$usethreads" in
12793 ":define") d_getprotobynumber_r_proto=define
12794 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12798 case "$d_getprotobynumber_r_proto" in
12800 case "$getprotobynumber_r_proto" in
12801 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12802 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12804 case "$getprotobynumber_r_proto" in
12805 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12806 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12808 case "$getprotobynumber_r_proto" in
12809 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12810 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12812 case "$getprotobynumber_r_proto" in
12813 ''|0) d_getprotobynumber_r=undef
12814 getprotobynumber_r_proto=0
12815 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12816 * ) case "$getprotobynumber_r_proto" in
12817 REENTRANT_PROTO*) ;;
12818 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12820 echo "Prototype: $try" ;;
12823 *) case "$usethreads" in
12824 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12826 d_getprotobynumber_r=undef
12827 getprotobynumber_r_proto=0
12831 *) getprotobynumber_r_proto=0
12835 : see if getprotoent_r exists
12836 set getprotoent_r d_getprotoent_r
12838 case "$d_getprotoent_r" in
12840 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12841 case "$d_getprotoent_r_proto:$usethreads" in
12842 ":define") d_getprotoent_r_proto=define
12843 set d_getprotoent_r_proto getprotoent_r $hdrs
12847 case "$d_getprotoent_r_proto" in
12849 case "$getprotoent_r_proto" in
12850 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12851 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12853 case "$getprotoent_r_proto" in
12854 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12855 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12857 case "$getprotoent_r_proto" in
12858 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12859 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12861 case "$getprotoent_r_proto" in
12862 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12863 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12865 case "$getprotoent_r_proto" in
12866 ''|0) d_getprotoent_r=undef
12867 getprotoent_r_proto=0
12868 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12869 * ) case "$getprotoent_r_proto" in
12870 REENTRANT_PROTO*) ;;
12871 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12873 echo "Prototype: $try" ;;
12876 *) case "$usethreads" in
12877 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12879 d_getprotoent_r=undef
12880 getprotoent_r_proto=0
12884 *) getprotoent_r_proto=0
12888 : see if prototypes for various getprotoxxx netdb.h functions are available
12890 set d_getprotoprotos getprotoent $i_netdb netdb.h
12893 : see if getprpwnam exists
12894 set getprpwnam d_getprpwnam
12897 : see if getpwent exists
12898 set getpwent d_getpwent
12901 : see if getpwent_r exists
12902 set getpwent_r d_getpwent_r
12904 case "$d_getpwent_r" in
12906 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12907 case "$d_getpwent_r_proto:$usethreads" in
12908 ":define") d_getpwent_r_proto=define
12909 set d_getpwent_r_proto getpwent_r $hdrs
12913 case "$d_getpwent_r_proto" in
12915 case "$getpwent_r_proto" in
12916 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12917 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12919 case "$getpwent_r_proto" in
12920 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12921 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12923 case "$getpwent_r_proto" in
12924 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12925 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12927 case "$getpwent_r_proto" in
12928 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12929 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12931 case "$getpwent_r_proto" in
12932 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12933 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12935 case "$getpwent_r_proto" in
12936 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12937 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12939 case "$getpwent_r_proto" in
12940 ''|0) d_getpwent_r=undef
12942 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12943 * ) case "$getpwent_r_proto" in
12944 REENTRANT_PROTO*) ;;
12945 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12947 echo "Prototype: $try" ;;
12950 *) case "$usethreads" in
12951 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12958 *) getpwent_r_proto=0
12962 : see if getpwnam_r exists
12963 set getpwnam_r d_getpwnam_r
12965 case "$d_getpwnam_r" in
12967 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12968 case "$d_getpwnam_r_proto:$usethreads" in
12969 ":define") d_getpwnam_r_proto=define
12970 set d_getpwnam_r_proto getpwnam_r $hdrs
12974 case "$d_getpwnam_r_proto" in
12976 case "$getpwnam_r_proto" in
12977 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
12978 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
12980 case "$getpwnam_r_proto" in
12981 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
12982 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
12984 case "$getpwnam_r_proto" in
12985 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
12986 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
12988 case "$getpwnam_r_proto" in
12989 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
12990 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
12992 case "$getpwnam_r_proto" in
12993 ''|0) d_getpwnam_r=undef
12995 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
12996 * ) case "$getpwnam_r_proto" in
12997 REENTRANT_PROTO*) ;;
12998 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13000 echo "Prototype: $try" ;;
13003 *) case "$usethreads" in
13004 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13011 *) getpwnam_r_proto=0
13015 : see if getpwuid_r exists
13016 set getpwuid_r d_getpwuid_r
13018 case "$d_getpwuid_r" in
13020 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13021 case "$d_getpwuid_r_proto:$usethreads" in
13022 ":define") d_getpwuid_r_proto=define
13023 set d_getpwuid_r_proto getpwuid_r $hdrs
13027 case "$d_getpwuid_r_proto" in
13029 case "$getpwuid_r_proto" in
13030 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13031 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13033 case "$getpwuid_r_proto" in
13034 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13035 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13037 case "$getpwuid_r_proto" in
13038 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13039 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13041 case "$getpwuid_r_proto" in
13042 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13043 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13045 case "$getpwuid_r_proto" in
13046 ''|0) d_getpwuid_r=undef
13048 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13049 * ) case "$getpwuid_r_proto" in
13050 REENTRANT_PROTO*) ;;
13051 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13053 echo "Prototype: $try" ;;
13056 *) case "$usethreads" in
13057 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13064 *) getpwuid_r_proto=0
13069 : see if getservbyname exists
13070 set getservbyname d_getsbyname
13073 : see if getservbyport exists
13074 set getservbyport d_getsbyport
13077 : see if getservent exists
13078 set getservent d_getsent
13081 : see if getservbyname_r exists
13082 set getservbyname_r d_getservbyname_r
13084 case "$d_getservbyname_r" in
13086 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13087 case "$d_getservbyname_r_proto:$usethreads" in
13088 ":define") d_getservbyname_r_proto=define
13089 set d_getservbyname_r_proto getservbyname_r $hdrs
13093 case "$d_getservbyname_r_proto" in
13095 case "$getservbyname_r_proto" in
13096 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13097 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13099 case "$getservbyname_r_proto" in
13100 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13101 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13103 case "$getservbyname_r_proto" in
13104 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13105 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13107 case "$getservbyname_r_proto" in
13108 ''|0) d_getservbyname_r=undef
13109 getservbyname_r_proto=0
13110 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13111 * ) case "$getservbyname_r_proto" in
13112 REENTRANT_PROTO*) ;;
13113 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13115 echo "Prototype: $try" ;;
13118 *) case "$usethreads" in
13119 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13121 d_getservbyname_r=undef
13122 getservbyname_r_proto=0
13126 *) getservbyname_r_proto=0
13130 : see if getservbyport_r exists
13131 set getservbyport_r d_getservbyport_r
13133 case "$d_getservbyport_r" in
13135 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13136 case "$d_getservbyport_r_proto:$usethreads" in
13137 ":define") d_getservbyport_r_proto=define
13138 set d_getservbyport_r_proto getservbyport_r $hdrs
13142 case "$d_getservbyport_r_proto" in
13144 case "$getservbyport_r_proto" in
13145 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13146 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13148 case "$getservbyport_r_proto" in
13149 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13150 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13152 case "$getservbyport_r_proto" in
13153 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13154 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13156 case "$getservbyport_r_proto" in
13157 ''|0) d_getservbyport_r=undef
13158 getservbyport_r_proto=0
13159 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13160 * ) case "$getservbyport_r_proto" in
13161 REENTRANT_PROTO*) ;;
13162 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13164 echo "Prototype: $try" ;;
13167 *) case "$usethreads" in
13168 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13170 d_getservbyport_r=undef
13171 getservbyport_r_proto=0
13175 *) getservbyport_r_proto=0
13179 : see if getservent_r exists
13180 set getservent_r d_getservent_r
13182 case "$d_getservent_r" in
13184 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13185 case "$d_getservent_r_proto:$usethreads" in
13186 ":define") d_getservent_r_proto=define
13187 set d_getservent_r_proto getservent_r $hdrs
13191 case "$d_getservent_r_proto" in
13193 case "$getservent_r_proto" in
13194 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13195 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13197 case "$getservent_r_proto" in
13198 ''|0) try='int getservent_r(struct servent*, char*, int);'
13199 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13201 case "$getservent_r_proto" in
13202 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13203 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13205 case "$getservent_r_proto" in
13206 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13207 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13209 case "$getservent_r_proto" in
13210 ''|0) d_getservent_r=undef
13211 getservent_r_proto=0
13212 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13213 * ) case "$getservent_r_proto" in
13214 REENTRANT_PROTO*) ;;
13215 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13217 echo "Prototype: $try" ;;
13220 *) case "$usethreads" in
13221 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13223 d_getservent_r=undef
13224 getservent_r_proto=0
13228 *) getservent_r_proto=0
13232 : see if prototypes for various getservxxx netdb.h functions are available
13234 set d_getservprotos getservent $i_netdb netdb.h
13237 : see if getspnam exists
13238 set getspnam d_getspnam
13241 : see if this is a shadow.h system
13242 set shadow.h i_shadow
13245 : see if getspnam_r exists
13246 set getspnam_r d_getspnam_r
13248 case "$d_getspnam_r" in
13250 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13251 case "$d_getspnam_r_proto:$usethreads" in
13252 ":define") d_getspnam_r_proto=define
13253 set d_getspnam_r_proto getspnam_r $hdrs
13257 case "$d_getspnam_r_proto" in
13259 case "$getspnam_r_proto" in
13260 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13261 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13263 case "$getspnam_r_proto" in
13264 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13265 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13267 case "$getspnam_r_proto" in
13268 ''|0) d_getspnam_r=undef
13270 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13271 * ) case "$getspnam_r_proto" in
13272 REENTRANT_PROTO*) ;;
13273 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13275 echo "Prototype: $try" ;;
13278 *) case "$usethreads" in
13279 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13286 *) getspnam_r_proto=0
13290 : see if gettimeofday or ftime exists
13291 set gettimeofday d_gettimeod
13293 case "$d_gettimeod" in
13299 val="$undef"; set d_ftime; eval $setvar
13302 case "$d_gettimeod$d_ftime" in
13305 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13309 : see if gmtime_r exists
13310 set gmtime_r d_gmtime_r
13312 case "$d_gmtime_r" in
13314 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13315 case "$d_gmtime_r_proto:$usethreads" in
13316 ":define") d_gmtime_r_proto=define
13317 set d_gmtime_r_proto gmtime_r $hdrs
13321 case "$d_gmtime_r_proto" in
13323 case "$gmtime_r_proto" in
13324 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13325 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13327 case "$gmtime_r_proto" in
13328 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13329 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13331 case "$gmtime_r_proto" in
13332 ''|0) d_gmtime_r=undef
13334 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13335 * ) case "$gmtime_r_proto" in
13336 REENTRANT_PROTO*) ;;
13337 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13339 echo "Prototype: $try" ;;
13342 *) case "$usethreads" in
13343 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13350 *) gmtime_r_proto=0
13354 : see if hasmntopt exists
13355 set hasmntopt d_hasmntopt
13358 : see if this is a netinet/in.h or sys/in.h system
13359 set netinet/in.h i_niin sys/in.h i_sysin
13362 : see if arpa/inet.h has to be included
13363 set arpa/inet.h i_arpainet
13366 : see if htonl --and friends-- exists
13371 : Maybe they are macros.
13374 $cat >htonl.c <<EOM
13376 #include <sys/types.h>
13377 #$i_niin I_NETINET_IN
13379 #$i_arpainet I_ARPA_INET
13380 #ifdef I_NETINET_IN
13381 #include <netinet/in.h>
13384 #include <sys/in.h>
13387 #include <arpa/inet.h>
13390 printf("Defined as a macro.");
13393 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13394 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13396 echo "But it seems to be defined as a macro." >&4
13406 if set index val -f; eval $csym; $val; then
13407 if set strchr val -f d_strchr; eval $csym; $val; then
13408 if $contains strchr "$strings" >/dev/null 2>&1 ; then
13411 echo "strchr() found." >&4
13415 echo "index() found." >&4
13420 echo "index() found." >&4
13423 if set strchr val -f d_strchr; eval $csym; $val; then
13426 echo "strchr() found." >&4
13428 echo "No index() or strchr() found!" >&4
13433 set d_strchr; eval $setvar
13435 set d_index; eval $setvar
13437 : check whether inet_aton exists
13438 set inet_aton d_inetaton
13443 $cat >isascii.c <<'EOCP'
13455 if eval $compile; then
13456 echo "isascii() found." >&4
13459 echo "isascii() NOT found." >&4
13466 : see if isfinite exists
13467 set isfinite d_isfinite
13470 : see if isinf exists
13474 : see if isnan exists
13478 : see if isnanl exists
13479 set isnanl d_isnanl
13482 : see if killpg exists
13483 set killpg d_killpg
13486 : see if lchown exists
13488 $cat > try.c <<'EOCP'
13489 /* System header to define __stub macros and hopefully few prototypes,
13490 which can conflict with char lchown(); below. */
13491 #include <assert.h>
13492 /* Override any gcc2 internal prototype to avoid an error. */
13493 /* We use char because int might match the return type of a gcc2
13494 builtin and then its argument prototype would still apply. */
13497 /* The GNU C library defines this for functions which it implements
13498 to always fail with ENOSYS. Some functions are actually named
13499 something starting with __ and the normal name is an alias. */
13500 #if defined (__stub_lchown) || defined (__stub___lchown)
13508 if eval $compile; then
13509 $echo "lchown() found." >&4
13512 $echo "lchown() NOT found." >&4
13518 : See if number of significant digits in a double precision number is known
13520 $cat >ldbl_dig.c <<EOM
13521 #$i_limits I_LIMITS
13524 #include <limits.h>
13530 printf("Contains LDBL_DIG");
13533 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13534 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13535 echo "LDBL_DIG found." >&4
13538 echo "LDBL_DIG NOT found." >&4
13545 : see if link exists
13549 : see if localtime_r exists
13550 set localtime_r d_localtime_r
13552 case "$d_localtime_r" in
13554 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13555 case "$d_localtime_r_proto:$usethreads" in
13556 ":define") d_localtime_r_proto=define
13557 set d_localtime_r_proto localtime_r $hdrs
13561 case "$d_localtime_r_proto" in
13563 case "$localtime_r_proto" in
13564 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13565 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13567 case "$localtime_r_proto" in
13568 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13569 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13571 case "$localtime_r_proto" in
13572 ''|0) d_localtime_r=undef
13573 localtime_r_proto=0
13574 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13575 * ) case "$localtime_r_proto" in
13576 REENTRANT_PROTO*) ;;
13577 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13579 echo "Prototype: $try" ;;
13582 *) case "$usethreads" in
13583 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13585 d_localtime_r=undef
13586 localtime_r_proto=0
13590 *) localtime_r_proto=0
13594 : see if localeconv exists
13595 set localeconv d_locconv
13598 : see if lockf exists
13602 : see if prototype for lseek is available
13604 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13607 : see if lstat exists
13611 : see if madvise exists
13612 set madvise d_madvise
13615 : see if mblen exists
13619 : see if mbstowcs exists
13620 set mbstowcs d_mbstowcs
13623 : see if mbtowc exists
13624 set mbtowc d_mbtowc
13627 : see if memchr exists
13628 set memchr d_memchr
13631 : see if memcmp exists
13632 set memcmp d_memcmp
13635 : see if memcpy exists
13636 set memcpy d_memcpy
13639 : see if memmove exists
13640 set memmove d_memmove
13643 : see if memset exists
13644 set memset d_memset
13647 : see if mkdir exists
13651 : see if mkdtemp exists
13652 set mkdtemp d_mkdtemp
13655 : see if mkfifo exists
13656 set mkfifo d_mkfifo
13659 : see if mkstemp exists
13660 set mkstemp d_mkstemp
13663 : see if mkstemps exists
13664 set mkstemps d_mkstemps
13667 : see if mktime exists
13668 set mktime d_mktime
13671 : see if this is a sys/mman.h system
13672 set sys/mman.h i_sysmman
13675 : see if mmap exists
13678 : see what shmat returns
13679 : default to something harmless
13681 case "$i_sysmman$d_mmap" in
13683 $cat >mmap.c <<'END'
13684 #include <sys/mman.h>
13687 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13692 echo "and it returns ($mmaptype)." >&4
13698 : see if mprotect exists
13699 set mprotect d_mprotect
13702 : see if msgctl exists
13703 set msgctl d_msgctl
13706 : see if msgget exists
13707 set msgget d_msgget
13710 : see if msgsnd exists
13711 set msgsnd d_msgsnd
13714 : see if msgrcv exists
13715 set msgrcv d_msgrcv
13718 : see how much of the 'msg*(2)' library is present.
13721 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13722 *"$undef"*) h_msg=false;;
13726 case "`ipcs 2>&1`" in
13727 "SVID messages"*"not configured"*)
13728 echo "Your $osname does not have the msg*(2) configured." >&4
13731 set msgctl d_msgctl
13733 set msgget d_msgget
13735 set msgsnd d_msgsnd
13737 set msgrcv d_msgrcv
13743 : we could also check for sys/ipc.h ...
13744 if $h_msg && $test `./findhdr sys/msg.h`; then
13745 echo "You have the full msg*(2) library." >&4
13748 echo "You don't have the full msg*(2) library." >&4
13756 echo "Checking to see if your system supports struct msghdr..." >&4
13757 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13759 case "$d_msghdr_s" in
13760 "$define") echo "Yes, it does." ;;
13761 *) echo "No, it doesn't." ;;
13765 : see if msync exists
13769 : see if munmap exists
13770 set munmap d_munmap
13773 : see if nanosleep exists
13774 set nanosleep d_nanosleep
13777 : see if nice exists
13781 : see if this is a langinfo.h system
13782 set langinfo.h i_langinfo
13785 : see if nl_langinfo exists
13786 set nl_langinfo d_nl_langinfo
13789 : check for length of character
13791 case "$charsize" in
13793 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13794 $cat >try.c <<'EOCP'
13798 printf("%d\n", (int)sizeof(char));
13803 if eval $compile_ok; then
13807 echo "(I can't seem to compile the test program. Guessing...)"
13814 rp="What is the size of a character (in bytes)?"
13819 : check for volatile keyword
13821 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13822 $cat >try.c <<'EOCP'
13825 typedef struct _goo_struct goo_struct;
13826 goo_struct * volatile goo = ((goo_struct *)0);
13827 struct _goo_struct {
13832 typedef unsigned short foo_t;
13833 char *volatile foo;
13835 volatile foo_t blech;
13839 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13841 echo "Yup, it does."
13844 echo "Nope, it doesn't."
13852 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13854 case "$use64bitint:$d_quad:$quadtype" in
13857 uvtype="$uquadtype"
13862 uvtype="unsigned long"
13868 case "$uselongdouble:$d_longdbl" in
13870 nvtype="long double"
13871 nvsize=$longdblsize
13878 $echo "(IV will be "$ivtype", $ivsize bytes)"
13879 $echo "(UV will be "$uvtype", $uvsize bytes)"
13880 $echo "(NV will be "$nvtype", $nvsize bytes)"
13883 #$i_inttypes I_INTTYPES
13885 #include <inttypes.h>
13890 int8_t i = INT8_MAX;
13891 uint8_t u = UINT8_MAX;
13892 printf("int8_t\n");
13895 int16_t i = INT16_MAX;
13896 uint16_t i = UINT16_MAX;
13897 printf("int16_t\n");
13900 int32_t i = INT32_MAX;
13901 uint32_t u = UINT32_MAX;
13902 printf("int32_t\n");
13908 '') case "$charsize" in
13910 u8type="unsigned char"
13919 if eval $compile; then
13920 case "`$run ./try`" in
13921 int8_t) i8type=int8_t
13931 '') if $test $charsize -ge 1; then
13933 u8type="unsigned char"
13941 '') case "$shortsize" in
13943 u16type="unsigned short"
13951 '') set try -DINT16
13952 if eval $compile; then
13953 case "`$run ./try`" in
13965 '') if $test $shortsize -ge 2; then
13967 u16type="unsigned short"
13975 '') case "$longsize" in
13977 u32type="unsigned long"
13981 *) case "$intsize" in
13983 u32type="unsigned int"
13993 '') set try -DINT32
13994 if eval $compile; then
13995 case "`$run ./try`" in
14007 '') if $test $intsize -ge 4; then
14009 u32type="unsigned int"
14017 '') case "$d_quad:$quadtype" in
14019 i64type="$quadtype"
14020 u64type="$uquadtype"
14028 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14029 : volatile so that the compiler has to store it out to memory.
14030 if test X"$d_volatile" = X"$define"; then
14035 #include <sys/types.h>
14036 #include <signal.h>
14038 $volatile int bletched = 0;
14039 $signal_t blech(s) int s; { bletched = 1; }
14044 int n = 8 * $uvsize;
14047 signal(SIGFPE, blech);
14050 for (i = 0; i < n; i++) {
14051 u = u << 1 | ($uvtype)1;
14053 if (($uvtype)d != u)
14057 d = ($nvtype)(u - 1);
14058 if (($uvtype)d != (u - 1))
14066 printf("%d\n", ((i == n) ? -n : i));
14072 d_nv_preserves_uv="$undef"
14073 if eval $compile; then
14074 nv_preserves_uv_bits="`$run ./try`"
14076 case "$nv_preserves_uv_bits" in
14078 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14079 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14080 d_nv_preserves_uv="$define"
14082 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14083 d_nv_preserves_uv="$undef" ;;
14084 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14085 nv_preserves_uv_bits="$undef" ;;
14091 : check for off64_t
14093 echo "Checking to see if you have off64_t..." >&4
14095 #include <sys/types.h>
14096 #include <unistd.h>
14097 int main() { off64_t x = 7; }
14100 if eval $compile; then
14102 echo "You have off64_t."
14105 echo "You do not have off64_t."
14106 case "$lseeksize" in
14107 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
14114 : how to create joinable pthreads
14115 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
14117 echo "Checking what constant to use for creating joinable pthreads..." >&4
14118 $cat >try.c <<'EOCP'
14119 #include <pthread.h>
14121 int detachstate = JOINABLE;
14124 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
14125 if eval $compile; then
14126 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
14127 val="$undef" # Yes, undef.
14128 set d_old_pthread_create_joinable
14131 set old_pthread_create_joinable
14134 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
14135 if eval $compile; then
14136 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
14138 set d_old_pthread_create_joinable
14140 val=PTHREAD_CREATE_UNDETACHED
14141 set old_pthread_create_joinable
14144 set try -DJOINABLE=__UNDETACHED
14145 if eval $compile; then
14146 echo "You seem to use __UNDETACHED." >&4
14148 set d_old_pthread_create_joinable
14151 set old_pthread_create_joinable
14154 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
14156 set d_old_pthread_create_joinable
14159 set old_pthread_create_joinable
14166 d_old_pthread_create_joinable="$undef"
14167 old_pthread_create_joinable=""
14170 : see if pause exists
14174 : see if pipe exists
14178 : see if poll exists
14182 : see if readlink exists
14183 set readlink d_readlink
14189 case "$d_readlink" in
14191 if $issymlink /proc/self/exe ; then
14192 $ls -l /proc/self/exe > reflect
14193 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14194 echo "You have Linux-like /proc/self/exe."
14195 procselfexe='"/proc/self/exe"'
14199 if $issymlink /proc/curproc/file ; then
14200 $ls -l /proc/curproc/file > reflect
14201 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14202 echo "You have BSD-like /proc/curproc/file."
14203 procselfexe='"/proc/curproc/file"'
14213 : see whether the pthread_atfork exists
14215 #include <pthread.h>
14218 #ifdef PTHREAD_ATFORK
14219 pthread_atfork(NULL,NULL,NULL);
14224 : see if pthread_atfork exists
14225 set try -DPTHREAD_ATFORK
14226 if eval $compile; then
14231 case "$usethreads" in
14234 $define) echo 'pthread_atfork found.' >&4 ;;
14235 *) echo 'pthread_atfork NOT found.' >&4 ;;
14238 set d_pthread_atfork
14242 : see whether the various POSIXish _yields exist
14244 #include <pthread.h>
14250 #ifdef PTHREAD_YIELD
14253 #ifdef PTHREAD_YIELD_NULL
14254 pthread_yield(NULL);
14260 : see if sched_yield exists
14261 set try -DSCHED_YIELD
14262 if eval $compile; then
14264 sched_yield='sched_yield()'
14268 case "$usethreads" in
14271 $define) echo 'sched_yield() found.' >&4 ;;
14272 *) echo 'sched_yield() NOT found.' >&4 ;;
14278 : see if pthread_yield exists
14279 set try -DPTHREAD_YIELD
14280 if eval $compile; then
14282 case "$sched_yield" in
14283 '') sched_yield='pthread_yield()' ;;
14286 set try -DPTHREAD_YIELD_NULL
14287 if eval $compile; then
14289 case "$sched_yield" in
14290 '') sched_yield='pthread_yield(NULL)' ;;
14296 case "$usethreads" in
14299 $define) echo 'pthread_yield() found.' >&4 ;;
14300 *) echo 'pthread_yield() NOT found.' >&4 ;;
14304 set d_pthread_yield
14307 case "$sched_yield" in
14308 '') sched_yield=undef ;;
14313 : see if random_r exists
14314 set random_r d_random_r
14316 case "$d_random_r" in
14318 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
14319 case "$d_random_r_proto:$usethreads" in
14320 ":define") d_random_r_proto=define
14321 set d_random_r_proto random_r $hdrs
14325 case "$d_random_r_proto" in
14327 case "$random_r_proto" in
14328 ''|0) try='int random_r(int*, struct random_data*);'
14329 ./protochk "extern $try" $hdrs && random_r_proto=I_TS ;;
14331 case "$random_r_proto" in
14332 ''|0) d_random_r=undef
14334 echo "Disabling random_r, cannot determine prototype." >&4 ;;
14335 * ) case "$random_r_proto" in
14336 REENTRANT_PROTO*) ;;
14337 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
14339 echo "Prototype: $try" ;;
14342 *) case "$usethreads" in
14343 define) echo "random_r has no prototype, not using it." >&4 ;;
14350 *) random_r_proto=0
14354 : see if readdir and friends exist
14355 set readdir d_readdir
14357 set seekdir d_seekdir
14359 set telldir d_telldir
14361 set rewinddir d_rewinddir
14364 : see if readdir64_r exists
14365 set readdir64_r d_readdir64_r
14367 case "$d_readdir64_r" in
14369 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14370 case "$d_readdir64_r_proto:$usethreads" in
14371 ":define") d_readdir64_r_proto=define
14372 set d_readdir64_r_proto readdir64_r $hdrs
14376 case "$d_readdir64_r_proto" in
14378 case "$readdir64_r_proto" in
14379 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
14380 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
14382 case "$readdir64_r_proto" in
14383 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
14384 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
14386 case "$readdir64_r_proto" in
14387 ''|0) d_readdir64_r=undef
14388 readdir64_r_proto=0
14389 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
14390 * ) case "$readdir64_r_proto" in
14391 REENTRANT_PROTO*) ;;
14392 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
14394 echo "Prototype: $try" ;;
14397 *) case "$usethreads" in
14398 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
14400 d_readdir64_r=undef
14401 readdir64_r_proto=0
14405 *) readdir64_r_proto=0
14409 : see if readdir_r exists
14410 set readdir_r d_readdir_r
14412 case "$d_readdir_r" in
14414 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14415 case "$d_readdir_r_proto:$usethreads" in
14416 ":define") d_readdir_r_proto=define
14417 set d_readdir_r_proto readdir_r $hdrs
14421 case "$d_readdir_r_proto" in
14423 case "$readdir_r_proto" in
14424 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
14425 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
14427 case "$readdir_r_proto" in
14428 ''|0) try='int readdir_r(DIR*, struct dirent*);'
14429 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
14431 case "$readdir_r_proto" in
14432 ''|0) d_readdir_r=undef
14434 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
14435 * ) case "$readdir_r_proto" in
14436 REENTRANT_PROTO*) ;;
14437 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
14439 echo "Prototype: $try" ;;
14442 *) case "$usethreads" in
14443 define) echo "readdir_r has no prototype, not using it." >&4 ;;
14450 *) readdir_r_proto=0
14454 : see if readv exists
14458 : see if recvmsg exists
14459 set recvmsg d_recvmsg
14462 : see if rename exists
14463 set rename d_rename
14466 : see if rmdir exists
14470 : see if memory.h is available.
14475 : See if it conflicts with string.h
14481 $cppstdin $cppflags $cppminus < $strings > mem.h
14482 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
14484 echo "We won't be including <memory.h>."
14494 : can bcopy handle overlapping blocks?
14497 case "$d_memmove" in
14498 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14499 *) case "$d_bcopy" in
14501 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14503 #$i_memory I_MEMORY
14504 #$i_stdlib I_STDLIB
14505 #$i_string I_STRING
14506 #$i_unistd I_UNISTD
14508 $cat >>try.c <<'EOCP'
14511 # include <memory.h>
14514 # include <stdlib.h>
14517 # include <string.h>
14519 # include <strings.h>
14522 # include <unistd.h> /* Needed for NetBSD */
14526 char buf[128], abc[128];
14532 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14533 try to store the string in read-only memory. */
14534 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14536 for (align = 7; align >= 0; align--) {
14537 for (len = 36; len; len--) {
14539 bcopy(abc, b, len);
14540 for (off = 1; off <= len; off++) {
14541 bcopy(b, b+off, len);
14542 bcopy(b+off, b, len);
14543 if (bcmp(b, abc, len))
14552 if eval $compile_ok; then
14553 if ./try 2>/dev/null; then
14554 echo "Yes, it can."
14557 echo "It can't, sorry."
14560 echo "(I can't compile the test program, so we'll assume not...)"
14564 $rm -f try.* try core
14570 : can memcpy handle overlapping blocks?
14573 case "$d_memmove" in
14574 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14575 *) case "$d_memcpy" in
14577 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14579 #$i_memory I_MEMORY
14580 #$i_stdlib I_STDLIB
14581 #$i_string I_STRING
14582 #$i_unistd I_UNISTD
14584 $cat >>try.c <<'EOCP'
14587 # include <memory.h>
14590 # include <stdlib.h>
14593 # include <string.h>
14595 # include <strings.h>
14598 # include <unistd.h> /* Needed for NetBSD */
14602 char buf[128], abc[128];
14608 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14609 try to store the string in read-only memory. */
14610 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14612 for (align = 7; align >= 0; align--) {
14613 for (len = 36; len; len--) {
14615 memcpy(b, abc, len);
14616 for (off = 1; off <= len; off++) {
14617 memcpy(b+off, b, len);
14618 memcpy(b, b+off, len);
14619 if (memcmp(b, abc, len))
14628 if eval $compile_ok; then
14629 if ./try 2>/dev/null; then
14630 echo "Yes, it can."
14633 echo "It can't, sorry."
14636 echo "(I can't compile the test program, so we'll assume not...)"
14640 $rm -f try.* try core
14646 : can memcmp be trusted to compare relative magnitude?
14648 case "$d_memcmp" in
14651 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14653 #$i_memory I_MEMORY
14654 #$i_stdlib I_STDLIB
14655 #$i_string I_STRING
14656 #$i_unistd I_UNISTD
14658 $cat >>try.c <<'EOCP'
14661 # include <memory.h>
14664 # include <stdlib.h>
14667 # include <string.h>
14669 # include <strings.h>
14672 # include <unistd.h> /* Needed for NetBSD */
14678 if ((a < b) && memcmp(&a, &b, 1) < 0)
14684 if eval $compile_ok; then
14685 if $run ./try 2>/dev/null; then
14686 echo "Yes, it can."
14689 echo "No, it can't (it uses signed chars)."
14692 echo "(I can't compile the test program, so we'll assume not...)"
14696 $rm -f try.* try core
14700 : see if prototype for sbrk is available
14702 set d_sbrkproto sbrk $i_unistd unistd.h
14705 : see if select exists
14706 set select d_select
14709 : see if semctl exists
14710 set semctl d_semctl
14713 : see if semget exists
14714 set semget d_semget
14717 : see if semop exists
14721 : see how much of the 'sem*(2)' library is present.
14724 case "$d_semctl$d_semget$d_semop" in
14725 *"$undef"*) h_sem=false;;
14729 case "`ipcs 2>&1`" in
14730 "SVID messages"*"not configured"*)
14731 echo "Your $osname does not have the sem*(2) configured." >&4
14734 set semctl d_semctl
14736 set semget d_semget
14744 : we could also check for sys/ipc.h ...
14745 if $h_sem && $test `./findhdr sys/sem.h`; then
14746 echo "You have the full sem*(2) library." >&4
14749 echo "You don't have the full sem*(2) library." >&4
14755 : see whether sys/sem.h defines union semun
14757 $cat > try.c <<'END'
14758 #include <sys/types.h>
14759 #include <sys/ipc.h>
14760 #include <sys/sem.h>
14761 int main () { union semun semun; semun.buf = 0; }
14764 if eval $compile; then
14765 echo "You have union semun in <sys/sem.h>." >&4
14768 echo "You do not have union semun in <sys/sem.h>." >&4
14771 $rm -f try try.c try.h
14775 : see how to do semctl IPC_STAT
14778 : see whether semctl IPC_STAT can use union semun
14783 # define S_IRUSR S_IREAD
14784 # define S_IWUSR S_IWRITE
14785 # define S_IXUSR S_IEXEC
14787 # define S_IRUSR 0400
14788 # define S_IWUSR 0200
14789 # define S_IXUSR 0100
14791 # define S_IRGRP (S_IRUSR>>3)
14792 # define S_IWGRP (S_IWUSR>>3)
14793 # define S_IXGRP (S_IXUSR>>3)
14794 # define S_IROTH (S_IRUSR>>6)
14795 # define S_IWOTH (S_IWUSR>>6)
14796 # define S_IXOTH (S_IXUSR>>6)
14799 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14800 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14801 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14806 #include <sys/types.h>
14807 #include <sys/ipc.h>
14808 #include <sys/sem.h>
14809 #include <sys/stat.h>
14816 #$d_union_semun HAS_UNION_SEMUN
14819 #ifndef HAS_UNION_SEMUN
14822 struct semid_ds *buf;
14823 unsigned short *array;
14829 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14830 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14832 struct semid_ds argbuf;
14835 st = semctl(sem, 0, IPC_STAT, arg);
14839 # endif /* IPC_STAT */
14840 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14842 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14843 # endif /* IPC_RMID */
14844 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14846 #endif /* IPC_PRIVATE && ... */
14847 printf("semget failed: errno = %d\n", errno);
14853 if eval $compile; then
14856 semun) val="$define" ;;
14862 case "$d_semctl_semun" in
14864 echo "You can use union semun for semctl IPC_STAT." >&4
14867 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14872 : see whether semctl IPC_STAT can use struct semid_ds pointer
14873 $cat > try.c <<'END'
14874 #include <sys/types.h>
14875 #include <sys/ipc.h>
14876 #include <sys/sem.h>
14877 #include <sys/stat.h>
14885 struct semid_ds arg;
14888 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14889 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14892 st = semctl(sem, 0, IPC_STAT, &arg);
14894 printf("semid_ds\n");
14896 # endif /* IPC_STAT */
14897 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14899 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14900 # endif /* IPC_RMID */
14901 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14903 #endif /* IPC_PRIVATE && ... */
14904 printf("semget failed: errno = %d\n", errno);
14911 if eval $compile; then
14914 semid_ds) val="$define" ;;
14918 set d_semctl_semid_ds
14920 case "$d_semctl_semid_ds" in
14922 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14924 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14931 # We do not have the full sem*(2) library, so assume we can not
14937 set d_semctl_semid_ds
14942 : see if sendmsg exists
14943 set sendmsg d_sendmsg
14946 : see if setegid exists
14947 set setegid d_setegid
14950 : see if seteuid exists
14951 set seteuid d_seteuid
14954 : see if setgrent exists
14955 set setgrent d_setgrent
14958 : see if setgrent_r exists
14959 set setgrent_r d_setgrent_r
14961 case "$d_setgrent_r" in
14963 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14964 case "$d_setgrent_r_proto:$usethreads" in
14965 ":define") d_setgrent_r_proto=define
14966 set d_setgrent_r_proto setgrent_r $hdrs
14970 case "$d_setgrent_r_proto" in
14972 case "$setgrent_r_proto" in
14973 ''|0) try='int setgrent_r(FILE**);'
14974 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
14976 case "$setgrent_r_proto" in
14977 ''|0) try='void setgrent_r(FILE**);'
14978 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
14980 case "$setgrent_r_proto" in
14981 ''|0) d_setgrent_r=undef
14983 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
14984 * ) case "$setgrent_r_proto" in
14985 REENTRANT_PROTO*) ;;
14986 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
14988 echo "Prototype: $try" ;;
14991 *) case "$usethreads" in
14992 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
14999 *) setgrent_r_proto=0
15003 : see if sethostent exists
15004 set sethostent d_sethent
15007 : see if sethostent_r exists
15008 set sethostent_r d_sethostent_r
15010 case "$d_sethostent_r" in
15012 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15013 case "$d_sethostent_r_proto:$usethreads" in
15014 ":define") d_sethostent_r_proto=define
15015 set d_sethostent_r_proto sethostent_r $hdrs
15019 case "$d_sethostent_r_proto" in
15021 case "$sethostent_r_proto" in
15022 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15023 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15025 case "$sethostent_r_proto" in
15026 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15027 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15029 case "$sethostent_r_proto" in
15030 ''|0) d_sethostent_r=undef
15031 sethostent_r_proto=0
15032 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15033 * ) case "$sethostent_r_proto" in
15034 REENTRANT_PROTO*) ;;
15035 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15037 echo "Prototype: $try" ;;
15040 *) case "$usethreads" in
15041 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15043 d_sethostent_r=undef
15044 sethostent_r_proto=0
15048 *) sethostent_r_proto=0
15052 : see if setitimer exists
15053 set setitimer d_setitimer
15056 : see if setlinebuf exists
15057 set setlinebuf d_setlinebuf
15060 : see if setlocale exists
15061 set setlocale d_setlocale
15064 : see if locale.h is available
15065 set locale.h i_locale
15068 : see if setlocale_r exists
15069 set setlocale_r d_setlocale_r
15071 case "$d_setlocale_r" in
15073 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15074 case "$d_setlocale_r_proto:$usethreads" in
15075 ":define") d_setlocale_r_proto=define
15076 set d_setlocale_r_proto setlocale_r $hdrs
15080 case "$d_setlocale_r_proto" in
15082 case "$setlocale_r_proto" in
15083 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15084 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15086 case "$setlocale_r_proto" in
15087 ''|0) d_setlocale_r=undef
15088 setlocale_r_proto=0
15089 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15090 * ) case "$setlocale_r_proto" in
15091 REENTRANT_PROTO*) ;;
15092 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15094 echo "Prototype: $try" ;;
15097 *) case "$usethreads" in
15098 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
15100 d_setlocale_r=undef
15101 setlocale_r_proto=0
15105 *) setlocale_r_proto=0
15109 : see if setnetent exists
15110 set setnetent d_setnent
15113 : see if setnetent_r exists
15114 set setnetent_r d_setnetent_r
15116 case "$d_setnetent_r" in
15118 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15119 case "$d_setnetent_r_proto:$usethreads" in
15120 ":define") d_setnetent_r_proto=define
15121 set d_setnetent_r_proto setnetent_r $hdrs
15125 case "$d_setnetent_r_proto" in
15127 case "$setnetent_r_proto" in
15128 ''|0) try='int setnetent_r(int, struct netent_data*);'
15129 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
15131 case "$setnetent_r_proto" in
15132 ''|0) try='void setnetent_r(int, struct netent_data*);'
15133 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
15135 case "$setnetent_r_proto" in
15136 ''|0) d_setnetent_r=undef
15137 setnetent_r_proto=0
15138 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
15139 * ) case "$setnetent_r_proto" in
15140 REENTRANT_PROTO*) ;;
15141 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
15143 echo "Prototype: $try" ;;
15146 *) case "$usethreads" in
15147 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
15149 d_setnetent_r=undef
15150 setnetent_r_proto=0
15154 *) setnetent_r_proto=0
15158 : see if setprotoent exists
15159 set setprotoent d_setpent
15162 : see if setpgid exists
15163 set setpgid d_setpgid
15166 : see if setpgrp2 exists
15167 set setpgrp2 d_setpgrp2
15170 : see if setpriority exists
15171 set setpriority d_setprior
15174 : see if setproctitle exists
15175 set setproctitle d_setproctitle
15178 : see if setprotoent_r exists
15179 set setprotoent_r d_setprotoent_r
15181 case "$d_setprotoent_r" in
15183 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15184 case "$d_setprotoent_r_proto:$usethreads" in
15185 ":define") d_setprotoent_r_proto=define
15186 set d_setprotoent_r_proto setprotoent_r $hdrs
15190 case "$d_setprotoent_r_proto" in
15192 case "$setprotoent_r_proto" in
15193 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
15194 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
15196 case "$setprotoent_r_proto" in
15197 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
15198 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
15200 case "$setprotoent_r_proto" in
15201 ''|0) d_setprotoent_r=undef
15202 setprotoent_r_proto=0
15203 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
15204 * ) case "$setprotoent_r_proto" in
15205 REENTRANT_PROTO*) ;;
15206 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
15208 echo "Prototype: $try" ;;
15211 *) case "$usethreads" in
15212 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
15214 d_setprotoent_r=undef
15215 setprotoent_r_proto=0
15219 *) setprotoent_r_proto=0
15223 : see if setpwent exists
15224 set setpwent d_setpwent
15227 : see if setpwent_r exists
15228 set setpwent_r d_setpwent_r
15230 case "$d_setpwent_r" in
15232 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15233 case "$d_setpwent_r_proto:$usethreads" in
15234 ":define") d_setpwent_r_proto=define
15235 set d_setpwent_r_proto setpwent_r $hdrs
15239 case "$d_setpwent_r_proto" in
15241 case "$setpwent_r_proto" in
15242 ''|0) try='int setpwent_r(FILE**);'
15243 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
15245 case "$setpwent_r_proto" in
15246 ''|0) try='void setpwent_r(FILE**);'
15247 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
15249 case "$setpwent_r_proto" in
15250 ''|0) d_setpwent_r=undef
15252 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
15253 * ) case "$setpwent_r_proto" in
15254 REENTRANT_PROTO*) ;;
15255 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
15257 echo "Prototype: $try" ;;
15260 *) case "$usethreads" in
15261 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
15268 *) setpwent_r_proto=0
15272 : see if setregid exists
15273 set setregid d_setregid
15275 set setresgid d_setresgid
15278 : see if setreuid exists
15279 set setreuid d_setreuid
15281 set setresuid d_setresuid
15284 : see if setrgid exists
15285 set setrgid d_setrgid
15288 : see if setruid exists
15289 set setruid d_setruid
15292 : see if setservent exists
15293 set setservent d_setsent
15296 : see if setservent_r exists
15297 set setservent_r d_setservent_r
15299 case "$d_setservent_r" in
15301 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15302 case "$d_setservent_r_proto:$usethreads" in
15303 ":define") d_setservent_r_proto=define
15304 set d_setservent_r_proto setservent_r $hdrs
15308 case "$d_setservent_r_proto" in
15310 case "$setservent_r_proto" in
15311 ''|0) try='int setservent_r(int, struct servent_data*);'
15312 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
15314 case "$setservent_r_proto" in
15315 ''|0) try='void setservent_r(int, struct servent_data*);'
15316 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
15318 case "$setservent_r_proto" in
15319 ''|0) d_setservent_r=undef
15320 setservent_r_proto=0
15321 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
15322 * ) case "$setservent_r_proto" in
15323 REENTRANT_PROTO*) ;;
15324 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
15326 echo "Prototype: $try" ;;
15329 *) case "$usethreads" in
15330 define) echo "setservent_r has no prototype, not using it." >&4 ;;
15332 d_setservent_r=undef
15333 setservent_r_proto=0
15337 *) setservent_r_proto=0
15341 : see if setsid exists
15342 set setsid d_setsid
15345 : see if setvbuf exists
15346 set setvbuf d_setvbuf
15349 : see if sfio.h is available
15354 : see if sfio library is available
15365 : Ok, but do we want to use it.
15369 true|$define|[yY]*) dflt='y';;
15372 echo "$package can use the sfio library, but it is experimental."
15373 case "$useperlio" in
15375 echo "For sfio also the PerlIO abstraction layer is needed."
15376 echo "Earlier you said you wouldn't want that."
15379 rp="You seem to have sfio available, do you want to try using it?"
15382 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
15383 useperlio="$define"
15386 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
15391 *) case "$usesfio" in
15392 true|$define|[yY]*)
15393 echo "Sorry, cannot find sfio on this machine." >&4
15394 echo "Ignoring your setting of usesfio=$usesfio." >&4
15403 $define) usesfio='true';;
15404 *) usesfio='false';;
15408 *) : Remove sfio from list of libraries to use
15411 echo "Removing unneeded -lsfio from library list" >&4
15412 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
15415 echo "libs = $libs" >&4
15422 : see if shmctl exists
15423 set shmctl d_shmctl
15426 : see if shmget exists
15427 set shmget d_shmget
15430 : see if shmat exists
15433 : see what shmat returns
15436 $cat >shmat.c <<'END'
15437 #include <sys/shm.h>
15440 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
15445 echo "and it returns ($shmattype)." >&4
15446 : see if a prototype for shmat is available
15447 xxx=`./findhdr sys/shm.h`
15448 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
15449 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
15460 set d_shmatprototype
15463 : see if shmdt exists
15467 : see how much of the 'shm*(2)' library is present.
15470 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
15471 *"$undef"*) h_shm=false;;
15475 case "`ipcs 2>&1`" in
15476 "SVID shared memory"*"not configured"*)
15477 echo "Your $osname does not have the shm*(2) configured." >&4
15480 set shmctl d_shmctl
15482 set shmget d_shmget
15492 : we could also check for sys/ipc.h ...
15493 if $h_shm && $test `./findhdr sys/shm.h`; then
15494 echo "You have the full shm*(2) library." >&4
15497 echo "You don't have the full shm*(2) library." >&4
15504 : see if we have sigaction
15505 if set sigaction val -f d_sigaction; eval $csym; $val; then
15506 echo 'sigaction() found.' >&4
15507 $cat > try.c <<'EOP'
15509 #include <sys/types.h>
15510 #include <signal.h>
15513 struct sigaction act, oact;
15515 oact.sa_handler = 0;
15516 /* so that act and oact are used */
15517 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15521 if eval $compile_ok; then
15524 echo "But you don't seem to have a useable struct sigaction." >&4
15528 echo 'sigaction NOT found.' >&4
15531 set d_sigaction; eval $setvar
15532 $rm -f try try$_o try.c
15534 : see if sigprocmask exists
15535 set sigprocmask d_sigprocmask
15538 : see if sigsetjmp exists
15540 case "$d_sigsetjmp" in
15542 $cat >try.c <<'EOP'
15543 #include <setjmp.h>
15548 if (sigsetjmp(env,1))
15551 siglongjmp(env, 1);
15556 if eval $compile; then
15557 if $run ./try >/dev/null 2>&1; then
15558 echo "POSIX sigsetjmp found." >&4
15562 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15568 echo "sigsetjmp not found." >&4
15572 *) val="$d_sigsetjmp"
15573 case "$d_sigsetjmp" in
15574 $define) echo "POSIX sigsetjmp found." >&4;;
15575 $undef) echo "sigsetjmp not found." >&4;;
15583 : see if sockatmark exists
15584 set sockatmark d_sockatmark
15587 : see if prototype for sockatmark is available
15589 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15592 : see if socks5_init exists
15593 set socks5_init d_socks5_init
15596 : see if srand48_r exists
15597 set srand48_r d_srand48_r
15599 case "$d_srand48_r" in
15601 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15602 case "$d_srand48_r_proto:$usethreads" in
15603 ":define") d_srand48_r_proto=define
15604 set d_srand48_r_proto srand48_r $hdrs
15608 case "$d_srand48_r_proto" in
15610 case "$srand48_r_proto" in
15611 ''|0) try='int srand48_r(long, struct drand48_data*);'
15612 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15614 case "$srand48_r_proto" in
15615 ''|0) d_srand48_r=undef
15617 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15618 * ) case "$srand48_r_proto" in
15619 REENTRANT_PROTO*) ;;
15620 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15622 echo "Prototype: $try" ;;
15625 *) case "$usethreads" in
15626 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15633 *) srand48_r_proto=0
15637 : see if srandom_r exists
15638 set srandom_r d_srandom_r
15640 case "$d_srandom_r" in
15642 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15643 case "$d_srandom_r_proto:$usethreads" in
15644 ":define") d_srandom_r_proto=define
15645 set d_srandom_r_proto srandom_r $hdrs
15649 case "$d_srandom_r_proto" in
15651 case "$srandom_r_proto" in
15652 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15653 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15655 case "$srandom_r_proto" in
15656 ''|0) d_srandom_r=undef
15658 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15659 * ) case "$srandom_r_proto" in
15660 REENTRANT_PROTO*) ;;
15661 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15663 echo "Prototype: $try" ;;
15666 *) case "$usethreads" in
15667 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15674 *) srandom_r_proto=0
15678 : see if prototype for setresgid is available
15680 set d_sresgproto setresgid $i_unistd unistd.h
15683 : see if prototype for setresuid is available
15685 set d_sresuproto setresuid $i_unistd unistd.h
15688 : see if sys/stat.h is available
15689 set sys/stat.h i_sysstat
15693 : see if stat knows about block sizes
15695 echo "Checking to see if your struct stat has st_blocks field..." >&4
15696 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15700 : see if this is a sys/vfs.h system
15701 set sys/vfs.h i_sysvfs
15705 : see if this is a sys/statfs.h system
15706 set sys/statfs.h i_sysstatfs
15711 echo "Checking to see if your system supports struct statfs..." >&4
15712 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
15714 case "$d_statfs_s" in
15715 "$define") echo "Yes, it does." ;;
15716 *) echo "No, it doesn't." ;;
15721 : see if struct statfs knows about f_flags
15722 case "$d_statfs_s" in
15725 echo "Checking to see if your struct statfs has f_flags field..." >&4
15726 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
15730 set d_statfs_f_flags
15734 case "$d_statfs_f_flags" in
15735 "$define") echo "Yes, it does." ;;
15736 *) echo "No, it doesn't." ;;
15739 : see if _ptr and _cnt from stdio act std
15742 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15743 echo "(Looks like you have stdio.h from BSD.)"
15744 case "$stdio_ptr" in
15745 '') stdio_ptr='((fp)->_p)'
15748 *) ptr_lval=$d_stdio_ptr_lval;;
15750 case "$stdio_cnt" in
15751 '') stdio_cnt='((fp)->_r)'
15754 *) cnt_lval=$d_stdio_cnt_lval;;
15756 case "$stdio_base" in
15757 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15759 case "$stdio_bufsiz" in
15760 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15762 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15763 echo "(Looks like you have stdio.h from Linux.)"
15764 case "$stdio_ptr" in
15765 '') stdio_ptr='((fp)->_IO_read_ptr)'
15768 *) ptr_lval=$d_stdio_ptr_lval;;
15770 case "$stdio_cnt" in
15771 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15774 *) cnt_lval=$d_stdio_cnt_lval;;
15776 case "$stdio_base" in
15777 '') stdio_base='((fp)->_IO_read_base)';;
15779 case "$stdio_bufsiz" in
15780 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15783 case "$stdio_ptr" in
15784 '') stdio_ptr='((fp)->_ptr)'
15787 *) ptr_lval=$d_stdio_ptr_lval;;
15789 case "$stdio_cnt" in
15790 '') stdio_cnt='((fp)->_cnt)'
15793 *) cnt_lval=$d_stdio_cnt_lval;;
15795 case "$stdio_base" in
15796 '') stdio_base='((fp)->_base)';;
15798 case "$stdio_bufsiz" in
15799 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15803 : test whether _ptr and _cnt really work
15804 echo "Checking how std your stdio is..." >&4
15807 #define FILE_ptr(fp) $stdio_ptr
15808 #define FILE_cnt(fp) $stdio_cnt
15810 FILE *fp = fopen("try.c", "r");
15813 18 <= FILE_cnt(fp) &&
15814 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15822 if eval $compile && $to try.c; then
15823 if $run ./try; then
15824 echo "Your stdio acts pretty std."
15827 echo "Your stdio isn't very std."
15830 echo "Your stdio doesn't appear very std."
15834 # glibc 2.2.90 and above apparently change stdio streams so Perl's
15835 # direct buffer manipulation no longer works. The Configure tests
15836 # should be changed to correctly detect this, but until then,
15837 # the following check should at least let perl compile and run.
15838 # (This quick fix should be updated before 5.8.1.)
15839 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
15840 # A. Dougherty, June 3, 2002.
15841 case "$d_gnulibc" in
15843 case "$gnulibc_version" in
15847 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
15856 : Can _ptr be used as an lvalue?
15857 case "$d_stdstdio$ptr_lval" in
15858 $define$define) val=$define ;;
15861 set d_stdio_ptr_lval
15864 : Can _cnt be used as an lvalue?
15865 case "$d_stdstdio$cnt_lval" in
15866 $define$define) val=$define ;;
15869 set d_stdio_cnt_lval
15873 : test whether setting _ptr sets _cnt as a side effect
15874 d_stdio_ptr_lval_sets_cnt="$undef"
15875 d_stdio_ptr_lval_nochange_cnt="$undef"
15876 case "$d_stdio_ptr_lval$d_stdstdio" in
15878 echo "Checking to see what happens if we set the stdio ptr..." >&4
15881 /* Can we scream? */
15882 /* Eat dust sed :-) */
15883 /* In the buffer space, no one can hear you scream. */
15884 #define FILE_ptr(fp) $stdio_ptr
15885 #define FILE_cnt(fp) $stdio_cnt
15886 #include <sys/types.h>
15888 FILE *fp = fopen("try.c", "r");
15893 puts("Fail even to read");
15896 c = getc(fp); /* Read away the first # */
15898 puts("Fail even to read");
15902 18 <= FILE_cnt(fp) &&
15903 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15905 puts("Fail even to read");
15908 ptr = (char*) FILE_ptr(fp);
15909 cnt = (size_t)FILE_cnt(fp);
15911 FILE_ptr(fp) += 42;
15913 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15914 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15917 if (FILE_cnt(fp) <= 20) {
15918 printf ("Fail (<20 chars to test)");
15921 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15922 puts("Fail compare");
15925 if (cnt == FILE_cnt(fp)) {
15926 puts("Pass_unchanged");
15929 if (FILE_cnt(fp) == (cnt - 42)) {
15930 puts("Pass_changed");
15933 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15939 if eval $compile && $to try.c; then
15940 case `$run ./try` in
15942 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15943 d_stdio_ptr_lval_sets_cnt="$define" ;;
15945 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
15946 d_stdio_ptr_lval_nochange_cnt="$define" ;;
15948 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
15950 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
15953 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
15959 : see if _base is also standard
15961 case "$d_stdstdio" in
15965 #define FILE_base(fp) $stdio_base
15966 #define FILE_bufsiz(fp) $stdio_bufsiz
15968 FILE *fp = fopen("try.c", "r");
15971 19 <= FILE_bufsiz(fp) &&
15972 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
15979 if eval $compile && $to try.c; then
15980 if $run ./try; then
15981 echo "And its _base field acts std."
15984 echo "But its _base field isn't std."
15987 echo "However, it seems to be lacking the _base field."
15996 Checking how to access stdio streams by file descriptor number...
15998 case "$stdio_stream_array" in
15999 '') $cat >try.c <<EOCP
16002 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16006 for s in _iob __iob __sF
16008 set try -DSTDIO_STREAM_ARRAY=$s
16009 if eval $compile; then
16010 case "`$run ./try`" in
16011 yes) stdio_stream_array=$s; break ;;
16015 $rm -f try.* try$exe_ext
16017 case "$stdio_stream_array" in
16019 I can't figure out how to access stdio streams by file descriptor number.
16021 d_stdio_stream_array="$undef"
16024 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16026 d_stdio_stream_array="$define"
16030 : see if strcoll exists
16031 set strcoll d_strcoll
16034 : check for structure copying
16036 echo "Checking to see if your C compiler can copy structs..." >&4
16037 $cat >try.c <<'EOCP'
16047 if $cc -c try.c >/dev/null 2>&1 ; then
16049 echo "Yup, it can."
16052 echo "Nope, it can't."
16058 : see if strerror and/or sys_errlist[] exist
16060 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16061 if set strerror val -f d_strerror; eval $csym; $val; then
16062 echo 'strerror() found.' >&4
16063 d_strerror="$define"
16064 d_strerrm='strerror(e)'
16065 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16066 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16067 d_syserrlst="$define"
16069 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16070 d_syserrlst="$undef"
16072 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16073 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16074 echo 'strerror() found in string header.' >&4
16075 d_strerror="$define"
16076 d_strerrm='strerror(e)'
16077 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16078 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16079 d_syserrlst="$define"
16081 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16082 d_syserrlst="$undef"
16084 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16085 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16086 d_strerror="$undef"
16087 d_syserrlst="$define"
16088 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16090 echo 'strerror() and sys_errlist[] NOT found.' >&4
16091 d_strerror="$undef"
16092 d_syserrlst="$undef"
16093 d_strerrm='"unknown"'
16097 : see if strerror_r exists
16098 set strerror_r d_strerror_r
16100 case "$d_strerror_r" in
16102 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16103 case "$d_strerror_r_proto:$usethreads" in
16104 ":define") d_strerror_r_proto=define
16105 set d_strerror_r_proto strerror_r $hdrs
16109 case "$d_strerror_r_proto" in
16111 case "$strerror_r_proto" in
16112 ''|0) try='int strerror_r(int, char*, size_t);'
16113 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16115 case "$strerror_r_proto" in
16116 ''|0) try='int strerror_r(int, char*, int);'
16117 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16119 case "$strerror_r_proto" in
16120 ''|0) try='char* strerror_r(int, char*, size_t);'
16121 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16123 case "$strerror_r_proto" in
16124 ''|0) d_strerror_r=undef
16126 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16127 * ) case "$strerror_r_proto" in
16128 REENTRANT_PROTO*) ;;
16129 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16131 echo "Prototype: $try" ;;
16134 *) case "$usethreads" in
16135 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16142 *) strerror_r_proto=0
16146 : see if strftime exists
16147 set strftime d_strftime
16150 : see if strtod exists
16151 set strtod d_strtod
16154 : see if strtol exists
16155 set strtol d_strtol
16158 : see if strtold exists
16159 set strtold d_strtold
16162 : see if strtoll exists
16163 set strtoll d_strtoll
16166 case "$d_longlong-$d_strtoll" in
16169 Checking whether your strtoll() works okay...
16171 $cat >try.c <<'EOCP'
16174 #define strtoll __strtoll
16177 #define strtoll _strtoll
16180 extern long long int strtoll(char *s, char **, int);
16181 static int bad = 0;
16182 int check(char *s, long long ell, int een) {
16185 gll = strtoll(s, 0, 10);
16186 if (!((gll == ell) && (errno == een)))
16190 check(" 1", 1LL, 0);
16191 check(" 0", 0LL, 0);
16192 check("-1", -1LL, 0);
16193 check("-9223372036854775808", -9223372036854775808LL, 0);
16194 check("-9223372036854775808", -9223372036854775808LL, 0);
16195 check(" 9223372036854775807", 9223372036854775807LL, 0);
16196 check("-9223372036854775808", -9223372036854775808LL, 0);
16197 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16198 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16204 if eval $compile; then
16207 ok) echo "Your strtoll() seems to be working okay." ;;
16209 Your strtoll() doesn't seem to be working okay.
16215 echo "(I can't seem to compile the test program--assuming it doesn't)"
16221 : see if strtoq exists
16222 set strtoq d_strtoq
16225 : see if strtoul exists
16226 set strtoul d_strtoul
16229 case "$d_strtoul" in
16232 Checking whether your strtoul() works okay...
16234 $cat >try.c <<'EOCP'
16237 extern unsigned long int strtoul(char *s, char **, int);
16238 static int bad = 0;
16239 void check(char *s, unsigned long eul, int een) {
16242 gul = strtoul(s, 0, 10);
16243 if (!((gul == eul) && (errno == een)))
16247 check(" 1", 1L, 0);
16248 check(" 0", 0L, 0);
16250 case "$longsize" in
16252 $cat >>try.c <<'EOCP'
16253 check("18446744073709551615", 18446744073709551615UL, 0);
16254 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16255 #if 0 /* strtoul() for /^-/ strings is undefined. */
16256 check("-1", 18446744073709551615UL, 0);
16257 check("-18446744073709551614", 2, 0);
16258 check("-18446744073709551615", 1, 0);
16259 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16260 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16265 $cat >>try.c <<'EOCP'
16266 check("4294967295", 4294967295UL, 0);
16267 check("4294967296", 4294967295UL, ERANGE);
16268 #if 0 /* strtoul() for /^-/ strings is undefined. */
16269 check("-1", 4294967295UL, 0);
16270 check("-4294967294", 2, 0);
16271 check("-4294967295", 1, 0);
16272 check("-4294967296", 4294967295UL, ERANGE);
16273 check("-4294967297", 4294967295UL, ERANGE);
16278 : Should we write these tests to be more portable by sprintf-ing
16279 : ~0 and then manipulating that char string as input for strtol?
16282 $cat >>try.c <<'EOCP'
16289 if eval $compile; then
16290 case "`$run ./try`" in
16291 ok) echo "Your strtoul() seems to be working okay." ;;
16293 Your strtoul() doesn't seem to be working okay.
16302 : see if strtoull exists
16303 set strtoull d_strtoull
16306 case "$d_longlong-$d_strtoull" in
16309 Checking whether your strtoull() works okay...
16311 $cat >try.c <<'EOCP'
16314 #define strtoull __strtoull
16317 extern unsigned long long int strtoull(char *s, char **, int);
16318 static int bad = 0;
16319 int check(char *s, long long eull, int een) {
16322 gull = strtoull(s, 0, 10);
16323 if (!((gull == eull) && (errno == een)))
16327 check(" 1", 1LL, 0);
16328 check(" 0", 0LL, 0);
16329 check("18446744073709551615", 18446744073709551615ULL, 0);
16330 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16331 #if 0 /* strtoull() for /^-/ strings is undefined. */
16332 check("-1", 18446744073709551615ULL, 0);
16333 check("-18446744073709551614", 2LL, 0);
16334 check("-18446744073709551615", 1LL, 0);
16335 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16336 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16343 if eval $compile; then
16344 case "`$run ./try`" in
16345 ok) echo "Your strtoull() seems to be working okay." ;;
16347 Your strtoull() doesn't seem to be working okay.
16349 d_strtoull="$undef"
16356 : see if strtouq exists
16357 set strtouq d_strtouq
16360 case "$d_strtouq" in
16363 Checking whether your strtouq() works okay...
16365 $cat >try.c <<'EOCP'
16368 extern unsigned long long int strtouq(char *s, char **, int);
16369 static int bad = 0;
16370 void check(char *s, unsigned long long eull, int een) {
16371 unsigned long long gull;
16373 gull = strtouq(s, 0, 10);
16374 if (!((gull == eull) && (errno == een)))
16378 check(" 1", 1LL, 0);
16379 check(" 0", 0LL, 0);
16380 check("18446744073709551615", 18446744073709551615ULL, 0);
16381 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16382 #if 0 /* strtouq() for /^-/ strings is undefined. */
16383 check("-1", 18446744073709551615ULL, 0);
16384 check("-18446744073709551614", 2LL, 0);
16385 check("-18446744073709551615", 1LL, 0);
16386 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16387 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16395 if eval $compile; then
16396 case "`$run ./try`" in
16397 ok) echo "Your strtouq() seems to be working okay." ;;
16399 Your strtouq() doesn't seem to be working okay.
16408 : see if strxfrm exists
16409 set strxfrm d_strxfrm
16412 : see if symlink exists
16413 set symlink d_symlink
16416 : see if syscall exists
16417 set syscall d_syscall
16420 : see if prototype for syscall is available
16422 set d_syscallproto syscall $i_unistd unistd.h
16425 : see if sysconf exists
16426 set sysconf d_sysconf
16429 : see if system exists
16430 set system d_system
16433 : see if tcgetpgrp exists
16434 set tcgetpgrp d_tcgetpgrp
16437 : see if tcsetpgrp exists
16438 set tcsetpgrp d_tcsetpgrp
16441 : see if prototype for telldir is available
16443 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
16446 : see if time exists
16448 if test "X$d_time" = X -o X"$timetype" = X; then
16449 if set time val -f d_time; eval $csym; $val; then
16450 echo 'time() found.' >&4
16452 rp="What is the type returned by time() on this system?"
16453 set time_t timetype long stdio.h sys/types.h
16456 echo 'time() not found, hope that will do.' >&4
16464 : see if this is a sys/times.h system
16465 set sys/times.h i_systimes
16468 : see if times exists
16470 if set times val -f d_times; eval $csym; $val; then
16471 echo 'times() found.' >&4
16474 case "$i_systimes" in
16475 "$define") inc='sys/times.h';;
16477 rp="What is the type returned by times() on this system?"
16478 set clock_t clocktype long stdio.h sys/types.h $inc
16481 echo 'times() NOT found, hope that will do.' >&4
16486 : see if tmpnam_r exists
16487 set tmpnam_r d_tmpnam_r
16489 case "$d_tmpnam_r" in
16491 hdrs="$i_systypes sys/types.h define stdio.h "
16492 case "$d_tmpnam_r_proto:$usethreads" in
16493 ":define") d_tmpnam_r_proto=define
16494 set d_tmpnam_r_proto tmpnam_r $hdrs
16498 case "$d_tmpnam_r_proto" in
16500 case "$tmpnam_r_proto" in
16501 ''|0) try='char* tmpnam_r(char*);'
16502 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16504 case "$tmpnam_r_proto" in
16505 ''|0) d_tmpnam_r=undef
16507 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16508 * ) case "$tmpnam_r_proto" in
16509 REENTRANT_PROTO*) ;;
16510 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16512 echo "Prototype: $try" ;;
16515 *) case "$usethreads" in
16516 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16523 *) tmpnam_r_proto=0
16527 : see if truncate exists
16528 set truncate d_truncate
16531 : see if ttyname_r exists
16532 set ttyname_r d_ttyname_r
16534 case "$d_ttyname_r" in
16536 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16537 case "$d_ttyname_r_proto:$usethreads" in
16538 ":define") d_ttyname_r_proto=define
16539 set d_ttyname_r_proto ttyname_r $hdrs
16543 case "$d_ttyname_r_proto" in
16545 case "$ttyname_r_proto" in
16546 ''|0) try='int ttyname_r(int, char*, size_t);'
16547 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16549 case "$ttyname_r_proto" in
16550 ''|0) try='int ttyname_r(int, char*, int);'
16551 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16553 case "$ttyname_r_proto" in
16554 ''|0) try='char* ttyname_r(int, char*, int);'
16555 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16557 case "$ttyname_r_proto" in
16558 ''|0) d_ttyname_r=undef
16560 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16561 * ) case "$ttyname_r_proto" in
16562 REENTRANT_PROTO*) ;;
16563 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16565 echo "Prototype: $try" ;;
16568 *) case "$usethreads" in
16569 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16576 *) ttyname_r_proto=0
16580 : see if tzname[] exists
16582 if set tzname val -a d_tzname; eval $csym; $val; then
16584 echo 'tzname[] found.' >&4
16587 echo 'tzname[] NOT found.' >&4
16593 next|rhapsody|darwin) multiarch="$define" ;;
16595 case "$multiarch" in
16596 ''|[nN]*) multiarch="$undef" ;;
16599 : check for ordering of bytes in a UV
16601 case "$usecrosscompile$multiarch" in
16604 You seem to be either cross-compiling or doing a multiarchitecture build,
16605 skipping the byteorder check.
16611 case "$byteorder" in
16614 In the following, larger digits indicate more significance. A big-endian
16615 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16616 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16617 machines may have weird orders like 3412. A Cray will report 87654321,
16618 an Alpha will report 12345678. If the test program works the default is
16620 I'm now running the test program...
16624 #include <sys/types.h>
16625 typedef $uvtype UV;
16635 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16637 u.l = (UV)0x04030201;
16638 for (i = 0; i < $uvsize; i++)
16639 printf("%c", u.c[i]+'0');
16646 if eval $compile && ./try > /dev/null; then
16649 [1-4][1-4][1-4][1-4]|12345678|87654321)
16650 echo "(The test program ran ok.)"
16651 echo "byteorder=$dflt"
16654 ????|????????) echo "(The test program ran ok.)" ;;
16655 *) echo "(The test program didn't run right for some reason.)" ;;
16660 (I can't seem to compile the test program. Guessing big-endian...)
16663 case "$xxx_prompt" in
16665 rp="What is the order of bytes in $uvtype?"
16681 Checking to see whether you can access character data unalignedly...
16683 case "$d_u32align" in
16684 '') $cat >try.c <<EOCP
16686 #define U32 $u32type
16687 #define BYTEORDER 0x$byteorder
16689 #include <signal.h>
16691 $signal_t bletch(s) int s; { exit(4); }
16694 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16699 if (sizeof(U32) != 4) {
16700 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16707 signal(SIGBUS, bletch);
16719 for (i = 0; i < 4; i++) {
16720 up = (U32*)(buf + i);
16721 if (! ((*up == 1 << (8*i)) || /* big-endian */
16722 (*up == 1 << (8*(3-i))) /* little-endian */
16726 printf("read failed (%x)\n", *up);
16732 for (i = 0; i < 4; i++) {
16733 up = (U32*)(buf + i);
16735 if (*up != 0xBeef) {
16736 printf("write failed (%x)\n", *up);
16750 if eval $compile_ok; then
16751 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16752 $run ./try 2>&1 >/dev/null
16755 You can access character data pretty unalignedly.
16757 d_u32align="$undef"
16760 It seems that you must access character data in an aligned manner.
16762 d_u32align="$define"
16766 rp='Can you access character data at unaligned addresses?'
16770 [yY]*) d_u32align="$undef" ;;
16771 *) d_u32align="$define" ;;
16774 $rm -f core core.try.* try.core
16778 : see if ualarm exists
16779 set ualarm d_ualarm
16782 : see if umask exists
16786 : see if unordered exists
16787 set unordered d_unordered
16790 : see if usleep exists
16791 set usleep d_usleep
16794 : see if prototype for usleep is available
16796 set d_usleepproto usleep $i_unistd unistd.h
16799 : see if ustat exists
16803 : backward compatibility for d_hvfork
16804 if test X$d_hvfork != X; then
16805 d_vfork="$d_hvfork"
16808 : see if there is a vfork
16813 : Ok, but do we want to use it. vfork is reportedly unreliable in
16814 : perl on Solaris 2.x, and probably elsewhere.
16818 case "$usevfork" in
16824 Perl can only use a vfork() that doesn't suffer from strict
16825 restrictions on calling functions or modifying global data in
16826 the child. For example, glibc-2.1 contains such a vfork()
16827 that is unsuitable. If your system provides a proper fork()
16828 call, chances are that you do NOT want perl to use vfork().
16831 rp="Do you still want to use vfork()?"
16836 echo "Ok, we won't use vfork()."
16845 $define) usevfork='true';;
16846 *) usevfork='false';;
16849 : see if closedir exists
16850 set closedir d_closedir
16853 case "$d_closedir" in
16856 echo "Checking whether closedir() returns a status..." >&4
16858 #$i_dirent I_DIRENT /**/
16859 #$i_sysdir I_SYS_DIR /**/
16860 #$i_sysndir I_SYS_NDIR /**/
16861 #$i_systypes I_SYS_TYPES /**/
16863 #if defined(I_SYS_TYPES)
16864 #include <sys/types.h>
16866 #if defined(I_DIRENT)
16867 #include <dirent.h>
16868 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16869 #include <sys/dir.h>
16873 #include <sys/ndir.h>
16877 #include <ndir.h> /* may be wrong in the future */
16879 #include <sys/dir.h>
16884 int main() { return closedir(opendir(".")); }
16887 if eval $compile_ok; then
16888 if $run ./try > /dev/null 2>&1 ; then
16889 echo "Yes, it does."
16892 echo "No, it doesn't."
16896 echo "(I can't seem to compile the test program--assuming it doesn't)"
16904 set d_void_closedir
16907 : see if there is a wait4
16911 : see if waitpid exists
16912 set waitpid d_waitpid
16915 : see if wcstombs exists
16916 set wcstombs d_wcstombs
16919 : see if wctomb exists
16920 set wctomb d_wctomb
16923 : see if writev exists
16924 set writev d_writev
16927 : preserve RCS keywords in files with variable substitution, grrr
16932 Revision='$Revision'
16934 : check for alignment requirements
16936 case "$usecrosscompile$multiarch" in
16939 You seem to be either cross-compiling or doing a multiarchitecture build,
16940 skipping the memory alignment check.
16943 case "$alignbytes" in
16944 '') alignbytes=8 ;;
16948 case "$alignbytes" in
16949 '') echo "Checking alignment constraints..." >&4
16950 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
16951 $cat >try.c <<'EOCP'
16952 typedef long double NV;
16955 $cat >try.c <<'EOCP'
16959 $cat >>try.c <<'EOCP'
16967 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
16972 if eval $compile_ok; then
16976 echo "(I can't seem to compile the test program...)"
16979 *) dflt="$alignbytes"
16982 rp="Doubles must be aligned on a how-many-byte boundary?"
16990 : set the base revision
16993 : how do we catenate cpp tokens here?
16995 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
16996 $cat >cpp_stuff.c <<'EOCP'
16997 #define RCAT(a,b)a/**/b
16998 #define ACAT(a,b)a ## b
17002 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17003 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17004 echo "Oh! Smells like ANSI's been here." >&4
17005 echo "We can catify or stringify, separately or together!"
17007 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17008 echo "Ah, yes! The good old days!" >&4
17009 echo "However, in the good old days we don't know how to stringify and"
17010 echo "catify at the same time."
17014 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
17015 to have to edit the values of CAT[2-5] in config.h...
17017 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17021 : see if this is a db.h system
17027 : Check db version.
17029 echo "Checking Berkeley DB version ..." >&4
17035 #include <sys/types.h>
17038 int main(int argc, char *argv[])
17040 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17041 int Major, Minor, Patch ;
17042 unsigned long Version ;
17043 (void)db_version(&Major, &Minor, &Patch) ;
17045 printf("%d %d %d %d %d %d\n",
17046 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17047 Major, Minor, Patch);
17050 printf("You have Berkeley DB Version 2 or greater.\n");
17052 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17053 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17054 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17055 Major, Minor, Patch) ;
17057 /* check that db.h & libdb are compatible */
17058 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17059 printf("db.h and libdb are incompatible.\n") ;
17063 printf("db.h and libdb are compatible.\n") ;
17065 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17066 + DB_VERSION_PATCH ;
17068 /* needs to be >= 2.3.4 */
17069 if (Version < 2003004) {
17070 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17071 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17077 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17082 printf("You have Berkeley DB Version 1.\n");
17083 exit(0); /* DB version < 2: the coast is clear. */
17085 exit(1); /* <db.h> not Berkeley DB? */
17091 if eval $compile_ok && $run ./try; then
17092 echo 'Looks OK.' >&4
17094 db_version_major=$1
17095 db_version_minor=$2
17096 db_version_patch=$3
17098 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17102 : Remove db from list of libraries to use
17103 echo "Removing unusable -ldb from library list" >&4
17104 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17107 echo "libs = $libs" >&4
17117 : Check the return type needed for hash
17119 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17125 #include <sys/types.h>
17128 #ifndef DB_VERSION_MAJOR
17129 u_int32_t hash_cb (ptr, size)
17137 info.hash = hash_cb;
17141 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17142 if $contains warning try.out >>/dev/null 2>&1 ; then
17145 db_hashtype='u_int32_t'
17148 : XXX Maybe we should just give up here.
17149 db_hashtype=u_int32_t
17151 echo "Help: I can't seem to compile the db test program." >&4
17152 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17155 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17157 *) db_hashtype=u_int32_t
17162 : Check the return type needed for prefix
17164 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17170 #include <sys/types.h>
17173 #ifndef DB_VERSION_MAJOR
17174 size_t prefix_cb (key1, key2)
17182 info.prefix = prefix_cb;
17186 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17187 if $contains warning try.out >>/dev/null 2>&1 ; then
17188 db_prefixtype='int'
17190 db_prefixtype='size_t'
17193 db_prefixtype='size_t'
17194 : XXX Maybe we should just give up here.
17196 echo "Help: I can't seem to compile the db test program." >&4
17197 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17200 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17202 *) db_prefixtype='size_t'
17207 : How can we generate normalized random numbers ?
17209 echo "Looking for a random number function..." >&4
17210 case "$randfunc" in
17212 if set drand48 val -f; eval $csym; $val; then
17214 echo "Good, found drand48()." >&4
17215 elif set random val -f; eval $csym; $val; then
17217 echo "OK, found random()." >&4
17220 echo "Yick, looks like I have to use rand()." >&4
17231 *-Dmy_rand=*|*-Dmy_srand=*)
17232 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17233 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17234 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17235 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17239 while $test "$cont"; do
17240 rp="Use which function to generate random numbers?"
17242 if $test "$ans" = "$dflt"; then
17248 if set $ans val -f; eval $csym; $val; then
17252 rp="I cannot find function $ans. Use that name anyway?"
17261 case "$randfunc" in
17263 drand01="drand48()"
17269 case "$randbits" in
17271 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17273 #$i_unistd I_UNISTD
17274 #$i_stdlib I_STDLIB
17277 # include <unistd.h>
17280 # include <stdlib.h>
17285 register unsigned long tmp;
17286 register unsigned long max = 0L;
17288 for (i = 1000; i; i--) {
17289 tmp = (unsigned long) $randfunc();
17290 if (tmp > max) max = tmp;
17292 for (i = 0; max; i++)
17298 if eval $compile_ok; then
17302 echo "(I can't seem to compile the test program...)"
17309 rp="How many bits does your $randfunc() function produce?"
17313 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17314 seedfunc="s$randfunc"
17315 randseedtype=unsigned
17319 rp="How many bits does your $randfunc() function produce?"
17322 seedfunc="s$randfunc"
17323 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17324 if set $seedfunc val -f; eval $csym; $val; then
17325 echo "(Using $seedfunc() to seed random generator)"
17327 echo "(Warning: no $seedfunc() to seed random generator)"
17330 randseedtype=unsigned
17338 echo "Determining whether or not we are on an EBCDIC system..." >&4
17339 $cat >try.c <<'EOM'
17342 if ('M'==0xd4) return 0;
17349 if eval $compile_ok; then
17350 if $run ./try; then
17351 echo "You seem to speak EBCDIC." >&4
17354 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
17357 echo "I'm unable to compile the test program." >&4
17358 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
17366 Checking how to flush all pending stdio output...
17368 # I only know how to find the first 32 possibly open files on SunOS.
17369 # See also hints/sunos_4_1.sh and util.c --AD
17371 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
17373 $cat >>try.c <<EOCP
17375 #$i_unistd I_UNISTD
17377 # include <unistd.h>
17379 #$d_sysconf HAS_SYSCONF
17380 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
17381 #ifdef HAS_STDIO_STREAM_ARRAY
17382 # define STDIO_STREAM_ARRAY $stdio_stream_array
17387 p = fopen("try.out", "w");
17391 # ifdef TRY_FPRINTF
17395 #ifdef TRY_FFLUSH_NULL
17398 #ifdef TRY_FFLUSH_ALL
17400 long open_max = -1;
17401 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
17402 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
17404 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
17405 open_max = sysconf(_SC_OPEN_MAX);
17408 open_max = FOPEN_MAX;
17411 open_max = OPEN_MAX;
17420 # ifdef HAS_STDIO_STREAM_ARRAY
17421 if (open_max > 0) {
17423 for (i = 0; i < open_max; i++)
17424 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
17425 STDIO_STREAM_ARRAY[i]._file < open_max &&
17426 STDIO_STREAM_ARRAY[i]._flag)
17427 fflush(&STDIO_STREAM_ARRAY[i]);
17435 : first we have to find out how _not_ to flush
17437 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
17439 set try -DTRY_FPUTC
17440 if eval $compile; then
17441 $run ./try 2>/dev/null
17444 if $test ! -s try.out -a "X$code" = X42; then
17450 set try -DTRY_FPRINTF
17451 if eval $compile; then
17452 $run ./try 2>/dev/null
17455 if $test ! -s try.out -a "X$code" = X42; then
17456 output=-DTRY_FPRINTF
17462 : check for fflush NULL behaviour
17463 case "$fflushNULL" in
17464 '') set try -DTRY_FFLUSH_NULL $output
17465 if eval $compile; then
17466 $run ./try 2>/dev/null
17469 if $test -s try.out -a "X$code" = X42; then
17470 fflushNULL="`$cat try.out`"
17472 if $test "X$code" != X42; then
17474 (If this test failed, don't worry, we'll try another method shortly.)
17479 $rm -f core try.core core.try.*
17480 case "$fflushNULL" in
17482 Your fflush(NULL) works okay for output streams.
17483 Let's see if it clobbers input pipes...
17485 # As of mid-March 2000 all versions of Solaris appear to have a stdio
17486 # bug that improperly flushes the input end of pipes. So we avoid the
17487 # autoflush on fork/system/exec support for now. :-(
17488 $cat >tryp.c <<EOCP
17491 main(int argc, char **argv)
17497 while ((i = getc(stdin)) != -1
17498 && (*bp++ = i) != '\n'
17499 && bp < &buf[1024])
17502 fprintf(stdout, "%s", buf);
17510 fflushNULL="$define"
17512 if eval $compile; then
17514 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17515 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17517 fflush(NULL) seems to behave okay with input streams.
17519 fflushNULL="$define"
17522 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17524 fflushNULL="$undef"
17527 $rm -f core tryp.c tryp.core core.tryp.*
17530 Your fflush(NULL) isn't working (contrary to ANSI C).
17532 fflushNULL="$undef"
17535 Cannot figure out whether your fflush(NULL) works or not.
17536 I'm assuming it doesn't (contrary to ANSI C).
17538 fflushNULL="$undef"
17542 $define|true|[yY]*)
17543 fflushNULL="$define"
17546 fflushNULL="$undef"
17549 : check explicit looping only if NULL did not work, and if the pipe
17550 : bug does not show up on an explicit flush too
17551 case "$fflushNULL" in
17553 $cat >tryp.c <<EOCP
17556 main(int argc, char **argv)
17562 while ((i = getc(stdin)) != -1
17563 && (*bp++ = i) != '\n'
17564 && bp < &buf[1024])
17567 fprintf(stdout, "%s", buf);
17576 if eval $compile; then
17578 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17579 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17581 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17583 : now check for fflushall behaviour
17584 case "$fflushall" in
17585 '') set try -DTRY_FFLUSH_ALL $output
17586 if eval $compile; then
17588 (Now testing the other method--but note that this also may fail.)
17590 $run ./try 2>/dev/null
17593 if $test -s try.out -a "X$code" = X42; then
17594 fflushall="`$cat try.out`"
17597 $rm -f core try.core core.try.*
17598 case "$fflushall" in
17600 Whew. Flushing explicitly all the stdio streams works.
17602 fflushall="$define"
17605 Sigh. Flushing explicitly all the stdio streams doesn't work.
17610 Cannot figure out whether flushing stdio streams explicitly works or not.
17611 I'm assuming it doesn't.
17617 "$define"|true|[yY]*)
17618 fflushall="$define"
17626 All is futile. Even fflush(stdin) clobbers input pipes!
17633 $rm -f core tryp.c tryp.core core.tryp.*
17635 *) fflushall="$undef"
17639 case "$fflushNULL$fflushall" in
17642 OK, I give up. I cannot figure out how to flush pending stdio output.
17643 We won't be flushing handles at all before fork/exec/popen.
17647 $rm -f try.* try$exe_ext
17649 : Store the full pathname to the ar program for use in the C program
17650 : Respect a hint or command line value for full_ar.
17655 : Store the full pathname to the sed program for use in the C program
17658 : see what type gids are declared as in the kernel
17660 echo "Looking for the type for group ids returned by getgid()."
17661 set gid_t gidtype xxx stdio.h sys/types.h
17665 xxx=`./findhdr sys/user.h`
17666 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17668 unsigned) dflt="$1 $2" ;;
17672 *) dflt="$gidtype";;
17675 gid_t) echo "gid_t found." ;;
17676 *) rp="What is the type for group ids returned by getgid()?"
17684 *_t) zzz="$gidtype" ;;
17687 echo "Checking the size of $zzz..." >&4
17689 #include <sys/types.h>
17692 printf("%d\n", (int)sizeof($gidtype));
17697 if eval $compile_ok; then
17701 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17704 echo "Your $zzz is $gidsize bytes long."
17709 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17715 *_t) zzz="$gidtype" ;;
17718 echo "Checking the sign of $zzz..." >&4
17720 #include <sys/types.h>
17731 if eval $compile; then
17735 echo "(I can't execute the test program--guessing unsigned.)" >&4
17739 1) echo "Your $zzz is unsigned." ;;
17740 -1) echo "Your $zzz is signed." ;;
17746 echo "(I can't compile the test program--guessing unsigned.)" >&4
17752 if $test X"$quadtype" != X; then
17754 echo "Checking how to print 64-bit integers..." >&4
17756 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17757 $cat >try.c <<'EOCP'
17758 #include <sys/types.h>
17761 int q = 12345678901;
17762 printf("%ld\n", q);
17766 if eval $compile; then
17770 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17771 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17772 echo "We will use %d."
17778 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17779 $cat >try.c <<'EOCP'
17780 #include <sys/types.h>
17783 long q = 12345678901;
17784 printf("%ld\n", q);
17788 if eval $compile; then
17792 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17793 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17794 echo "We will use %ld."
17800 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17801 $cat >try.c <<'EOCP'
17802 #include <sys/types.h>
17803 #include <inttypes.h>
17806 int64_t q = 12345678901;
17807 printf("%" PRId64 "\n", q);
17811 if eval $compile; then
17815 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17816 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17817 echo "We will use the C9X style."
17823 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17825 #include <sys/types.h>
17828 $quadtype q = 12345678901;
17829 printf("%Ld\n", q);
17833 if eval $compile; then
17837 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17838 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17839 echo "We will use %Ld."
17845 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17846 $cat >try.c <<'EOCP'
17847 #include <sys/types.h>
17850 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17851 printf("%lld\n", q);
17855 if eval $compile; then
17859 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17860 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17861 echo "We will use the %lld style."
17867 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17869 #include <sys/types.h>
17872 $quadtype q = 12345678901;
17873 printf("%qd\n", q);
17877 if eval $compile; then
17881 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17882 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17883 echo "We will use %qd."
17889 if $test X"$sPRId64" = X; then
17890 echo "Cannot figure out how to print 64-bit integers." >&4
17898 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17899 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17901 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17902 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17908 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17910 if $test X"$ivsize" = X8; then
17911 ivdformat="$sPRId64"
17912 uvuformat="$sPRIu64"
17913 uvoformat="$sPRIo64"
17914 uvxformat="$sPRIx64"
17915 uvXUformat="$sPRIXU64"
17917 if $test X"$ivsize" = X"$longsize"; then
17924 if $test X"$ivsize" = X"$intsize"; then
17932 if $test X"$ivsize" = X"$shortsize"; then
17943 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
17944 nveformat="$sPRIeldbl"
17945 nvfformat="$sPRIfldbl"
17946 nvgformat="$sPRIgldbl"
17947 nvEUformat="$sPRIEUldbl"
17948 nvFUformat="$sPRIFUldbl"
17949 nvGUformat="$sPRIGUldbl"
17959 case "$ivdformat" in
17960 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
17967 $echo "Checking the format string to be used for gids..." >&4
17970 -1) if $test X"$gidsize" = X"$ivsize"; then
17971 gidformat="$ivdformat"
17973 if $test X"$gidsize" = X"$longsize"; then
17976 if $test X"$gidsize" = X"$intsize"; then
17979 if $test X"$gidsize" = X"$shortsize"; then
17986 *) if $test X"$gidsize" = X"$uvsize"; then
17987 gidformat="$uvuformat"
17989 if $test X"$gidsize" = X"$longsize"; then
17992 if $test X"$gidsize" = X"$intsize"; then
17995 if $test X"$gidsize" = X"$shortsize"; then
18004 : see if getgroups exists
18005 set getgroups d_getgrps
18008 : see if setgroups exists
18009 set setgroups d_setgrps
18013 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18015 case "$d_getgrps$d_setgrps" in
18017 case "$groupstype" in
18018 '') dflt="$gidtype" ;;
18019 *) dflt="$groupstype" ;;
18022 What type of pointer is the second argument to getgroups() and setgroups()?
18023 Usually this is the same as group ids, $gidtype, but not always.
18026 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18030 *) groupstype="$gidtype";;
18034 echo "Checking if your $make program sets \$(MAKE)..." >&4
18035 case "$make_set_make" in
18037 $sed 's/^X //' > testmake.mak << 'EOF'
18039 X @echo 'maketemp="$(MAKE)"'
18041 case "`$make -f testmake.mak 2>/dev/null`" in
18042 *maketemp=*) make_set_make='#' ;;
18043 *) make_set_make="MAKE=$make" ;;
18045 $rm -f testmake.mak
18048 case "$make_set_make" in
18049 '#') echo "Yup, it does.";;
18050 *) echo "Nope, it doesn't.";;
18053 : see what type is used for mode_t
18054 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18055 set mode_t modetype int stdio.h sys/types.h
18058 : see if stdarg is available
18060 if $test `./findhdr stdarg.h`; then
18061 echo "<stdarg.h> found." >&4
18064 echo "<stdarg.h> NOT found." >&4
18068 : see if varags is available
18070 if $test `./findhdr varargs.h`; then
18071 echo "<varargs.h> found." >&4
18073 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18076 : set up the varargs testing programs
18077 $cat > varargs.c <<EOP
18079 #include <stdarg.h>
18082 #include <varargs.h>
18086 int f(char *p, ...)
18100 p = va_arg(ap, char *);
18105 $cat > varargs <<EOP
18107 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18116 : now check which varargs header should be included
18121 if `./varargs I_STDARG`; then
18123 elif `./varargs I_VARARGS`; then
18128 if `./varargs I_VARARGS`; then
18135 echo "I could not find the definition for va_dcl... You have problems..." >&4
18136 val="$undef"; set i_stdarg; eval $setvar
18137 val="$undef"; set i_varargs; eval $setvar
18142 case "$i_varhdr" in
18144 val="$define"; set i_stdarg; eval $setvar
18145 val="$undef"; set i_varargs; eval $setvar
18148 val="$undef"; set i_stdarg; eval $setvar
18149 val="$define"; set i_varargs; eval $setvar
18152 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18156 : see if we need va_copy
18158 case "$i_stdarg" in
18161 #include <stdarg.h>
18163 #$i_stdlib I_STDLIB
18165 #include <stdlib.h>
18167 #include <signal.h>
18170 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18172 return vfprintf(f, fmt, *valp);
18176 myvfprintf(FILE *f, const char *fmt, va_list val)
18178 return ivfprintf(f, fmt, &val);
18182 myprintf(char *fmt, ...)
18185 va_start(val, fmt);
18186 return myvfprintf(stdout, fmt, val);
18190 main(int ac, char **av)
18192 signal(SIGSEGV, exit);
18194 myprintf("%s%cs all right, then\n", "that", '\'');
18199 if eval $compile && $run ./try 2>&1 >/dev/null; then
18200 case "`$run ./try`" in
18201 "that's all right, then")
18207 yes) echo "It seems that you don't need va_copy()." >&4
18208 need_va_copy="$undef"
18210 *) echo "It seems that va_copy() or similar will be needed." >&4
18211 need_va_copy="$define"
18214 $rm -f try.* core core.* *.core *.core.*
18216 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18220 : see what type is used for size_t
18221 rp="What is the type used for the length parameter for string functions?"
18222 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18225 : check for type of arguments to gethostbyaddr.
18226 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18227 case "$d_gethbyaddr" in
18231 Checking to see what type of arguments are accepted by gethostbyaddr().
18233 hdrs="$define sys/types.h
18234 $d_socket sys/socket.h
18235 $i_niin netinet/in.h
18237 $i_unistd unistd.h"
18238 : The first arg can 'char *' or 'void *'
18239 : The second arg is some of integral type
18240 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18241 for yyy in size_t long int; do
18242 case "$netdb_host_type" in
18243 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18244 if ./protochk "$try" $hdrs; then
18245 echo "Your system accepts $xxx for the first arg."
18246 echo "...and $yyy for the second arg."
18247 netdb_host_type="$xxx"
18248 netdb_hlen_type="$yyy"
18254 : In case none of those worked, prompt the user.
18255 case "$netdb_host_type" in
18256 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18259 netdb_host_type=$ans
18260 rp='What is the type for the 2nd argument to gethostbyaddr?'
18263 netdb_hlen_type=$ans
18267 *) : no gethostbyaddr, so pick harmless defaults
18268 netdb_host_type='char *'
18269 netdb_hlen_type="$sizetype"
18272 # Remove the "const" if needed. -- but then we'll have a
18274 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18277 : check for type of argument to gethostbyname.
18278 if test "X$netdb_name_type" = X ; then
18279 case "$d_gethbyname" in
18283 Checking to see what type of argument is accepted by gethostbyname().
18285 hdrs="$define sys/types.h
18286 $d_socket sys/socket.h
18287 $i_niin netinet/in.h
18289 $i_unistd unistd.h"
18290 for xxx in "const char *" "char *"; do
18291 case "$netdb_name_type" in
18292 '') try="extern struct hostent *gethostbyname($xxx);"
18293 if ./protochk "$try" $hdrs; then
18294 echo "Your system accepts $xxx."
18295 netdb_name_type="$xxx"
18300 : In case none of those worked, prompt the user.
18301 case "$netdb_name_type" in
18302 '') rp='What is the type for the 1st argument to gethostbyname?'
18305 netdb_name_type=$ans
18309 *) : no gethostbyname, so pick harmless default
18310 netdb_name_type='char *'
18315 : check for type of 1st argument to getnetbyaddr.
18316 if test "X$netdb_net_type" = X ; then
18317 case "$d_getnbyaddr" in
18321 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18323 hdrs="$define sys/types.h
18324 $d_socket sys/socket.h
18325 $i_niin netinet/in.h
18327 $i_unistd unistd.h"
18328 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
18329 case "$netdb_net_type" in
18330 '') try="extern struct netent *getnetbyaddr($xxx, int);"
18331 if ./protochk "$try" $hdrs; then
18332 echo "Your system accepts $xxx."
18333 netdb_net_type="$xxx"
18338 : In case none of those worked, prompt the user.
18339 case "$netdb_net_type" in
18340 '') rp='What is the type for the 1st argument to getnetbyaddr?'
18343 netdb_net_type=$ans
18347 *) : no getnetbyaddr, so pick harmless default
18348 netdb_net_type='long'
18352 : locate the preferred pager for this system
18359 [a-zA-Z]:/*) dflt=$pg;;
18363 [a-zA-Z]:/*) dflt=$more;;
18367 [a-zA-Z]:/*) dflt=$less;;
18370 '') dflt=/usr/ucb/more;;
18374 : Instruct ./getfile to trust the hinted or previous pager value,
18375 : even if it does not begin with a slash. For example, on os2,
18376 : pager might be cmd /c more. See comments in UU/getfile.
18381 rp='What pager is used on your system?'
18385 : see what type pids are declared as in the kernel
18386 rp="What is the type of process ids on this system?"
18387 set pid_t pidtype int stdio.h sys/types.h
18390 : Find earliest binary compatible site_perl subdirectory perl can use.
18391 xs_apiversion=$version # The current site_perl version.
18392 : Find earliest pure perl site_perl subdirectory perl can use.
18393 : The versioned directories started at 5.005.
18394 pm_apiversion='5.005'
18396 : see if ar generates random libraries by itself
18398 echo "Checking how to generate random libraries on your machine..." >&4
18399 echo 'int bar1() { return bar2(); }' > bar1.c
18400 echo 'int bar2() { return 2; }' > bar2.c
18401 $cat > foo.c <<'EOP'
18402 int main() { printf("%d\n", bar1()); exit(0); }
18404 $cc $ccflags -c bar1.c >/dev/null 2>&1
18405 $cc $ccflags -c bar2.c >/dev/null 2>&1
18406 $cc $ccflags -c foo.c >/dev/null 2>&1
18407 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
18408 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18409 $run ./foobar >/dev/null 2>&1; then
18410 echo "$ar appears to generate random libraries itself."
18413 elif $ar ts bar$_a >/dev/null 2>&1 &&
18414 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18415 $run ./foobar >/dev/null 2>&1; then
18416 echo "a table of contents needs to be added with '$ar ts'."
18423 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
18424 $test -f $ranlib || ranlib=''
18427 if $test -n "$ranlib"; then
18428 echo "your system has '$ranlib'; we'll use that."
18431 echo "your system doesn't seem to support random libraries"
18432 echo "so we'll use lorder and tsort to order the libraries."
18439 : check for type of arguments to select.
18440 case "$selecttype" in
18441 '') case "$d_select" in
18445 Checking to see what type of arguments are accepted by select().
18447 hdrs="$define sys/types.h
18448 $i_systime sys/time.h
18449 $i_sysselct sys/select.h
18450 $d_socket sys/socket.h"
18451 : The first arg can be int, unsigned, or size_t
18452 : The last arg may or may not be 'const'
18454 : void pointer has been seen but using that
18455 : breaks the selectminbits test
18456 for xxx in 'fd_set *' 'int *'; do
18457 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
18458 for tmo in 'struct timeval *' 'const struct timeval *'; do
18460 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
18461 if ./protochk "$try" $hdrs; then
18462 echo "Your system accepts $xxx."
18471 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
18472 case "$d_fd_set" in
18473 $define) dflt="fd_set *" ;;
18482 *) : no select, so pick a harmless default
18489 : check for the select 'width'
18490 case "$selectminbits" in
18491 '') case "$d_select" in
18495 Checking to see on how many bits at a time your select() operates...
18498 #include <sys/types.h>
18500 #$i_systime I_SYS_TIME
18501 #$i_systimek I_SYS_TIME_KERNEL
18506 # ifdef I_SYS_TIME_KERNEL
18509 # include <sys/time.h>
18510 # ifdef I_SYS_TIME_KERNEL
18514 #$i_sysselct I_SYS_SELECT
18515 #ifdef I_SYS_SELECT
18516 #include <sys/select.h>
18518 #$d_socket HAS_SOCKET
18520 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18524 #define S sizeof(*(b))
18526 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18527 #define NBITS (NBYTES * 8)
18536 fp = fopen("try.c", "r");
18542 b = ($selecttype)s;
18543 for (i = 0; i < NBITS; i++)
18547 select(fd + 1, b, 0, 0, &t);
18548 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18549 printf("%d\n", i + 1);
18554 if eval $compile_ok; then
18555 selectminbits=`$run ./try`
18556 case "$selectminbits" in
18558 Cannot figure out on how many bits at a time your select() operates.
18559 I'll play safe and guess it is 32 bits.
18565 *) bits="$selectminbits bits" ;;
18567 echo "Your select() operates on $bits at a time." >&4
18569 rp='What is the minimum number of bits your select() operates on?'
18570 case "$byteorder" in
18571 1234|12345678) dflt=32 ;;
18576 selectminbits="$val"
18580 *) : no select, so pick a harmless default
18587 : Trace out the files included by signal.h, then look for SIGxxx names.
18588 : Remove SIGARRAYSIZE used by HPUX.
18589 : Remove SIGSTKSIZE used by Linux.
18590 : Remove SIGSTKSZ used by Posix.
18591 : Remove SIGTYP void lines used by OS2.
18592 : Some cpps, like os390, dont give the file name anywhere
18593 if [ "X$fieldn" = X ]; then
18594 : Just make some guesses. We check them later.
18595 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18597 xxx=`echo '#include <signal.h>' |
18598 $cppstdin $cppminus $cppflags 2>/dev/null |
18599 $grep '^[ ]*#.*include' |
18600 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18602 : Check this list of files to be sure we have parsed the cpp output ok.
18603 : This will also avoid potentially non-existent files, such
18606 for xx in $xxx /dev/null ; do
18607 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18609 : If we have found no files, at least try signal.h
18610 case "$xxxfiles" in
18611 '') xxxfiles=`./findhdr signal.h` ;;
18614 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18615 print substr($2, 4, 20)
18617 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18618 print substr($3, 4, 20)
18620 : Append some common names just in case the awk scan failed.
18621 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18622 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18623 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18624 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18625 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18627 : generate a few handy files for later
18628 $cat > signal.c <<'EOCP'
18629 #include <sys/types.h>
18630 #include <signal.h>
18634 /* Strange style to avoid deeply-nested #if/#else/#endif */
18637 # define NSIG (_NSIG)
18643 # define NSIG (SIGMAX+1)
18649 # define NSIG (SIG_MAX+1)
18655 # define NSIG (MAXSIG+1)
18661 # define NSIG (MAX_SIG+1)
18666 # ifdef SIGARRAYSIZE
18667 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18673 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18677 /* Default to some arbitrary number that's big enough to get most
18678 of the common signals.
18684 printf("NSIG %d\n", NSIG);
18690 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18692 printf "#ifdef SIG"; printf $1; printf "\n"
18693 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18694 printf $1; printf ");\n"
18698 printf "#endif /* JUST_NSIG */\n";
18699 printf "exit(0);\n}\n";
18702 $cat >signal.awk <<'EOP'
18703 BEGIN { ndups = 0 }
18704 $1 ~ /^NSIG$/ { nsig = $2 }
18705 ($1 !~ /^NSIG$/) && (NF == 2) {
18706 if ($2 > maxsig) { maxsig = $2 }
18707 if (sig_name[$2]) {
18708 dup_name[ndups] = $1
18709 dup_num[ndups] = $2
18721 printf("NSIG %d\n", nsig);
18722 for (n = 1; n < nsig; n++) {
18724 printf("%s %d\n", sig_name[n], sig_num[n])
18727 printf("NUM%d %d\n", n, n)
18730 for (n = 0; n < ndups; n++) {
18731 printf("%s %d\n", dup_name[n], dup_num[n])
18735 $cat >signal_cmd <<EOS
18737 if $test -s signal.lst; then
18738 echo "Using your existing signal.lst file"
18743 $cat >>signal_cmd <<'EOS'
18746 if eval $compile_ok; then
18747 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18749 echo "(I can't seem be able to compile the whole test program)" >&4
18750 echo "(I'll try it in little pieces.)" >&4
18751 set signal -DJUST_NSIG
18752 if eval $compile_ok; then
18753 $run ./signal$_exe > signal.nsg
18756 echo "I can't seem to figure out how many signals you have." >&4
18757 echo "Guessing 50." >&4
18758 echo 'NSIG 50' > signal.nsg
18760 : Now look at all the signal names, one at a time.
18761 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18762 $cat > signal.c <<EOCP
18763 #include <sys/types.h>
18764 #include <signal.h>
18767 printf("$xx %d\n", SIG${xx});
18772 if eval $compile; then
18773 echo "SIG${xx} found."
18774 $run ./signal$_exe >> signal.ls1
18776 echo "SIG${xx} NOT found."
18779 if $test -s signal.ls1; then
18780 $cat signal.nsg signal.ls1 |
18781 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18785 if $test -s signal.lst; then
18788 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18789 echo 'kill -l' >signal
18790 set X `csh -f <signal`
18794 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18796 echo $@ | $tr ' ' $trnl | \
18797 $awk '{ printf "%s %d\n", $1, ++s; }
18798 END { printf "NSIG %d\n", ++s }' >signal.lst
18800 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18802 chmod a+x signal_cmd
18803 $eunicefix signal_cmd
18805 : generate list of signal names
18807 case "$sig_name_init" in
18809 *) case "$sig_num_init" in
18810 ''|*,*) doinit=yes ;;
18815 echo "Generating a list of signal names and numbers..." >&4
18817 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18818 sig_name=`$awk 'BEGIN { printf "ZERO " }
18819 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18820 sig_num=`$awk 'BEGIN { printf "0 " }
18821 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18822 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18823 !/^NSIG/ { printf "\"%s\", ", $1 }
18824 END { printf "0\n" }' signal.lst`
18825 sig_num_init=`$awk 'BEGIN { printf "0, " }
18826 !/^NSIG/ { printf "%d, ", $2}
18827 END { printf "0\n"}' signal.lst`
18830 echo "The following $sig_count signals are available:"
18832 echo $sig_name | $awk \
18833 'BEGIN { linelen = 0 }
18835 for (i = 1; i <= NF; i++) {
18836 name = "SIG" $i " "
18837 linelen = linelen + length(name)
18838 if (linelen > 70) {
18840 linelen = length(name)
18846 sig_size=`echo $sig_name | awk '{print NF}'`
18847 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18850 case "$sizetype" in
18851 *_t) zzz="$sizetype" ;;
18852 *) zzz="filesize" ;;
18854 echo "Checking the size of $zzz..." >&4
18856 #include <sys/types.h>
18859 printf("%d\n", (int)sizeof($sizetype));
18864 if eval $compile_ok; then
18868 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18871 echo "Your $zzz size is $sizesize bytes."
18876 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18880 : check for socklen_t
18882 echo "Checking to see if you have socklen_t..." >&4
18884 #include <sys/types.h>
18885 #$d_socket HAS_SOCKET
18887 #include <sys/socket.h>
18889 int main() { socklen_t x = 16; }
18892 if eval $compile; then
18894 echo "You have socklen_t."
18897 echo "You do not have socklen_t."
18898 case "$sizetype" in
18899 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18906 : see if this is a socks.h system
18907 set socks.h i_socks
18910 : check for type of the size argument to socket calls
18911 case "$d_socket" in
18915 Checking to see what type is the last argument of accept().
18918 case "$d_socklen_t" in
18919 "$define") yyy="$yyy socklen_t"
18921 yyy="$yyy $sizetype int long unsigned"
18922 for xxx in $yyy; do
18923 case "$socksizetype" in
18924 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18925 case "$usesocks" in
18927 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
18928 echo "Your system accepts '$xxx *' for the last argument of accept()."
18929 socksizetype="$xxx"
18932 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
18933 echo "Your system accepts '$xxx *' for the last argument of accept()."
18934 socksizetype="$xxx"
18941 : In case none of those worked, prompt the user.
18942 case "$socksizetype" in
18943 '') rp='What is the type for socket address structure sizes?'
18950 *) : no sockets, so pick relatively harmless default
18955 : see what type is used for signed size_t
18956 set ssize_t ssizetype int stdio.h sys/types.h
18961 #include <sys/types.h>
18962 #define Size_t $sizetype
18963 #define SSize_t $dflt
18966 if (sizeof(Size_t) == sizeof(SSize_t))
18968 else if (sizeof(Size_t) == sizeof(int))
18977 if eval $compile_ok && $run ./try > /dev/null; then
18978 ssizetype=`$run ./try`
18979 echo "I'll be using $ssizetype for functions returning a byte count." >&4
18982 Help! I can't compile and run the ssize_t test program: please enlighten me!
18983 (This is probably a misconfiguration in your system or libraries, and
18984 you really ought to fix it. Still, I'll try anyway.)
18986 I need a type that is the same size as $sizetype, but is guaranteed to
18987 be signed. Common values are ssize_t, int and long.
18990 rp="What signed type is the same size as $sizetype?"
18996 : see what type of char stdio uses.
18998 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
18999 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19000 echo "Your stdio uses unsigned chars." >&4
19001 stdchar="unsigned char"
19003 echo "Your stdio uses signed chars." >&4
19010 : see what type uids are declared as in the kernel
19012 echo "Looking for the type for user ids returned by getuid()."
19013 set uid_t uidtype xxx stdio.h sys/types.h
19017 xxx=`./findhdr sys/user.h`
19018 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19020 unsigned) dflt="$1 $2" ;;
19024 *) dflt="$uidtype";;
19027 uid_t) echo "uid_t found." ;;
19028 *) rp="What is the type for user ids returned by getuid()?"
19036 *_t) zzz="$uidtype" ;;
19039 echo "Checking the size of $zzz..." >&4
19041 #include <sys/types.h>
19044 printf("%d\n", (int)sizeof($uidtype));
19049 if eval $compile_ok; then
19053 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19056 echo "Your $zzz is $uidsize bytes long."
19061 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19066 *_t) zzz="$uidtype" ;;
19069 echo "Checking the sign of $zzz..." >&4
19071 #include <sys/types.h>
19082 if eval $compile; then
19086 echo "(I can't execute the test program--guessing unsigned.)" >&4
19090 1) echo "Your $zzz is unsigned." ;;
19091 -1) echo "Your $zzz is signed." ;;
19097 echo "(I can't compile the test program--guessing unsigned.)" >&4
19103 $echo "Checking the format string to be used for uids..." >&4
19106 -1) if $test X"$uidsize" = X"$ivsize"; then
19107 uidformat="$ivdformat"
19109 if $test X"$uidsize" = X"$longsize"; then
19112 if $test X"$uidsize" = X"$intsize"; then
19115 if $test X"$uidsize" = X"$shortsize"; then
19122 *) if $test X"$uidsize" = X"$uvsize"; then
19123 uidformat="$uvuformat"
19125 if $test X"$uidsize" = X"$longsize"; then
19128 if $test X"$uidsize" = X"$intsize"; then
19131 if $test X"$uidsize" = X"$shortsize"; then
19140 : determine compiler compiler
19149 if $test -f "$byacc$_exe"; then
19151 comp="byacc or $comp"
19153 if $test -f "$bison$_exe"; then
19154 comp="$comp or bison -y"
19156 rp="Which compiler compiler ($comp) shall I use?"
19165 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19171 : see if this is a fp.h system
19175 : see if this is a fp_class.h system
19176 set fp_class.h i_fp_class
19179 : see if this is a ieeefp.h system
19180 case "$i_ieeefp" in
19181 '' ) set ieeefp.h i_ieeefp
19186 : see if this is a libutil.h system
19187 set libutil.h i_libutil
19190 : see if mach cthreads are available
19191 if test "X$usethreads" = "X$define"; then
19192 set mach/cthreads.h i_machcthr
19195 i_machcthr="$undef"
19200 : see if this is a math.h system
19204 : see if this is a mntent.h system
19205 set mntent.h i_mntent
19208 : see if ndbm.h is available
19214 # Some Linux distributions such as RedHat 7.1 put the
19215 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19216 if $test -f /usr/include/gdbm/ndbm.h; then
19217 echo '<gdbm/ndbm.h> found.'
19218 ccflags="$ccflags -I/usr/include/gdbm"
19219 cppflags="$cppflags -I/usr/include/gdbm"
19227 : see if dbm_open exists
19228 set dbm_open d_dbm_open
19230 case "$d_dbm_open" in
19233 echo "We won't be including <ndbm.h>"
19242 : see if net/errno.h is available
19244 set net/errno.h val
19247 : Unfortunately, it causes problems on some systems. Arrgh.
19250 cat > try.c <<'EOM'
19253 #include <net/errno.h>
19259 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19260 echo "We'll be including <net/errno.h>." >&4
19262 echo "We won't be including <net/errno.h>." >&4
19271 : see if netinet/tcp.h is available
19272 set netinet/tcp.h i_netinettcp
19275 : see if this is a poll.h system
19279 : see if this is a prot.h system
19284 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19285 $cat <<'EOSH' > Cppsym.know
19286 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19287 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19288 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19289 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
19290 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
19291 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
19292 bull c cadmus clipper CMU COFF COMPILER_VERSION
19293 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
19294 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
19295 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
19296 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
19298 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
19299 H3050R H3050RX hbullx20 hcx host_mips
19300 hp200 hp300 hp700 HP700 hp800 hp9000
19301 hp9000s200 hp9000s300 hp9000s400 hp9000s500
19302 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
19303 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
19304 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
19305 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
19306 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
19307 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
19308 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
19309 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
19310 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
19311 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
19312 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
19313 MATH_HAS_NO_SIDE_EFFECTS
19314 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
19315 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
19316 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
19317 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
19318 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
19319 NetBSD news1500 news1700 news1800 news1900 news3700
19320 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
19321 ns32016 ns32332 ns32k nsc32000
19322 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
19323 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
19324 pc532 pdp11 PGC PIC plexus PORTAR posix
19325 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
19326 POSIX_C_SOURCE POSIX_SOURCE POWER
19327 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
19328 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
19329 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
19330 sony sony_news sonyrisc sparc sparclite spectrum
19331 stardent stdc STDC_EXT stratos sun sun3 sun386
19332 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
19333 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
19334 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
19335 sysV68 sysV88 Tek4132 Tek4300 titan
19336 TM3200 TM5400 TM5600
19337 tower tower32 tower32_200 tower32_600 tower32_700
19338 tower32_800 tower32_850 tss
19339 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
19340 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
19341 unix UNIX95 UNIX99 unixpc unos
19342 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
19343 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
19344 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
19346 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
19347 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
19348 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
19351 # Maybe put other stuff here too.
19352 cat <<EOSH >>Cppsym.know
19355 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
19356 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
19357 $cat Cppsym.know > Cppsym.c
19358 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
19359 $rm -f Cppsym.a Cppsym.b Cppsym.c
19360 cat <<EOSH > Cppsym
19362 if $test \$# -gt 0; then
19363 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
19364 if $test -s Cppsym.got; then
19371 $tr " " "$trnl" | ./Cppsym.try
19377 cat <<EOSH > Cppsym.try
19379 cat <<'EOCP' > try.c
19385 cat <<'EOSH' >> Cppsym.try
19387 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
19388 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
19389 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
19390 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
19392 echo 'return 0;}' >> try.c
19394 cat <<EOSH >> Cppsym.try
19396 case "$osname-$gccversion" in
19397 irix-) ccflags="\$ccflags -woff 1178" ;;
19398 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
19400 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
19402 chmod +x Cppsym.try
19403 $eunicefix Cppsym.try
19404 ./Cppsym < Cppsym.know > Cppsym.true
19405 : now check the C compiler for additional symbols
19406 postprocess_cc_v=''
19408 aix) postprocess_cc_v="|$tr , ' '" ;;
19415 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
19418 -D*) echo "\$i" | $sed 's/^-D//';;
19419 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
19424 postprocess_cc_v=''
19427 ./ccsym > ccsym1.raw
19428 if $test -s ccsym1.raw; then
19429 $sort ccsym1.raw | $uniq >ccsym.raw
19431 mv ccsym1.raw ccsym.raw
19434 $awk '/\=/ { print $0; next }
19435 { print $0"=1" }' ccsym.raw >ccsym.list
19436 $awk '/\=/ { print $0; next }
19437 { print $0"=1" }' Cppsym.true >ccsym.true
19438 $comm -13 ccsym.true ccsym.list >ccsym.own
19439 $comm -12 ccsym.true ccsym.list >ccsym.com
19440 $comm -23 ccsym.true ccsym.list >ccsym.cpp
19442 if $test -z ccsym.raw; then
19443 echo "Your C compiler doesn't seem to define any symbols!" >&4
19445 echo "However, your C preprocessor defines the following symbols:"
19448 cppsymbols=`$cat Cppsym.true`
19449 cppsymbols=`echo $cppsymbols`
19450 cppccsymbols="$cppsymbols"
19452 if $test -s ccsym.com; then
19453 echo "Your C compiler and pre-processor define these symbols:"
19454 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
19457 cppccsymbols=`$cat ccsym.com`
19458 cppccsymbols=`echo $cppccsymbols`
19459 $test "$silent" || sleep 1
19461 if $test -s ccsym.cpp; then
19462 $test "$also" && echo " "
19463 echo "Your C pre-processor ${also}defines the following symbols:"
19464 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
19466 cppsymbols=`$cat ccsym.cpp`
19467 cppsymbols=`echo $cppsymbols`
19468 $test "$silent" || sleep 1
19470 if $test -s ccsym.own; then
19471 $test "$also" && echo " "
19472 echo "Your C compiler ${also}defines the following cpp symbols:"
19473 $sed -e 's/\(..*\)=1/\1/' ccsym.own
19474 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
19475 ccsymbols=`$cat ccsym.own`
19476 ccsymbols=`echo $ccsymbols`
19477 $test "$silent" || sleep 1
19481 : see if this is a termio system
19485 if $test `./findhdr termios.h`; then
19486 set tcsetattr i_termios
19492 "$define") echo "You have POSIX termios.h... good!" >&4;;
19493 *) if ./Cppsym pyr; then
19494 case "`/bin/universe`" in
19495 ucb) if $test `./findhdr sgtty.h`; then
19497 echo "<sgtty.h> found." >&4
19499 echo "System is pyramid with BSD universe."
19500 echo "<sgtty.h> not found--you could have problems." >&4
19502 *) if $test `./findhdr termio.h`; then
19504 echo "<termio.h> found." >&4
19506 echo "System is pyramid with USG universe."
19507 echo "<termio.h> not found--you could have problems." >&4
19511 if $test `./findhdr termio.h`; then
19512 echo "<termio.h> found." >&4
19514 elif $test `./findhdr sgtty.h`; then
19515 echo "<sgtty.h> found." >&4
19518 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19521 if $test `./findhdr sgtty.h`; then
19522 echo "<sgtty.h> found." >&4
19524 elif $test `./findhdr termio.h`; then
19525 echo "<termio.h> found." >&4
19528 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19532 set i_termio; eval $setvar
19533 val=$val2; set i_sgtty; eval $setvar
19534 val=$val3; set i_termios; eval $setvar
19536 : see if stddef is available
19537 set stddef.h i_stddef
19540 : see if this is a sunmath.h system
19541 set sunmath.h i_sunmath
19544 : see if sys/access.h is available
19545 set sys/access.h i_sysaccess
19548 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19549 set sys/filio.h i_sysfilio
19552 if $test `./findhdr sys/ioctl.h`; then
19554 echo '<sys/ioctl.h> found.' >&4
19557 if $test $i_sysfilio = "$define"; then
19558 echo '<sys/ioctl.h> NOT found.' >&4
19560 $test $i_sgtty = "$define" && xxx="sgtty.h"
19561 $test $i_termio = "$define" && xxx="termio.h"
19562 $test $i_termios = "$define" && xxx="termios.h"
19563 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19569 : see if socket ioctl defs are in sys/sockio.h
19571 xxx=`./findhdr sys/sockio.h`
19572 if $test "$xxx"; then
19573 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19575 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19578 echo "No socket ioctls found in <sys/sockio.h>." >&4
19583 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19590 : see if this is a syslog.h system
19591 set syslog.h i_syslog
19595 : see if this is a sys/mode.h system
19596 set sys/mode.h i_sysmode
19599 : see if sys/resource.h has to be included
19600 set sys/resource.h i_sysresrc
19603 : see if sys/security.h is available
19604 set sys/security.h i_syssecrt
19607 : see if this is a sys/statvfs.h system
19608 set sys/statvfs.h i_sysstatvfs
19611 : see if this is a sys/un.h system
19612 set sys/un.h i_sysun
19616 : see if this is a sys/utsname.h system
19617 set sys/utsname.h i_sysutsname
19620 : see if this is a syswait system
19621 set sys/wait.h i_syswait
19624 : see if this is a ustat.h system
19625 set ustat.h i_ustat
19628 : see if this is an utime system
19629 set utime.h i_utime
19632 : see if this is a values.h system
19633 set values.h i_values
19636 : see if this is a vfork system
19639 set vfork.h i_vfork
19647 : see if gdbm.h is available
19652 : see if gdbm_open exists
19653 set gdbm_open d_gdbm_open
19655 case "$d_gdbm_open" in
19658 echo "We won't be including <gdbm.h>"
19668 echo "Looking for extensions..." >&4
19669 : If we are using the old config.sh, known_extensions may contain
19670 : old or inaccurate or duplicate values.
19671 known_extensions=''
19672 nonxs_extensions=''
19673 : We do not use find because it might not be available.
19674 : We do not just use MANIFEST because the user may have dropped
19675 : some additional extensions into the source tree and expect them
19678 : Function to recursively find available extensions, ignoring DynaLoader
19679 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19683 DynaLoader|dynaload) ;;
19685 if $test -f $xxx/$xxx.xs; then
19686 known_extensions="$known_extensions $1$xxx";
19687 elif $test -f $xxx/Makefile.PL; then
19688 nonxs_extensions="$nonxs_extensions $1$xxx";
19690 if $test -d $xxx -a $# -lt 10; then
19693 eval $find_extensions;
19705 eval $find_extensions
19706 # Special case: Add in threads/shared since it is not picked up by the
19707 # recursive find above (and adding in general recursive finding breaks
19708 # SDBM_File/sdbm). A.D. 10/25/2001.
19709 known_extensions="$known_extensions threads/shared"
19710 set X $nonxs_extensions
19712 nonxs_extensions="$*"
19713 set X $known_extensions
19715 known_extensions="$*"
19718 : Now see which are supported on this system.
19720 for xxx in $known_extensions ; do
19724 $define) avail_ext="$avail_ext $xxx" ;;
19727 GDBM_File|gdbm_fil)
19729 $define) avail_ext="$avail_ext $xxx" ;;
19732 I18N/Langinfo|i18n_lan)
19733 case "$i_langinfo$d_nl_langinfo" in
19734 $define$define) avail_ext="$avail_ext $xxx" ;;
19737 NDBM_File|ndbm_fil)
19740 case "$osname-$use64bitint" in
19743 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19746 *) avail_ext="$avail_ext $xxx" ;;
19751 ODBM_File|odbm_fil)
19752 case "${i_dbm}${i_rpcsvcdbm}" in
19754 case "$osname-$use64bitint" in
19757 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19760 *) avail_ext="$avail_ext $xxx" ;;
19766 case "$useposix" in
19767 true|define|y) avail_ext="$avail_ext $xxx" ;;
19771 case "$useopcode" in
19772 true|define|y) avail_ext="$avail_ext $xxx" ;;
19776 case "$d_socket" in
19779 beos) ;; # not unless BONE
19780 *) avail_ext="$avail_ext $xxx" ;;
19785 Sys/Syslog|sys/syslog)
19786 : XXX syslog requires socket
19787 case "$d_socket" in
19788 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19792 case "$usethreads" in
19794 case "$useithreads" in
19795 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19799 XS/APItest|xs/apitest)
19800 # This is just for testing. Skip it unless we have dynamic loading.
19803 $define) avail_ext="$avail_ext $xxx" ;;
19806 XS/Typemap|xs/typemap)
19807 # This is just for testing. Skip it unless we have dynamic loading.
19809 $define) avail_ext="$avail_ext $xxx" ;;
19812 threads|threads/shared)
19813 # threads and threads::shared are special cases.
19814 # To stop people from asking "Perl 5.8.0 was supposed
19815 # to have this new fancy threads implementation but my
19816 # perl doesn't have it" and from people trying to
19817 # (re)install the threads module using CPAN.pm and
19818 # CPAN.pm then offering to reinstall Perl 5.8.0,
19819 # the threads.pm and threads/shared.pm will always be
19820 # there, croaking informatively ("you need to rebuild
19821 # all of Perl with threads, sorry") when threads haven't
19822 # been compiled in.
19824 avail_ext="$avail_ext $xxx"
19827 : XXX Do we need a useipcsysv variable here
19828 case "${d_msg}${d_sem}${d_shm}" in
19829 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19832 *) avail_ext="$avail_ext $xxx"
19841 : Now see which nonxs extensions are supported on this system.
19842 : For now assume all are.
19844 for xxx in $nonxs_extensions ; do
19846 *) nonxs_ext="$nonxs_ext $xxx"
19858 A number of extensions are supplied with $package. You may choose to
19859 compile these extensions for dynamic loading (the default), compile
19860 them into the $package executable (static loading), or not include
19861 them at all. Answer "none" to include no extensions.
19862 Note that DynaLoader is always built and need not be mentioned here.
19865 case "$dynamic_ext" in
19867 : Exclude those listed in static_ext
19869 for xxx in $avail_ext; do
19870 case " $static_ext " in
19872 *) dflt="$dflt $xxx" ;;
19879 *) dflt="$dynamic_ext"
19880 # Perhaps we are reusing an old out-of-date config.sh.
19883 if test X"$dynamic_ext" != X"$avail_ext"; then
19885 NOTICE: Your previous config.sh list may be incorrect.
19886 The extensions now available to you are
19888 but the default list from your previous config.sh is
19900 rp="What extensions do you wish to load dynamically?"
19903 none) dynamic_ext=' ' ;;
19904 *) dynamic_ext="$ans" ;;
19907 case "$static_ext" in
19909 : Exclude those already listed in dynamic linking
19911 for xxx in $avail_ext; do
19912 case " $dynamic_ext " in
19914 *) dflt="$dflt $xxx" ;;
19921 *) dflt="$static_ext"
19928 rp="What extensions do you wish to load statically?"
19931 none) static_ext=' ' ;;
19932 *) static_ext="$ans" ;;
19937 A number of extensions are supplied with $package. Answer "none"
19938 to include no extensions.
19939 Note that DynaLoader is always built and need not be mentioned here.
19942 case "$static_ext" in
19943 '') dflt="$avail_ext" ;;
19944 *) dflt="$static_ext"
19945 # Perhaps we are reusing an old out-of-date config.sh.
19948 if test X"$static_ext" != X"$avail_ext"; then
19950 NOTICE: Your previous config.sh list may be incorrect.
19951 The extensions now available to you are
19953 but the default list from your previous config.sh is
19962 : Exclude those that are not xs extensions
19966 rp="What extensions do you wish to include?"
19969 none) static_ext=' ' ;;
19970 *) static_ext="$ans" ;;
19975 # Encode is a special case. If we are building Encode as a static
19976 # extension, we need to explicitly list its subextensions as well.
19977 # For other nested extensions, this is handled automatically by
19978 # the appropriate Makefile.PL.
19979 case " $static_ext " in
19980 *" Encode "*) # Add the subextensions of Encode
19982 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
19983 static_ext="$static_ext Encode/$xxx"
19989 set X $dynamic_ext $static_ext $nonxs_ext
19993 : Remove libraries needed only for extensions
19994 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
19995 : The exception is SunOS 4.x, which needs them.
19996 case "${osname}X${osvers}" in
20000 *) case "$usedl" in
20001 $define|true|[yY]*)
20002 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20006 *) perllibs="$libs"
20012 : Remove build directory name from cppstdin so it can be used from
20013 : either the present location or the final installed location.
20015 : Get out of the UU directory to get correct path name.
20017 case "$cppstdin" in
20019 echo "Stripping down cppstdin path name"
20025 : end of configuration questions
20027 echo "End of configuration questions."
20030 : back to where it started
20031 if test -d ../UU; then
20035 : configuration may be patched via a 'config.arch' file
20036 if $test -f config.arch; then
20037 echo "I see a config.arch file, loading it."
20041 : configuration may be patched via a 'config.over' file
20042 if $test -f config.over; then
20045 rp='I see a config.over file. Do you wish to load it?'
20048 n*) echo "OK, I'll ignore it.";;
20050 echo "Configuration override changes have been loaded."
20055 : in case they want portability, strip down executable paths
20056 case "$d_portable" in
20059 echo "Stripping down executable paths..." >&4
20060 for file in $loclist $trylist; do
20062 eval $file=`basename $temp`
20067 : create config.sh file
20069 echo "Creating config.sh..." >&4
20070 $spitshell <<EOT >config.sh
20073 # This file was produced by running the Configure script. It holds all the
20074 # definitions figured out by Configure. Should you modify one of these values,
20075 # do not forget to propagate your changes by running "Configure -der". You may
20076 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20079 # Package name : $package
20080 # Source directory : $src
20081 # Configuration time: $cf_time
20082 # Configured by : $cf_by
20083 # Target system : $myuname
20093 Revision='$Revision'
20101 alignbytes='$alignbytes'
20102 ansi2knr='$ansi2knr'
20103 aphostname='$aphostname'
20104 api_revision='$api_revision'
20105 api_subversion='$api_subversion'
20106 api_version='$api_version'
20107 api_versionstring='$api_versionstring'
20110 archlibexp='$archlibexp'
20111 archname64='$archname64'
20112 archname='$archname'
20113 archobjs='$archobjs'
20114 asctime_r_proto='$asctime_r_proto'
20122 byteorder='$byteorder'
20124 castflags='$castflags'
20127 cccdlflags='$cccdlflags'
20128 ccdlflags='$ccdlflags'
20130 ccflags_uselargefiles='$ccflags_uselargefiles'
20132 ccsymbols='$ccsymbols'
20133 ccversion='$ccversion'
20135 cf_email='$cf_email'
20137 charsize='$charsize'
20141 clocktype='$clocktype'
20143 compress='$compress'
20144 contains='$contains'
20148 cpp_stuff='$cpp_stuff'
20149 cppccsymbols='$cppccsymbols'
20150 cppflags='$cppflags'
20152 cppminus='$cppminus'
20154 cppstdin='$cppstdin'
20155 cppsymbols='$cppsymbols'
20156 crypt_r_proto='$crypt_r_proto'
20157 cryptlib='$cryptlib'
20159 ctermid_r_proto='$ctermid_r_proto'
20160 ctime_r_proto='$ctime_r_proto'
20161 d_Gconvert='$d_Gconvert'
20162 d_PRIEUldbl='$d_PRIEUldbl'
20163 d_PRIFUldbl='$d_PRIFUldbl'
20164 d_PRIGUldbl='$d_PRIGUldbl'
20165 d_PRIXU64='$d_PRIXU64'
20166 d_PRId64='$d_PRId64'
20167 d_PRIeldbl='$d_PRIeldbl'
20168 d_PRIfldbl='$d_PRIfldbl'
20169 d_PRIgldbl='$d_PRIgldbl'
20170 d_PRIi64='$d_PRIi64'
20171 d_PRIo64='$d_PRIo64'
20172 d_PRIu64='$d_PRIu64'
20173 d_PRIx64='$d_PRIx64'
20174 d_SCNfldbl='$d_SCNfldbl'
20175 d__fwalk='$d__fwalk'
20176 d_access='$d_access'
20177 d_accessx='$d_accessx'
20179 d_archlib='$d_archlib'
20180 d_asctime_r='$d_asctime_r'
20183 d_attribut='$d_attribut'
20187 d_bsdgetpgrp='$d_bsdgetpgrp'
20188 d_bsdsetpgrp='$d_bsdsetpgrp'
20190 d_casti32='$d_casti32'
20191 d_castneg='$d_castneg'
20192 d_charvspr='$d_charvspr'
20194 d_chroot='$d_chroot'
20195 d_chsize='$d_chsize'
20197 d_closedir='$d_closedir'
20198 d_cmsghdr_s='$d_cmsghdr_s'
20201 d_crypt_r='$d_crypt_r'
20203 d_ctermid_r='$d_ctermid_r'
20204 d_ctime_r='$d_ctime_r'
20205 d_cuserid='$d_cuserid'
20206 d_dbl_dig='$d_dbl_dig'
20207 d_dbminitproto='$d_dbminitproto'
20208 d_difftime='$d_difftime'
20210 d_dirnamlen='$d_dirnamlen'
20211 d_dlerror='$d_dlerror'
20212 d_dlopen='$d_dlopen'
20213 d_dlsymun='$d_dlsymun'
20214 d_dosuid='$d_dosuid'
20215 d_drand48_r='$d_drand48_r'
20216 d_drand48proto='$d_drand48proto'
20218 d_eaccess='$d_eaccess'
20219 d_endgrent='$d_endgrent'
20220 d_endgrent_r='$d_endgrent_r'
20221 d_endhent='$d_endhent'
20222 d_endhostent_r='$d_endhostent_r'
20223 d_endnent='$d_endnent'
20224 d_endnetent_r='$d_endnetent_r'
20225 d_endpent='$d_endpent'
20226 d_endprotoent_r='$d_endprotoent_r'
20227 d_endpwent='$d_endpwent'
20228 d_endpwent_r='$d_endpwent_r'
20229 d_endsent='$d_endsent'
20230 d_endservent_r='$d_endservent_r'
20231 d_eofnblk='$d_eofnblk'
20232 d_eunice='$d_eunice'
20233 d_fchdir='$d_fchdir'
20234 d_fchmod='$d_fchmod'
20235 d_fchown='$d_fchown'
20237 d_fcntl_can_lock='$d_fcntl_can_lock'
20238 d_fd_macros='$d_fd_macros'
20239 d_fd_set='$d_fd_set'
20240 d_fds_bits='$d_fds_bits'
20241 d_fgetpos='$d_fgetpos'
20242 d_finite='$d_finite'
20243 d_finitel='$d_finitel'
20244 d_flexfnam='$d_flexfnam'
20246 d_flockproto='$d_flockproto'
20248 d_fp_class='$d_fp_class'
20249 d_fpathconf='$d_fpathconf'
20250 d_fpclass='$d_fpclass'
20251 d_fpclassify='$d_fpclassify'
20252 d_fpclassl='$d_fpclassl'
20253 d_fpos64_t='$d_fpos64_t'
20254 d_frexpl='$d_frexpl'
20255 d_fs_data_s='$d_fs_data_s'
20256 d_fseeko='$d_fseeko'
20257 d_fsetpos='$d_fsetpos'
20258 d_fstatfs='$d_fstatfs'
20259 d_fstatvfs='$d_fstatvfs'
20261 d_ftello='$d_ftello'
20263 d_getcwd='$d_getcwd'
20264 d_getespwnam='$d_getespwnam'
20265 d_getfsstat='$d_getfsstat'
20266 d_getgrent='$d_getgrent'
20267 d_getgrent_r='$d_getgrent_r'
20268 d_getgrgid_r='$d_getgrgid_r'
20269 d_getgrnam_r='$d_getgrnam_r'
20270 d_getgrps='$d_getgrps'
20271 d_gethbyaddr='$d_gethbyaddr'
20272 d_gethbyname='$d_gethbyname'
20273 d_gethent='$d_gethent'
20274 d_gethname='$d_gethname'
20275 d_gethostbyaddr_r='$d_gethostbyaddr_r'
20276 d_gethostbyname_r='$d_gethostbyname_r'
20277 d_gethostent_r='$d_gethostent_r'
20278 d_gethostprotos='$d_gethostprotos'
20279 d_getitimer='$d_getitimer'
20280 d_getlogin='$d_getlogin'
20281 d_getlogin_r='$d_getlogin_r'
20282 d_getmnt='$d_getmnt'
20283 d_getmntent='$d_getmntent'
20284 d_getnbyaddr='$d_getnbyaddr'
20285 d_getnbyname='$d_getnbyname'
20286 d_getnent='$d_getnent'
20287 d_getnetbyaddr_r='$d_getnetbyaddr_r'
20288 d_getnetbyname_r='$d_getnetbyname_r'
20289 d_getnetent_r='$d_getnetent_r'
20290 d_getnetprotos='$d_getnetprotos'
20291 d_getpagsz='$d_getpagsz'
20292 d_getpbyname='$d_getpbyname'
20293 d_getpbynumber='$d_getpbynumber'
20294 d_getpent='$d_getpent'
20295 d_getpgid='$d_getpgid'
20296 d_getpgrp2='$d_getpgrp2'
20297 d_getpgrp='$d_getpgrp'
20298 d_getppid='$d_getppid'
20299 d_getprior='$d_getprior'
20300 d_getprotobyname_r='$d_getprotobyname_r'
20301 d_getprotobynumber_r='$d_getprotobynumber_r'
20302 d_getprotoent_r='$d_getprotoent_r'
20303 d_getprotoprotos='$d_getprotoprotos'
20304 d_getprpwnam='$d_getprpwnam'
20305 d_getpwent='$d_getpwent'
20306 d_getpwent_r='$d_getpwent_r'
20307 d_getpwnam_r='$d_getpwnam_r'
20308 d_getpwuid_r='$d_getpwuid_r'
20309 d_getsbyname='$d_getsbyname'
20310 d_getsbyport='$d_getsbyport'
20311 d_getsent='$d_getsent'
20312 d_getservbyname_r='$d_getservbyname_r'
20313 d_getservbyport_r='$d_getservbyport_r'
20314 d_getservent_r='$d_getservent_r'
20315 d_getservprotos='$d_getservprotos'
20316 d_getspnam='$d_getspnam'
20317 d_getspnam_r='$d_getspnam_r'
20318 d_gettimeod='$d_gettimeod'
20319 d_gmtime_r='$d_gmtime_r'
20320 d_gnulibc='$d_gnulibc'
20321 d_grpasswd='$d_grpasswd'
20322 d_hasmntopt='$d_hasmntopt'
20325 d_inetaton='$d_inetaton'
20326 d_int64_t='$d_int64_t'
20327 d_isascii='$d_isascii'
20328 d_isfinite='$d_isfinite'
20331 d_isnanl='$d_isnanl'
20332 d_killpg='$d_killpg'
20333 d_lchown='$d_lchown'
20334 d_ldbl_dig='$d_ldbl_dig'
20336 d_localtime_r='$d_localtime_r'
20337 d_locconv='$d_locconv'
20339 d_longdbl='$d_longdbl'
20340 d_longlong='$d_longlong'
20341 d_lseekproto='$d_lseekproto'
20343 d_madvise='$d_madvise'
20345 d_mbstowcs='$d_mbstowcs'
20346 d_mbtowc='$d_mbtowc'
20347 d_memchr='$d_memchr'
20348 d_memcmp='$d_memcmp'
20349 d_memcpy='$d_memcpy'
20350 d_memmove='$d_memmove'
20351 d_memset='$d_memset'
20353 d_mkdtemp='$d_mkdtemp'
20354 d_mkfifo='$d_mkfifo'
20355 d_mkstemp='$d_mkstemp'
20356 d_mkstemps='$d_mkstemps'
20357 d_mktime='$d_mktime'
20360 d_modfl_pow32_bug='$d_modfl_pow32_bug'
20361 d_modflproto='$d_modflproto'
20362 d_mprotect='$d_mprotect'
20364 d_msg_ctrunc='$d_msg_ctrunc'
20365 d_msg_dontroute='$d_msg_dontroute'
20366 d_msg_oob='$d_msg_oob'
20367 d_msg_peek='$d_msg_peek'
20368 d_msg_proxy='$d_msg_proxy'
20369 d_msgctl='$d_msgctl'
20370 d_msgget='$d_msgget'
20371 d_msghdr_s='$d_msghdr_s'
20372 d_msgrcv='$d_msgrcv'
20373 d_msgsnd='$d_msgsnd'
20375 d_munmap='$d_munmap'
20376 d_mymalloc='$d_mymalloc'
20377 d_nanosleep='$d_nanosleep'
20379 d_nl_langinfo='$d_nl_langinfo'
20380 d_nv_preserves_uv='$d_nv_preserves_uv'
20381 d_off64_t='$d_off64_t'
20382 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
20383 d_oldpthreads='$d_oldpthreads'
20384 d_oldsock='$d_oldsock'
20386 d_pathconf='$d_pathconf'
20388 d_perl_otherlibdirs='$d_perl_otherlibdirs'
20389 d_phostname='$d_phostname'
20392 d_portable='$d_portable'
20393 d_procselfexe='$d_procselfexe'
20394 d_pthread_atfork='$d_pthread_atfork'
20395 d_pthread_yield='$d_pthread_yield'
20397 d_pwchange='$d_pwchange'
20398 d_pwclass='$d_pwclass'
20399 d_pwcomment='$d_pwcomment'
20400 d_pwexpire='$d_pwexpire'
20401 d_pwgecos='$d_pwgecos'
20402 d_pwpasswd='$d_pwpasswd'
20403 d_pwquota='$d_pwquota'
20406 d_random_r='$d_random_r'
20407 d_readdir64_r='$d_readdir64_r'
20408 d_readdir='$d_readdir'
20409 d_readdir_r='$d_readdir_r'
20410 d_readlink='$d_readlink'
20412 d_recvmsg='$d_recvmsg'
20413 d_rename='$d_rename'
20414 d_rewinddir='$d_rewinddir'
20416 d_safebcpy='$d_safebcpy'
20417 d_safemcpy='$d_safemcpy'
20418 d_sanemcmp='$d_sanemcmp'
20419 d_sbrkproto='$d_sbrkproto'
20420 d_sched_yield='$d_sched_yield'
20421 d_scm_rights='$d_scm_rights'
20422 d_seekdir='$d_seekdir'
20423 d_select='$d_select'
20425 d_semctl='$d_semctl'
20426 d_semctl_semid_ds='$d_semctl_semid_ds'
20427 d_semctl_semun='$d_semctl_semun'
20428 d_semget='$d_semget'
20430 d_sendmsg='$d_sendmsg'
20431 d_setegid='$d_setegid'
20432 d_seteuid='$d_seteuid'
20433 d_setgrent='$d_setgrent'
20434 d_setgrent_r='$d_setgrent_r'
20435 d_setgrps='$d_setgrps'
20436 d_sethent='$d_sethent'
20437 d_sethostent_r='$d_sethostent_r'
20438 d_setitimer='$d_setitimer'
20439 d_setlinebuf='$d_setlinebuf'
20440 d_setlocale='$d_setlocale'
20441 d_setlocale_r='$d_setlocale_r'
20442 d_setnent='$d_setnent'
20443 d_setnetent_r='$d_setnetent_r'
20444 d_setpent='$d_setpent'
20445 d_setpgid='$d_setpgid'
20446 d_setpgrp2='$d_setpgrp2'
20447 d_setpgrp='$d_setpgrp'
20448 d_setprior='$d_setprior'
20449 d_setproctitle='$d_setproctitle'
20450 d_setprotoent_r='$d_setprotoent_r'
20451 d_setpwent='$d_setpwent'
20452 d_setpwent_r='$d_setpwent_r'
20453 d_setregid='$d_setregid'
20454 d_setresgid='$d_setresgid'
20455 d_setresuid='$d_setresuid'
20456 d_setreuid='$d_setreuid'
20457 d_setrgid='$d_setrgid'
20458 d_setruid='$d_setruid'
20459 d_setsent='$d_setsent'
20460 d_setservent_r='$d_setservent_r'
20461 d_setsid='$d_setsid'
20462 d_setvbuf='$d_setvbuf'
20466 d_shmatprototype='$d_shmatprototype'
20467 d_shmctl='$d_shmctl'
20469 d_shmget='$d_shmget'
20470 d_sigaction='$d_sigaction'
20471 d_sigprocmask='$d_sigprocmask'
20472 d_sigsetjmp='$d_sigsetjmp'
20473 d_sockatmark='$d_sockatmark'
20474 d_sockatmarkproto='$d_sockatmarkproto'
20475 d_socket='$d_socket'
20476 d_socklen_t='$d_socklen_t'
20477 d_sockpair='$d_sockpair'
20478 d_socks5_init='$d_socks5_init'
20480 d_srand48_r='$d_srand48_r'
20481 d_srandom_r='$d_srandom_r'
20482 d_sresgproto='$d_sresgproto'
20483 d_sresuproto='$d_sresuproto'
20484 d_statblks='$d_statblks'
20485 d_statfs_f_flags='$d_statfs_f_flags'
20486 d_statfs_s='$d_statfs_s'
20487 d_statvfs='$d_statvfs'
20488 d_stdio_cnt_lval='$d_stdio_cnt_lval'
20489 d_stdio_ptr_lval='$d_stdio_ptr_lval'
20490 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
20491 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
20492 d_stdio_stream_array='$d_stdio_stream_array'
20493 d_stdiobase='$d_stdiobase'
20494 d_stdstdio='$d_stdstdio'
20495 d_strchr='$d_strchr'
20496 d_strcoll='$d_strcoll'
20497 d_strctcpy='$d_strctcpy'
20498 d_strerrm='$d_strerrm'
20499 d_strerror='$d_strerror'
20500 d_strerror_r='$d_strerror_r'
20501 d_strftime='$d_strftime'
20502 d_strtod='$d_strtod'
20503 d_strtol='$d_strtol'
20504 d_strtold='$d_strtold'
20505 d_strtoll='$d_strtoll'
20506 d_strtoq='$d_strtoq'
20507 d_strtoul='$d_strtoul'
20508 d_strtoull='$d_strtoull'
20509 d_strtouq='$d_strtouq'
20510 d_strxfrm='$d_strxfrm'
20511 d_suidsafe='$d_suidsafe'
20512 d_symlink='$d_symlink'
20513 d_syscall='$d_syscall'
20514 d_syscallproto='$d_syscallproto'
20515 d_sysconf='$d_sysconf'
20516 d_sysernlst='$d_sysernlst'
20517 d_syserrlst='$d_syserrlst'
20518 d_system='$d_system'
20519 d_tcgetpgrp='$d_tcgetpgrp'
20520 d_tcsetpgrp='$d_tcsetpgrp'
20521 d_telldir='$d_telldir'
20522 d_telldirproto='$d_telldirproto'
20525 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20526 d_tm_tm_zone='$d_tm_tm_zone'
20527 d_tmpnam_r='$d_tmpnam_r'
20528 d_truncate='$d_truncate'
20529 d_ttyname_r='$d_ttyname_r'
20530 d_tzname='$d_tzname'
20531 d_u32align='$d_u32align'
20532 d_ualarm='$d_ualarm'
20535 d_union_semun='$d_union_semun'
20536 d_unordered='$d_unordered'
20537 d_usleep='$d_usleep'
20538 d_usleepproto='$d_usleepproto'
20540 d_vendorarch='$d_vendorarch'
20541 d_vendorbin='$d_vendorbin'
20542 d_vendorlib='$d_vendorlib'
20543 d_vendorscript='$d_vendorscript'
20545 d_void_closedir='$d_void_closedir'
20546 d_voidsig='$d_voidsig'
20547 d_voidtty='$d_voidtty'
20548 d_volatile='$d_volatile'
20549 d_vprintf='$d_vprintf'
20551 d_waitpid='$d_waitpid'
20552 d_wcstombs='$d_wcstombs'
20553 d_wctomb='$d_wctomb'
20554 d_writev='$d_writev'
20557 db_hashtype='$db_hashtype'
20558 db_prefixtype='$db_prefixtype'
20559 db_version_major='$db_version_major'
20560 db_version_minor='$db_version_minor'
20561 db_version_patch='$db_version_patch'
20562 defvoidused='$defvoidused'
20563 direntrytype='$direntrytype'
20566 doublesize='$doublesize'
20568 drand48_r_proto='$drand48_r_proto'
20569 dynamic_ext='$dynamic_ext'
20575 endgrent_r_proto='$endgrent_r_proto'
20576 endhostent_r_proto='$endhostent_r_proto'
20577 endnetent_r_proto='$endnetent_r_proto'
20578 endprotoent_r_proto='$endprotoent_r_proto'
20579 endpwent_r_proto='$endpwent_r_proto'
20580 endservent_r_proto='$endservent_r_proto'
20581 eunicefix='$eunicefix'
20584 extensions='$extensions'
20586 fflushNULL='$fflushNULL'
20587 fflushall='$fflushall'
20589 firstmakefile='$firstmakefile'
20591 fpossize='$fpossize'
20592 fpostype='$fpostype'
20593 freetype='$freetype'
20596 full_csh='$full_csh'
20597 full_sed='$full_sed'
20598 gccansipedantic='$gccansipedantic'
20599 gccosandvers='$gccosandvers'
20600 gccversion='$gccversion'
20601 getgrent_r_proto='$getgrent_r_proto'
20602 getgrgid_r_proto='$getgrgid_r_proto'
20603 getgrnam_r_proto='$getgrnam_r_proto'
20604 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20605 gethostbyname_r_proto='$gethostbyname_r_proto'
20606 gethostent_r_proto='$gethostent_r_proto'
20607 getlogin_r_proto='$getlogin_r_proto'
20608 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20609 getnetbyname_r_proto='$getnetbyname_r_proto'
20610 getnetent_r_proto='$getnetent_r_proto'
20611 getprotobyname_r_proto='$getprotobyname_r_proto'
20612 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20613 getprotoent_r_proto='$getprotoent_r_proto'
20614 getpwent_r_proto='$getpwent_r_proto'
20615 getpwnam_r_proto='$getpwnam_r_proto'
20616 getpwuid_r_proto='$getpwuid_r_proto'
20617 getservbyname_r_proto='$getservbyname_r_proto'
20618 getservbyport_r_proto='$getservbyport_r_proto'
20619 getservent_r_proto='$getservent_r_proto'
20620 getspnam_r_proto='$getspnam_r_proto'
20621 gidformat='$gidformat'
20627 gmtime_r_proto='$gmtime_r_proto'
20628 gnulibc_version='$gnulibc_version'
20630 groupcat='$groupcat'
20631 groupstype='$groupstype'
20634 h_sysfile='$h_sysfile'
20637 html1dir='$html1dir'
20638 html1direxp='$html1direxp'
20639 html3dir='$html3dir'
20640 html3direxp='$html3direxp'
20649 i_arpainet='$i_arpainet'
20650 i_bsdioctl='$i_bsdioctl'
20654 i_dirent='$i_dirent'
20660 i_fp_class='$i_fp_class'
20663 i_ieeefp='$i_ieeefp'
20664 i_inttypes='$i_inttypes'
20665 i_langinfo='$i_langinfo'
20666 i_libutil='$i_libutil'
20667 i_limits='$i_limits'
20668 i_locale='$i_locale'
20669 i_machcthr='$i_machcthr'
20670 i_malloc='$i_malloc'
20672 i_memory='$i_memory'
20673 i_mntent='$i_mntent'
20676 i_neterrno='$i_neterrno'
20677 i_netinettcp='$i_netinettcp'
20681 i_pthread='$i_pthread'
20683 i_rpcsvcdbm='$i_rpcsvcdbm'
20686 i_shadow='$i_shadow'
20688 i_stdarg='$i_stdarg'
20689 i_stddef='$i_stddef'
20690 i_stdlib='$i_stdlib'
20691 i_string='$i_string'
20692 i_sunmath='$i_sunmath'
20693 i_sysaccess='$i_sysaccess'
20694 i_sysdir='$i_sysdir'
20695 i_sysfile='$i_sysfile'
20696 i_sysfilio='$i_sysfilio'
20698 i_sysioctl='$i_sysioctl'
20699 i_syslog='$i_syslog'
20700 i_sysmman='$i_sysmman'
20701 i_sysmode='$i_sysmode'
20702 i_sysmount='$i_sysmount'
20703 i_sysndir='$i_sysndir'
20704 i_sysparam='$i_sysparam'
20705 i_sysresrc='$i_sysresrc'
20706 i_syssecrt='$i_syssecrt'
20707 i_sysselct='$i_sysselct'
20708 i_syssockio='$i_syssockio'
20709 i_sysstat='$i_sysstat'
20710 i_sysstatfs='$i_sysstatfs'
20711 i_sysstatvfs='$i_sysstatvfs'
20712 i_systime='$i_systime'
20713 i_systimek='$i_systimek'
20714 i_systimes='$i_systimes'
20715 i_systypes='$i_systypes'
20716 i_sysuio='$i_sysuio'
20718 i_sysutsname='$i_sysutsname'
20719 i_sysvfs='$i_sysvfs'
20720 i_syswait='$i_syswait'
20721 i_termio='$i_termio'
20722 i_termios='$i_termios'
20724 i_unistd='$i_unistd'
20727 i_values='$i_values'
20728 i_varargs='$i_varargs'
20729 i_varhdr='$i_varhdr'
20731 ignore_versioned_solibs='$ignore_versioned_solibs'
20732 inc_version_list='$inc_version_list'
20733 inc_version_list_init='$inc_version_list_init'
20736 installarchlib='$installarchlib'
20737 installbin='$installbin'
20738 installhtml1dir='$installhtml1dir'
20739 installhtml3dir='$installhtml3dir'
20740 installman1dir='$installman1dir'
20741 installman3dir='$installman3dir'
20742 installprefix='$installprefix'
20743 installprefixexp='$installprefixexp'
20744 installprivlib='$installprivlib'
20745 installscript='$installscript'
20746 installsitearch='$installsitearch'
20747 installsitebin='$installsitebin'
20748 installsitehtml1='$installsitehtml1'
20749 installsitehtml3='$installsitehtml3'
20750 installsitelib='$installsitelib'
20751 installsiteman1='$installsiteman1'
20752 installsiteman3='$installsiteman3'
20753 installsitescript='$installsitescript'
20754 installstyle='$installstyle'
20755 installusrbinperl='$installusrbinperl'
20756 installvendorarch='$installvendorarch'
20757 installvendorbin='$installvendorbin'
20758 installvendorhtml1='$installvendorhtml1'
20759 installvendorhtml3='$installvendorhtml3'
20760 installvendorlib='$installvendorlib'
20761 installvendorman1='$installvendorman1'
20762 installvendorman3='$installvendorman3'
20763 installvendorscript='$installvendorscript'
20765 issymlink='$issymlink'
20766 ivdformat='$ivdformat'
20769 known_extensions='$known_extensions'
20772 lddlflags='$lddlflags'
20774 ldflags_uselargefiles='$ldflags_uselargefiles'
20775 ldlibpthname='$ldlibpthname'
20782 libsdirs='$libsdirs'
20783 libsfiles='$libsfiles'
20784 libsfound='$libsfound'
20785 libspath='$libspath'
20786 libswanted='$libswanted'
20787 libswanted_uselargefiles='$libswanted_uselargefiles'
20793 localtime_r_proto='$localtime_r_proto'
20794 locincpth='$locincpth'
20795 loclibpth='$loclibpth'
20796 longdblsize='$longdblsize'
20797 longlongsize='$longlongsize'
20798 longsize='$longsize'
20802 lseeksize='$lseeksize'
20803 lseektype='$lseektype'
20807 make_set_make='$make_set_make'
20808 mallocobj='$mallocobj'
20809 mallocsrc='$mallocsrc'
20810 malloctype='$malloctype'
20812 man1direxp='$man1direxp'
20815 man3direxp='$man3direxp'
20817 mips_type='$mips_type'
20819 mmaptype='$mmaptype'
20820 modetype='$modetype'
20822 multiarch='$multiarch'
20824 myarchname='$myarchname'
20825 mydomain='$mydomain'
20826 myhostname='$myhostname'
20829 need_va_copy='$need_va_copy'
20830 netdb_hlen_type='$netdb_hlen_type'
20831 netdb_host_type='$netdb_host_type'
20832 netdb_name_type='$netdb_name_type'
20833 netdb_net_type='$netdb_net_type'
20836 nm_so_opt='$nm_so_opt'
20837 nonxs_ext='$nonxs_ext'
20839 nvEUformat='$nvEUformat'
20840 nvFUformat='$nvFUformat'
20841 nvGUformat='$nvGUformat'
20842 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20843 nveformat='$nveformat'
20844 nvfformat='$nvfformat'
20845 nvgformat='$nvgformat'
20848 o_nonblock='$o_nonblock'
20850 old_pthread_create_joinable='$old_pthread_create_joinable'
20851 optimize='$optimize'
20852 orderlib='$orderlib'
20855 otherlibdirs='$otherlibdirs'
20859 patchlevel='$patchlevel'
20860 path_sep='$path_sep'
20863 perl_patchlevel='$perl_patchlevel'
20864 perladmin='$perladmin'
20865 perllibs='$perllibs'
20866 perlpath='$perlpath'
20868 phostname='$phostname'
20871 pm_apiversion='$pm_apiversion'
20875 prefixexp='$prefixexp'
20877 privlibexp='$privlibexp'
20878 procselfexe='$procselfexe'
20879 prototype='$prototype'
20881 quadkind='$quadkind'
20882 quadtype='$quadtype'
20883 randbits='$randbits'
20884 randfunc='$randfunc'
20885 random_r_proto='$random_r_proto'
20886 randseedtype='$randseedtype'
20888 rd_nodata='$rd_nodata'
20889 readdir64_r_proto='$readdir64_r_proto'
20890 readdir_r_proto='$readdir_r_proto'
20891 revision='$revision'
20896 sPRIEUldbl='$sPRIEUldbl'
20897 sPRIFUldbl='$sPRIFUldbl'
20898 sPRIGUldbl='$sPRIGUldbl'
20899 sPRIXU64='$sPRIXU64'
20901 sPRIeldbl='$sPRIeldbl'
20902 sPRIfldbl='$sPRIfldbl'
20903 sPRIgldbl='$sPRIgldbl'
20908 sSCNfldbl='$sSCNfldbl'
20909 sched_yield='$sched_yield'
20910 scriptdir='$scriptdir'
20911 scriptdirexp='$scriptdirexp'
20913 seedfunc='$seedfunc'
20914 selectminbits='$selectminbits'
20915 selecttype='$selecttype'
20916 sendmail='$sendmail'
20917 setgrent_r_proto='$setgrent_r_proto'
20918 sethostent_r_proto='$sethostent_r_proto'
20919 setlocale_r_proto='$setlocale_r_proto'
20920 setnetent_r_proto='$setnetent_r_proto'
20921 setprotoent_r_proto='$setprotoent_r_proto'
20922 setpwent_r_proto='$setpwent_r_proto'
20923 setservent_r_proto='$setservent_r_proto'
20926 sharpbang='$sharpbang'
20927 shmattype='$shmattype'
20928 shortsize='$shortsize'
20931 sig_count='$sig_count'
20932 sig_name='$sig_name'
20933 sig_name_init='$sig_name_init'
20935 sig_num_init='$sig_num_init'
20936 sig_size='$sig_size'
20937 signal_t='$signal_t'
20938 sitearch='$sitearch'
20939 sitearchexp='$sitearchexp'
20941 sitebinexp='$sitebinexp'
20942 sitehtml1='$sitehtml1'
20943 sitehtml1exp='$sitehtml1exp'
20944 sitehtml3='$sitehtml3'
20945 sitehtml3exp='$sitehtml3exp'
20947 sitelib_stem='$sitelib_stem'
20948 sitelibexp='$sitelibexp'
20949 siteman1='$siteman1'
20950 siteman1exp='$siteman1exp'
20951 siteman3='$siteman3'
20952 siteman3exp='$siteman3exp'
20953 siteprefix='$siteprefix'
20954 siteprefixexp='$siteprefixexp'
20955 sitescript='$sitescript'
20956 sitescriptexp='$sitescriptexp'
20957 sizesize='$sizesize'
20958 sizetype='$sizetype'
20962 sockethdr='$sockethdr'
20963 socketlib='$socketlib'
20964 socksizetype='$socksizetype'
20966 spackage='$spackage'
20967 spitshell='$spitshell'
20968 srand48_r_proto='$srand48_r_proto'
20969 srandom_r_proto='$srandom_r_proto'
20971 ssizetype='$ssizetype'
20972 startperl='$startperl'
20974 static_ext='$static_ext'
20976 stdio_base='$stdio_base'
20977 stdio_bufsiz='$stdio_bufsiz'
20978 stdio_cnt='$stdio_cnt'
20979 stdio_filbuf='$stdio_filbuf'
20980 stdio_ptr='$stdio_ptr'
20981 stdio_stream_array='$stdio_stream_array'
20982 strerror_r_proto='$strerror_r_proto'
20985 subversion='$subversion'
20989 targetarch='$targetarch'
20993 timeincl='$timeincl'
20994 timetype='$timetype'
20995 tmpnam_r_proto='$tmpnam_r_proto'
21001 ttyname_r_proto='$ttyname_r_proto'
21010 uidformat='$uidformat'
21016 uquadtype='$uquadtype'
21017 use5005threads='$use5005threads'
21018 use64bitall='$use64bitall'
21019 use64bitint='$use64bitint'
21020 usecrosscompile='$usecrosscompile'
21022 useithreads='$useithreads'
21023 uselargefiles='$uselargefiles'
21024 uselongdouble='$uselongdouble'
21025 usemorebits='$usemorebits'
21026 usemultiplicity='$usemultiplicity'
21027 usemymalloc='$usemymalloc'
21029 useopcode='$useopcode'
21030 useperlio='$useperlio'
21031 useposix='$useposix'
21032 usereentrant='$usereentrant'
21034 useshrplib='$useshrplib'
21035 usesocks='$usesocks'
21036 usethreads='$usethreads'
21037 usevendorprefix='$usevendorprefix'
21038 usevfork='$usevfork'
21041 uvXUformat='$uvXUformat'
21042 uvoformat='$uvoformat'
21045 uvuformat='$uvuformat'
21046 uvxformat='$uvxformat'
21047 vendorarch='$vendorarch'
21048 vendorarchexp='$vendorarchexp'
21049 vendorbin='$vendorbin'
21050 vendorbinexp='$vendorbinexp'
21051 vendorhtml1='$vendorhtml1'
21052 vendorhtml1exp='$vendorhtml1exp'
21053 vendorhtml3='$vendorhtml3'
21054 vendorhtml3exp='$vendorhtml3exp'
21055 vendorlib='$vendorlib'
21056 vendorlib_stem='$vendorlib_stem'
21057 vendorlibexp='$vendorlibexp'
21058 vendorman1='$vendorman1'
21059 vendorman1exp='$vendorman1exp'
21060 vendorman3='$vendorman3'
21061 vendorman3exp='$vendorman3exp'
21062 vendorprefix='$vendorprefix'
21063 vendorprefixexp='$vendorprefixexp'
21064 vendorscript='$vendorscript'
21065 vendorscriptexp='$vendorscriptexp'
21067 version_patchlevel_string='$version_patchlevel_string'
21068 versiononly='$versiononly'
21070 voidflags='$voidflags'
21072 xs_apiversion='$xs_apiversion'
21074 yaccflags='$yaccflags'
21079 : Add in command line options if available
21080 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21082 : add special variables
21083 $test -f $src/patchlevel.h && \
21084 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21085 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21086 echo "PERL_CONFIG_SH=true" >>config.sh
21088 : propagate old symbols
21089 if $test -f UU/config.sh; then
21090 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21091 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21092 $sort | $uniq -u >UU/oldsyms
21093 set X `cat UU/oldsyms`
21099 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21101 echo "# Variables propagated from previous config.sh file." >>config.sh
21102 for sym in `cat UU/oldsyms`; do
21103 echo " Propagating $hint variable "'$'"$sym..."
21104 eval 'tmp="$'"${sym}"'"'
21106 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21112 : Finish up by extracting the .SH files
21116 echo "Extraction done."
21126 If you'd like to make any changes to the config.sh file before I begin
21127 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21130 rp="Press return or use a shell escape to edit config.sh:"
21135 *) : in case they cannot read
21136 sh 1>&4 -c "$ans";;
21141 : if this fails, just run all the .SH files by hand
21150 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21157 Now you need to generate make dependencies by running "$make depend".
21158 You might prefer to run it in background: "$make depend > makedepend.out &"
21159 It can take a while, so you might not want to run it right now.
21164 rp="Run $make depend now?"
21168 $make depend && echo "Now you must run '$make'."
21171 echo "You must run '$make depend' then '$make'."
21174 elif test -f [Mm]akefile; then
21176 echo "Now you must run a $make."
21178 echo "Configure done."
21181 if $test -f Policy.sh; then
21184 If you compile $package on a different machine or from a different object
21185 directory, copy the Policy.sh file from this object directory to the
21186 new one before you run Configure -- this will help you with most of
21187 the policy defaults.
21191 if $test -f config.msg; then
21192 echo "Hmm. I also noted the following information while running:"
21194 $cat config.msg >&4
21197 $rm -f kit*isdone ark*isdone