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 Thu Mar 13 12:23:47 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 : determine filename position in cpp output
4944 echo "Computing filename position in cpp output for #include directives..." >&4
4946 vos) testaccess=-e ;;
4949 echo '#include <stdio.h>' > foo.c
4952 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4953 $grep '^[ ]*#.*stdio\.h' | \
4954 while read cline; do
4957 while $test \$# -gt 0; do
4958 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4963 pos=\`expr \$pos + 1\`
4975 *) pos="${fieldn}th";;
4977 echo "Your cpp writes the filename in the $pos field of the line."
4980 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4983 : locate header file
4988 for usrincdir in $usrinc
4990 if test -f \$usrincdir/\$wanted; then
4991 echo "\$usrincdir/\$wanted"
4995 awkprg='{ print \$$fieldn }'
4996 echo "#include <\$wanted>" > foo\$\$.c
4997 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4998 $cppfilter $grep "^[ ]*#.*\$wanted" | \
4999 while read cline; do
5000 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5002 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5003 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5008 # status = 0: grep returned 0 lines, case statement not executed
5009 # status = 1: headerfile found
5010 # status = 2: while loop executed, no headerfile found
5014 if test \$status -eq 1; then
5021 : define an alternate in-header-list? function
5022 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5023 cont=true; xxf="echo \"<\$1> found.\" >&4";
5024 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5025 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5027 case $# in 4) instead=instead;; *) instead="at last";; esac;
5028 while $test "$cont"; do
5030 var=$2; eval "was=\$$2";
5031 if $test "$xxx" && $test -r "$xxx";
5033 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5036 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5037 set $yyy; shift; shift; yyy=$@;
5038 case $# in 0) cont="";;
5039 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5040 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5041 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5042 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5046 do set $yyy; var=$2; eval "was=\$$2";
5047 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5048 set $yyy; shift; shift; yyy=$@;
5051 : see if stdlib is available
5052 set stdlib.h i_stdlib
5055 : check for lengths of integral types
5059 echo "Checking to see how big your integers are..." >&4
5068 printf("intsize=%d;\n", (int)sizeof(int));
5069 printf("longsize=%d;\n", (int)sizeof(long));
5070 printf("shortsize=%d;\n", (int)sizeof(short));
5075 if eval $compile_ok && $run ./try > /dev/null; then
5077 echo "Your integers are $intsize bytes long."
5078 echo "Your long integers are $longsize bytes long."
5079 echo "Your short integers are $shortsize bytes long."
5083 Help! I can't compile and run the intsize test program: please enlighten me!
5084 (This is probably a misconfiguration in your system or libraries, and
5085 you really ought to fix it. Still, I'll try anyway.)
5089 rp="What is the size of an integer (in bytes)?"
5093 rp="What is the size of a long integer (in bytes)?"
5097 rp="What is the size of a short integer (in bytes)?"
5105 : check for long long
5107 echo "Checking to see if you have long long..." >&4
5108 echo 'int main() { long long x = 7; return 0; }' > try.c
5110 if eval $compile; then
5112 echo "You have long long."
5115 echo "You do not have long long."
5121 : check for length of long long
5122 case "${d_longlong}${longlongsize}" in
5125 echo "Checking to see how big your long longs are..." >&4
5126 $cat >try.c <<'EOCP'
5130 printf("%d\n", (int)sizeof(long long));
5135 if eval $compile_ok; then
5136 longlongsize=`$run ./try`
5137 echo "Your long longs are $longlongsize bytes long."
5141 echo "(I can't seem to compile the test program. Guessing...)"
5142 rp="What is the size of a long long (in bytes)?"
5146 if $test "X$longsize" = "X$longlongsize"; then
5147 echo "(That isn't any different from an ordinary long.)"
5153 : see if inttypes.h is available
5154 : we want a real compile instead of Inhdr because some systems
5155 : have an inttypes.h which includes non-existent headers
5158 #include <inttypes.h>
5160 static int32_t foo32 = 0x12345678;
5164 if eval $compile; then
5165 echo "<inttypes.h> found." >&4
5168 echo "<inttypes.h> NOT found." >&4
5177 echo "Checking to see if you have int64_t..." >&4
5179 #include <sys/types.h>
5180 #$i_inttypes I_INTTYPES
5182 #include <inttypes.h>
5184 int main() { int64_t x = 7; }
5187 if eval $compile; then
5189 echo "You have int64_t."
5192 echo "You do not have int64_t."
5200 echo "Checking which 64-bit integer type we could use..." >&4
5206 val='"unsigned int"'
5211 *) case "$longsize" in
5215 val='"unsigned long"'
5220 *) case "$d_longlong:$longlongsize" in
5225 val='"unsigned long long"'
5230 *) case "$d_int64_t" in
5249 '') echo "Alas, no 64-bit integer types in sight." >&4
5252 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5258 case "$uselonglong" in
5259 "$define"|true|[yY]*)
5262 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5264 use64bitint="$define"
5267 case "$use64bits" in
5268 "$define"|true|[yY]*)
5271 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5273 use64bitint="$define"
5276 case "$use64bitints" in
5277 "$define"|true|[yY]*)
5280 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5282 use64bitint="$define"
5285 case "$use64bitsint" in
5286 "$define"|true|[yY]*)
5289 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5291 use64bitint="$define"
5294 case "$uselonglongs" in
5295 "$define"|true|[yY]*)
5298 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5300 use64bitint="$define"
5303 case "$use64bitsall" in
5304 "$define"|true|[yY]*)
5307 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5309 use64bitall="$define"
5314 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5316 case "$use64bitall" in
5317 "$define"|true|[yY]*) use64bitint="$define" ;;
5323 You have natively 64-bit long integers.
5327 *) case "$use64bitint" in
5328 "$define"|true|[yY]*) dflt='y';;
5337 Perl can be built to take advantage of 64-bit integer types
5338 on some systems. To do so, Configure can be run with -Duse64bitint.
5339 Choosing this option will most probably introduce binary incompatibilities.
5341 If this doesn't make any sense to you, just accept the default '$dflt'.
5342 (The default has been chosen based on your configuration.)
5344 rp='Try to use 64-bit integers, if available?'
5347 [yY]*) val="$define" ;;
5355 case "$use64bitall" in
5356 "$define"|true|[yY]*) dflt='y' ;;
5357 *) case "$longsize" in
5365 You may also choose to try maximal 64-bitness. It means using as much
5366 64-bitness as possible on the platform. This in turn means even more
5367 binary incompatibilities. On the other hand, your platform may not
5368 have any more 64-bitness available than what you already have chosen.
5370 If this doesn't make any sense to you, just accept the default '$dflt'.
5371 (The default has been chosen based on your configuration.)
5373 rp='Try to use maximal 64-bit support, if available?'
5376 [yY]*) val="$define" ;;
5381 case "$use64bitall" in
5383 case "$use64bitint" in
5387 Since you have chosen a maximally 64-bit build, I'm also turning on
5388 the use of 64-bit integers.
5390 use64bitint="$define" ;;
5395 case "$use64bitint" in
5396 "$define"|true|[yY]*)
5397 : Look for a hint-file generated 'call-back-unit'. If the
5398 : user has specified that a 64-bit perl is to be built,
5399 : we may need to set or change some other defaults.
5400 if $test -f use64bitint.cbu; then
5401 echo "Your platform has some specific hints for 64-bit integers, using them..."
5405 4) case "$archname64" in
5406 '') archname64=64int ;;
5413 case "$use64bitall" in
5414 "$define"|true|[yY]*)
5415 : Look for a hint-file generated 'call-back-unit'. If the
5416 : user has specified that a maximally 64-bit perl is to be built,
5417 : we may need to set or change some other defaults.
5418 if $test -f use64bitall.cbu; then
5419 echo "Your platform has some specific hints for 64-bit builds, using them..."
5423 4) case "$archname64" in
5424 ''|64int) archname64=64all ;;
5432 echo "Checking for GNU C Library..." >&4
5434 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
5435 alone are insufficient to distinguish different versions, such as
5436 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
5437 libc version 2.1.0. A. Dougherty, June 3, 2002.
5443 # ifdef __GLIBC_MINOR__
5444 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
5445 # include <gnu/libc-version.h>
5446 printf("%s\n", gnu_get_libc_version());
5448 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
5451 printf("%d\n", __GLIBC__);
5460 if eval $compile_ok && $run ./try > glibc.ver; then
5462 gnulibc_version=`$cat glibc.ver`
5463 echo "You are using the GNU C Library version $gnulibc_version"
5467 echo "You are not using the GNU C Library"
5469 $rm -f try try.* glibc.ver
5473 : see if nm is to be used to determine whether a symbol is defined or not
5477 case "$d_gnulibc" in
5480 echo "nm probably won't work on the GNU C Library." >&4
5486 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
5488 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5489 echo "'nm' won't be sufficient on this sytem." >&4
5495 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5496 if $test $dflt -gt 20; then
5506 true|$define) dflt=y;;
5513 I can use $nm to extract the symbols from your C libraries. This
5514 is a time consuming task which may generate huge output on the disk (up
5515 to 3 megabytes) but that should make the symbols extraction faster. The
5516 alternative is to skip the 'nm' extraction part and to compile a small
5517 test program instead to determine whether each symbol is present. If
5518 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5519 this may be the best solution.
5521 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5524 rp="Shall I use $nm to extract C symbols from the libraries?"
5527 [Nn]*) usenm=false;;
5536 : nm options which may be necessary
5538 '') if $test -f /mach_boot; then
5540 elif $test -d /usr/ccs/lib; then
5541 nm_opt='-p' # Solaris (and SunOS?)
5542 elif $test -f /dgux; then
5544 elif $test -f /lib64/rld; then
5545 nm_opt='-p' # 64-bit Irix
5551 : nm options which may be necessary for shared libraries but illegal
5552 : for archive libraries. Thank you, Linux.
5553 case "$nm_so_opt" in
5554 '') case "$myuname" in
5556 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5557 nm_so_opt='--dynamic'
5566 : get list of predefined functions in a handy place
5571 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5577 *) for thislib in $libs; do
5580 : Handle C library specially below.
5583 thislib=`echo $thislib | $sed -e 's/^-l//'`
5584 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5586 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5588 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5590 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5592 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5594 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5596 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5601 libnames="$libnames $try"
5603 *) libnames="$libnames $thislib" ;;
5612 for xxx in $libpth; do
5613 $test -r $1 || set $xxx/libc.$so
5614 : The messy sed command sorts on library version numbers.
5616 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5617 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5619 s/[0-9][0-9]*/0000&/g
5620 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5623 $sort | $sed -e 's/^.* //'`
5626 $test -r $1 || set /usr/ccs/lib/libc.$so
5627 $test -r $1 || set /lib/libsys_s$_a
5633 if $test -r "$1"; then
5634 echo "Your (shared) C library seems to be in $1."
5636 elif $test -r /lib/libc && $test -r /lib/clib; then
5637 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5639 libc='/lib/clib /lib/libc'
5640 if $test -r /lib/syslib; then
5641 echo "(Your math library is in /lib/syslib.)"
5642 libc="$libc /lib/syslib"
5644 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5645 echo "Your C library seems to be in $libc, as you said before."
5646 elif $test -r $incpath/usr/lib/libc$_a; then
5647 libc=$incpath/usr/lib/libc$_a;
5648 echo "Your C library seems to be in $libc. That's fine."
5649 elif $test -r /lib/libc$_a; then
5651 echo "Your C library seems to be in $libc. You're normal."
5653 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5655 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5656 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5657 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5659 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5661 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5664 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5666 if $test -r "$tans"; then
5667 echo "Your C library seems to be in $tans, of all places."
5673 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5677 If the guess above is wrong (which it might be if you're using a strange
5678 compiler, or your machine supports multiple models), you can override it here.
5683 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5685 I can't seem to find your C library. I've looked in the following places:
5688 $sed 's/^/ /' libpath
5691 None of these seems to contain your C library. I need to get its name...
5696 rp='Where is your C library?'
5701 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5702 set X `cat libnames`
5705 case $# in 1) xxx=file; esac
5706 echo "Extracting names from the following $xxx for later perusal:" >&4
5708 $sed 's/^/ /' libnames >&4
5710 $echo $n "This may take a while...$c" >&4
5714 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5715 *) $nm $nm_opt $file 2>/dev/null;;
5720 $grep fprintf libc.tmp > libc.ptf
5721 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5722 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5724 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5726 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5728 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5730 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5732 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5734 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5736 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5738 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5740 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5742 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5744 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5746 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5748 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5749 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5751 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5753 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5755 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5757 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5759 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5761 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5763 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5765 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5767 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5769 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5771 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5773 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5775 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5777 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5779 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5782 $nm -p $* 2>/dev/null >libc.tmp
5783 $grep fprintf libc.tmp > libc.ptf
5784 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5785 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5791 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5793 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5794 for thisname in $libnames $libc; do
5795 $ar t $thisname >>libc.tmp
5797 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5799 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5800 # Repeat libc to extract forwarders to DLL entries too
5801 for thisname in $libnames $libc; do
5802 $ar tv $thisname >>libc.tmp
5803 # Revision 50 of EMX has bug in $ar.
5804 # it will not extract forwarders to DLL entries
5805 # Use emximp which will extract exactly them.
5806 emximp -o tmp.imp $thisname \
5808 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5809 < tmp.imp >>libc.tmp
5812 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5815 echo "$ar didn't seem to work right." >&4
5816 echo "Maybe this is a Cray...trying bld instead..." >&4
5817 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5819 for thisname in $libnames; do
5821 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5822 $ar t $thisname >>libc.tmp
5826 echo "That didn't work either. Giving up." >&4
5836 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
5837 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
5839 *) if $test -f /lib/syscalls.exp; then
5841 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5842 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5848 $rm -f libnames libpath
5850 : is a C symbol defined?
5853 -v) tf=libc.tmp; tc=""; tdc="";;
5854 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5855 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5858 case "$reuseval-$4" in
5860 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5866 if $contains $tlook $tf >/dev/null 2>&1;
5871 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5872 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5880 $define) tval=true;;
5886 : define an is-in-libc? function
5887 inlibc='echo " "; td=$define; tu=$undef;
5888 sym=$1; var=$2; eval "was=\$$2";
5890 case "$reuseval$was" in
5900 echo "$sym() found." >&4;
5901 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5903 echo "$sym() NOT found." >&4;
5904 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5908 $define) echo "$sym() found." >&4;;
5909 *) echo "$sym() NOT found." >&4;;
5913 : see if sqrtl exists
5917 hasproto='varname=$1; func=$2; shift; shift;
5918 while $test $# -ge 2; do
5920 $define) echo "#include <$2>";;
5924 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
5925 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
5926 echo "$func() prototype found.";
5929 echo "$func() prototype NOT found.";
5934 $rm -f try.c tryout.c'
5936 : check for length of double
5938 case "$doublesize" in
5940 echo "Checking to see how big your double precision numbers are..." >&4
5949 printf("%d\n", (int)sizeof(double));
5954 if eval $compile_ok; then
5955 doublesize=`$run ./try`
5956 echo "Your double is $doublesize bytes long."
5959 echo "(I can't seem to compile the test program. Guessing...)"
5960 rp="What is the size of a double precision number (in bytes)?"
5968 : check for long doubles
5970 echo "Checking to see if you have long double..." >&4
5971 echo 'int main() { long double x = 7.0; }' > try.c
5973 if eval $compile; then
5975 echo "You have long double."
5978 echo "You do not have long double."
5984 : check for length of long double
5985 case "${d_longdbl}${longdblsize}" in
5988 echo "Checking to see how big your long doubles are..." >&4
5989 $cat >try.c <<'EOCP'
5993 printf("%d\n", sizeof(long double));
5998 if eval $compile; then
5999 longdblsize=`$run ./try`
6000 echo "Your long doubles are $longdblsize bytes long."
6004 echo "(I can't seem to compile the test program. Guessing...)" >&4
6005 rp="What is the size of a long double (in bytes)?"
6009 if $test "X$doublesize" = "X$longdblsize"; then
6010 echo "(That isn't any different from an ordinary double.)"
6018 if $test X"$d_longdbl" = X"$define"; then
6020 echo "Checking how to print long doubles..." >&4
6022 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
6023 $cat >try.c <<'EOCP'
6024 #include <sys/types.h>
6028 printf("%.3f\n", d);
6032 if eval $compile; then
6036 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
6037 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
6038 echo "We will use %f."
6044 if $test X"$sPRIfldbl" = X; then
6045 $cat >try.c <<'EOCP'
6046 #include <sys/types.h>
6049 long double d = 123.456;
6050 printf("%.3Lf\n", d);
6054 if eval $compile; then
6058 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
6059 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
6060 echo "We will use %Lf."
6066 if $test X"$sPRIfldbl" = X; then
6067 $cat >try.c <<'EOCP'
6068 #include <sys/types.h>
6071 long double d = 123.456;
6072 printf("%.3llf\n", d);
6076 if eval $compile; then
6080 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
6081 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
6082 echo "We will use %llf."
6088 if $test X"$sPRIfldbl" = X; then
6089 $cat >try.c <<'EOCP'
6090 #include <sys/types.h>
6093 long double d = 123.456;
6094 printf("%.3lf\n", d);
6098 if eval $compile; then
6102 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
6103 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
6104 echo "We will use %lf."
6110 if $test X"$sPRIfldbl" = X; then
6111 echo "Cannot figure out how to print long doubles." >&4
6113 sSCNfldbl=$sPRIfldbl # expect consistency
6120 case "$sPRIfldbl" in
6121 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
6122 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
6123 d_SCNfldbl="$undef";
6125 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
6126 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
6127 d_SCNfldbl="$define";
6131 : see if modfl exists
6135 : see if prototype for modfl is available
6137 set d_modflproto modfl math.h
6140 d_modfl_pow32_bug="$undef"
6142 case "$d_longdbl$d_modfl" in
6145 Checking to see whether your modfl() is okay for large values...
6151 if $test "X$d_modflproto" != "X$define"; then
6153 /* Sigh. many current glibcs provide the function, but do not prototype it. */
6154 long double modfl (long double, long double *);
6159 long double nv = 4294967303.15;
6165 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
6169 case "$osname:$gccversion" in
6170 aix:) saveccflags="$ccflags"
6171 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
6174 if eval $compile; then
6177 *" 4294967303.150000 1.150000 4294967302.000000")
6178 echo >&4 "Your modfl() is broken for large values."
6179 d_modfl_pow32_bug="$define"
6181 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
6185 *" 4294967303.150000 0.150000 4294967303.000000")
6186 echo >&4 "Your modfl() seems okay for large values."
6188 *) echo >&4 "I don't understand your modfl() at all."
6192 $rm -f try.* try core core.try.*
6194 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
6197 case "$osname:$gccversion" in
6198 aix:) ccflags="$saveccflags" ;; # restore
6204 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6207 case "$uselongdouble" in
6208 $define|true|[yY]*) dflt='y';;
6213 Perl can be built to take advantage of long doubles which
6214 (if available) may give more accuracy and range for floating point numbers.
6216 If this doesn't make any sense to you, just accept the default '$dflt'.
6218 rp='Try to use long doubles if available?'
6221 y|Y) val="$define" ;;
6227 case "$uselongdouble" in
6228 true|[yY]*) uselongdouble="$define" ;;
6231 case "$uselongdouble" in
6233 : Look for a hint-file generated 'call-back-unit'. If the
6234 : user has specified that long doubles should be used,
6235 : we may need to set or change some other defaults.
6236 if $test -f uselongdouble.cbu; then
6237 echo "Your platform has some specific hints for long doubles, using them..."
6238 . ./uselongdouble.cbu
6241 (Your platform doesn't have any specific hints for long doubles.)
6248 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6249 $define:$define:$define)
6252 $define:$define:$undef)
6253 message="I could not find modfl"
6255 $define:$undef:$define)
6256 message="I could not find sqrtl"
6258 $define:$undef:$undef)
6259 message="I found neither sqrtl nor modfl"
6263 if $test "$message" != X; then
6266 *** You requested the use of long doubles but you do not seem to have
6267 *** the mathematic functions for long doubles.
6269 *** I'm disabling the use of long doubles.
6273 uselongdouble=$undef
6276 : determine the architecture name
6278 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6279 tarch=`arch`"-$osname"
6280 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6281 if uname -m > tmparch 2>&1 ; then
6282 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6283 -e 's/$/'"-$osname/" tmparch`
6291 case "$myarchname" in
6294 echo "(Your architecture name used to be $myarchname.)"
6298 case "$targetarch" in
6300 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6305 *) dflt="$archname";;
6307 rp='What is your architecture name'
6310 case "$usethreads" in
6312 echo "Threads selected." >&4
6314 *-thread*) echo "...and architecture name already has -thread." >&4
6316 *) archname="$archname-thread"
6317 echo "...setting architecture name to $archname." >&4
6322 case "$usemultiplicity" in
6324 echo "Multiplicity selected." >&4
6326 *-multi*) echo "...and architecture name already has -multi." >&4
6328 *) archname="$archname-multi"
6329 echo "...setting architecture name to $archname." >&4
6334 case "$use64bitint$use64bitall" in
6336 case "$archname64" in
6338 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6341 case "$use64bitint" in
6342 "$define") echo "64 bit integers selected." >&4 ;;
6344 case "$use64bitall" in
6345 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6348 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6350 *) archname="$archname-$archname64"
6351 echo "...setting architecture name to $archname." >&4
6357 case "$uselongdouble" in
6359 echo "Long doubles selected." >&4
6360 case "$longdblsize" in
6362 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6366 *-ld*) echo "...and architecture name already has -ld." >&4
6368 *) archname="$archname-ld"
6369 echo "...setting architecture name to $archname." >&4
6376 case "$useperlio" in
6378 echo "Perlio selected." >&4
6381 echo "Perlio not selected, using stdio." >&4
6383 *-stdio*) echo "...and architecture name already has -stdio." >&4
6385 *) archname="$archname-stdio"
6386 echo "...setting architecture name to $archname." >&4
6392 : determine root of directory hierarchy where package will be installed.
6395 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6398 dflt=`echo "$prefix" | sed 's/.$//'`
6406 By default, $package will be installed in $dflt/bin, manual pages
6407 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6408 installation directories. Typically this is something like /usr/local.
6409 If you wish to have binaries under /usr/bin but other parts of the
6410 installation under /usr/local, that's ok: you will be prompted
6411 separately for each of the installation directories, the prefix being
6412 only used to set the defaults.
6416 rp='Installation prefix to use?'
6424 *) oldprefix="$prefix";;
6433 *) afsroot=$afsroot ;;
6439 $define|true) afs=true ;;
6440 $undef|false) afs=false ;;
6441 *) if test -d $afsroot; then
6449 echo "AFS may be running... I'll be extra cautious then..." >&4
6451 echo "AFS does not seem to be running..." >&4
6454 : determine installation prefix for where package is to be installed.
6458 Since you are running AFS, I need to distinguish the directory in which
6459 files will reside from the directory in which they are installed (and from
6460 which they are presumably copied to the former directory by occult means).
6463 case "$installprefix" in
6464 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6465 *) dflt="$installprefix";;
6470 In some special cases, particularly when building $package for distribution,
6471 it is convenient to distinguish the directory in which files should be
6472 installed from the directory ($prefix) in which they will
6473 eventually reside. For most users, these two directories are the same.
6476 case "$installprefix" in
6478 *) dflt=$installprefix;;
6482 rp='What installation prefix should I use for installing files?'
6484 installprefix="$ans"
6485 installprefixexp="$ansexp"
6487 : set the prefixit variable, to compute a suitable default value
6488 prefixit='case "$3" in
6490 case "$oldprefix" in
6491 "") eval "$1=\"\$$2\"";;
6498 ""|" ") eval "$1=\"\$$2\"";;
6504 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6506 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6507 /*-$oldprefix/*|\~*-$oldprefix/*)
6508 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6509 *) eval "$1=\"\$$2\"";;
6513 : get the patchlevel
6515 echo "Getting the current patchlevel..." >&4
6516 if $test -r $rsrc/patchlevel.h;then
6517 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6518 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6519 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6520 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6521 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6522 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6523 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6532 $echo "(You do not have patchlevel.h. Eek.)"
6534 if $test -r $rsrc/.patch ; then
6535 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6536 perl_patchlevel=`cat $rsrc/.patch`
6539 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6540 version_patchlevel_string="version $patchlevel subversion $subversion"
6541 case "$perl_patchlevel" in
6543 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6546 $echo "(You have $package $version_patchlevel_string.)"
6550 : XXX Should be a Configure test for double-dots in filenames.
6551 version=`echo $revision $patchlevel $subversion | \
6552 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6553 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6554 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6557 version=`echo $revision $patchlevel $subversion | \
6558 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6559 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6560 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6563 : Special case the 5.005_xx maintenance series, which used 5.005
6564 : without any subversion label as a subdirectory in $sitelib
6565 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6566 api_versionstring='5.005'
6569 : determine installation style
6570 : For now, try to deduce it from prefix unless it is already set.
6571 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6572 case "$installstyle" in
6573 '') case "$prefix" in
6574 *perl*) dflt='lib';;
6575 *) dflt='lib/perl5' ;;
6578 *) dflt="$installstyle" ;;
6580 : Probably not worth prompting for this since we prompt for all
6581 : the directories individually, and the prompt would be too long and
6585 : determine where private library files go
6586 : Usual default is /usr/local/lib/perl5/$version.
6587 : Also allow things like /opt/perl/lib/$version, since
6588 : /opt/perl/lib/perl5... would be redundant.
6589 : The default "style" setting is made in installstyle.U
6590 case "$installstyle" in
6591 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6592 *) set dflt privlib lib/$version ;;
6597 There are some auxiliary files for $package that need to be put into a
6598 private library directory that is accessible by everyone.
6602 rp='Pathname where the private library files will reside?'
6605 privlibexp="$ansexp"
6606 : Change installation prefix, if necessary.
6607 if $test X"$prefix" != X"$installprefix"; then
6608 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6610 installprivlib="$privlibexp"
6613 : set the prefixup variable, to restore leading tilda escape
6614 prefixup='case "$prefixexp" in
6616 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6619 : determine where public architecture dependent libraries go
6622 : privlib default is /usr/local/lib/$package/$version
6623 : archlib default is /usr/local/lib/$package/$version/$archname
6624 : privlib may have an optional trailing /share.
6625 tdflt=`echo $privlib | $sed 's,/share$,,'`
6626 tdflt=$tdflt/$archname
6635 $spackage contains architecture-dependent library files. If you are
6636 sharing libraries in a heterogeneous environment, you might store
6637 these files in a separate location. Otherwise, you can just include
6638 them with the rest of the public library files.
6642 rp='Where do you want to put the public architecture-dependent libraries?'
6645 archlibexp="$ansexp"
6646 if $test X"$archlib" = X"$privlib"; then
6651 : Change installation prefix, if necessary.
6652 if $test X"$prefix" != X"$installprefix"; then
6653 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6655 installarchlib="$archlibexp"
6658 : see if setuid scripts can be secure
6661 Some kernels have a bug that prevents setuid #! scripts from being
6662 secure. Some sites have disabled setuid #! scripts because of this.
6664 First let's decide if your kernel supports secure setuid #! scripts.
6665 (If setuid #! scripts would be secure but have been disabled anyway,
6666 don't say that they are secure if asked.)
6671 if $test -d /dev/fd; then
6672 echo "#!$ls" >reflect
6673 chmod +x,u+s reflect
6674 ./reflect >flect 2>&1
6675 if $contains "/dev/fd" flect >/dev/null; then
6676 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6680 If you are not sure if they are secure, I can check but I'll need a
6681 username and password different from the one you are using right now.
6682 If you don't have such a username or don't want me to test, simply
6686 rp='Other username to test security of setuid scripts with?'
6691 case "$d_suidsafe" in
6692 '') echo "I'll assume setuid scripts are *not* secure." >&4
6695 echo "Well, the $hint value is *not* secure." >&4
6697 *) echo "Well, the $hint value *is* secure." >&4
6702 $rm -f reflect flect
6703 echo "#!$ls" >reflect
6704 chmod +x,u+s reflect
6707 echo '"su" will (probably) prompt you for '"$ans's password."
6708 su $ans -c './reflect >flect'
6709 if $contains "/dev/fd" flect >/dev/null; then
6710 echo "Okay, it looks like setuid scripts are secure." >&4
6713 echo "I don't think setuid scripts are secure." >&4
6718 rp='Does your kernel have *secure* setuid scripts?'
6721 [yY]*) val="$define";;
6726 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6727 echo "(That's for file descriptors, not floppy disks.)"
6733 $rm -f reflect flect
6735 : now see if they want to do setuid emulation
6738 case "$d_suidsafe" in
6741 echo "No need to emulate SUID scripts since they are secure here." >&4
6745 Some systems have disabled setuid scripts, especially systems where
6746 setuid scripts cannot be secure. On systems where setuid scripts have
6747 been disabled, the setuid/setgid bits on scripts are currently
6748 useless. It is possible for $package to detect those bits and emulate
6749 setuid/setgid in a secure fashion. This emulation will only work if
6750 setuid scripts have been disabled in your kernel.
6754 "$define") dflt=y ;;
6757 rp="Do you want to do setuid/setgid emulation?"
6760 [yY]*) val="$define";;
6768 : see if this is a malloc.h system
6769 : we want a real compile instead of Inhdr because some systems have a
6770 : malloc.h that just gives a compile error saying to use stdlib.h instead
6775 int main () { return 0; }
6778 if eval $compile; then
6779 echo "<malloc.h> found." >&4
6782 echo "<malloc.h> NOT found." >&4
6789 : check for void type
6791 echo "Checking to see how well your C compiler groks the void type..." >&4
6792 case "$voidflags" in
6804 extern void moo(); /* function returning void */
6805 void (*goo)(); /* ptr to func returning void */
6807 void *hue; /* generic ptr */
6820 int main() { sub(); }
6822 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6823 voidflags=$defvoidused
6824 echo "Good. It appears to support void to the level $package wants.">&4
6825 if $contains warning .out >/dev/null 2>&1; then
6826 echo "However, you might get some warnings that look like this:"
6830 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6831 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6832 echo "It supports 1..."
6833 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6834 echo "It also supports 2..."
6835 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6837 echo "And it supports 4 but not 8 definitely."
6839 echo "It doesn't support 4..."
6840 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6842 echo "But it supports 8."
6845 echo "Neither does it support 8."
6849 echo "It does not support 2..."
6850 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6852 echo "But it supports 4 and 8."
6854 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6856 echo "And it supports 4 but has not heard about 8."
6858 echo "However it supports 8 but not 4."
6863 echo "There is no support at all for void."
6868 case "$voidflags" in
6871 Support flag bits are:
6872 1: basic void declarations.
6873 2: arrays of pointers to functions returning void.
6874 4: operations between pointers to and addresses of void functions.
6875 8: generic void pointers.
6878 rp="Your void support flags add up to what?"
6885 : check for length of pointer
6889 echo "Checking to see how big your pointers are..." >&4
6890 if test "$voidflags" -gt 7; then
6891 echo '#define VOID_PTR char *' > try.c
6893 echo '#define VOID_PTR void *' > try.c
6903 printf("%d\n", (int)sizeof(VOID_PTR));
6908 if eval $compile_ok; then
6909 ptrsize=`$run ./try`
6910 echo "Your pointers are $ptrsize bytes long."
6913 echo "(I can't seem to compile the test program. Guessing...)" >&4
6914 rp="What is the size of a pointer (in bytes)?"
6921 case "$use64bitall" in
6922 "$define"|true|[yY]*)
6926 *** You have chosen a maximally 64-bit build, but your pointers
6927 *** are only 4 bytes wide, disabling maximal 64-bitness.
6930 use64bitall="$undef"
6931 case "$use64bitint" in
6932 "$define"|true|[yY]*) ;;
6935 *** Downgrading from maximal 64-bitness to using 64-bit integers.
6938 use64bitint="$define"
6947 : determine which malloc to compile in
6949 case "$usemymalloc" in
6950 [yY]*|true|$define) dflt='y' ;;
6951 [nN]*|false|$undef) dflt='n' ;;
6952 *) case "$ptrsize" in
6958 rp="Do you wish to attempt to use the malloc that comes with $package?"
6964 mallocsrc='malloc.c'
6965 mallocobj="malloc$_o"
6966 d_mymalloc="$define"
6969 : Remove malloc from list of libraries to use
6970 echo "Removing unneeded -lmalloc from library list" >&4
6971 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6974 echo "libs = $libs" >&4
6986 : compute the return types of malloc and free
6988 $cat >malloc.c <<END
6992 #include <sys/types.h>
7006 case "$malloctype" in
7008 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
7015 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
7019 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
7026 echo "Your system uses $freetype free(), it would seem." >&4
7030 After $package is installed, you may wish to install various
7031 add-on modules and utilities. Typically, these add-ons will
7032 be installed under $prefix with the rest
7033 of this package. However, you may wish to install such add-ons
7034 elsewhere under a different prefix.
7036 If you do not wish to put everything under a single prefix, that's
7037 ok. You will be prompted for the individual locations; this siteprefix
7038 is only used to suggest the defaults.
7040 The default should be fine for most people.
7044 rp='Installation prefix to use for add-on modules and utilities?'
7045 : XXX Here might be another good place for an installstyle setting.
7046 case "$siteprefix" in
7048 *) dflt=$siteprefix ;;
7051 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7053 case "$siteprefix" in
7057 *) oldsiteprefix="$prefix";;
7062 siteprefixexp="$ansexp"
7064 : determine where site specific libraries go.
7065 : Usual default is /usr/local/lib/perl5/site_perl/$version
7066 : The default "style" setting is made in installstyle.U
7067 : XXX No longer works with Prefixit stuff.
7068 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7070 '') case "$installstyle" in
7071 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
7072 *) dflt=$siteprefix/lib/site_$prog/$version ;;
7080 The installation process will create a directory for
7081 site-specific extensions and modules. Most users find it convenient
7082 to place all site-specific files in this directory rather than in the
7083 main distribution directory.
7087 rp='Pathname for the site-specific library files?'
7090 sitelibexp="$ansexp"
7091 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
7092 : Change installation prefix, if necessary.
7093 if $test X"$prefix" != X"$installprefix"; then
7094 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
7096 installsitelib="$sitelibexp"
7099 : determine where site specific architecture-dependent libraries go.
7100 : sitelib default is /usr/local/lib/perl5/site_perl/$version
7101 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
7102 : sitelib may have an optional trailing /share.
7104 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
7105 dflt="$dflt/$archname"
7110 set sitearch sitearch none
7114 The installation process will also create a directory for
7115 architecture-dependent site-specific extensions and modules.
7119 rp='Pathname for the site-specific architecture-dependent library files?'
7122 sitearchexp="$ansexp"
7123 : Change installation prefix, if necessary.
7124 if $test X"$prefix" != X"$installprefix"; then
7125 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
7127 installsitearch="$sitearchexp"
7132 The installation process will also create a directory for
7133 vendor-supplied add-ons. Vendors who supply perl with their system
7134 may find it convenient to place all vendor-supplied files in this
7135 directory rather than in the main distribution directory. This will
7136 ease upgrades between binary-compatible maintenance versions of perl.
7138 Of course you may also use these directories in whatever way you see
7139 fit. For example, you might use them to access modules shared over a
7140 company-wide network.
7142 The default answer should be fine for most people.
7143 This causes further questions about vendor add-ons to be skipped
7144 and no vendor-specific directories will be configured for perl.
7147 rp='Do you want to configure vendor-specific add-on directories?'
7148 case "$usevendorprefix" in
7149 define|true|[yY]*) dflt=y ;;
7150 *) : User may have set vendorprefix directly on Configure command line.
7151 case "$vendorprefix" in
7160 rp='Installation prefix to use for vendor-supplied add-ons?'
7161 case "$vendorprefix" in
7163 *) dflt=$vendorprefix ;;
7166 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7168 case "$vendorprefix" in
7172 *) oldvendorprefix="$prefix";;
7176 usevendorprefix="$define"
7178 vendorprefixexp="$ansexp"
7180 *) usevendorprefix="$undef"
7186 case "$vendorprefix" in
7187 '') d_vendorlib="$undef"
7191 *) d_vendorlib="$define"
7192 : determine where vendor-supplied modules go.
7193 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7194 case "$vendorlib" in
7196 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7197 case "$installstyle" in
7198 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7199 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7202 *) dflt="$vendorlib"
7206 rp='Pathname for the vendor-supplied library files?'
7209 vendorlibexp="$ansexp"
7212 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7213 : Change installation prefix, if necessary.
7214 if $test X"$prefix" != X"$installprefix"; then
7215 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7217 installvendorlib="$vendorlibexp"
7220 case "$vendorprefix" in
7221 '') d_vendorarch="$undef"
7225 *) d_vendorarch="$define"
7226 : determine where vendor-supplied architecture-dependent libraries go.
7227 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7228 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7229 : vendorlib may have an optional trailing /share.
7230 case "$vendorarch" in
7231 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7232 dflt="$dflt/$archname"
7234 *) dflt="$vendorarch" ;;
7237 rp='Pathname for vendor-supplied architecture-dependent files?'
7240 vendorarchexp="$ansexp"
7243 : Change installation prefix, if necessary.
7244 if $test X"$prefix" != X"$installprefix"; then
7245 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7247 installvendorarch="$vendorarchexp"
7250 : Final catch-all directories to search
7253 Lastly, you can have perl look in other directories for extensions and
7254 modules in addition to those already specified.
7255 These directories will be searched after
7259 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7260 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7262 case "$otherlibdirs" in
7263 ''|' ') dflt='none' ;;
7264 *) dflt="$otherlibdirs" ;;
7267 Enter a colon-separated set of extra paths to include in perl's @INC
7268 search path, or enter 'none' for no extra paths.
7272 rp='Colon-separated list of additional directories for perl to search?'
7275 ' '|''|none) otherlibdirs=' ' ;;
7276 *) otherlibdirs="$ans" ;;
7278 case "$otherlibdirs" in
7282 set d_perl_otherlibdirs
7285 : Cruising for prototypes
7287 echo "Checking out function prototypes..." >&4
7288 $cat >prototype.c <<'EOCP'
7289 int main(int argc, char *argv[]) {
7292 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7293 echo "Your C compiler appears to support function prototypes."
7296 echo "Your C compiler doesn't seem to understand function prototypes."
7303 case "$prototype" in
7305 *) ansi2knr='ansi2knr'
7310 This version of $package can only be compiled by a compiler that
7311 understands function prototypes. Unfortunately, your C compiler
7313 doesn't seem to understand them. Sorry about that.
7315 If GNU cc is available for your system, perhaps you could try that instead.
7317 Eventually, we hope to support building Perl with pre-ANSI compilers.
7318 If you would like to help in that effort, please contact <perlbug@perl.org>.
7320 Aborting Configure now.
7326 : determine where public executables go
7331 rp='Pathname where the public executables will reside?'
7333 if $test "X$ansexp" != "X$binexp"; then
7338 : Change installation prefix, if necessary.
7339 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7340 if $test X"$prefix" != X"$installprefix"; then
7341 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7343 installbin="$binexp"
7352 Perl can be built with extra modules or bundles of modules which
7353 will be fetched from the CPAN and installed alongside Perl.
7355 Notice that you will need access to the CPAN; either via the Internet,
7356 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7357 be asked later to configure the CPAN.pm module which will in turn do
7358 the installation of the rest of the extra modules or bundles.)
7360 Notice also that if the modules require any external software such as
7361 libraries and headers (the libz library and the zlib.h header for the
7362 Compress::Zlib module, for example) you MUST have any such software
7363 already installed, this configuration process will NOT install such
7366 If this doesn't make any sense to you, just accept the default '$dflt'.
7368 rp='Install any extra modules (y or n)?'
7374 Please list any extra modules or bundles to be installed from CPAN,
7375 with spaces between the names. The names can be in any format the
7376 'install' command of CPAN.pm will understand. (Answer 'none',
7377 without the quotes, to install no extra modules or bundles.)
7387 $rm -f ../extras.lst
7389 *) echo "(Saving the list of extras for later...)"
7390 echo "$extras" > ../extras.lst
7398 : determine where html pages for programs go
7399 set html1dir html1dir none
7403 If you wish to install html files for programs in $spackage, indicate
7404 the appropriate directory here. To skip installing html files,
7408 ''|none|$undef|' ') dflt=none ;;
7409 *) dflt=$html1dir ;;
7412 rp="Directory for the main $spackage html pages?"
7415 html1direxp="$ansexp"
7416 : Use ' ' for none so value is preserved next time through Configure
7417 $test X"$html1dir" = "X" && html1dir=' '
7418 : Change installation prefix, if necessary.
7419 if $test X"$prefix" != X"$installprefix"; then
7420 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
7422 installhtml1dir="$html1direxp"
7425 : determine where html pages for libraries and modules go
7426 set html3dir html3dir none
7430 If you wish to install html files for modules associated with $spackage,
7431 indicate the appropriate directory here. To skip installing html files,
7434 : There is no obvious default. If they have specified html1dir, then
7435 : try to key off that, possibly changing .../html1 into .../html3.
7437 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7438 *) dflt=$html3dir ;;
7441 rp="Directory for the $spackage module html pages?"
7444 html3direxp="$ansexp"
7445 : Use ' ' for none so value is preserved next time through Configure
7446 $test X"$html3dir" = "X" && html3dir=' '
7447 : Change installation prefix, if necessary.
7448 if $test X"$prefix" != X"$installprefix"; then
7449 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
7451 installhtml3dir="$html3direxp"
7454 : Find perl5.005 or later.
7455 echo "Looking for a previously installed perl5.005 or later... "
7457 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7458 : Check if this perl is recent and can load a simple module
7459 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7462 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7472 '') echo "None found. That's ok.";;
7473 *) echo "Using $perl5." ;;
7476 : Determine list of previous versions to include in @INC
7477 $cat > getverlist <<EOPL
7480 \$api_versionstring = "$api_versionstring";
7481 \$version = "$version";
7482 \$stem = "$sitelib_stem";
7483 \$archname = "$archname";
7485 $cat >> getverlist <<'EOPL'
7486 # Can't have leading @ because metaconfig interprets it as a command!
7487 ;@inc_version_list=();
7488 # XXX Redo to do opendir/readdir?
7491 ;@candidates = glob("5.*");
7497 # XXX ToDo: These comparisons must be reworked when two-digit
7498 # subversions come along, so that 5.7.10 compares as greater than
7499 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7500 # widespread that we can use the built-in version vectors rather
7501 # than reinventing them here. For 5.6.0, however, we must
7502 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7503 foreach $d (@candidates) {
7504 if ($d lt $version) {
7505 if ($d ge $api_versionstring) {
7506 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7508 elsif ($d ge "5.005") {
7509 unshift(@inc_version_list, grep { -d } $d);
7513 # Skip newer version. I.e. don't look in
7514 # 5.7.0 if we're installing 5.6.1.
7518 if (@inc_version_list) {
7519 print join(' ', @inc_version_list);
7522 # Blank space to preserve value for next Configure run.
7527 case "$inc_version_list" in
7528 '') if test -x "$perl5$exe_ext"; then
7529 dflt=`$perl5 getverlist`
7534 $undef) dflt='none' ;;
7535 *) eval dflt=\"$inc_version_list\" ;;
7538 ''|' ') dflt=none ;;
7545 In order to ease the process of upgrading, this version of perl
7546 can be configured to use modules built and installed with earlier
7547 versions of perl that were installed under $prefix. Specify here
7548 the list of earlier versions that this version of perl should check.
7549 If Configure detected no earlier versions of perl installed under
7550 $prefix, then the list will be empty. Answer 'none' to tell perl
7551 to not search earlier versions.
7553 The default should almost always be sensible, so if you're not sure,
7554 just accept the default.
7557 rp='List of earlier versions to include in @INC?'
7560 [Nn]one|''|' ') inc_version_list=' ' ;;
7561 *) inc_version_list="$ans" ;;
7563 case "$inc_version_list" in
7565 inc_version_list_init='0';;
7566 *) inc_version_list_init=`echo $inc_version_list |
7567 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7572 : determine whether to install perl also as /usr/bin/perl
7575 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7577 Many scripts expect perl to be installed as /usr/bin/perl.
7579 If you want to, I can install the perl you are about to compile
7580 as /usr/bin/perl (in addition to $bin/perl).
7582 if test -f /usr/bin/perl; then
7585 However, please note that because you already have a /usr/bin/perl,
7586 overwriting that with a new Perl would very probably cause problems.
7587 Therefore I'm assuming you don't want to do that (unless you insist).
7590 case "$installusrbinperl" in
7591 "$define"|[yY]*) dflt='y';;
7597 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7600 case "$installusrbinperl" in
7601 "$undef"|[nN]*) dflt='n';;
7605 rp="Do you want to install perl as /usr/bin/perl?"
7608 [yY]*) val="$define";;
7614 set installusrbinperl
7617 : see if dld is available
7621 : see if dlopen exists
7628 : determine which dynamic loading, if any, to compile in
7630 dldir="ext/DynaLoader"
7643 $define) dflt='y' ;;
7646 $define) dflt='y' ;;
7648 : Does a dl_xxx.xs file exist for this operating system
7649 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7652 rp="Do you wish to use dynamic loading?"
7659 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7660 dflt="$dldir/dl_${osname}.xs"
7661 elif $test "$d_dlopen" = "$define" ; then
7662 dflt="$dldir/dl_dlopen.xs"
7663 elif $test "$i_dld" = "$define" ; then
7664 dflt="$dldir/dl_dld.xs"
7669 *) dflt="$dldir/$dlsrc"
7672 echo "The following dynamic loading files are available:"
7673 : Can not go over to $dldir because getfile has path hard-coded in.
7674 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7675 rp="Source file to use for dynamic loading"
7681 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7685 Some systems may require passing special flags to $cc -c to
7686 compile modules that will be used to create a shared library.
7687 To use no flags, say "none".
7690 case "$cccdlflags" in
7691 '') case "$gccversion" in
7692 '') case "$osname" in
7694 next) dflt='none' ;;
7695 irix*) dflt='-KPIC' ;;
7696 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7697 sunos) dflt='-pic' ;;
7701 *) case "$osname" in
7702 darwin) dflt='none' ;;
7703 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7708 *) dflt="$cccdlflags" ;;
7710 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7713 none) cccdlflags=' ' ;;
7714 *) cccdlflags="$ans" ;;
7719 Some systems use ld to create libraries that can be dynamically loaded,
7720 while other systems (such as those using ELF) use $cc.
7724 '') $cat >try.c <<'EOM'
7725 /* Test for whether ELF binaries are produced */
7730 int i = open("a.out",O_RDONLY);
7733 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7734 exit(0); /* succeed (yes, it's ELF) */
7739 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7741 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7745 echo "I'll use ld to build dynamic libraries."
7754 rp="What command should be used to create dynamic libraries?"
7760 Some systems may require passing special flags to $ld to create a
7761 library that can be dynamically loaded. If your ld flags include
7762 -L/other/path options to locate libraries outside your loader's normal
7763 search path, you may need to specify those -L options here as well. To
7764 use no flags, say "none".
7767 case "$lddlflags" in
7768 '') case "$osname" in
7769 beos) dflt='-nostart' ;;
7771 case "$gccversion" in
7772 '') dflt="$dflt +vnocompatwarnings" ;;
7775 linux|irix*) dflt='-shared' ;;
7776 next) dflt='none' ;;
7777 solaris) dflt='-G' ;;
7778 sunos) dflt='-assert nodefinitions' ;;
7779 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7783 *) dflt="$lddlflags" ;;
7786 : Try to guess additional flags to pick up local libraries.
7787 : Be careful not to append to a plain 'none'
7791 for thisflag in $ldflags; do
7796 *) dflt="$dflt $thisflag" ;;
7803 ''|' ') dflt='none' ;;
7806 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7809 none) lddlflags=' ' ;;
7810 *) lddlflags="$ans" ;;
7815 Some systems may require passing special flags to $cc to indicate that
7816 the resulting executable will use dynamic linking. To use no flags,
7820 case "$ccdlflags" in
7821 '') case "$osname" in
7822 hpux) dflt='-Wl,-E' ;;
7823 linux) dflt='-rdynamic' ;;
7824 next) dflt='none' ;;
7825 sunos) dflt='none' ;;
7829 *) dflt="$ccdlflags" ;;
7831 rp="Any special flags to pass to $cc to use dynamic linking?"
7834 none) ccdlflags=' ' ;;
7835 *) ccdlflags="$ans" ;;
7849 # No dynamic loading being used, so don't bother even to prompt.
7852 *) case "$useshrplib" in
7853 '') case "$osname" in
7854 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7856 also='Building a shared libperl is required for dynamic loading to work on your system.'
7861 also='Building a shared libperl is needed for MAB support.'
7879 The perl executable is normally obtained by linking perlmain.c with
7880 libperl${_a}, any static extensions (usually just DynaLoader), and
7881 any other libraries needed on this system (such as -lm, etc.). Since
7882 your system supports dynamic loading, it is probably possible to build
7883 a shared libperl.$so. If you will have more than one executable linked
7884 to libperl.$so, this will significantly reduce the size of each
7885 executable, but it may have a noticeable affect on performance. The
7886 default is probably sensible for your system.
7890 rp="Build a shared libperl.$so (y/n)"
7894 useshrplib='true' ;;
7895 *) useshrplib='false' ;;
7900 case "$useshrplib" in
7904 # Figure out a good name for libperl.so. Since it gets stored in
7905 # a version-specific architecture-dependent library, the version
7906 # number isn't really that important, except for making cc/ld happy.
7908 # A name such as libperl.so.3.1
7909 majmin="libperl.$so.$patchlevel.$subversion"
7910 # A name such as libperl.so.301
7911 majonly=`echo $patchlevel $subversion |
7912 $awk '{printf "%d%02d", $1, $2}'`
7913 majonly=libperl.$so.$majonly
7914 # I'd prefer to keep the os-specific stuff here to a minimum, and
7915 # rely on figuring it out from the naming of libc.
7916 case "${osname}${osvers}" in
7919 # XXX How handle the --version stuff for MAB?
7921 linux*) # ld won't link with a bare -lperl otherwise.
7924 cygwin*) # ld links against an importlib
7925 dflt=libperl$lib_ext
7927 *) # Try to guess based on whether libc has major.minor.
7929 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7930 *libc.$so.[0-9]*) dflt=$majonly ;;
7931 *) dflt=libperl.$so ;;
7941 I need to select a good name for the shared libperl. If your system uses
7942 library names with major and minor numbers, then you might want something
7943 like $majmin. Alternatively, if your system uses a single version
7944 number for shared libraries, then you might want to use $majonly.
7945 Or, your system might be quite happy with a simple libperl.$so.
7947 Since the shared libperl will get installed into a version-specific
7948 architecture-dependent directory, the version number of the shared perl
7949 library probably isn't important, so the default should be o.k.
7952 rp='What name do you want to give to the shared libperl?'
7955 echo "Ok, I'll use $libperl"
7958 libperl="libperl${_a}"
7962 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7966 WARNING: Use of the shrpdir variable for the installation location of
7967 the shared $libperl is not supported. It was never documented and
7968 will not work in this version. Let me (perlbug@perl.org)
7969 know of any problems this may cause.
7975 But your current setting of $shrpdir is
7976 the default anyway, so it's harmless.
7981 Further, your current attempted setting of $shrpdir
7982 conflicts with the value of $archlibexp/CORE
7983 that installperl will use.
7990 # How will the perl executable find the installed shared $libperl?
7991 # Add $xxx to ccdlflags.
7992 # If we can't figure out a command-line option, use $shrpenv to
7993 # set env LD_RUN_PATH. The main perl makefile uses this.
7994 shrpdir=$archlibexp/CORE
7997 if "$useshrplib"; then
8000 # We'll set it in Makefile.SH...
8005 freebsd|netbsd|openbsd)
8006 xxx="-Wl,-R$shrpdir"
8008 bsdos|linux|irix*|dec_osf)
8009 xxx="-Wl,-rpath,$shrpdir"
8012 # next doesn't like the default...
8015 # beos doesn't like the default, either.
8018 # hpux doesn't like the default, either.
8019 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8022 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8028 # Only add $xxx if it isn't already in ccdlflags.
8029 case " $ccdlflags " in
8031 *) ccdlflags="$ccdlflags $xxx"
8034 Adding $xxx to the flags
8035 passed to $ld so that the perl executable will find the
8036 installed shared $libperl.
8044 # Fix ccdlflags in AIX for building external extensions.
8045 # (For building Perl itself bare -bE:perl.exp is needed,
8046 # Makefile.SH takes care of this.)
8048 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8050 # Respect a hint or command-line value.
8052 '') shrpenv="$tmp_shrpenv" ;;
8054 case "$ldlibpthname" in
8055 '') ldlibpthname=LD_LIBRARY_PATH ;;
8056 none) ldlibpthname='' ;;
8059 : determine where manual pages are on this system
8063 syspath='/usr/share/man/man1 /usr/man/man1'
8064 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8065 syspath="$syspath /usr/man/u_man/man1"
8066 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8067 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8068 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8069 sysman=`./loc . /usr/man/man1 $syspath`
8072 if $test -d "$sysman"; then
8073 echo "System manual is in $sysman." >&4
8075 echo "Could not find manual pages in source form." >&4
8078 : determine where manual pages go
8079 set man1dir man1dir none
8083 $spackage has manual pages available in source form.
8087 echo "However, you don't have nroff, so they're probably useless to you."
8089 '') man1dir="none";;
8092 echo "If you don't want the manual sources installed, answer 'none'."
8097 lookpath="$prefixexp/share/man/man1"
8098 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8099 lookpath="$lookpath $prefixexp/man/p_man/man1"
8100 lookpath="$lookpath $prefixexp/man/u_man/man1"
8101 lookpath="$lookpath $prefixexp/man/man.1"
8103 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8104 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8114 rp="Where do the main $spackage manual pages (source) go?"
8116 if $test "X$man1direxp" != "X$ansexp"; then
8120 man1direxp="$ansexp"
8126 : Change installation prefix, if necessary.
8127 if $test X"$prefix" != X"$installprefix"; then
8128 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8130 installman1dir="$man1direxp"
8133 : What suffix to use on installed man pages
8140 rp="What suffix should be used for the main $spackage man pages?"
8142 '') case "$man1dir" in
8156 *) dflt="$man1ext";;
8163 : see if we can have long filenames
8165 first=123456789abcdef
8167 if (echo hi >$first) 2>/dev/null; then
8168 if $test -f 123456789abcde; then
8169 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8172 echo 'You can have filenames longer than 14 characters.'>&4
8177 You can't have filenames longer than 14 chars.
8178 You can't even think about them!
8184 $rm -rf 123456789abcde*
8186 : determine where library module manual pages go
8187 set man3dir man3dir none
8191 $spackage has manual pages for many of the library modules.
8197 However, you don't have nroff, so they're probably useless to you.
8200 '') man3dir="none";;
8204 case "$d_flexfnam" in
8207 However, your system can't handle the long file names like File::Basename.3.
8210 '') man3dir="none";;
8214 echo "If you don't want the manual sources installed, answer 'none'."
8215 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8217 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8218 if $test -d "$privlib/man/man3"; then
8221 WARNING: Previous versions of perl installed man3 pages into
8222 $privlib/man/man3. This version will suggest a
8223 new default of $dflt.
8227 rp='Do you wish to preserve the old behavior?(y/n)'
8230 y*) dflt="$privlib/man/man3" ;;
8235 *) dflt="$man3dir" ;;
8242 rp="Where do the $package library man pages (source) go?"
8245 man3direxp="$ansexp"
8251 : Change installation prefix, if necessary.
8252 if $test X"$prefix" != X"$installprefix"; then
8253 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8255 installman3dir="$man3direxp"
8258 : What suffix to use on installed man pages
8264 rp="What suffix should be used for the $package library man pages?"
8266 '') case "$man3dir" in
8280 *) dflt="$man3ext";;
8287 : see if we have to deal with yellow pages, now NIS.
8288 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8289 if $test -f /usr/etc/nibindd; then
8291 echo "I'm fairly confident you're on a NeXT."
8293 rp='Do you get the hosts file via NetInfo?'
8302 y*) hostcat='nidump hosts .';;
8303 *) case "$hostcat" in
8304 nidump*) hostcat='';;
8314 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8322 rp='Are you getting the hosts file via yellow pages?'
8325 y*) hostcat='ypcat hosts';;
8326 *) hostcat='cat /etc/hosts';;
8332 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8335 '') test -f /etc/group && groupcat='cat /etc/group';;
8338 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8341 : now get the host name
8343 echo "Figuring out host name..." >&4
8344 case "$myhostname" in
8346 echo 'Maybe "hostname" will work...'
8347 if tans=`sh -c hostname 2>&1` ; then
8355 if $test "$cont"; then
8357 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8358 if tans=`cat /etc/systemid 2>&1` ; then
8360 phostname='cat /etc/systemid'
8361 echo "Whadyaknow. Xenix always was a bit strange..."
8364 elif $test -r /etc/systemid; then
8365 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8368 if $test "$cont"; then
8369 echo 'No, maybe "uuname -l" will work...'
8370 if tans=`sh -c 'uuname -l' 2>&1` ; then
8372 phostname='uuname -l'
8374 echo 'Strange. Maybe "uname -n" will work...'
8375 if tans=`sh -c 'uname -n' 2>&1` ; then
8377 phostname='uname -n'
8379 echo 'Oh well, maybe I can mine it out of whoami.h...'
8380 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8381 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8382 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8384 case "$myhostname" in
8385 '') echo "Does this machine have an identity crisis or something?"
8388 echo "Well, you said $myhostname before..."
8389 phostname='echo $myhostname';;
8395 case "$myhostname" in
8396 '') myhostname=noname ;;
8398 : you do not want to know about this
8403 if $test "$myhostname" ; then
8405 rp='Your host name appears to be "'$myhostname'".'" Right?"
8413 : bad guess or no guess
8414 while $test "X$myhostname" = X ; do
8416 rp="Please type the (one word) name of your host:"
8421 : translate upper to lower if necessary
8422 case "$myhostname" in
8424 echo "(Normalizing case in your host name)"
8425 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8429 case "$myhostname" in
8431 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8432 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8433 echo "(Trimming domain name from host name--host name is now $myhostname)"
8435 *) case "$mydomain" in
8438 test "X$hostcat" = "Xypcat hosts" &&
8439 ypmatch "$myhostname" hosts 2>/dev/null |\
8440 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8443 test "X$hostcat" != "X" &&
8444 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8445 /[ ]$myhostname[ . ]/p" > hosts
8448 if $test -f hosts; then
8449 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8450 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8451 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8452 hosts | $sort | $uniq | \
8453 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8454 case `$echo X$dflt` in
8455 X*\ *) echo "(Several hosts in the database matched hostname)"
8458 X.) echo "(You do not have fully-qualified names in the hosts database)"
8462 echo "(I cannot locate a hosts database anywhere)"
8467 tans=`./loc resolv.conf X /etc /usr/etc`
8468 if $test -f "$tans"; then
8469 echo "(Attempting domain name extraction from $tans)"
8470 dflt=.`$sed -n -e 's/ / /g' \
8471 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8472 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8474 .) dflt=.`$sed -n -e 's/ / /g' \
8475 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8476 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8483 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8484 dflt=.`sh -c domainname 2>/dev/null`
8487 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8491 case "$dflt$osname" in
8492 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8493 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8497 .) echo "(Lost all hope -- silly guess then)"
8503 *) dflt="$mydomain";;
8507 rp="What is your domain name?"
8517 : translate upper to lower if necessary
8520 echo "(Normalizing case in your domain name)"
8521 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8525 : a little sanity check here
8526 case "$phostname" in
8529 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8530 $myhostname$mydomain|$myhostname) ;;
8532 case "$phostname" in
8534 echo "(That doesn't agree with your whoami.h file, by the way.)"
8537 echo "(That doesn't agree with your $phostname command, by the way.)"
8547 I need to get your e-mail address in Internet format if possible, i.e.
8548 something like user@host.domain. Please answer accurately since I have
8549 no easy means to double check it. The default value provided below
8550 is most probably close to reality but may not be valid from outside
8551 your organization...
8555 while test "$cont"; do
8557 '') dflt="$cf_by@$myhostname$mydomain";;
8558 *) dflt="$cf_email";;
8560 rp='What is your e-mail address?'
8566 rp='Address does not look like an Internet one. Use it anyway?'
8582 If you or somebody else will be maintaining perl at your site, please
8583 fill in the correct e-mail address here so that they may be contacted
8584 if necessary. Currently, the "perlbug" program included with perl
8585 will send mail to this address in addition to perlbug@perl.org. You may
8586 enter "none" for no administrator.
8589 case "$perladmin" in
8590 '') dflt="$cf_email";;
8591 *) dflt="$perladmin";;
8593 rp='Perl administrator e-mail address'
8597 : determine whether to only install version-specific parts.
8600 Do you want to install only the version-specific parts of the perl
8601 distribution? Usually you do *not* want to do this.
8603 case "$versiononly" in
8604 "$define"|[Yy]*|true) dflt='y' ;;
8607 rp="Do you want to install only the version-specific parts of perl?"
8610 [yY]*) val="$define";;
8616 case "$versiononly" in
8617 "$define") inc_version_list=''
8618 inc_version_list_init=0
8622 : figure out how to guarantee perl startup
8623 case "$startperl" in
8625 case "$sharpbang" in
8629 I can use the #! construct to start perl on your system. This will
8630 make startup of perl scripts faster, but may cause problems if you
8631 want to share those scripts and perl is not in a standard place
8632 ($binexp/perl) on all your platforms. The alternative is to force
8633 a shell by starting the script with a single ':' character.
8636 case "$versiononly" in
8637 "$define") dflt="$binexp/perl$version";;
8638 *) dflt="$binexp/perl";;
8640 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8643 none) startperl=": # use perl";;
8644 *) startperl="#!$ans"
8645 if $test 30 -lt `echo "$ans" | wc -c`; then
8648 WARNING: Some systems limit the #! command to 32 characters.
8649 If you experience difficulty running Perl scripts with #!, try
8650 installing Perl in a directory with a shorter pathname.
8656 *) startperl=": # use perl"
8661 echo "I'll use $startperl to start perl scripts."
8663 : figure best path for perl in scripts
8666 case "$versiononly" in
8667 "$define") perlpath="$binexp/perl$version";;
8668 *) perlpath="$binexp/perl";;
8670 case "$startperl" in
8675 I will use the "eval 'exec'" idiom to start Perl on your system.
8676 I can use the full path of your Perl binary for this purpose, but
8677 doing so may cause problems if you want to share those scripts and
8678 Perl is not always in a standard place ($binexp/perl).
8682 rp="What path shall I use in \"eval 'exec'\"?"
8689 case "$startperl" in
8691 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8694 : determine where public executable scripts go
8695 set scriptdir scriptdir
8697 case "$scriptdir" in
8700 : guess some guesses
8701 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8702 $test -d /usr/share/bin && dflt=/usr/share/bin
8703 $test -d /usr/local/script && dflt=/usr/local/script
8704 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8705 $test -d $prefixexp/script && dflt=$prefixexp/script
8709 *) dflt="$scriptdir"
8714 Some installations have a separate directory just for executable scripts so
8715 that they can mount it across multiple architectures but keep the scripts in
8716 one spot. You might, for example, have a subdirectory of /usr/share for this.
8717 Or you might just lump your scripts in with all your other executables.
8721 rp='Where do you keep publicly executable scripts?'
8723 if $test "X$ansexp" != "X$scriptdirexp"; then
8727 scriptdirexp="$ansexp"
8728 : Change installation prefix, if necessary.
8729 if $test X"$prefix" != X"$installprefix"; then
8730 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8732 installscript="$scriptdirexp"
8735 : determine where add-on public executables go
8737 '') dflt=$siteprefix/bin ;;
8741 rp='Pathname where the add-on public executables should be installed?'
8744 sitebinexp="$ansexp"
8745 : Change installation prefix, if necessary.
8746 if $test X"$prefix" != X"$installprefix"; then
8747 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8749 installsitebin="$sitebinexp"
8752 : determine where add-on html pages go
8753 : There is no standard location, so try to copy the previously-selected
8754 : directory structure for the core html pages.
8755 case "$sitehtml1" in
8756 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8757 *) dflt=$sitehtml1 ;;
8760 ''|' ') dflt=none ;;
8763 rp='Pathname where the site-specific html pages should be installed?'
8766 sitehtml1exp="$ansexp"
8767 : Use ' ' for none so value is preserved next time through Configure
8768 $test X"$sitehtml1" = "X" && sitehtml1=' '
8769 : Change installation prefix, if necessary.
8770 if $test X"$prefix" != X"$installprefix"; then
8771 installsitehtml1=`echo "$sitehtml1exp" | $sed "s#^$prefix#$installprefix#"`
8773 installsitehtml1="$sitehtml1exp"
8776 : determine where add-on library html pages go
8777 : There is no standard location, so try to copy the previously-selected
8778 : directory structure for the core html pages.
8779 case "$sitehtml3" in
8780 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8781 *) dflt=$sitehtml3 ;;
8784 ''|' ') dflt=none ;;
8787 rp='Pathname where the site-specific library html pages should be installed?'
8790 sitehtml3exp="$ansexp"
8791 : Use ' ' for none so value is preserved next time through Configure
8792 $test X"$sitehtml3" = "X" && sitehtml3=' '
8793 : Change installation prefix, if necessary.
8794 if $test X"$prefix" != X"$installprefix"; then
8795 installsitehtml3=`echo "$sitehtml3exp" | $sed "s#^$prefix#$installprefix#"`
8797 installsitehtml3="$sitehtml3exp"
8800 : determine where add-on manual pages go
8802 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8803 *) dflt=$siteman1 ;;
8806 ''|' ') dflt=none ;;
8809 rp='Pathname where the site-specific manual pages should be installed?'
8812 siteman1exp="$ansexp"
8813 : Use ' ' for none so value is preserved next time through Configure
8814 $test X"$siteman1" = "X" && siteman1=' '
8815 : Change installation prefix, if necessary.
8816 if $test X"$prefix" != X"$installprefix"; then
8817 installsiteman1=`echo "$siteman1exp" | $sed "s#^$prefix#$installprefix#"`
8819 installsiteman1="$siteman1exp"
8822 : determine where add-on library man pages go
8824 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8825 *) dflt=$siteman3 ;;
8828 ''|' ') dflt=none ;;
8831 rp='Pathname where the site-specific library manual pages should be installed?'
8834 siteman3exp="$ansexp"
8835 : Use ' ' for none so value is preserved next time through Configure
8836 $test X"$siteman3" = "X" && siteman3=' '
8837 : Change installation prefix, if necessary.
8838 if $test X"$prefix" != X"$installprefix"; then
8839 installsiteman3=`echo "$siteman3exp" | $sed "s#^$prefix#$installprefix#"`
8841 installsiteman3="$siteman3exp"
8844 : determine where add-on public executable scripts go
8845 case "$sitescript" in
8846 '') dflt=$siteprefix/script
8847 $test -d $dflt || dflt=$sitebin ;;
8848 *) dflt="$sitescript" ;;
8851 rp='Pathname where add-on public executable scripts should be installed?'
8854 sitescriptexp="$ansexp"
8855 : Change installation prefix, if necessary.
8856 if $test X"$prefix" != X"$installprefix"; then
8857 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8859 installsitescript="$sitescriptexp"
8862 : define an is-a-typedef? function
8863 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8865 "") inclist="sys/types.h";;
8867 eval "varval=\$$var";
8871 for inc in $inclist; do
8872 echo "#include <$inc>" >>temp.c;
8874 echo "#ifdef $type" >> temp.c;
8875 echo "printf(\"We have $type\");" >> temp.c;
8876 echo "#endif" >> temp.c;
8877 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8878 if $contains $type temp.E >/dev/null 2>&1; then
8884 *) eval "$var=\$varval";;
8887 : define an is-a-typedef? function that prompts if the type is not available.
8888 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8890 "") inclist="sys/types.h";;
8892 eval "varval=\$$var";
8896 for inc in $inclist; do
8897 echo "#include <$inc>" >>temp.c;
8899 echo "#ifdef $type" >> temp.c;
8900 echo "printf(\"We have $type\");" >> temp.c;
8901 echo "#endif" >> temp.c;
8902 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8904 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8905 if $contains $type temp.E >/dev/null 2>&1; then
8906 echo "$type found." >&4;
8909 echo "$type NOT found." >&4;
8915 *) eval "$var=\$varval";;
8918 : see what type lseek is declared as in the kernel
8919 rp="What is the type used for lseek's offset on this system?"
8920 set off_t lseektype long stdio.h sys/types.h
8924 echo "Checking to see how big your file offsets are..." >&4
8926 #include <sys/types.h>
8930 printf("%d\n", (int)sizeof($lseektype));
8935 if eval $compile_ok; then
8936 lseeksize=`$run ./try`
8937 echo "Your file offsets are $lseeksize bytes long."
8941 echo "(I can't seem to compile the test program. Guessing...)"
8942 rp="What is the size of your file offsets (in bytes)?"
8948 : see what type file positions are declared as in the library
8949 rp="What is the type for file position used by fsetpos()?"
8950 set fpos_t fpostype long stdio.h sys/types.h
8955 *_t) zzz="$fpostype" ;;
8958 echo "Checking the size of $zzz..." >&4
8960 #include <sys/types.h>
8967 printf("%d\n", (int)sizeof($fpostype));
8972 if eval $compile_ok; then
8976 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8979 echo "Your $zzz is $fpossize bytes long."
8985 echo "(I can't compile the test program. Guessing...)" >&4
8986 rp="What is the size of your file positions (in bytes)?"
8993 # Backward compatibility (uselfs is deprecated).
8995 "$define"|true|[yY]*)
8998 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9000 uselargefiles="$define"
9004 case "$lseeksize:$fpossize" in
9007 You can have files larger than 2 gigabytes.
9010 *) case "$uselargefiles" in
9011 "$undef"|false|[nN]*) dflt='n' ;;
9016 Perl can be built to understand large files (files larger than 2 gigabytes)
9017 on some systems. To do so, Configure can be run with -Duselargefiles.
9019 If this doesn't make any sense to you, just accept the default '$dflt'.
9021 rp='Try to understand large files, if available?'
9024 y|Y) val="$define" ;;
9031 case "$uselargefiles" in
9033 : Look for a hint-file generated 'call-back-unit'. If the
9034 : user has specified that a large files perl is to be built,
9035 : we may need to set or change some other defaults.
9036 if $test -f uselargefiles.cbu; then
9037 echo "Your platform has some specific hints for large file builds, using them..."
9038 . ./uselargefiles.cbu
9040 echo "Rechecking to see how big your file offsets are..." >&4
9042 #include <sys/types.h>
9046 printf("%d\n", (int)sizeof($lseektype));
9051 if eval $compile_ok; then
9052 lseeksize=`$run ./try`
9053 $echo "Your file offsets are now $lseeksize bytes long."
9057 echo "(I can't seem to compile the test program. Guessing...)"
9058 rp="What is the size of your file offsets (in bytes)?"
9063 *_t) zzz="$fpostype" ;;
9066 $echo $n "Rechecking the size of $zzz...$c" >&4
9068 #include <sys/types.h>
9071 printf("%d\n", (int)sizeof($fpostype));
9076 if eval $compile_ok; then
9081 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9084 echo " $fpossize bytes." >&4
9090 echo "(I can't compile the test program. Guessing...)" >&4
9091 rp="What is the size of your file positions (in bytes)?"
9100 case "$vendorprefix" in
9101 '') d_vendorbin="$undef"
9105 *) d_vendorbin="$define"
9106 : determine where vendor-supplied executables go.
9107 case "$vendorbin" in
9108 '') dflt=$vendorprefix/bin ;;
9109 *) dflt="$vendorbin" ;;
9112 rp='Pathname for the vendor-supplied executables directory?'
9115 vendorbinexp="$ansexp"
9118 : Change installation prefix, if necessary.
9119 if $test X"$prefix" != X"$installprefix"; then
9120 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9122 installvendorbin="$vendorbinexp"
9125 case "$vendorprefix" in
9129 *) : determine where vendor-supplied html pages go.
9130 : There is no standard location, so try to copy the previously-selected
9131 : directory structure for the core html pages.
9132 : XXX Better default suggestions would be welcome.
9133 case "$vendorhtml1" in
9134 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9135 *) dflt=$vendorhtml1 ;;
9138 ''|' ') dflt=none ;;
9141 rp='Pathname for the vendor-supplied html pages?'
9144 vendorhtml1exp="$ansexp"
9147 : Use ' ' for none so value is preserved next time through Configure
9148 $test X"$vendorhtml1" = "X" && vendorhtml1=' '
9149 : Change installation prefix, if necessary.
9150 if $test X"$prefix" != X"$installprefix"; then
9151 installvendorhtml1=`echo $vendorhtml1exp | $sed "s#^$prefix#$installprefix#"`
9153 installvendorhtml1="$vendorhtml1exp"
9156 case "$vendorprefix" in
9160 *) : determine where vendor-supplied module html pages go.
9161 : There is no standard location, so try to copy the previously-selected
9162 : directory structure for the core html pages.
9163 : XXX Better default suggestions would be welcome.
9164 case "$vendorhtml3" in
9165 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9166 *) dflt=$vendorhtml3 ;;
9169 ''|' ') dflt=none ;;
9172 rp='Pathname for the vendor-supplied html pages?'
9175 vendorhtml3exp="$ansexp"
9178 : Use ' ' for none so value is preserved next time through Configure
9179 $test X"$vendorhtml3" = "X" && vendorhtml3=' '
9180 : Change installation prefix, if necessary.
9181 if $test X"$prefix" != X"$installprefix"; then
9182 installvendorhtml3=`echo $vendorhtml3exp | $sed "s#^$prefix#$installprefix#"`
9184 installvendorhtml3="$vendorhtml3exp"
9187 case "$vendorprefix" in
9191 *) : determine where vendor-supplied manual pages go.
9192 case "$vendorman1" in
9193 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9194 *) dflt=$vendorman1 ;;
9197 ''|' ') dflt=none ;;
9200 rp='Pathname for the vendor-supplied manual section 1 pages?'
9203 vendorman1exp="$ansexp"
9206 : Use ' ' for none so value is preserved next time through Configure
9207 $test X"$vendorman1" = "X" && vendorman1=' '
9208 : Change installation prefix, if necessary.
9209 if $test X"$prefix" != X"$installprefix"; then
9210 installvendorman1=`echo "$vendorman1exp" | $sed "s#^$prefix#$installprefix#"`
9212 installvendorman1="$vendorman1exp"
9215 case "$vendorprefix" in
9219 *) : determine where vendor-supplied module manual pages go.
9220 case "$vendorman3" in
9221 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9222 *) dflt=$vendorman3 ;;
9225 ''|' ') dflt=none ;;
9228 rp='Pathname for the vendor-supplied manual section 3 pages?'
9231 vendorman3exp="$ansexp"
9234 : Use ' ' for none so value is preserved next time through Configure
9235 $test X"$vendorman3" = "X" && vendorman3=' '
9236 : Change installation prefix, if necessary.
9237 if $test X"$prefix" != X"$installprefix"; then
9238 installvendorman3=`echo "$vendorman3exp" | $sed "s#^$prefix#$installprefix#"`
9240 installvendorman3="$vendorman3exp"
9243 case "$vendorprefix" in
9244 '') d_vendorscript="$undef"
9248 *) d_vendorscript="$define"
9249 : determine where vendor-supplied scripts go.
9250 case "$vendorscript" in
9251 '') dflt=$vendorprefix/script
9252 $test -d $dflt || dflt=$vendorbin ;;
9253 *) dflt="$vendorscript" ;;
9257 The installation process will create a directory for
9258 vendor-supplied scripts.
9262 rp='Pathname for the vendor-supplied scripts directory?'
9265 vendorscriptexp="$ansexp"
9268 : Change installation prefix, if necessary.
9269 if $test X"$prefix" != X"$installprefix"; then
9270 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9272 installvendorscript="$vendorscriptexp"
9275 : see if qgcvt exists
9279 : Check how to convert floats to strings.
9281 if test "X$d_Gconvert" = X; then
9284 echo "Checking for an efficient way to convert floats to strings."
9286 case "$uselongdouble" in
9287 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9289 case "$d_longdbl" in
9290 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9292 case "$d_PRIgldbl" in
9293 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9297 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9298 char *myname = "gconvert";
9301 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9302 char *myname = "gcvt";
9305 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9306 char *myname = "qgcvt";
9307 #define DOUBLETYPE long double
9310 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9312 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9314 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9317 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9319 char *myname = "sprintf";
9323 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9324 #define DOUBLETYPE long double
9326 #define DOUBLETYPE double
9332 #define I_STDLIB $i_stdlib
9338 checkit(expect, got)
9342 if (strcmp(expect, got)) {
9343 printf("%s oddity: Expected %s, got %s\n",
9344 myname, expect, got);
9354 /* This must be 1st test on (which?) platform */
9355 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9356 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9357 checkit("0.1", buf);
9359 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9360 checkit("0.01", buf);
9362 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9363 checkit("0.001", buf);
9365 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9366 checkit("0.0001", buf);
9368 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9369 if (strlen(buf) > 5)
9370 checkit("9e-005", buf); /* for Microsoft ?? */
9372 checkit("9e-05", buf);
9374 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9377 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9378 checkit("1.1", buf);
9380 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9381 checkit("1.01", buf);
9383 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9384 checkit("1.001", buf);
9386 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9387 checkit("1.0001", buf);
9389 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9390 checkit("1.00001", buf);
9392 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9393 checkit("1.000001", buf);
9395 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9398 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9401 /* Some Linux gcvt's give 1.e+5 here. */
9402 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9403 checkit("100000", buf);
9405 /* Some Linux gcvt's give -1.e+5 here. */
9406 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9407 checkit("-100000", buf);
9409 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9410 checkit("123.456", buf);
9412 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9413 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9414 /* 34 should be enough to scare even long double
9415 * places into using the e notation. */
9416 if (strlen(buf) > 5)
9417 checkit("1e+034", buf); /* for Microsoft */
9419 checkit("1e+34", buf);
9421 /* For Perl, if you add additional tests here, also add them to
9422 * t/base/num.t for benefit of platforms not using Configure or
9423 * overriding d_Gconvert */
9428 : first add preferred functions to our list
9430 for xxx_convert in $gconvert_preference; do
9431 case $xxx_convert in
9432 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9433 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9436 : then add any others
9437 for xxx_convert in gconvert gcvt sprintf; do
9440 *) xxx_list="$xxx_list $xxx_convert" ;;
9444 case "$d_longdbl$uselongdouble" in
9446 : again, add prefered functions to our list first
9448 for xxx_convert in $gconvert_ld_preference; do
9449 case $xxx_convert in
9450 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9451 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9454 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9455 for xxx_convert in qgcvt sprintf $xxx_list; do
9456 case "$xxx_ld_list" in
9457 $xxx_convert*|*" $xxx_convert"*) ;;
9458 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9461 : if sprintf cannot do long doubles, move it to the end
9462 if test "$d_PRIgldbl" != "$define"; then
9463 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9465 : if no qgcvt, remove it
9466 if test "$d_qgcvt" != "$define"; then
9467 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9470 xxx_list="$xxx_ld_list"
9474 for xxx_convert in $xxx_list; do
9475 echo "Trying $xxx_convert..."
9477 set try -DTRY_$xxx_convert
9478 if eval $compile; then
9479 echo "$xxx_convert() found." >&4
9481 echo "I'll use $xxx_convert to convert floats into a string." >&4
9484 echo "...But $xxx_convert didn't work as I expected."
9488 echo "$xxx_convert NOT found." >&4
9492 if test X$xxx_convert = X; then
9493 echo "*** WHOA THERE!!! ***" >&4
9494 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9498 case "$xxx_convert" in
9499 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9500 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9501 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9502 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9503 "$define$define$define")
9504 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9505 "$define$define$undef")
9506 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9507 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9514 : see if _fwalk exists
9518 : Initialize h_fcntl
9521 : Initialize h_sysfile
9524 : access call always available on UNIX
9528 : locate the flags for 'access()'
9532 $cat >access.c <<'EOCP'
9533 #include <sys/types.h>
9538 #include <sys/file.h>
9547 : check sys/file.h first, no particular reason here
9548 if $test `./findhdr sys/file.h` && \
9549 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9551 echo "<sys/file.h> defines the *_OK access constants." >&4
9552 elif $test `./findhdr fcntl.h` && \
9553 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9555 echo "<fcntl.h> defines the *_OK access constants." >&4
9556 elif $test `./findhdr unistd.h` && \
9557 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9558 echo "<unistd.h> defines the *_OK access constants." >&4
9560 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9566 : see if accessx exists
9567 set accessx d_accessx
9570 : see if alarm exists
9574 : see if POSIX threads are available
9575 set pthread.h i_pthread
9578 : define a fucntion to check prototypes
9579 $cat > protochk <<EOSH
9582 optimize="$optimize"
9584 prototype="$prototype"
9587 usethreads=$usethreads
9588 i_pthread=$i_pthread
9589 pthread_h_first=$pthread_h_first
9592 $cat >> protochk <<'EOSH'
9597 while test $# -ge 2; do
9599 $define) echo "#include <$2>" >> try.c ;;
9600 literal) echo "$2" >> try.c ;;
9602 # Extra magic for the benefit of systems that need pthread.h
9603 # to be included early to correctly detect threadsafe functions.
9604 # Such functions must guarantee themselves, though, that the usethreads
9605 # and i_pthread have been defined, before calling protochk.
9606 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9607 echo "#include <pthread.h>" >> try.c
9612 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9613 cat >> try.c <<'EOCP'
9614 #ifdef CAN_PROTOTYPE
9615 #define _(args) args
9620 echo "$foo" >> try.c
9621 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9622 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9630 : see if sys/types.h has to be included
9631 set sys/types.h i_systypes
9634 : see if sys/select.h has to be included
9635 set sys/select.h i_sysselct
9638 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9639 while $test $# -ge 2; do
9641 $define) echo "#include <$2>";;
9645 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9647 if eval $compile; then
9656 : see if we should include time.h, sys/time.h, or both
9658 if test "X$timeincl" = X; then
9659 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9660 $echo $n "I'm now running the test program...$c"
9661 $cat >try.c <<'EOCP'
9662 #include <sys/types.h>
9667 #ifdef SYSTIMEKERNEL
9670 #include <sys/time.h>
9673 #include <sys/select.h>
9682 struct timezone tzp;
9684 if (foo.tm_sec == foo.tm_sec)
9687 if (bar.tv_sec == bar.tv_sec)
9694 for s_timezone in '-DS_TIMEZONE' ''; do
9696 for s_timeval in '-DS_TIMEVAL' ''; do
9697 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9698 for i_time in '' '-DI_TIME'; do
9699 for i_systime in '-DI_SYSTIME' ''; do
9702 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9703 if eval $compile; then
9704 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9708 $echo $n "Succeeded with $flags$c"
9720 *SYSTIMEKERNEL*) i_systimek="$define"
9721 timeincl=`./findhdr sys/time.h`
9722 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9723 *) i_systimek="$undef";;
9726 *I_TIME*) i_time="$define"
9727 timeincl=`./findhdr time.h`" $timeincl"
9728 echo "We'll include <time.h>." >&4;;
9729 *) i_time="$undef";;
9732 *I_SYSTIME*) i_systime="$define"
9733 timeincl=`./findhdr sys/time.h`" $timeincl"
9734 echo "We'll include <sys/time.h>." >&4;;
9735 *) i_systime="$undef";;
9739 : see if struct tm knows about tm_zone
9740 case "$i_systime$i_time" in
9743 echo "Checking to see if your struct tm has tm_zone field..." >&4
9744 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9752 case "$d_tm_tm_zone" in
9753 "$define") echo "Yes, it does." ;;
9754 *) echo "No, it doesn't." ;;
9756 : see if struct tm knows about tm_gmtoff
9757 case "$i_systime$i_time" in
9760 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9761 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9769 case "$d_tm_tm_gmtoff" in
9770 "$define") echo "Yes, it does." ;;
9771 *) echo "No, it doesn't." ;;
9774 : see if asctime_r exists
9775 set asctime_r d_asctime_r
9777 case "$d_asctime_r" in
9779 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9780 case "$d_asctime_r_proto:$usethreads" in
9781 ":define") d_asctime_r_proto=define
9782 set d_asctime_r_proto asctime_r $hdrs
9786 case "$d_asctime_r_proto" in
9788 case "$asctime_r_proto" in
9789 ''|0) try='char* asctime_r(const struct tm*, char*);'
9790 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9792 case "$asctime_r_proto" in
9793 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9794 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9796 case "$asctime_r_proto" in
9797 ''|0) try='int asctime_r(const struct tm*, char*);'
9798 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9800 case "$asctime_r_proto" in
9801 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9802 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9804 case "$asctime_r_proto" in
9805 ''|0) d_asctime_r=undef
9807 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9808 * ) case "$asctime_r_proto" in
9809 REENTRANT_PROTO*) ;;
9810 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9812 echo "Prototype: $try" ;;
9815 *) case "$usethreads" in
9816 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9823 *) asctime_r_proto=0
9827 : see if atolf exists
9831 : see if atoll exists
9835 : Look for GNU-cc style attribute checking
9837 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9838 $cat >attrib.c <<'EOCP'
9840 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9842 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9843 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9844 echo "Your C compiler doesn't fully support __attribute__."
9847 echo "Your C compiler supports __attribute__."
9851 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9858 : see if bcmp exists
9862 : see if bcopy exists
9866 : see if this is a unistd.h system
9867 set unistd.h i_unistd
9870 : see if getpgrp exists
9871 set getpgrp d_getpgrp
9874 case "$d_getpgrp" in
9877 echo "Checking to see which flavor of getpgrp is in use..."
9880 #include <sys/types.h>
9882 # include <unistd.h>
9886 if (getuid() == 0) {
9887 printf("(I see you are running Configure as super-user...)\n");
9891 if (getpgrp(1) == 0)
9900 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9901 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9903 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9904 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9907 echo "I can't seem to compile and run the test program."
9909 xxx="a USG one, i.e. you use getpgrp()."
9911 # SVR4 systems can appear rather BSD-ish.
9914 xxx="a BSD one, i.e. you use getpgrp(pid)."
9918 xxx="probably a USG one, i.e. you use getpgrp()."
9923 echo "Assuming your getpgrp is $xxx" >&4
9932 : see if setpgrp exists
9933 set setpgrp d_setpgrp
9936 case "$d_setpgrp" in
9939 echo "Checking to see which flavor of setpgrp is in use..."
9942 #include <sys/types.h>
9944 # include <unistd.h>
9948 if (getuid() == 0) {
9949 printf("(I see you are running Configure as super-user...)\n");
9953 if (-1 == setpgrp(1, 1))
9956 if (setpgrp() != -1)
9962 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9963 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9965 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9966 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9969 echo "(I can't seem to compile and run the test program.)"
9971 xxx="a USG one, i.e. you use setpgrp()."
9973 # SVR4 systems can appear rather BSD-ish.
9976 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9980 xxx="probably a USG one, i.e. you use setpgrp()."
9985 echo "Assuming your setpgrp is $xxx" >&4
9993 : see if bzero exists
9997 : see if signal is declared as pointer to function returning int or void
9999 xxx=`./findhdr signal.h`
10000 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10001 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10002 echo "You have int (*signal())() instead of void." >&4
10004 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10005 echo "You have void (*signal())()." >&4
10007 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10008 echo "You have int (*signal())() instead of void." >&4
10010 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10011 echo "You have void (*signal())()." >&4
10014 case "$d_voidsig" in
10016 echo "I can't determine whether signal handler returns void or int..." >&4
10018 rp="What type does your signal handler return?"
10021 v*) val="$define";;
10025 echo "As you already told me, signal handler returns void." >&4
10028 *) echo "As you already told me, signal handler returns int." >&4
10035 case "$d_voidsig" in
10036 "$define") signal_t="void";;
10037 *) signal_t="int";;
10041 : check for ability to cast large floats to 32-bit ints.
10043 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10044 if $test "$intsize" -ge 4; then
10051 #$i_stdlib I_STDLIB
10053 #include <stdlib.h>
10055 #include <sys/types.h>
10056 #include <signal.h>
10057 $signal_t blech(s) int s; { exit(3); }
10064 signal(SIGFPE, blech);
10066 /* Don't let compiler optimize the test away. Store the number
10067 in a writable string for gcc to pass to sscanf under HP/UX.
10069 sprintf(str, "2147483647");
10070 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10074 /* x86 processors will probably give 0x8000 0000, which is a
10075 sign change. We don't want that. We want to mimic SPARC
10076 behavior here, which is to preserve the sign and give
10079 if (i32 != ($xxx) f)
10085 if eval $compile_ok; then
10089 echo "(I can't seem to compile the test program--assuming it can't)"
10094 echo "Yup, it can."
10097 echo "Nope, it can't."
10104 : check for ability to cast negative floats to unsigned
10106 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10109 #$i_stdlib I_STDLIB
10111 #include <stdlib.h>
10113 #include <sys/types.h>
10114 #include <signal.h>
10115 $signal_t blech(s) int s; { exit(7); }
10116 $signal_t blech_in_list(s) int s; { exit(4); }
10117 unsigned long dummy_long(p) unsigned long p; { return p; }
10118 unsigned int dummy_int(p) unsigned int p; { return p; }
10119 unsigned short dummy_short(p) unsigned short p; { return p; }
10123 unsigned long along;
10125 unsigned short ashort;
10129 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10130 a direct f = -123. assignment. gcc-2.8.0 reportedly
10131 optimized the whole file away
10133 /* Store the number in a writable string for gcc to pass to
10134 sscanf under HP/UX.
10136 sprintf(str, "-123");
10137 sscanf(str, "%lf", &f); /* f = -123.; */
10139 signal(SIGFPE, blech);
10140 along = (unsigned long)f;
10141 aint = (unsigned int)f;
10142 ashort = (unsigned short)f;
10143 if (along != (unsigned long)-123)
10145 if (aint != (unsigned int)-123)
10147 if (ashort != (unsigned short)-123)
10149 sprintf(str, "1073741824.");
10150 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10153 along = (unsigned long)f;
10154 if (along != 0x80000000)
10158 along = (unsigned long)f;
10159 if (along != 0x7fffffff)
10163 along = (unsigned long)f;
10164 if (along != 0x80000001)
10168 signal(SIGFPE, blech_in_list);
10169 sprintf(str, "123.");
10170 sscanf(str, "%lf", &f); /* f = 123.; */
10171 along = dummy_long((unsigned long)f);
10172 aint = dummy_int((unsigned int)f);
10173 ashort = dummy_short((unsigned short)f);
10174 if (along != (unsigned long)123)
10176 if (aint != (unsigned int)123)
10178 if (ashort != (unsigned short)123)
10185 if eval $compile_ok; then
10189 echo "(I can't seem to compile the test program--assuming it can't)"
10192 case "$castflags" in
10194 echo "Yup, it can."
10197 echo "Nope, it can't."
10204 : see if vprintf exists
10206 if set vprintf val -f d_vprintf; eval $csym; $val; then
10207 echo 'vprintf() found.' >&4
10209 $cat >try.c <<'EOF'
10210 #include <varargs.h>
10212 int main() { xxx("foo"); }
10221 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10225 if eval $compile && $run ./try; then
10226 echo "Your vsprintf() returns (int)." >&4
10229 echo "Your vsprintf() returns (char*)." >&4
10233 echo 'vprintf() NOT found.' >&4
10244 : see if chown exists
10248 : see if chroot exists
10249 set chroot d_chroot
10252 : see if chsize exists
10253 set chsize d_chsize
10256 : see if class exists
10260 hasstruct='varname=$1; struct=$2; shift; shift;
10261 while $test $# -ge 2; do
10263 $define) echo "#include <$2>";;
10267 echo "int main () { struct $struct foo; }" >> try.c;
10269 if eval $compile; then
10276 $rm -f try.c try.o'
10280 : see whether socket exists
10282 $echo $n "Hmm... $c" >&4
10283 if set socket val -f d_socket; eval $csym; $val; then
10284 echo "Looks like you have Berkeley networking support." >&4
10286 if set setsockopt val -f; eval $csym; $val; then
10289 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10290 d_oldsock="$define"
10293 if $contains socklib libc.list >/dev/null 2>&1; then
10294 echo "Looks like you have Berkeley networking support." >&4
10296 : we will have to assume that it supports the 4.2 BSD interface
10299 echo "You don't have Berkeley networking in libc$_a..." >&4
10300 if test "X$d_socket" = "X$define"; then
10301 echo "...but you seem to believe that you have sockets." >&4
10303 for net in net socket
10305 if test -f /usr/lib/lib$net$_a; then
10306 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10307 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10308 if $contains socket libc.list >/dev/null 2>&1; then
10313 echo "...but the Wollongong group seems to have hacked it in." >&4
10314 sockethdr="-I/usr/netinclude"
10317 echo "Found Berkeley sockets interface in lib$net." >&4
10318 if $contains setsockopt libc.list >/dev/null 2>&1; then
10321 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10322 d_oldsock="$define"
10328 if test "X$d_socket" != "X$define"; then
10329 echo "or anywhere else I see." >&4
10337 : see if socketpair exists
10338 set socketpair d_sockpair
10343 echo "Checking the availability of certain socket constants..." >&4
10344 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10345 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10347 #include <sys/types.h>
10348 #include <sys/socket.h>
10354 set try; if eval $compile; then
10357 set d_${enum}; eval $setvar
10361 : see if this is a sys/uio.h system
10362 set sys/uio.h i_sysuio
10367 echo "Checking to see if your system supports struct cmsghdr..." >&4
10368 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10370 case "$d_cmsghdr_s" in
10371 "$define") echo "Yes, it does." ;;
10372 *) echo "No, it doesn't." ;;
10376 : check for const keyword
10378 echo 'Checking to see if your C compiler knows about "const"...' >&4
10379 $cat >const.c <<'EOCP'
10380 typedef struct spug { int drokk; } spug;
10387 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10389 echo "Yup, it does."
10392 echo "Nope, it doesn't."
10397 : see if crypt exists
10402 $define) cryptlib='' ;;
10403 *) if set crypt val -f d_crypt; eval $csym; $val; then
10404 echo 'crypt() found.' >&4
10408 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10409 if $test -z "$cryptlib"; then
10410 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10414 if $test -z "$cryptlib"; then
10415 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10419 if $test -z "$cryptlib"; then
10420 cryptlib=`./loc libcrypt$_a "" $libpth`
10424 if $test -z "$cryptlib"; then
10425 echo 'crypt() NOT found.' >&4
10436 : see if this is a crypt.h system
10437 set crypt.h i_crypt
10440 : see if crypt_r exists
10441 set crypt_r d_crypt_r
10443 case "$d_crypt_r" in
10445 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10446 case "$d_crypt_r_proto:$usethreads" in
10447 ":define") d_crypt_r_proto=define
10448 set d_crypt_r_proto crypt_r $hdrs
10452 case "$d_crypt_r_proto" in
10454 case "$crypt_r_proto" in
10455 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10456 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10458 case "$crypt_r_proto" in
10459 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10460 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10462 case "$crypt_r_proto" in
10463 ''|0) d_crypt_r=undef
10465 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10466 * ) case "$crypt_r_proto" in
10467 REENTRANT_PROTO*) ;;
10468 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10470 echo "Prototype: $try" ;;
10473 *) case "$usethreads" in
10474 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10485 : get csh whereabouts
10487 'csh') val="$undef" ;;
10488 *) val="$define" ;;
10492 : Respect a hint or command line value for full_csh.
10493 case "$full_csh" in
10494 '') full_csh=$csh ;;
10497 : see if ctermid_r exists
10498 set ctermid_r d_ctermid_r
10500 case "$d_ctermid_r" in
10502 hdrs="$i_systypes sys/types.h define stdio.h "
10503 case "$d_ctermid_r_proto:$usethreads" in
10504 ":define") d_ctermid_r_proto=define
10505 set d_ctermid_r_proto ctermid_r $hdrs
10509 case "$d_ctermid_r_proto" in
10511 case "$ctermid_r_proto" in
10512 ''|0) try='char* ctermid_r(char*);'
10513 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10515 case "$ctermid_r_proto" in
10516 ''|0) d_ctermid_r=undef
10518 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10519 * ) case "$ctermid_r_proto" in
10520 REENTRANT_PROTO*) ;;
10521 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10523 echo "Prototype: $try" ;;
10526 *) case "$usethreads" in
10527 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10534 *) ctermid_r_proto=0
10538 : see if ctime_r exists
10539 set ctime_r d_ctime_r
10541 case "$d_ctime_r" in
10543 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10544 case "$d_ctime_r_proto:$usethreads" in
10545 ":define") d_ctime_r_proto=define
10546 set d_ctime_r_proto ctime_r $hdrs
10550 case "$d_ctime_r_proto" in
10552 case "$ctime_r_proto" in
10553 ''|0) try='char* ctime_r(const time_t*, char*);'
10554 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10556 case "$ctime_r_proto" in
10557 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10558 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10560 case "$ctime_r_proto" in
10561 ''|0) try='int ctime_r(const time_t*, char*);'
10562 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10564 case "$ctime_r_proto" in
10565 ''|0) try='int ctime_r(const time_t*, char*, int);'
10566 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10568 case "$ctime_r_proto" in
10569 ''|0) d_ctime_r=undef
10571 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10572 * ) case "$ctime_r_proto" in
10573 REENTRANT_PROTO*) ;;
10574 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10576 echo "Prototype: $try" ;;
10579 *) case "$usethreads" in
10580 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10591 : see if cuserid exists
10592 set cuserid d_cuserid
10595 : see if this is a limits.h system
10596 set limits.h i_limits
10599 : see if this is a float.h system
10600 set float.h i_float
10603 : See if number of significant digits in a double precision number is known
10605 $cat >dbl_dig.c <<EOM
10606 #$i_limits I_LIMITS
10609 #include <limits.h>
10615 printf("Contains DBL_DIG");
10618 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10619 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10620 echo "DBL_DIG found." >&4
10623 echo "DBL_DIG NOT found." >&4
10630 : see if dbm.h is available
10631 : see if dbmclose exists
10632 set dbmclose d_dbmclose
10635 case "$d_dbmclose" in
10645 *) set rpcsvc/dbm.h i_rpcsvcdbm
10650 *) echo "We won't be including <dbm.h>"
10660 : see if prototype for dbminit is available
10662 set d_dbminitproto dbminit $i_dbm dbm.h
10665 : see if difftime exists
10666 set difftime d_difftime
10669 : see if this is a dirent system
10671 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10673 echo "<dirent.h> found." >&4
10676 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10677 echo "<sys/dir.h> found." >&4
10680 xinc=`./findhdr sys/ndir.h`
10682 echo "<dirent.h> NOT found." >&4
10687 : Look for type of directory structure.
10689 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10691 case "$direntrytype" in
10693 case "$i_dirent" in
10694 $define) guess1='struct dirent' ;;
10695 *) guess1='struct direct' ;;
10698 *) guess1="$direntrytype"
10703 'struct dirent') guess2='struct direct' ;;
10704 *) guess2='struct dirent' ;;
10707 if $contains "$guess1" try.c >/dev/null 2>&1; then
10708 direntrytype="$guess1"
10709 echo "Your directory entries are $direntrytype." >&4
10710 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10711 direntrytype="$guess2"
10712 echo "Your directory entries seem to be $direntrytype." >&4
10714 echo "I don't recognize your system's directory entries." >&4
10715 rp="What type is used for directory entries on this system?"
10718 direntrytype="$ans"
10723 : see if the directory entry stores field length
10725 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10726 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10727 echo "Good, your directory entry keeps length information in d_namlen." >&4
10730 echo "Your directory entry does not know about the d_namlen field." >&4
10737 : see if this is an sysdir system
10738 set sys/dir.h i_sysdir
10741 : see if this is an sysndir system
10742 set sys/ndir.h i_sysndir
10747 $cat >dirfd.c <<EOM
10749 #$i_dirent I_DIRENT /**/
10750 #$i_sysdir I_SYS_DIR /**/
10751 #$i_sysndir I_SYS_NDIR /**/
10752 #$i_systypes I_SYS_TYPES /**/
10753 #if defined(I_SYS_TYPES)
10754 #include <sys/types.h>
10756 #if defined(I_DIRENT)
10757 #include <dirent.h>
10758 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10759 #include <sys/dir.h>
10763 #include <sys/ndir.h>
10767 #include <ndir.h> /* may be wrong in the future */
10769 #include <sys/dir.h>
10775 DIR *dirp = opendir(".");
10776 if (dirfd(dirp) >= 0)
10783 if eval $compile; then
10787 $define) echo "dirfd() found." >&4 ;;
10788 *) echo "dirfd() NOT found." >&4 ;;
10794 : see if dlerror exists
10797 set dlerror d_dlerror
10801 : see if dlfcn is available
10802 set dlfcn.h i_dlfcn
10809 On a few systems, the dynamically loaded modules that perl generates and uses
10810 will need a different extension than shared libs. The default will probably
10816 *) dflt="$dlext" ;;
10818 rp='What is the extension of dynamically loaded modules'
10827 : Check if dlsym need a leading underscore
10833 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10834 $cat >dyna.c <<'EOM'
10843 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10845 #include <sys/types.h>
10850 extern int fred() ;
10859 int mode = RTLD_LAZY ;
10861 handle = dlopen("./dyna.$dlext", mode) ;
10862 if (handle == NULL) {
10867 symbol = dlsym(handle, "fred") ;
10868 if (symbol == NULL) {
10869 /* try putting a leading underscore */
10870 symbol = dlsym(handle, "_fred") ;
10871 if (symbol == NULL) {
10884 : Call the object file tmp-dyna.o in case dlext=o.
10885 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10886 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10887 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10888 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10891 1) echo "Test program failed using dlopen." >&4
10892 echo "Perhaps you should not use dynamic loading." >&4;;
10893 2) echo "Test program failed using dlsym." >&4
10894 echo "Perhaps you should not use dynamic loading." >&4;;
10895 3) echo "dlsym needs a leading underscore" >&4
10897 4) echo "dlsym doesn't need a leading underscore." >&4;;
10900 echo "I can't compile and run the test program." >&4
10901 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10906 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10911 : see if drand48_r exists
10912 set drand48_r d_drand48_r
10914 case "$d_drand48_r" in
10916 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10917 case "$d_drand48_r_proto:$usethreads" in
10918 ":define") d_drand48_r_proto=define
10919 set d_drand48_r_proto drand48_r $hdrs
10923 case "$d_drand48_r_proto" in
10925 case "$drand48_r_proto" in
10926 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10927 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10929 case "$drand48_r_proto" in
10930 ''|0) d_drand48_r=undef
10932 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10933 * ) case "$drand48_r_proto" in
10934 REENTRANT_PROTO*) ;;
10935 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10937 echo "Prototype: $try" ;;
10940 *) case "$usethreads" in
10941 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10948 *) drand48_r_proto=0
10952 : see if prototype for drand48 is available
10954 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10957 : see if dup2 exists
10961 : see if eaccess exists
10962 set eaccess d_eaccess
10965 : see if endgrent exists
10966 set endgrent d_endgrent
10969 : see if this is an grp system
10975 xxx=`./findhdr grp.h`
10976 $cppstdin $cppflags $cppminus < $xxx >$$.h
10978 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10990 set d_grpasswd; eval $setvar
10994 : see if endgrent_r exists
10995 set endgrent_r d_endgrent_r
10997 case "$d_endgrent_r" in
10999 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11000 case "$d_endgrent_r_proto:$usethreads" in
11001 ":define") d_endgrent_r_proto=define
11002 set d_endgrent_r_proto endgrent_r $hdrs
11006 case "$d_endgrent_r_proto" in
11008 case "$endgrent_r_proto" in
11009 ''|0) try='int endgrent_r(FILE**);'
11010 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11012 case "$endgrent_r_proto" in
11013 ''|0) try='void endgrent_r(FILE**);'
11014 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11016 case "$endgrent_r_proto" in
11017 ''|0) d_endgrent_r=undef
11019 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11020 * ) case "$endgrent_r_proto" in
11021 REENTRANT_PROTO*) ;;
11022 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11024 echo "Prototype: $try" ;;
11027 *) case "$usethreads" in
11028 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11035 *) endgrent_r_proto=0
11039 : see if endhostent exists
11040 set endhostent d_endhent
11043 : see if this is a netdb.h system
11044 set netdb.h i_netdb
11047 : see if endhostent_r exists
11048 set endhostent_r d_endhostent_r
11050 case "$d_endhostent_r" in
11052 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11053 case "$d_endhostent_r_proto:$usethreads" in
11054 ":define") d_endhostent_r_proto=define
11055 set d_endhostent_r_proto endhostent_r $hdrs
11059 case "$d_endhostent_r_proto" in
11061 case "$endhostent_r_proto" in
11062 ''|0) try='int endhostent_r(struct hostent_data*);'
11063 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11065 case "$endhostent_r_proto" in
11066 ''|0) try='void endhostent_r(struct hostent_data*);'
11067 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11069 case "$endhostent_r_proto" in
11070 ''|0) d_endhostent_r=undef
11071 endhostent_r_proto=0
11072 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11073 * ) case "$endhostent_r_proto" in
11074 REENTRANT_PROTO*) ;;
11075 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11077 echo "Prototype: $try" ;;
11080 *) case "$usethreads" in
11081 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11083 d_endhostent_r=undef
11084 endhostent_r_proto=0
11088 *) endhostent_r_proto=0
11092 : see if endnetent exists
11093 set endnetent d_endnent
11096 : see if endnetent_r exists
11097 set endnetent_r d_endnetent_r
11099 case "$d_endnetent_r" in
11101 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11102 case "$d_endnetent_r_proto:$usethreads" in
11103 ":define") d_endnetent_r_proto=define
11104 set d_endnetent_r_proto endnetent_r $hdrs
11108 case "$d_endnetent_r_proto" in
11110 case "$endnetent_r_proto" in
11111 ''|0) try='int endnetent_r(struct netent_data*);'
11112 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11114 case "$endnetent_r_proto" in
11115 ''|0) try='void endnetent_r(struct netent_data*);'
11116 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11118 case "$endnetent_r_proto" in
11119 ''|0) d_endnetent_r=undef
11120 endnetent_r_proto=0
11121 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11122 * ) case "$endnetent_r_proto" in
11123 REENTRANT_PROTO*) ;;
11124 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11126 echo "Prototype: $try" ;;
11129 *) case "$usethreads" in
11130 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11132 d_endnetent_r=undef
11133 endnetent_r_proto=0
11137 *) endnetent_r_proto=0
11141 : see if endprotoent exists
11142 set endprotoent d_endpent
11145 : see if endprotoent_r exists
11146 set endprotoent_r d_endprotoent_r
11148 case "$d_endprotoent_r" in
11150 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11151 case "$d_endprotoent_r_proto:$usethreads" in
11152 ":define") d_endprotoent_r_proto=define
11153 set d_endprotoent_r_proto endprotoent_r $hdrs
11157 case "$d_endprotoent_r_proto" in
11159 case "$endprotoent_r_proto" in
11160 ''|0) try='int endprotoent_r(struct protoent_data*);'
11161 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11163 case "$endprotoent_r_proto" in
11164 ''|0) try='void endprotoent_r(struct protoent_data*);'
11165 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11167 case "$endprotoent_r_proto" in
11168 ''|0) d_endprotoent_r=undef
11169 endprotoent_r_proto=0
11170 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11171 * ) case "$endprotoent_r_proto" in
11172 REENTRANT_PROTO*) ;;
11173 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11175 echo "Prototype: $try" ;;
11178 *) case "$usethreads" in
11179 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11181 d_endprotoent_r=undef
11182 endprotoent_r_proto=0
11186 *) endprotoent_r_proto=0
11190 : see if endpwent exists
11191 set endpwent d_endpwent
11194 : see if this is a pwd.h system
11200 xxx=`./findhdr pwd.h`
11201 $cppstdin $cppflags $cppminus < $xxx >$$.h
11203 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11211 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11219 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11227 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11235 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11243 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11251 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11259 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11271 set d_pwquota; eval $setvar
11272 set d_pwage; eval $setvar
11273 set d_pwchange; eval $setvar
11274 set d_pwclass; eval $setvar
11275 set d_pwexpire; eval $setvar
11276 set d_pwcomment; eval $setvar
11277 set d_pwgecos; eval $setvar
11278 set d_pwpasswd; eval $setvar
11282 : see if endpwent_r exists
11283 set endpwent_r d_endpwent_r
11285 case "$d_endpwent_r" in
11287 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11288 case "$d_endpwent_r_proto:$usethreads" in
11289 ":define") d_endpwent_r_proto=define
11290 set d_endpwent_r_proto endpwent_r $hdrs
11294 case "$d_endpwent_r_proto" in
11296 case "$endpwent_r_proto" in
11297 ''|0) try='int endpwent_r(FILE**);'
11298 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11300 case "$endpwent_r_proto" in
11301 ''|0) try='void endpwent_r(FILE**);'
11302 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11304 case "$endpwent_r_proto" in
11305 ''|0) d_endpwent_r=undef
11307 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11308 * ) case "$endpwent_r_proto" in
11309 REENTRANT_PROTO*) ;;
11310 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11312 echo "Prototype: $try" ;;
11315 *) case "$usethreads" in
11316 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11323 *) endpwent_r_proto=0
11327 : see if endservent exists
11328 set endservent d_endsent
11331 : see if endservent_r exists
11332 set endservent_r d_endservent_r
11334 case "$d_endservent_r" in
11336 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11337 case "$d_endservent_r_proto:$usethreads" in
11338 ":define") d_endservent_r_proto=define
11339 set d_endservent_r_proto endservent_r $hdrs
11343 case "$d_endservent_r_proto" in
11345 case "$endservent_r_proto" in
11346 ''|0) try='int endservent_r(struct servent_data*);'
11347 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11349 case "$endservent_r_proto" in
11350 ''|0) try='void endservent_r(struct servent_data*);'
11351 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11353 case "$endservent_r_proto" in
11354 ''|0) d_endservent_r=undef
11355 endservent_r_proto=0
11356 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11357 * ) case "$endservent_r_proto" in
11358 REENTRANT_PROTO*) ;;
11359 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11361 echo "Prototype: $try" ;;
11364 *) case "$usethreads" in
11365 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11367 d_endservent_r=undef
11368 endservent_r_proto=0
11372 *) endservent_r_proto=0
11376 : Locate the flags for 'open()'
11378 $cat >try.c <<'EOCP'
11379 #include <sys/types.h>
11384 #include <sys/file.h>
11395 : check sys/file.h first to get FREAD on Sun
11396 if $test `./findhdr sys/file.h` && \
11397 set try -DI_SYS_FILE && eval $compile; then
11399 echo "<sys/file.h> defines the O_* constants..." >&4
11400 if $run ./try; then
11401 echo "and you have the 3 argument form of open()." >&4
11404 echo "but not the 3 argument form of open(). Oh, well." >&4
11407 elif $test `./findhdr fcntl.h` && \
11408 set try -DI_FCNTL && eval $compile; then
11410 echo "<fcntl.h> defines the O_* constants..." >&4
11411 if $run ./try; then
11412 echo "and you have the 3 argument form of open()." >&4
11415 echo "but not the 3 argument form of open(). Oh, well." >&4
11420 echo "I can't find the O_* constant definitions! You got problems." >&4
11426 : see which of string.h or strings.h is needed
11428 strings=`./findhdr string.h`
11429 if $test "$strings" && $test -r "$strings"; then
11430 echo "Using <string.h> instead of <strings.h>." >&4
11434 strings=`./findhdr strings.h`
11435 if $test "$strings" && $test -r "$strings"; then
11436 echo "Using <strings.h> instead of <string.h>." >&4
11438 echo "No string header found -- You'll surely have problems." >&4
11443 case "$i_string" in
11444 "$undef") strings=`./findhdr strings.h`;;
11445 *) strings=`./findhdr string.h`;;
11448 : see if this is a sys/file.h system
11453 : do we need to include sys/file.h ?
11457 if $h_sysfile; then
11459 echo "We'll be including <sys/file.h>." >&4
11462 echo "We won't be including <sys/file.h>." >&4
11472 : see if fcntl.h is there
11477 : see if we can include fcntl.h
11483 echo "We'll be including <fcntl.h>." >&4
11486 if $h_sysfile; then
11487 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11489 echo "We won't be including <fcntl.h>." >&4
11501 : check for non-blocking I/O stuff
11502 case "$h_sysfile" in
11503 true) echo "#include <sys/file.h>" > head.c;;
11506 true) echo "#include <fcntl.h>" > head.c;;
11507 *) echo "#include <sys/fcntl.h>" > head.c;;
11512 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11513 case "$o_nonblock" in
11515 $cat head.c > try.c
11516 $cat >>try.c <<EOCP
11518 #include <stdlib.h>
11525 printf("O_NONBLOCK\n");
11529 printf("O_NDELAY\n");
11533 printf("FNDELAY\n");
11540 if eval $compile_ok; then
11541 o_nonblock=`$run ./try`
11542 case "$o_nonblock" in
11543 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11544 *) echo "Seems like we can use $o_nonblock.";;
11547 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11550 *) echo "Using $hint value $o_nonblock.";;
11552 $rm -f try try.* .out core
11555 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11558 $cat head.c > try.c
11559 $cat >>try.c <<EOCP
11561 #include <sys/types.h>
11562 #include <signal.h>
11564 #include <stdlib.h>
11569 #define MY_O_NONBLOCK $o_nonblock
11570 #ifndef errno /* XXX need better Configure test */
11573 #$i_unistd I_UNISTD
11575 #include <unistd.h>
11577 #$i_string I_STRING
11579 #include <string.h>
11581 #include <strings.h>
11583 $signal_t blech(x) int x; { exit(3); }
11585 $cat >> try.c <<'EOCP'
11593 pipe(pd); /* Down: child -> parent */
11594 pipe(pu); /* Up: parent -> child */
11597 close(pd[1]); /* Parent reads from pd[0] */
11598 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11600 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11605 signal(SIGALRM, blech);
11607 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11609 sprintf(string, "%d\n", ret);
11610 write(2, string, strlen(string));
11613 if (errno == EAGAIN) {
11614 printf("EAGAIN\n");
11619 if (errno == EWOULDBLOCK)
11620 printf("EWOULDBLOCK\n");
11623 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11624 sleep(2); /* Give it time to close our pipe */
11626 ret = read(pd[0], buf, 1); /* Should read EOF */
11628 sprintf(string, "%d\n", ret);
11629 write(4, string, strlen(string));
11633 close(pd[0]); /* We write to pd[1] */
11634 close(pu[1]); /* We read from pu[0] */
11635 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11636 close(pd[1]); /* Pipe pd is now fully closed! */
11637 exit(0); /* Bye bye, thank you for playing! */
11641 if eval $compile_ok; then
11642 echo "$startsh" >mtry
11643 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11645 ./mtry >/dev/null 2>&1
11647 0) eagain=`$cat try.out`;;
11648 1) echo "Could not perform non-blocking setting!";;
11649 2) echo "I did a successful read() for something that was not there!";;
11650 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11651 4) echo "Could not find F_SETFL!";;
11652 *) echo "Something terribly wrong happened during testing.";;
11654 rd_nodata=`$cat try.ret`
11655 echo "A read() system call with no data present returns $rd_nodata."
11656 case "$rd_nodata" in
11659 echo "(That's peculiar, fixing that to be -1.)"
11665 echo "Forcing errno EAGAIN on read() with no data available."
11669 echo "Your read() sets errno to $eagain when no data is available."
11672 status=`$cat try.err`
11674 0) echo "And it correctly returns 0 to signal EOF.";;
11675 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11676 *) echo "However, your read() returns '$status' on EOF??";;
11679 if test "$status" = "$rd_nodata"; then
11680 echo "WARNING: you can't distinguish between EOF and no data!"
11684 echo "I can't compile the test program--assuming errno EAGAIN will do."
11691 echo "Using $hint value $eagain."
11692 echo "Your read() returns $rd_nodata when no data is present."
11693 case "$d_eofnblk" in
11694 "$define") echo "And you can see EOF because read() returns 0.";;
11695 "$undef") echo "But you can't see EOF status from read() returned value.";;
11697 echo "(Assuming you can't see EOF status from read anyway.)"
11703 $rm -f try try.* .out core head.c mtry
11705 : see if fchdir exists
11706 set fchdir d_fchdir
11709 : see if fchmod exists
11710 set fchmod d_fchmod
11713 : see if fchown exists
11714 set fchown d_fchown
11717 : see if this is an fcntl system
11722 : See if fcntl-based locking works.
11724 #include <stdlib.h>
11725 #include <unistd.h>
11727 #include <signal.h>
11728 $signal_t blech(x) int x; { exit(3); }
11730 #if defined(F_SETLK) && defined(F_SETLKW)
11731 struct flock flock;
11733 fd = open("try.c", O_RDONLY);
11734 flock.l_type = F_RDLCK;
11735 flock.l_whence = SEEK_SET;
11736 flock.l_start = flock.l_len = 0;
11737 signal(SIGALRM, blech);
11739 retval = fcntl(fd, F_SETLK, &flock);
11741 (retval < 0 ? exit(2) : exit(0));
11747 echo "Checking if fcntl-based file locking works... "
11751 if eval $compile_ok; then
11752 if $run ./try; then
11753 echo "Yes, it seems to work."
11756 echo "Nope, it didn't work."
11761 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11762 *** This is (almost) impossible.
11763 *** If your NFS lock daemons are not feeling well, something like
11764 *** this may happen, please investigate. Cannot continue, aborting.
11772 echo "I'm unable to compile the test program, so I'll assume not."
11777 echo "Nope, since you don't even have fcntl()."
11780 set d_fcntl_can_lock
11785 : check for fd_set items
11788 Checking to see how well your C compiler handles fd_set and friends ...
11791 #$i_systime I_SYS_TIME
11792 #$i_sysselct I_SYS_SELECT
11793 #$d_socket HAS_SOCKET
11794 #include <sys/types.h>
11796 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11799 #include <sys/time.h>
11801 #ifdef I_SYS_SELECT
11802 #include <sys/select.h>
11811 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11819 if eval $compile; then
11820 d_fds_bits="$define"
11822 echo "Well, your system knows about the normal fd_set typedef..." >&4
11823 if $run ./try; then
11824 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11825 d_fd_macros="$define"
11828 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11830 d_fd_macros="$undef"
11834 Hmm, your compiler has some difficulty with fd_set. Checking further...
11837 if eval $compile; then
11838 d_fds_bits="$undef"
11840 echo "Well, your system has some sort of fd_set available..." >&4
11841 if $run ./try; then
11842 echo "and you have the normal fd_set macros." >&4
11843 d_fd_macros="$define"
11846 but not the normal fd_set macros! Gross! More work for me...
11848 d_fd_macros="$undef"
11851 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11853 d_fds_bits="$undef"
11854 d_fd_macros="$undef"
11859 : see if fgetpos exists
11860 set fgetpos d_fgetpos
11863 : see if finite exists
11864 set finite d_finite
11867 : see if finitel exists
11868 set finitel d_finitel
11871 : see if flock exists
11875 : see if prototype for flock is available
11877 set d_flockproto flock $i_sysfile sys/file.h
11880 : see if fork exists
11884 : see if fp_class exists
11885 set fp_class d_fp_class
11888 : see if pathconf exists
11889 set pathconf d_pathconf
11892 : see if fpathconf exists
11893 set fpathconf d_fpathconf
11896 : see if fpclass exists
11897 set fpclass d_fpclass
11900 : see if fpclassify exists
11901 set fpclassify d_fpclassify
11904 : see if fpclassl exists
11905 set fpclassl d_fpclassl
11909 : check for fpos64_t
11911 echo "Checking to see if you have fpos64_t..." >&4
11914 int main() { fpos64_t x = 7; }
11917 if eval $compile; then
11919 echo "You have fpos64_t."
11922 echo "You do not have fpos64_t."
11923 case "$fpossize" in
11924 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11931 : see if frexpl exists
11932 set frexpl d_frexpl
11935 : see if this is a sys/param system
11936 set sys/param.h i_sysparam
11939 : see if this is a sys/mount.h system
11940 set sys/mount.h i_sysmount
11945 echo "Checking to see if your system supports struct fs_data..." >&4
11946 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11948 case "$d_fs_data_s" in
11949 "$define") echo "Yes, it does." ;;
11950 *) echo "No, it doesn't." ;;
11953 : see if fseeko exists
11954 set fseeko d_fseeko
11956 case "$longsize" in
11957 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11960 : see if fsetpos exists
11961 set fsetpos d_fsetpos
11965 : see if fstatfs exists
11966 set fstatfs d_fstatfs
11970 : see if statvfs exists
11971 set statvfs d_statvfs
11974 : see if fstatvfs exists
11975 set fstatvfs d_fstatvfs
11979 : see if fsync exists
11983 : see if ftello exists
11984 set ftello d_ftello
11986 case "$longsize" in
11987 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11990 : see if getcwd exists
11991 set getcwd d_getcwd
11994 : see if getespwnam exists
11995 set getespwnam d_getespwnam
11999 : see if getfsstat exists
12000 set getfsstat d_getfsstat
12003 : see if getgrent exists
12004 set getgrent d_getgrent
12007 : see if getgrent_r exists
12008 set getgrent_r d_getgrent_r
12010 case "$d_getgrent_r" in
12012 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12013 case "$d_getgrent_r_proto:$usethreads" in
12014 ":define") d_getgrent_r_proto=define
12015 set d_getgrent_r_proto getgrent_r $hdrs
12019 case "$d_getgrent_r_proto" in
12021 case "$getgrent_r_proto" in
12022 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12023 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12025 case "$getgrent_r_proto" in
12026 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12027 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12029 case "$getgrent_r_proto" in
12030 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12031 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12033 case "$getgrent_r_proto" in
12034 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12035 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12037 case "$getgrent_r_proto" in
12038 ''|0) try='int getgrent_r(struct group*, char*, int);'
12039 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12041 case "$getgrent_r_proto" in
12042 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12043 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12045 case "$getgrent_r_proto" in
12046 ''|0) d_getgrent_r=undef
12048 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12049 * ) case "$getgrent_r_proto" in
12050 REENTRANT_PROTO*) ;;
12051 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12053 echo "Prototype: $try" ;;
12056 *) case "$usethreads" in
12057 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12064 *) getgrent_r_proto=0
12068 : see if getgrgid_r exists
12069 set getgrgid_r d_getgrgid_r
12071 case "$d_getgrgid_r" in
12073 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12074 case "$d_getgrgid_r_proto:$usethreads" in
12075 ":define") d_getgrgid_r_proto=define
12076 set d_getgrgid_r_proto getgrgid_r $hdrs
12080 case "$d_getgrgid_r_proto" in
12082 case "$getgrgid_r_proto" in
12083 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12084 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12086 case "$getgrgid_r_proto" in
12087 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12088 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12090 case "$getgrgid_r_proto" in
12091 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12092 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12094 case "$getgrgid_r_proto" in
12095 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12096 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12098 case "$getgrgid_r_proto" in
12099 ''|0) d_getgrgid_r=undef
12101 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12102 * ) case "$getgrgid_r_proto" in
12103 REENTRANT_PROTO*) ;;
12104 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12106 echo "Prototype: $try" ;;
12109 *) case "$usethreads" in
12110 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12117 *) getgrgid_r_proto=0
12121 : see if getgrnam_r exists
12122 set getgrnam_r d_getgrnam_r
12124 case "$d_getgrnam_r" in
12126 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12127 case "$d_getgrnam_r_proto:$usethreads" in
12128 ":define") d_getgrnam_r_proto=define
12129 set d_getgrnam_r_proto getgrnam_r $hdrs
12133 case "$d_getgrnam_r_proto" in
12135 case "$getgrnam_r_proto" in
12136 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12137 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12139 case "$getgrnam_r_proto" in
12140 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12141 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12143 case "$getgrnam_r_proto" in
12144 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12145 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12147 case "$getgrnam_r_proto" in
12148 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12149 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12151 case "$getgrnam_r_proto" in
12152 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12153 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12155 case "$getgrnam_r_proto" in
12156 ''|0) d_getgrnam_r=undef
12158 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12159 * ) case "$getgrnam_r_proto" in
12160 REENTRANT_PROTO*) ;;
12161 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12163 echo "Prototype: $try" ;;
12166 *) case "$usethreads" in
12167 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12174 *) getgrnam_r_proto=0
12178 : see if gethostbyaddr exists
12179 set gethostbyaddr d_gethbyaddr
12182 : see if gethostbyname exists
12183 set gethostbyname d_gethbyname
12186 : see if gethostent exists
12187 set gethostent d_gethent
12190 : see how we will look up host name
12193 if set gethostname val -f d_gethname; eval $csym; $val; then
12194 echo 'gethostname() found.' >&4
12195 d_gethname="$define"
12198 if set uname val -f d_uname; eval $csym; $val; then
12201 uname() was found, but you're running xenix, and older versions of xenix
12202 have a broken uname(). If you don't really know whether your xenix is old
12203 enough to have a broken system call, use the default answer.
12208 "$define") dflt=n;;
12210 rp='Is your uname() broken?'
12213 n*) d_uname="$define"; call=uname;;
12216 echo 'uname() found.' >&4
12223 case "$d_gethname" in
12224 '') d_gethname="$undef";;
12227 '') d_uname="$undef";;
12229 case "$d_uname$d_gethname" in
12234 Every now and then someone has a $call() that lies about the hostname
12235 but can't be fixed for political or economic reasons. If you wish, I can
12236 pretend $call() isn't there and maybe compute hostname at run-time
12237 thanks to the '$phostname' command.
12240 rp="Shall I ignore $call() from now on?"
12243 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12246 case "$phostname" in
12247 '') aphostname='';;
12248 *) case "$aphostname" in
12250 *) set X $phostname
12254 file=`./loc $file $file $pth`
12255 aphostname=`echo $file $*`
12260 case "$d_uname$d_gethname" in
12263 case "$phostname" in
12265 echo "There will be no way for $package to get your hostname." >&4;;
12267 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12271 case "$d_phostname" in
12272 '') d_phostname="$undef";;
12275 : see if gethostbyaddr_r exists
12276 set gethostbyaddr_r d_gethostbyaddr_r
12278 case "$d_gethostbyaddr_r" in
12280 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12281 case "$d_gethostbyaddr_r_proto:$usethreads" in
12282 ":define") d_gethostbyaddr_r_proto=define
12283 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12287 case "$d_gethostbyaddr_r_proto" in
12289 case "$gethostbyaddr_r_proto" in
12290 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12291 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12293 case "$gethostbyaddr_r_proto" in
12294 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12295 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12297 case "$gethostbyaddr_r_proto" in
12298 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12299 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12301 case "$gethostbyaddr_r_proto" in
12302 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12303 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12305 case "$gethostbyaddr_r_proto" in
12306 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12307 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12309 case "$gethostbyaddr_r_proto" in
12310 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12311 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12313 case "$gethostbyaddr_r_proto" in
12314 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12315 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12317 case "$gethostbyaddr_r_proto" in
12318 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12319 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12321 case "$gethostbyaddr_r_proto" in
12322 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12323 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12325 case "$gethostbyaddr_r_proto" in
12326 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12327 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12329 case "$gethostbyaddr_r_proto" in
12330 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12331 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12333 case "$gethostbyaddr_r_proto" in
12334 ''|0) d_gethostbyaddr_r=undef
12335 gethostbyaddr_r_proto=0
12336 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12337 * ) case "$gethostbyaddr_r_proto" in
12338 REENTRANT_PROTO*) ;;
12339 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12341 echo "Prototype: $try" ;;
12344 *) case "$usethreads" in
12345 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12347 d_gethostbyaddr_r=undef
12348 gethostbyaddr_r_proto=0
12352 *) gethostbyaddr_r_proto=0
12356 : see if gethostbyname_r exists
12357 set gethostbyname_r d_gethostbyname_r
12359 case "$d_gethostbyname_r" in
12361 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12362 case "$d_gethostbyname_r_proto:$usethreads" in
12363 ":define") d_gethostbyname_r_proto=define
12364 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12368 case "$d_gethostbyname_r_proto" in
12370 case "$gethostbyname_r_proto" in
12371 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12372 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12374 case "$gethostbyname_r_proto" in
12375 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12376 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12378 case "$gethostbyname_r_proto" in
12379 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12380 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12382 case "$gethostbyname_r_proto" in
12383 ''|0) d_gethostbyname_r=undef
12384 gethostbyname_r_proto=0
12385 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12386 * ) case "$gethostbyname_r_proto" in
12387 REENTRANT_PROTO*) ;;
12388 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12390 echo "Prototype: $try" ;;
12393 *) case "$usethreads" in
12394 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12396 d_gethostbyname_r=undef
12397 gethostbyname_r_proto=0
12401 *) gethostbyname_r_proto=0
12405 : see if gethostent_r exists
12406 set gethostent_r d_gethostent_r
12408 case "$d_gethostent_r" in
12410 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12411 case "$d_gethostent_r_proto:$usethreads" in
12412 ":define") d_gethostent_r_proto=define
12413 set d_gethostent_r_proto gethostent_r $hdrs
12417 case "$d_gethostent_r_proto" in
12419 case "$gethostent_r_proto" in
12420 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12421 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12423 case "$gethostent_r_proto" in
12424 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12425 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12427 case "$gethostent_r_proto" in
12428 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12429 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12431 case "$gethostent_r_proto" in
12432 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12433 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12435 case "$gethostent_r_proto" in
12436 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12437 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12439 case "$gethostent_r_proto" in
12440 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
12441 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
12443 case "$gethostent_r_proto" in
12444 ''|0) d_gethostent_r=undef
12445 gethostent_r_proto=0
12446 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
12447 * ) case "$gethostent_r_proto" in
12448 REENTRANT_PROTO*) ;;
12449 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
12451 echo "Prototype: $try" ;;
12454 *) case "$usethreads" in
12455 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
12457 d_gethostent_r=undef
12458 gethostent_r_proto=0
12462 *) gethostent_r_proto=0
12466 : see if prototypes for various gethostxxx netdb.h functions are available
12468 set d_gethostprotos gethostent $i_netdb netdb.h
12471 : see if getitimer exists
12472 set getitimer d_getitimer
12475 : see if getlogin exists
12476 set getlogin d_getlogin
12479 : see if getlogin_r exists
12480 set getlogin_r d_getlogin_r
12482 case "$d_getlogin_r" in
12484 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
12485 case "$d_getlogin_r_proto:$usethreads" in
12486 ":define") d_getlogin_r_proto=define
12487 set d_getlogin_r_proto getlogin_r $hdrs
12491 case "$d_getlogin_r_proto" in
12493 case "$getlogin_r_proto" in
12494 ''|0) try='int getlogin_r(char*, size_t);'
12495 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
12497 case "$getlogin_r_proto" in
12498 ''|0) try='int getlogin_r(char*, int);'
12499 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12501 case "$getlogin_r_proto" in
12502 ''|0) try='char* getlogin_r(char*, size_t);'
12503 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12505 case "$getlogin_r_proto" in
12506 ''|0) try='char* getlogin_r(char*, int);'
12507 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12509 case "$getlogin_r_proto" in
12510 ''|0) d_getlogin_r=undef
12512 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12513 * ) case "$getlogin_r_proto" in
12514 REENTRANT_PROTO*) ;;
12515 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12517 echo "Prototype: $try" ;;
12520 *) case "$usethreads" in
12521 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12528 *) getlogin_r_proto=0
12532 : see if getmnt exists
12533 set getmnt d_getmnt
12536 : see if getmntent exists
12537 set getmntent d_getmntent
12540 : see if getnetbyaddr exists
12541 set getnetbyaddr d_getnbyaddr
12544 : see if getnetbyname exists
12545 set getnetbyname d_getnbyname
12548 : see if getnetent exists
12549 set getnetent d_getnent
12552 : see if getnetbyaddr_r exists
12553 set getnetbyaddr_r d_getnetbyaddr_r
12555 case "$d_getnetbyaddr_r" in
12557 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12558 case "$d_getnetbyaddr_r_proto:$usethreads" in
12559 ":define") d_getnetbyaddr_r_proto=define
12560 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12564 case "$d_getnetbyaddr_r_proto" in
12566 case "$getnetbyaddr_r_proto" in
12567 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12568 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12570 case "$getnetbyaddr_r_proto" in
12571 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12572 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12574 case "$getnetbyaddr_r_proto" in
12575 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12576 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12578 case "$getnetbyaddr_r_proto" in
12579 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12580 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12582 case "$getnetbyaddr_r_proto" in
12583 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12584 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12586 case "$getnetbyaddr_r_proto" in
12587 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12588 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12590 case "$getnetbyaddr_r_proto" in
12591 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12592 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12594 case "$getnetbyaddr_r_proto" in
12595 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
12596 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
12598 case "$getnetbyaddr_r_proto" in
12599 ''|0) d_getnetbyaddr_r=undef
12600 getnetbyaddr_r_proto=0
12601 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12602 * ) case "$getnetbyaddr_r_proto" in
12603 REENTRANT_PROTO*) ;;
12604 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12606 echo "Prototype: $try" ;;
12609 *) case "$usethreads" in
12610 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12612 d_getnetbyaddr_r=undef
12613 getnetbyaddr_r_proto=0
12617 *) getnetbyaddr_r_proto=0
12621 : see if getnetbyname_r exists
12622 set getnetbyname_r d_getnetbyname_r
12624 case "$d_getnetbyname_r" in
12626 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12627 case "$d_getnetbyname_r_proto:$usethreads" in
12628 ":define") d_getnetbyname_r_proto=define
12629 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12633 case "$d_getnetbyname_r_proto" in
12635 case "$getnetbyname_r_proto" in
12636 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12637 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12639 case "$getnetbyname_r_proto" in
12640 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12641 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12643 case "$getnetbyname_r_proto" in
12644 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12645 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12647 case "$getnetbyname_r_proto" in
12648 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12649 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12651 case "$getnetbyname_r_proto" in
12652 ''|0) d_getnetbyname_r=undef
12653 getnetbyname_r_proto=0
12654 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12655 * ) case "$getnetbyname_r_proto" in
12656 REENTRANT_PROTO*) ;;
12657 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12659 echo "Prototype: $try" ;;
12662 *) case "$usethreads" in
12663 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12665 d_getnetbyname_r=undef
12666 getnetbyname_r_proto=0
12670 *) getnetbyname_r_proto=0
12674 : see if getnetent_r exists
12675 set getnetent_r d_getnetent_r
12677 case "$d_getnetent_r" in
12679 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12680 case "$d_getnetent_r_proto:$usethreads" in
12681 ":define") d_getnetent_r_proto=define
12682 set d_getnetent_r_proto getnetent_r $hdrs
12686 case "$d_getnetent_r_proto" in
12688 case "$getnetent_r_proto" in
12689 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12690 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12692 case "$getnetent_r_proto" in
12693 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12694 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12696 case "$getnetent_r_proto" in
12697 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12698 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12700 case "$getnetent_r_proto" in
12701 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12702 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12704 case "$getnetent_r_proto" in
12705 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12706 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12708 case "$getnetent_r_proto" in
12709 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12710 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12712 case "$getnetent_r_proto" in
12713 ''|0) d_getnetent_r=undef
12714 getnetent_r_proto=0
12715 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12716 * ) case "$getnetent_r_proto" in
12717 REENTRANT_PROTO*) ;;
12718 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12720 echo "Prototype: $try" ;;
12723 *) case "$usethreads" in
12724 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12726 d_getnetent_r=undef
12727 getnetent_r_proto=0
12731 *) getnetent_r_proto=0
12735 : see if prototypes for various getnetxxx netdb.h functions are available
12737 set d_getnetprotos getnetent $i_netdb netdb.h
12740 : see if getpagesize exists
12741 set getpagesize d_getpagsz
12745 : see if getprotobyname exists
12746 set getprotobyname d_getpbyname
12749 : see if getprotobynumber exists
12750 set getprotobynumber d_getpbynumber
12753 : see if getprotoent exists
12754 set getprotoent d_getpent
12757 : see if getpgid exists
12758 set getpgid d_getpgid
12761 : see if getpgrp2 exists
12762 set getpgrp2 d_getpgrp2
12765 : see if getppid exists
12766 set getppid d_getppid
12769 : see if getpriority exists
12770 set getpriority d_getprior
12773 : see if getprotobyname_r exists
12774 set getprotobyname_r d_getprotobyname_r
12776 case "$d_getprotobyname_r" in
12778 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12779 case "$d_getprotobyname_r_proto:$usethreads" in
12780 ":define") d_getprotobyname_r_proto=define
12781 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12785 case "$d_getprotobyname_r_proto" in
12787 case "$getprotobyname_r_proto" in
12788 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12789 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12791 case "$getprotobyname_r_proto" in
12792 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12793 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12795 case "$getprotobyname_r_proto" in
12796 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12797 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12799 case "$getprotobyname_r_proto" in
12800 ''|0) d_getprotobyname_r=undef
12801 getprotobyname_r_proto=0
12802 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12803 * ) case "$getprotobyname_r_proto" in
12804 REENTRANT_PROTO*) ;;
12805 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12807 echo "Prototype: $try" ;;
12810 *) case "$usethreads" in
12811 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12813 d_getprotobyname_r=undef
12814 getprotobyname_r_proto=0
12818 *) getprotobyname_r_proto=0
12822 : see if getprotobynumber_r exists
12823 set getprotobynumber_r d_getprotobynumber_r
12825 case "$d_getprotobynumber_r" in
12827 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12828 case "$d_getprotobynumber_r_proto:$usethreads" in
12829 ":define") d_getprotobynumber_r_proto=define
12830 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12834 case "$d_getprotobynumber_r_proto" in
12836 case "$getprotobynumber_r_proto" in
12837 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12838 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12840 case "$getprotobynumber_r_proto" in
12841 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12842 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12844 case "$getprotobynumber_r_proto" in
12845 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12846 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12848 case "$getprotobynumber_r_proto" in
12849 ''|0) d_getprotobynumber_r=undef
12850 getprotobynumber_r_proto=0
12851 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12852 * ) case "$getprotobynumber_r_proto" in
12853 REENTRANT_PROTO*) ;;
12854 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12856 echo "Prototype: $try" ;;
12859 *) case "$usethreads" in
12860 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12862 d_getprotobynumber_r=undef
12863 getprotobynumber_r_proto=0
12867 *) getprotobynumber_r_proto=0
12871 : see if getprotoent_r exists
12872 set getprotoent_r d_getprotoent_r
12874 case "$d_getprotoent_r" in
12876 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12877 case "$d_getprotoent_r_proto:$usethreads" in
12878 ":define") d_getprotoent_r_proto=define
12879 set d_getprotoent_r_proto getprotoent_r $hdrs
12883 case "$d_getprotoent_r_proto" in
12885 case "$getprotoent_r_proto" in
12886 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12887 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12889 case "$getprotoent_r_proto" in
12890 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12891 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12893 case "$getprotoent_r_proto" in
12894 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12895 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12897 case "$getprotoent_r_proto" in
12898 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12899 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12901 case "$getprotoent_r_proto" in
12902 ''|0) d_getprotoent_r=undef
12903 getprotoent_r_proto=0
12904 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12905 * ) case "$getprotoent_r_proto" in
12906 REENTRANT_PROTO*) ;;
12907 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12909 echo "Prototype: $try" ;;
12912 *) case "$usethreads" in
12913 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12915 d_getprotoent_r=undef
12916 getprotoent_r_proto=0
12920 *) getprotoent_r_proto=0
12924 : see if prototypes for various getprotoxxx netdb.h functions are available
12926 set d_getprotoprotos getprotoent $i_netdb netdb.h
12929 : see if getprpwnam exists
12930 set getprpwnam d_getprpwnam
12933 : see if getpwent exists
12934 set getpwent d_getpwent
12937 : see if getpwent_r exists
12938 set getpwent_r d_getpwent_r
12940 case "$d_getpwent_r" in
12942 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12943 case "$d_getpwent_r_proto:$usethreads" in
12944 ":define") d_getpwent_r_proto=define
12945 set d_getpwent_r_proto getpwent_r $hdrs
12949 case "$d_getpwent_r_proto" in
12951 case "$getpwent_r_proto" in
12952 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12953 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12955 case "$getpwent_r_proto" in
12956 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12957 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12959 case "$getpwent_r_proto" in
12960 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12961 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12963 case "$getpwent_r_proto" in
12964 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12965 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12967 case "$getpwent_r_proto" in
12968 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12969 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12971 case "$getpwent_r_proto" in
12972 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12973 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12975 case "$getpwent_r_proto" in
12976 ''|0) d_getpwent_r=undef
12978 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12979 * ) case "$getpwent_r_proto" in
12980 REENTRANT_PROTO*) ;;
12981 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12983 echo "Prototype: $try" ;;
12986 *) case "$usethreads" in
12987 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12994 *) getpwent_r_proto=0
12998 : see if getpwnam_r exists
12999 set getpwnam_r d_getpwnam_r
13001 case "$d_getpwnam_r" in
13003 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13004 case "$d_getpwnam_r_proto:$usethreads" in
13005 ":define") d_getpwnam_r_proto=define
13006 set d_getpwnam_r_proto getpwnam_r $hdrs
13010 case "$d_getpwnam_r_proto" in
13012 case "$getpwnam_r_proto" in
13013 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13014 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13016 case "$getpwnam_r_proto" in
13017 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13018 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13020 case "$getpwnam_r_proto" in
13021 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13022 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13024 case "$getpwnam_r_proto" in
13025 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13026 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13028 case "$getpwnam_r_proto" in
13029 ''|0) d_getpwnam_r=undef
13031 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13032 * ) case "$getpwnam_r_proto" in
13033 REENTRANT_PROTO*) ;;
13034 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13036 echo "Prototype: $try" ;;
13039 *) case "$usethreads" in
13040 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13047 *) getpwnam_r_proto=0
13051 : see if getpwuid_r exists
13052 set getpwuid_r d_getpwuid_r
13054 case "$d_getpwuid_r" in
13056 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13057 case "$d_getpwuid_r_proto:$usethreads" in
13058 ":define") d_getpwuid_r_proto=define
13059 set d_getpwuid_r_proto getpwuid_r $hdrs
13063 case "$d_getpwuid_r_proto" in
13065 case "$getpwuid_r_proto" in
13066 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13067 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13069 case "$getpwuid_r_proto" in
13070 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13071 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13073 case "$getpwuid_r_proto" in
13074 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13075 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13077 case "$getpwuid_r_proto" in
13078 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13079 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13081 case "$getpwuid_r_proto" in
13082 ''|0) d_getpwuid_r=undef
13084 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13085 * ) case "$getpwuid_r_proto" in
13086 REENTRANT_PROTO*) ;;
13087 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13089 echo "Prototype: $try" ;;
13092 *) case "$usethreads" in
13093 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13100 *) getpwuid_r_proto=0
13105 : see if getservbyname exists
13106 set getservbyname d_getsbyname
13109 : see if getservbyport exists
13110 set getservbyport d_getsbyport
13113 : see if getservent exists
13114 set getservent d_getsent
13117 : see if getservbyname_r exists
13118 set getservbyname_r d_getservbyname_r
13120 case "$d_getservbyname_r" in
13122 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13123 case "$d_getservbyname_r_proto:$usethreads" in
13124 ":define") d_getservbyname_r_proto=define
13125 set d_getservbyname_r_proto getservbyname_r $hdrs
13129 case "$d_getservbyname_r_proto" in
13131 case "$getservbyname_r_proto" in
13132 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13133 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13135 case "$getservbyname_r_proto" in
13136 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13137 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13139 case "$getservbyname_r_proto" in
13140 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13141 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13143 case "$getservbyname_r_proto" in
13144 ''|0) d_getservbyname_r=undef
13145 getservbyname_r_proto=0
13146 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13147 * ) case "$getservbyname_r_proto" in
13148 REENTRANT_PROTO*) ;;
13149 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13151 echo "Prototype: $try" ;;
13154 *) case "$usethreads" in
13155 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13157 d_getservbyname_r=undef
13158 getservbyname_r_proto=0
13162 *) getservbyname_r_proto=0
13166 : see if getservbyport_r exists
13167 set getservbyport_r d_getservbyport_r
13169 case "$d_getservbyport_r" in
13171 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13172 case "$d_getservbyport_r_proto:$usethreads" in
13173 ":define") d_getservbyport_r_proto=define
13174 set d_getservbyport_r_proto getservbyport_r $hdrs
13178 case "$d_getservbyport_r_proto" in
13180 case "$getservbyport_r_proto" in
13181 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13182 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13184 case "$getservbyport_r_proto" in
13185 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13186 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13188 case "$getservbyport_r_proto" in
13189 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13190 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13192 case "$getservbyport_r_proto" in
13193 ''|0) d_getservbyport_r=undef
13194 getservbyport_r_proto=0
13195 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13196 * ) case "$getservbyport_r_proto" in
13197 REENTRANT_PROTO*) ;;
13198 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13200 echo "Prototype: $try" ;;
13203 *) case "$usethreads" in
13204 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13206 d_getservbyport_r=undef
13207 getservbyport_r_proto=0
13211 *) getservbyport_r_proto=0
13215 : see if getservent_r exists
13216 set getservent_r d_getservent_r
13218 case "$d_getservent_r" in
13220 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13221 case "$d_getservent_r_proto:$usethreads" in
13222 ":define") d_getservent_r_proto=define
13223 set d_getservent_r_proto getservent_r $hdrs
13227 case "$d_getservent_r_proto" in
13229 case "$getservent_r_proto" in
13230 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13231 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13233 case "$getservent_r_proto" in
13234 ''|0) try='int getservent_r(struct servent*, char*, int);'
13235 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13237 case "$getservent_r_proto" in
13238 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13239 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13241 case "$getservent_r_proto" in
13242 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13243 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13245 case "$getservent_r_proto" in
13246 ''|0) d_getservent_r=undef
13247 getservent_r_proto=0
13248 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13249 * ) case "$getservent_r_proto" in
13250 REENTRANT_PROTO*) ;;
13251 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13253 echo "Prototype: $try" ;;
13256 *) case "$usethreads" in
13257 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13259 d_getservent_r=undef
13260 getservent_r_proto=0
13264 *) getservent_r_proto=0
13268 : see if prototypes for various getservxxx netdb.h functions are available
13270 set d_getservprotos getservent $i_netdb netdb.h
13273 : see if getspnam exists
13274 set getspnam d_getspnam
13277 : see if this is a shadow.h system
13278 set shadow.h i_shadow
13281 : see if getspnam_r exists
13282 set getspnam_r d_getspnam_r
13284 case "$d_getspnam_r" in
13286 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13287 case "$d_getspnam_r_proto:$usethreads" in
13288 ":define") d_getspnam_r_proto=define
13289 set d_getspnam_r_proto getspnam_r $hdrs
13293 case "$d_getspnam_r_proto" in
13295 case "$getspnam_r_proto" in
13296 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13297 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13299 case "$getspnam_r_proto" in
13300 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13301 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13303 case "$getspnam_r_proto" in
13304 ''|0) d_getspnam_r=undef
13306 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13307 * ) case "$getspnam_r_proto" in
13308 REENTRANT_PROTO*) ;;
13309 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13311 echo "Prototype: $try" ;;
13314 *) case "$usethreads" in
13315 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13322 *) getspnam_r_proto=0
13326 : see if gettimeofday or ftime exists
13327 set gettimeofday d_gettimeod
13329 case "$d_gettimeod" in
13335 val="$undef"; set d_ftime; eval $setvar
13338 case "$d_gettimeod$d_ftime" in
13341 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13345 : see if gmtime_r exists
13346 set gmtime_r d_gmtime_r
13348 case "$d_gmtime_r" in
13350 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13351 case "$d_gmtime_r_proto:$usethreads" in
13352 ":define") d_gmtime_r_proto=define
13353 set d_gmtime_r_proto gmtime_r $hdrs
13357 case "$d_gmtime_r_proto" in
13359 case "$gmtime_r_proto" in
13360 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13361 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13363 case "$gmtime_r_proto" in
13364 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13365 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13367 case "$gmtime_r_proto" in
13368 ''|0) d_gmtime_r=undef
13370 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13371 * ) case "$gmtime_r_proto" in
13372 REENTRANT_PROTO*) ;;
13373 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13375 echo "Prototype: $try" ;;
13378 *) case "$usethreads" in
13379 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13386 *) gmtime_r_proto=0
13390 : see if hasmntopt exists
13391 set hasmntopt d_hasmntopt
13394 : see if this is a netinet/in.h or sys/in.h system
13395 set netinet/in.h i_niin sys/in.h i_sysin
13398 : see if arpa/inet.h has to be included
13399 set arpa/inet.h i_arpainet
13402 : see if htonl --and friends-- exists
13407 : Maybe they are macros.
13410 $cat >htonl.c <<EOM
13412 #include <sys/types.h>
13413 #$i_niin I_NETINET_IN
13415 #$i_arpainet I_ARPA_INET
13416 #ifdef I_NETINET_IN
13417 #include <netinet/in.h>
13420 #include <sys/in.h>
13423 #include <arpa/inet.h>
13426 printf("Defined as a macro.");
13429 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13430 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13432 echo "But it seems to be defined as a macro." >&4
13442 if set index val -f; eval $csym; $val; then
13443 if set strchr val -f d_strchr; eval $csym; $val; then
13444 if $contains strchr "$strings" >/dev/null 2>&1 ; then
13447 echo "strchr() found." >&4
13451 echo "index() found." >&4
13456 echo "index() found." >&4
13459 if set strchr val -f d_strchr; eval $csym; $val; then
13462 echo "strchr() found." >&4
13464 echo "No index() or strchr() found!" >&4
13469 set d_strchr; eval $setvar
13471 set d_index; eval $setvar
13473 : check whether inet_aton exists
13474 set inet_aton d_inetaton
13479 $cat >isascii.c <<'EOCP'
13491 if eval $compile; then
13492 echo "isascii() found." >&4
13495 echo "isascii() NOT found." >&4
13502 : see if isfinite exists
13503 set isfinite d_isfinite
13506 : see if isinf exists
13510 : see if isnan exists
13514 : see if isnanl exists
13515 set isnanl d_isnanl
13518 : see if killpg exists
13519 set killpg d_killpg
13522 : see if lchown exists
13524 $cat > try.c <<'EOCP'
13525 /* System header to define __stub macros and hopefully few prototypes,
13526 which can conflict with char lchown(); below. */
13527 #include <assert.h>
13528 /* Override any gcc2 internal prototype to avoid an error. */
13529 /* We use char because int might match the return type of a gcc2
13530 builtin and then its argument prototype would still apply. */
13533 /* The GNU C library defines this for functions which it implements
13534 to always fail with ENOSYS. Some functions are actually named
13535 something starting with __ and the normal name is an alias. */
13536 #if defined (__stub_lchown) || defined (__stub___lchown)
13544 if eval $compile; then
13545 $echo "lchown() found." >&4
13548 $echo "lchown() NOT found." >&4
13554 : See if number of significant digits in a double precision number is known
13556 $cat >ldbl_dig.c <<EOM
13557 #$i_limits I_LIMITS
13560 #include <limits.h>
13566 printf("Contains LDBL_DIG");
13569 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13570 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13571 echo "LDBL_DIG found." >&4
13574 echo "LDBL_DIG NOT found." >&4
13581 : see if link exists
13585 : see if localtime_r exists
13586 set localtime_r d_localtime_r
13588 case "$d_localtime_r" in
13590 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13591 case "$d_localtime_r_proto:$usethreads" in
13592 ":define") d_localtime_r_proto=define
13593 set d_localtime_r_proto localtime_r $hdrs
13597 case "$d_localtime_r_proto" in
13599 case "$localtime_r_proto" in
13600 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13601 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13603 case "$localtime_r_proto" in
13604 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13605 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13607 case "$localtime_r_proto" in
13608 ''|0) d_localtime_r=undef
13609 localtime_r_proto=0
13610 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13611 * ) case "$localtime_r_proto" in
13612 REENTRANT_PROTO*) ;;
13613 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13615 echo "Prototype: $try" ;;
13618 *) case "$usethreads" in
13619 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13621 d_localtime_r=undef
13622 localtime_r_proto=0
13626 *) localtime_r_proto=0
13630 : see if localeconv exists
13631 set localeconv d_locconv
13634 : see if lockf exists
13638 : see if prototype for lseek is available
13640 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13643 : see if lstat exists
13647 : see if madvise exists
13648 set madvise d_madvise
13651 : see if mblen exists
13655 : see if mbstowcs exists
13656 set mbstowcs d_mbstowcs
13659 : see if mbtowc exists
13660 set mbtowc d_mbtowc
13663 : see if memchr exists
13664 set memchr d_memchr
13667 : see if memcmp exists
13668 set memcmp d_memcmp
13671 : see if memcpy exists
13672 set memcpy d_memcpy
13675 : see if memmove exists
13676 set memmove d_memmove
13679 : see if memset exists
13680 set memset d_memset
13683 : see if mkdir exists
13687 : see if mkdtemp exists
13688 set mkdtemp d_mkdtemp
13691 : see if mkfifo exists
13692 set mkfifo d_mkfifo
13695 : see if mkstemp exists
13696 set mkstemp d_mkstemp
13699 : see if mkstemps exists
13700 set mkstemps d_mkstemps
13703 : see if mktime exists
13704 set mktime d_mktime
13707 : see if this is a sys/mman.h system
13708 set sys/mman.h i_sysmman
13711 : see if mmap exists
13714 : see what shmat returns
13715 : default to something harmless
13717 case "$i_sysmman$d_mmap" in
13719 $cat >mmap.c <<'END'
13720 #include <sys/mman.h>
13723 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13728 echo "and it returns ($mmaptype)." >&4
13734 : see if mprotect exists
13735 set mprotect d_mprotect
13738 : see if msgctl exists
13739 set msgctl d_msgctl
13742 : see if msgget exists
13743 set msgget d_msgget
13746 : see if msgsnd exists
13747 set msgsnd d_msgsnd
13750 : see if msgrcv exists
13751 set msgrcv d_msgrcv
13754 : see how much of the 'msg*(2)' library is present.
13757 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13758 *"$undef"*) h_msg=false;;
13762 case "`ipcs 2>&1`" in
13763 "SVID messages"*"not configured"*)
13764 echo "Your $osname does not have the msg*(2) configured." >&4
13767 set msgctl d_msgctl
13769 set msgget d_msgget
13771 set msgsnd d_msgsnd
13773 set msgrcv d_msgrcv
13779 : we could also check for sys/ipc.h ...
13780 if $h_msg && $test `./findhdr sys/msg.h`; then
13781 echo "You have the full msg*(2) library." >&4
13784 echo "You don't have the full msg*(2) library." >&4
13792 echo "Checking to see if your system supports struct msghdr..." >&4
13793 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13795 case "$d_msghdr_s" in
13796 "$define") echo "Yes, it does." ;;
13797 *) echo "No, it doesn't." ;;
13801 : see if msync exists
13805 : see if munmap exists
13806 set munmap d_munmap
13809 : see if nanosleep exists
13810 set nanosleep d_nanosleep
13813 : see if nice exists
13817 : see if this is a langinfo.h system
13818 set langinfo.h i_langinfo
13821 : see if nl_langinfo exists
13822 set nl_langinfo d_nl_langinfo
13825 : check for length of character
13827 case "$charsize" in
13829 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13832 #$i_stdlib I_STDLIB
13834 #include <stdlib.h>
13838 printf("%d\n", (int)sizeof(char));
13843 if eval $compile_ok; then
13847 echo "(I can't seem to compile the test program. Guessing...)"
13854 rp="What is the size of a character (in bytes)?"
13859 : check for volatile keyword
13861 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13862 $cat >try.c <<'EOCP'
13865 typedef struct _goo_struct goo_struct;
13866 goo_struct * volatile goo = ((goo_struct *)0);
13867 struct _goo_struct {
13872 typedef unsigned short foo_t;
13873 char *volatile foo;
13875 volatile foo_t blech;
13879 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13881 echo "Yup, it does."
13884 echo "Nope, it doesn't."
13892 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13894 case "$use64bitint:$d_quad:$quadtype" in
13897 uvtype="$uquadtype"
13902 uvtype="unsigned long"
13908 case "$uselongdouble:$d_longdbl" in
13910 nvtype="long double"
13911 nvsize=$longdblsize
13918 $echo "(IV will be "$ivtype", $ivsize bytes)"
13919 $echo "(UV will be "$uvtype", $uvsize bytes)"
13920 $echo "(NV will be "$nvtype", $nvsize bytes)"
13923 #$i_inttypes I_INTTYPES
13925 #include <inttypes.h>
13930 int8_t i = INT8_MAX;
13931 uint8_t u = UINT8_MAX;
13932 printf("int8_t\n");
13935 int16_t i = INT16_MAX;
13936 uint16_t i = UINT16_MAX;
13937 printf("int16_t\n");
13940 int32_t i = INT32_MAX;
13941 uint32_t u = UINT32_MAX;
13942 printf("int32_t\n");
13948 '') case "$charsize" in
13950 u8type="unsigned char"
13959 if eval $compile; then
13960 case "`$run ./try`" in
13961 int8_t) i8type=int8_t
13971 '') if $test $charsize -ge 1; then
13973 u8type="unsigned char"
13981 '') case "$shortsize" in
13983 u16type="unsigned short"
13991 '') set try -DINT16
13992 if eval $compile; then
13993 case "`$run ./try`" in
14005 '') if $test $shortsize -ge 2; then
14007 u16type="unsigned short"
14015 '') case "$longsize" in
14017 u32type="unsigned long"
14021 *) case "$intsize" in
14023 u32type="unsigned int"
14033 '') set try -DINT32
14034 if eval $compile; then
14035 case "`$run ./try`" in
14047 '') if $test $intsize -ge 4; then
14049 u32type="unsigned int"
14057 '') case "$d_quad:$quadtype" in
14059 i64type="$quadtype"
14060 u64type="$uquadtype"
14068 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14069 : volatile so that the compiler has to store it out to memory.
14070 if test X"$d_volatile" = X"$define"; then
14075 #include <sys/types.h>
14076 #include <signal.h>
14078 $volatile int bletched = 0;
14079 $signal_t blech(s) int s; { bletched = 1; }
14084 int n = 8 * $uvsize;
14087 signal(SIGFPE, blech);
14090 for (i = 0; i < n; i++) {
14091 u = u << 1 | ($uvtype)1;
14093 if (($uvtype)d != u)
14097 d = ($nvtype)(u - 1);
14098 if (($uvtype)d != (u - 1))
14106 printf("%d\n", ((i == n) ? -n : i));
14112 d_nv_preserves_uv="$undef"
14113 if eval $compile; then
14114 nv_preserves_uv_bits="`$run ./try`"
14116 case "$nv_preserves_uv_bits" in
14118 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14119 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14120 d_nv_preserves_uv="$define"
14122 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14123 d_nv_preserves_uv="$undef" ;;
14124 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14125 nv_preserves_uv_bits="$undef" ;;
14131 : check for off64_t
14133 echo "Checking to see if you have off64_t..." >&4
14135 #include <sys/types.h>
14136 #include <unistd.h>
14137 int main() { off64_t x = 7; }
14140 if eval $compile; then
14142 echo "You have off64_t."
14145 echo "You do not have off64_t."
14146 case "$lseeksize" in
14147 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
14154 : how to create joinable pthreads
14155 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
14157 echo "Checking what constant to use for creating joinable pthreads..." >&4
14158 $cat >try.c <<'EOCP'
14159 #include <pthread.h>
14161 int detachstate = JOINABLE;
14164 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
14165 if eval $compile; then
14166 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
14167 val="$undef" # Yes, undef.
14168 set d_old_pthread_create_joinable
14171 set old_pthread_create_joinable
14174 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
14175 if eval $compile; then
14176 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
14178 set d_old_pthread_create_joinable
14180 val=PTHREAD_CREATE_UNDETACHED
14181 set old_pthread_create_joinable
14184 set try -DJOINABLE=__UNDETACHED
14185 if eval $compile; then
14186 echo "You seem to use __UNDETACHED." >&4
14188 set d_old_pthread_create_joinable
14191 set old_pthread_create_joinable
14194 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
14196 set d_old_pthread_create_joinable
14199 set old_pthread_create_joinable
14206 d_old_pthread_create_joinable="$undef"
14207 old_pthread_create_joinable=""
14210 : see if pause exists
14214 : see if pipe exists
14218 : see if poll exists
14222 : see if readlink exists
14223 set readlink d_readlink
14229 case "$d_readlink" in
14231 if $issymlink /proc/self/exe ; then
14232 $ls -l /proc/self/exe > reflect
14233 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14234 echo "You have Linux-like /proc/self/exe."
14235 procselfexe='"/proc/self/exe"'
14239 if $issymlink /proc/curproc/file ; then
14240 $ls -l /proc/curproc/file > reflect
14241 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14242 echo "You have BSD-like /proc/curproc/file."
14243 procselfexe='"/proc/curproc/file"'
14253 : see whether the pthread_atfork exists
14255 #include <pthread.h>
14258 #ifdef PTHREAD_ATFORK
14259 pthread_atfork(NULL,NULL,NULL);
14264 : see if pthread_atfork exists
14265 set try -DPTHREAD_ATFORK
14266 if eval $compile; then
14271 case "$usethreads" in
14274 $define) echo 'pthread_atfork found.' >&4 ;;
14275 *) echo 'pthread_atfork NOT found.' >&4 ;;
14278 set d_pthread_atfork
14282 : see whether the various POSIXish _yields exist
14284 #include <pthread.h>
14290 #ifdef PTHREAD_YIELD
14293 #ifdef PTHREAD_YIELD_NULL
14294 pthread_yield(NULL);
14300 : see if sched_yield exists
14301 set try -DSCHED_YIELD
14302 if eval $compile; then
14304 sched_yield='sched_yield()'
14308 case "$usethreads" in
14311 $define) echo 'sched_yield() found.' >&4 ;;
14312 *) echo 'sched_yield() NOT found.' >&4 ;;
14318 : see if pthread_yield exists
14319 set try -DPTHREAD_YIELD
14320 if eval $compile; then
14322 case "$sched_yield" in
14323 '') sched_yield='pthread_yield()' ;;
14326 set try -DPTHREAD_YIELD_NULL
14327 if eval $compile; then
14329 case "$sched_yield" in
14330 '') sched_yield='pthread_yield(NULL)' ;;
14336 case "$usethreads" in
14339 $define) echo 'pthread_yield() found.' >&4 ;;
14340 *) echo 'pthread_yield() NOT found.' >&4 ;;
14344 set d_pthread_yield
14347 case "$sched_yield" in
14348 '') sched_yield=undef ;;
14353 : see if random_r exists
14354 set random_r d_random_r
14356 case "$d_random_r" in
14358 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
14359 case "$d_random_r_proto:$usethreads" in
14360 ":define") d_random_r_proto=define
14361 set d_random_r_proto random_r $hdrs
14365 case "$d_random_r_proto" in
14367 case "$random_r_proto" in
14368 ''|0) try='int random_r(int*, struct random_data*);'
14369 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
14371 case "$random_r_proto" in
14372 ''|0) try='int random_r(long*, struct random_data*);'
14373 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
14375 case "$random_r_proto" in
14376 ''|0) try='int random_r(struct random_data*, int32_t*);'
14377 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
14379 case "$random_r_proto" in
14380 ''|0) d_random_r=undef
14382 echo "Disabling random_r, cannot determine prototype." >&4 ;;
14383 * ) case "$random_r_proto" in
14384 REENTRANT_PROTO*) ;;
14385 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
14387 echo "Prototype: $try" ;;
14390 *) case "$usethreads" in
14391 define) echo "random_r has no prototype, not using it." >&4 ;;
14398 *) random_r_proto=0
14402 : see if readdir and friends exist
14403 set readdir d_readdir
14405 set seekdir d_seekdir
14407 set telldir d_telldir
14409 set rewinddir d_rewinddir
14412 : see if readdir64_r exists
14413 set readdir64_r d_readdir64_r
14415 case "$d_readdir64_r" in
14417 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14418 case "$d_readdir64_r_proto:$usethreads" in
14419 ":define") d_readdir64_r_proto=define
14420 set d_readdir64_r_proto readdir64_r $hdrs
14424 case "$d_readdir64_r_proto" in
14426 case "$readdir64_r_proto" in
14427 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
14428 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
14430 case "$readdir64_r_proto" in
14431 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
14432 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
14434 case "$readdir64_r_proto" in
14435 ''|0) d_readdir64_r=undef
14436 readdir64_r_proto=0
14437 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
14438 * ) case "$readdir64_r_proto" in
14439 REENTRANT_PROTO*) ;;
14440 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
14442 echo "Prototype: $try" ;;
14445 *) case "$usethreads" in
14446 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
14448 d_readdir64_r=undef
14449 readdir64_r_proto=0
14453 *) readdir64_r_proto=0
14457 : see if readdir_r exists
14458 set readdir_r d_readdir_r
14460 case "$d_readdir_r" in
14462 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14463 case "$d_readdir_r_proto:$usethreads" in
14464 ":define") d_readdir_r_proto=define
14465 set d_readdir_r_proto readdir_r $hdrs
14469 case "$d_readdir_r_proto" in
14471 case "$readdir_r_proto" in
14472 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
14473 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
14475 case "$readdir_r_proto" in
14476 ''|0) try='int readdir_r(DIR*, struct dirent*);'
14477 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
14479 case "$readdir_r_proto" in
14480 ''|0) d_readdir_r=undef
14482 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
14483 * ) case "$readdir_r_proto" in
14484 REENTRANT_PROTO*) ;;
14485 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
14487 echo "Prototype: $try" ;;
14490 *) case "$usethreads" in
14491 define) echo "readdir_r has no prototype, not using it." >&4 ;;
14498 *) readdir_r_proto=0
14502 : see if readv exists
14506 : see if recvmsg exists
14507 set recvmsg d_recvmsg
14510 : see if rename exists
14511 set rename d_rename
14514 : see if rmdir exists
14518 : see if memory.h is available.
14523 : See if it conflicts with string.h
14529 $cppstdin $cppflags $cppminus < $strings > mem.h
14530 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
14532 echo "We won't be including <memory.h>."
14542 : can bcopy handle overlapping blocks?
14545 case "$d_memmove" in
14546 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14547 *) case "$d_bcopy" in
14549 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14551 #$i_memory I_MEMORY
14552 #$i_stdlib I_STDLIB
14553 #$i_string I_STRING
14554 #$i_unistd I_UNISTD
14556 $cat >>try.c <<'EOCP'
14559 # include <memory.h>
14562 # include <stdlib.h>
14565 # include <string.h>
14567 # include <strings.h>
14570 # include <unistd.h> /* Needed for NetBSD */
14574 char buf[128], abc[128];
14580 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14581 try to store the string in read-only memory. */
14582 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14584 for (align = 7; align >= 0; align--) {
14585 for (len = 36; len; len--) {
14587 bcopy(abc, b, len);
14588 for (off = 1; off <= len; off++) {
14589 bcopy(b, b+off, len);
14590 bcopy(b+off, b, len);
14591 if (bcmp(b, abc, len))
14600 if eval $compile_ok; then
14601 if ./try 2>/dev/null; then
14602 echo "Yes, it can."
14605 echo "It can't, sorry."
14608 echo "(I can't compile the test program, so we'll assume not...)"
14612 $rm -f try.* try core
14618 : can memcpy handle overlapping blocks?
14621 case "$d_memmove" in
14622 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14623 *) case "$d_memcpy" in
14625 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14627 #$i_memory I_MEMORY
14628 #$i_stdlib I_STDLIB
14629 #$i_string I_STRING
14630 #$i_unistd I_UNISTD
14632 $cat >>try.c <<'EOCP'
14635 # include <memory.h>
14638 # include <stdlib.h>
14641 # include <string.h>
14643 # include <strings.h>
14646 # include <unistd.h> /* Needed for NetBSD */
14650 char buf[128], abc[128];
14656 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14657 try to store the string in read-only memory. */
14658 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14660 for (align = 7; align >= 0; align--) {
14661 for (len = 36; len; len--) {
14663 memcpy(b, abc, len);
14664 for (off = 1; off <= len; off++) {
14665 memcpy(b+off, b, len);
14666 memcpy(b, b+off, len);
14667 if (memcmp(b, abc, len))
14676 if eval $compile_ok; then
14677 if ./try 2>/dev/null; then
14678 echo "Yes, it can."
14681 echo "It can't, sorry."
14684 echo "(I can't compile the test program, so we'll assume not...)"
14688 $rm -f try.* try core
14694 : can memcmp be trusted to compare relative magnitude?
14696 case "$d_memcmp" in
14699 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14701 #$i_memory I_MEMORY
14702 #$i_stdlib I_STDLIB
14703 #$i_string I_STRING
14704 #$i_unistd I_UNISTD
14706 $cat >>try.c <<'EOCP'
14709 # include <memory.h>
14712 # include <stdlib.h>
14715 # include <string.h>
14717 # include <strings.h>
14720 # include <unistd.h> /* Needed for NetBSD */
14726 if ((a < b) && memcmp(&a, &b, 1) < 0)
14732 if eval $compile_ok; then
14733 if $run ./try 2>/dev/null; then
14734 echo "Yes, it can."
14737 echo "No, it can't (it uses signed chars)."
14740 echo "(I can't compile the test program, so we'll assume not...)"
14744 $rm -f try.* try core
14748 : see if prototype for sbrk is available
14750 set d_sbrkproto sbrk $i_unistd unistd.h
14753 : see if select exists
14754 set select d_select
14757 : see if semctl exists
14758 set semctl d_semctl
14761 : see if semget exists
14762 set semget d_semget
14765 : see if semop exists
14769 : see how much of the 'sem*(2)' library is present.
14772 case "$d_semctl$d_semget$d_semop" in
14773 *"$undef"*) h_sem=false;;
14777 case "`ipcs 2>&1`" in
14778 "SVID messages"*"not configured"*)
14779 echo "Your $osname does not have the sem*(2) configured." >&4
14782 set semctl d_semctl
14784 set semget d_semget
14792 : we could also check for sys/ipc.h ...
14793 if $h_sem && $test `./findhdr sys/sem.h`; then
14794 echo "You have the full sem*(2) library." >&4
14797 echo "You don't have the full sem*(2) library." >&4
14803 : see whether sys/sem.h defines union semun
14805 $cat > try.c <<'END'
14806 #include <sys/types.h>
14807 #include <sys/ipc.h>
14808 #include <sys/sem.h>
14809 int main () { union semun semun; semun.buf = 0; }
14812 if eval $compile; then
14813 echo "You have union semun in <sys/sem.h>." >&4
14816 echo "You do not have union semun in <sys/sem.h>." >&4
14819 $rm -f try try.c try.h
14823 : see how to do semctl IPC_STAT
14826 : see whether semctl IPC_STAT can use union semun
14831 # define S_IRUSR S_IREAD
14832 # define S_IWUSR S_IWRITE
14833 # define S_IXUSR S_IEXEC
14835 # define S_IRUSR 0400
14836 # define S_IWUSR 0200
14837 # define S_IXUSR 0100
14839 # define S_IRGRP (S_IRUSR>>3)
14840 # define S_IWGRP (S_IWUSR>>3)
14841 # define S_IXGRP (S_IXUSR>>3)
14842 # define S_IROTH (S_IRUSR>>6)
14843 # define S_IWOTH (S_IWUSR>>6)
14844 # define S_IXOTH (S_IXUSR>>6)
14847 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14848 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14849 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14854 #include <sys/types.h>
14855 #include <sys/ipc.h>
14856 #include <sys/sem.h>
14857 #include <sys/stat.h>
14864 #$d_union_semun HAS_UNION_SEMUN
14867 #ifndef HAS_UNION_SEMUN
14870 struct semid_ds *buf;
14871 unsigned short *array;
14877 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14878 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14880 struct semid_ds argbuf;
14883 st = semctl(sem, 0, IPC_STAT, arg);
14887 # endif /* IPC_STAT */
14888 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14890 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14891 # endif /* IPC_RMID */
14892 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14894 #endif /* IPC_PRIVATE && ... */
14895 printf("semget failed: errno = %d\n", errno);
14901 if eval $compile; then
14904 semun) val="$define" ;;
14910 case "$d_semctl_semun" in
14912 echo "You can use union semun for semctl IPC_STAT." >&4
14915 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14920 : see whether semctl IPC_STAT can use struct semid_ds pointer
14921 $cat > try.c <<'END'
14922 #include <sys/types.h>
14923 #include <sys/ipc.h>
14924 #include <sys/sem.h>
14925 #include <sys/stat.h>
14933 struct semid_ds arg;
14936 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14937 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14940 st = semctl(sem, 0, IPC_STAT, &arg);
14942 printf("semid_ds\n");
14944 # endif /* IPC_STAT */
14945 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14947 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14948 # endif /* IPC_RMID */
14949 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14951 #endif /* IPC_PRIVATE && ... */
14952 printf("semget failed: errno = %d\n", errno);
14959 if eval $compile; then
14962 semid_ds) val="$define" ;;
14966 set d_semctl_semid_ds
14968 case "$d_semctl_semid_ds" in
14970 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14972 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14979 # We do not have the full sem*(2) library, so assume we can not
14985 set d_semctl_semid_ds
14990 : see if sendmsg exists
14991 set sendmsg d_sendmsg
14994 : see if setegid exists
14995 set setegid d_setegid
14998 : see if seteuid exists
14999 set seteuid d_seteuid
15002 : see if setgrent exists
15003 set setgrent d_setgrent
15006 : see if setgrent_r exists
15007 set setgrent_r d_setgrent_r
15009 case "$d_setgrent_r" in
15011 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15012 case "$d_setgrent_r_proto:$usethreads" in
15013 ":define") d_setgrent_r_proto=define
15014 set d_setgrent_r_proto setgrent_r $hdrs
15018 case "$d_setgrent_r_proto" in
15020 case "$setgrent_r_proto" in
15021 ''|0) try='int setgrent_r(FILE**);'
15022 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15024 case "$setgrent_r_proto" in
15025 ''|0) try='void setgrent_r(FILE**);'
15026 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15028 case "$setgrent_r_proto" in
15029 ''|0) d_setgrent_r=undef
15031 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15032 * ) case "$setgrent_r_proto" in
15033 REENTRANT_PROTO*) ;;
15034 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15036 echo "Prototype: $try" ;;
15039 *) case "$usethreads" in
15040 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15047 *) setgrent_r_proto=0
15051 : see if sethostent exists
15052 set sethostent d_sethent
15055 : see if sethostent_r exists
15056 set sethostent_r d_sethostent_r
15058 case "$d_sethostent_r" in
15060 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15061 case "$d_sethostent_r_proto:$usethreads" in
15062 ":define") d_sethostent_r_proto=define
15063 set d_sethostent_r_proto sethostent_r $hdrs
15067 case "$d_sethostent_r_proto" in
15069 case "$sethostent_r_proto" in
15070 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15071 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15073 case "$sethostent_r_proto" in
15074 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15075 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15077 case "$sethostent_r_proto" in
15078 ''|0) d_sethostent_r=undef
15079 sethostent_r_proto=0
15080 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15081 * ) case "$sethostent_r_proto" in
15082 REENTRANT_PROTO*) ;;
15083 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15085 echo "Prototype: $try" ;;
15088 *) case "$usethreads" in
15089 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15091 d_sethostent_r=undef
15092 sethostent_r_proto=0
15096 *) sethostent_r_proto=0
15100 : see if setitimer exists
15101 set setitimer d_setitimer
15104 : see if setlinebuf exists
15105 set setlinebuf d_setlinebuf
15108 : see if setlocale exists
15109 set setlocale d_setlocale
15112 : see if locale.h is available
15113 set locale.h i_locale
15116 : see if setlocale_r exists
15117 set setlocale_r d_setlocale_r
15119 case "$d_setlocale_r" in
15121 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15122 case "$d_setlocale_r_proto:$usethreads" in
15123 ":define") d_setlocale_r_proto=define
15124 set d_setlocale_r_proto setlocale_r $hdrs
15128 case "$d_setlocale_r_proto" in
15130 case "$setlocale_r_proto" in
15131 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15132 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15134 case "$setlocale_r_proto" in
15135 ''|0) d_setlocale_r=undef
15136 setlocale_r_proto=0
15137 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15138 * ) case "$setlocale_r_proto" in
15139 REENTRANT_PROTO*) ;;
15140 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15142 echo "Prototype: $try" ;;
15145 *) case "$usethreads" in
15146 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
15148 d_setlocale_r=undef
15149 setlocale_r_proto=0
15153 *) setlocale_r_proto=0
15157 : see if setnetent exists
15158 set setnetent d_setnent
15161 : see if setnetent_r exists
15162 set setnetent_r d_setnetent_r
15164 case "$d_setnetent_r" in
15166 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15167 case "$d_setnetent_r_proto:$usethreads" in
15168 ":define") d_setnetent_r_proto=define
15169 set d_setnetent_r_proto setnetent_r $hdrs
15173 case "$d_setnetent_r_proto" in
15175 case "$setnetent_r_proto" in
15176 ''|0) try='int setnetent_r(int, struct netent_data*);'
15177 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
15179 case "$setnetent_r_proto" in
15180 ''|0) try='void setnetent_r(int, struct netent_data*);'
15181 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
15183 case "$setnetent_r_proto" in
15184 ''|0) d_setnetent_r=undef
15185 setnetent_r_proto=0
15186 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
15187 * ) case "$setnetent_r_proto" in
15188 REENTRANT_PROTO*) ;;
15189 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
15191 echo "Prototype: $try" ;;
15194 *) case "$usethreads" in
15195 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
15197 d_setnetent_r=undef
15198 setnetent_r_proto=0
15202 *) setnetent_r_proto=0
15206 : see if setprotoent exists
15207 set setprotoent d_setpent
15210 : see if setpgid exists
15211 set setpgid d_setpgid
15214 : see if setpgrp2 exists
15215 set setpgrp2 d_setpgrp2
15218 : see if setpriority exists
15219 set setpriority d_setprior
15222 : see if setproctitle exists
15223 set setproctitle d_setproctitle
15226 : see if setprotoent_r exists
15227 set setprotoent_r d_setprotoent_r
15229 case "$d_setprotoent_r" in
15231 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15232 case "$d_setprotoent_r_proto:$usethreads" in
15233 ":define") d_setprotoent_r_proto=define
15234 set d_setprotoent_r_proto setprotoent_r $hdrs
15238 case "$d_setprotoent_r_proto" in
15240 case "$setprotoent_r_proto" in
15241 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
15242 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
15244 case "$setprotoent_r_proto" in
15245 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
15246 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
15248 case "$setprotoent_r_proto" in
15249 ''|0) d_setprotoent_r=undef
15250 setprotoent_r_proto=0
15251 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
15252 * ) case "$setprotoent_r_proto" in
15253 REENTRANT_PROTO*) ;;
15254 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
15256 echo "Prototype: $try" ;;
15259 *) case "$usethreads" in
15260 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
15262 d_setprotoent_r=undef
15263 setprotoent_r_proto=0
15267 *) setprotoent_r_proto=0
15271 : see if setpwent exists
15272 set setpwent d_setpwent
15275 : see if setpwent_r exists
15276 set setpwent_r d_setpwent_r
15278 case "$d_setpwent_r" in
15280 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15281 case "$d_setpwent_r_proto:$usethreads" in
15282 ":define") d_setpwent_r_proto=define
15283 set d_setpwent_r_proto setpwent_r $hdrs
15287 case "$d_setpwent_r_proto" in
15289 case "$setpwent_r_proto" in
15290 ''|0) try='int setpwent_r(FILE**);'
15291 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
15293 case "$setpwent_r_proto" in
15294 ''|0) try='void setpwent_r(FILE**);'
15295 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
15297 case "$setpwent_r_proto" in
15298 ''|0) d_setpwent_r=undef
15300 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
15301 * ) case "$setpwent_r_proto" in
15302 REENTRANT_PROTO*) ;;
15303 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
15305 echo "Prototype: $try" ;;
15308 *) case "$usethreads" in
15309 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
15316 *) setpwent_r_proto=0
15320 : see if setregid exists
15321 set setregid d_setregid
15323 set setresgid d_setresgid
15326 : see if setreuid exists
15327 set setreuid d_setreuid
15329 set setresuid d_setresuid
15332 : see if setrgid exists
15333 set setrgid d_setrgid
15336 : see if setruid exists
15337 set setruid d_setruid
15340 : see if setservent exists
15341 set setservent d_setsent
15344 : see if setservent_r exists
15345 set setservent_r d_setservent_r
15347 case "$d_setservent_r" in
15349 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15350 case "$d_setservent_r_proto:$usethreads" in
15351 ":define") d_setservent_r_proto=define
15352 set d_setservent_r_proto setservent_r $hdrs
15356 case "$d_setservent_r_proto" in
15358 case "$setservent_r_proto" in
15359 ''|0) try='int setservent_r(int, struct servent_data*);'
15360 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
15362 case "$setservent_r_proto" in
15363 ''|0) try='void setservent_r(int, struct servent_data*);'
15364 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
15366 case "$setservent_r_proto" in
15367 ''|0) d_setservent_r=undef
15368 setservent_r_proto=0
15369 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
15370 * ) case "$setservent_r_proto" in
15371 REENTRANT_PROTO*) ;;
15372 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
15374 echo "Prototype: $try" ;;
15377 *) case "$usethreads" in
15378 define) echo "setservent_r has no prototype, not using it." >&4 ;;
15380 d_setservent_r=undef
15381 setservent_r_proto=0
15385 *) setservent_r_proto=0
15389 : see if setsid exists
15390 set setsid d_setsid
15393 : see if setvbuf exists
15394 set setvbuf d_setvbuf
15397 : see if sfio.h is available
15402 : see if sfio library is available
15413 : Ok, but do we want to use it.
15417 true|$define|[yY]*) dflt='y';;
15420 echo "$package can use the sfio library, but it is experimental."
15421 case "$useperlio" in
15423 echo "For sfio also the PerlIO abstraction layer is needed."
15424 echo "Earlier you said you wouldn't want that."
15427 rp="You seem to have sfio available, do you want to try using it?"
15430 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
15431 useperlio="$define"
15434 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
15439 *) case "$usesfio" in
15440 true|$define|[yY]*)
15441 echo "Sorry, cannot find sfio on this machine." >&4
15442 echo "Ignoring your setting of usesfio=$usesfio." >&4
15451 $define) usesfio='true';;
15452 *) usesfio='false';;
15456 *) : Remove sfio from list of libraries to use
15459 echo "Removing unneeded -lsfio from library list" >&4
15460 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
15463 echo "libs = $libs" >&4
15470 : see if shmctl exists
15471 set shmctl d_shmctl
15474 : see if shmget exists
15475 set shmget d_shmget
15478 : see if shmat exists
15481 : see what shmat returns
15484 $cat >shmat.c <<'END'
15485 #include <sys/shm.h>
15488 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
15493 echo "and it returns ($shmattype)." >&4
15494 : see if a prototype for shmat is available
15495 xxx=`./findhdr sys/shm.h`
15496 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
15497 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
15508 set d_shmatprototype
15511 : see if shmdt exists
15515 : see how much of the 'shm*(2)' library is present.
15518 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
15519 *"$undef"*) h_shm=false;;
15523 case "`ipcs 2>&1`" in
15524 "SVID shared memory"*"not configured"*)
15525 echo "Your $osname does not have the shm*(2) configured." >&4
15528 set shmctl d_shmctl
15530 set shmget d_shmget
15540 : we could also check for sys/ipc.h ...
15541 if $h_shm && $test `./findhdr sys/shm.h`; then
15542 echo "You have the full shm*(2) library." >&4
15545 echo "You don't have the full shm*(2) library." >&4
15552 : see if we have sigaction
15553 if set sigaction val -f d_sigaction; eval $csym; $val; then
15554 echo 'sigaction() found.' >&4
15557 #include <sys/types.h>
15558 #include <signal.h>
15559 #$i_stdlib I_STDLIB
15561 #include <stdlib.h>
15565 struct sigaction act, oact;
15567 oact.sa_handler = 0;
15568 /* so that act and oact are used */
15569 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15573 if eval $compile_ok; then
15576 echo "But you don't seem to have a useable struct sigaction." >&4
15580 echo 'sigaction NOT found.' >&4
15583 set d_sigaction; eval $setvar
15584 $rm -f try try$_o try.c
15586 : see if sigprocmask exists
15587 set sigprocmask d_sigprocmask
15590 : see if sigsetjmp exists
15592 case "$d_sigsetjmp" in
15595 #include <setjmp.h>
15596 #$i_stdlib I_STDLIB
15598 #include <stdlib.h>
15604 if (sigsetjmp(env,1))
15607 siglongjmp(env, 1);
15612 if eval $compile; then
15613 if $run ./try >/dev/null 2>&1; then
15614 echo "POSIX sigsetjmp found." >&4
15618 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15624 echo "sigsetjmp not found." >&4
15628 *) val="$d_sigsetjmp"
15629 case "$d_sigsetjmp" in
15630 $define) echo "POSIX sigsetjmp found." >&4;;
15631 $undef) echo "sigsetjmp not found." >&4;;
15639 : see if sockatmark exists
15640 set sockatmark d_sockatmark
15643 : see if prototype for sockatmark is available
15645 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15648 : see if socks5_init exists
15649 set socks5_init d_socks5_init
15652 : see if srand48_r exists
15653 set srand48_r d_srand48_r
15655 case "$d_srand48_r" in
15657 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15658 case "$d_srand48_r_proto:$usethreads" in
15659 ":define") d_srand48_r_proto=define
15660 set d_srand48_r_proto srand48_r $hdrs
15664 case "$d_srand48_r_proto" in
15666 case "$srand48_r_proto" in
15667 ''|0) try='int srand48_r(long, struct drand48_data*);'
15668 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15670 case "$srand48_r_proto" in
15671 ''|0) d_srand48_r=undef
15673 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15674 * ) case "$srand48_r_proto" in
15675 REENTRANT_PROTO*) ;;
15676 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15678 echo "Prototype: $try" ;;
15681 *) case "$usethreads" in
15682 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15689 *) srand48_r_proto=0
15693 : see if srandom_r exists
15694 set srandom_r d_srandom_r
15696 case "$d_srandom_r" in
15698 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15699 case "$d_srandom_r_proto:$usethreads" in
15700 ":define") d_srandom_r_proto=define
15701 set d_srandom_r_proto srandom_r $hdrs
15705 case "$d_srandom_r_proto" in
15707 case "$srandom_r_proto" in
15708 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15709 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15711 case "$srandom_r_proto" in
15712 ''|0) d_srandom_r=undef
15714 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15715 * ) case "$srandom_r_proto" in
15716 REENTRANT_PROTO*) ;;
15717 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15719 echo "Prototype: $try" ;;
15722 *) case "$usethreads" in
15723 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15730 *) srandom_r_proto=0
15734 : see if prototype for setresgid is available
15736 set d_sresgproto setresgid $i_unistd unistd.h
15739 : see if prototype for setresuid is available
15741 set d_sresuproto setresuid $i_unistd unistd.h
15744 : see if sys/stat.h is available
15745 set sys/stat.h i_sysstat
15749 : see if stat knows about block sizes
15751 echo "Checking to see if your struct stat has st_blocks field..." >&4
15752 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15756 : see if this is a sys/vfs.h system
15757 set sys/vfs.h i_sysvfs
15761 : see if this is a sys/statfs.h system
15762 set sys/statfs.h i_sysstatfs
15767 echo "Checking to see if your system supports struct statfs..." >&4
15768 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
15770 case "$d_statfs_s" in
15771 "$define") echo "Yes, it does." ;;
15772 *) echo "No, it doesn't." ;;
15777 : see if struct statfs knows about f_flags
15778 case "$d_statfs_s" in
15781 echo "Checking to see if your struct statfs has f_flags field..." >&4
15782 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
15786 set d_statfs_f_flags
15790 case "$d_statfs_f_flags" in
15791 "$define") echo "Yes, it does." ;;
15792 *) echo "No, it doesn't." ;;
15795 : see if _ptr and _cnt from stdio act std
15798 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15799 echo "(Looks like you have stdio.h from BSD.)"
15800 case "$stdio_ptr" in
15801 '') stdio_ptr='((fp)->_p)'
15804 *) ptr_lval=$d_stdio_ptr_lval;;
15806 case "$stdio_cnt" in
15807 '') stdio_cnt='((fp)->_r)'
15810 *) cnt_lval=$d_stdio_cnt_lval;;
15812 case "$stdio_base" in
15813 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15815 case "$stdio_bufsiz" in
15816 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15818 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15819 echo "(Looks like you have stdio.h from Linux.)"
15820 case "$stdio_ptr" in
15821 '') stdio_ptr='((fp)->_IO_read_ptr)'
15824 *) ptr_lval=$d_stdio_ptr_lval;;
15826 case "$stdio_cnt" in
15827 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15830 *) cnt_lval=$d_stdio_cnt_lval;;
15832 case "$stdio_base" in
15833 '') stdio_base='((fp)->_IO_read_base)';;
15835 case "$stdio_bufsiz" in
15836 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15839 case "$stdio_ptr" in
15840 '') stdio_ptr='((fp)->_ptr)'
15843 *) ptr_lval=$d_stdio_ptr_lval;;
15845 case "$stdio_cnt" in
15846 '') stdio_cnt='((fp)->_cnt)'
15849 *) cnt_lval=$d_stdio_cnt_lval;;
15851 case "$stdio_base" in
15852 '') stdio_base='((fp)->_base)';;
15854 case "$stdio_bufsiz" in
15855 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15859 : test whether _ptr and _cnt really work
15860 echo "Checking how std your stdio is..." >&4
15863 #define FILE_ptr(fp) $stdio_ptr
15864 #define FILE_cnt(fp) $stdio_cnt
15866 FILE *fp = fopen("try.c", "r");
15869 18 <= FILE_cnt(fp) &&
15870 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15878 if eval $compile && $to try.c; then
15879 if $run ./try; then
15880 echo "Your stdio acts pretty std."
15883 echo "Your stdio isn't very std."
15886 echo "Your stdio doesn't appear very std."
15890 # glibc 2.2.90 and above apparently change stdio streams so Perl's
15891 # direct buffer manipulation no longer works. The Configure tests
15892 # should be changed to correctly detect this, but until then,
15893 # the following check should at least let perl compile and run.
15894 # (This quick fix should be updated before 5.8.1.)
15895 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
15896 # A. Dougherty, June 3, 2002.
15897 case "$d_gnulibc" in
15899 case "$gnulibc_version" in
15903 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
15912 : Can _ptr be used as an lvalue?
15913 case "$d_stdstdio$ptr_lval" in
15914 $define$define) val=$define ;;
15917 set d_stdio_ptr_lval
15920 : Can _cnt be used as an lvalue?
15921 case "$d_stdstdio$cnt_lval" in
15922 $define$define) val=$define ;;
15925 set d_stdio_cnt_lval
15929 : test whether setting _ptr sets _cnt as a side effect
15930 d_stdio_ptr_lval_sets_cnt="$undef"
15931 d_stdio_ptr_lval_nochange_cnt="$undef"
15932 case "$d_stdio_ptr_lval$d_stdstdio" in
15934 echo "Checking to see what happens if we set the stdio ptr..." >&4
15937 /* Can we scream? */
15938 /* Eat dust sed :-) */
15939 /* In the buffer space, no one can hear you scream. */
15940 #define FILE_ptr(fp) $stdio_ptr
15941 #define FILE_cnt(fp) $stdio_cnt
15942 #include <sys/types.h>
15944 FILE *fp = fopen("try.c", "r");
15949 puts("Fail even to read");
15952 c = getc(fp); /* Read away the first # */
15954 puts("Fail even to read");
15958 18 <= FILE_cnt(fp) &&
15959 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15961 puts("Fail even to read");
15964 ptr = (char*) FILE_ptr(fp);
15965 cnt = (size_t)FILE_cnt(fp);
15967 FILE_ptr(fp) += 42;
15969 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15970 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15973 if (FILE_cnt(fp) <= 20) {
15974 printf ("Fail (<20 chars to test)");
15977 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15978 puts("Fail compare");
15981 if (cnt == FILE_cnt(fp)) {
15982 puts("Pass_unchanged");
15985 if (FILE_cnt(fp) == (cnt - 42)) {
15986 puts("Pass_changed");
15989 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15995 if eval $compile && $to try.c; then
15996 case `$run ./try` in
15998 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15999 d_stdio_ptr_lval_sets_cnt="$define" ;;
16001 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
16002 d_stdio_ptr_lval_nochange_cnt="$define" ;;
16004 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
16006 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
16009 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
16015 : see if _base is also standard
16017 case "$d_stdstdio" in
16021 #define FILE_base(fp) $stdio_base
16022 #define FILE_bufsiz(fp) $stdio_bufsiz
16024 FILE *fp = fopen("try.c", "r");
16027 19 <= FILE_bufsiz(fp) &&
16028 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
16035 if eval $compile && $to try.c; then
16036 if $run ./try; then
16037 echo "And its _base field acts std."
16040 echo "But its _base field isn't std."
16043 echo "However, it seems to be lacking the _base field."
16052 Checking how to access stdio streams by file descriptor number...
16054 case "$stdio_stream_array" in
16055 '') $cat >try.c <<EOCP
16058 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16062 for s in _iob __iob __sF
16064 set try -DSTDIO_STREAM_ARRAY=$s
16065 if eval $compile; then
16066 case "`$run ./try`" in
16067 yes) stdio_stream_array=$s; break ;;
16071 $rm -f try.* try$exe_ext
16073 case "$stdio_stream_array" in
16075 I can't figure out how to access stdio streams by file descriptor number.
16077 d_stdio_stream_array="$undef"
16080 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16082 d_stdio_stream_array="$define"
16086 : see if strcoll exists
16087 set strcoll d_strcoll
16090 : check for structure copying
16092 echo "Checking to see if your C compiler can copy structs..." >&4
16093 $cat >try.c <<'EOCP'
16103 if $cc -c try.c >/dev/null 2>&1 ; then
16105 echo "Yup, it can."
16108 echo "Nope, it can't."
16114 : see if strerror and/or sys_errlist[] exist
16116 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16117 if set strerror val -f d_strerror; eval $csym; $val; then
16118 echo 'strerror() found.' >&4
16119 d_strerror="$define"
16120 d_strerrm='strerror(e)'
16121 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16122 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16123 d_syserrlst="$define"
16125 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16126 d_syserrlst="$undef"
16128 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16129 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16130 echo 'strerror() found in string header.' >&4
16131 d_strerror="$define"
16132 d_strerrm='strerror(e)'
16133 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16134 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16135 d_syserrlst="$define"
16137 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16138 d_syserrlst="$undef"
16140 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16141 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16142 d_strerror="$undef"
16143 d_syserrlst="$define"
16144 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16146 echo 'strerror() and sys_errlist[] NOT found.' >&4
16147 d_strerror="$undef"
16148 d_syserrlst="$undef"
16149 d_strerrm='"unknown"'
16153 : see if strerror_r exists
16154 set strerror_r d_strerror_r
16156 case "$d_strerror_r" in
16158 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16159 case "$d_strerror_r_proto:$usethreads" in
16160 ":define") d_strerror_r_proto=define
16161 set d_strerror_r_proto strerror_r $hdrs
16165 case "$d_strerror_r_proto" in
16167 case "$strerror_r_proto" in
16168 ''|0) try='int strerror_r(int, char*, size_t);'
16169 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16171 case "$strerror_r_proto" in
16172 ''|0) try='int strerror_r(int, char*, int);'
16173 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16175 case "$strerror_r_proto" in
16176 ''|0) try='char* strerror_r(int, char*, size_t);'
16177 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16179 case "$strerror_r_proto" in
16180 ''|0) d_strerror_r=undef
16182 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16183 * ) case "$strerror_r_proto" in
16184 REENTRANT_PROTO*) ;;
16185 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16187 echo "Prototype: $try" ;;
16190 *) case "$usethreads" in
16191 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16198 *) strerror_r_proto=0
16202 : see if strftime exists
16203 set strftime d_strftime
16206 : see if strtod exists
16207 set strtod d_strtod
16210 : see if strtol exists
16211 set strtol d_strtol
16214 : see if strtold exists
16215 set strtold d_strtold
16218 : see if strtoll exists
16219 set strtoll d_strtoll
16222 case "$d_longlong-$d_strtoll" in
16225 Checking whether your strtoll() works okay...
16227 $cat >try.c <<'EOCP'
16230 #define strtoll __strtoll
16233 #define strtoll _strtoll
16236 extern long long int strtoll(char *s, char **, int);
16237 static int bad = 0;
16238 int check(char *s, long long ell, int een) {
16241 gll = strtoll(s, 0, 10);
16242 if (!((gll == ell) && (errno == een)))
16246 check(" 1", 1LL, 0);
16247 check(" 0", 0LL, 0);
16248 check("-1", -1LL, 0);
16249 check("-9223372036854775808", -9223372036854775808LL, 0);
16250 check("-9223372036854775808", -9223372036854775808LL, 0);
16251 check(" 9223372036854775807", 9223372036854775807LL, 0);
16252 check("-9223372036854775808", -9223372036854775808LL, 0);
16253 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16254 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16260 if eval $compile; then
16263 ok) echo "Your strtoll() seems to be working okay." ;;
16265 Your strtoll() doesn't seem to be working okay.
16271 echo "(I can't seem to compile the test program--assuming it doesn't)"
16277 : see if strtoq exists
16278 set strtoq d_strtoq
16281 : see if strtoul exists
16282 set strtoul d_strtoul
16285 case "$d_strtoul" in
16288 Checking whether your strtoul() works okay...
16290 $cat >try.c <<'EOCP'
16293 extern unsigned long int strtoul(char *s, char **, int);
16294 static int bad = 0;
16295 void check(char *s, unsigned long eul, int een) {
16298 gul = strtoul(s, 0, 10);
16299 if (!((gul == eul) && (errno == een)))
16303 check(" 1", 1L, 0);
16304 check(" 0", 0L, 0);
16306 case "$longsize" in
16308 $cat >>try.c <<'EOCP'
16309 check("18446744073709551615", 18446744073709551615UL, 0);
16310 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16311 #if 0 /* strtoul() for /^-/ strings is undefined. */
16312 check("-1", 18446744073709551615UL, 0);
16313 check("-18446744073709551614", 2, 0);
16314 check("-18446744073709551615", 1, 0);
16315 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16316 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16321 $cat >>try.c <<'EOCP'
16322 check("4294967295", 4294967295UL, 0);
16323 check("4294967296", 4294967295UL, ERANGE);
16324 #if 0 /* strtoul() for /^-/ strings is undefined. */
16325 check("-1", 4294967295UL, 0);
16326 check("-4294967294", 2, 0);
16327 check("-4294967295", 1, 0);
16328 check("-4294967296", 4294967295UL, ERANGE);
16329 check("-4294967297", 4294967295UL, ERANGE);
16334 : Should we write these tests to be more portable by sprintf-ing
16335 : ~0 and then manipulating that char string as input for strtol?
16338 $cat >>try.c <<'EOCP'
16345 if eval $compile; then
16346 case "`$run ./try`" in
16347 ok) echo "Your strtoul() seems to be working okay." ;;
16349 Your strtoul() doesn't seem to be working okay.
16358 : see if strtoull exists
16359 set strtoull d_strtoull
16362 case "$d_longlong-$d_strtoull" in
16365 Checking whether your strtoull() works okay...
16367 $cat >try.c <<'EOCP'
16370 #define strtoull __strtoull
16373 extern unsigned long long int strtoull(char *s, char **, int);
16374 static int bad = 0;
16375 int check(char *s, long long eull, int een) {
16378 gull = strtoull(s, 0, 10);
16379 if (!((gull == eull) && (errno == een)))
16383 check(" 1", 1LL, 0);
16384 check(" 0", 0LL, 0);
16385 check("18446744073709551615", 18446744073709551615ULL, 0);
16386 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16387 #if 0 /* strtoull() for /^-/ strings is undefined. */
16388 check("-1", 18446744073709551615ULL, 0);
16389 check("-18446744073709551614", 2LL, 0);
16390 check("-18446744073709551615", 1LL, 0);
16391 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16392 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16399 if eval $compile; then
16400 case "`$run ./try`" in
16401 ok) echo "Your strtoull() seems to be working okay." ;;
16403 Your strtoull() doesn't seem to be working okay.
16405 d_strtoull="$undef"
16412 : see if strtouq exists
16413 set strtouq d_strtouq
16416 case "$d_strtouq" in
16419 Checking whether your strtouq() works okay...
16421 $cat >try.c <<'EOCP'
16424 extern unsigned long long int strtouq(char *s, char **, int);
16425 static int bad = 0;
16426 void check(char *s, unsigned long long eull, int een) {
16427 unsigned long long gull;
16429 gull = strtouq(s, 0, 10);
16430 if (!((gull == eull) && (errno == een)))
16434 check(" 1", 1LL, 0);
16435 check(" 0", 0LL, 0);
16436 check("18446744073709551615", 18446744073709551615ULL, 0);
16437 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16438 #if 0 /* strtouq() for /^-/ strings is undefined. */
16439 check("-1", 18446744073709551615ULL, 0);
16440 check("-18446744073709551614", 2LL, 0);
16441 check("-18446744073709551615", 1LL, 0);
16442 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16443 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16451 if eval $compile; then
16452 case "`$run ./try`" in
16453 ok) echo "Your strtouq() seems to be working okay." ;;
16455 Your strtouq() doesn't seem to be working okay.
16464 : see if strxfrm exists
16465 set strxfrm d_strxfrm
16468 : see if symlink exists
16469 set symlink d_symlink
16472 : see if syscall exists
16473 set syscall d_syscall
16476 : see if prototype for syscall is available
16478 set d_syscallproto syscall $i_unistd unistd.h
16481 : see if sysconf exists
16482 set sysconf d_sysconf
16485 : see if system exists
16486 set system d_system
16489 : see if tcgetpgrp exists
16490 set tcgetpgrp d_tcgetpgrp
16493 : see if tcsetpgrp exists
16494 set tcsetpgrp d_tcsetpgrp
16497 : see if prototype for telldir is available
16499 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
16502 : see if time exists
16504 if test "X$d_time" = X -o X"$timetype" = X; then
16505 if set time val -f d_time; eval $csym; $val; then
16506 echo 'time() found.' >&4
16508 rp="What is the type returned by time() on this system?"
16509 set time_t timetype long stdio.h sys/types.h
16512 echo 'time() not found, hope that will do.' >&4
16520 : see if this is a sys/times.h system
16521 set sys/times.h i_systimes
16524 : see if times exists
16526 if set times val -f d_times; eval $csym; $val; then
16527 echo 'times() found.' >&4
16530 case "$i_systimes" in
16531 "$define") inc='sys/times.h';;
16533 rp="What is the type returned by times() on this system?"
16534 set clock_t clocktype long stdio.h sys/types.h $inc
16537 echo 'times() NOT found, hope that will do.' >&4
16542 : see if tmpnam_r exists
16543 set tmpnam_r d_tmpnam_r
16545 case "$d_tmpnam_r" in
16547 hdrs="$i_systypes sys/types.h define stdio.h "
16548 case "$d_tmpnam_r_proto:$usethreads" in
16549 ":define") d_tmpnam_r_proto=define
16550 set d_tmpnam_r_proto tmpnam_r $hdrs
16554 case "$d_tmpnam_r_proto" in
16556 case "$tmpnam_r_proto" in
16557 ''|0) try='char* tmpnam_r(char*);'
16558 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16560 case "$tmpnam_r_proto" in
16561 ''|0) d_tmpnam_r=undef
16563 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16564 * ) case "$tmpnam_r_proto" in
16565 REENTRANT_PROTO*) ;;
16566 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16568 echo "Prototype: $try" ;;
16571 *) case "$usethreads" in
16572 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16579 *) tmpnam_r_proto=0
16583 : see if truncate exists
16584 set truncate d_truncate
16587 : see if ttyname_r exists
16588 set ttyname_r d_ttyname_r
16590 case "$d_ttyname_r" in
16592 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16593 case "$d_ttyname_r_proto:$usethreads" in
16594 ":define") d_ttyname_r_proto=define
16595 set d_ttyname_r_proto ttyname_r $hdrs
16599 case "$d_ttyname_r_proto" in
16601 case "$ttyname_r_proto" in
16602 ''|0) try='int ttyname_r(int, char*, size_t);'
16603 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16605 case "$ttyname_r_proto" in
16606 ''|0) try='int ttyname_r(int, char*, int);'
16607 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16609 case "$ttyname_r_proto" in
16610 ''|0) try='char* ttyname_r(int, char*, int);'
16611 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16613 case "$ttyname_r_proto" in
16614 ''|0) d_ttyname_r=undef
16616 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16617 * ) case "$ttyname_r_proto" in
16618 REENTRANT_PROTO*) ;;
16619 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16621 echo "Prototype: $try" ;;
16624 *) case "$usethreads" in
16625 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16632 *) ttyname_r_proto=0
16636 : see if tzname[] exists
16638 if set tzname val -a d_tzname; eval $csym; $val; then
16640 echo 'tzname[] found.' >&4
16643 echo 'tzname[] NOT found.' >&4
16649 next|rhapsody|darwin) multiarch="$define" ;;
16651 case "$multiarch" in
16652 ''|[nN]*) multiarch="$undef" ;;
16655 : check for ordering of bytes in a UV
16657 case "$usecrosscompile$multiarch" in
16660 You seem to be either cross-compiling or doing a multiarchitecture build,
16661 skipping the byteorder check.
16667 case "$byteorder" in
16670 In the following, larger digits indicate more significance. A big-endian
16671 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16672 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16673 machines may have weird orders like 3412. A Cray will report 87654321,
16674 an Alpha will report 12345678. If the test program works the default is
16676 I'm now running the test program...
16680 #include <sys/types.h>
16681 typedef $uvtype UV;
16691 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16693 u.l = (UV)0x04030201;
16694 for (i = 0; i < $uvsize; i++)
16695 printf("%c", u.c[i]+'0');
16702 if eval $compile && ./try > /dev/null; then
16705 [1-4][1-4][1-4][1-4]|12345678|87654321)
16706 echo "(The test program ran ok.)"
16707 echo "byteorder=$dflt"
16710 ????|????????) echo "(The test program ran ok.)" ;;
16711 *) echo "(The test program didn't run right for some reason.)" ;;
16716 (I can't seem to compile the test program. Guessing big-endian...)
16719 case "$xxx_prompt" in
16721 rp="What is the order of bytes in $uvtype?"
16737 Checking to see whether you can access character data unalignedly...
16739 case "$d_u32align" in
16740 '') $cat >try.c <<EOCP
16742 #$i_stdlib I_STDLIB
16744 #include <stdlib.h>
16746 #define U32 $u32type
16747 #define BYTEORDER 0x$byteorder
16749 #include <signal.h>
16751 $signal_t bletch(s) int s; { exit(4); }
16754 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16759 if (sizeof(U32) != 4) {
16760 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16767 signal(SIGBUS, bletch);
16779 for (i = 0; i < 4; i++) {
16780 up = (U32*)(buf + i);
16781 if (! ((*up == 1 << (8*i)) || /* big-endian */
16782 (*up == 1 << (8*(3-i))) /* little-endian */
16786 printf("read failed (%x)\n", *up);
16792 for (i = 0; i < 4; i++) {
16793 up = (U32*)(buf + i);
16795 if (*up != 0xBeef) {
16796 printf("write failed (%x)\n", *up);
16810 if eval $compile_ok; then
16811 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16812 $run ./try 2>&1 >/dev/null
16815 You can access character data pretty unalignedly.
16817 d_u32align="$undef"
16820 It seems that you must access character data in an aligned manner.
16822 d_u32align="$define"
16826 rp='Can you access character data at unaligned addresses?'
16830 [yY]*) d_u32align="$undef" ;;
16831 *) d_u32align="$define" ;;
16834 $rm -f core core.try.* try.core
16838 : see if ualarm exists
16839 set ualarm d_ualarm
16842 : see if umask exists
16846 : see if unordered exists
16847 set unordered d_unordered
16850 : see if usleep exists
16851 set usleep d_usleep
16854 : see if prototype for usleep is available
16856 set d_usleepproto usleep $i_unistd unistd.h
16859 : see if ustat exists
16863 : backward compatibility for d_hvfork
16864 if test X$d_hvfork != X; then
16865 d_vfork="$d_hvfork"
16868 : see if there is a vfork
16873 : Ok, but do we want to use it. vfork is reportedly unreliable in
16874 : perl on Solaris 2.x, and probably elsewhere.
16878 case "$usevfork" in
16884 Perl can only use a vfork() that doesn't suffer from strict
16885 restrictions on calling functions or modifying global data in
16886 the child. For example, glibc-2.1 contains such a vfork()
16887 that is unsuitable. If your system provides a proper fork()
16888 call, chances are that you do NOT want perl to use vfork().
16891 rp="Do you still want to use vfork()?"
16896 echo "Ok, we won't use vfork()."
16905 $define) usevfork='true';;
16906 *) usevfork='false';;
16909 : see if closedir exists
16910 set closedir d_closedir
16913 case "$d_closedir" in
16916 echo "Checking whether closedir() returns a status..." >&4
16918 #$i_dirent I_DIRENT /**/
16919 #$i_sysdir I_SYS_DIR /**/
16920 #$i_sysndir I_SYS_NDIR /**/
16921 #$i_systypes I_SYS_TYPES /**/
16923 #if defined(I_SYS_TYPES)
16924 #include <sys/types.h>
16926 #if defined(I_DIRENT)
16927 #include <dirent.h>
16928 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16929 #include <sys/dir.h>
16933 #include <sys/ndir.h>
16937 #include <ndir.h> /* may be wrong in the future */
16939 #include <sys/dir.h>
16944 int main() { return closedir(opendir(".")); }
16947 if eval $compile_ok; then
16948 if $run ./try > /dev/null 2>&1 ; then
16949 echo "Yes, it does."
16952 echo "No, it doesn't."
16956 echo "(I can't seem to compile the test program--assuming it doesn't)"
16964 set d_void_closedir
16967 : see if there is a wait4
16971 : see if waitpid exists
16972 set waitpid d_waitpid
16975 : see if wcstombs exists
16976 set wcstombs d_wcstombs
16979 : see if wctomb exists
16980 set wctomb d_wctomb
16983 : see if writev exists
16984 set writev d_writev
16987 : preserve RCS keywords in files with variable substitution, grrr
16992 Revision='$Revision'
16994 : check for alignment requirements
16996 case "$usecrosscompile$multiarch" in
16999 You seem to be either cross-compiling or doing a multiarchitecture build,
17000 skipping the memory alignment check.
17003 case "$alignbytes" in
17004 '') alignbytes=8 ;;
17008 case "$alignbytes" in
17009 '') echo "Checking alignment constraints..." >&4
17010 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17011 $cat >try.c <<'EOCP'
17012 typedef long double NV;
17015 $cat >try.c <<'EOCP'
17019 $cat >>try.c <<'EOCP'
17027 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17032 if eval $compile_ok; then
17036 echo "(I can't seem to compile the test program...)"
17039 *) dflt="$alignbytes"
17042 rp="Doubles must be aligned on a how-many-byte boundary?"
17050 : set the base revision
17053 : how do we catenate cpp tokens here?
17055 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
17056 $cat >cpp_stuff.c <<'EOCP'
17057 #define RCAT(a,b)a/**/b
17058 #define ACAT(a,b)a ## b
17062 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17063 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17064 echo "Oh! Smells like ANSI's been here." >&4
17065 echo "We can catify or stringify, separately or together!"
17067 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17068 echo "Ah, yes! The good old days!" >&4
17069 echo "However, in the good old days we don't know how to stringify and"
17070 echo "catify at the same time."
17074 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
17075 to have to edit the values of CAT[2-5] in config.h...
17077 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17081 : see if this is a db.h system
17087 : Check db version.
17089 echo "Checking Berkeley DB version ..." >&4
17095 #include <sys/types.h>
17098 int main(int argc, char *argv[])
17100 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17101 int Major, Minor, Patch ;
17102 unsigned long Version ;
17103 (void)db_version(&Major, &Minor, &Patch) ;
17105 printf("%d %d %d %d %d %d\n",
17106 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17107 Major, Minor, Patch);
17110 printf("You have Berkeley DB Version 2 or greater.\n");
17112 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17113 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17114 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17115 Major, Minor, Patch) ;
17117 /* check that db.h & libdb are compatible */
17118 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17119 printf("db.h and libdb are incompatible.\n") ;
17123 printf("db.h and libdb are compatible.\n") ;
17125 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17126 + DB_VERSION_PATCH ;
17128 /* needs to be >= 2.3.4 */
17129 if (Version < 2003004) {
17130 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17131 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17137 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17142 printf("You have Berkeley DB Version 1.\n");
17143 exit(0); /* DB version < 2: the coast is clear. */
17145 exit(1); /* <db.h> not Berkeley DB? */
17151 if eval $compile_ok && $run ./try; then
17152 echo 'Looks OK.' >&4
17154 db_version_major=$1
17155 db_version_minor=$2
17156 db_version_patch=$3
17158 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17162 : Remove db from list of libraries to use
17163 echo "Removing unusable -ldb from library list" >&4
17164 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17167 echo "libs = $libs" >&4
17177 : Check the return type needed for hash
17179 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17185 #include <sys/types.h>
17188 #ifndef DB_VERSION_MAJOR
17189 u_int32_t hash_cb (ptr, size)
17197 info.hash = hash_cb;
17201 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17202 if $contains warning try.out >>/dev/null 2>&1 ; then
17205 db_hashtype='u_int32_t'
17208 : XXX Maybe we should just give up here.
17209 db_hashtype=u_int32_t
17211 echo "Help: I can't seem to compile the db test program." >&4
17212 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17215 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17217 *) db_hashtype=u_int32_t
17222 : Check the return type needed for prefix
17224 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17230 #include <sys/types.h>
17233 #ifndef DB_VERSION_MAJOR
17234 size_t prefix_cb (key1, key2)
17242 info.prefix = prefix_cb;
17246 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17247 if $contains warning try.out >>/dev/null 2>&1 ; then
17248 db_prefixtype='int'
17250 db_prefixtype='size_t'
17253 db_prefixtype='size_t'
17254 : XXX Maybe we should just give up here.
17256 echo "Help: I can't seem to compile the db test program." >&4
17257 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17260 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17262 *) db_prefixtype='size_t'
17267 : How can we generate normalized random numbers ?
17269 echo "Looking for a random number function..." >&4
17270 case "$randfunc" in
17272 if set drand48 val -f; eval $csym; $val; then
17274 echo "Good, found drand48()." >&4
17275 elif set random val -f; eval $csym; $val; then
17277 echo "OK, found random()." >&4
17280 echo "Yick, looks like I have to use rand()." >&4
17291 *-Dmy_rand=*|*-Dmy_srand=*)
17292 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17293 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17294 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17295 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17299 while $test "$cont"; do
17300 rp="Use which function to generate random numbers?"
17302 if $test "$ans" = "$dflt"; then
17308 if set $ans val -f; eval $csym; $val; then
17312 rp="I cannot find function $ans. Use that name anyway?"
17321 case "$randfunc" in
17323 drand01="drand48()"
17329 case "$randbits" in
17331 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17333 #$i_unistd I_UNISTD
17334 #$i_stdlib I_STDLIB
17337 # include <unistd.h>
17340 # include <stdlib.h>
17345 register unsigned long tmp;
17346 register unsigned long max = 0L;
17348 for (i = 1000; i; i--) {
17349 tmp = (unsigned long) $randfunc();
17350 if (tmp > max) max = tmp;
17352 for (i = 0; max; i++)
17358 if eval $compile_ok; then
17362 echo "(I can't seem to compile the test program...)"
17369 rp="How many bits does your $randfunc() function produce?"
17373 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17374 seedfunc="s$randfunc"
17375 randseedtype=unsigned
17379 rp="How many bits does your $randfunc() function produce?"
17382 seedfunc="s$randfunc"
17383 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17384 if set $seedfunc val -f; eval $csym; $val; then
17385 echo "(Using $seedfunc() to seed random generator)"
17387 echo "(Warning: no $seedfunc() to seed random generator)"
17390 randseedtype=unsigned
17398 echo "Determining whether or not we are on an EBCDIC system..." >&4
17399 $cat >try.c <<'EOM'
17402 if ('M'==0xd4) return 0;
17409 if eval $compile_ok; then
17410 if $run ./try; then
17411 echo "You seem to speak EBCDIC." >&4
17414 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
17417 echo "I'm unable to compile the test program." >&4
17418 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
17426 Checking how to flush all pending stdio output...
17428 # I only know how to find the first 32 possibly open files on SunOS.
17429 # See also hints/sunos_4_1.sh and util.c --AD
17431 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
17433 $cat >>try.c <<EOCP
17435 #$i_unistd I_UNISTD
17437 # include <unistd.h>
17439 #$d_sysconf HAS_SYSCONF
17440 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
17441 #ifdef HAS_STDIO_STREAM_ARRAY
17442 # define STDIO_STREAM_ARRAY $stdio_stream_array
17447 p = fopen("try.out", "w");
17451 # ifdef TRY_FPRINTF
17455 #ifdef TRY_FFLUSH_NULL
17458 #ifdef TRY_FFLUSH_ALL
17460 long open_max = -1;
17461 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
17462 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
17464 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
17465 open_max = sysconf(_SC_OPEN_MAX);
17468 open_max = FOPEN_MAX;
17471 open_max = OPEN_MAX;
17480 # ifdef HAS_STDIO_STREAM_ARRAY
17481 if (open_max > 0) {
17483 for (i = 0; i < open_max; i++)
17484 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
17485 STDIO_STREAM_ARRAY[i]._file < open_max &&
17486 STDIO_STREAM_ARRAY[i]._flag)
17487 fflush(&STDIO_STREAM_ARRAY[i]);
17495 : first we have to find out how _not_ to flush
17497 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
17499 set try -DTRY_FPUTC
17500 if eval $compile; then
17501 $run ./try 2>/dev/null
17504 if $test ! -s try.out -a "X$code" = X42; then
17510 set try -DTRY_FPRINTF
17511 if eval $compile; then
17512 $run ./try 2>/dev/null
17515 if $test ! -s try.out -a "X$code" = X42; then
17516 output=-DTRY_FPRINTF
17522 : check for fflush NULL behaviour
17523 case "$fflushNULL" in
17524 '') set try -DTRY_FFLUSH_NULL $output
17525 if eval $compile; then
17526 $run ./try 2>/dev/null
17529 if $test -s try.out -a "X$code" = X42; then
17530 fflushNULL="`$cat try.out`"
17532 if $test "X$code" != X42; then
17534 (If this test failed, don't worry, we'll try another method shortly.)
17539 $rm -f core try.core core.try.*
17540 case "$fflushNULL" in
17542 Your fflush(NULL) works okay for output streams.
17543 Let's see if it clobbers input pipes...
17545 # As of mid-March 2000 all versions of Solaris appear to have a stdio
17546 # bug that improperly flushes the input end of pipes. So we avoid the
17547 # autoflush on fork/system/exec support for now. :-(
17548 $cat >tryp.c <<EOCP
17551 main(int argc, char **argv)
17557 while ((i = getc(stdin)) != -1
17558 && (*bp++ = i) != '\n'
17559 && bp < &buf[1024])
17562 fprintf(stdout, "%s", buf);
17570 fflushNULL="$define"
17572 if eval $compile; then
17574 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17575 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17577 fflush(NULL) seems to behave okay with input streams.
17579 fflushNULL="$define"
17582 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17584 fflushNULL="$undef"
17587 $rm -f core tryp.c tryp.core core.tryp.*
17590 Your fflush(NULL) isn't working (contrary to ANSI C).
17592 fflushNULL="$undef"
17595 Cannot figure out whether your fflush(NULL) works or not.
17596 I'm assuming it doesn't (contrary to ANSI C).
17598 fflushNULL="$undef"
17602 $define|true|[yY]*)
17603 fflushNULL="$define"
17606 fflushNULL="$undef"
17609 : check explicit looping only if NULL did not work, and if the pipe
17610 : bug does not show up on an explicit flush too
17611 case "$fflushNULL" in
17613 $cat >tryp.c <<EOCP
17616 main(int argc, char **argv)
17622 while ((i = getc(stdin)) != -1
17623 && (*bp++ = i) != '\n'
17624 && bp < &buf[1024])
17627 fprintf(stdout, "%s", buf);
17636 if eval $compile; then
17638 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17639 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17641 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17643 : now check for fflushall behaviour
17644 case "$fflushall" in
17645 '') set try -DTRY_FFLUSH_ALL $output
17646 if eval $compile; then
17648 (Now testing the other method--but note that this also may fail.)
17650 $run ./try 2>/dev/null
17653 if $test -s try.out -a "X$code" = X42; then
17654 fflushall="`$cat try.out`"
17657 $rm -f core try.core core.try.*
17658 case "$fflushall" in
17660 Whew. Flushing explicitly all the stdio streams works.
17662 fflushall="$define"
17665 Sigh. Flushing explicitly all the stdio streams doesn't work.
17670 Cannot figure out whether flushing stdio streams explicitly works or not.
17671 I'm assuming it doesn't.
17677 "$define"|true|[yY]*)
17678 fflushall="$define"
17686 All is futile. Even fflush(stdin) clobbers input pipes!
17693 $rm -f core tryp.c tryp.core core.tryp.*
17695 *) fflushall="$undef"
17699 case "$fflushNULL$fflushall" in
17702 OK, I give up. I cannot figure out how to flush pending stdio output.
17703 We won't be flushing handles at all before fork/exec/popen.
17707 $rm -f try.* try$exe_ext
17709 : Store the full pathname to the ar program for use in the C program
17710 : Respect a hint or command line value for full_ar.
17715 : Store the full pathname to the sed program for use in the C program
17718 : see what type gids are declared as in the kernel
17720 echo "Looking for the type for group ids returned by getgid()."
17721 set gid_t gidtype xxx stdio.h sys/types.h
17725 xxx=`./findhdr sys/user.h`
17726 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17728 unsigned) dflt="$1 $2" ;;
17732 *) dflt="$gidtype";;
17735 gid_t) echo "gid_t found." ;;
17736 *) rp="What is the type for group ids returned by getgid()?"
17744 *_t) zzz="$gidtype" ;;
17747 echo "Checking the size of $zzz..." >&4
17749 #include <sys/types.h>
17751 #$i_stdlib I_STDLIB
17753 #include <stdlib.h>
17756 printf("%d\n", (int)sizeof($gidtype));
17761 if eval $compile_ok; then
17765 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17768 echo "Your $zzz is $gidsize bytes long."
17773 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17779 *_t) zzz="$gidtype" ;;
17782 echo "Checking the sign of $zzz..." >&4
17784 #include <sys/types.h>
17795 if eval $compile; then
17799 echo "(I can't execute the test program--guessing unsigned.)" >&4
17803 1) echo "Your $zzz is unsigned." ;;
17804 -1) echo "Your $zzz is signed." ;;
17810 echo "(I can't compile the test program--guessing unsigned.)" >&4
17816 if $test X"$quadtype" != X; then
17818 echo "Checking how to print 64-bit integers..." >&4
17820 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17821 $cat >try.c <<'EOCP'
17822 #include <sys/types.h>
17825 int q = 12345678901;
17826 printf("%ld\n", q);
17830 if eval $compile; then
17834 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17835 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17836 echo "We will use %d."
17842 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17843 $cat >try.c <<'EOCP'
17844 #include <sys/types.h>
17847 long q = 12345678901;
17848 printf("%ld\n", q);
17852 if eval $compile; then
17856 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17857 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17858 echo "We will use %ld."
17864 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17865 $cat >try.c <<'EOCP'
17866 #include <sys/types.h>
17867 #include <inttypes.h>
17870 int64_t q = 12345678901;
17871 printf("%" PRId64 "\n", q);
17875 if eval $compile; then
17879 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17880 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17881 echo "We will use the C9X style."
17887 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17889 #include <sys/types.h>
17892 $quadtype q = 12345678901;
17893 printf("%Ld\n", q);
17897 if eval $compile; then
17901 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17902 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17903 echo "We will use %Ld."
17909 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17910 $cat >try.c <<'EOCP'
17911 #include <sys/types.h>
17914 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17915 printf("%lld\n", q);
17919 if eval $compile; then
17923 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17924 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17925 echo "We will use the %lld style."
17931 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17933 #include <sys/types.h>
17936 $quadtype q = 12345678901;
17937 printf("%qd\n", q);
17941 if eval $compile; then
17945 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17946 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17947 echo "We will use %qd."
17953 if $test X"$sPRId64" = X; then
17954 echo "Cannot figure out how to print 64-bit integers." >&4
17962 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17963 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17965 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17966 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17972 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17974 if $test X"$ivsize" = X8; then
17975 ivdformat="$sPRId64"
17976 uvuformat="$sPRIu64"
17977 uvoformat="$sPRIo64"
17978 uvxformat="$sPRIx64"
17979 uvXUformat="$sPRIXU64"
17981 if $test X"$ivsize" = X"$longsize"; then
17988 if $test X"$ivsize" = X"$intsize"; then
17996 if $test X"$ivsize" = X"$shortsize"; then
18007 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18008 nveformat="$sPRIeldbl"
18009 nvfformat="$sPRIfldbl"
18010 nvgformat="$sPRIgldbl"
18011 nvEUformat="$sPRIEUldbl"
18012 nvFUformat="$sPRIFUldbl"
18013 nvGUformat="$sPRIGUldbl"
18023 case "$ivdformat" in
18024 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18031 $echo "Checking the format string to be used for gids..." >&4
18034 -1) if $test X"$gidsize" = X"$ivsize"; then
18035 gidformat="$ivdformat"
18037 if $test X"$gidsize" = X"$longsize"; then
18040 if $test X"$gidsize" = X"$intsize"; then
18043 if $test X"$gidsize" = X"$shortsize"; then
18050 *) if $test X"$gidsize" = X"$uvsize"; then
18051 gidformat="$uvuformat"
18053 if $test X"$gidsize" = X"$longsize"; then
18056 if $test X"$gidsize" = X"$intsize"; then
18059 if $test X"$gidsize" = X"$shortsize"; then
18068 : see if getgroups exists
18069 set getgroups d_getgrps
18072 : see if setgroups exists
18073 set setgroups d_setgrps
18077 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18079 case "$d_getgrps$d_setgrps" in
18081 case "$groupstype" in
18082 '') dflt="$gidtype" ;;
18083 *) dflt="$groupstype" ;;
18086 What type of pointer is the second argument to getgroups() and setgroups()?
18087 Usually this is the same as group ids, $gidtype, but not always.
18090 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18094 *) groupstype="$gidtype";;
18098 echo "Checking if your $make program sets \$(MAKE)..." >&4
18099 case "$make_set_make" in
18101 $sed 's/^X //' > testmake.mak << 'EOF'
18103 X @echo 'maketemp="$(MAKE)"'
18105 case "`$make -f testmake.mak 2>/dev/null`" in
18106 *maketemp=*) make_set_make='#' ;;
18107 *) make_set_make="MAKE=$make" ;;
18109 $rm -f testmake.mak
18112 case "$make_set_make" in
18113 '#') echo "Yup, it does.";;
18114 *) echo "Nope, it doesn't.";;
18117 : see what type is used for mode_t
18118 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18119 set mode_t modetype int stdio.h sys/types.h
18122 : see if stdarg is available
18124 if $test `./findhdr stdarg.h`; then
18125 echo "<stdarg.h> found." >&4
18128 echo "<stdarg.h> NOT found." >&4
18132 : see if varags is available
18134 if $test `./findhdr varargs.h`; then
18135 echo "<varargs.h> found." >&4
18137 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18140 : set up the varargs testing programs
18141 $cat > varargs.c <<EOP
18143 #include <stdarg.h>
18146 #include <varargs.h>
18150 int f(char *p, ...)
18164 p = va_arg(ap, char *);
18169 $cat > varargs <<EOP
18171 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18180 : now check which varargs header should be included
18185 if `./varargs I_STDARG`; then
18187 elif `./varargs I_VARARGS`; then
18192 if `./varargs I_VARARGS`; then
18199 echo "I could not find the definition for va_dcl... You have problems..." >&4
18200 val="$undef"; set i_stdarg; eval $setvar
18201 val="$undef"; set i_varargs; eval $setvar
18206 case "$i_varhdr" in
18208 val="$define"; set i_stdarg; eval $setvar
18209 val="$undef"; set i_varargs; eval $setvar
18212 val="$undef"; set i_stdarg; eval $setvar
18213 val="$define"; set i_varargs; eval $setvar
18216 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18220 : see if we need va_copy
18222 case "$i_stdarg" in
18225 #include <stdarg.h>
18227 #$i_stdlib I_STDLIB
18229 #include <stdlib.h>
18231 #include <signal.h>
18234 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18236 return vfprintf(f, fmt, *valp);
18240 myvfprintf(FILE *f, const char *fmt, va_list val)
18242 return ivfprintf(f, fmt, &val);
18246 myprintf(char *fmt, ...)
18249 va_start(val, fmt);
18250 return myvfprintf(stdout, fmt, val);
18254 main(int ac, char **av)
18256 signal(SIGSEGV, exit);
18258 myprintf("%s%cs all right, then\n", "that", '\'');
18263 if eval $compile && $run ./try 2>&1 >/dev/null; then
18264 case "`$run ./try`" in
18265 "that's all right, then")
18271 yes) echo "It seems that you don't need va_copy()." >&4
18272 need_va_copy="$undef"
18274 *) echo "It seems that va_copy() or similar will be needed." >&4
18275 need_va_copy="$define"
18278 $rm -f try.* core core.* *.core *.core.*
18280 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18284 : see what type is used for size_t
18285 rp="What is the type used for the length parameter for string functions?"
18286 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18289 : check for type of arguments to gethostbyaddr.
18290 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18291 case "$d_gethbyaddr" in
18295 Checking to see what type of arguments are accepted by gethostbyaddr().
18297 hdrs="$define sys/types.h
18298 $d_socket sys/socket.h
18299 $i_niin netinet/in.h
18301 $i_unistd unistd.h"
18302 : The first arg can 'char *' or 'void *'
18303 : The second arg is some of integral type
18304 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18305 for yyy in size_t long int; do
18306 case "$netdb_host_type" in
18307 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18308 if ./protochk "$try" $hdrs; then
18309 echo "Your system accepts $xxx for the first arg."
18310 echo "...and $yyy for the second arg."
18311 netdb_host_type="$xxx"
18312 netdb_hlen_type="$yyy"
18318 : In case none of those worked, prompt the user.
18319 case "$netdb_host_type" in
18320 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18323 netdb_host_type=$ans
18324 rp='What is the type for the 2nd argument to gethostbyaddr?'
18327 netdb_hlen_type=$ans
18331 *) : no gethostbyaddr, so pick harmless defaults
18332 netdb_host_type='char *'
18333 netdb_hlen_type="$sizetype"
18336 # Remove the "const" if needed. -- but then we'll have a
18338 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18341 : check for type of argument to gethostbyname.
18342 if test "X$netdb_name_type" = X ; then
18343 case "$d_gethbyname" in
18347 Checking to see what type of argument is accepted by gethostbyname().
18349 hdrs="$define sys/types.h
18350 $d_socket sys/socket.h
18351 $i_niin netinet/in.h
18353 $i_unistd unistd.h"
18354 for xxx in "const char *" "char *"; do
18355 case "$netdb_name_type" in
18356 '') try="extern struct hostent *gethostbyname($xxx);"
18357 if ./protochk "$try" $hdrs; then
18358 echo "Your system accepts $xxx."
18359 netdb_name_type="$xxx"
18364 : In case none of those worked, prompt the user.
18365 case "$netdb_name_type" in
18366 '') rp='What is the type for the 1st argument to gethostbyname?'
18369 netdb_name_type=$ans
18373 *) : no gethostbyname, so pick harmless default
18374 netdb_name_type='char *'
18379 : check for type of 1st argument to getnetbyaddr.
18380 if test "X$netdb_net_type" = X ; then
18381 case "$d_getnbyaddr" in
18385 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18387 hdrs="$define sys/types.h
18388 $d_socket sys/socket.h
18389 $i_niin netinet/in.h
18391 $i_unistd unistd.h"
18392 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
18393 case "$netdb_net_type" in
18394 '') try="extern struct netent *getnetbyaddr($xxx, int);"
18395 if ./protochk "$try" $hdrs; then
18396 echo "Your system accepts $xxx."
18397 netdb_net_type="$xxx"
18402 : In case none of those worked, prompt the user.
18403 case "$netdb_net_type" in
18404 '') rp='What is the type for the 1st argument to getnetbyaddr?'
18407 netdb_net_type=$ans
18411 *) : no getnetbyaddr, so pick harmless default
18412 netdb_net_type='long'
18416 : locate the preferred pager for this system
18423 [a-zA-Z]:/*) dflt=$pg;;
18427 [a-zA-Z]:/*) dflt=$more;;
18431 [a-zA-Z]:/*) dflt=$less;;
18434 '') dflt=/usr/ucb/more;;
18438 : Instruct ./getfile to trust the hinted or previous pager value,
18439 : even if it does not begin with a slash. For example, on os2,
18440 : pager might be cmd /c more. See comments in UU/getfile.
18445 rp='What pager is used on your system?'
18449 : see what type pids are declared as in the kernel
18450 rp="What is the type of process ids on this system?"
18451 set pid_t pidtype int stdio.h sys/types.h
18454 : Find earliest binary compatible site_perl subdirectory perl can use.
18455 xs_apiversion=$version # The current site_perl version.
18456 : Find earliest pure perl site_perl subdirectory perl can use.
18457 : The versioned directories started at 5.005.
18458 pm_apiversion='5.005'
18460 : see if ar generates random libraries by itself
18462 echo "Checking how to generate random libraries on your machine..." >&4
18463 echo 'int bar1() { return bar2(); }' > bar1.c
18464 echo 'int bar2() { return 2; }' > bar2.c
18465 $cat > foo.c <<'EOP'
18466 int main() { printf("%d\n", bar1()); exit(0); }
18468 $cc $ccflags -c bar1.c >/dev/null 2>&1
18469 $cc $ccflags -c bar2.c >/dev/null 2>&1
18470 $cc $ccflags -c foo.c >/dev/null 2>&1
18471 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
18472 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18473 $run ./foobar >/dev/null 2>&1; then
18474 echo "$ar appears to generate random libraries itself."
18477 elif $ar ts bar$_a >/dev/null 2>&1 &&
18478 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18479 $run ./foobar >/dev/null 2>&1; then
18480 echo "a table of contents needs to be added with '$ar ts'."
18487 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
18488 $test -f $ranlib || ranlib=''
18491 if $test -n "$ranlib"; then
18492 echo "your system has '$ranlib'; we'll use that."
18495 echo "your system doesn't seem to support random libraries"
18496 echo "so we'll use lorder and tsort to order the libraries."
18503 : check for type of arguments to select.
18504 case "$selecttype" in
18505 '') case "$d_select" in
18509 Checking to see what type of arguments are accepted by select().
18511 hdrs="$define sys/types.h
18512 $i_systime sys/time.h
18513 $i_sysselct sys/select.h
18514 $d_socket sys/socket.h"
18515 : The first arg can be int, unsigned, or size_t
18516 : The last arg may or may not be 'const'
18518 : void pointer has been seen but using that
18519 : breaks the selectminbits test
18520 for xxx in 'fd_set *' 'int *'; do
18521 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
18522 for tmo in 'struct timeval *' 'const struct timeval *'; do
18524 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
18525 if ./protochk "$try" $hdrs; then
18526 echo "Your system accepts $xxx."
18535 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
18536 case "$d_fd_set" in
18537 $define) dflt="fd_set *" ;;
18546 *) : no select, so pick a harmless default
18553 : check for the select 'width'
18554 case "$selectminbits" in
18555 '') case "$d_select" in
18559 Checking to see on how many bits at a time your select() operates...
18562 #include <sys/types.h>
18564 #$i_systime I_SYS_TIME
18565 #$i_systimek I_SYS_TIME_KERNEL
18570 # ifdef I_SYS_TIME_KERNEL
18573 # include <sys/time.h>
18574 # ifdef I_SYS_TIME_KERNEL
18578 #$i_sysselct I_SYS_SELECT
18579 #ifdef I_SYS_SELECT
18580 #include <sys/select.h>
18582 #$d_socket HAS_SOCKET
18584 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18587 #$i_stdlib I_STDLIB
18589 #include <stdlib.h>
18592 #define S sizeof(*(b))
18594 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18595 #define NBITS (NBYTES * 8)
18604 fp = fopen("try.c", "r");
18610 b = ($selecttype)s;
18611 for (i = 0; i < NBITS; i++)
18615 select(fd + 1, b, 0, 0, &t);
18616 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18617 printf("%d\n", i + 1);
18622 if eval $compile_ok; then
18623 selectminbits=`$run ./try`
18624 case "$selectminbits" in
18626 Cannot figure out on how many bits at a time your select() operates.
18627 I'll play safe and guess it is 32 bits.
18633 *) bits="$selectminbits bits" ;;
18635 echo "Your select() operates on $bits at a time." >&4
18637 rp='What is the minimum number of bits your select() operates on?'
18638 case "$byteorder" in
18639 1234|12345678) dflt=32 ;;
18644 selectminbits="$val"
18648 *) : no select, so pick a harmless default
18655 : Trace out the files included by signal.h, then look for SIGxxx names.
18656 : Remove SIGARRAYSIZE used by HPUX.
18657 : Remove SIGSTKSIZE used by Linux.
18658 : Remove SIGSTKSZ used by Posix.
18659 : Remove SIGTYP void lines used by OS2.
18660 : Some cpps, like os390, dont give the file name anywhere
18661 if [ "X$fieldn" = X ]; then
18662 : Just make some guesses. We check them later.
18663 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18665 xxx=`echo '#include <signal.h>' |
18666 $cppstdin $cppminus $cppflags 2>/dev/null |
18667 $grep '^[ ]*#.*include' |
18668 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18670 : Check this list of files to be sure we have parsed the cpp output ok.
18671 : This will also avoid potentially non-existent files, such
18674 for xx in $xxx /dev/null ; do
18675 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18677 : If we have found no files, at least try signal.h
18678 case "$xxxfiles" in
18679 '') xxxfiles=`./findhdr signal.h` ;;
18682 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18683 print substr($2, 4, 20)
18685 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18686 print substr($3, 4, 20)
18688 : Append some common names just in case the awk scan failed.
18689 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18690 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18691 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18692 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18693 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18695 : generate a few handy files for later
18696 $cat > signal.c <<'EOCP'
18697 #include <sys/types.h>
18698 #include <signal.h>
18702 /* Strange style to avoid deeply-nested #if/#else/#endif */
18705 # define NSIG (_NSIG)
18711 # define NSIG (SIGMAX+1)
18717 # define NSIG (SIG_MAX+1)
18723 # define NSIG (MAXSIG+1)
18729 # define NSIG (MAX_SIG+1)
18734 # ifdef SIGARRAYSIZE
18735 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18741 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18745 /* Default to some arbitrary number that's big enough to get most
18746 of the common signals.
18752 printf("NSIG %d\n", NSIG);
18758 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18760 printf "#ifdef SIG"; printf $1; printf "\n"
18761 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18762 printf $1; printf ");\n"
18766 printf "#endif /* JUST_NSIG */\n";
18767 printf "exit(0);\n}\n";
18770 $cat >signal.awk <<'EOP'
18771 BEGIN { ndups = 0 }
18772 $1 ~ /^NSIG$/ { nsig = $2 }
18773 ($1 !~ /^NSIG$/) && (NF == 2) {
18774 if ($2 > maxsig) { maxsig = $2 }
18775 if (sig_name[$2]) {
18776 dup_name[ndups] = $1
18777 dup_num[ndups] = $2
18789 printf("NSIG %d\n", nsig);
18790 for (n = 1; n < nsig; n++) {
18792 printf("%s %d\n", sig_name[n], sig_num[n])
18795 printf("NUM%d %d\n", n, n)
18798 for (n = 0; n < ndups; n++) {
18799 printf("%s %d\n", dup_name[n], dup_num[n])
18803 $cat >signal_cmd <<EOS
18805 if $test -s signal.lst; then
18806 echo "Using your existing signal.lst file"
18811 $cat >>signal_cmd <<'EOS'
18814 if eval $compile_ok; then
18815 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18817 echo "(I can't seem be able to compile the whole test program)" >&4
18818 echo "(I'll try it in little pieces.)" >&4
18819 set signal -DJUST_NSIG
18820 if eval $compile_ok; then
18821 $run ./signal$_exe > signal.nsg
18824 echo "I can't seem to figure out how many signals you have." >&4
18825 echo "Guessing 50." >&4
18826 echo 'NSIG 50' > signal.nsg
18828 : Now look at all the signal names, one at a time.
18829 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18830 $cat > signal.c <<EOCP
18831 #include <sys/types.h>
18832 #include <signal.h>
18835 printf("$xx %d\n", SIG${xx});
18840 if eval $compile; then
18841 echo "SIG${xx} found."
18842 $run ./signal$_exe >> signal.ls1
18844 echo "SIG${xx} NOT found."
18847 if $test -s signal.ls1; then
18848 $cat signal.nsg signal.ls1 |
18849 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18853 if $test -s signal.lst; then
18856 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18857 echo 'kill -l' >signal
18858 set X `csh -f <signal`
18862 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18864 echo $@ | $tr ' ' $trnl | \
18865 $awk '{ printf "%s %d\n", $1, ++s; }
18866 END { printf "NSIG %d\n", ++s }' >signal.lst
18868 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18870 chmod a+x signal_cmd
18871 $eunicefix signal_cmd
18873 : generate list of signal names
18875 case "$sig_name_init" in
18877 *) case "$sig_num_init" in
18878 ''|*,*) doinit=yes ;;
18883 echo "Generating a list of signal names and numbers..." >&4
18885 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18886 sig_name=`$awk 'BEGIN { printf "ZERO " }
18887 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18888 sig_num=`$awk 'BEGIN { printf "0 " }
18889 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18890 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18891 !/^NSIG/ { printf "\"%s\", ", $1 }
18892 END { printf "0\n" }' signal.lst`
18893 sig_num_init=`$awk 'BEGIN { printf "0, " }
18894 !/^NSIG/ { printf "%d, ", $2}
18895 END { printf "0\n"}' signal.lst`
18898 echo "The following $sig_count signals are available:"
18900 echo $sig_name | $awk \
18901 'BEGIN { linelen = 0 }
18903 for (i = 1; i <= NF; i++) {
18904 name = "SIG" $i " "
18905 linelen = linelen + length(name)
18906 if (linelen > 70) {
18908 linelen = length(name)
18914 sig_size=`echo $sig_name | awk '{print NF}'`
18915 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18918 case "$sizetype" in
18919 *_t) zzz="$sizetype" ;;
18920 *) zzz="filesize" ;;
18922 echo "Checking the size of $zzz..." >&4
18924 #include <sys/types.h>
18926 #$i_stdlib I_STDLIB
18928 #include <stdlib.h>
18931 printf("%d\n", (int)sizeof($sizetype));
18936 if eval $compile_ok; then
18940 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18943 echo "Your $zzz size is $sizesize bytes."
18948 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18952 : check for socklen_t
18954 echo "Checking to see if you have socklen_t..." >&4
18956 #include <sys/types.h>
18957 #$d_socket HAS_SOCKET
18959 #include <sys/socket.h>
18961 int main() { socklen_t x = 16; }
18964 if eval $compile; then
18966 echo "You have socklen_t."
18969 echo "You do not have socklen_t."
18970 case "$sizetype" in
18971 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18978 : see if this is a socks.h system
18979 set socks.h i_socks
18982 : check for type of the size argument to socket calls
18983 case "$d_socket" in
18987 Checking to see what type is the last argument of accept().
18990 case "$d_socklen_t" in
18991 "$define") yyy="$yyy socklen_t"
18993 yyy="$yyy $sizetype int long unsigned"
18994 for xxx in $yyy; do
18995 case "$socksizetype" in
18996 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18997 case "$usesocks" in
18999 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19000 echo "Your system accepts '$xxx *' for the last argument of accept()."
19001 socksizetype="$xxx"
19004 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19005 echo "Your system accepts '$xxx *' for the last argument of accept()."
19006 socksizetype="$xxx"
19013 : In case none of those worked, prompt the user.
19014 case "$socksizetype" in
19015 '') rp='What is the type for socket address structure sizes?'
19022 *) : no sockets, so pick relatively harmless default
19027 : see what type is used for signed size_t
19028 set ssize_t ssizetype int stdio.h sys/types.h
19033 #$i_stdlib I_STDLIB
19035 #include <stdlib.h>
19037 #include <sys/types.h>
19038 #define Size_t $sizetype
19039 #define SSize_t $dflt
19042 if (sizeof(Size_t) == sizeof(SSize_t))
19044 else if (sizeof(Size_t) == sizeof(int))
19053 if eval $compile_ok && $run ./try > /dev/null; then
19054 ssizetype=`$run ./try`
19055 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19058 Help! I can't compile and run the ssize_t test program: please enlighten me!
19059 (This is probably a misconfiguration in your system or libraries, and
19060 you really ought to fix it. Still, I'll try anyway.)
19062 I need a type that is the same size as $sizetype, but is guaranteed to
19063 be signed. Common values are ssize_t, int and long.
19066 rp="What signed type is the same size as $sizetype?"
19072 : see what type of char stdio uses.
19074 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19075 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19076 echo "Your stdio uses unsigned chars." >&4
19077 stdchar="unsigned char"
19079 echo "Your stdio uses signed chars." >&4
19086 : see what type uids are declared as in the kernel
19088 echo "Looking for the type for user ids returned by getuid()."
19089 set uid_t uidtype xxx stdio.h sys/types.h
19093 xxx=`./findhdr sys/user.h`
19094 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19096 unsigned) dflt="$1 $2" ;;
19100 *) dflt="$uidtype";;
19103 uid_t) echo "uid_t found." ;;
19104 *) rp="What is the type for user ids returned by getuid()?"
19112 *_t) zzz="$uidtype" ;;
19115 echo "Checking the size of $zzz..." >&4
19117 #include <sys/types.h>
19119 #$i_stdlib I_STDLIB
19121 #include <stdlib.h>
19124 printf("%d\n", (int)sizeof($uidtype));
19129 if eval $compile_ok; then
19133 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19136 echo "Your $zzz is $uidsize bytes long."
19141 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19146 *_t) zzz="$uidtype" ;;
19149 echo "Checking the sign of $zzz..." >&4
19151 #include <sys/types.h>
19162 if eval $compile; then
19166 echo "(I can't execute the test program--guessing unsigned.)" >&4
19170 1) echo "Your $zzz is unsigned." ;;
19171 -1) echo "Your $zzz is signed." ;;
19177 echo "(I can't compile the test program--guessing unsigned.)" >&4
19183 $echo "Checking the format string to be used for uids..." >&4
19186 -1) if $test X"$uidsize" = X"$ivsize"; then
19187 uidformat="$ivdformat"
19189 if $test X"$uidsize" = X"$longsize"; then
19192 if $test X"$uidsize" = X"$intsize"; then
19195 if $test X"$uidsize" = X"$shortsize"; then
19202 *) if $test X"$uidsize" = X"$uvsize"; then
19203 uidformat="$uvuformat"
19205 if $test X"$uidsize" = X"$longsize"; then
19208 if $test X"$uidsize" = X"$intsize"; then
19211 if $test X"$uidsize" = X"$shortsize"; then
19220 : determine compiler compiler
19229 if $test -f "$byacc$_exe"; then
19231 comp="byacc or $comp"
19233 if $test -f "$bison$_exe"; then
19234 comp="$comp or bison -y"
19236 rp="Which compiler compiler ($comp) shall I use?"
19245 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19251 : see if this is a fp.h system
19255 : see if this is a fp_class.h system
19256 set fp_class.h i_fp_class
19259 : see if this is a ieeefp.h system
19260 case "$i_ieeefp" in
19261 '' ) set ieeefp.h i_ieeefp
19266 : see if this is a libutil.h system
19267 set libutil.h i_libutil
19270 : see if mach cthreads are available
19271 if test "X$usethreads" = "X$define"; then
19272 set mach/cthreads.h i_machcthr
19275 i_machcthr="$undef"
19280 : see if this is a math.h system
19284 : see if this is a mntent.h system
19285 set mntent.h i_mntent
19288 : see if ndbm.h is available
19294 # Some Linux distributions such as RedHat 7.1 put the
19295 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19296 if $test -f /usr/include/gdbm/ndbm.h; then
19297 echo '<gdbm/ndbm.h> found.'
19298 ccflags="$ccflags -I/usr/include/gdbm"
19299 cppflags="$cppflags -I/usr/include/gdbm"
19307 : see if dbm_open exists
19308 set dbm_open d_dbm_open
19310 case "$d_dbm_open" in
19313 echo "We won't be including <ndbm.h>"
19322 : see if net/errno.h is available
19324 set net/errno.h val
19327 : Unfortunately, it causes problems on some systems. Arrgh.
19330 cat > try.c <<'EOM'
19333 #include <net/errno.h>
19339 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19340 echo "We'll be including <net/errno.h>." >&4
19342 echo "We won't be including <net/errno.h>." >&4
19351 : see if netinet/tcp.h is available
19352 set netinet/tcp.h i_netinettcp
19355 : see if this is a poll.h system
19359 : see if this is a prot.h system
19364 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19365 $cat <<'EOSH' > Cppsym.know
19366 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19367 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19368 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19369 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
19370 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
19371 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
19372 bull c cadmus clipper CMU COFF COMPILER_VERSION
19373 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
19374 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
19375 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
19376 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
19378 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
19379 H3050R H3050RX hbullx20 hcx host_mips
19380 hp200 hp300 hp700 HP700 hp800 hp9000
19381 hp9000s200 hp9000s300 hp9000s400 hp9000s500
19382 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
19383 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
19384 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
19385 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
19386 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
19387 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
19388 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
19389 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
19390 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
19391 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
19392 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
19393 MATH_HAS_NO_SIDE_EFFECTS
19394 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
19395 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
19396 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
19397 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
19398 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
19399 NetBSD news1500 news1700 news1800 news1900 news3700
19400 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
19401 ns32016 ns32332 ns32k nsc32000
19402 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
19403 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
19404 pc532 pdp11 PGC PIC plexus PORTAR posix
19405 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
19406 POSIX_C_SOURCE POSIX_SOURCE POWER
19407 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
19408 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
19409 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
19410 sony sony_news sonyrisc sparc sparclite spectrum
19411 stardent stdc STDC_EXT stratos sun sun3 sun386
19412 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
19413 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
19414 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
19415 sysV68 sysV88 Tek4132 Tek4300 titan
19416 TM3200 TM5400 TM5600
19417 tower tower32 tower32_200 tower32_600 tower32_700
19418 tower32_800 tower32_850 tss
19419 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
19420 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
19421 unix UNIX95 UNIX99 unixpc unos
19422 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
19423 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
19424 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
19426 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
19427 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
19428 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
19431 # Maybe put other stuff here too.
19432 cat <<EOSH >>Cppsym.know
19435 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
19436 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
19437 $cat Cppsym.know > Cppsym.c
19438 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
19439 $rm -f Cppsym.a Cppsym.b Cppsym.c
19440 cat <<EOSH > Cppsym
19442 if $test \$# -gt 0; then
19443 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
19444 if $test -s Cppsym.got; then
19451 $tr " " "$trnl" | ./Cppsym.try
19457 cat <<EOSH > Cppsym.try
19459 cat <<'EOCP' > try.c
19465 cat <<'EOSH' >> Cppsym.try
19467 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
19468 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
19469 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
19470 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
19472 echo 'return 0;}' >> try.c
19474 cat <<EOSH >> Cppsym.try
19476 case "$osname-$gccversion" in
19477 irix-) ccflags="\$ccflags -woff 1178" ;;
19478 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
19480 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
19482 chmod +x Cppsym.try
19483 $eunicefix Cppsym.try
19484 ./Cppsym < Cppsym.know > Cppsym.true
19485 : now check the C compiler for additional symbols
19486 postprocess_cc_v=''
19488 aix) postprocess_cc_v="|$tr , ' '" ;;
19495 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
19498 -D*) echo "\$i" | $sed 's/^-D//';;
19499 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
19504 postprocess_cc_v=''
19507 ./ccsym > ccsym1.raw
19508 if $test -s ccsym1.raw; then
19509 $sort ccsym1.raw | $uniq >ccsym.raw
19511 mv ccsym1.raw ccsym.raw
19514 $awk '/\=/ { print $0; next }
19515 { print $0"=1" }' ccsym.raw >ccsym.list
19516 $awk '/\=/ { print $0; next }
19517 { print $0"=1" }' Cppsym.true >ccsym.true
19518 $comm -13 ccsym.true ccsym.list >ccsym.own
19519 $comm -12 ccsym.true ccsym.list >ccsym.com
19520 $comm -23 ccsym.true ccsym.list >ccsym.cpp
19522 if $test -z ccsym.raw; then
19523 echo "Your C compiler doesn't seem to define any symbols!" >&4
19525 echo "However, your C preprocessor defines the following symbols:"
19528 cppsymbols=`$cat Cppsym.true`
19529 cppsymbols=`echo $cppsymbols`
19530 cppccsymbols="$cppsymbols"
19532 if $test -s ccsym.com; then
19533 echo "Your C compiler and pre-processor define these symbols:"
19534 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
19537 cppccsymbols=`$cat ccsym.com`
19538 cppccsymbols=`echo $cppccsymbols`
19539 $test "$silent" || sleep 1
19541 if $test -s ccsym.cpp; then
19542 $test "$also" && echo " "
19543 echo "Your C pre-processor ${also}defines the following symbols:"
19544 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
19546 cppsymbols=`$cat ccsym.cpp`
19547 cppsymbols=`echo $cppsymbols`
19548 $test "$silent" || sleep 1
19550 if $test -s ccsym.own; then
19551 $test "$also" && echo " "
19552 echo "Your C compiler ${also}defines the following cpp symbols:"
19553 $sed -e 's/\(..*\)=1/\1/' ccsym.own
19554 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
19555 ccsymbols=`$cat ccsym.own`
19556 ccsymbols=`echo $ccsymbols`
19557 $test "$silent" || sleep 1
19561 : see if this is a termio system
19565 if $test `./findhdr termios.h`; then
19566 set tcsetattr i_termios
19572 "$define") echo "You have POSIX termios.h... good!" >&4;;
19573 *) if ./Cppsym pyr; then
19574 case "`/bin/universe`" in
19575 ucb) if $test `./findhdr sgtty.h`; then
19577 echo "<sgtty.h> found." >&4
19579 echo "System is pyramid with BSD universe."
19580 echo "<sgtty.h> not found--you could have problems." >&4
19582 *) if $test `./findhdr termio.h`; then
19584 echo "<termio.h> found." >&4
19586 echo "System is pyramid with USG universe."
19587 echo "<termio.h> not found--you could have problems." >&4
19591 if $test `./findhdr termio.h`; then
19592 echo "<termio.h> found." >&4
19594 elif $test `./findhdr sgtty.h`; then
19595 echo "<sgtty.h> found." >&4
19598 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19601 if $test `./findhdr sgtty.h`; then
19602 echo "<sgtty.h> found." >&4
19604 elif $test `./findhdr termio.h`; then
19605 echo "<termio.h> found." >&4
19608 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19612 set i_termio; eval $setvar
19613 val=$val2; set i_sgtty; eval $setvar
19614 val=$val3; set i_termios; eval $setvar
19616 : see if stddef is available
19617 set stddef.h i_stddef
19620 : see if this is a sunmath.h system
19621 set sunmath.h i_sunmath
19624 : see if sys/access.h is available
19625 set sys/access.h i_sysaccess
19628 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19629 set sys/filio.h i_sysfilio
19632 if $test `./findhdr sys/ioctl.h`; then
19634 echo '<sys/ioctl.h> found.' >&4
19637 if $test $i_sysfilio = "$define"; then
19638 echo '<sys/ioctl.h> NOT found.' >&4
19640 $test $i_sgtty = "$define" && xxx="sgtty.h"
19641 $test $i_termio = "$define" && xxx="termio.h"
19642 $test $i_termios = "$define" && xxx="termios.h"
19643 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19649 : see if socket ioctl defs are in sys/sockio.h
19651 xxx=`./findhdr sys/sockio.h`
19652 if $test "$xxx"; then
19653 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19655 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19658 echo "No socket ioctls found in <sys/sockio.h>." >&4
19663 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19670 : see if this is a syslog.h system
19671 set syslog.h i_syslog
19675 : see if this is a sys/mode.h system
19676 set sys/mode.h i_sysmode
19679 : see if sys/resource.h has to be included
19680 set sys/resource.h i_sysresrc
19683 : see if sys/security.h is available
19684 set sys/security.h i_syssecrt
19687 : see if this is a sys/statvfs.h system
19688 set sys/statvfs.h i_sysstatvfs
19691 : see if this is a sys/un.h system
19692 set sys/un.h i_sysun
19696 : see if this is a sys/utsname.h system
19697 set sys/utsname.h i_sysutsname
19700 : see if this is a syswait system
19701 set sys/wait.h i_syswait
19704 : see if this is a ustat.h system
19705 set ustat.h i_ustat
19708 : see if this is an utime system
19709 set utime.h i_utime
19712 : see if this is a values.h system
19713 set values.h i_values
19716 : see if this is a vfork system
19719 set vfork.h i_vfork
19727 : see if gdbm.h is available
19732 : see if gdbm_open exists
19733 set gdbm_open d_gdbm_open
19735 case "$d_gdbm_open" in
19738 echo "We won't be including <gdbm.h>"
19748 echo "Looking for extensions..." >&4
19749 : If we are using the old config.sh, known_extensions may contain
19750 : old or inaccurate or duplicate values.
19751 known_extensions=''
19752 nonxs_extensions=''
19753 : We do not use find because it might not be available.
19754 : We do not just use MANIFEST because the user may have dropped
19755 : some additional extensions into the source tree and expect them
19758 : Function to recursively find available extensions, ignoring DynaLoader
19759 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19763 DynaLoader|dynaload) ;;
19765 if $test -f $xxx/$xxx.xs; then
19766 known_extensions="$known_extensions $1$xxx";
19767 elif $test -f $xxx/Makefile.PL; then
19768 nonxs_extensions="$nonxs_extensions $1$xxx";
19770 if $test -d $xxx -a $# -lt 10; then
19773 eval $find_extensions;
19785 eval $find_extensions
19786 # Special case: Add in threads/shared since it is not picked up by the
19787 # recursive find above (and adding in general recursive finding breaks
19788 # SDBM_File/sdbm). A.D. 10/25/2001.
19789 known_extensions="$known_extensions threads/shared"
19790 set X $nonxs_extensions
19792 nonxs_extensions="$*"
19793 set X $known_extensions
19795 known_extensions="$*"
19798 : Now see which are supported on this system.
19800 for xxx in $known_extensions ; do
19804 $define) avail_ext="$avail_ext $xxx" ;;
19807 GDBM_File|gdbm_fil)
19809 $define) avail_ext="$avail_ext $xxx" ;;
19812 I18N/Langinfo|i18n_lan)
19813 case "$i_langinfo$d_nl_langinfo" in
19814 $define$define) avail_ext="$avail_ext $xxx" ;;
19817 NDBM_File|ndbm_fil)
19820 case "$osname-$use64bitint" in
19823 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19826 *) avail_ext="$avail_ext $xxx" ;;
19831 ODBM_File|odbm_fil)
19832 case "${i_dbm}${i_rpcsvcdbm}" in
19834 case "$osname-$use64bitint" in
19837 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19840 *) avail_ext="$avail_ext $xxx" ;;
19846 case "$useposix" in
19847 true|define|y) avail_ext="$avail_ext $xxx" ;;
19851 case "$useopcode" in
19852 true|define|y) avail_ext="$avail_ext $xxx" ;;
19856 case "$d_socket" in
19859 beos) ;; # not unless BONE
19860 *) avail_ext="$avail_ext $xxx" ;;
19865 Sys/Syslog|sys/syslog)
19866 : XXX syslog requires socket
19867 case "$d_socket" in
19868 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19872 case "$usethreads" in
19874 case "$useithreads" in
19875 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19879 XS/APItest|xs/apitest)
19880 # This is just for testing. Skip it unless we have dynamic loading.
19883 $define) avail_ext="$avail_ext $xxx" ;;
19886 XS/Typemap|xs/typemap)
19887 # This is just for testing. Skip it unless we have dynamic loading.
19889 $define) avail_ext="$avail_ext $xxx" ;;
19892 threads|threads/shared)
19893 # threads and threads::shared are special cases.
19894 # To stop people from asking "Perl 5.8.0 was supposed
19895 # to have this new fancy threads implementation but my
19896 # perl doesn't have it" and from people trying to
19897 # (re)install the threads module using CPAN.pm and
19898 # CPAN.pm then offering to reinstall Perl 5.8.0,
19899 # the threads.pm and threads/shared.pm will always be
19900 # there, croaking informatively ("you need to rebuild
19901 # all of Perl with threads, sorry") when threads haven't
19902 # been compiled in.
19904 avail_ext="$avail_ext $xxx"
19907 : XXX Do we need a useipcsysv variable here
19908 case "${d_msg}${d_sem}${d_shm}" in
19909 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19912 *) avail_ext="$avail_ext $xxx"
19921 : Now see which nonxs extensions are supported on this system.
19922 : For now assume all are.
19924 for xxx in $nonxs_extensions ; do
19926 *) nonxs_ext="$nonxs_ext $xxx"
19938 A number of extensions are supplied with $package. You may choose to
19939 compile these extensions for dynamic loading (the default), compile
19940 them into the $package executable (static loading), or not include
19941 them at all. Answer "none" to include no extensions.
19942 Note that DynaLoader is always built and need not be mentioned here.
19945 case "$dynamic_ext" in
19947 : Exclude those listed in static_ext
19949 for xxx in $avail_ext; do
19950 case " $static_ext " in
19952 *) dflt="$dflt $xxx" ;;
19959 *) dflt="$dynamic_ext"
19960 # Perhaps we are reusing an old out-of-date config.sh.
19963 if test X"$dynamic_ext" != X"$avail_ext"; then
19965 NOTICE: Your previous config.sh list may be incorrect.
19966 The extensions now available to you are
19968 but the default list from your previous config.sh is
19980 rp="What extensions do you wish to load dynamically?"
19983 none) dynamic_ext=' ' ;;
19984 *) dynamic_ext="$ans" ;;
19987 case "$static_ext" in
19989 : Exclude those already listed in dynamic linking
19991 for xxx in $avail_ext; do
19992 case " $dynamic_ext " in
19994 *) dflt="$dflt $xxx" ;;
20001 *) dflt="$static_ext"
20008 rp="What extensions do you wish to load statically?"
20011 none) static_ext=' ' ;;
20012 *) static_ext="$ans" ;;
20017 A number of extensions are supplied with $package. Answer "none"
20018 to include no extensions.
20019 Note that DynaLoader is always built and need not be mentioned here.
20022 case "$static_ext" in
20023 '') dflt="$avail_ext" ;;
20024 *) dflt="$static_ext"
20025 # Perhaps we are reusing an old out-of-date config.sh.
20028 if test X"$static_ext" != X"$avail_ext"; then
20030 NOTICE: Your previous config.sh list may be incorrect.
20031 The extensions now available to you are
20033 but the default list from your previous config.sh is
20042 : Exclude those that are not xs extensions
20046 rp="What extensions do you wish to include?"
20049 none) static_ext=' ' ;;
20050 *) static_ext="$ans" ;;
20055 # Encode is a special case. If we are building Encode as a static
20056 # extension, we need to explicitly list its subextensions as well.
20057 # For other nested extensions, this is handled automatically by
20058 # the appropriate Makefile.PL.
20059 case " $static_ext " in
20060 *" Encode "*) # Add the subextensions of Encode
20062 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20063 static_ext="$static_ext Encode/$xxx"
20069 set X $dynamic_ext $static_ext $nonxs_ext
20073 : Remove libraries needed only for extensions
20074 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20075 : The exception is SunOS 4.x, which needs them.
20076 case "${osname}X${osvers}" in
20080 *) case "$usedl" in
20081 $define|true|[yY]*)
20082 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20086 *) perllibs="$libs"
20092 : Remove build directory name from cppstdin so it can be used from
20093 : either the present location or the final installed location.
20095 : Get out of the UU directory to get correct path name.
20097 case "$cppstdin" in
20099 echo "Stripping down cppstdin path name"
20105 : end of configuration questions
20107 echo "End of configuration questions."
20110 : back to where it started
20111 if test -d ../UU; then
20115 : configuration may be patched via a 'config.arch' file
20116 if $test -f config.arch; then
20117 echo "I see a config.arch file, loading it."
20121 : configuration may be patched via a 'config.over' file
20122 if $test -f config.over; then
20125 rp='I see a config.over file. Do you wish to load it?'
20128 n*) echo "OK, I'll ignore it.";;
20130 echo "Configuration override changes have been loaded."
20135 : in case they want portability, strip down executable paths
20136 case "$d_portable" in
20139 echo "Stripping down executable paths..." >&4
20140 for file in $loclist $trylist; do
20142 eval $file=`basename $temp`
20147 : create config.sh file
20149 echo "Creating config.sh..." >&4
20150 $spitshell <<EOT >config.sh
20153 # This file was produced by running the Configure script. It holds all the
20154 # definitions figured out by Configure. Should you modify one of these values,
20155 # do not forget to propagate your changes by running "Configure -der". You may
20156 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20159 # Package name : $package
20160 # Source directory : $src
20161 # Configuration time: $cf_time
20162 # Configured by : $cf_by
20163 # Target system : $myuname
20173 Revision='$Revision'
20181 alignbytes='$alignbytes'
20182 ansi2knr='$ansi2knr'
20183 aphostname='$aphostname'
20184 api_revision='$api_revision'
20185 api_subversion='$api_subversion'
20186 api_version='$api_version'
20187 api_versionstring='$api_versionstring'
20190 archlibexp='$archlibexp'
20191 archname64='$archname64'
20192 archname='$archname'
20193 archobjs='$archobjs'
20194 asctime_r_proto='$asctime_r_proto'
20202 byteorder='$byteorder'
20204 castflags='$castflags'
20207 cccdlflags='$cccdlflags'
20208 ccdlflags='$ccdlflags'
20210 ccflags_uselargefiles='$ccflags_uselargefiles'
20212 ccsymbols='$ccsymbols'
20213 ccversion='$ccversion'
20215 cf_email='$cf_email'
20217 charsize='$charsize'
20221 clocktype='$clocktype'
20223 compress='$compress'
20224 contains='$contains'
20228 cpp_stuff='$cpp_stuff'
20229 cppccsymbols='$cppccsymbols'
20230 cppflags='$cppflags'
20232 cppminus='$cppminus'
20234 cppstdin='$cppstdin'
20235 cppsymbols='$cppsymbols'
20236 crypt_r_proto='$crypt_r_proto'
20237 cryptlib='$cryptlib'
20239 ctermid_r_proto='$ctermid_r_proto'
20240 ctime_r_proto='$ctime_r_proto'
20241 d_Gconvert='$d_Gconvert'
20242 d_PRIEUldbl='$d_PRIEUldbl'
20243 d_PRIFUldbl='$d_PRIFUldbl'
20244 d_PRIGUldbl='$d_PRIGUldbl'
20245 d_PRIXU64='$d_PRIXU64'
20246 d_PRId64='$d_PRId64'
20247 d_PRIeldbl='$d_PRIeldbl'
20248 d_PRIfldbl='$d_PRIfldbl'
20249 d_PRIgldbl='$d_PRIgldbl'
20250 d_PRIi64='$d_PRIi64'
20251 d_PRIo64='$d_PRIo64'
20252 d_PRIu64='$d_PRIu64'
20253 d_PRIx64='$d_PRIx64'
20254 d_SCNfldbl='$d_SCNfldbl'
20255 d__fwalk='$d__fwalk'
20256 d_access='$d_access'
20257 d_accessx='$d_accessx'
20259 d_archlib='$d_archlib'
20260 d_asctime_r='$d_asctime_r'
20263 d_attribut='$d_attribut'
20267 d_bsdgetpgrp='$d_bsdgetpgrp'
20268 d_bsdsetpgrp='$d_bsdsetpgrp'
20270 d_casti32='$d_casti32'
20271 d_castneg='$d_castneg'
20272 d_charvspr='$d_charvspr'
20274 d_chroot='$d_chroot'
20275 d_chsize='$d_chsize'
20277 d_closedir='$d_closedir'
20278 d_cmsghdr_s='$d_cmsghdr_s'
20281 d_crypt_r='$d_crypt_r'
20283 d_ctermid_r='$d_ctermid_r'
20284 d_ctime_r='$d_ctime_r'
20285 d_cuserid='$d_cuserid'
20286 d_dbl_dig='$d_dbl_dig'
20287 d_dbminitproto='$d_dbminitproto'
20288 d_difftime='$d_difftime'
20290 d_dirnamlen='$d_dirnamlen'
20291 d_dlerror='$d_dlerror'
20292 d_dlopen='$d_dlopen'
20293 d_dlsymun='$d_dlsymun'
20294 d_dosuid='$d_dosuid'
20295 d_drand48_r='$d_drand48_r'
20296 d_drand48proto='$d_drand48proto'
20298 d_eaccess='$d_eaccess'
20299 d_endgrent='$d_endgrent'
20300 d_endgrent_r='$d_endgrent_r'
20301 d_endhent='$d_endhent'
20302 d_endhostent_r='$d_endhostent_r'
20303 d_endnent='$d_endnent'
20304 d_endnetent_r='$d_endnetent_r'
20305 d_endpent='$d_endpent'
20306 d_endprotoent_r='$d_endprotoent_r'
20307 d_endpwent='$d_endpwent'
20308 d_endpwent_r='$d_endpwent_r'
20309 d_endsent='$d_endsent'
20310 d_endservent_r='$d_endservent_r'
20311 d_eofnblk='$d_eofnblk'
20312 d_eunice='$d_eunice'
20313 d_fchdir='$d_fchdir'
20314 d_fchmod='$d_fchmod'
20315 d_fchown='$d_fchown'
20317 d_fcntl_can_lock='$d_fcntl_can_lock'
20318 d_fd_macros='$d_fd_macros'
20319 d_fd_set='$d_fd_set'
20320 d_fds_bits='$d_fds_bits'
20321 d_fgetpos='$d_fgetpos'
20322 d_finite='$d_finite'
20323 d_finitel='$d_finitel'
20324 d_flexfnam='$d_flexfnam'
20326 d_flockproto='$d_flockproto'
20328 d_fp_class='$d_fp_class'
20329 d_fpathconf='$d_fpathconf'
20330 d_fpclass='$d_fpclass'
20331 d_fpclassify='$d_fpclassify'
20332 d_fpclassl='$d_fpclassl'
20333 d_fpos64_t='$d_fpos64_t'
20334 d_frexpl='$d_frexpl'
20335 d_fs_data_s='$d_fs_data_s'
20336 d_fseeko='$d_fseeko'
20337 d_fsetpos='$d_fsetpos'
20338 d_fstatfs='$d_fstatfs'
20339 d_fstatvfs='$d_fstatvfs'
20341 d_ftello='$d_ftello'
20343 d_getcwd='$d_getcwd'
20344 d_getespwnam='$d_getespwnam'
20345 d_getfsstat='$d_getfsstat'
20346 d_getgrent='$d_getgrent'
20347 d_getgrent_r='$d_getgrent_r'
20348 d_getgrgid_r='$d_getgrgid_r'
20349 d_getgrnam_r='$d_getgrnam_r'
20350 d_getgrps='$d_getgrps'
20351 d_gethbyaddr='$d_gethbyaddr'
20352 d_gethbyname='$d_gethbyname'
20353 d_gethent='$d_gethent'
20354 d_gethname='$d_gethname'
20355 d_gethostbyaddr_r='$d_gethostbyaddr_r'
20356 d_gethostbyname_r='$d_gethostbyname_r'
20357 d_gethostent_r='$d_gethostent_r'
20358 d_gethostprotos='$d_gethostprotos'
20359 d_getitimer='$d_getitimer'
20360 d_getlogin='$d_getlogin'
20361 d_getlogin_r='$d_getlogin_r'
20362 d_getmnt='$d_getmnt'
20363 d_getmntent='$d_getmntent'
20364 d_getnbyaddr='$d_getnbyaddr'
20365 d_getnbyname='$d_getnbyname'
20366 d_getnent='$d_getnent'
20367 d_getnetbyaddr_r='$d_getnetbyaddr_r'
20368 d_getnetbyname_r='$d_getnetbyname_r'
20369 d_getnetent_r='$d_getnetent_r'
20370 d_getnetprotos='$d_getnetprotos'
20371 d_getpagsz='$d_getpagsz'
20372 d_getpbyname='$d_getpbyname'
20373 d_getpbynumber='$d_getpbynumber'
20374 d_getpent='$d_getpent'
20375 d_getpgid='$d_getpgid'
20376 d_getpgrp2='$d_getpgrp2'
20377 d_getpgrp='$d_getpgrp'
20378 d_getppid='$d_getppid'
20379 d_getprior='$d_getprior'
20380 d_getprotobyname_r='$d_getprotobyname_r'
20381 d_getprotobynumber_r='$d_getprotobynumber_r'
20382 d_getprotoent_r='$d_getprotoent_r'
20383 d_getprotoprotos='$d_getprotoprotos'
20384 d_getprpwnam='$d_getprpwnam'
20385 d_getpwent='$d_getpwent'
20386 d_getpwent_r='$d_getpwent_r'
20387 d_getpwnam_r='$d_getpwnam_r'
20388 d_getpwuid_r='$d_getpwuid_r'
20389 d_getsbyname='$d_getsbyname'
20390 d_getsbyport='$d_getsbyport'
20391 d_getsent='$d_getsent'
20392 d_getservbyname_r='$d_getservbyname_r'
20393 d_getservbyport_r='$d_getservbyport_r'
20394 d_getservent_r='$d_getservent_r'
20395 d_getservprotos='$d_getservprotos'
20396 d_getspnam='$d_getspnam'
20397 d_getspnam_r='$d_getspnam_r'
20398 d_gettimeod='$d_gettimeod'
20399 d_gmtime_r='$d_gmtime_r'
20400 d_gnulibc='$d_gnulibc'
20401 d_grpasswd='$d_grpasswd'
20402 d_hasmntopt='$d_hasmntopt'
20405 d_inetaton='$d_inetaton'
20406 d_int64_t='$d_int64_t'
20407 d_isascii='$d_isascii'
20408 d_isfinite='$d_isfinite'
20411 d_isnanl='$d_isnanl'
20412 d_killpg='$d_killpg'
20413 d_lchown='$d_lchown'
20414 d_ldbl_dig='$d_ldbl_dig'
20416 d_localtime_r='$d_localtime_r'
20417 d_locconv='$d_locconv'
20419 d_longdbl='$d_longdbl'
20420 d_longlong='$d_longlong'
20421 d_lseekproto='$d_lseekproto'
20423 d_madvise='$d_madvise'
20425 d_mbstowcs='$d_mbstowcs'
20426 d_mbtowc='$d_mbtowc'
20427 d_memchr='$d_memchr'
20428 d_memcmp='$d_memcmp'
20429 d_memcpy='$d_memcpy'
20430 d_memmove='$d_memmove'
20431 d_memset='$d_memset'
20433 d_mkdtemp='$d_mkdtemp'
20434 d_mkfifo='$d_mkfifo'
20435 d_mkstemp='$d_mkstemp'
20436 d_mkstemps='$d_mkstemps'
20437 d_mktime='$d_mktime'
20440 d_modfl_pow32_bug='$d_modfl_pow32_bug'
20441 d_modflproto='$d_modflproto'
20442 d_mprotect='$d_mprotect'
20444 d_msg_ctrunc='$d_msg_ctrunc'
20445 d_msg_dontroute='$d_msg_dontroute'
20446 d_msg_oob='$d_msg_oob'
20447 d_msg_peek='$d_msg_peek'
20448 d_msg_proxy='$d_msg_proxy'
20449 d_msgctl='$d_msgctl'
20450 d_msgget='$d_msgget'
20451 d_msghdr_s='$d_msghdr_s'
20452 d_msgrcv='$d_msgrcv'
20453 d_msgsnd='$d_msgsnd'
20455 d_munmap='$d_munmap'
20456 d_mymalloc='$d_mymalloc'
20457 d_nanosleep='$d_nanosleep'
20459 d_nl_langinfo='$d_nl_langinfo'
20460 d_nv_preserves_uv='$d_nv_preserves_uv'
20461 d_off64_t='$d_off64_t'
20462 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
20463 d_oldpthreads='$d_oldpthreads'
20464 d_oldsock='$d_oldsock'
20466 d_pathconf='$d_pathconf'
20468 d_perl_otherlibdirs='$d_perl_otherlibdirs'
20469 d_phostname='$d_phostname'
20472 d_portable='$d_portable'
20473 d_procselfexe='$d_procselfexe'
20474 d_pthread_atfork='$d_pthread_atfork'
20475 d_pthread_yield='$d_pthread_yield'
20477 d_pwchange='$d_pwchange'
20478 d_pwclass='$d_pwclass'
20479 d_pwcomment='$d_pwcomment'
20480 d_pwexpire='$d_pwexpire'
20481 d_pwgecos='$d_pwgecos'
20482 d_pwpasswd='$d_pwpasswd'
20483 d_pwquota='$d_pwquota'
20486 d_random_r='$d_random_r'
20487 d_readdir64_r='$d_readdir64_r'
20488 d_readdir='$d_readdir'
20489 d_readdir_r='$d_readdir_r'
20490 d_readlink='$d_readlink'
20492 d_recvmsg='$d_recvmsg'
20493 d_rename='$d_rename'
20494 d_rewinddir='$d_rewinddir'
20496 d_safebcpy='$d_safebcpy'
20497 d_safemcpy='$d_safemcpy'
20498 d_sanemcmp='$d_sanemcmp'
20499 d_sbrkproto='$d_sbrkproto'
20500 d_sched_yield='$d_sched_yield'
20501 d_scm_rights='$d_scm_rights'
20502 d_seekdir='$d_seekdir'
20503 d_select='$d_select'
20505 d_semctl='$d_semctl'
20506 d_semctl_semid_ds='$d_semctl_semid_ds'
20507 d_semctl_semun='$d_semctl_semun'
20508 d_semget='$d_semget'
20510 d_sendmsg='$d_sendmsg'
20511 d_setegid='$d_setegid'
20512 d_seteuid='$d_seteuid'
20513 d_setgrent='$d_setgrent'
20514 d_setgrent_r='$d_setgrent_r'
20515 d_setgrps='$d_setgrps'
20516 d_sethent='$d_sethent'
20517 d_sethostent_r='$d_sethostent_r'
20518 d_setitimer='$d_setitimer'
20519 d_setlinebuf='$d_setlinebuf'
20520 d_setlocale='$d_setlocale'
20521 d_setlocale_r='$d_setlocale_r'
20522 d_setnent='$d_setnent'
20523 d_setnetent_r='$d_setnetent_r'
20524 d_setpent='$d_setpent'
20525 d_setpgid='$d_setpgid'
20526 d_setpgrp2='$d_setpgrp2'
20527 d_setpgrp='$d_setpgrp'
20528 d_setprior='$d_setprior'
20529 d_setproctitle='$d_setproctitle'
20530 d_setprotoent_r='$d_setprotoent_r'
20531 d_setpwent='$d_setpwent'
20532 d_setpwent_r='$d_setpwent_r'
20533 d_setregid='$d_setregid'
20534 d_setresgid='$d_setresgid'
20535 d_setresuid='$d_setresuid'
20536 d_setreuid='$d_setreuid'
20537 d_setrgid='$d_setrgid'
20538 d_setruid='$d_setruid'
20539 d_setsent='$d_setsent'
20540 d_setservent_r='$d_setservent_r'
20541 d_setsid='$d_setsid'
20542 d_setvbuf='$d_setvbuf'
20546 d_shmatprototype='$d_shmatprototype'
20547 d_shmctl='$d_shmctl'
20549 d_shmget='$d_shmget'
20550 d_sigaction='$d_sigaction'
20551 d_sigprocmask='$d_sigprocmask'
20552 d_sigsetjmp='$d_sigsetjmp'
20553 d_sockatmark='$d_sockatmark'
20554 d_sockatmarkproto='$d_sockatmarkproto'
20555 d_socket='$d_socket'
20556 d_socklen_t='$d_socklen_t'
20557 d_sockpair='$d_sockpair'
20558 d_socks5_init='$d_socks5_init'
20560 d_srand48_r='$d_srand48_r'
20561 d_srandom_r='$d_srandom_r'
20562 d_sresgproto='$d_sresgproto'
20563 d_sresuproto='$d_sresuproto'
20564 d_statblks='$d_statblks'
20565 d_statfs_f_flags='$d_statfs_f_flags'
20566 d_statfs_s='$d_statfs_s'
20567 d_statvfs='$d_statvfs'
20568 d_stdio_cnt_lval='$d_stdio_cnt_lval'
20569 d_stdio_ptr_lval='$d_stdio_ptr_lval'
20570 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
20571 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
20572 d_stdio_stream_array='$d_stdio_stream_array'
20573 d_stdiobase='$d_stdiobase'
20574 d_stdstdio='$d_stdstdio'
20575 d_strchr='$d_strchr'
20576 d_strcoll='$d_strcoll'
20577 d_strctcpy='$d_strctcpy'
20578 d_strerrm='$d_strerrm'
20579 d_strerror='$d_strerror'
20580 d_strerror_r='$d_strerror_r'
20581 d_strftime='$d_strftime'
20582 d_strtod='$d_strtod'
20583 d_strtol='$d_strtol'
20584 d_strtold='$d_strtold'
20585 d_strtoll='$d_strtoll'
20586 d_strtoq='$d_strtoq'
20587 d_strtoul='$d_strtoul'
20588 d_strtoull='$d_strtoull'
20589 d_strtouq='$d_strtouq'
20590 d_strxfrm='$d_strxfrm'
20591 d_suidsafe='$d_suidsafe'
20592 d_symlink='$d_symlink'
20593 d_syscall='$d_syscall'
20594 d_syscallproto='$d_syscallproto'
20595 d_sysconf='$d_sysconf'
20596 d_sysernlst='$d_sysernlst'
20597 d_syserrlst='$d_syserrlst'
20598 d_system='$d_system'
20599 d_tcgetpgrp='$d_tcgetpgrp'
20600 d_tcsetpgrp='$d_tcsetpgrp'
20601 d_telldir='$d_telldir'
20602 d_telldirproto='$d_telldirproto'
20605 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20606 d_tm_tm_zone='$d_tm_tm_zone'
20607 d_tmpnam_r='$d_tmpnam_r'
20608 d_truncate='$d_truncate'
20609 d_ttyname_r='$d_ttyname_r'
20610 d_tzname='$d_tzname'
20611 d_u32align='$d_u32align'
20612 d_ualarm='$d_ualarm'
20615 d_union_semun='$d_union_semun'
20616 d_unordered='$d_unordered'
20617 d_usleep='$d_usleep'
20618 d_usleepproto='$d_usleepproto'
20620 d_vendorarch='$d_vendorarch'
20621 d_vendorbin='$d_vendorbin'
20622 d_vendorlib='$d_vendorlib'
20623 d_vendorscript='$d_vendorscript'
20625 d_void_closedir='$d_void_closedir'
20626 d_voidsig='$d_voidsig'
20627 d_voidtty='$d_voidtty'
20628 d_volatile='$d_volatile'
20629 d_vprintf='$d_vprintf'
20631 d_waitpid='$d_waitpid'
20632 d_wcstombs='$d_wcstombs'
20633 d_wctomb='$d_wctomb'
20634 d_writev='$d_writev'
20637 db_hashtype='$db_hashtype'
20638 db_prefixtype='$db_prefixtype'
20639 db_version_major='$db_version_major'
20640 db_version_minor='$db_version_minor'
20641 db_version_patch='$db_version_patch'
20642 defvoidused='$defvoidused'
20643 direntrytype='$direntrytype'
20646 doublesize='$doublesize'
20648 drand48_r_proto='$drand48_r_proto'
20649 dynamic_ext='$dynamic_ext'
20655 endgrent_r_proto='$endgrent_r_proto'
20656 endhostent_r_proto='$endhostent_r_proto'
20657 endnetent_r_proto='$endnetent_r_proto'
20658 endprotoent_r_proto='$endprotoent_r_proto'
20659 endpwent_r_proto='$endpwent_r_proto'
20660 endservent_r_proto='$endservent_r_proto'
20661 eunicefix='$eunicefix'
20664 extensions='$extensions'
20666 fflushNULL='$fflushNULL'
20667 fflushall='$fflushall'
20669 firstmakefile='$firstmakefile'
20671 fpossize='$fpossize'
20672 fpostype='$fpostype'
20673 freetype='$freetype'
20676 full_csh='$full_csh'
20677 full_sed='$full_sed'
20678 gccansipedantic='$gccansipedantic'
20679 gccosandvers='$gccosandvers'
20680 gccversion='$gccversion'
20681 getgrent_r_proto='$getgrent_r_proto'
20682 getgrgid_r_proto='$getgrgid_r_proto'
20683 getgrnam_r_proto='$getgrnam_r_proto'
20684 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20685 gethostbyname_r_proto='$gethostbyname_r_proto'
20686 gethostent_r_proto='$gethostent_r_proto'
20687 getlogin_r_proto='$getlogin_r_proto'
20688 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20689 getnetbyname_r_proto='$getnetbyname_r_proto'
20690 getnetent_r_proto='$getnetent_r_proto'
20691 getprotobyname_r_proto='$getprotobyname_r_proto'
20692 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20693 getprotoent_r_proto='$getprotoent_r_proto'
20694 getpwent_r_proto='$getpwent_r_proto'
20695 getpwnam_r_proto='$getpwnam_r_proto'
20696 getpwuid_r_proto='$getpwuid_r_proto'
20697 getservbyname_r_proto='$getservbyname_r_proto'
20698 getservbyport_r_proto='$getservbyport_r_proto'
20699 getservent_r_proto='$getservent_r_proto'
20700 getspnam_r_proto='$getspnam_r_proto'
20701 gidformat='$gidformat'
20707 gmtime_r_proto='$gmtime_r_proto'
20708 gnulibc_version='$gnulibc_version'
20710 groupcat='$groupcat'
20711 groupstype='$groupstype'
20714 h_sysfile='$h_sysfile'
20717 html1dir='$html1dir'
20718 html1direxp='$html1direxp'
20719 html3dir='$html3dir'
20720 html3direxp='$html3direxp'
20729 i_arpainet='$i_arpainet'
20730 i_bsdioctl='$i_bsdioctl'
20734 i_dirent='$i_dirent'
20740 i_fp_class='$i_fp_class'
20743 i_ieeefp='$i_ieeefp'
20744 i_inttypes='$i_inttypes'
20745 i_langinfo='$i_langinfo'
20746 i_libutil='$i_libutil'
20747 i_limits='$i_limits'
20748 i_locale='$i_locale'
20749 i_machcthr='$i_machcthr'
20750 i_malloc='$i_malloc'
20752 i_memory='$i_memory'
20753 i_mntent='$i_mntent'
20756 i_neterrno='$i_neterrno'
20757 i_netinettcp='$i_netinettcp'
20761 i_pthread='$i_pthread'
20763 i_rpcsvcdbm='$i_rpcsvcdbm'
20766 i_shadow='$i_shadow'
20768 i_stdarg='$i_stdarg'
20769 i_stddef='$i_stddef'
20770 i_stdlib='$i_stdlib'
20771 i_string='$i_string'
20772 i_sunmath='$i_sunmath'
20773 i_sysaccess='$i_sysaccess'
20774 i_sysdir='$i_sysdir'
20775 i_sysfile='$i_sysfile'
20776 i_sysfilio='$i_sysfilio'
20778 i_sysioctl='$i_sysioctl'
20779 i_syslog='$i_syslog'
20780 i_sysmman='$i_sysmman'
20781 i_sysmode='$i_sysmode'
20782 i_sysmount='$i_sysmount'
20783 i_sysndir='$i_sysndir'
20784 i_sysparam='$i_sysparam'
20785 i_sysresrc='$i_sysresrc'
20786 i_syssecrt='$i_syssecrt'
20787 i_sysselct='$i_sysselct'
20788 i_syssockio='$i_syssockio'
20789 i_sysstat='$i_sysstat'
20790 i_sysstatfs='$i_sysstatfs'
20791 i_sysstatvfs='$i_sysstatvfs'
20792 i_systime='$i_systime'
20793 i_systimek='$i_systimek'
20794 i_systimes='$i_systimes'
20795 i_systypes='$i_systypes'
20796 i_sysuio='$i_sysuio'
20798 i_sysutsname='$i_sysutsname'
20799 i_sysvfs='$i_sysvfs'
20800 i_syswait='$i_syswait'
20801 i_termio='$i_termio'
20802 i_termios='$i_termios'
20804 i_unistd='$i_unistd'
20807 i_values='$i_values'
20808 i_varargs='$i_varargs'
20809 i_varhdr='$i_varhdr'
20811 ignore_versioned_solibs='$ignore_versioned_solibs'
20812 inc_version_list='$inc_version_list'
20813 inc_version_list_init='$inc_version_list_init'
20816 installarchlib='$installarchlib'
20817 installbin='$installbin'
20818 installhtml1dir='$installhtml1dir'
20819 installhtml3dir='$installhtml3dir'
20820 installman1dir='$installman1dir'
20821 installman3dir='$installman3dir'
20822 installprefix='$installprefix'
20823 installprefixexp='$installprefixexp'
20824 installprivlib='$installprivlib'
20825 installscript='$installscript'
20826 installsitearch='$installsitearch'
20827 installsitebin='$installsitebin'
20828 installsitehtml1='$installsitehtml1'
20829 installsitehtml3='$installsitehtml3'
20830 installsitelib='$installsitelib'
20831 installsiteman1='$installsiteman1'
20832 installsiteman3='$installsiteman3'
20833 installsitescript='$installsitescript'
20834 installstyle='$installstyle'
20835 installusrbinperl='$installusrbinperl'
20836 installvendorarch='$installvendorarch'
20837 installvendorbin='$installvendorbin'
20838 installvendorhtml1='$installvendorhtml1'
20839 installvendorhtml3='$installvendorhtml3'
20840 installvendorlib='$installvendorlib'
20841 installvendorman1='$installvendorman1'
20842 installvendorman3='$installvendorman3'
20843 installvendorscript='$installvendorscript'
20845 issymlink='$issymlink'
20846 ivdformat='$ivdformat'
20849 known_extensions='$known_extensions'
20852 lddlflags='$lddlflags'
20854 ldflags_uselargefiles='$ldflags_uselargefiles'
20855 ldlibpthname='$ldlibpthname'
20862 libsdirs='$libsdirs'
20863 libsfiles='$libsfiles'
20864 libsfound='$libsfound'
20865 libspath='$libspath'
20866 libswanted='$libswanted'
20867 libswanted_uselargefiles='$libswanted_uselargefiles'
20873 localtime_r_proto='$localtime_r_proto'
20874 locincpth='$locincpth'
20875 loclibpth='$loclibpth'
20876 longdblsize='$longdblsize'
20877 longlongsize='$longlongsize'
20878 longsize='$longsize'
20882 lseeksize='$lseeksize'
20883 lseektype='$lseektype'
20887 make_set_make='$make_set_make'
20888 mallocobj='$mallocobj'
20889 mallocsrc='$mallocsrc'
20890 malloctype='$malloctype'
20892 man1direxp='$man1direxp'
20895 man3direxp='$man3direxp'
20897 mips_type='$mips_type'
20899 mmaptype='$mmaptype'
20900 modetype='$modetype'
20902 multiarch='$multiarch'
20904 myarchname='$myarchname'
20905 mydomain='$mydomain'
20906 myhostname='$myhostname'
20909 need_va_copy='$need_va_copy'
20910 netdb_hlen_type='$netdb_hlen_type'
20911 netdb_host_type='$netdb_host_type'
20912 netdb_name_type='$netdb_name_type'
20913 netdb_net_type='$netdb_net_type'
20916 nm_so_opt='$nm_so_opt'
20917 nonxs_ext='$nonxs_ext'
20919 nvEUformat='$nvEUformat'
20920 nvFUformat='$nvFUformat'
20921 nvGUformat='$nvGUformat'
20922 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20923 nveformat='$nveformat'
20924 nvfformat='$nvfformat'
20925 nvgformat='$nvgformat'
20928 o_nonblock='$o_nonblock'
20930 old_pthread_create_joinable='$old_pthread_create_joinable'
20931 optimize='$optimize'
20932 orderlib='$orderlib'
20935 otherlibdirs='$otherlibdirs'
20939 patchlevel='$patchlevel'
20940 path_sep='$path_sep'
20943 perl_patchlevel='$perl_patchlevel'
20944 perladmin='$perladmin'
20945 perllibs='$perllibs'
20946 perlpath='$perlpath'
20948 phostname='$phostname'
20951 pm_apiversion='$pm_apiversion'
20955 prefixexp='$prefixexp'
20957 privlibexp='$privlibexp'
20958 procselfexe='$procselfexe'
20959 prototype='$prototype'
20961 quadkind='$quadkind'
20962 quadtype='$quadtype'
20963 randbits='$randbits'
20964 randfunc='$randfunc'
20965 random_r_proto='$random_r_proto'
20966 randseedtype='$randseedtype'
20968 rd_nodata='$rd_nodata'
20969 readdir64_r_proto='$readdir64_r_proto'
20970 readdir_r_proto='$readdir_r_proto'
20971 revision='$revision'
20976 sPRIEUldbl='$sPRIEUldbl'
20977 sPRIFUldbl='$sPRIFUldbl'
20978 sPRIGUldbl='$sPRIGUldbl'
20979 sPRIXU64='$sPRIXU64'
20981 sPRIeldbl='$sPRIeldbl'
20982 sPRIfldbl='$sPRIfldbl'
20983 sPRIgldbl='$sPRIgldbl'
20988 sSCNfldbl='$sSCNfldbl'
20989 sched_yield='$sched_yield'
20990 scriptdir='$scriptdir'
20991 scriptdirexp='$scriptdirexp'
20993 seedfunc='$seedfunc'
20994 selectminbits='$selectminbits'
20995 selecttype='$selecttype'
20996 sendmail='$sendmail'
20997 setgrent_r_proto='$setgrent_r_proto'
20998 sethostent_r_proto='$sethostent_r_proto'
20999 setlocale_r_proto='$setlocale_r_proto'
21000 setnetent_r_proto='$setnetent_r_proto'
21001 setprotoent_r_proto='$setprotoent_r_proto'
21002 setpwent_r_proto='$setpwent_r_proto'
21003 setservent_r_proto='$setservent_r_proto'
21006 sharpbang='$sharpbang'
21007 shmattype='$shmattype'
21008 shortsize='$shortsize'
21011 sig_count='$sig_count'
21012 sig_name='$sig_name'
21013 sig_name_init='$sig_name_init'
21015 sig_num_init='$sig_num_init'
21016 sig_size='$sig_size'
21017 signal_t='$signal_t'
21018 sitearch='$sitearch'
21019 sitearchexp='$sitearchexp'
21021 sitebinexp='$sitebinexp'
21022 sitehtml1='$sitehtml1'
21023 sitehtml1exp='$sitehtml1exp'
21024 sitehtml3='$sitehtml3'
21025 sitehtml3exp='$sitehtml3exp'
21027 sitelib_stem='$sitelib_stem'
21028 sitelibexp='$sitelibexp'
21029 siteman1='$siteman1'
21030 siteman1exp='$siteman1exp'
21031 siteman3='$siteman3'
21032 siteman3exp='$siteman3exp'
21033 siteprefix='$siteprefix'
21034 siteprefixexp='$siteprefixexp'
21035 sitescript='$sitescript'
21036 sitescriptexp='$sitescriptexp'
21037 sizesize='$sizesize'
21038 sizetype='$sizetype'
21042 sockethdr='$sockethdr'
21043 socketlib='$socketlib'
21044 socksizetype='$socksizetype'
21046 spackage='$spackage'
21047 spitshell='$spitshell'
21048 srand48_r_proto='$srand48_r_proto'
21049 srandom_r_proto='$srandom_r_proto'
21051 ssizetype='$ssizetype'
21052 startperl='$startperl'
21054 static_ext='$static_ext'
21056 stdio_base='$stdio_base'
21057 stdio_bufsiz='$stdio_bufsiz'
21058 stdio_cnt='$stdio_cnt'
21059 stdio_filbuf='$stdio_filbuf'
21060 stdio_ptr='$stdio_ptr'
21061 stdio_stream_array='$stdio_stream_array'
21062 strerror_r_proto='$strerror_r_proto'
21065 subversion='$subversion'
21069 targetarch='$targetarch'
21073 timeincl='$timeincl'
21074 timetype='$timetype'
21075 tmpnam_r_proto='$tmpnam_r_proto'
21081 ttyname_r_proto='$ttyname_r_proto'
21090 uidformat='$uidformat'
21096 uquadtype='$uquadtype'
21097 use5005threads='$use5005threads'
21098 use64bitall='$use64bitall'
21099 use64bitint='$use64bitint'
21100 usecrosscompile='$usecrosscompile'
21102 useithreads='$useithreads'
21103 uselargefiles='$uselargefiles'
21104 uselongdouble='$uselongdouble'
21105 usemorebits='$usemorebits'
21106 usemultiplicity='$usemultiplicity'
21107 usemymalloc='$usemymalloc'
21109 useopcode='$useopcode'
21110 useperlio='$useperlio'
21111 useposix='$useposix'
21112 usereentrant='$usereentrant'
21114 useshrplib='$useshrplib'
21115 usesocks='$usesocks'
21116 usethreads='$usethreads'
21117 usevendorprefix='$usevendorprefix'
21118 usevfork='$usevfork'
21121 uvXUformat='$uvXUformat'
21122 uvoformat='$uvoformat'
21125 uvuformat='$uvuformat'
21126 uvxformat='$uvxformat'
21127 vendorarch='$vendorarch'
21128 vendorarchexp='$vendorarchexp'
21129 vendorbin='$vendorbin'
21130 vendorbinexp='$vendorbinexp'
21131 vendorhtml1='$vendorhtml1'
21132 vendorhtml1exp='$vendorhtml1exp'
21133 vendorhtml3='$vendorhtml3'
21134 vendorhtml3exp='$vendorhtml3exp'
21135 vendorlib='$vendorlib'
21136 vendorlib_stem='$vendorlib_stem'
21137 vendorlibexp='$vendorlibexp'
21138 vendorman1='$vendorman1'
21139 vendorman1exp='$vendorman1exp'
21140 vendorman3='$vendorman3'
21141 vendorman3exp='$vendorman3exp'
21142 vendorprefix='$vendorprefix'
21143 vendorprefixexp='$vendorprefixexp'
21144 vendorscript='$vendorscript'
21145 vendorscriptexp='$vendorscriptexp'
21147 version_patchlevel_string='$version_patchlevel_string'
21148 versiononly='$versiononly'
21150 voidflags='$voidflags'
21152 xs_apiversion='$xs_apiversion'
21154 yaccflags='$yaccflags'
21159 : Add in command line options if available
21160 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21162 : add special variables
21163 $test -f $src/patchlevel.h && \
21164 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21165 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21166 echo "PERL_CONFIG_SH=true" >>config.sh
21168 : propagate old symbols
21169 if $test -f UU/config.sh; then
21170 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21171 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21172 $sort | $uniq -u >UU/oldsyms
21173 set X `cat UU/oldsyms`
21179 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21181 echo "# Variables propagated from previous config.sh file." >>config.sh
21182 for sym in `cat UU/oldsyms`; do
21183 echo " Propagating $hint variable "'$'"$sym..."
21184 eval 'tmp="$'"${sym}"'"'
21186 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21192 : Finish up by extracting the .SH files
21196 echo "Extraction done."
21206 If you'd like to make any changes to the config.sh file before I begin
21207 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21210 rp="Press return or use a shell escape to edit config.sh:"
21215 *) : in case they cannot read
21216 sh 1>&4 -c "$ans";;
21221 : if this fails, just run all the .SH files by hand
21230 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21237 Now you need to generate make dependencies by running "$make depend".
21238 You might prefer to run it in background: "$make depend > makedepend.out &"
21239 It can take a while, so you might not want to run it right now.
21244 rp="Run $make depend now?"
21248 $make depend && echo "Now you must run '$make'."
21251 echo "You must run '$make depend' then '$make'."
21254 elif test -f [Mm]akefile; then
21256 echo "Now you must run a $make."
21258 echo "Configure done."
21261 if $test -f Policy.sh; then
21264 If you compile $package on a different machine or from a different object
21265 directory, copy the Policy.sh file from this object directory to the
21266 new one before you run Configure -- this will help you with most of
21267 the policy defaults.
21271 if $test -f config.msg; then
21272 echo "Hmm. I also noted the following information while running:"
21274 $cat config.msg >&4
21277 $rm -f kit*isdone ark*isdone