3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # Though this script was generated by metaconfig, it is OK to send
22 # patches against it. It's up to the Configure pumpkin to backport
23 # the patch to the metaunits if it is accepted.
24 # See Porting/pumpkin.pod for more information on metaconfig.
27 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
29 # Generated on Fri Mar 3 17:34:44 CET 2006 [metaconfig 3.0 PL70]
30 # (with additional metaconfig patches by perlbug@perl.org)
35 SCO csh still thinks true is false. Write to SCO today and tell them that next
36 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
38 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39 we'd have to do is go in and swap the && and || tokens, wherever they are.)
41 [End of diatribe. We now return you to your regularly scheduled programming...]
45 OOPS! You naughty creature! You didn't run Configure with sh!
46 I will attempt to remedy the situation by running sh for you...
50 true || exec sh $0 $argv:q
52 (exit $?0) || cat c2$$
53 (exit $?0) || exec sh $0 $argv:q
56 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
59 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61 *** Please read the README.plan9 for further instructions.
62 *** Cannot continue, aborting.
68 : compute my invocation name
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
77 : Proper separator for the PATH environment variable
79 : On OS/2 this directory should exist if this is not floppy only system :-]
80 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
95 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102 paths="$paths /sbin /usr/sbin /usr/libexec"
103 paths="$paths /system/gnu_library/bin"
107 case "$p_$PATH$p_" in
109 *) test -d $p && PATH=$PATH$p_$p ;;
116 : shall we be using ksh?
122 if (PATH=.; alias -x) >/dev/null 2>&1; then
125 if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
128 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
134 if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
141 case "$inksh/$needksh" in
148 case "$inksh/$avoidksh" in
154 case "$inksh/$needksh-$avoidksh-" in
157 (I see you are using the Korn shell. Some ksh's blow up on $me,
158 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
165 echo "(Feeding myself to $newsh $reason.)"
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
173 : if needed set CDPATH to a harmless value that is not chatty
174 : avoid bash 2.02 problems with empty CDPATH.
178 *bash*) CDPATH='.' ;;
183 : Configure runs within the UU subdirectory
184 test -d UU || mkdir UU
348 d_attribute_format=''
349 d_attribute_malloc=''
350 d_attribute_nonnull=''
351 d_attribute_noreturn=''
353 d_attribute_unused=''
354 d_attribute_warn_unused_result=''
357 d_builtin_choose_expr=''
403 endhostent_r_proto=''
409 endprotoent_r_proto=''
415 endservent_r_proto=''
467 gethostbyaddr_r_proto=''
469 gethostbyname_r_proto=''
471 gethostent_r_proto=''
483 getnetbyaddr_r_proto=''
485 getnetbyname_r_proto=''
499 d_getprotobyname_r=''
500 getprotobyname_r_proto=''
501 d_getprotobynumber_r=''
502 getprotobynumber_r_proto=''
504 getprotoent_r_proto=''
516 getservbyname_r_proto=''
518 getservbyport_r_proto=''
520 getservent_r_proto=''
544 d_libm_lib_version=''
557 d_malloc_good_size=''
599 d_old_pthread_create_joinable=''
600 old_pthread_create_joinable=''
602 d_pthread_attr_setscope=''
641 sethostent_r_proto=''
658 setprotoent_r_proto=''
670 setservent_r_proto=''
703 d_sprintf_returns_strlen=''
718 d_stdio_ptr_lval_nochange_cnt=''
719 d_stdio_ptr_lval_sets_cnt=''
923 inc_version_list_init=''
942 ignore_versioned_solibs=''
1002 d_perl_otherlibdirs=''
1010 api_versionstring=''
1016 version_patchlevel_string=''
1020 d_nv_preserves_uv=''
1021 d_nv_zero_is_allbits_zero=''
1032 nv_preserves_uv_bits=''
1103 installsitehtml1dir=''
1106 installsitehtml3dir=''
1113 installsiteman1dir=''
1116 installsiteman3dir=''
1121 installsitescript=''
1136 d_stdio_stream_array=''
1137 stdio_stream_array=''
1148 ccflags_uselargefiles=''
1149 ldflags_uselargefiles=''
1150 libswanted_uselargefiles=''
1160 userelocatableinc=''
1172 installvendorarch=''
1179 installvendorhtml1dir=''
1181 vendorhtml1direxp=''
1182 installvendorhtml3dir=''
1184 vendorhtml3direxp=''
1190 installvendorman1dir=''
1193 installvendorman3dir=''
1200 installvendorscript=''
1212 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1215 : We must find out about Eunice early
1217 if test -f /etc/unixtovms; then
1218 eunicefix=/etc/unixtovms
1220 if test -f /etc/unixtovms.exe; then
1221 eunicefix=/etc/unixtovms.exe
1224 : Set executable suffix now -- needed before hints available
1225 if test -f "/libs/version.library"; then
1228 elif test -f "/system/gnu_library/bin/ar.pm"; then
1231 elif test -n "$DJGPP"; then
1234 elif test -d c:/. -o -n "$is_os2" ; then
1243 : set useposix=false in your hint file to disable the POSIX extension.
1245 : set useopcode=false in your hint file to disable the Opcode extension.
1247 : Trailing extension. Override this in a hint file, if needed.
1248 : Extra object files, if any, needed on this platform.
1251 : Possible local include directories to search.
1252 : Set locincpth to "" in a hint file to defeat local include searches.
1253 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1254 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1256 : no include file wanted by default
1261 : change the next line if compiling for Xenix/286 on Xenix/386
1262 xlibpth='/usr/lib/386 /lib/386'
1263 : Possible local library directories to search.
1264 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1265 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1267 : general looking path for locating libraries
1268 glibpth="/lib /usr/lib $xlibpth"
1269 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1270 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1271 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1273 : Private path used by Configure to find libraries. Its value
1274 : is prepended to libpth. This variable takes care of special
1275 : machines, like the mips. Usually, it should be empty.
1278 : default library list
1280 : some systems want to use only the non-versioned libso:s
1281 ignore_versioned_solibs=''
1286 ccflags_uselargefiles=''
1287 ldflags_uselargefiles=''
1288 libswanted_uselargefiles=''
1289 : set usemultiplicity on the Configure command line to enable multiplicity.
1290 : set usesocks on the Configure command line to enable socks.
1291 : set usethreads on the Configure command line to enable threads.
1292 usereentrant='undef'
1293 : full support for void wanted by default
1296 : List of libraries we want.
1297 : If anyone needs extra -lxxx, put those in a hint file.
1298 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1299 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1300 : We probably want to search /usr/shlib before most other libraries.
1301 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1302 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1303 glibpth="/usr/shlib $glibpth"
1304 : Do not use vfork unless overridden by a hint file.
1307 : Find the basic shell for Bourne shell scripts
1311 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1314 if test -f "$xxx"; then
1317 : Build up a list and do a single loop so we can 'break' out.
1318 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1319 for xxx in sh bash ksh pdksh ash; do
1321 try="$try ${p}/${xxx}"
1325 if test -f "$xxx"; then
1328 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1331 elif test -f "$xxx.exe"; then
1342 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1344 Usually it's in /bin/sh. How did you even get this far?
1345 Please contact me (Perl Maintainers) at perlbug@perl.org and
1346 we'll try to straighten this all out.
1352 : see if sh knows # comments
1353 if `$sh -c '#' >/dev/null 2>&1`; then
1357 test -f $xcat$_exe || xcat=/usr/bin/cat
1358 if test ! -f $xcat$_exe; then
1359 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1360 if test -f $p/cat$_exe; then
1365 if test ! -f $xcat$_exe; then
1366 echo "Can't find cat anywhere!"
1370 echo "#!$xcat" >sharp
1374 if test -s today; then
1377 echo "#! $xcat" > sharp
1381 if test -s today; then
1389 echo "Your $sh doesn't grok # comments--I will strip them later on."
1392 echo "exec grep -v '^[ ]*#'" >spitshell
1394 $eunicefix spitshell
1395 spitshell=`pwd`/spitshell
1397 echo "I presume that if # doesn't work, #! won't work either!"
1402 : figure out how to guarantee sh startup
1404 '') startsh=${sharpbang}${sh} ;;
1416 : echo "Yup, it does."
1418 echo "Hmm... '$startsh' does not guarantee sh startup..."
1419 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1424 : Save command line options in file UU/cmdline.opt for later use in
1425 : generating config.sh.
1426 cat > cmdline.opt <<EOSH
1427 # Configure command line arguments.
1436 cat >>cmdline.opt <<EOSH
1437 config_arg$argn='$arg'
1439 # Extreme backslashitis: replace each ' by '"'"'
1440 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1443 arg_exp=`cat cmdl.opt`
1444 args_exp="$args_exp$args_sep'$arg_exp'"
1445 argn=`expr $argn + 1`
1448 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1449 # used by ./hints/os2.sh
1452 : produce awk script to parse command line options
1453 cat >options.awk <<'EOF'
1455 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1457 len = length(optstr);
1458 for (i = 1; i <= len; i++) {
1459 c = substr(optstr, i, 1);
1460 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1471 if (substr(str, 1, 1) != "-") {
1472 printf("'%s'\n", str);
1476 for (i = 2; i <= len; i++) {
1477 c = substr(str, i, 1);
1479 printf("-%s\n", substr(str, i));
1485 printf("'%s'\n", substr(str, i + 1));
1498 : process the command line options
1499 set X `for arg in "$@"; do echo "X$arg"; done |
1500 sed -e s/X// | awk -f options.awk`
1505 : set up default values
1515 rm -f optdef.sh posthint.sh
1516 cat >optdef.sh <<EOS
1522 while test $# -gt 0; do
1524 -d) shift; fastread=yes;;
1525 -e) shift; alldone=cont;;
1529 if test -r "$1"; then
1532 echo "$me: cannot read config file $1." >&2
1537 -h) shift; error=true;;
1538 -r) shift; reuseval=true;;
1539 -s) shift; silent=true; realsilent=true;;
1540 -E) shift; alldone=exit;;
1541 -K) shift; knowitall=true;;
1542 -O) shift; override=true;;
1543 -S) shift; silent=true; extractsh=true;;
1548 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1549 echo "$me: ignoring -D $1" >&2
1552 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1553 *) echo "$1='define'" >> optdef.sh;;
1560 *=) echo "$1" >> optdef.sh;;
1562 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1563 echo "$me: ignoring -U $1" >&2
1565 *) echo "$1='undef'" >> optdef.sh;;
1576 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1580 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1581 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1587 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1588 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1589 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1590 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1591 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1592 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1598 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1600 echo "$yyy=''" >> posthint.sh ;;
1605 echo "$yyy='$zzz'" >> posthint.sh ;;
1607 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1609 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1614 echo "$yyy=$zzz" >> posthint.sh ;;
1615 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1619 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1622 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1630 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1631 [-U symbol] [-U symbol=] [-A command:symbol...]
1632 -d : use defaults for all answers.
1633 -e : go on without questioning past the production of config.sh.
1634 -f : specify an alternate default configuration file.
1635 -h : print this help message and exit (with an error status).
1636 -r : reuse C symbols value if possible (skips costly nm extraction).
1637 -s : silent mode, only echoes questions and essential information.
1638 -D : define symbol to have some value:
1639 -D symbol symbol gets the value 'define'
1640 -D symbol=value symbol gets the value 'value'
1641 -E : stop at the end of questions, after having produced config.sh.
1642 -K : do not use unless you know what you are doing.
1643 -O : let -D and -U override definitions from loaded configuration file.
1644 -S : perform variable substitutions on all .SH files (can mix with -f)
1645 -U : undefine symbol:
1646 -U symbol symbol gets the value 'undef'
1647 -U symbol= symbol gets completely empty
1648 -A : manipulate symbol after the platform specific hints have been applied:
1649 -A symbol=value append " "value to symbol
1650 -A append:symbol=value append value to symbol
1651 -A define:symbol=value define symbol to have value
1652 -A clear:symbol define symbol to be ''
1653 -A define:symbol define symbol to be 'define'
1654 -A eval:symbol=value define symbol to be eval of value
1655 -A prepend:symbol=value prepend value to symbol
1656 -A undef:symbol define symbol to be 'undef'
1657 -A undef:symbol= define symbol to be ''
1658 -V : print version number and exit (with a zero status).
1665 case "$fastread$alldone" in
1668 case "$extractsh" in
1671 if test ! -t 0; then
1672 echo "Say 'sh Configure', not 'sh <Configure'"
1682 true) exec 1>/dev/null;;
1685 : run the defines and the undefines, if any, but leave the file out there...
1688 : create the posthint manipulation script and leave the file out there...
1693 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1694 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1695 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1696 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1697 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1700 : Some greps do not return status, grrr.
1701 echo "grimblepritz" >grimble
1702 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1704 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1710 : the following should work in any shell
1714 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1715 cat >contains <<'EOSS'
1716 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1721 : Find the path to the source tree
1724 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1728 *) src=`cd ../$src && pwd` ;;
1741 if test -f $rsrc/Configure && \
1742 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1744 : found it, so we are ok.
1747 for src in . .. ../.. ../../.. ../../../..; do
1748 if test -f ../$src/Configure && \
1749 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1760 Sorry, I can't seem to locate the source dir for $package. Please start
1761 Configure with an explicit path -- i.e. /some/path/Configure.
1769 echo "Sources for $package found in \"$src\"." >&4
1773 : script used to extract .SH files with variable substitutions
1774 cat >extract <<'EOS'
1776 echo "Doing variable substitutions on .SH files..."
1777 if test -f MANIFEST; then
1778 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1780 echo "(Looking for .SH files under the source directory.)"
1781 set x `(cd "$src"; find . -name "*.SH" -print)`
1785 0) set x `(cd "$src"; echo *.SH)`; shift;;
1787 if test ! -f "$src/$1"; then
1793 while test $name; do
1794 if test ! -d "$name"; then
1795 create="$name $create";
1796 name=`echo $name | sed -e "s|^[^/]*$||"`;
1797 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1802 for file in $create; do
1811 dir=`expr X$file : 'X\(.*\)/'`
1812 file=`expr X$file : 'X.*/\(.*\)'`
1813 (cd "$dir" && . ./$file)
1823 dir=`expr X$file : 'X\(.*\)/'`
1824 file=`expr X$file : 'X.*/\(.*\)'`
1825 (set x $dir; shift; eval $mkdir_p)
1826 sh <"$src/$dir/$file"
1835 if test -f "$src/config_h.SH"; then
1836 if test ! -f config.h; then
1837 : oops, they left it out of MANIFEST, probably, so do it anyway.
1838 . "$src/config_h.SH"
1843 : extract files and exit if asked to do so
1844 case "$extractsh" in
1846 case "$realsilent" in
1850 case "$config_sh" in
1851 '') config_sh='config.sh';;
1854 echo "Fetching answers from $config_sh..."
1857 test "$override" && . ./optdef.sh
1861 echo "Extraction done."
1866 : Eunice requires " " instead of "", can you believe it
1869 echo "Beginning of configuration questions for $package."
1871 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1873 : first determine how to suppress newline on echo command
1875 echo "Checking echo to see how to suppress newlines..."
1876 (echo "hi there\c" ; echo " ") >.echotmp
1877 if $contains c .echotmp >/dev/null 2>&1 ; then
1888 echo $n "The star should be here-->$c"
1892 : Now test for existence of everything in MANIFEST
1894 if test -f "$rsrc/MANIFEST"; then
1895 echo "First let's make sure your kit is complete. Checking..." >&4
1896 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1899 for filelist in x??; do
1900 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1902 if test -s missing; then
1906 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1908 You have the option of continuing the configuration process, despite the
1909 distinct possibility that your kit is damaged, by typing 'y'es. If you
1910 do, don't blame me if something goes wrong. I advise you to type 'n'o
1911 and contact the author (perlbug@perl.org).
1914 echo $n "Continue? [n] $c" >&4
1918 echo "Continuing..." >&4
1922 echo "ABORTING..." >&4
1927 echo "Looks good..."
1930 echo "There is no MANIFEST file. I hope your kit is complete !"
1935 : Find the appropriate value for a newline for tr
1936 if test -n "$DJGPP"; then
1939 if test X"$trnl" = X; then
1940 case "`echo foo|tr '\n' x 2>/dev/null`" in
1944 if test X"$trnl" = X; then
1945 case "`echo foo|tr '\012' x 2>/dev/null`" in
1946 foox) trnl='\012' ;;
1949 if test X"$trnl" = X; then
1950 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1951 fooxy) trnl='\n\r' ;;
1954 if test X"$trnl" = X; then
1957 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1963 : compute the number of columns on the terminal for proper question formatting
1968 : set up the echo used in my read
1969 myecho="case \"\$xxxm\" in
1970 '') echo $n \"\$rp $c\" >&4;;
1972 '') echo $n \"[\$xxxm] $c\";;
1974 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1976 echo $n \"[\$xxxm] $c\" >&4
1978 echo $n \"\$rp [\$xxxm] $c\" >&4
1984 : now set up to do reads with possible shell escape and default assignment
1990 case "\$fastread" in
1991 yes) case "\$dflt" in
1994 case "\$silent-\$rp" in
1999 *) case "\$silent" in
2000 true) case "\$rp" in
2005 while expr "X\$ans" : "X!" >/dev/null; do
2009 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2017 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2026 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2031 echo "(OK, I'll run with -d after this question.)" >&4
2034 echo "*** Sorry, \$1 not supported yet." >&4
2044 echo "*** Substitution done -- please confirm."
2046 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2051 echo "*** Error -- try again."
2058 case "\$ans\$xxxm\$nostick" in
2070 : create .config dir to save info across Configure sessions
2071 test -d ../.config || mkdir ../.config
2072 cat >../.config/README <<EOF
2073 This directory created by Configure to save information that should
2074 persist across sessions for $package.
2076 You may safely delete it if you wish.
2079 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2081 $define|true|[yY]*) ;;
2082 *) case "$xversion" in
2085 *** WHOA THERE!!! ***
2087 This is an UNSTABLE DEVELOPMENT release.
2088 The version of this $package distribution is $xversion, that is, odd,
2089 (as opposed to even) and that signifies a development release.
2090 If you want a maintenance release, you want an even-numbered version.
2092 Do ***NOT*** install this into production use.
2093 Data corruption and crashes are possible.
2095 It is most seriously suggested that you do not continue any further
2096 unless you want to help in developing and debugging Perl.
2098 If you *still* want to build perl, you can answer 'y' now,
2099 or pass -Dusedevel to Configure.
2102 rp='Do you really want to continue?'
2106 [yY]) echo >&4 "Okay, continuing."
2107 usedevel="$define" ;;
2108 *) echo >&4 "Okay, bye."
2118 case "$versiononly" in
2119 '') versiononly="$define" ;;
2121 case "$installusrbinperl" in
2122 '') installusrbinperl="$undef" ;;
2127 : general instructions
2130 user=`(logname) 2>/dev/null`
2132 '') user=`whoami 2>&1`;;
2134 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2137 rp='Would you like to see the instructions?'
2148 This installation shell script will examine your system and ask you questions
2149 to determine how the perl5 package should be installed. If you get
2150 stuck on a question, you may use a ! shell escape to start a subshell or
2151 execute a command. Many of the questions will have default answers in square
2152 brackets; typing carriage return will give you the default.
2154 On some of the questions which ask for file or directory names you are allowed
2155 to use the ~name construct to specify the login directory belonging to "name",
2156 even if you don't have a shell which knows about that. Questions where this is
2157 allowed will be marked "(~name ok)".
2161 dflt='Type carriage return to continue'
2165 The prompter used in this script allows you to use shell variables and
2166 backticks in your answers. You may use $1, $2, etc... to refer to the words
2167 in the default answer, as if the default line was a set of arguments given to a
2168 script shell. This means you may also use $* to repeat the whole default line,
2169 so you do not have to re-type everything to add something to the default.
2171 Everytime there is a substitution, you will have to confirm. If there is an
2172 error (e.g. an unmatched backtick), the default answer will remain unchanged
2173 and you will be prompted again.
2175 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2176 the questions and use the computed defaults (or the previous answers if there
2177 was already a config.sh file). Type 'Configure -h' for a list of options.
2178 You may also start interactively and then answer '& -d' at any prompt to turn
2179 on the non-interactive behaviour for the remainder of the execution.
2185 Much effort has been expended to ensure that this shell script will run on any
2186 Unix system. If despite that it blows up on yours, your best bet is to edit
2187 Configure and run it again. If you can't run Configure for some reason,
2188 you'll have to generate a config.sh file by hand. Whatever problems you
2189 have, let me (perlbug@perl.org) know how I blew it.
2191 This installation script affects things in two ways:
2193 1) it may do direct variable substitutions on some of the files included
2195 2) it builds a config.h file for inclusion in C programs. You may edit
2196 any of these files as the need arises after running this script.
2198 If you make a mistake on a question, there is no easy way to back up to it
2199 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2200 files. Configure will offer to let you do this before it runs the SH files.
2203 dflt='Type carriage return to continue'
2205 case "$firsttime" in
2206 true) echo $user >>../.config/instruct;;
2210 : find out where common programs are
2212 echo "Locating common programs..." >&4
2225 if test -d \$dir/\$thing; then
2231 for thisthing in \$dir/\$thing; do
2232 : just loop through to pick last item
2234 if test -f \$thisthing; then
2237 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2240 elif test -f \$dir/\$thing.exe; then
2241 if test -n "$DJGPP"; then
2242 echo \$dir/\$thing.exe
2243 elif test "$eunicefix" != ":"; then
2244 : on Eunice apparently
2298 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2299 pth="$pth /lib /usr/lib"
2300 for file in $loclist; do
2304 if test -f "$xxx"; then
2307 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2308 xxx=`./loc $file $file $pth`
2311 '') xxx=`./loc $file $file $pth`;;
2312 *) xxx=`./loc $xxx $xxx $pth`;;
2314 eval $file=$xxx$_exe
2318 echo $file is in $xxx.
2321 echo $file is in $xxx.
2324 echo "I don't know where '$file' is, and my life depends on it." >&4
2325 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2331 echo "Don't worry if any of the following aren't found..."
2333 for file in $trylist; do
2337 if test -f "$xxx"; then
2340 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2341 xxx=`./loc $file $file $pth`
2344 '') xxx=`./loc $file $file $pth`;;
2345 *) xxx=`./loc $xxx $xxx $pth`;;
2347 eval $file=$xxx$_exe
2351 echo $file is in $xxx.
2354 echo $file is in $xxx.
2357 echo "I don't see $file out there, $say."
2364 echo "Substituting grep for egrep."
2371 echo "Substituting cp for ln."
2380 echo "I can't find make or gmake, and my life depends on it." >&4
2381 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2389 *) # We can't have osname yet.
2390 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2391 # Assume that gmake, if found, is definitely GNU make
2392 # and prefer it over the system make.
2393 echo "Substituting gmake for make."
2401 echo "Hopefully test is built into your sh."
2404 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2405 echo "Using the test built into your sh."
2413 echo "Hopefully echo is built into your sh."
2418 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2419 $echo $n "hi there$c" >foo1
2420 echo $n "hi there$c" >foo2
2421 if cmp foo1 foo2 >/dev/null 2>&1; then
2422 echo "They are compatible. In fact, they may be identical."
2429 They are not compatible! You are probably running ksh on a non-USG system.
2430 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2431 have echo built in and we may have to run some Bourne shell scripts. That
2432 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2435 $echo $n "The star should be here-->$c"
2445 cat <<'EOSC' >>trygcc
2450 int main(int argc, char *argv[]) {
2454 if $cc -o try $ccflags $ldflags try.c; then
2457 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2463 case "`$cc -v -c try.c 2>&1`" in
2466 if $test X"$trygcc" = Xyes; then
2467 if gcc -o try -c try.c; then
2469 echo "You seem to have a working gcc, though." >&4
2470 rp="Would you like to use it?"
2472 if $test -f myread; then
2475 if $test -f UU/myread; then
2478 echo "Cannot find myread, sorry. Aborting." >&2
2483 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2484 if $test -f usethreads.cbu; then
2487 *** However, any setting of the C compiler flags (e.g. for thread support)
2488 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2489 *** (together with e.g. -Dusethreads).
2505 cat <<'EOSC' >>checkcc
2510 int main(int argc, char *argv[]) {
2514 if $cc -o try $ccflags $ldflags try.c; then
2517 if $test X"$despair" = Xyes; then
2518 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2521 You need to find a working C compiler.
2522 Either (purchase and) install the C compiler supplied by your OS vendor,
2523 or for a free C compiler try http://gcc.gnu.org/
2524 I cannot continue any further, aborting.
2533 : determine whether symbolic links are supported
2536 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2537 echo "Symbolic links are supported." >&4
2540 echo "Symbolic links are NOT supported." >&4
2545 : determine whether symbolic links are supported
2549 echo "Checking how to test for symbolic links..." >&4
2551 if $test "X$issymlink" = X; then
2553 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2554 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2556 if test $? = 0; then
2559 echo "Your builtin 'test -h' may be broken." >&4
2562 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2565 if test -f "$p/$test"; then
2574 echo "Trying external '$test -h'." >&4
2575 issymlink="$test -h"
2576 if $test ! -h sym >/dev/null 2>&1; then
2577 echo "External '$test -h' is broken, too." >&4
2585 if $test "X$issymlink" = X; then
2586 if $test -L sym 2>/dev/null; then
2587 issymlink="$test -L"
2588 echo "The builtin '$test -L' worked." >&4
2591 if $test "X$issymlink" != X; then
2592 echo "You can test for symbolic links with '$issymlink'." >&4
2594 echo "I do not know how you can test for symbolic links." >&4
2598 *) echo "No symbolic links, so not testing for their testing..." >&4
2604 case "$mksymlinks" in
2607 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2610 *) case "$lns:$issymlink" in
2611 *"ln"*" -s:"*"test -"?)
2612 echo "Creating the symbolic links..." >&4
2613 echo "(First creating the subdirectories...)" >&4
2615 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2617 test -z "$directory" && break
2621 if test ! -d t/base; then
2622 echo "Failed to create the subdirectories. Aborting." >&4
2625 echo "(Then creating the symlinks...)" >&4
2626 awk '{print $1}' $src/MANIFEST | while true; do
2628 test -z "$filename" && break
2629 if test -f $filename; then
2630 if $issymlink $filename; then
2634 if test -f $filename; then
2635 echo "$filename already exists, not symlinking."
2637 ln -s $src/$filename $filename
2641 if test ! -f t/base/lex.t; then
2642 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2647 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2656 case "$usecrosscompile" in
2658 $echo "Cross-compiling..."
2661 *-*-gcc) # A cross-compiling gcc, probably.
2662 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2664 # leave out ld, choosing it is more complex
2666 ranlib=$targetarch-ranlib
2667 $echo 'extern int foo;' > try.c
2668 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2670 if $test $# -gt 0; then
2672 incpth="`$echo $incpth|$sed 's/^ //'`"
2673 echo "Guessing incpth '$incpth'." >&4
2675 j="`$echo $i|$sed 's,/include$,/lib,'`"
2676 if $test -d $j; then
2680 libpth="`$echo $libpth|$sed 's/^ //'`"
2681 echo "Guessing libpth '$libpth'." >&4
2686 case "$targetarch" in
2687 '') echo "Targetarch not defined." >&4; croak=y ;;
2688 *) echo "Using targetarch $targetarch." >&4 ;;
2691 '') echo "Incpth not defined." >&4; croak=y ;;
2692 *) echo "Using incpth '$incpth'." >&4 ;;
2695 '') echo "Libpth not defined." >&4; croak=y ;;
2696 *) echo "Using libpth '$libpth'." >&4 ;;
2699 '') for i in $incpth; do
2700 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2702 echo "Guessing usrinc $usrinc." >&4
2707 '') echo "Usrinc not defined." >&4; croak=y ;;
2710 *) echo "Using usrinc $usrinc." >&4 ;;
2712 case "$targethost" in
2713 '') echo "Targethost not defined." >&4; croak=y ;;
2714 *) echo "Using targethost $targethost." >&4
2719 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2722 /*) run=$src/Cross/run
2723 targetmkdir=$src/Cross/mkdir
2725 from=$src/Cross/from
2727 *) pwd=`$test -f ../Configure & cd ..; pwd`
2729 targetmkdir=$pwd/Cross/mkdir
2731 from=$pwd/Cross/from
2734 case "$targetrun" in
2735 '') targetrun=ssh ;;
2740 case "$targetfrom" in
2741 '') targetfrom=scp ;;
2745 from=$from-$targetfrom
2746 case "$targetdir" in
2748 echo "Guessing targetdir $targetdir." >&4
2751 case "$targetuser" in
2753 echo "Guessing targetuser $targetuser." >&4
2756 case "$targetfrom" in
2760 case "$targetrun" in
2772 '') cwd=$targetdir ;;
2776 if $test ! -f \$exe.xok; then
2780 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2783 *) echo "Unknown targetrun '$targetrun'" >&4
2787 case "$targetmkdir" in
2789 cat >$targetmkdir <<EOF
2791 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2793 $chmod a+rx $targetmkdir
2795 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2807 $targetmkdir \`dirname \$f\`
2808 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2811 $targetmkdir $targetdir/\`dirname \$f\`
2812 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2825 $mkdir -p $targetdir/\`dirname \$f\`
2826 $cp \$f $targetdir/\$f || exit 1
2829 $targetmkdir $targetdir/\`dirname \$f\`
2830 $cp \$f $targetdir/\$f || exit 1
2837 *) echo "Unknown targetto '$targetto'" >&4
2841 case "$targetfrom" in
2848 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2853 cp) cat >$from <<EOF
2858 cp $targetdir/\$f . || exit 1
2863 *) echo "Unknown targetfrom '$targetfrom'" >&4
2867 if $test ! -f $run; then
2868 echo "Target 'run' script '$run' not found." >&4
2872 if $test ! -f $to; then
2873 echo "Target 'to' script '$to' not found." >&4
2877 if $test ! -f $from; then
2878 echo "Target 'from' script '$from' not found." >&4
2882 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2886 Using '$run' for remote execution,
2887 and '$from' and '$to'
2888 for remote file transfer.
2894 usecrosscompile='undef'
2899 : see whether [:lower:] and [:upper:] are supported character classes
2901 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2903 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2907 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2908 # (0xd9 and 0xe2), therefore that is a nice testing point.
2909 if test "X$up" = X -o "X$low" = X; then
2910 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2916 if test "X$up" = X -o "X$low" = X; then
2917 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2923 if test "X$up" = X -o "X$low" = X; then
2924 case "`echo RS | od -x 2>/dev/null`" in
2926 echo "Hey, this might be EBCDIC." >&4
2927 if test "X$up" = X -o "X$low" = X; then
2928 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2929 rs) up='[A-IJ-RS-Z]'
2934 if test "X$up" = X -o "X$low" = X; then
2935 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2945 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2947 echo "Using $up and $low to convert case." >&4
2950 echo "I don't know how to translate letters from upper to lower case." >&4
2951 echo "Your tr is not acting any way I know of." >&4
2955 : set up the translation script tr, must be called with ./tr of course
2959 '[A-Z][a-z]') exec $tr '$up' '$low';;
2960 '[a-z][A-Z]') exec $tr '$low' '$up';;
2967 : Try to determine whether config.sh was made on this system
2968 case "$config_sh" in
2970 myuname=`$uname -a 2>/dev/null`
2971 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2972 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2973 # because the A-Z/a-z are not consecutive.
2974 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2975 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2976 newmyuname="$myuname"
2978 case "$knowitall" in
2980 if test -f ../config.sh; then
2981 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2982 eval "`grep myuname= ../config.sh`"
2984 if test "X$myuname" = "X$newmyuname"; then
2992 : Get old answers from old config file if Configure was run on the
2993 : same system, otherwise use the hints.
2996 if test -f config.sh; then
2998 rp="I see a config.sh file. Shall I use it to set the defaults?"
3001 n*|N*) echo "OK, I'll ignore it."
3002 mv config.sh config.sh.old
3003 myuname="$newmyuname"
3005 *) echo "Fetching default answers from your old config.sh file..." >&4
3013 : Older versions did not always set $sh. Catch re-use of such
3023 if test ! -f config.sh; then
3026 First time through, eh? I have some defaults handy for some systems
3027 that need some extra help getting the Configure answers right:
3030 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3032 : Half the following guesses are probably wrong... If you have better
3033 : tests or hints, please send them to perlbug@perl.org
3034 : The metaconfig authors would also appreciate a copy...
3035 $test -f /irix && osname=irix
3036 $test -f /xenix && osname=sco_xenix
3037 $test -f /dynix && osname=dynix
3038 $test -f /dnix && osname=dnix
3039 $test -f /lynx.os && osname=lynxos
3040 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3041 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3042 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3043 $test -f /bin/mips && /bin/mips && osname=mips
3044 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3045 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3046 $test -d /usr/apollo/bin && osname=apollo
3047 $test -f /etc/saf/_sactab && osname=svr4
3048 $test -d /usr/include/minix && osname=minix
3049 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3050 if $test -d /MachTen -o -d /MachTen_Folder; then
3052 if $test -x /sbin/version; then
3053 osvers=`/sbin/version | $awk '{print $2}' |
3054 $sed -e 's/[A-Za-z]$//'`
3055 elif $test -x /usr/etc/version; then
3056 osvers=`/usr/etc/version | $awk '{print $2}' |
3057 $sed -e 's/[A-Za-z]$//'`
3063 $test -f /sys/posix.dll &&
3064 $test -f /usr/bin/what &&
3065 set X `/usr/bin/what /sys/posix.dll` &&
3066 $test "$3" = UWIN &&
3070 if $test -f $uname; then
3078 umips) osname=umips ;;
3081 [23]100) osname=mips ;;
3082 next*) osname=next ;;
3084 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3085 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3088 elif $test -f /etc/kconfig; then
3090 if test "$lns" = "$ln -s"; then
3092 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3094 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3101 if test -n "$DJGPP"; then
3110 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3112 # oslevel can fail with:
3113 # oslevel: Unable to acquire lock.
3114 *not\ found) osvers="$4"."$3" ;;
3115 '<3240'|'<>3240') osvers=3.2.0 ;;
3116 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3117 '=3250'|'>3250') osvers=3.2.5 ;;
3121 bsd386) osname=bsd386
3124 cygwin*) osname=cygwin
3127 *dc.osx) osname=dcosx
3133 domainos) osname=apollo
3139 dragonfly) osname=dragonfly
3142 dynixptx*) osname=dynixptx
3143 osvers=`echo "$4"|sed 's/^v//'`
3145 freebsd) osname=freebsd
3147 genix) osname=genix ;;
3151 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3167 netbsd*) osname=netbsd
3170 news-os) osvers="$3"
3172 4*) osname=newsos4 ;;
3176 next*) osname=next ;;
3177 nonstop-ux) osname=nonstopux ;;
3178 openbsd) osname=openbsd
3184 POSIX-BC | posix-bc ) osname=posix-bc
3187 powerux | power_ux | powermax_os | powermaxos | \
3188 powerunix | power_unix) osname=powerux
3194 solaris) osname=solaris
3196 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3203 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3207 titanos) osname=titanos
3216 ultrix) osname=ultrix
3219 osf1|mls+) case "$5" in
3222 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3225 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3228 hp*) osname=hp_osf1 ;;
3229 mips) osname=mips_osf1 ;;
3232 # UnixWare 7.1.2 is known as Open UNIX 8
3233 openunix|unixware) osname=svr5
3241 $2) case "$osname" in
3245 : svr4.x or possibly later
3255 if test -f /stand/boot ; then
3256 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3257 if test -n "$INITPROG" -a -f "$INITPROG"; then
3258 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3259 if test -n "$isesix"; then
3267 *) if test -f /etc/systemid; then
3269 set `echo $3 | $sed 's/\./ /g'` $4
3270 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3272 elif $test -f $src/hints/sco_$1_$2.sh; then
3274 elif $test -f $src/hints/sco_$1.sh; then
3279 '') : Still unknown. Probably a generic Sys V.
3288 *) case "$osname" in
3289 '') : Still unknown. Probably a generic BSD.
3297 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3298 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3299 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3302 $rm -f UU/kernel.what
3303 elif test -d c:/. -o -n "$is_os2" ; then
3310 case "$targetarch" in
3313 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3318 : Now look for a hint file osname_osvers, unless one has been
3319 : specified already.
3322 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3323 : Also try without trailing minor version numbers.
3324 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3325 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3326 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3327 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3330 *) case "$osvers" in
3333 *) if $test -f $src/hints/$file.sh ; then
3335 elif $test -f $src/hints/$xfile.sh ; then
3337 elif $test -f $src/hints/$xxfile.sh ; then
3339 elif $test -f $src/hints/$xxxfile.sh ; then
3341 elif $test -f $src/hints/$xxxxfile.sh ; then
3343 elif $test -f "$src/hints/${osname}.sh" ; then
3352 if $test -f Policy.sh ; then
3355 none) dflt="Policy" ;;
3356 *) dflt="Policy $dflt" ;;
3361 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3365 if $test -f Policy.sh ; then
3368 There's also a Policy hint file available, which should make the
3369 site-specific (policy) questions easier to answer.
3376 You may give one or more space-separated answers, or "none" if appropriate.
3377 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3378 is a good thing. DO NOT give a wrong version or a wrong OS.
3382 rp="Which of these apply, if any?"
3385 for file in $tans; do
3386 if $test X$file = XPolicy -a -f Policy.sh; then
3388 $cat Policy.sh >> UU/config.sh
3389 elif $test -f $src/hints/$file.sh; then
3390 . $src/hints/$file.sh
3391 $cat $src/hints/$file.sh >> UU/config.sh
3392 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3395 : Give one chance to correct a possible typo.
3396 echo "$file.sh does not exist"
3398 rp="hint to use instead?"
3400 for file in $ans; do
3401 if $test -f "$src/hints/$file.sh"; then
3402 . $src/hints/$file.sh
3403 $cat $src/hints/$file.sh >> UU/config.sh
3404 elif $test X$ans = X -o X$ans = Xnone ; then
3407 echo "$file.sh does not exist -- ignored."
3414 : Remember our hint file for later.
3415 if $test -f "$src/hints/$file.sh" ; then
3425 echo "Fetching default answers from $config_sh..." >&4
3429 cp $config_sh config.sh 2>/dev/null
3439 test "$override" && . ./optdef.sh
3441 : Restore computed paths
3442 for file in $loclist $trylist; do
3443 eval $file="\$_$file"
3448 Configure uses the operating system name and version to set some defaults.
3449 The default value is probably right if the name rings a bell. Otherwise,
3450 since spelling matters for me, either accept the default or answer "none"
3457 ''|' '|none) dflt=none ;;
3458 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3461 *) dflt="$osname" ;;
3463 rp="Operating system name?"
3467 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3473 ''|' '|none) dflt=none ;;
3474 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3475 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3477 ''|' ') dflt=none ;;
3482 *) dflt="$osvers" ;;
3484 rp="Operating system version?"
3494 : who configured the system
3495 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3498 cf_by=`(logname) 2>/dev/null`
3501 cf_by=`(whoami) 2>/dev/null`
3503 "") cf_by=unknown ;;
3508 : set up the script used to warn in case of inconsistency
3515 echo "*** WHOA THERE!!! ***" >&4
3516 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3517 rp=" Keep the $hint value?"
3520 y) td=$was; tu=$was;;
3524 : function used to set $1 to $val
3525 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3527 $define$undef) . ./whoa; eval "$var=\$td";;
3528 $undef$define) . ./whoa; eval "$var=\$tu";;
3529 *) eval "$var=$val";;
3533 $define|true|[yY]*) dflt='y';;
3538 Perl can be built to use the SOCKS proxy protocol library. To do so,
3539 Configure must be run with -Dusesocks. If you use SOCKS you also need
3540 to use the PerlIO abstraction layer, this will be implicitly selected.
3542 If this doesn't make any sense to you, just accept the default '$dflt'.
3544 rp='Build Perl for SOCKS?'
3547 y|Y) val="$define" ;;
3554 $define|true|[yY]*) dflt='y';;
3559 Would you like to build with Misc Attribute Decoration? This is development
3560 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
3561 overhead on the interpreter.
3563 If this doesn't make any sense to you, just accept the default '$dflt'.
3565 rp='Build Perl with MAD?'
3568 y|Y) val="$define" ;;
3575 $define|true|[yY]*) useperlio="$define";;
3578 case "$useperlio" in
3579 $define|true|[yY]*|'') dflt='y';;
3584 Previous version of $package used the standard IO mechanisms as
3585 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3586 alternate IO mechanisms via the PerlIO abstraction layer, but the
3587 stdio mechanism is still available if needed. The abstraction layer
3588 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3589 Using PerlIO with sfio may cause problems with some extension modules.
3591 If this doesn't make any sense to you, just accept the default '$dflt'.
3593 rp='Use the PerlIO abstraction layer?'
3600 echo "Ok, doing things the stdio way."
3609 case "$useperlio" in
3610 $define|true|[yY]*) ;;
3613 You are using the SOCKS proxy protocol library which means that you
3614 should also use the PerlIO layer. You may be headed for trouble.
3623 case "$usethreads" in
3624 $define|true|[yY]*) dflt='y';;
3625 *) # Catch case where user specified ithreads or 5005threads but
3626 # forgot -Dusethreads (A.D. 4/2002)
3627 case "$useithreads$use5005threads" in
3629 case "$useperlio" in
3630 "$define") dflt='y' ;;
3640 Perl can be built to take advantage of threads on some systems.
3641 To do so, Configure can be run with -Dusethreads.
3643 Note that Perl built with threading support runs slightly slower
3644 and uses more memory than plain Perl. The current implementation
3645 is believed to be stable, but it is fairly new, and so should be
3646 treated with caution.
3648 If this doesn't make any sense to you, just accept the default '$dflt'.
3650 rp='Build a threading Perl?'
3653 y|Y) val="$define" ;;
3659 case "$usethreads" in
3663 Since release 5.6, Perl has had two different threading implementations,
3664 the newer interpreter-based version (ithreads) with one interpreter per
3665 thread, and the older 5.005 version (5005threads).
3666 The 5005threads version is effectively unmaintained and will probably be
3667 removed in Perl 5.10, so there should be no need to build a Perl using it
3668 unless needed for backwards compatibility with some existing 5.005threads
3672 : Default to ithreads unless overridden on command line or with
3675 case "$use5005threads" in
3676 $define|true|[yY]*) dflt='n';;
3678 case "$useithreads" in
3679 $undef|false|[nN]*) dflt='n';;
3681 rp='Use the newer interpreter-based ithreads?'
3684 y|Y) val="$define" ;;
3689 : Now set use5005threads to the opposite value.
3690 case "$useithreads" in
3691 $define) val="$undef" ;;
3698 useithreads="$undef"
3699 use5005threads="$undef"
3703 case "$useithreads$use5005threads" in
3707 You cannot have both the ithreads and the 5.005 threads enabled
3708 at the same time. Disabling the 5.005 threads since they are
3709 much less stable than the ithreads.
3712 use5005threads="$undef"
3716 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3719 *** To build with ithreads you must also use the PerlIO layer.
3720 *** Cannot continue, aborting.
3726 case "$d_oldpthreads" in
3727 '') : Configure tests would be welcome here. For now, assume undef.
3729 *) val="$d_oldpthreads" ;;
3735 : Look for a hint-file generated 'call-back-unit'. If the
3736 : user has specified that a threading perl is to be built,
3737 : we may need to set or change some other defaults.
3738 if $test -f usethreads.cbu; then
3739 echo "Your platform has some specific hints regarding threaded builds, using them..."
3742 case "$usethreads" in
3743 "$define"|true|[yY]*)
3745 (Your platform does not have any specific hints for threaded builds.
3746 Assuming POSIX threads, then.)
3754 Perl can be built so that multiple Perl interpreters can coexist
3755 within the same Perl executable.
3758 case "$useithreads" in
3761 This multiple interpreter support is required for interpreter-based threads.
3765 *) case "$usemultiplicity" in
3766 $define|true|[yY]*) dflt='y';;
3770 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3771 rp='Build Perl for multiplicity?'
3774 y|Y) val="$define" ;;
3783 case "$usemorebits" in
3784 "$define"|true|[yY]*)
3785 use64bitint="$define"
3786 uselongdouble="$define"
3787 usemorebits="$define"
3789 *) usemorebits="$undef"
3793 : make some quick guesses about what we are up against
3795 $echo $n "Hmm... $c"
3805 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3806 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3808 echo "Looks kind of like an OSF/1 system, but we'll see..."
3810 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3811 xxx=`./loc addbib blurfl $pth`
3812 if $test -f $xxx; then
3813 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3817 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3818 echo "Looks kind of like an extended USG system, but we'll see..."
3820 echo "Looks kind of like a USG system, but we'll see..."
3824 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3825 echo "Looks kind of like a BSD system, but we'll see..."
3829 echo "Looks kind of like a Version 7 system, but we'll see..."
3832 case "$eunicefix" in
3835 There is, however, a strange, musty smell in the air that reminds me of
3836 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3840 : it so happens the Eunice I know will not run shell scripts in Unix format
3844 echo "Congratulations. You aren't running Eunice."
3848 : Detect OS2. The p_ variable is set above in the Head.U unit.
3849 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3850 : semicolon as a patch separator
3855 I have the feeling something is not exactly right, however...don't tell me...
3856 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3857 (Or you may be running DOS with DJGPP.)
3862 if test -f /xenix; then
3863 echo "Actually, this looks more like a XENIX system..."
3868 echo "It's not Xenix..."
3873 if test -f /venix; then
3874 echo "Actually, this looks more like a VENIX system..."
3881 echo "Nor is it Venix..."
3884 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3885 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3892 rp="Use which C compiler?"
3896 : See if they have not cc but they do have gcc
3898 : Look for a hint-file generated 'call-back-unit'. Now that the
3899 : user has specified the compiler, we may need to set or change some
3901 if $test -f cc.cbu; then
3907 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3913 printf("%s\n", __VERSION__);
3915 printf("%s\n", "1");
3921 if $cc -o try $ccflags $ldflags try.c; then
3922 gccversion=`$run ./try`
3923 case "$gccversion" in
3924 '') echo "You are not using GNU cc." ;;
3925 *) echo "You are using GNU cc $gccversion."
3931 echo "*** WHOA THERE!!! ***" >&4
3932 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3933 case "$knowitall" in
3935 echo " You'd better start hunting for one and let me know about it." >&4
3941 case "$gccversion" in
3942 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3944 case "$gccversion" in
3945 '') gccosandvers='' ;;
3946 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3947 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3949 case "$gccosandvers" in
3950 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3951 $osname$osvers) ;; # looking good
3952 $osname*) cat <<EOM >&4
3954 *** WHOA THERE!!! ***
3956 Your gcc has not been compiled for the exact release of
3957 your operating system ($gccosandvers versus $osname$osvers).
3959 In general it is a good idea to keep gcc synchronized with
3960 the operating system because otherwise serious problems
3961 may ensue when trying to compile software, like Perl.
3963 I'm trying to be optimistic here, though, and will continue.
3964 If later during the configuration and build icky compilation
3965 problems appear (headerfile conflicts being the most common
3966 manifestation), I suggest reinstalling the gcc to match
3967 your operating system release.
3971 *) gccosandvers='' ;; # failed to parse, better be silent
3979 # gcc 3.* complain about adding -Idirectories that they already know about,
3980 # so we will take those off from locincpth.
3981 case "$gccversion" in
3983 echo "main(){}">try.c
3984 for incdir in $locincpth; do
3985 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3986 grep '^c[cp]p*[01]: warning: changing search order '`
3987 if test "X$warn" != X; then
3988 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3994 : decide how portable to be. Allow command line overrides.
3995 case "$d_portable" in
3997 *) d_portable="$define" ;;
4000 : set up shell script to do ~ expansion
4006 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
4009 if $test -f /bin/csh; then
4010 /bin/csh -f -c "glob \$1"
4015 name=\`$expr x\$1 : '..\([^/]*\)'\`
4016 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
4017 if $test ! -d "\$dir"; then
4019 echo "\$me: can't locate home directory for: \$name" >&2
4024 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
4040 : now set up to get a file name
4044 cat <<'EOSC' >>getfile
4060 : getfile will accept an answer from the comma-separated list
4061 : enclosed in parentheses even if it does not meet other criteria.
4062 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4063 fn=`echo $fn | sed 's/(.*)//'`
4069 loc_file=`expr $fn : '.*:\(.*\)'`
4070 fn=`expr $fn : '\(.*\):.*'`
4078 */*) fullpath=true;;
4087 *e*) exp_file=true;;
4090 *p*) nopath_ok=true;;
4095 *d*) type='Directory';;
4096 *l*) type='Locate';;
4101 Locate) what='File';;
4106 case "$d_portable" in
4114 while test "$type"; do
4119 true) rp="$rp (~name ok)";;
4122 if test -f UU/getfile.ok && \
4123 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4142 value=`UU/filexp $ans`
4145 if test "$ans" != "$value"; then
4146 echo "(That expands to $value on this system.)"
4160 /*) value="$ansexp" ;;
4161 [a-zA-Z]:/*) value="$ansexp" ;;
4166 echo "I shall only accept a full path name, as in /bin/ls." >&4
4167 echo "Use a ! shell escape if you wish to check pathnames." >&4
4170 echo "Please give a full path name, starting with slash." >&4
4173 echo "Note that using ~name is ok provided it expands well." >&4
4186 for fp in $gfpth; do
4187 if test "X$fp" = X.; then
4192 if test -f "$pf"; then
4194 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4196 echo "($value is not a plain file, but that's ok.)"
4199 if test X"$type" = X; then
4206 for fp in $gfpth; do
4207 if test "X$fp" = X.; then
4212 direxp="$fp/$ansexp"
4214 if test -d "$direxp"; then
4222 if test -d "$ansexp"; then
4223 echo "(Looking for $loc_file in directory $value.)"
4224 value="$value/$loc_file"
4225 ansexp="$ansexp/$loc_file"
4227 if test -f "$ansexp"; then
4230 case "$nopath_ok" in
4231 true) case "$value" in
4233 *) echo "Assuming $value will be in people's path."
4249 if test "$fastread" = yes; then
4254 rp="$what $value doesn't exist. Use that name anyway?"
4273 test "X$gfpthkeep" != Xy && gfpth=""
4276 : What should the include directory be ?
4278 $echo $n "Hmm... $c"
4282 if $test -f /bin/mips && /bin/mips; then
4283 echo "Looks like a MIPS system..."
4284 $cat >usr.c <<'EOCP'
4285 #ifdef SYSTYPE_BSD43
4289 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4290 dflt='/bsd43/usr/include'
4294 mips_type='System V'
4296 $rm -f usr.c usr.out
4297 echo "and you're compiling with the $mips_type compiler and libraries."
4301 echo "Doesn't look like a MIPS system."
4311 case "$xxx_prompt" in
4314 rp='Where are the include files you want to use?'
4322 : see how we invoke the C preprocessor
4324 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4325 cat <<'EOT' >testcpp.c
4331 if test ! -f cppstdin; then
4332 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4333 # AIX cc -E doesn't show the absolute headerfile
4334 # locations but we'll cheat by using the -M flag.
4335 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
4337 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4340 echo "Keeping your $hint cppstdin wrapper."
4343 wrapper=`pwd`/cppstdin
4347 if $test "X$cppstdin" != "X" && \
4348 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4349 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4351 echo "You used to use $cppstdin $cppminus so we'll use that again."
4353 '') echo "But let's see if we can live without a wrapper..." ;;
4355 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4356 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4358 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4361 echo "(However, $cpprun $cpplast does not work, let's see...)"
4369 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4376 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4377 $cc -E <testcpp.c >testcpp.out 2>&1; \
4378 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4379 echo "Yup, it does."
4382 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4383 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4384 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4385 echo "Yup, it does."
4388 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4389 $cc -P <testcpp.c >testcpp.out 2>&1; \
4390 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4391 echo "Yipee, that works!"
4394 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4395 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4396 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4397 echo "At long last!"
4400 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4401 $cpp <testcpp.c >testcpp.out 2>&1; \
4402 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4406 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4407 $cpp - <testcpp.c >testcpp.out 2>&1; \
4408 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4409 echo "Hooray, it works! I was beginning to wonder."
4412 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4413 $wrapper <testcpp.c >testcpp.out 2>&1; \
4414 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4420 rp="No dice. I can't find a C preprocessor. Name one:"
4424 $x_cpp <testcpp.c >testcpp.out 2>&1
4425 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4426 echo "OK, that will do." >&4
4428 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4443 echo "Perhaps can we force $cc -E using a wrapper..."
4444 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4445 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4451 echo "Nope, we'll have to live without it..."
4465 "$wrapper"|'cppstdin') ;;
4466 *) $rm -f $wrapper;;
4468 $rm -f testcpp.c testcpp.out
4470 : Set private lib path
4473 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4478 '') dlist="$loclibpth $plibpth $glibpth";;
4479 *) dlist="$libpth";;
4482 : Now check and see which directories actually exist, avoiding duplicates
4486 if $test -d $xxx; then
4489 *) libpth="$libpth $xxx";;
4495 Some systems have incompatible or broken versions of libraries. Among
4496 the directories listed in the question below, please remove any you
4497 know not to be holding relevant libraries, and add any that are needed.
4498 Say "none" for none.
4509 rp="Directories to use for library searches?"
4516 : compute shared library extension
4519 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4529 On some systems, shared libraries may be available. Answer 'none' if
4530 you want to suppress searching of shared libraries for the remainder
4531 of this configuration.
4534 rp='What is the file extension used for shared libraries?'
4538 : Define several unixisms.
4539 : Hints files or command line option can be used to override them.
4540 : The convoluted testing is in case hints files set either the old
4543 '') case "$exe_ext" in
4545 *) _exe="$exe_ext" ;;
4550 '') case "$lib_ext" in
4557 '') case "$obj_ext" in
4564 '') case "$path_sep" in
4575 : Which makefile gets called first. This is used by make depend.
4576 case "$firstmakefile" in
4577 '') firstmakefile='makefile';;
4581 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4584 case "$uselongdouble" in
4585 $define|true|[yY]*) dflt='y';;
4590 Perl can be built to take advantage of long doubles which
4591 (if available) may give more accuracy and range for floating point numbers.
4593 If this doesn't make any sense to you, just accept the default '$dflt'.
4595 rp='Try to use long doubles if available?'
4598 y|Y) val="$define" ;;
4604 case "$uselongdouble" in
4605 true|[yY]*) uselongdouble="$define" ;;
4608 : Look for a hint-file generated 'call-back-unit'. If the
4609 : user has specified that long doubles should be used,
4610 : we may need to set or change some other defaults.
4611 if $test -f uselongdouble.cbu; then
4612 echo "Your platform has some specific hints regarding long doubles, using them..."
4613 . ./uselongdouble.cbu
4615 case "$uselongdouble" in
4618 (Your platform does not have any specific hints for long doubles.)
4624 : Looking for optional libraries
4626 echo "Checking for optional libraries..." >&4
4631 case "$libswanted" in
4632 '') libswanted='c_s';;
4635 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4641 for thisdir in $libpth $xlibpth; do
4642 test -d $thisdir && libspath="$libspath $thisdir"
4644 for thislib in $libswanted; do
4645 for thisdir in $libspath; do
4647 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4648 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4649 $test -f "$xxx" && eval $libscheck
4650 $test -f "$xxx" && libstyle=shared
4652 if test ! -f "$xxx"; then
4653 xxx=$thisdir/lib$thislib.$so
4654 $test -f "$xxx" && eval $libscheck
4655 $test -f "$xxx" && libstyle=shared
4657 if test ! -f "$xxx"; then
4658 xxx=$thisdir/lib$thislib$_a
4659 $test -f "$xxx" && eval $libscheck
4660 $test -f "$xxx" && libstyle=static
4662 if test ! -f "$xxx"; then
4663 xxx=$thisdir/$thislib$_a
4664 $test -f "$xxx" && eval $libscheck
4665 $test -f "$xxx" && libstyle=static
4667 if test ! -f "$xxx"; then
4668 xxx=$thisdir/lib${thislib}_s$_a
4669 $test -f "$xxx" && eval $libscheck
4670 $test -f "$xxx" && libstyle=static
4671 $test -f "$xxx" && thislib=${thislib}_s
4673 if test ! -f "$xxx"; then
4674 xxx=$thisdir/Slib$thislib$_a
4675 $test -f "$xxx" && eval $libscheck
4676 $test -f "$xxx" && libstyle=static
4678 if $test -f "$xxx"; then
4680 shared) echo "Found -l$thislib (shared)." ;;
4681 static) echo "Found -l$thislib." ;;
4682 *) echo "Found -l$thislib ($libstyle)." ;;
4686 *) dflt="$dflt -l$thislib"
4687 libsfound="$libsfound $xxx"
4689 libsfiles="$libsfiles $yyy"
4690 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4691 case " $libsdirs " in
4693 *) libsdirs="$libsdirs $yyy" ;;
4700 if $test ! -f "$xxx"; then
4701 echo "No -l$thislib."
4712 ' '|'') dflt='none';;
4717 In order to compile $package on your machine, a number of libraries
4718 are usually needed. Include any other special libraries here as well.
4719 Say "none" for none. The default list is almost always right.
4723 rp="What libraries to use?"
4730 : determine optimization, if desired, or use for debug flag also
4732 ' '|$undef) dflt='none';;
4734 *) dflt="$optimize";;
4738 By default, $package compiles with the -O flag to use the optimizer.
4739 Alternately, you might want to use the symbolic debugger, which uses
4740 the -g flag (on traditional Unix systems). Either flag can be
4741 specified here. To use neither flag, specify the word "none".
4744 rp="What optimizer/debugger flag should be used?"
4748 'none') optimize=" ";;
4752 : We will not override a previous value, but we might want to
4753 : augment a hint file
4755 default|recommended)
4756 case "$gccversion" in
4757 1*) dflt='-fpcc-struct-return' ;;
4760 *-g*) dflt="$dflt -DDEBUGGING";;
4762 case "$gccversion" in
4763 2*) if test -d /etc/conf/kconfig.d &&
4764 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4766 # Interactive Systems (ISC) POSIX mode.
4771 case "$gccversion" in
4775 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4776 echo 'int main(void) { return 0; }' > gcctest.c
4777 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4778 echo "Yes, it does." 2>&1
4781 echo "Leaving current flags $ccflags alone." 2>&1
4783 *) dflt="$dflt -fno-strict-aliasing" ;;
4786 echo "Nope, it doesn't, but that's ok." 2>&1
4790 # For gcc, adding -pipe speeds up compilations for some, but apparently
4791 # some assemblers can't read from stdin. (It also slows down compilations
4792 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4793 case "$gccversion" in
4795 echo "Checking if your compiler accepts -pipe" 2>&1
4796 echo 'int main(void) { return 0; }' > gcctest.c
4797 if $cc -pipe -o gcctest gcctest.c; then
4798 echo "Yes, it does." 2>&1
4801 echo "Leaving current flags $ccflags alone." 2>&1
4803 *) dflt="$dflt -pipe" ;;
4806 echo "Nope, it doesn't, but that's ok." 2>&1
4809 echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
4810 echo 'int main(void) { return 0; }' > gcctest.c
4811 if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
4812 echo "Yes, it does." 2>&1
4814 *-Wdeclaration-after-statement*)
4815 echo "Leaving current flags $ccflags alone." 2>&1
4817 *) dflt="$dflt -Wdeclaration-after-statement" ;;
4820 echo "Nope, it doesn't, but that's ok." 2>&1
4827 case "$mips_type" in
4828 *BSD*|'') inclwanted="$locincpth $usrinc";;
4829 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4831 for thisincl in $inclwanted; do
4832 if $test -d $thisincl; then
4833 if $test x$thisincl != x$usrinc; then
4835 *" -I$thisincl "*);;
4836 *) dflt="$dflt -I$thisincl ";;
4842 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4844 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4852 *) dflt="$dflt -D$2";;
4856 set signal.h LANGUAGE_C; eval $inctest
4860 ccflags="$ccflags -DSOCKS"
4865 default|recommended) dflt="$ccflags $dflt" ;;
4866 *) dflt="$ccflags";;
4875 Your C compiler may want other flags. For this question you should include
4876 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4877 but you should NOT include libraries or ld flags like -lwhatever. If you
4878 want $package to honor its debug switch, you should include -DDEBUGGING here.
4879 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4881 To use no flags, specify the word "none".
4887 rp="Any additional cc flags?"
4894 : the following weeds options from ccflags that are of no interest to cpp
4896 '') cppflags="$ccflags" ;;
4897 *) cppflags="$cppflags $ccflags" ;;
4899 case "$gccversion" in
4900 1*) cppflags="$cppflags -D__GNUC__"
4902 case "$mips_type" in
4904 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4910 echo "Let me guess what the preprocessor flags are..." >&4
4924 *) ftry="$previous $flag";;
4926 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4927 >cpp1.out 2>/dev/null && \
4928 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4929 >cpp2.out 2>/dev/null && \
4930 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4931 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4933 cppflags="$cppflags $ftry"
4943 *-*) echo "They appear to be: $cppflags";;
4945 $rm -f cpp.c cpp?.out
4949 : flags used in final linking phase
4951 '') if ./venix; then
4957 *-posix*) dflt="$dflt -posix" ;;
4960 *) dflt="$ldflags";;
4963 : Try to guess additional flags to pick up local libraries.
4964 for thislibdir in $libpth; do
4965 case " $loclibpth " in
4968 *"-L$thislibdir "*) ;;
4969 *) dflt="$dflt -L$thislibdir" ;;
4981 Your C linker may need flags. For this question you should
4982 include -L/whatever and any other flags used by the C linker, but you
4983 should NOT include libraries like -lwhatever.
4985 Make sure you include the appropriate -L/path flags if your C linker
4986 does not normally search all of the directories you specified above,
4989 To use no flags, specify the word "none".
4993 rp="Any additional ld flags (NOT including libraries)?"
4999 rmlist="$rmlist pdp11"
5003 echo "Checking your choice of C compiler and flags for coherency..." >&4
5004 $cat > try.c <<'EOF'
5006 int main() { printf("Ok\n"); return(0); }
5008 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5010 $cat >try.msg <<'EOM'
5011 I've tried to compile and run the following simple program:
5014 $cat try.c >> try.msg
5016 $cat >> try.msg <<EOM
5023 and I got the following output:
5027 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5028 if $sh -c "$run ./try" >>try.msg 2>&1; then
5032 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5035 cat >> try.msg <<'EOQS'
5036 If $libs contains -lsfio, and sfio is mis-configured, then it
5037 sometimes (apparently) runs and exits with a 0 status, but with no
5038 output! It may have to do with sfio's use of _exit vs. exit.
5041 rp="You have a big problem. Shall I abort Configure"
5048 echo "The program compiled OK, but exited with status $?." >>try.msg
5049 rp="You have a problem. Shall I abort Configure"
5053 echo "I can't compile the test program." >>try.msg
5054 rp="You have a BIG problem. Shall I abort Configure"
5060 case "$knowitall" in
5062 echo "(The supplied flags or libraries might be incorrect.)"
5070 *) echo "Ok. Stopping Configure." >&4
5075 n) echo "OK, that should do.";;
5077 $rm -f try try.* core
5079 : define a shorthand compile call
5083 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5084 : define a shorthand compile call for compilations that should be ok.
5088 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5090 : determine filename position in cpp output
5092 echo "Computing filename position in cpp output for #include directives..." >&4
5094 vos) testaccess=-e ;;
5097 echo '#include <stdio.h>' > foo.c
5100 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5101 $grep '^[ ]*#.*stdio\.h' | \
5102 while read cline; do
5105 while $test \$# -gt 0; do
5106 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5111 pos=\`expr \$pos + 1\`
5123 *) pos="${fieldn}th";;
5125 echo "Your cpp writes the filename in the $pos field of the line."
5128 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5129 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5132 : locate header file
5137 for usrincdir in $usrinc
5139 if test -f \$usrincdir/\$wanted; then
5140 echo "\$usrincdir/\$wanted"
5144 awkprg='{ print \$$fieldn }'
5145 echo "#include <\$wanted>" > foo\$\$.c
5146 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5147 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5148 while read cline; do
5149 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5151 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5152 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5157 # status = 0: grep returned 0 lines, case statement not executed
5158 # status = 1: headerfile found
5159 # status = 2: while loop executed, no headerfile found
5163 if test \$status -eq 1; then
5170 : define an alternate in-header-list? function
5171 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5172 cont=true; xxf="echo \"<\$1> found.\" >&4";
5173 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5174 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5176 case $# in 4) instead=instead;; *) instead="at last";; esac;
5177 while $test "$cont"; do
5179 var=$2; eval "was=\$$2";
5180 if $test "$xxx" && $test -r "$xxx";
5182 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5185 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5186 set $yyy; shift; shift; yyy=$@;
5187 case $# in 0) cont="";;
5188 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5189 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5190 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5191 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5195 do set $yyy; var=$2; eval "was=\$$2";
5196 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5197 set $yyy; shift; shift; yyy=$@;
5200 : see if stdlib is available
5201 set stdlib.h i_stdlib
5204 : check for lengths of integral types
5208 echo "Checking to see how big your integers are..." >&4
5217 printf("intsize=%d;\n", (int)sizeof(int));
5218 printf("longsize=%d;\n", (int)sizeof(long));
5219 printf("shortsize=%d;\n", (int)sizeof(short));
5224 if eval $compile_ok && $run ./try > /dev/null; then
5226 echo "Your integers are $intsize bytes long."
5227 echo "Your long integers are $longsize bytes long."
5228 echo "Your short integers are $shortsize bytes long."
5232 Help! I can't compile and run the intsize test program: please enlighten me!
5233 (This is probably a misconfiguration in your system or libraries, and
5234 you really ought to fix it. Still, I'll try anyway.)
5238 rp="What is the size of an integer (in bytes)?"
5242 rp="What is the size of a long integer (in bytes)?"
5246 rp="What is the size of a short integer (in bytes)?"
5254 : check for long long
5256 echo "Checking to see if you have long long..." >&4
5257 echo 'int main() { long long x = 7; return 0; }' > try.c
5259 if eval $compile; then
5261 echo "You have long long."
5264 echo "You do not have long long."
5270 : check for length of long long
5271 case "${d_longlong}${longlongsize}" in
5274 echo "Checking to see how big your long longs are..." >&4
5275 $cat >try.c <<'EOCP'
5279 printf("%d\n", (int)sizeof(long long));
5284 if eval $compile_ok; then
5285 longlongsize=`$run ./try`
5286 echo "Your long longs are $longlongsize bytes long."
5290 echo "(I can't seem to compile the test program. Guessing...)"
5291 rp="What is the size of a long long (in bytes)?"
5295 if $test "X$longsize" = "X$longlongsize"; then
5296 echo "(That isn't any different from an ordinary long.)"
5302 : see if inttypes.h is available
5303 : we want a real compile instead of Inhdr because some systems
5304 : have an inttypes.h which includes non-existent headers
5307 #include <inttypes.h>
5309 static int32_t foo32 = 0x12345678;
5313 if eval $compile; then
5314 echo "<inttypes.h> found." >&4
5317 echo "<inttypes.h> NOT found." >&4
5326 echo "Checking to see if you have int64_t..." >&4
5328 #include <sys/types.h>
5329 #$i_inttypes I_INTTYPES
5331 #include <inttypes.h>
5333 int main() { int64_t x = 7; }
5336 if eval $compile; then
5338 echo "You have int64_t."
5341 echo "You do not have int64_t."
5349 echo "Checking which 64-bit integer type we could use..." >&4
5355 val='"unsigned int"'
5360 *) case "$longsize" in
5364 val='"unsigned long"'
5369 *) case "$d_longlong:$longlongsize" in
5374 val='"unsigned long long"'
5379 *) case "$d_int64_t" in
5398 '') echo "Alas, no 64-bit integer types in sight." >&4
5401 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5407 case "$uselonglong" in
5408 "$define"|true|[yY]*)
5411 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5413 use64bitint="$define"
5416 case "$use64bits" in
5417 "$define"|true|[yY]*)
5420 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5422 use64bitint="$define"
5425 case "$use64bitints" in
5426 "$define"|true|[yY]*)
5429 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5431 use64bitint="$define"
5434 case "$use64bitsint" in
5435 "$define"|true|[yY]*)
5438 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5440 use64bitint="$define"
5443 case "$uselonglongs" in
5444 "$define"|true|[yY]*)
5447 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5449 use64bitint="$define"
5452 case "$use64bitsall" in
5453 "$define"|true|[yY]*)
5456 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5458 use64bitall="$define"
5463 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5465 case "$use64bitall" in
5466 "$define"|true|[yY]*) use64bitint="$define" ;;
5472 You have natively 64-bit long integers.
5476 *) case "$use64bitint" in
5477 "$define"|true|[yY]*) dflt='y';;
5486 Perl can be built to take advantage of 64-bit integer types
5487 on some systems. To do so, Configure can be run with -Duse64bitint.
5488 Choosing this option will most probably introduce binary incompatibilities.
5490 If this doesn't make any sense to you, just accept the default '$dflt'.
5491 (The default has been chosen based on your configuration.)
5493 rp='Try to use 64-bit integers, if available?'
5496 [yY]*) val="$define" ;;
5504 case "$use64bitall" in
5505 "$define"|true|[yY]*) dflt='y' ;;
5506 *) case "$longsize" in
5514 You may also choose to try maximal 64-bitness. It means using as much
5515 64-bitness as possible on the platform. This in turn means even more
5516 binary incompatibilities. On the other hand, your platform may not
5517 have any more 64-bitness available than what you already have chosen.
5519 If this doesn't make any sense to you, just accept the default '$dflt'.
5520 (The default has been chosen based on your configuration.)
5522 rp='Try to use maximal 64-bit support, if available?'
5525 [yY]*) val="$define" ;;
5530 case "$use64bitall" in
5532 case "$use64bitint" in
5536 Since you have chosen a maximally 64-bit build, I'm also turning on
5537 the use of 64-bit integers.
5539 use64bitint="$define" ;;
5544 : Look for a hint-file generated 'call-back-unit'. If the
5545 : user has specified that a 64-bit perl is to be built,
5546 : we may need to set or change some other defaults.
5547 if $test -f use64bitint.cbu; then
5548 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5551 case "$use64bitint" in
5552 "$define"|true|[yY]*)
5554 4) case "$archname64" in
5555 '') archname64=64int ;;
5562 : Look for a hint-file generated 'call-back-unit'. If the
5563 : user has specified that a maximally 64-bit perl is to be built,
5564 : we may need to set or change some other defaults.
5565 if $test -f use64bitall.cbu; then
5566 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5569 case "$use64bitall" in
5570 "$define"|true|[yY]*)
5572 4) case "$archname64" in
5573 ''|64int) archname64=64all ;;
5580 case "$d_quad:$use64bitint" in
5584 *** You have chosen to use 64-bit integers,
5585 *** but none can be found.
5586 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5587 *** Cannot continue, aborting.
5594 : check for length of double
5596 case "$doublesize" in
5598 echo "Checking to see how big your double precision numbers are..." >&4
5607 printf("%d\n", (int)sizeof(double));
5612 if eval $compile_ok; then
5613 doublesize=`$run ./try`
5614 echo "Your double is $doublesize bytes long."
5617 echo "(I can't seem to compile the test program. Guessing...)"
5618 rp="What is the size of a double precision number (in bytes)?"
5626 : check for long doubles
5628 echo "Checking to see if you have long double..." >&4
5629 echo 'int main() { long double x = 7.0; }' > try.c
5631 if eval $compile; then
5633 echo "You have long double."
5636 echo "You do not have long double."
5642 : check for length of long double
5643 case "${d_longdbl}${longdblsize}" in
5646 echo "Checking to see how big your long doubles are..." >&4
5647 $cat >try.c <<'EOCP'
5651 printf("%d\n", sizeof(long double));
5656 if eval $compile; then
5657 longdblsize=`$run ./try`
5658 echo "Your long doubles are $longdblsize bytes long."
5662 echo "(I can't seem to compile the test program. Guessing...)" >&4
5663 rp="What is the size of a long double (in bytes)?"
5667 if $test "X$doublesize" = "X$longdblsize"; then
5668 echo "That isn't any different from an ordinary double."
5669 echo "I'll keep your setting anyway, but you may see some"
5670 echo "harmless compilation warnings."
5676 : determine the architecture name
5678 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5679 tarch=`arch`"-$osname"
5680 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5681 if uname -m > tmparch 2>&1 ; then
5682 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5683 -e 's/$/'"-$osname/" tmparch`
5691 case "$myarchname" in
5694 echo "(Your architecture name used to be $myarchname.)"
5698 case "$targetarch" in
5700 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5705 *) dflt="$archname";;
5707 rp='What is your architecture name'
5710 case "$usethreads" in
5712 echo "Threads selected." >&4
5714 *-thread*) echo "...and architecture name already has -thread." >&4
5716 *) archname="$archname-thread"
5717 echo "...setting architecture name to $archname." >&4
5722 case "$usemultiplicity" in
5724 echo "Multiplicity selected." >&4
5726 *-multi*) echo "...and architecture name already has -multi." >&4
5728 *) archname="$archname-multi"
5729 echo "...setting architecture name to $archname." >&4
5734 case "$use64bitint$use64bitall" in
5736 case "$archname64" in
5738 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5741 case "$use64bitint" in
5742 "$define") echo "64 bit integers selected." >&4 ;;
5744 case "$use64bitall" in
5745 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5748 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5750 *) archname="$archname-$archname64"
5751 echo "...setting architecture name to $archname." >&4
5757 case "$uselongdouble" in
5759 echo "Long doubles selected." >&4
5760 case "$longdblsize" in
5762 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5766 *-ld*) echo "...and architecture name already has -ld." >&4
5768 *) archname="$archname-ld"
5769 echo "...setting architecture name to $archname." >&4
5776 case "$useperlio" in
5778 echo "Perlio selected." >&4
5781 echo "Perlio not selected, using stdio." >&4
5783 *-stdio*) echo "...and architecture name already has -stdio." >&4
5785 *) archname="$archname-stdio"
5786 echo "...setting architecture name to $archname." >&4
5791 if $test -f archname.cbu; then
5792 echo "Your platform has some specific hints for architecture name, using them..."
5796 : determine root of directory hierarchy where package will be installed.
5799 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5802 dflt=`echo "$prefix" | sed 's/.$//'`
5810 By default, $package will be installed in $dflt/bin, manual pages
5811 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5812 installation directories. Typically this is something like /usr/local.
5813 If you wish to have binaries under /usr/bin but other parts of the
5814 installation under /usr/local, that's ok: you will be prompted
5815 separately for each of the installation directories, the prefix being
5816 only used to set the defaults.
5820 rp='Installation prefix to use?'
5828 *) oldprefix="$prefix";;
5837 *) afsroot=$afsroot ;;
5843 $define|true) afs=true ;;
5844 $undef|false) afs=false ;;
5845 *) if test -d $afsroot; then
5853 echo "AFS may be running... I'll be extra cautious then..." >&4
5855 echo "AFS does not seem to be running..." >&4
5858 : determine installation prefix for where package is to be installed.
5862 Since you are running AFS, I need to distinguish the directory in which
5863 files will reside from the directory in which they are installed (and from
5864 which they are presumably copied to the former directory by occult means).
5867 case "$installprefix" in
5868 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5869 *) dflt="$installprefix";;
5874 In some special cases, particularly when building $package for distribution,
5875 it is convenient to distinguish the directory in which files should be
5876 installed from the directory ($prefix) in which they will
5877 eventually reside. For most users, these two directories are the same.
5880 case "$installprefix" in
5882 *) dflt=$installprefix;;
5886 rp='What installation prefix should I use for installing files?'
5888 installprefix="$ans"
5889 installprefixexp="$ansexp"
5891 : set the prefixit variable, to compute a suitable default value
5892 prefixit='case "$3" in
5894 case "$oldprefix" in
5895 "") eval "$1=\"\$$2\"";;
5902 ""|" ") eval "$1=\"\$$2\"";;
5908 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5910 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5911 /*-$oldprefix/*|\~*-$oldprefix/*)
5912 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5913 *) eval "$1=\"\$$2\"";;
5917 : get the patchlevel
5919 echo "Getting the current patchlevel..." >&4
5920 if $test -r $rsrc/patchlevel.h;then
5921 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5922 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5923 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5924 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5925 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5926 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5927 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5936 $echo "(You do not have patchlevel.h. Eek.)"
5938 if $test -r $rsrc/.patch ; then
5939 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5940 perl_patchlevel=`cat $rsrc/.patch`
5943 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5944 version_patchlevel_string="version $patchlevel subversion $subversion"
5945 case "$perl_patchlevel" in
5947 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5950 $echo "(You have $package $version_patchlevel_string.)"
5954 : XXX Should be a Configure test for double-dots in filenames.
5955 version=`echo $revision $patchlevel $subversion | \
5956 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5957 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5958 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5961 version=`echo $revision $patchlevel $subversion | \
5962 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5963 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5964 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5967 : Special case the 5.005_xx maintenance series, which used 5.005
5968 : without any subversion label as a subdirectory in $sitelib
5969 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5970 api_versionstring='5.005'
5973 : determine installation style
5974 : For now, try to deduce it from prefix unless it is already set.
5975 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5976 case "$installstyle" in
5977 '') case "$prefix" in
5978 *perl*) dflt='lib';;
5979 *) dflt='lib/perl5' ;;
5982 *) dflt="$installstyle" ;;
5984 : Probably not worth prompting for this since we prompt for all
5985 : the directories individually, and the prompt would be too long and
5989 : determine where private library files go
5990 : Usual default is /usr/local/lib/perl5/$version.
5991 : Also allow things like /opt/perl/lib/$version, since
5992 : /opt/perl/lib/perl5... would be redundant.
5993 : The default "style" setting is made in installstyle.U
5994 case "$installstyle" in
5995 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5996 *) set dflt privlib lib/$version ;;
6001 There are some auxiliary files for $package that need to be put into a
6002 private library directory that is accessible by everyone.
6006 rp='Pathname where the private library files will reside?'
6009 privlibexp="$ansexp"
6010 : Change installation prefix, if necessary.
6011 if $test X"$prefix" != X"$installprefix"; then
6012 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6014 installprivlib="$privlibexp"
6017 : set the prefixup variable, to restore leading tilda escape
6018 prefixup='case "$prefixexp" in
6020 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6023 : determine where public architecture dependent libraries go
6026 : privlib default is /usr/local/lib/$package/$version
6027 : archlib default is /usr/local/lib/$package/$version/$archname
6028 : privlib may have an optional trailing /share.
6029 tdflt=`echo $privlib | $sed 's,/share$,,'`
6030 tdflt=$tdflt/$archname
6039 $spackage contains architecture-dependent library files. If you are
6040 sharing libraries in a heterogeneous environment, you might store
6041 these files in a separate location. Otherwise, you can just include
6042 them with the rest of the public library files.
6046 rp='Where do you want to put the public architecture-dependent libraries?'
6049 archlibexp="$ansexp"
6050 if $test X"$archlib" = X"$privlib"; then
6055 : Change installation prefix, if necessary.
6056 if $test X"$prefix" != X"$installprefix"; then
6057 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6059 installarchlib="$archlibexp"
6062 : see if setuid scripts can be secure
6065 Some kernels have a bug that prevents setuid #! scripts from being
6066 secure. Some sites have disabled setuid #! scripts because of this.
6068 First let's decide if your kernel supports secure setuid #! scripts.
6069 (If setuid #! scripts would be secure but have been disabled anyway,
6070 don't say that they are secure if asked.)
6075 if $test -d /dev/fd; then
6076 echo "#!$ls" >reflect
6077 chmod +x,u+s reflect
6078 ./reflect >flect 2>&1
6079 if $contains "/dev/fd" flect >/dev/null; then
6080 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6084 If you are not sure if they are secure, I can check but I'll need a
6085 username and password different from the one you are using right now.
6086 If you don't have such a username or don't want me to test, simply
6090 rp='Other username to test security of setuid scripts with?'
6095 case "$d_suidsafe" in
6096 '') echo "I'll assume setuid scripts are *not* secure." >&4
6099 echo "Well, the $hint value is *not* secure." >&4
6101 *) echo "Well, the $hint value *is* secure." >&4
6106 $rm -f reflect flect
6107 echo "#!$ls" >reflect
6108 chmod +x,u+s reflect
6111 echo '"su" will (probably) prompt you for '"$ans's password."
6112 su $ans -c './reflect >flect'
6113 if $contains "/dev/fd" flect >/dev/null; then
6114 echo "Okay, it looks like setuid scripts are secure." >&4
6117 echo "I don't think setuid scripts are secure." >&4
6122 rp='Does your kernel have *secure* setuid scripts?'
6125 [yY]*) val="$define";;
6130 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6131 echo "(That's for file descriptors, not floppy disks.)"
6137 $rm -f reflect flect
6139 : now see if they want to do setuid emulation
6142 case "$d_suidsafe" in
6145 echo "No need to emulate SUID scripts since they are secure here." >&4
6149 Some systems have disabled setuid scripts, especially systems where
6150 setuid scripts cannot be secure. On systems where setuid scripts have
6151 been disabled, the setuid/setgid bits on scripts are currently
6152 useless. It is possible for $package to detect those bits and emulate
6153 setuid/setgid in a secure fashion. This emulation will only work if
6154 setuid scripts have been disabled in your kernel.
6158 "$define") dflt=y ;;
6161 rp="Do you want to do setuid/setgid emulation?"
6164 [yY]*) val="$define";;
6172 : see if this is a malloc.h system
6173 : we want a real compile instead of Inhdr because some systems have a
6174 : malloc.h that just gives a compile error saying to use stdlib.h instead
6179 int main () { return 0; }
6182 if eval $compile; then
6183 echo "<malloc.h> found." >&4
6186 echo "<malloc.h> NOT found." >&4
6193 : check for void type
6195 echo "Checking to see how well your C compiler groks the void type..." >&4
6196 case "$voidflags" in
6208 extern void moo(); /* function returning void */
6209 void (*goo)(); /* ptr to func returning void */
6211 void *hue; /* generic ptr */
6224 int main() { sub(); }
6226 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6227 voidflags=$defvoidused
6228 echo "Good. It appears to support void to the level $package wants.">&4
6229 if $contains warning .out >/dev/null 2>&1; then
6230 echo "However, you might get some warnings that look like this:"
6234 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6235 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6236 echo "It supports 1..."
6237 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6238 echo "It also supports 2..."
6239 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6241 echo "And it supports 4 but not 8 definitely."
6243 echo "It doesn't support 4..."
6244 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6246 echo "But it supports 8."
6249 echo "Neither does it support 8."
6253 echo "It does not support 2..."
6254 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6256 echo "But it supports 4 and 8."
6258 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6260 echo "And it supports 4 but has not heard about 8."
6262 echo "However it supports 8 but not 4."
6267 echo "There is no support at all for void."
6272 case "$voidflags" in
6275 Support flag bits are:
6276 1: basic void declarations.
6277 2: arrays of pointers to functions returning void.
6278 4: operations between pointers to and addresses of void functions.
6279 8: generic void pointers.
6282 rp="Your void support flags add up to what?"
6289 : check for length of pointer
6293 echo "Checking to see how big your pointers are..." >&4
6294 if test "$voidflags" -gt 7; then
6295 echo '#define VOID_PTR char *' > try.c
6297 echo '#define VOID_PTR void *' > try.c
6307 printf("%d\n", (int)sizeof(VOID_PTR));
6312 if eval $compile_ok; then
6313 ptrsize=`$run ./try`
6314 echo "Your pointers are $ptrsize bytes long."
6317 echo "(I can't seem to compile the test program. Guessing...)" >&4
6318 rp="What is the size of a pointer (in bytes)?"
6325 case "$use64bitall" in
6326 "$define"|true|[yY]*)
6330 *** You have chosen a maximally 64-bit build,
6331 *** but your pointers are only 4 bytes wide.
6332 *** Please rerun Configure without -Duse64bitall.
6337 *** Since you have quads, you could possibly try with -Duse64bitint.
6342 *** Cannot continue, aborting.
6353 : determine whether to use malloc wrapping
6355 case "$usemallocwrap" in
6356 [yY]*|true|$define) dflt='y' ;;
6357 [nN]*|false|$undef) dflt='n' ;;
6358 *) case "$usedevel" in
6359 [yY]*|true|$define) dflt='y' ;;
6364 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6366 usemallocwrap="$ans"
6369 usemallocwrap="$define" ;;
6371 usemallocwrap="$undef" ;;
6374 : determine which malloc to compile in
6376 case "$usemymalloc" in
6377 [yY]*|true|$define) dflt='y' ;;
6378 [nN]*|false|$undef) dflt='n' ;;
6379 *) case "$ptrsize" in
6385 rp="Do you wish to attempt to use the malloc that comes with $package?"
6391 mallocsrc='malloc.c'
6392 mallocobj="malloc$_o"
6393 d_mymalloc="$define"
6396 : Remove malloc from list of libraries to use
6397 echo "Removing unneeded -lmalloc from library list" >&4
6398 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6401 echo "libs = $libs" >&4
6413 : compute the return types of malloc and free
6415 $cat >malloc.c <<END
6419 #include <sys/types.h>
6433 case "$malloctype" in
6435 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6442 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6446 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6453 echo "Your system uses $freetype free(), it would seem." >&4
6457 After $package is installed, you may wish to install various
6458 add-on modules and utilities. Typically, these add-ons will
6459 be installed under $prefix with the rest
6460 of this package. However, you may wish to install such add-ons
6461 elsewhere under a different prefix.
6463 If you do not wish to put everything under a single prefix, that's
6464 ok. You will be prompted for the individual locations; this siteprefix
6465 is only used to suggest the defaults.
6467 The default should be fine for most people.
6471 rp='Installation prefix to use for add-on modules and utilities?'
6472 : XXX Here might be another good place for an installstyle setting.
6473 case "$siteprefix" in
6475 *) dflt=$siteprefix ;;
6478 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6480 case "$siteprefix" in
6484 *) oldsiteprefix="$prefix";;
6489 siteprefixexp="$ansexp"
6491 : determine where site specific libraries go.
6492 : Usual default is /usr/local/lib/perl5/site_perl/$version
6493 : The default "style" setting is made in installstyle.U
6494 : XXX No longer works with Prefixit stuff.
6495 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6497 '') case "$installstyle" in
6498 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6499 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6507 The installation process will create a directory for
6508 site-specific extensions and modules. Most users find it convenient
6509 to place all site-specific files in this directory rather than in the
6510 main distribution directory.
6514 rp='Pathname for the site-specific library files?'
6517 sitelibexp="$ansexp"
6518 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6519 : Change installation prefix, if necessary.
6520 if $test X"$prefix" != X"$installprefix"; then
6521 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6523 installsitelib="$sitelibexp"
6526 : determine where site specific architecture-dependent libraries go.
6527 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6528 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6529 : sitelib may have an optional trailing /share.
6531 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6532 dflt="$dflt/$archname"
6537 set sitearch sitearch none
6541 The installation process will also create a directory for
6542 architecture-dependent site-specific extensions and modules.
6546 rp='Pathname for the site-specific architecture-dependent library files?'
6549 sitearchexp="$ansexp"
6550 : Change installation prefix, if necessary.
6551 if $test X"$prefix" != X"$installprefix"; then
6552 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6554 installsitearch="$sitearchexp"
6559 The installation process will also create a directory for
6560 vendor-supplied add-ons. Vendors who supply perl with their system
6561 may find it convenient to place all vendor-supplied files in this
6562 directory rather than in the main distribution directory. This will
6563 ease upgrades between binary-compatible maintenance versions of perl.
6565 Of course you may also use these directories in whatever way you see
6566 fit. For example, you might use them to access modules shared over a
6567 company-wide network.
6569 The default answer should be fine for most people.
6570 This causes further questions about vendor add-ons to be skipped
6571 and no vendor-specific directories will be configured for perl.
6574 rp='Do you want to configure vendor-specific add-on directories?'
6575 case "$usevendorprefix" in
6576 define|true|[yY]*) dflt=y ;;
6577 *) : User may have set vendorprefix directly on Configure command line.
6578 case "$vendorprefix" in
6587 rp='Installation prefix to use for vendor-supplied add-ons?'
6588 case "$vendorprefix" in
6590 *) dflt=$vendorprefix ;;
6593 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6595 case "$vendorprefix" in
6599 *) oldvendorprefix="$prefix";;
6603 usevendorprefix="$define"
6605 vendorprefixexp="$ansexp"
6607 *) usevendorprefix="$undef"
6613 case "$vendorprefix" in
6614 '') d_vendorlib="$undef"
6618 *) d_vendorlib="$define"
6619 : determine where vendor-supplied modules go.
6620 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6621 case "$vendorlib" in
6623 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6624 case "$installstyle" in
6625 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6626 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6629 *) dflt="$vendorlib"
6633 rp='Pathname for the vendor-supplied library files?'
6636 vendorlibexp="$ansexp"
6639 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6640 : Change installation prefix, if necessary.
6641 if $test X"$prefix" != X"$installprefix"; then
6642 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6644 installvendorlib="$vendorlibexp"
6647 case "$vendorprefix" in
6648 '') d_vendorarch="$undef"
6652 *) d_vendorarch="$define"
6653 : determine where vendor-supplied architecture-dependent libraries go.
6654 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6655 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6656 : vendorlib may have an optional trailing /share.
6657 case "$vendorarch" in
6658 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6659 dflt="$dflt/$archname"
6661 *) dflt="$vendorarch" ;;
6664 rp='Pathname for vendor-supplied architecture-dependent files?'
6667 vendorarchexp="$ansexp"
6670 : Change installation prefix, if necessary.
6671 if $test X"$prefix" != X"$installprefix"; then
6672 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6674 installvendorarch="$vendorarchexp"
6677 : Final catch-all directories to search
6680 Lastly, you can have perl look in other directories for extensions and
6681 modules in addition to those already specified.
6682 These directories will be searched after
6686 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6687 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6689 case "$otherlibdirs" in
6690 ''|' ') dflt='none' ;;
6691 *) dflt="$otherlibdirs" ;;
6694 Enter a colon-separated set of extra paths to include in perl's @INC
6695 search path, or enter 'none' for no extra paths.
6699 rp='Colon-separated list of additional directories for perl to search?'
6702 ' '|''|none) otherlibdirs=' ' ;;
6703 *) otherlibdirs="$ans" ;;
6705 case "$otherlibdirs" in
6709 set d_perl_otherlibdirs
6712 : Cruising for prototypes
6714 echo "Checking out function prototypes..." >&4
6715 $cat >prototype.c <<EOCP
6720 int main(int argc, char *argv[]) {
6723 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6724 echo "Your C compiler appears to support function prototypes."
6727 echo "Your C compiler doesn't seem to understand function prototypes."
6734 case "$prototype" in
6736 *) ansi2knr='ansi2knr'
6741 This version of $package can only be compiled by a compiler that
6742 understands function prototypes. Unfortunately, your C compiler
6744 doesn't seem to understand them. Sorry about that.
6746 If GNU cc is available for your system, perhaps you could try that instead.
6748 Eventually, we hope to support building Perl with pre-ANSI compilers.
6749 If you would like to help in that effort, please contact <perlbug@perl.org>.
6751 Aborting Configure now.
6757 : determine where public executables go
6762 rp='Pathname where the public executables will reside?'
6764 if $test "X$ansexp" != "X$binexp"; then
6769 : Change installation prefix, if necessary.
6770 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6771 if $test X"$prefix" != X"$installprefix"; then
6772 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6774 installbin="$binexp"
6783 Perl can be built with extra modules or bundles of modules which
6784 will be fetched from the CPAN and installed alongside Perl.
6786 Notice that you will need access to the CPAN; either via the Internet,
6787 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6788 be asked later to configure the CPAN.pm module which will in turn do
6789 the installation of the rest of the extra modules or bundles.)
6791 Notice also that if the modules require any external software such as
6792 libraries and headers (the libz library and the zlib.h header for the
6793 Compress::Zlib module, for example) you MUST have any such software
6794 already installed, this configuration process will NOT install such
6797 If this doesn't make any sense to you, just accept the default '$dflt'.
6799 rp='Install any extra modules (y or n)?'
6805 Please list any extra modules or bundles to be installed from CPAN,
6806 with spaces between the names. The names can be in any format the
6807 'install' command of CPAN.pm will understand. (Answer 'none',
6808 without the quotes, to install no extra modules or bundles.)
6818 $rm -f ../extras.lst
6820 *) echo "(Saving the list of extras for later...)"
6821 echo "$extras" > ../extras.lst
6829 : determine where html pages for programs go
6830 set html1dir html1dir none
6834 If you wish to install html files for programs in $spackage, indicate
6835 the appropriate directory here. To skip installing html files,
6839 ''|none|$undef|' ') dflt=none ;;
6840 *) dflt=$html1dir ;;
6843 rp="Directory for the main $spackage html pages?"
6846 html1direxp="$ansexp"
6847 : Use ' ' for none so value is preserved next time through Configure
6848 $test X"$html1dir" = "X" && html1dir=' '
6849 : Change installation prefix, if necessary.
6850 if $test X"$prefix" != X"$installprefix"; then
6851 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6853 installhtml1dir="$html1direxp"
6856 : determine where html pages for libraries and modules go
6857 set html3dir html3dir none
6861 If you wish to install html files for modules associated with $spackage,
6862 indicate the appropriate directory here. To skip installing html files,
6865 : There is no obvious default. If they have specified html1dir, then
6866 : try to key off that, possibly changing .../html1 into .../html3.
6868 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6869 *) dflt=$html3dir ;;
6872 rp="Directory for the $spackage module html pages?"
6875 html3direxp="$ansexp"
6876 : Use ' ' for none so value is preserved next time through Configure
6877 $test X"$html3dir" = "X" && html3dir=' '
6878 : Change installation prefix, if necessary.
6879 if $test X"$prefix" != X"$installprefix"; then
6880 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6882 installhtml3dir="$html3direxp"
6885 : Find perl5.005 or later.
6886 echo "Looking for a previously installed perl5.005 or later... "
6888 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6889 : Check if this perl is recent and can load a simple module
6890 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6893 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6903 '') echo "None found. That's ok.";;
6904 *) echo "Using $perl5." ;;
6907 : Determine list of previous versions to include in @INC
6908 $cat > getverlist <<EOPL
6911 \$api_versionstring = "$api_versionstring";
6912 \$version = "$version";
6913 \$stem = "$sitelib_stem";
6914 \$archname = "$archname";
6916 $cat >> getverlist <<'EOPL'
6917 # Can't have leading @ because metaconfig interprets it as a command!
6918 ;@inc_version_list=();
6919 # XXX Redo to do opendir/readdir?
6922 ;@candidates = glob("5.*");
6928 # XXX ToDo: These comparisons must be reworked when two-digit
6929 # subversions come along, so that 5.7.10 compares as greater than
6930 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6931 # widespread that we can use the built-in version vectors rather
6932 # than reinventing them here. For 5.6.0, however, we must
6933 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6934 foreach $d (@candidates) {
6935 if ($d lt $version) {
6936 if ($d ge $api_versionstring) {
6937 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6939 elsif ($d ge "5.005") {
6940 unshift(@inc_version_list, grep { -d } $d);
6944 # Skip newer version. I.e. don't look in
6945 # 5.7.0 if we're installing 5.6.1.
6949 if (@inc_version_list) {
6950 print join(' ', @inc_version_list);
6953 # Blank space to preserve value for next Configure run.
6958 case "$inc_version_list" in
6959 '') if test -x "$perl5$exe_ext"; then
6960 dflt=`$perl5 getverlist`
6965 $undef) dflt='none' ;;
6966 *) eval dflt=\"$inc_version_list\" ;;
6969 ''|' ') dflt=none ;;
6976 In order to ease the process of upgrading, this version of perl
6977 can be configured to use modules built and installed with earlier
6978 versions of perl that were installed under $prefix. Specify here
6979 the list of earlier versions that this version of perl should check.
6980 If Configure detected no earlier versions of perl installed under
6981 $prefix, then the list will be empty. Answer 'none' to tell perl
6982 to not search earlier versions.
6984 The default should almost always be sensible, so if you're not sure,
6985 just accept the default.
6988 rp='List of earlier versions to include in @INC?'
6991 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6992 *) inc_version_list="$ans" ;;
6994 case "$inc_version_list" in
6996 inc_version_list_init='0';;
6997 *) inc_version_list_init=`echo $inc_version_list |
6998 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7003 : determine whether to install perl also as /usr/bin/perl
7006 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7008 Many scripts expect perl to be installed as /usr/bin/perl.
7010 If you want to, I can install the perl you are about to compile
7011 as /usr/bin/perl (in addition to $bin/perl).
7013 if test -f /usr/bin/perl; then
7016 However, please note that because you already have a /usr/bin/perl,
7017 overwriting that with a new Perl would very probably cause problems.
7018 Therefore I'm assuming you don't want to do that (unless you insist).
7021 case "$installusrbinperl" in
7022 "$define"|[yY]*) dflt='y';;
7028 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7031 case "$installusrbinperl" in
7032 "$undef"|[nN]*) dflt='n';;
7036 rp="Do you want to install perl as /usr/bin/perl?"
7039 [yY]*) val="$define";;
7045 set installusrbinperl
7049 echo "Checking for GNU C Library..." >&4
7051 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7052 alone are insufficient to distinguish different versions, such as
7053 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7054 libc version 2.1.0. A. Dougherty, June 3, 2002.
7060 # ifdef __GLIBC_MINOR__
7061 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7062 # include <gnu/libc-version.h>
7063 printf("%s\n", gnu_get_libc_version());
7065 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7068 printf("%d\n", __GLIBC__);
7077 if eval $compile_ok && $run ./try > glibc.ver; then
7079 gnulibc_version=`$cat glibc.ver`
7080 echo "You are using the GNU C Library version $gnulibc_version"
7084 echo "You are not using the GNU C Library"
7086 $rm -f try try.* glibc.ver
7090 : see if nm is to be used to determine whether a symbol is defined or not
7094 case "$d_gnulibc" in
7097 echo "nm probably won't work on the GNU C Library." >&4
7103 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7105 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7106 echo "'nm' won't be sufficient on this sytem." >&4
7112 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7113 if $test $dflt -gt 20; then
7123 true|$define) dflt=y;;
7130 I can use $nm to extract the symbols from your C libraries. This
7131 is a time consuming task which may generate huge output on the disk (up
7132 to 3 megabytes) but that should make the symbols extraction faster. The
7133 alternative is to skip the 'nm' extraction part and to compile a small
7134 test program instead to determine whether each symbol is present. If
7135 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7136 this may be the best solution.
7138 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7141 rp="Shall I use $nm to extract C symbols from the libraries?"
7144 [Nn]*) usenm=false;;
7153 : nm options which may be necessary
7155 '') if $test -f /mach_boot; then
7157 elif $test -d /usr/ccs/lib; then
7158 nm_opt='-p' # Solaris (and SunOS?)
7159 elif $test -f /dgux; then
7161 elif $test -f /lib64/rld; then
7162 nm_opt='-p' # 64-bit Irix
7168 : nm options which may be necessary for shared libraries but illegal
7169 : for archive libraries. Thank you, Linux.
7170 case "$nm_so_opt" in
7171 '') case "$myuname" in
7173 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7174 nm_so_opt='--dynamic'
7183 : get list of predefined functions in a handy place
7188 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7194 *) for thislib in $libs; do
7197 : Handle C library specially below.
7200 thislib=`echo $thislib | $sed -e 's/^-l//'`
7201 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7203 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7205 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7207 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7209 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7211 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7213 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7218 libnames="$libnames $try"
7220 *) libnames="$libnames $thislib" ;;
7229 for xxx in $libpth; do
7230 $test -r $1 || set $xxx/libc.$so
7231 : The messy sed command sorts on library version numbers.
7233 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7234 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7236 s/[0-9][0-9]*/0000&/g
7237 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7240 $sort | $sed -e 's/^.* //'`
7243 $test -r $1 || set /usr/ccs/lib/libc.$so
7244 $test -r $1 || set /lib/libsys_s$_a
7250 if $test -r "$1"; then
7251 echo "Your (shared) C library seems to be in $1."
7253 elif $test -r /lib/libc && $test -r /lib/clib; then
7254 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7256 libc='/lib/clib /lib/libc'
7257 if $test -r /lib/syslib; then
7258 echo "(Your math library is in /lib/syslib.)"
7259 libc="$libc /lib/syslib"
7261 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7262 echo "Your C library seems to be in $libc, as you said before."
7263 elif $test -r $incpath/usr/lib/libc$_a; then
7264 libc=$incpath/usr/lib/libc$_a;
7265 echo "Your C library seems to be in $libc. That's fine."
7266 elif $test -r /lib/libc$_a; then
7268 echo "Your C library seems to be in $libc. You're normal."
7270 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7272 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7273 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7274 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7276 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7278 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7281 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7283 if $test -r "$tans"; then
7284 echo "Your C library seems to be in $tans, of all places."
7290 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7294 If the guess above is wrong (which it might be if you're using a strange
7295 compiler, or your machine supports multiple models), you can override it here.
7300 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7302 I can't seem to find your C library. I've looked in the following places:
7305 $sed 's/^/ /' libpath
7308 None of these seems to contain your C library. I need to get its name...
7313 rp='Where is your C library?'
7318 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7319 set X `cat libnames`
7322 case $# in 1) xxx=file; esac
7323 echo "Extracting names from the following $xxx for later perusal:" >&4
7325 $sed 's/^/ /' libnames >&4
7327 $echo $n "This may take a while...$c" >&4
7331 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7332 *) $nm $nm_opt $file 2>/dev/null;;
7337 $grep fprintf libc.tmp > libc.ptf
7338 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7339 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7341 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7343 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7345 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7347 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7349 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7351 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7353 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7355 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7357 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7359 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7361 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7363 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7365 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7366 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7368 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7370 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7372 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7374 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7376 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7378 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7380 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7382 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7384 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7386 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7388 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7390 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7392 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7394 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7396 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7399 $nm -p $* 2>/dev/null >libc.tmp
7400 $grep fprintf libc.tmp > libc.ptf
7401 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7402 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7408 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7410 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7411 for thisname in $libnames $libc; do
7412 $ar t $thisname >>libc.tmp
7414 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7416 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7417 # Repeat libc to extract forwarders to DLL entries too
7418 for thisname in $libnames $libc; do
7419 $ar tv $thisname >>libc.tmp
7420 # Revision 50 of EMX has bug in $ar.
7421 # it will not extract forwarders to DLL entries
7422 # Use emximp which will extract exactly them.
7423 emximp -o tmp.imp $thisname \
7425 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7426 < tmp.imp >>libc.tmp
7429 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7432 echo "$ar didn't seem to work right." >&4
7433 echo "Maybe this is a Cray...trying bld instead..." >&4
7434 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7436 for thisname in $libnames; do
7438 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7439 $ar t $thisname >>libc.tmp
7443 echo "That didn't work either. Giving up." >&4
7453 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7454 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7456 *) if $test -f /lib/syscalls.exp; then
7458 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7459 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7465 $rm -f libnames libpath
7467 : see if dld is available
7471 : is a C symbol defined?
7474 -v) tf=libc.tmp; tdc="";;
7475 -a) tf=libc.tmp; tdc="[]";;
7476 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7479 case "$reuseval-$4" in
7481 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7486 if $test "$runnm" = true; then
7487 if $contains $tlook $tf >/dev/null 2>&1; then
7489 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7490 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7491 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7492 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7493 $rm -f try$_exe try.c core core.* try.core;
7496 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7497 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7498 $rm -f try$_exe try.c;
7503 $define) tval=true;;
7510 : define an is-in-libc? function
7511 inlibc='echo " "; td=$define; tu=$undef;
7512 sym=$1; var=$2; eval "was=\$$2";
7514 case "$reuseval$was" in
7524 echo "$sym() found." >&4;
7525 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7527 echo "$sym() NOT found." >&4;
7528 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7532 $define) echo "$sym() found." >&4;;
7533 *) echo "$sym() NOT found." >&4;;
7537 : see if dlopen exists
7544 : determine which dynamic loading, if any, to compile in
7546 dldir="ext/DynaLoader"
7559 $define) dflt='y' ;;
7562 $define) dflt='y' ;;
7564 : Does a dl_xxx.xs file exist for this operating system
7565 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7568 rp="Do you wish to use dynamic loading?"
7575 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7576 dflt="$dldir/dl_${osname}.xs"
7577 elif $test "$d_dlopen" = "$define" ; then
7578 dflt="$dldir/dl_dlopen.xs"
7579 elif $test "$i_dld" = "$define" ; then
7580 dflt="$dldir/dl_dld.xs"
7585 *) dflt="$dldir/$dlsrc"
7588 echo "The following dynamic loading files are available:"
7589 : Can not go over to $dldir because getfile has path hard-coded in.
7590 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7591 rp="Source file to use for dynamic loading"
7597 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7601 Some systems may require passing special flags to $cc -c to
7602 compile modules that will be used to create a shared library.
7603 To use no flags, say "none".
7606 case "$cccdlflags" in
7607 '') case "$gccversion" in
7608 '') case "$osname" in
7610 next) dflt='none' ;;
7611 irix*) dflt='-KPIC' ;;
7612 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7613 sunos) dflt='-pic' ;;
7617 *) case "$osname" in
7618 darwin) dflt='none' ;;
7619 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7624 *) dflt="$cccdlflags" ;;
7626 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7629 none) cccdlflags=' ' ;;
7630 *) cccdlflags="$ans" ;;
7635 Some systems use ld to create libraries that can be dynamically loaded,
7636 while other systems (such as those using ELF) use $cc.
7640 '') $cat >try.c <<EOM
7641 /* Test for whether ELF binaries are produced */
7649 int i = open("a.out",O_RDONLY);
7652 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7653 exit(0); /* succeed (yes, it's ELF) */
7658 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7660 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7664 echo "I'll use ld to build dynamic libraries."
7673 rp="What command should be used to create dynamic libraries?"
7679 Some systems may require passing special flags to $ld to create a
7680 library that can be dynamically loaded. If your ld flags include
7681 -L/other/path options to locate libraries outside your loader's normal
7682 search path, you may need to specify those -L options here as well. To
7683 use no flags, say "none".
7686 case "$lddlflags" in
7687 '') case "$osname" in
7688 beos) dflt='-nostart' ;;
7690 case "$gccversion" in
7691 '') dflt="$dflt +vnocompatwarnings" ;;
7694 linux|irix*|gnu*) dflt='-shared' ;;
7695 next) dflt='none' ;;
7696 solaris) dflt='-G' ;;
7697 sunos) dflt='-assert nodefinitions' ;;
7698 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7702 *) dflt="$lddlflags" ;;
7705 : Try to guess additional flags to pick up local libraries.
7706 : Be careful not to append to a plain 'none'
7710 for thisflag in $ldflags; do
7715 *) dflt="$dflt $thisflag" ;;
7722 ''|' ') dflt='none' ;;
7725 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7728 none) lddlflags=' ' ;;
7729 *) lddlflags="$ans" ;;
7734 Some systems may require passing special flags to $cc to indicate that
7735 the resulting executable will use dynamic linking. To use no flags,
7739 case "$ccdlflags" in
7740 '') case "$osname" in
7741 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7742 next|sunos) dflt='none' ;;
7746 *) dflt="$ccdlflags" ;;
7748 rp="Any special flags to pass to $cc to use dynamic linking?"
7751 none) ccdlflags=' ' ;;
7752 *) ccdlflags="$ans" ;;
7766 # No dynamic loading being used, so don't bother even to prompt.
7769 *) case "$useshrplib" in
7770 '') case "$osname" in
7771 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7773 also='Building a shared libperl is required for dynamic loading to work on your system.'
7778 also='Building a shared libperl is needed for MAB support.'
7796 The perl executable is normally obtained by linking perlmain.c with
7797 libperl${_a}, any static extensions (usually just DynaLoader), and
7798 any other libraries needed on this system (such as -lm, etc.). Since
7799 your system supports dynamic loading, it is probably possible to build
7800 a shared libperl.$so. If you will have more than one executable linked
7801 to libperl.$so, this will significantly reduce the size of each
7802 executable, but it may have a noticeable effect on performance. The
7803 default is probably sensible for your system.
7807 rp="Build a shared libperl.$so (y/n)"
7811 useshrplib='true' ;;
7812 *) useshrplib='false' ;;
7817 case "$useshrplib" in
7821 # Figure out a good name for libperl.so. Since it gets stored in
7822 # a version-specific architecture-dependent library, the version
7823 # number isn't really that important, except for making cc/ld happy.
7825 # A name such as libperl.so.3.1
7826 majmin="libperl.$so.$patchlevel.$subversion"
7827 # A name such as libperl.so.301
7828 majonly=`echo $patchlevel $subversion |
7829 $awk '{printf "%d%02d", $1, $2}'`
7830 majonly=libperl.$so.$majonly
7831 # I'd prefer to keep the os-specific stuff here to a minimum, and
7832 # rely on figuring it out from the naming of libc.
7833 case "${osname}${osvers}" in
7836 # XXX How handle the --version stuff for MAB?
7838 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7841 cygwin*) # ld links against an importlib
7842 dflt=libperl$lib_ext
7844 *) # Try to guess based on whether libc has major.minor.
7846 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7847 *libc.$so.[0-9]*) dflt=$majonly ;;
7848 *) dflt=libperl.$so ;;
7858 I need to select a good name for the shared libperl. If your system uses
7859 library names with major and minor numbers, then you might want something
7860 like $majmin. Alternatively, if your system uses a single version
7861 number for shared libraries, then you might want to use $majonly.
7862 Or, your system might be quite happy with a simple libperl.$so.
7864 Since the shared libperl will get installed into a version-specific
7865 architecture-dependent directory, the version number of the shared perl
7866 library probably isn't important, so the default should be o.k.
7869 rp='What name do you want to give to the shared libperl?'
7872 echo "Ok, I'll use $libperl"
7875 libperl="libperl${_a}"
7879 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7883 WARNING: Use of the shrpdir variable for the installation location of
7884 the shared $libperl is not supported. It was never documented and
7885 will not work in this version. Let me (perlbug@perl.org)
7886 know of any problems this may cause.
7892 But your current setting of $shrpdir is
7893 the default anyway, so it's harmless.
7898 Further, your current attempted setting of $shrpdir
7899 conflicts with the value of $archlibexp/CORE
7900 that installperl will use.
7907 # How will the perl executable find the installed shared $libperl?
7908 # Add $xxx to ccdlflags.
7909 # If we can't figure out a command-line option, use $shrpenv to
7910 # set env LD_RUN_PATH. The main perl makefile uses this.
7911 shrpdir=$archlibexp/CORE
7914 if "$useshrplib"; then
7917 # We'll set it in Makefile.SH...
7922 freebsd|netbsd|openbsd|interix|dragonfly)
7923 xxx="-Wl,-R$shrpdir"
7925 bsdos|linux|irix*|dec_osf|gnu*)
7926 xxx="-Wl,-rpath,$shrpdir"
7929 # next doesn't like the default...
7932 # beos doesn't like the default, either.
7935 # hpux doesn't like the default, either.
7936 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7939 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7945 # Only add $xxx if it isn't already in ccdlflags.
7946 case " $ccdlflags " in
7948 *) ccdlflags="$ccdlflags $xxx"
7951 Adding $xxx to the flags
7952 passed to $ld so that the perl executable will find the
7953 installed shared $libperl.
7961 # Fix ccdlflags in AIX for building external extensions.
7962 # (For building Perl itself bare -bE:perl.exp is needed,
7963 # Makefile.SH takes care of this.)
7965 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7967 # Respect a hint or command-line value.
7969 '') shrpenv="$tmp_shrpenv" ;;
7971 case "$ldlibpthname" in
7972 '') ldlibpthname=LD_LIBRARY_PATH ;;
7973 none) ldlibpthname='' ;;
7976 : determine where manual pages are on this system
7980 syspath='/usr/share/man/man1 /usr/man/man1'
7981 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7982 syspath="$syspath /usr/man/u_man/man1"
7983 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7984 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7985 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7986 sysman=`./loc . /usr/man/man1 $syspath`
7989 if $test -d "$sysman"; then
7990 echo "System manual is in $sysman." >&4
7992 echo "Could not find manual pages in source form." >&4
7995 : determine where manual pages go
7996 set man1dir man1dir none
8000 $spackage has manual pages available in source form.
8004 echo "However, you don't have nroff, so they're probably useless to you."
8006 '') man1dir="none";;
8009 echo "If you don't want the manual sources installed, answer 'none'."
8014 lookpath="$prefixexp/share/man/man1"
8015 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8016 lookpath="$lookpath $prefixexp/man/p_man/man1"
8017 lookpath="$lookpath $prefixexp/man/u_man/man1"
8018 lookpath="$lookpath $prefixexp/man/man.1"
8020 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8021 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8031 rp="Where do the main $spackage manual pages (source) go?"
8033 if $test "X$man1direxp" != "X$ansexp"; then
8037 man1direxp="$ansexp"
8043 : Change installation prefix, if necessary.
8044 if $test X"$prefix" != X"$installprefix"; then
8045 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
8047 installman1dir="$man1direxp"
8050 : What suffix to use on installed man pages
8057 rp="What suffix should be used for the main $spackage man pages?"
8059 '') case "$man1dir" in
8073 *) dflt="$man1ext";;
8080 : see if we can have long filenames
8082 first=123456789abcdef
8084 if (echo hi >$first) 2>/dev/null; then
8085 if $test -f 123456789abcde; then
8086 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8089 echo 'You can have filenames longer than 14 characters.'>&4
8094 You can't have filenames longer than 14 chars.
8095 You can't even think about them!
8101 $rm -rf 123456789abcde*
8103 : determine where library module manual pages go
8104 set man3dir man3dir none
8108 $spackage has manual pages for many of the library modules.
8114 However, you don't have nroff, so they're probably useless to you.
8117 '') man3dir="none";;
8121 case "$d_flexfnam" in
8124 However, your system can't handle the long file names like File::Basename.3.
8127 '') man3dir="none";;
8131 echo "If you don't want the manual sources installed, answer 'none'."
8132 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8134 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8135 if $test -d "$privlib/man/man3"; then
8138 WARNING: Previous versions of perl installed man3 pages into
8139 $privlib/man/man3. This version will suggest a
8140 new default of $dflt.
8144 rp='Do you wish to preserve the old behavior?(y/n)'
8147 y*) dflt="$privlib/man/man3" ;;
8152 *) dflt="$man3dir" ;;
8159 rp="Where do the $package library man pages (source) go?"
8162 man3direxp="$ansexp"
8168 : Change installation prefix, if necessary.
8169 if $test X"$prefix" != X"$installprefix"; then
8170 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8172 installman3dir="$man3direxp"
8175 : What suffix to use on installed man pages
8181 rp="What suffix should be used for the $package library man pages?"
8183 '') case "$man3dir" in
8197 *) dflt="$man3ext";;
8204 : see if we have to deal with yellow pages, now NIS.
8205 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8206 if $test -f /usr/etc/nibindd; then
8208 echo "I'm fairly confident you're on a NeXT."
8210 rp='Do you get the hosts file via NetInfo?'
8219 y*) hostcat='nidump hosts .';;
8220 *) case "$hostcat" in
8221 nidump*) hostcat='';;
8231 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8239 rp='Are you getting the hosts file via yellow pages?'
8242 y*) hostcat='ypcat hosts';;
8243 *) hostcat='cat /etc/hosts';;
8249 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8252 '') test -f /etc/group && groupcat='cat /etc/group';;
8255 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8258 : now get the host name
8260 echo "Figuring out host name..." >&4
8261 case "$myhostname" in
8263 echo 'Maybe "hostname" will work...'
8264 if tans=`sh -c hostname 2>&1` ; then
8272 if $test "$cont"; then
8274 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8275 if tans=`cat /etc/systemid 2>&1` ; then
8277 phostname='cat /etc/systemid'
8278 echo "Whadyaknow. Xenix always was a bit strange..."
8281 elif $test -r /etc/systemid; then
8282 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8285 if $test "$cont"; then
8286 echo 'No, maybe "uuname -l" will work...'
8287 if tans=`sh -c 'uuname -l' 2>&1` ; then
8289 phostname='uuname -l'
8291 echo 'Strange. Maybe "uname -n" will work...'
8292 if tans=`sh -c 'uname -n' 2>&1` ; then
8294 phostname='uname -n'
8296 echo 'Oh well, maybe I can mine it out of whoami.h...'
8297 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8298 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8299 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8301 case "$myhostname" in
8302 '') echo "Does this machine have an identity crisis or something?"
8305 echo "Well, you said $myhostname before..."
8306 phostname='echo $myhostname';;
8312 case "$myhostname" in
8313 '') myhostname=noname ;;
8315 : you do not want to know about this
8320 if $test "$myhostname" ; then
8322 rp='Your host name appears to be "'$myhostname'".'" Right?"
8330 : bad guess or no guess
8331 while $test "X$myhostname" = X ; do
8333 rp="Please type the (one word) name of your host:"
8338 : translate upper to lower if necessary
8339 case "$myhostname" in
8341 echo "(Normalizing case in your host name)"
8342 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8346 case "$myhostname" in
8348 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8349 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8350 echo "(Trimming domain name from host name--host name is now $myhostname)"
8352 *) case "$mydomain" in
8355 test "X$hostcat" = "Xypcat hosts" &&
8356 ypmatch "$myhostname" hosts 2>/dev/null |\
8357 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8360 test "X$hostcat" != "X" &&
8361 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8362 /[ ]$myhostname[ . ]/p" > hosts
8365 if $test -f hosts; then
8366 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8367 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8368 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8369 hosts | $sort | $uniq | \
8370 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8371 case `$echo X$dflt` in
8372 X*\ *) echo "(Several hosts in the database matched hostname)"
8375 X.) echo "(You do not have fully-qualified names in the hosts database)"
8379 echo "(I cannot locate a hosts database anywhere)"
8384 tans=`./loc resolv.conf X /etc /usr/etc`
8385 if $test -f "$tans"; then
8386 echo "(Attempting domain name extraction from $tans)"
8387 dflt=.`$sed -n -e 's/ / /g' \
8388 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8389 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8391 .) dflt=.`$sed -n -e 's/ / /g' \
8392 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8393 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8400 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8401 dflt=.`sh -c domainname 2>/dev/null`
8404 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8408 case "$dflt$osname" in
8409 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8410 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8414 .) echo "(Lost all hope -- silly guess then)"
8420 *) dflt="$mydomain";;
8424 rp="What is your domain name?"
8434 : translate upper to lower if necessary
8437 echo "(Normalizing case in your domain name)"
8438 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8442 : a little sanity check here
8443 case "$phostname" in
8446 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8447 $myhostname$mydomain|$myhostname) ;;
8449 case "$phostname" in
8451 echo "(That doesn't agree with your whoami.h file, by the way.)"
8454 echo "(That doesn't agree with your $phostname command, by the way.)"
8464 I need to get your e-mail address in Internet format if possible, i.e.
8465 something like user@host.domain. Please answer accurately since I have
8466 no easy means to double check it. The default value provided below
8467 is most probably close to reality but may not be valid from outside
8468 your organization...
8472 while test "$cont"; do
8474 '') dflt="$cf_by@$myhostname$mydomain";;
8475 *) dflt="$cf_email";;
8477 rp='What is your e-mail address?'
8483 rp='Address does not look like an Internet one. Use it anyway?'
8499 If you or somebody else will be maintaining perl at your site, please
8500 fill in the correct e-mail address here so that they may be contacted
8501 if necessary. Currently, the "perlbug" program included with perl
8502 will send mail to this address in addition to perlbug@perl.org. You may
8503 enter "none" for no administrator.
8506 case "$perladmin" in
8507 '') dflt="$cf_email";;
8508 *) dflt="$perladmin";;
8510 rp='Perl administrator e-mail address'
8514 : determine whether to only install version-specific parts.
8517 Do you want to install only the version-specific parts of the perl
8518 distribution? Usually you do *not* want to do this.
8520 case "$versiononly" in
8521 "$define"|[Yy]*|true) dflt='y' ;;
8524 rp="Do you want to install only the version-specific parts of perl?"
8527 [yY]*) val="$define";;
8533 case "$versiononly" in
8534 "$define") inc_version_list=''
8535 inc_version_list_init=0
8539 : figure out how to guarantee perl startup
8540 case "$startperl" in
8542 case "$sharpbang" in
8546 I can use the #! construct to start perl on your system. This will
8547 make startup of perl scripts faster, but may cause problems if you
8548 want to share those scripts and perl is not in a standard place
8549 ($binexp/perl) on all your platforms. The alternative is to force
8550 a shell by starting the script with a single ':' character.
8553 case "$versiononly" in
8554 "$define") dflt="$binexp/perl$version";;
8555 *) dflt="$binexp/perl";;
8557 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8560 none) startperl=": # use perl";;
8561 *) startperl="#!$ans"
8562 if $test 30 -lt `echo "$ans" | wc -c`; then
8565 WARNING: Some systems limit the #! command to 32 characters.
8566 If you experience difficulty running Perl scripts with #!, try
8567 installing Perl in a directory with a shorter pathname.
8573 *) startperl=": # use perl"
8578 echo "I'll use $startperl to start perl scripts."
8580 : figure best path for perl in scripts
8583 case "$versiononly" in
8584 "$define") perlpath="$binexp/perl$version";;
8585 *) perlpath="$binexp/perl";;
8587 case "$startperl" in
8592 I will use the "eval 'exec'" idiom to start Perl on your system.
8593 I can use the full path of your Perl binary for this purpose, but
8594 doing so may cause problems if you want to share those scripts and
8595 Perl is not always in a standard place ($binexp/perl).
8599 rp="What path shall I use in \"eval 'exec'\"?"
8606 case "$startperl" in
8608 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8611 : determine where public executable scripts go
8612 set scriptdir scriptdir
8614 case "$scriptdir" in
8617 : guess some guesses
8618 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8619 $test -d /usr/share/bin && dflt=/usr/share/bin
8620 $test -d /usr/local/script && dflt=/usr/local/script
8621 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8622 $test -d $prefixexp/script && dflt=$prefixexp/script
8626 *) dflt="$scriptdir"
8631 Some installations have a separate directory just for executable scripts so
8632 that they can mount it across multiple architectures but keep the scripts in
8633 one spot. You might, for example, have a subdirectory of /usr/share for this.
8634 Or you might just lump your scripts in with all your other executables.
8638 rp='Where do you keep publicly executable scripts?'
8640 if $test "X$ansexp" != "X$scriptdirexp"; then
8644 scriptdirexp="$ansexp"
8645 : Change installation prefix, if necessary.
8646 if $test X"$prefix" != X"$installprefix"; then
8647 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8649 installscript="$scriptdirexp"
8652 : determine where add-on public executables go
8654 '') dflt=$siteprefix/bin ;;
8658 rp='Pathname where the add-on public executables should be installed?'
8661 sitebinexp="$ansexp"
8662 : Change installation prefix, if necessary.
8663 if $test X"$prefix" != X"$installprefix"; then
8664 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8666 installsitebin="$sitebinexp"
8669 : determine where add-on html pages go
8670 : There is no standard location, so try to copy the previously-selected
8671 : directory structure for the core html pages.
8672 case "$sitehtml1dir" in
8673 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8674 *) dflt=$sitehtml1dir ;;
8677 ''|' ') dflt=none ;;
8680 rp='Pathname where the site-specific html pages should be installed?'
8683 sitehtml1direxp="$ansexp"
8684 : Change installation prefix, if necessary.
8685 if $test X"$prefix" != X"$installprefix"; then
8686 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8688 installsitehtml1dir="$sitehtml1direxp"
8691 : determine where add-on library html pages go
8692 : There is no standard location, so try to copy the previously-selected
8693 : directory structure for the core html pages.
8694 case "$sitehtml3dir" in
8695 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8696 *) dflt=$sitehtml3dir ;;
8699 ''|' ') dflt=none ;;
8702 rp='Pathname where the site-specific library html pages should be installed?'
8705 sitehtml3direxp="$ansexp"
8706 : Change installation prefix, if necessary.
8707 if $test X"$prefix" != X"$installprefix"; then
8708 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8710 installsitehtml3dir="$sitehtml3direxp"
8713 : determine where add-on manual pages go
8714 case "$siteman1dir" in
8715 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8716 *) dflt=$siteman1dir ;;
8719 ''|' ') dflt=none ;;
8722 rp='Pathname where the site-specific manual pages should be installed?'
8725 siteman1direxp="$ansexp"
8726 : Change installation prefix, if necessary.
8727 if $test X"$prefix" != X"$installprefix"; then
8728 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8730 installsiteman1dir="$siteman1direxp"
8733 : determine where add-on library man pages go
8734 case "$siteman3dir" in
8735 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8736 *) dflt=$siteman3dir ;;
8739 ''|' ') dflt=none ;;
8742 rp='Pathname where the site-specific library manual pages should be installed?'
8745 siteman3direxp="$ansexp"
8746 : Change installation prefix, if necessary.
8747 if $test X"$prefix" != X"$installprefix"; then
8748 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8750 installsiteman3dir="$siteman3direxp"
8753 : determine where add-on public executable scripts go
8754 case "$sitescript" in
8755 '') dflt=$siteprefix/script
8756 $test -d $dflt || dflt=$sitebin ;;
8757 *) dflt="$sitescript" ;;
8760 rp='Pathname where add-on public executable scripts should be installed?'
8763 sitescriptexp="$ansexp"
8764 : Change installation prefix, if necessary.
8765 if $test X"$prefix" != X"$installprefix"; then
8766 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8768 installsitescript="$sitescriptexp"
8771 case "$usefaststdio" in
8772 $define|true|[yY]*|'')
8773 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8783 Perl can be built to use 'fast stdio', which means using the stdio
8784 library but also directly manipulating the stdio buffers to enable
8785 faster I/O. Using stdio is better for backward compatibility (especially
8786 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8787 interface has been preferred instead of stdio.
8789 If this doesn't make any sense to you, just accept the default '$dflt'.
8791 rp='Use the "fast stdio" if available?'
8794 y|Y) val="$define" ;;
8801 : define an is-a-typedef? function
8802 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8804 "") inclist="sys/types.h";;
8806 eval "varval=\$$var";
8810 for inc in $inclist; do
8811 echo "#include <$inc>" >>temp.c;
8813 echo "#ifdef $type" >> temp.c;
8814 echo "printf(\"We have $type\");" >> temp.c;
8815 echo "#endif" >> temp.c;
8816 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8817 if $contains $type temp.E >/dev/null 2>&1; then
8823 *) eval "$var=\$varval";;
8826 : define an is-a-typedef? function that prompts if the type is not available.
8827 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8829 "") inclist="sys/types.h";;
8831 eval "varval=\$$var";
8835 for inc in $inclist; do
8836 echo "#include <$inc>" >>temp.c;
8838 echo "#ifdef $type" >> temp.c;
8839 echo "printf(\"We have $type\");" >> temp.c;
8840 echo "#endif" >> temp.c;
8841 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8843 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8844 if $contains $type temp.E >/dev/null 2>&1; then
8845 echo "$type found." >&4;
8848 echo "$type NOT found." >&4;
8854 *) eval "$var=\$varval";;
8857 : see what type lseek is declared as in the kernel
8858 rp="What is the type used for lseek's offset on this system?"
8859 set off_t lseektype long stdio.h sys/types.h
8863 echo "Checking to see how big your file offsets are..." >&4
8865 #include <sys/types.h>
8869 printf("%d\n", (int)sizeof($lseektype));
8874 if eval $compile_ok; then
8875 lseeksize=`$run ./try`
8876 echo "Your file offsets are $lseeksize bytes long."
8880 echo "(I can't seem to compile the test program. Guessing...)"
8881 rp="What is the size of your file offsets (in bytes)?"
8887 : see what type file positions are declared as in the library
8888 rp="What is the type for file position used by fsetpos()?"
8889 set fpos_t fpostype long stdio.h sys/types.h
8894 *_t) zzz="$fpostype" ;;
8897 echo "Checking the size of $zzz..." >&4
8899 #include <sys/types.h>
8906 printf("%d\n", (int)sizeof($fpostype));
8911 if eval $compile_ok; then
8915 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8918 echo "Your $zzz is $fpossize bytes long."
8924 echo "(I can't compile the test program. Guessing...)" >&4
8925 rp="What is the size of your file positions (in bytes)?"
8930 # Backward compatibility (uselfs is deprecated).
8932 "$define"|true|[yY]*)
8935 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8937 uselargefiles="$define"
8941 case "$lseeksize:$fpossize" in
8944 You can have files larger than 2 gigabytes.
8947 *) case "$uselargefiles" in
8948 "$undef"|false|[nN]*) dflt='n' ;;
8953 Perl can be built to understand large files (files larger than 2 gigabytes)
8954 on some systems. To do so, Configure can be run with -Duselargefiles.
8956 If this doesn't make any sense to you, just accept the default '$dflt'.
8958 rp='Try to understand large files, if available?'
8961 y|Y) val="$define" ;;
8968 : Look for a hint-file generated 'call-back-unit'. If the
8969 : user has specified that a large files perl is to be built,
8970 : we may need to set or change some other defaults.
8971 if $test -f uselargefiles.cbu; then
8972 echo "Your platform has some specific hints regarding large file builds, using them..."
8973 . ./uselargefiles.cbu
8975 case "$uselargefiles" in
8977 if $test -f uselargefiles.cbu; then
8979 echo "Rechecking to see how big your file offsets are..." >&4
8981 #include <sys/types.h>
8985 printf("%d\n", (int)sizeof($lseektype));
8990 if eval $compile_ok; then
8991 lseeksize=`$run ./try`
8992 $echo "Your file offsets are now $lseeksize bytes long."
8996 echo "(I can't seem to compile the test program. Guessing...)"
8997 rp="What is the size of your file offsets (in bytes)?"
9002 *_t) zzz="$fpostype" ;;
9005 $echo $n "Rechecking the size of $zzz...$c" >&4
9007 #include <sys/types.h>
9014 printf("%d\n", (int)sizeof($fpostype));
9019 if eval $compile_ok; then
9024 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9027 echo " $fpossize bytes." >&4
9033 echo "(I can't compile the test program. Guessing...)" >&4
9034 rp="What is the size of your file positions (in bytes)?"
9043 # probably will refer to
9044 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
9046 userelocatableinc=undef
9048 case "$vendorprefix" in
9049 '') d_vendorbin="$undef"
9053 *) d_vendorbin="$define"
9054 : determine where vendor-supplied executables go.
9055 case "$vendorbin" in
9056 '') dflt=$vendorprefix/bin ;;
9057 *) dflt="$vendorbin" ;;
9060 rp='Pathname for the vendor-supplied executables directory?'
9063 vendorbinexp="$ansexp"
9066 : Change installation prefix, if necessary.
9067 if $test X"$prefix" != X"$installprefix"; then
9068 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9070 installvendorbin="$vendorbinexp"
9073 case "$vendorprefix" in
9074 '') vendorhtml1dir=''
9075 vendorhtml1direxp=''
9077 *) : determine where vendor-supplied html pages go.
9078 : There is no standard location, so try to copy the previously-selected
9079 : directory structure for the core html pages.
9080 : XXX Better default suggestions would be welcome.
9081 case "$vendorhtml1dir" in
9082 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9083 *) dflt=$vendorhtml1dir ;;
9086 ''|' ') dflt=none ;;
9089 rp='Pathname for the vendor-supplied html pages?'
9091 vendorhtml1dir="$ans"
9092 vendorhtml1direxp="$ansexp"
9095 : Use ' ' for none so value is preserved next time through Configure
9096 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9097 : Change installation prefix, if necessary.
9098 if $test X"$prefix" != X"$installprefix"; then
9099 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9101 installvendorhtml1dir="$vendorhtml1direxp"
9104 case "$vendorprefix" in
9105 '') vendorhtml3dir=''
9106 vendorhtml3direxp=''
9108 *) : determine where vendor-supplied module html pages go.
9109 : There is no standard location, so try to copy the previously-selected
9110 : directory structure for the core html pages.
9111 : XXX Better default suggestions would be welcome.
9112 case "$vendorhtml3dir" in
9113 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9114 *) dflt=$vendorhtml3dir ;;
9117 ''|' ') dflt=none ;;
9120 rp='Pathname for the vendor-supplied html pages?'
9122 vendorhtml3dir="$ans"
9123 vendorhtml3direxp="$ansexp"
9126 : Use ' ' for none so value is preserved next time through Configure
9127 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9128 : Change installation prefix, if necessary.
9129 if $test X"$prefix" != X"$installprefix"; then
9130 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9132 installvendorhtml3dir="$vendorhtml3direxp"
9135 case "$vendorprefix" in
9136 '') vendorman1dir=''
9139 *) : determine where vendor-supplied manual pages go.
9140 case "$vendorman1dir" in
9141 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9142 *) dflt=$vendorman1dir ;;
9145 ''|' ') dflt=none ;;
9148 rp='Pathname for the vendor-supplied manual section 1 pages?'
9150 vendorman1dir="$ans"
9151 vendorman1direxp="$ansexp"
9154 : Use ' ' for none so value is preserved next time through Configure
9155 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9156 : Change installation prefix, if necessary.
9157 if $test X"$prefix" != X"$installprefix"; then
9158 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9160 installvendorman1dir="$vendorman1direxp"
9163 case "$vendorprefix" in
9164 '') vendorman3dir=''
9167 *) : determine where vendor-supplied module manual pages go.
9168 case "$vendorman3dir" in
9169 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9170 *) dflt=$vendorman3dir ;;
9173 ''|' ') dflt=none ;;
9176 rp='Pathname for the vendor-supplied manual section 3 pages?'
9178 vendorman3dir="$ans"
9179 vendorman3direxp="$ansexp"
9182 : Use ' ' for none so value is preserved next time through Configure
9183 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9184 : Change installation prefix, if necessary.
9185 if $test X"$prefix" != X"$installprefix"; then
9186 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9188 installvendorman3dir="$vendorman3direxp"
9191 case "$vendorprefix" in
9192 '') d_vendorscript="$undef"
9196 *) d_vendorscript="$define"
9197 : determine where vendor-supplied scripts go.
9198 case "$vendorscript" in
9199 '') dflt=$vendorprefix/script
9200 $test -d $dflt || dflt=$vendorbin ;;
9201 *) dflt="$vendorscript" ;;
9205 The installation process will create a directory for
9206 vendor-supplied scripts.
9210 rp='Pathname for the vendor-supplied scripts directory?'
9213 vendorscriptexp="$ansexp"
9216 : Change installation prefix, if necessary.
9217 if $test X"$prefix" != X"$installprefix"; then
9218 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9220 installvendorscript="$vendorscriptexp"
9223 : see if qgcvt exists
9229 if $test X"$d_longdbl" = X"$define"; then
9231 echo "Checking how to print long doubles..." >&4
9233 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9234 $cat >try.c <<'EOCP'
9235 #include <sys/types.h>
9239 printf("%.3f\n", d);
9243 if eval $compile; then
9247 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9248 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9249 echo "We will use %f."
9255 if $test X"$sPRIfldbl" = X; then
9256 $cat >try.c <<'EOCP'
9257 #include <sys/types.h>
9260 long double d = 123.456;
9261 printf("%.3Lf\n", d);
9265 if eval $compile; then
9269 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9270 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9271 echo "We will use %Lf."
9277 if $test X"$sPRIfldbl" = X; then
9278 $cat >try.c <<'EOCP'
9279 #include <sys/types.h>
9282 long double d = 123.456;
9283 printf("%.3llf\n", d);
9287 if eval $compile; then
9291 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9292 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9293 echo "We will use %llf."
9299 if $test X"$sPRIfldbl" = X; then
9300 $cat >try.c <<'EOCP'
9301 #include <sys/types.h>
9304 long double d = 123.456;
9305 printf("%.3lf\n", d);
9309 if eval $compile; then
9313 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9314 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9315 echo "We will use %lf."
9321 if $test X"$sPRIfldbl" = X; then
9322 echo "Cannot figure out how to print long doubles." >&4
9324 sSCNfldbl=$sPRIfldbl # expect consistency
9331 case "$sPRIfldbl" in
9332 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9333 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9334 d_SCNfldbl="$undef";
9336 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9337 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9338 d_SCNfldbl="$define";
9342 : Check how to convert floats to strings.
9344 if test "X$d_Gconvert" = X; then
9347 echo "Checking for an efficient way to convert floats to strings."
9349 case "$uselongdouble" in
9350 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9352 case "$d_longdbl" in
9353 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9355 case "$d_PRIgldbl" in
9356 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9360 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9361 char *myname = "gconvert";
9364 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9365 char *myname = "gcvt";
9368 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9369 char *myname = "qgcvt";
9370 #define DOUBLETYPE long double
9373 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9375 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9377 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9380 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9382 char *myname = "sprintf";
9386 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9387 #define DOUBLETYPE long double
9389 #define DOUBLETYPE double
9395 #define I_STDLIB $i_stdlib
9401 checkit(expect, got)
9405 if (strcmp(expect, got)) {
9406 printf("%s oddity: Expected %s, got %s\n",
9407 myname, expect, got);
9417 /* This must be 1st test on (which?) platform */
9418 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9419 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9420 checkit("0.1", buf);
9422 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9423 checkit("0.01", buf);
9425 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9426 checkit("0.001", buf);
9428 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9429 checkit("0.0001", buf);
9431 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9432 if (strlen(buf) > 5)
9433 checkit("9e-005", buf); /* for Microsoft ?? */
9435 checkit("9e-05", buf);
9437 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9440 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9441 checkit("1.1", buf);
9443 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9444 checkit("1.01", buf);
9446 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9447 checkit("1.001", buf);
9449 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9450 checkit("1.0001", buf);
9452 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9453 checkit("1.00001", buf);
9455 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9456 checkit("1.000001", buf);
9458 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9461 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9464 /* Some Linux gcvt's give 1.e+5 here. */
9465 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9466 checkit("100000", buf);
9468 /* Some Linux gcvt's give -1.e+5 here. */
9469 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9470 checkit("-100000", buf);
9472 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9473 checkit("123.456", buf);
9475 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9476 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9477 /* 34 should be enough to scare even long double
9478 * places into using the e notation. */
9479 if (strlen(buf) > 5)
9480 checkit("1e+034", buf); /* for Microsoft */
9482 checkit("1e+34", buf);
9484 /* For Perl, if you add additional tests here, also add them to
9485 * t/base/num.t for benefit of platforms not using Configure or
9486 * overriding d_Gconvert */
9491 : first add preferred functions to our list
9493 for xxx_convert in $gconvert_preference; do
9494 case $xxx_convert in
9495 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9496 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9499 : then add any others
9500 for xxx_convert in gconvert gcvt sprintf; do
9503 *) xxx_list="$xxx_list $xxx_convert" ;;
9507 case "$d_longdbl$uselongdouble" in
9509 : again, add prefered functions to our list first
9511 for xxx_convert in $gconvert_ld_preference; do
9512 case $xxx_convert in
9513 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9514 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9517 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9518 for xxx_convert in qgcvt sprintf $xxx_list; do
9519 case "$xxx_ld_list" in
9520 $xxx_convert*|*" $xxx_convert"*) ;;
9521 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9524 : if sprintf cannot do long doubles, move it to the end
9525 if test "$d_PRIgldbl" != "$define"; then
9526 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9528 : if no qgcvt, remove it
9529 if test "$d_qgcvt" != "$define"; then
9530 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9533 xxx_list="$xxx_ld_list"
9537 for xxx_convert in $xxx_list; do
9538 echo "Trying $xxx_convert..."
9540 set try -DTRY_$xxx_convert
9541 if eval $compile; then
9542 echo "$xxx_convert() found." >&4
9544 echo "I'll use $xxx_convert to convert floats into a string." >&4
9547 echo "...But $xxx_convert didn't work as I expected."
9551 echo "$xxx_convert NOT found." >&4
9555 if test X$xxx_convert = X; then
9556 echo "*** WHOA THERE!!! ***" >&4
9557 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9561 case "$xxx_convert" in
9562 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9563 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9564 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9565 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9566 "$define$define$define")
9567 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9568 "$define$define$undef")
9569 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9570 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9577 : see if _fwalk exists
9581 : Initialize h_fcntl
9584 : Initialize h_sysfile
9587 : access call always available on UNIX
9591 : locate the flags for 'access()'
9595 $cat >access.c <<EOCP
9596 #include <sys/types.h>
9601 #include <sys/file.h>
9614 : check sys/file.h first, no particular reason here
9615 if $test `./findhdr sys/file.h` && \
9616 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9618 echo "<sys/file.h> defines the *_OK access constants." >&4
9619 elif $test `./findhdr fcntl.h` && \
9620 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9622 echo "<fcntl.h> defines the *_OK access constants." >&4
9623 elif $test `./findhdr unistd.h` && \
9624 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9625 echo "<unistd.h> defines the *_OK access constants." >&4
9627 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9633 : see if accessx exists
9634 set accessx d_accessx
9637 : see if aintl exists
9641 : see if alarm exists
9645 : see if POSIX threads are available
9646 set pthread.h i_pthread
9649 : define a fucntion to check prototypes
9650 $cat > protochk <<EOSH
9653 optimize="$optimize"
9655 prototype="$prototype"
9658 usethreads=$usethreads
9659 i_pthread=$i_pthread
9660 pthread_h_first=$pthread_h_first
9663 $cat >> protochk <<'EOSH'
9668 while test $# -ge 2; do
9670 $define) echo "#include <$2>" >> try.c ;;
9671 literal) echo "$2" >> try.c ;;
9673 # Extra magic for the benefit of systems that need pthread.h
9674 # to be included early to correctly detect threadsafe functions.
9675 # Such functions must guarantee themselves, though, that the usethreads
9676 # and i_pthread have been defined, before calling protochk.
9677 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9678 echo "#include <pthread.h>" >> try.c
9683 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9684 cat >> try.c <<'EOCP'
9685 #ifdef CAN_PROTOTYPE
9686 #define _(args) args
9691 echo "$foo" >> try.c
9692 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9693 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9701 hasproto='varname=$1; func=$2; shift; shift;
9702 while $test $# -ge 2; do
9704 $define) echo "#include <$2>";;
9708 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9709 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9710 echo "$func() prototype found.";
9713 echo "$func() prototype NOT found.";
9718 $rm -f try.c tryout.c'
9720 : see if sys/types.h has to be included
9721 set sys/types.h i_systypes
9724 : see if sys/select.h has to be included
9725 set sys/select.h i_sysselct
9728 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9729 while $test $# -ge 2; do
9731 $define) echo "#include <$2>";;
9735 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9737 if eval $compile; then
9746 : see if we should include time.h, sys/time.h, or both
9748 if test "X$timeincl" = X; then
9749 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9750 $echo $n "I'm now running the test program...$c"
9752 #include <sys/types.h>
9757 #ifdef SYSTIMEKERNEL
9760 #include <sys/time.h>
9763 #include <sys/select.h>
9776 struct timezone tzp;
9778 if (foo.tm_sec == foo.tm_sec)
9781 if (bar.tv_sec == bar.tv_sec)
9788 for s_timezone in '-DS_TIMEZONE' ''; do
9790 for s_timeval in '-DS_TIMEVAL' ''; do
9791 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9792 for i_time in '' '-DI_TIME'; do
9793 for i_systime in '-DI_SYSTIME' ''; do
9796 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9797 if eval $compile; then
9798 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9802 $echo $n "Succeeded with $flags$c"
9814 *SYSTIMEKERNEL*) i_systimek="$define"
9815 timeincl=`./findhdr sys/time.h`
9816 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9817 *) i_systimek="$undef";;
9820 *I_TIME*) i_time="$define"
9821 timeincl=`./findhdr time.h`" $timeincl"
9822 echo "We'll include <time.h>." >&4;;
9823 *) i_time="$undef";;
9826 *I_SYSTIME*) i_systime="$define"
9827 timeincl=`./findhdr sys/time.h`" $timeincl"
9828 echo "We'll include <sys/time.h>." >&4;;
9829 *) i_systime="$undef";;
9833 : see if struct tm knows about tm_zone
9834 case "$i_systime$i_time" in
9837 echo "Checking to see if your struct tm has tm_zone field..." >&4
9838 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9846 case "$d_tm_tm_zone" in
9847 "$define") echo "Yes, it does." ;;
9848 *) echo "No, it doesn't." ;;
9850 : see if struct tm knows about tm_gmtoff
9851 case "$i_systime$i_time" in
9854 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9855 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9863 case "$d_tm_tm_gmtoff" in
9864 "$define") echo "Yes, it does." ;;
9865 *) echo "No, it doesn't." ;;
9868 : see if asctime_r exists
9869 set asctime_r d_asctime_r
9871 case "$d_asctime_r" in
9873 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9874 case "$d_asctime_r_proto:$usethreads" in
9875 ":define") d_asctime_r_proto=define
9876 set d_asctime_r_proto asctime_r $hdrs
9880 case "$d_asctime_r_proto" in
9882 case "$asctime_r_proto" in
9883 ''|0) try='char* asctime_r(const struct tm*, char*);'
9884 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9886 case "$asctime_r_proto" in
9887 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9888 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9890 case "$asctime_r_proto" in
9891 ''|0) try='int asctime_r(const struct tm*, char*);'
9892 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9894 case "$asctime_r_proto" in
9895 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9896 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9898 case "$asctime_r_proto" in
9899 ''|0) d_asctime_r=undef
9901 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9902 * ) case "$asctime_r_proto" in
9903 REENTRANT_PROTO*) ;;
9904 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9906 echo "Prototype: $try" ;;
9909 *) case "$usethreads" in
9910 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9917 *) asctime_r_proto=0
9921 : see if atolf exists
9925 : see if atoll exists
9929 : Look for GCC-style attribute format
9930 case "$d_attribute_format" in
9933 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9934 $cat >attrib.c <<'EOCP'
9936 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9938 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9939 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9940 echo "Your C compiler doesn't support __attribute__((format))."
9943 echo "Your C compiler supports __attribute__((format))."
9947 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9951 *) val="$d_attribute_format" ;;
9953 set d_attribute_format
9957 : Look for GCC-style attribute malloc
9958 case "$d_attribute_malloc" in
9961 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9962 $cat >attrib.c <<'EOCP'
9964 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9966 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9967 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9968 echo "Your C compiler doesn't support __attribute__((malloc))."
9971 echo "Your C compiler supports __attribute__((malloc))."
9975 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9979 *) val="$d_attribute_malloc" ;;
9981 set d_attribute_malloc
9985 : Look for GCC-style attribute nonnull
9986 case "$d_attribute_nonnull" in
9989 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9990 $cat >attrib.c <<'EOCP'
9992 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9994 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9995 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9996 echo "Your C compiler doesn't support __attribute__((nonnull))."
9999 echo "Your C compiler supports __attribute__((nonnull))."
10003 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10007 *) val="$d_attribute_nonnull" ;;
10009 set d_attribute_nonnull
10013 : Look for GCC-style attribute noreturn
10014 case "$d_attribute_noreturn" in
10017 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10018 $cat >attrib.c <<'EOCP'
10020 void fall_over_dead( void ) __attribute__((noreturn));
10022 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10023 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10024 echo "Your C compiler doesn't support __attribute__((noreturn))."
10027 echo "Your C compiler supports __attribute__((noreturn))."
10031 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10035 *) val="$d_attribute_noreturn" ;;
10037 set d_attribute_noreturn
10041 : Look for GCC-style attribute pure
10042 case "$d_attribute_pure" in
10045 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10046 $cat >attrib.c <<'EOCP'
10048 int square( int n ) __attribute__((pure));
10050 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10051 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10052 echo "Your C compiler doesn't support __attribute__((pure))."
10055 echo "Your C compiler supports __attribute__((pure))."
10059 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10063 *) val="$d_attribute_pure" ;;
10065 set d_attribute_pure
10069 : Look for GCC-style attribute unused
10070 case "$d_attribute_unused" in
10073 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10074 $cat >attrib.c <<'EOCP'
10076 int do_something( int dummy __attribute__((unused)), int n );
10078 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10079 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10080 echo "Your C compiler doesn't support __attribute__((unused))."
10083 echo "Your C compiler supports __attribute__((unused))."
10087 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10091 *) val="$d_attribute_unused" ;;
10093 set d_attribute_unused
10097 : Look for GCC-style attribute warn_unused_result
10098 case "$d_attribute_warn_unused_result" in
10101 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10102 $cat >attrib.c <<'EOCP'
10104 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10106 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10107 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10108 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10111 echo "Your C compiler supports __attribute__((warn_unused_result))."
10115 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10119 *) val="$d_attribute_warn_unused_result" ;;
10121 set d_attribute_warn_unused_result
10125 : see if bcmp exists
10129 : see if bcopy exists
10133 : see if this is a unistd.h system
10134 set unistd.h i_unistd
10137 : see if getpgrp exists
10138 set getpgrp d_getpgrp
10141 case "$d_getpgrp" in
10144 echo "Checking to see which flavor of getpgrp is in use..."
10146 #$i_unistd I_UNISTD
10147 #include <sys/types.h>
10149 # include <unistd.h>
10151 #$i_stdlib I_STDLIB
10153 #include <stdlib.h>
10157 if (getuid() == 0) {
10158 printf("(I see you are running Configure as super-user...)\n");
10161 #ifdef TRY_BSD_PGRP
10162 if (getpgrp(1) == 0)
10171 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10172 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10174 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10175 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10178 echo "I can't seem to compile and run the test program."
10180 xxx="a USG one, i.e. you use getpgrp()."
10182 # SVR4 systems can appear rather BSD-ish.
10183 case "$i_unistd" in
10185 xxx="a BSD one, i.e. you use getpgrp(pid)."
10189 xxx="probably a USG one, i.e. you use getpgrp()."
10194 echo "Assuming your getpgrp is $xxx" >&4
10203 : see if setpgrp exists
10204 set setpgrp d_setpgrp
10207 case "$d_setpgrp" in
10210 echo "Checking to see which flavor of setpgrp is in use..."
10212 #$i_unistd I_UNISTD
10213 #include <sys/types.h>
10215 # include <unistd.h>
10217 #$i_stdlib I_STDLIB
10219 #include <stdlib.h>
10223 if (getuid() == 0) {
10224 printf("(I see you are running Configure as super-user...)\n");
10227 #ifdef TRY_BSD_PGRP
10228 if (-1 == setpgrp(1, 1))
10231 if (setpgrp() != -1)
10237 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10238 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10240 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10241 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10244 echo "(I can't seem to compile and run the test program.)"
10246 xxx="a USG one, i.e. you use setpgrp()."
10248 # SVR4 systems can appear rather BSD-ish.
10249 case "$i_unistd" in
10251 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10255 xxx="probably a USG one, i.e. you use setpgrp()."
10260 echo "Assuming your setpgrp is $xxx" >&4
10268 : Look for GCC-style __builtin_choose_expr
10269 case "$d_builtin_choose_expr" in
10272 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10273 $cat >try.c <<'EOCP'
10274 #include <assert.h>
10275 #include <stdlib.h>
10278 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10281 assert( SYRINX(1) == 2112 );
10282 assert( SYRINX(1) != 5150 );
10283 assert( SYRINX(0) == 5150 );
10284 assert( SYRINX(0) != 2112 );
10285 puts( "All good!" );
10291 if eval $compile; then
10292 echo "Your C compiler supports __builtin_choose_expr."
10295 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10299 *) val="$d_builtin_choose_expr" ;;
10302 set d_builtin_choose_expr
10304 $rm -f try.* try core core.try.*
10306 : Look for GCC-style __builtin_expect
10307 case "$d_builtin_expect" in
10310 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10311 $cat >builtin.c <<'EOCP'
10314 if ( __builtin_expect(n, 0) ) n = 1;
10318 if eval $compile; then
10319 echo "Your C compiler supports __builtin_choose_expr."
10322 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10326 *) val="$d_builtin_expect" ;;
10329 set d_builtin_expect
10331 $rm -f try.* try core core.try.*
10333 : see if bzero exists
10337 : see if signal is declared as pointer to function returning int or void
10339 xxx=`./findhdr signal.h`
10340 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10341 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10342 echo "You have int (*signal())() instead of void." >&4
10344 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10345 echo "You have void (*signal())()." >&4
10347 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10348 echo "You have int (*signal())() instead of void." >&4
10350 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10351 echo "You have void (*signal())()." >&4
10354 case "$d_voidsig" in
10356 echo "I can't determine whether signal handler returns void or int..." >&4
10358 rp="What type does your signal handler return?"
10361 v*) val="$define";;
10365 echo "As you already told me, signal handler returns void." >&4
10368 *) echo "As you already told me, signal handler returns int." >&4
10375 case "$d_voidsig" in
10376 "$define") signal_t="void";;
10377 *) signal_t="int";;
10381 : check for ability to cast large floats to 32-bit ints.
10383 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10384 if $test "$intsize" -ge 4; then
10391 #$i_stdlib I_STDLIB
10393 #include <stdlib.h>
10395 #include <sys/types.h>
10396 #include <signal.h>
10397 $signal_t blech(s) int s; { exit(3); }
10404 signal(SIGFPE, blech);
10406 /* Don't let compiler optimize the test away. Store the number
10407 in a writable string for gcc to pass to sscanf under HP/UX.
10409 sprintf(str, "2147483647");
10410 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10414 /* x86 processors will probably give 0x8000 0000, which is a
10415 sign change. We don't want that. We want to mimic SPARC
10416 behavior here, which is to preserve the sign and give
10419 if (i32 != ($xxx) f)
10425 if eval $compile_ok; then
10429 echo "(I can't seem to compile the test program--assuming it can't)"
10434 echo "Yup, it can."
10437 echo "Nope, it can't."
10444 : check for ability to cast negative floats to unsigned
10446 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10449 #$i_stdlib I_STDLIB
10451 #include <stdlib.h>
10453 #include <sys/types.h>
10454 #include <signal.h>
10455 $signal_t blech(s) int s; { exit(7); }
10456 $signal_t blech_in_list(s) int s; { exit(4); }
10457 unsigned long dummy_long(p) unsigned long p; { return p; }
10458 unsigned int dummy_int(p) unsigned int p; { return p; }
10459 unsigned short dummy_short(p) unsigned short p; { return p; }
10463 unsigned long along;
10465 unsigned short ashort;
10469 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10470 a direct f = -123. assignment. gcc-2.8.0 reportedly
10471 optimized the whole file away
10473 /* Store the number in a writable string for gcc to pass to
10474 sscanf under HP/UX.
10476 sprintf(str, "-123");
10477 sscanf(str, "%lf", &f); /* f = -123.; */
10479 signal(SIGFPE, blech);
10480 along = (unsigned long)f;
10481 aint = (unsigned int)f;
10482 ashort = (unsigned short)f;
10483 if (along != (unsigned long)-123)
10485 if (aint != (unsigned int)-123)
10487 if (ashort != (unsigned short)-123)
10489 sprintf(str, "1073741824.");
10490 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10493 along = (unsigned long)f;
10494 if (along != 0x80000000)
10498 along = (unsigned long)f;
10499 if (along != 0x7fffffff)
10503 along = (unsigned long)f;
10504 if (along != 0x80000001)
10508 signal(SIGFPE, blech_in_list);
10509 sprintf(str, "123.");
10510 sscanf(str, "%lf", &f); /* f = 123.; */
10511 along = dummy_long((unsigned long)f);
10512 aint = dummy_int((unsigned int)f);
10513 ashort = dummy_short((unsigned short)f);
10514 if (along != (unsigned long)123)
10516 if (aint != (unsigned int)123)
10518 if (ashort != (unsigned short)123)
10525 if eval $compile_ok; then
10529 echo "(I can't seem to compile the test program--assuming it can't)"
10532 case "$castflags" in
10534 echo "Yup, it can."
10537 echo "Nope, it can't."
10544 : see if vprintf exists
10546 if set vprintf val -f d_vprintf; eval $csym; $val; then
10547 echo 'vprintf() found.' >&4
10550 #include <varargs.h>
10551 #$i_stdlib I_STDLIB
10553 #include <stdlib.h>
10556 int main() { xxx("foo"); }
10565 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10569 if eval $compile && $run ./try; then
10570 echo "Your vsprintf() returns (int)." >&4
10573 echo "Your vsprintf() returns (char*)." >&4
10577 echo 'vprintf() NOT found.' >&4
10588 : see if chown exists
10592 : see if chroot exists
10593 set chroot d_chroot
10596 : see if chsize exists
10597 set chsize d_chsize
10600 : see if class exists
10604 : see if clearenv exists
10605 set clearenv d_clearenv
10608 hasstruct='varname=$1; struct=$2; shift; shift;
10609 while $test $# -ge 2; do
10611 $define) echo "#include <$2>";;
10615 echo "int main () { struct $struct foo; }" >> try.c;
10617 if eval $compile; then
10624 $rm -f try.c try.o'
10628 : see whether socket exists
10630 $echo $n "Hmm... $c" >&4
10631 if set socket val -f d_socket; eval $csym; $val; then
10632 echo "Looks like you have Berkeley networking support." >&4
10634 if set setsockopt val -f; eval $csym; $val; then
10637 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10638 d_oldsock="$define"
10641 if $contains socklib libc.list >/dev/null 2>&1; then
10642 echo "Looks like you have Berkeley networking support." >&4
10644 : we will have to assume that it supports the 4.2 BSD interface
10647 echo "You don't have Berkeley networking in libc$_a..." >&4
10648 if test "X$d_socket" = "X$define"; then
10649 echo "...but you seem to believe that you have sockets." >&4
10651 for net in net socket
10653 if test -f /usr/lib/lib$net$_a; then
10654 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10655 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10656 if $contains socket libc.list >/dev/null 2>&1; then
10661 echo "...but the Wollongong group seems to have hacked it in." >&4
10662 sockethdr="-I/usr/netinclude"
10665 echo "Found Berkeley sockets interface in lib$net." >&4
10666 if $contains setsockopt libc.list >/dev/null 2>&1; then
10669 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10670 d_oldsock="$define"
10676 if test "X$d_socket" != "X$define"; then
10677 echo "or anywhere else I see." >&4
10685 : see if socketpair exists
10686 set socketpair d_sockpair
10691 echo "Checking the availability of certain socket constants..." >&4
10692 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10693 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10695 #include <sys/types.h>
10696 #include <sys/socket.h>
10702 set try; if eval $compile; then
10705 set d_${enum}; eval $setvar
10709 : see if this is a sys/uio.h system
10710 set sys/uio.h i_sysuio
10715 echo "Checking to see if your system supports struct cmsghdr..." >&4
10716 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10718 case "$d_cmsghdr_s" in
10719 "$define") echo "Yes, it does." ;;
10720 *) echo "No, it doesn't." ;;
10724 : check for const keyword
10726 echo 'Checking to see if your C compiler knows about "const"...' >&4
10727 $cat >const.c <<'EOCP'
10728 typedef struct spug { int drokk; } spug;
10735 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10737 echo "Yup, it does."
10740 echo "Nope, it doesn't."
10745 : see if copysignl exists
10746 set copysignl d_copysignl
10749 : see if crypt exists
10754 $define) cryptlib='' ;;
10755 *) if set crypt val -f d_crypt; eval $csym; $val; then
10756 echo 'crypt() found.' >&4
10760 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10761 if $test -z "$cryptlib"; then
10762 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10766 if $test -z "$cryptlib"; then
10767 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10771 if $test -z "$cryptlib"; then
10772 cryptlib=`./loc libcrypt$_a "" $libpth`
10776 if $test -z "$cryptlib"; then
10777 echo 'crypt() NOT found.' >&4
10788 : see if this is a crypt.h system
10789 set crypt.h i_crypt
10792 : see if crypt_r exists
10793 set crypt_r d_crypt_r
10795 case "$d_crypt_r" in
10797 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10798 case "$d_crypt_r_proto:$usethreads" in
10799 ":define") d_crypt_r_proto=define
10800 set d_crypt_r_proto crypt_r $hdrs
10804 case "$d_crypt_r_proto" in
10806 case "$crypt_r_proto" in
10807 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10808 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10810 case "$crypt_r_proto" in
10811 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10812 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10814 case "$crypt_r_proto" in
10815 ''|0) d_crypt_r=undef
10817 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10818 * ) case "$crypt_r_proto" in
10819 REENTRANT_PROTO*) ;;
10820 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10822 echo "Prototype: $try" ;;
10825 *) case "$usethreads" in
10826 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10837 : get csh whereabouts
10839 'csh') val="$undef" ;;
10840 *) val="$define" ;;
10844 : Respect a hint or command line value for full_csh.
10845 case "$full_csh" in
10846 '') full_csh=$csh ;;
10849 : see if ctermid_r exists
10850 set ctermid_r d_ctermid_r
10852 case "$d_ctermid_r" in
10854 hdrs="$i_systypes sys/types.h define stdio.h "
10855 case "$d_ctermid_r_proto:$usethreads" in
10856 ":define") d_ctermid_r_proto=define
10857 set d_ctermid_r_proto ctermid_r $hdrs
10861 case "$d_ctermid_r_proto" in
10863 case "$ctermid_r_proto" in
10864 ''|0) try='char* ctermid_r(char*);'
10865 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10867 case "$ctermid_r_proto" in
10868 ''|0) d_ctermid_r=undef
10870 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10871 * ) case "$ctermid_r_proto" in
10872 REENTRANT_PROTO*) ;;
10873 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10875 echo "Prototype: $try" ;;
10878 *) case "$usethreads" in
10879 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10886 *) ctermid_r_proto=0
10890 : see if ctime_r exists
10891 set ctime_r d_ctime_r
10893 case "$d_ctime_r" in
10895 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10896 case "$d_ctime_r_proto:$usethreads" in
10897 ":define") d_ctime_r_proto=define
10898 set d_ctime_r_proto ctime_r $hdrs
10902 case "$d_ctime_r_proto" in
10904 case "$ctime_r_proto" in
10905 ''|0) try='char* ctime_r(const time_t*, char*);'
10906 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10908 case "$ctime_r_proto" in
10909 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10910 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10912 case "$ctime_r_proto" in
10913 ''|0) try='int ctime_r(const time_t*, char*);'
10914 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10916 case "$ctime_r_proto" in
10917 ''|0) try='int ctime_r(const time_t*, char*, int);'
10918 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10920 case "$ctime_r_proto" in
10921 ''|0) d_ctime_r=undef
10923 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10924 * ) case "$ctime_r_proto" in
10925 REENTRANT_PROTO*) ;;
10926 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10928 echo "Prototype: $try" ;;
10931 *) case "$usethreads" in
10932 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10943 : see if cuserid exists
10944 set cuserid d_cuserid
10947 : see if this is a limits.h system
10948 set limits.h i_limits
10951 : see if this is a float.h system
10952 set float.h i_float
10955 : See if number of significant digits in a double precision number is known
10957 $cat >dbl_dig.c <<EOM
10958 #$i_limits I_LIMITS
10961 #include <limits.h>
10967 printf("Contains DBL_DIG");
10970 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10971 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10972 echo "DBL_DIG found." >&4
10975 echo "DBL_DIG NOT found." >&4
10982 : see if dbm.h is available
10983 : see if dbmclose exists
10984 set dbmclose d_dbmclose
10987 case "$d_dbmclose" in
10997 *) set rpcsvc/dbm.h i_rpcsvcdbm
11002 *) echo "We won't be including <dbm.h>"
11012 : see if prototype for dbminit is available
11014 set d_dbminitproto dbminit $i_dbm dbm.h
11017 : see if difftime exists
11018 set difftime d_difftime
11021 : see if this is a dirent system
11023 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11025 echo "<dirent.h> found." >&4
11028 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11029 echo "<sys/dir.h> found." >&4
11032 xinc=`./findhdr sys/ndir.h`
11034 echo "<dirent.h> NOT found." >&4
11039 : Look for type of directory structure.
11041 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11043 case "$direntrytype" in
11045 case "$i_dirent" in
11046 $define) guess1='struct dirent' ;;
11047 *) guess1='struct direct' ;;
11050 *) guess1="$direntrytype"
11055 'struct dirent') guess2='struct direct' ;;
11056 *) guess2='struct dirent' ;;
11059 if $contains "$guess1" try.c >/dev/null 2>&1; then
11060 direntrytype="$guess1"
11061 echo "Your directory entries are $direntrytype." >&4
11062 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11063 direntrytype="$guess2"
11064 echo "Your directory entries seem to be $direntrytype." >&4
11066 echo "I don't recognize your system's directory entries." >&4
11067 rp="What type is used for directory entries on this system?"
11070 direntrytype="$ans"
11075 : see if the directory entry stores field length
11077 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11078 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11079 echo "Good, your directory entry keeps length information in d_namlen." >&4
11082 echo "Your directory entry does not know about the d_namlen field." >&4
11089 : see if this is an sysdir system
11090 set sys/dir.h i_sysdir
11093 : see if this is an sysndir system
11094 set sys/ndir.h i_sysndir
11099 $cat >dirfd.c <<EOM
11101 #$i_stdlib I_STDLIB
11103 #include <stdlib.h>
11105 #$i_dirent I_DIRENT /**/
11106 #$i_sysdir I_SYS_DIR /**/
11107 #$i_sysndir I_SYS_NDIR /**/
11108 #$i_systypes I_SYS_TYPES /**/
11109 #if defined(I_SYS_TYPES)
11110 #include <sys/types.h>
11112 #if defined(I_DIRENT)
11113 #include <dirent.h>
11114 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11115 #include <sys/dir.h>
11119 #include <sys/ndir.h>
11123 #include <ndir.h> /* may be wrong in the future */
11125 #include <sys/dir.h>
11131 DIR *dirp = opendir(".");
11132 if (dirfd(dirp) >= 0)
11140 if eval $compile; then
11144 $define) echo "dirfd() found." >&4 ;;
11145 *) echo "dirfd() NOT found." >&4 ;;
11151 : see if dlerror exists
11154 set dlerror d_dlerror
11158 : see if dlfcn is available
11159 set dlfcn.h i_dlfcn
11166 On a few systems, the dynamically loaded modules that perl generates and uses
11167 will need a different extension than shared libs. The default will probably
11173 *) dflt="$dlext" ;;
11175 rp='What is the extension of dynamically loaded modules'
11184 : Check if dlsym need a leading underscore
11190 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11191 $cat >dyna.c <<'EOM'
11198 #$i_stdlib I_STDLIB
11200 #include <stdlib.h>
11204 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11206 #include <sys/types.h>
11211 extern int fred() ;
11220 int mode = RTLD_LAZY ;
11222 handle = dlopen("./dyna.$dlext", mode) ;
11223 if (handle == NULL) {
11228 symbol = dlsym(handle, "fred") ;
11229 if (symbol == NULL) {
11230 /* try putting a leading underscore */
11231 symbol = dlsym(handle, "_fred") ;
11232 if (symbol == NULL) {
11245 : Call the object file tmp-dyna.o in case dlext=o.
11246 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11247 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11248 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11249 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11252 1) echo "Test program failed using dlopen." >&4
11253 echo "Perhaps you should not use dynamic loading." >&4;;
11254 2) echo "Test program failed using dlsym." >&4
11255 echo "Perhaps you should not use dynamic loading." >&4;;
11256 3) echo "dlsym needs a leading underscore" >&4
11258 4) echo "dlsym doesn't need a leading underscore." >&4;;
11261 echo "I can't compile and run the test program." >&4
11262 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11267 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11272 : see if drand48_r exists
11273 set drand48_r d_drand48_r
11275 case "$d_drand48_r" in
11277 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11278 case "$d_drand48_r_proto:$usethreads" in
11279 ":define") d_drand48_r_proto=define
11280 set d_drand48_r_proto drand48_r $hdrs
11284 case "$d_drand48_r_proto" in
11286 case "$drand48_r_proto" in
11287 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11288 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11290 case "$drand48_r_proto" in
11291 ''|0) d_drand48_r=undef
11293 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11294 * ) case "$drand48_r_proto" in
11295 REENTRANT_PROTO*) ;;
11296 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11298 echo "Prototype: $try" ;;
11301 *) case "$usethreads" in
11302 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11309 *) drand48_r_proto=0
11313 : see if prototype for drand48 is available
11315 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11318 : see if dup2 exists
11322 : see if eaccess exists
11323 set eaccess d_eaccess
11326 : see if endgrent exists
11327 set endgrent d_endgrent
11330 : see if this is an grp system
11336 xxx=`./findhdr grp.h`
11337 $cppstdin $cppflags $cppminus < $xxx >$$.h
11339 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11351 set d_grpasswd; eval $setvar
11355 : see if endgrent_r exists
11356 set endgrent_r d_endgrent_r
11358 case "$d_endgrent_r" in
11360 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11361 case "$d_endgrent_r_proto:$usethreads" in
11362 ":define") d_endgrent_r_proto=define
11363 set d_endgrent_r_proto endgrent_r $hdrs
11367 case "$d_endgrent_r_proto" in
11369 case "$endgrent_r_proto" in
11370 ''|0) try='int endgrent_r(FILE**);'
11371 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11373 case "$endgrent_r_proto" in
11374 ''|0) try='void endgrent_r(FILE**);'
11375 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11377 case "$endgrent_r_proto" in
11378 ''|0) d_endgrent_r=undef
11380 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11381 * ) case "$endgrent_r_proto" in
11382 REENTRANT_PROTO*) ;;
11383 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11385 echo "Prototype: $try" ;;
11388 *) case "$usethreads" in
11389 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11396 *) endgrent_r_proto=0
11400 : see if endhostent exists
11401 set endhostent d_endhent
11404 : see if this is a netdb.h system
11405 set netdb.h i_netdb
11408 : see if endhostent_r exists
11409 set endhostent_r d_endhostent_r
11411 case "$d_endhostent_r" in
11413 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11414 case "$d_endhostent_r_proto:$usethreads" in
11415 ":define") d_endhostent_r_proto=define
11416 set d_endhostent_r_proto endhostent_r $hdrs
11420 case "$d_endhostent_r_proto" in
11422 case "$endhostent_r_proto" in
11423 ''|0) try='int endhostent_r(struct hostent_data*);'
11424 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11426 case "$endhostent_r_proto" in
11427 ''|0) try='void endhostent_r(struct hostent_data*);'
11428 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11430 case "$endhostent_r_proto" in
11431 ''|0) d_endhostent_r=undef
11432 endhostent_r_proto=0
11433 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11434 * ) case "$endhostent_r_proto" in
11435 REENTRANT_PROTO*) ;;
11436 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11438 echo "Prototype: $try" ;;
11441 *) case "$usethreads" in
11442 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11444 d_endhostent_r=undef
11445 endhostent_r_proto=0
11449 *) endhostent_r_proto=0
11453 : see if endnetent exists
11454 set endnetent d_endnent
11457 : see if endnetent_r exists
11458 set endnetent_r d_endnetent_r
11460 case "$d_endnetent_r" in
11462 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11463 case "$d_endnetent_r_proto:$usethreads" in
11464 ":define") d_endnetent_r_proto=define
11465 set d_endnetent_r_proto endnetent_r $hdrs
11469 case "$d_endnetent_r_proto" in
11471 case "$endnetent_r_proto" in
11472 ''|0) try='int endnetent_r(struct netent_data*);'
11473 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11475 case "$endnetent_r_proto" in
11476 ''|0) try='void endnetent_r(struct netent_data*);'
11477 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11479 case "$endnetent_r_proto" in
11480 ''|0) d_endnetent_r=undef
11481 endnetent_r_proto=0
11482 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11483 * ) case "$endnetent_r_proto" in
11484 REENTRANT_PROTO*) ;;
11485 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11487 echo "Prototype: $try" ;;
11490 *) case "$usethreads" in
11491 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11493 d_endnetent_r=undef
11494 endnetent_r_proto=0
11498 *) endnetent_r_proto=0
11502 : see if endprotoent exists
11503 set endprotoent d_endpent
11506 : see if endprotoent_r exists
11507 set endprotoent_r d_endprotoent_r
11509 case "$d_endprotoent_r" in
11511 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11512 case "$d_endprotoent_r_proto:$usethreads" in
11513 ":define") d_endprotoent_r_proto=define
11514 set d_endprotoent_r_proto endprotoent_r $hdrs
11518 case "$d_endprotoent_r_proto" in
11520 case "$endprotoent_r_proto" in
11521 ''|0) try='int endprotoent_r(struct protoent_data*);'
11522 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11524 case "$endprotoent_r_proto" in
11525 ''|0) try='void endprotoent_r(struct protoent_data*);'
11526 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11528 case "$endprotoent_r_proto" in
11529 ''|0) d_endprotoent_r=undef
11530 endprotoent_r_proto=0
11531 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11532 * ) case "$endprotoent_r_proto" in
11533 REENTRANT_PROTO*) ;;
11534 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11536 echo "Prototype: $try" ;;
11539 *) case "$usethreads" in
11540 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11542 d_endprotoent_r=undef
11543 endprotoent_r_proto=0
11547 *) endprotoent_r_proto=0
11551 : see if endpwent exists
11552 set endpwent d_endpwent
11555 : see if this is a pwd.h system
11561 xxx=`./findhdr pwd.h`
11562 $cppstdin $cppflags $cppminus < $xxx >$$.h
11564 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11572 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11580 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11588 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11596 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11604 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11612 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11620 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11632 set d_pwquota; eval $setvar
11633 set d_pwage; eval $setvar
11634 set d_pwchange; eval $setvar
11635 set d_pwclass; eval $setvar
11636 set d_pwexpire; eval $setvar
11637 set d_pwcomment; eval $setvar
11638 set d_pwgecos; eval $setvar
11639 set d_pwpasswd; eval $setvar
11643 : see if endpwent_r exists
11644 set endpwent_r d_endpwent_r
11646 case "$d_endpwent_r" in
11648 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11649 case "$d_endpwent_r_proto:$usethreads" in
11650 ":define") d_endpwent_r_proto=define
11651 set d_endpwent_r_proto endpwent_r $hdrs
11655 case "$d_endpwent_r_proto" in
11657 case "$endpwent_r_proto" in
11658 ''|0) try='int endpwent_r(FILE**);'
11659 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11661 case "$endpwent_r_proto" in
11662 ''|0) try='void endpwent_r(FILE**);'
11663 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11665 case "$endpwent_r_proto" in
11666 ''|0) d_endpwent_r=undef
11668 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11669 * ) case "$endpwent_r_proto" in
11670 REENTRANT_PROTO*) ;;
11671 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11673 echo "Prototype: $try" ;;
11676 *) case "$usethreads" in
11677 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11684 *) endpwent_r_proto=0
11688 : see if endservent exists
11689 set endservent d_endsent
11692 : see if endservent_r exists
11693 set endservent_r d_endservent_r
11695 case "$d_endservent_r" in
11697 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11698 case "$d_endservent_r_proto:$usethreads" in
11699 ":define") d_endservent_r_proto=define
11700 set d_endservent_r_proto endservent_r $hdrs
11704 case "$d_endservent_r_proto" in
11706 case "$endservent_r_proto" in
11707 ''|0) try='int endservent_r(struct servent_data*);'
11708 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11710 case "$endservent_r_proto" in
11711 ''|0) try='void endservent_r(struct servent_data*);'
11712 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11714 case "$endservent_r_proto" in
11715 ''|0) d_endservent_r=undef
11716 endservent_r_proto=0
11717 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11718 * ) case "$endservent_r_proto" in
11719 REENTRANT_PROTO*) ;;
11720 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11722 echo "Prototype: $try" ;;
11725 *) case "$usethreads" in
11726 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11728 d_endservent_r=undef
11729 endservent_r_proto=0
11733 *) endservent_r_proto=0
11737 : Locate the flags for 'open()'
11740 #include <sys/types.h>
11745 #include <sys/file.h>
11747 #$i_stdlib I_STDLIB
11749 #include <stdlib.h>
11760 : check sys/file.h first to get FREAD on Sun
11761 if $test `./findhdr sys/file.h` && \
11762 set try -DI_SYS_FILE && eval $compile; then
11764 echo "<sys/file.h> defines the O_* constants..." >&4
11765 if $run ./try; then
11766 echo "and you have the 3 argument form of open()." >&4
11769 echo "but not the 3 argument form of open(). Oh, well." >&4
11772 elif $test `./findhdr fcntl.h` && \
11773 set try -DI_FCNTL && eval $compile; then
11775 echo "<fcntl.h> defines the O_* constants..." >&4
11776 if $run ./try; then
11777 echo "and you have the 3 argument form of open()." >&4
11780 echo "but not the 3 argument form of open(). Oh, well." >&4
11785 echo "I can't find the O_* constant definitions! You got problems." >&4
11791 : see which of string.h or strings.h is needed
11793 strings=`./findhdr string.h`
11794 if $test "$strings" && $test -r "$strings"; then
11795 echo "Using <string.h> instead of <strings.h>." >&4
11799 strings=`./findhdr strings.h`
11800 if $test "$strings" && $test -r "$strings"; then
11801 echo "Using <strings.h> instead of <string.h>." >&4
11803 echo "No string header found -- You'll surely have problems." >&4
11808 case "$i_string" in
11809 "$undef") strings=`./findhdr strings.h`;;
11810 *) strings=`./findhdr string.h`;;
11813 : see if this is a sys/file.h system
11818 : do we need to include sys/file.h ?
11822 if $h_sysfile; then
11824 echo "We'll be including <sys/file.h>." >&4
11827 echo "We won't be including <sys/file.h>." >&4
11837 : see if fcntl.h is there
11842 : see if we can include fcntl.h
11848 echo "We'll be including <fcntl.h>." >&4
11851 if $h_sysfile; then
11852 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11854 echo "We won't be including <fcntl.h>." >&4
11866 : check for non-blocking I/O stuff
11867 case "$h_sysfile" in
11868 true) echo "#include <sys/file.h>" > head.c;;
11871 true) echo "#include <fcntl.h>" > head.c;;
11872 *) echo "#include <sys/fcntl.h>" > head.c;;
11877 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11878 case "$o_nonblock" in
11880 $cat head.c > try.c
11881 $cat >>try.c <<EOCP
11883 #$i_stdlib I_STDLIB
11885 #include <stdlib.h>
11893 printf("O_NONBLOCK\n");
11897 printf("O_NDELAY\n");
11901 printf("FNDELAY\n");
11908 if eval $compile_ok; then
11909 o_nonblock=`$run ./try`
11910 case "$o_nonblock" in
11911 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11912 *) echo "Seems like we can use $o_nonblock.";;
11915 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11918 *) echo "Using $hint value $o_nonblock.";;
11920 $rm -f try try.* .out core
11923 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11926 $cat head.c > try.c
11927 $cat >>try.c <<EOCP
11929 #include <sys/types.h>
11930 #include <signal.h>
11932 #$i_stdlib I_STDLIB
11934 #include <stdlib.h>
11940 #define MY_O_NONBLOCK $o_nonblock
11941 #ifndef errno /* XXX need better Configure test */
11944 #$i_unistd I_UNISTD
11946 #include <unistd.h>
11948 #$i_string I_STRING
11950 #include <string.h>
11952 #include <strings.h>
11954 $signal_t blech(x) int x; { exit(3); }
11956 $cat >> try.c <<'EOCP'
11964 pipe(pd); /* Down: child -> parent */
11965 pipe(pu); /* Up: parent -> child */
11968 close(pd[1]); /* Parent reads from pd[0] */
11969 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11971 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11976 signal(SIGALRM, blech);
11978 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11980 sprintf(string, "%d\n", ret);
11981 write(2, string, strlen(string));
11984 if (errno == EAGAIN) {
11985 printf("EAGAIN\n");
11990 if (errno == EWOULDBLOCK)
11991 printf("EWOULDBLOCK\n");
11994 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11995 sleep(2); /* Give it time to close our pipe */
11997 ret = read(pd[0], buf, 1); /* Should read EOF */
11999 sprintf(string, "%d\n", ret);
12000 write(4, string, strlen(string));
12004 close(pd[0]); /* We write to pd[1] */
12005 close(pu[1]); /* We read from pu[0] */
12006 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12007 close(pd[1]); /* Pipe pd is now fully closed! */
12008 exit(0); /* Bye bye, thank you for playing! */
12012 if eval $compile_ok; then
12013 echo "$startsh" >mtry
12014 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12016 ./mtry >/dev/null 2>&1
12018 0) eagain=`$cat try.out`;;
12019 1) echo "Could not perform non-blocking setting!";;
12020 2) echo "I did a successful read() for something that was not there!";;
12021 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12022 4) echo "Could not find F_SETFL!";;
12023 *) echo "Something terribly wrong happened during testing.";;
12025 rd_nodata=`$cat try.ret`
12026 echo "A read() system call with no data present returns $rd_nodata."
12027 case "$rd_nodata" in
12030 echo "(That's peculiar, fixing that to be -1.)"
12036 echo "Forcing errno EAGAIN on read() with no data available."
12040 echo "Your read() sets errno to $eagain when no data is available."
12043 status=`$cat try.err`
12045 0) echo "And it correctly returns 0 to signal EOF.";;
12046 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12047 *) echo "However, your read() returns '$status' on EOF??";;
12050 if test "$status" = "$rd_nodata"; then
12051 echo "WARNING: you can't distinguish between EOF and no data!"
12055 echo "I can't compile the test program--assuming errno EAGAIN will do."
12062 echo "Using $hint value $eagain."
12063 echo "Your read() returns $rd_nodata when no data is present."
12064 case "$d_eofnblk" in
12065 "$define") echo "And you can see EOF because read() returns 0.";;
12066 "$undef") echo "But you can't see EOF status from read() returned value.";;
12068 echo "(Assuming you can't see EOF status from read anyway.)"
12074 $rm -f try try.* .out core head.c mtry
12076 : see if _ptr and _cnt from stdio act std
12079 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12080 echo "(Looks like you have stdio.h from BSD.)"
12081 case "$stdio_ptr" in
12082 '') stdio_ptr='((fp)->_p)'
12085 *) ptr_lval=$d_stdio_ptr_lval;;
12087 case "$stdio_cnt" in
12088 '') stdio_cnt='((fp)->_r)'
12091 *) cnt_lval=$d_stdio_cnt_lval;;
12093 case "$stdio_base" in
12094 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12096 case "$stdio_bufsiz" in
12097 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12099 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12100 echo "(Looks like you have stdio.h from Linux.)"
12101 case "$stdio_ptr" in
12102 '') stdio_ptr='((fp)->_IO_read_ptr)'
12105 *) ptr_lval=$d_stdio_ptr_lval;;
12107 case "$stdio_cnt" in
12108 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12111 *) cnt_lval=$d_stdio_cnt_lval;;
12113 case "$stdio_base" in
12114 '') stdio_base='((fp)->_IO_read_base)';;
12116 case "$stdio_bufsiz" in
12117 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12120 case "$stdio_ptr" in
12121 '') stdio_ptr='((fp)->_ptr)'
12124 *) ptr_lval=$d_stdio_ptr_lval;;
12126 case "$stdio_cnt" in
12127 '') stdio_cnt='((fp)->_cnt)'
12130 *) cnt_lval=$d_stdio_cnt_lval;;
12132 case "$stdio_base" in
12133 '') stdio_base='((fp)->_base)';;
12135 case "$stdio_bufsiz" in
12136 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12140 : test whether _ptr and _cnt really work
12141 echo "Checking how std your stdio is..." >&4
12144 #$i_stdlib I_STDLIB
12146 #include <stdlib.h>
12148 #define FILE_ptr(fp) $stdio_ptr
12149 #define FILE_cnt(fp) $stdio_cnt
12151 FILE *fp = fopen("try.c", "r");
12154 18 <= FILE_cnt(fp) &&
12155 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12163 if eval $compile && $to try.c; then
12164 if $run ./try; then
12165 echo "Your stdio acts pretty std."
12168 echo "Your stdio isn't very std."
12171 echo "Your stdio doesn't appear very std."
12175 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12176 # direct buffer manipulation no longer works. The Configure tests
12177 # should be changed to correctly detect this, but until then,
12178 # the following check should at least let perl compile and run.
12179 # (This quick fix should be updated before 5.8.1.)
12180 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12181 # A. Dougherty, June 3, 2002.
12182 case "$d_gnulibc" in
12184 case "$gnulibc_version" in
12188 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12197 : Can _ptr be used as an lvalue?
12198 case "$d_stdstdio$ptr_lval" in
12199 $define$define) val=$define ;;
12202 set d_stdio_ptr_lval
12205 : Can _cnt be used as an lvalue?
12206 case "$d_stdstdio$cnt_lval" in
12207 $define$define) val=$define ;;
12210 set d_stdio_cnt_lval
12214 : test whether setting _ptr sets _cnt as a side effect
12215 d_stdio_ptr_lval_sets_cnt="$undef"
12216 d_stdio_ptr_lval_nochange_cnt="$undef"
12217 case "$d_stdio_ptr_lval$d_stdstdio" in
12219 echo "Checking to see what happens if we set the stdio ptr..." >&4
12222 /* Can we scream? */
12223 /* Eat dust sed :-) */
12224 /* In the buffer space, no one can hear you scream. */
12225 #$i_stdlib I_STDLIB
12227 #include <stdlib.h>
12229 #define FILE_ptr(fp) $stdio_ptr
12230 #define FILE_cnt(fp) $stdio_cnt
12231 #include <sys/types.h>
12233 FILE *fp = fopen("try.c", "r");
12238 puts("Fail even to read");
12241 c = getc(fp); /* Read away the first # */
12243 puts("Fail even to read");
12247 18 <= FILE_cnt(fp) &&
12248 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12250 puts("Fail even to read");
12253 ptr = (char*) FILE_ptr(fp);
12254 cnt = (size_t)FILE_cnt(fp);
12256 FILE_ptr(fp) += 42;
12258 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12259 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12262 if (FILE_cnt(fp) <= 20) {
12263 printf ("Fail (<20 chars to test)");
12266 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12267 puts("Fail compare");
12270 if (cnt == FILE_cnt(fp)) {
12271 puts("Pass_unchanged");
12274 if (FILE_cnt(fp) == (cnt - 42)) {
12275 puts("Pass_changed");
12278 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12284 if eval $compile && $to try.c; then
12285 case `$run ./try` in
12287 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12288 d_stdio_ptr_lval_sets_cnt="$define" ;;
12290 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12291 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12293 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12295 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12298 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12304 : see if _base is also standard
12306 case "$d_stdstdio" in
12310 #$i_stdlib I_STDLIB
12312 #include <stdlib.h>
12314 #define FILE_base(fp) $stdio_base
12315 #define FILE_bufsiz(fp) $stdio_bufsiz
12317 FILE *fp = fopen("try.c", "r");
12320 19 <= FILE_bufsiz(fp) &&
12321 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12328 if eval $compile && $to try.c; then
12329 if $run ./try; then
12330 echo "And its _base field acts std."
12333 echo "But its _base field isn't std."
12336 echo "However, it seems to be lacking the _base field."
12344 : see if fast_stdio exists
12346 case "$d_stdstdio:$d_stdio_ptr_lval" in
12348 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12350 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12361 : see if fchdir exists
12362 set fchdir d_fchdir
12365 : see if fchmod exists
12366 set fchmod d_fchmod
12369 : see if fchown exists
12370 set fchown d_fchown
12373 : see if this is an fcntl system
12378 : See if fcntl-based locking works.
12380 #$i_stdlib I_STDLIB
12382 #include <stdlib.h>
12384 #include <unistd.h>
12386 #include <signal.h>
12387 $signal_t blech(x) int x; { exit(3); }
12389 #if defined(F_SETLK) && defined(F_SETLKW)
12390 struct flock flock;
12392 fd = open("try.c", O_RDONLY);
12393 flock.l_type = F_RDLCK;
12394 flock.l_whence = SEEK_SET;
12395 flock.l_start = flock.l_len = 0;
12396 signal(SIGALRM, blech);
12398 retval = fcntl(fd, F_SETLK, &flock);
12400 (retval < 0 ? exit(2) : exit(0));
12406 echo "Checking if fcntl-based file locking works... "
12410 if eval $compile_ok; then
12411 if $run ./try; then
12412 echo "Yes, it seems to work."
12415 echo "Nope, it didn't work."
12420 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12421 *** This is (almost) impossible.
12422 *** If your NFS lock daemons are not feeling well, something like
12423 *** this may happen, please investigate. Cannot continue, aborting.
12431 echo "I'm unable to compile the test program, so I'll assume not."
12436 echo "Nope, since you don't even have fcntl()."
12439 set d_fcntl_can_lock
12444 : check for fd_set items
12447 Checking to see how well your C compiler handles fd_set and friends ...
12450 #$i_stdlib I_STDLIB
12452 #include <stdlib.h>
12454 #$i_systime I_SYS_TIME
12455 #$i_sysselct I_SYS_SELECT
12456 #$d_socket HAS_SOCKET
12457 #include <sys/types.h>
12459 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12462 #include <sys/time.h>
12464 #ifdef I_SYS_SELECT
12465 #include <sys/select.h>
12474 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12482 if eval $compile; then
12483 d_fds_bits="$define"
12485 echo "Well, your system knows about the normal fd_set typedef..." >&4
12486 if $run ./try; then
12487 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12488 d_fd_macros="$define"
12491 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12493 d_fd_macros="$undef"
12497 Hmm, your compiler has some difficulty with fd_set. Checking further...
12500 if eval $compile; then
12501 d_fds_bits="$undef"
12503 echo "Well, your system has some sort of fd_set available..." >&4
12504 if $run ./try; then
12505 echo "and you have the normal fd_set macros." >&4
12506 d_fd_macros="$define"
12509 but not the normal fd_set macros! Gross! More work for me...
12511 d_fd_macros="$undef"
12514 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12516 d_fds_bits="$undef"
12517 d_fd_macros="$undef"
12522 : see if fgetpos exists
12523 set fgetpos d_fgetpos
12526 : see if finite exists
12527 set finite d_finite
12530 : see if finitel exists
12531 set finitel d_finitel
12534 : see if flock exists
12538 : see if prototype for flock is available
12540 set d_flockproto flock $i_sysfile sys/file.h
12543 : see if fork exists
12547 : see if fp_class exists
12548 set fp_class d_fp_class
12551 : see if pathconf exists
12552 set pathconf d_pathconf
12555 : see if fpathconf exists
12556 set fpathconf d_fpathconf
12559 : see if fpclass exists
12560 set fpclass d_fpclass
12563 : see if fpclassify exists
12564 set fpclassify d_fpclassify
12567 : see if fpclassl exists
12568 set fpclassl d_fpclassl
12572 : check for fpos64_t
12574 echo "Checking to see if you have fpos64_t..." >&4
12577 int main() { fpos64_t x = 7; }
12580 if eval $compile; then
12582 echo "You have fpos64_t."
12585 echo "You do not have fpos64_t."
12586 case "$fpossize" in
12587 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12594 : see if frexpl exists
12595 set frexpl d_frexpl
12598 : see if this is a sys/param system
12599 set sys/param.h i_sysparam
12602 : see if this is a sys/mount.h system
12603 set sys/mount.h i_sysmount
12608 echo "Checking to see if your system supports struct fs_data..." >&4
12609 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12611 case "$d_fs_data_s" in
12612 "$define") echo "Yes, it does." ;;
12613 *) echo "No, it doesn't." ;;
12616 : see if fseeko exists
12617 set fseeko d_fseeko
12619 case "$longsize" in
12620 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12623 : see if fsetpos exists
12624 set fsetpos d_fsetpos
12628 : see if fstatfs exists
12629 set fstatfs d_fstatfs
12633 : see if statvfs exists
12634 set statvfs d_statvfs
12637 : see if fstatvfs exists
12638 set fstatvfs d_fstatvfs
12642 : see if fsync exists
12646 : see if ftello exists
12647 set ftello d_ftello
12649 case "$longsize" in
12650 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12654 : check for a working futimes
12656 echo "Checking for a working futimes()" >&4
12659 #include <sys/time.h>
12666 fd = open ("try.c", O_RDWR);
12667 if (-1 == fd) exit (1);
12668 rv = futimes (fd, NULL);
12669 exit (rv == -1 ? errno : 0);
12673 if eval $compile; then
12677 0) echo "Yes, it does" >&4
12678 d_futimes="$define"
12680 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12684 echo "No, it does not (probably harmless)\n" >&4
12686 $rm -f try.* try core core.try.*
12688 : see if getcwd exists
12689 set getcwd d_getcwd
12692 : see if getespwnam exists
12693 set getespwnam d_getespwnam
12697 : see if getfsstat exists
12698 set getfsstat d_getfsstat
12701 : see if getgrent exists
12702 set getgrent d_getgrent
12705 : see if getgrent_r exists
12706 set getgrent_r d_getgrent_r
12708 case "$d_getgrent_r" in
12710 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12711 case "$d_getgrent_r_proto:$usethreads" in
12712 ":define") d_getgrent_r_proto=define
12713 set d_getgrent_r_proto getgrent_r $hdrs
12717 case "$d_getgrent_r_proto" in
12719 case "$getgrent_r_proto" in
12720 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12721 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12723 case "$getgrent_r_proto" in
12724 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12725 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12727 case "$getgrent_r_proto" in
12728 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12729 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12731 case "$getgrent_r_proto" in
12732 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12733 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12735 case "$getgrent_r_proto" in
12736 ''|0) try='int getgrent_r(struct group*, char*, int);'
12737 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12739 case "$getgrent_r_proto" in
12740 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12741 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12743 case "$getgrent_r_proto" in
12744 ''|0) d_getgrent_r=undef
12746 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12747 * ) case "$getgrent_r_proto" in
12748 REENTRANT_PROTO*) ;;
12749 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12751 echo "Prototype: $try" ;;
12754 *) case "$usethreads" in
12755 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12762 *) getgrent_r_proto=0
12766 : see if getgrgid_r exists
12767 set getgrgid_r d_getgrgid_r
12769 case "$d_getgrgid_r" in
12771 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12772 case "$d_getgrgid_r_proto:$usethreads" in
12773 ":define") d_getgrgid_r_proto=define
12774 set d_getgrgid_r_proto getgrgid_r $hdrs
12778 case "$d_getgrgid_r_proto" in
12780 case "$getgrgid_r_proto" in
12781 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12782 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12784 case "$getgrgid_r_proto" in
12785 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12786 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12788 case "$getgrgid_r_proto" in
12789 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12790 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12792 case "$getgrgid_r_proto" in
12793 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12794 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12796 case "$getgrgid_r_proto" in
12797 ''|0) d_getgrgid_r=undef
12799 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12800 * ) case "$getgrgid_r_proto" in
12801 REENTRANT_PROTO*) ;;
12802 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12804 echo "Prototype: $try" ;;
12807 *) case "$usethreads" in
12808 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12815 *) getgrgid_r_proto=0
12819 : see if getgrnam_r exists
12820 set getgrnam_r d_getgrnam_r
12822 case "$d_getgrnam_r" in
12824 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12825 case "$d_getgrnam_r_proto:$usethreads" in
12826 ":define") d_getgrnam_r_proto=define
12827 set d_getgrnam_r_proto getgrnam_r $hdrs
12831 case "$d_getgrnam_r_proto" in
12833 case "$getgrnam_r_proto" in
12834 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12835 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12837 case "$getgrnam_r_proto" in
12838 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12839 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12841 case "$getgrnam_r_proto" in
12842 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12843 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12845 case "$getgrnam_r_proto" in
12846 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12847 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12849 case "$getgrnam_r_proto" in
12850 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12851 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12853 case "$getgrnam_r_proto" in
12854 ''|0) d_getgrnam_r=undef
12856 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12857 * ) case "$getgrnam_r_proto" in
12858 REENTRANT_PROTO*) ;;
12859 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12861 echo "Prototype: $try" ;;
12864 *) case "$usethreads" in
12865 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12872 *) getgrnam_r_proto=0
12876 : see if gethostbyaddr exists
12877 set gethostbyaddr d_gethbyaddr
12880 : see if gethostbyname exists
12881 set gethostbyname d_gethbyname
12884 : see if gethostent exists
12885 set gethostent d_gethent
12888 : see how we will look up host name
12891 if set gethostname val -f d_gethname; eval $csym; $val; then
12892 echo 'gethostname() found.' >&4
12893 d_gethname="$define"
12896 if set uname val -f d_uname; eval $csym; $val; then
12899 uname() was found, but you're running xenix, and older versions of xenix
12900 have a broken uname(). If you don't really know whether your xenix is old
12901 enough to have a broken system call, use the default answer.
12906 "$define") dflt=n;;
12908 rp='Is your uname() broken?'
12911 n*) d_uname="$define"; call=uname;;
12914 echo 'uname() found.' >&4
12921 case "$d_gethname" in
12922 '') d_gethname="$undef";;
12925 '') d_uname="$undef";;
12927 case "$d_uname$d_gethname" in
12932 Every now and then someone has a $call() that lies about the hostname
12933 but can't be fixed for political or economic reasons. If you wish, I can
12934 pretend $call() isn't there and maybe compute hostname at run-time
12935 thanks to the '$phostname' command.
12938 rp="Shall I ignore $call() from now on?"
12941 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12944 case "$phostname" in
12945 '') aphostname='';;
12946 *) case "$aphostname" in
12948 *) set X $phostname
12952 file=`./loc $file $file $pth`
12953 aphostname=`echo $file $*`
12958 case "$d_uname$d_gethname" in
12961 case "$phostname" in
12963 echo "There will be no way for $package to get your hostname." >&4;;
12965 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12969 case "$d_phostname" in
12970 '') d_phostname="$undef";;
12973 : see if gethostbyaddr_r exists
12974 set gethostbyaddr_r d_gethostbyaddr_r
12976 case "$d_gethostbyaddr_r" in
12978 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12979 case "$d_gethostbyaddr_r_proto:$usethreads" in
12980 ":define") d_gethostbyaddr_r_proto=define
12981 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12985 case "$d_gethostbyaddr_r_proto" in
12987 case "$gethostbyaddr_r_proto" in
12988 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12989 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12991 case "$gethostbyaddr_r_proto" in
12992 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12993 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12995 case "$gethostbyaddr_r_proto" in
12996 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12997 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12999 case "$gethostbyaddr_r_proto" in
13000 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13001 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13003 case "$gethostbyaddr_r_proto" in
13004 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13005 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13007 case "$gethostbyaddr_r_proto" in
13008 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13009 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13011 case "$gethostbyaddr_r_proto" in
13012 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13013 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13015 case "$gethostbyaddr_r_proto" in
13016 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13017 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13019 case "$gethostbyaddr_r_proto" in
13020 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13021 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13023 case "$gethostbyaddr_r_proto" in
13024 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13025 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13027 case "$gethostbyaddr_r_proto" in
13028 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13029 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13031 case "$gethostbyaddr_r_proto" in
13032 ''|0) d_gethostbyaddr_r=undef
13033 gethostbyaddr_r_proto=0
13034 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13035 * ) case "$gethostbyaddr_r_proto" in
13036 REENTRANT_PROTO*) ;;
13037 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13039 echo "Prototype: $try" ;;
13042 *) case "$usethreads" in
13043 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13045 d_gethostbyaddr_r=undef
13046 gethostbyaddr_r_proto=0
13050 *) gethostbyaddr_r_proto=0
13054 : see if gethostbyname_r exists
13055 set gethostbyname_r d_gethostbyname_r
13057 case "$d_gethostbyname_r" in
13059 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13060 case "$d_gethostbyname_r_proto:$usethreads" in
13061 ":define") d_gethostbyname_r_proto=define
13062 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13066 case "$d_gethostbyname_r_proto" in
13068 case "$gethostbyname_r_proto" in
13069 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13070 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13072 case "$gethostbyname_r_proto" in
13073 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13074 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13076 case "$gethostbyname_r_proto" in
13077 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13078 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13080 case "$gethostbyname_r_proto" in
13081 ''|0) d_gethostbyname_r=undef
13082 gethostbyname_r_proto=0
13083 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13084 * ) case "$gethostbyname_r_proto" in
13085 REENTRANT_PROTO*) ;;
13086 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13088 echo "Prototype: $try" ;;
13091 *) case "$usethreads" in
13092 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13094 d_gethostbyname_r=undef
13095 gethostbyname_r_proto=0
13099 *) gethostbyname_r_proto=0
13103 : see if gethostent_r exists
13104 set gethostent_r d_gethostent_r
13106 case "$d_gethostent_r" in
13108 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13109 case "$d_gethostent_r_proto:$usethreads" in
13110 ":define") d_gethostent_r_proto=define
13111 set d_gethostent_r_proto gethostent_r $hdrs
13115 case "$d_gethostent_r_proto" in
13117 case "$gethostent_r_proto" in
13118 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13119 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13121 case "$gethostent_r_proto" in
13122 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13123 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13125 case "$gethostent_r_proto" in
13126 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13127 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13129 case "$gethostent_r_proto" in
13130 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13131 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13133 case "$gethostent_r_proto" in
13134 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13135 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13137 case "$gethostent_r_proto" in
13138 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13139 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13141 case "$gethostent_r_proto" in
13142 ''|0) d_gethostent_r=undef
13143 gethostent_r_proto=0
13144 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13145 * ) case "$gethostent_r_proto" in
13146 REENTRANT_PROTO*) ;;
13147 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13149 echo "Prototype: $try" ;;
13152 *) case "$usethreads" in
13153 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13155 d_gethostent_r=undef
13156 gethostent_r_proto=0
13160 *) gethostent_r_proto=0
13164 : see if prototypes for various gethostxxx netdb.h functions are available
13166 set d_gethostprotos gethostent $i_netdb netdb.h
13169 : see if getitimer exists
13170 set getitimer d_getitimer
13173 : see if getlogin exists
13174 set getlogin d_getlogin
13177 : see if getlogin_r exists
13178 set getlogin_r d_getlogin_r
13180 case "$d_getlogin_r" in
13182 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13183 case "$d_getlogin_r_proto:$usethreads" in
13184 ":define") d_getlogin_r_proto=define
13185 set d_getlogin_r_proto getlogin_r $hdrs
13189 case "$d_getlogin_r_proto" in
13191 case "$getlogin_r_proto" in
13192 ''|0) try='int getlogin_r(char*, size_t);'
13193 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13195 case "$getlogin_r_proto" in
13196 ''|0) try='int getlogin_r(char*, int);'
13197 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13199 case "$getlogin_r_proto" in
13200 ''|0) try='char* getlogin_r(char*, size_t);'
13201 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13203 case "$getlogin_r_proto" in
13204 ''|0) try='char* getlogin_r(char*, int);'
13205 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13207 case "$getlogin_r_proto" in
13208 ''|0) d_getlogin_r=undef
13210 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13211 * ) case "$getlogin_r_proto" in
13212 REENTRANT_PROTO*) ;;
13213 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13215 echo "Prototype: $try" ;;
13218 *) case "$usethreads" in
13219 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13226 *) getlogin_r_proto=0
13230 : see if getmnt exists
13231 set getmnt d_getmnt
13234 : see if getmntent exists
13235 set getmntent d_getmntent
13238 : see if getnetbyaddr exists
13239 set getnetbyaddr d_getnbyaddr
13242 : see if getnetbyname exists
13243 set getnetbyname d_getnbyname
13246 : see if getnetent exists
13247 set getnetent d_getnent
13250 : see if getnetbyaddr_r exists
13251 set getnetbyaddr_r d_getnetbyaddr_r
13253 case "$d_getnetbyaddr_r" in
13255 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13256 case "$d_getnetbyaddr_r_proto:$usethreads" in
13257 ":define") d_getnetbyaddr_r_proto=define
13258 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13262 case "$d_getnetbyaddr_r_proto" in
13264 case "$getnetbyaddr_r_proto" in
13265 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13266 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13268 case "$getnetbyaddr_r_proto" in
13269 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13270 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13272 case "$getnetbyaddr_r_proto" in
13273 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13274 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13276 case "$getnetbyaddr_r_proto" in
13277 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13278 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13280 case "$getnetbyaddr_r_proto" in
13281 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13282 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13284 case "$getnetbyaddr_r_proto" in
13285 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13286 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13288 case "$getnetbyaddr_r_proto" in
13289 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13290 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13292 case "$getnetbyaddr_r_proto" in
13293 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13294 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13296 case "$getnetbyaddr_r_proto" in
13297 ''|0) d_getnetbyaddr_r=undef
13298 getnetbyaddr_r_proto=0
13299 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13300 * ) case "$getnetbyaddr_r_proto" in
13301 REENTRANT_PROTO*) ;;
13302 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13304 echo "Prototype: $try" ;;
13307 *) case "$usethreads" in
13308 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13310 d_getnetbyaddr_r=undef
13311 getnetbyaddr_r_proto=0
13315 *) getnetbyaddr_r_proto=0
13319 : see if getnetbyname_r exists
13320 set getnetbyname_r d_getnetbyname_r
13322 case "$d_getnetbyname_r" in
13324 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13325 case "$d_getnetbyname_r_proto:$usethreads" in
13326 ":define") d_getnetbyname_r_proto=define
13327 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13331 case "$d_getnetbyname_r_proto" in
13333 case "$getnetbyname_r_proto" in
13334 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13335 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13337 case "$getnetbyname_r_proto" in
13338 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13339 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13341 case "$getnetbyname_r_proto" in
13342 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13343 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13345 case "$getnetbyname_r_proto" in
13346 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13347 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13349 case "$getnetbyname_r_proto" in
13350 ''|0) d_getnetbyname_r=undef
13351 getnetbyname_r_proto=0
13352 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13353 * ) case "$getnetbyname_r_proto" in
13354 REENTRANT_PROTO*) ;;
13355 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13357 echo "Prototype: $try" ;;
13360 *) case "$usethreads" in
13361 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13363 d_getnetbyname_r=undef
13364 getnetbyname_r_proto=0
13368 *) getnetbyname_r_proto=0
13372 : see if getnetent_r exists
13373 set getnetent_r d_getnetent_r
13375 case "$d_getnetent_r" in
13377 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13378 case "$d_getnetent_r_proto:$usethreads" in
13379 ":define") d_getnetent_r_proto=define
13380 set d_getnetent_r_proto getnetent_r $hdrs
13384 case "$d_getnetent_r_proto" in
13386 case "$getnetent_r_proto" in
13387 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13388 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13390 case "$getnetent_r_proto" in
13391 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13392 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13394 case "$getnetent_r_proto" in
13395 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13396 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13398 case "$getnetent_r_proto" in
13399 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13400 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13402 case "$getnetent_r_proto" in
13403 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13404 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13406 case "$getnetent_r_proto" in
13407 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13408 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13410 case "$getnetent_r_proto" in
13411 ''|0) d_getnetent_r=undef
13412 getnetent_r_proto=0
13413 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13414 * ) case "$getnetent_r_proto" in
13415 REENTRANT_PROTO*) ;;
13416 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13418 echo "Prototype: $try" ;;
13421 *) case "$usethreads" in
13422 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13424 d_getnetent_r=undef
13425 getnetent_r_proto=0
13429 *) getnetent_r_proto=0
13433 : see if prototypes for various getnetxxx netdb.h functions are available
13435 set d_getnetprotos getnetent $i_netdb netdb.h
13438 : see if getpagesize exists
13439 set getpagesize d_getpagsz
13443 : see if getprotobyname exists
13444 set getprotobyname d_getpbyname
13447 : see if getprotobynumber exists
13448 set getprotobynumber d_getpbynumber
13451 : see if getprotoent exists
13452 set getprotoent d_getpent
13455 : see if getpgid exists
13456 set getpgid d_getpgid
13459 : see if getpgrp2 exists
13460 set getpgrp2 d_getpgrp2
13463 : see if getppid exists
13464 set getppid d_getppid
13467 : see if getpriority exists
13468 set getpriority d_getprior
13471 : see if getprotobyname_r exists
13472 set getprotobyname_r d_getprotobyname_r
13474 case "$d_getprotobyname_r" in
13476 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13477 case "$d_getprotobyname_r_proto:$usethreads" in
13478 ":define") d_getprotobyname_r_proto=define
13479 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13483 case "$d_getprotobyname_r_proto" in
13485 case "$getprotobyname_r_proto" in
13486 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13487 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13489 case "$getprotobyname_r_proto" in
13490 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13491 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13493 case "$getprotobyname_r_proto" in
13494 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13495 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13497 case "$getprotobyname_r_proto" in
13498 ''|0) d_getprotobyname_r=undef
13499 getprotobyname_r_proto=0
13500 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13501 * ) case "$getprotobyname_r_proto" in
13502 REENTRANT_PROTO*) ;;
13503 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13505 echo "Prototype: $try" ;;
13508 *) case "$usethreads" in
13509 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13511 d_getprotobyname_r=undef
13512 getprotobyname_r_proto=0
13516 *) getprotobyname_r_proto=0
13520 : see if getprotobynumber_r exists
13521 set getprotobynumber_r d_getprotobynumber_r
13523 case "$d_getprotobynumber_r" in
13525 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13526 case "$d_getprotobynumber_r_proto:$usethreads" in
13527 ":define") d_getprotobynumber_r_proto=define
13528 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13532 case "$d_getprotobynumber_r_proto" in
13534 case "$getprotobynumber_r_proto" in
13535 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13536 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13538 case "$getprotobynumber_r_proto" in
13539 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13540 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13542 case "$getprotobynumber_r_proto" in
13543 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13544 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13546 case "$getprotobynumber_r_proto" in
13547 ''|0) d_getprotobynumber_r=undef
13548 getprotobynumber_r_proto=0
13549 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13550 * ) case "$getprotobynumber_r_proto" in
13551 REENTRANT_PROTO*) ;;
13552 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13554 echo "Prototype: $try" ;;
13557 *) case "$usethreads" in
13558 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13560 d_getprotobynumber_r=undef
13561 getprotobynumber_r_proto=0
13565 *) getprotobynumber_r_proto=0
13569 : see if getprotoent_r exists
13570 set getprotoent_r d_getprotoent_r
13572 case "$d_getprotoent_r" in
13574 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13575 case "$d_getprotoent_r_proto:$usethreads" in
13576 ":define") d_getprotoent_r_proto=define
13577 set d_getprotoent_r_proto getprotoent_r $hdrs
13581 case "$d_getprotoent_r_proto" in
13583 case "$getprotoent_r_proto" in
13584 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13585 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13587 case "$getprotoent_r_proto" in
13588 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13589 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13591 case "$getprotoent_r_proto" in
13592 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13593 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13595 case "$getprotoent_r_proto" in
13596 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13597 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13599 case "$getprotoent_r_proto" in
13600 ''|0) d_getprotoent_r=undef
13601 getprotoent_r_proto=0
13602 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13603 * ) case "$getprotoent_r_proto" in
13604 REENTRANT_PROTO*) ;;
13605 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13607 echo "Prototype: $try" ;;
13610 *) case "$usethreads" in
13611 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13613 d_getprotoent_r=undef
13614 getprotoent_r_proto=0
13618 *) getprotoent_r_proto=0
13622 : see if prototypes for various getprotoxxx netdb.h functions are available
13624 set d_getprotoprotos getprotoent $i_netdb netdb.h
13627 : see if getprpwnam exists
13628 set getprpwnam d_getprpwnam
13631 : see if getpwent exists
13632 set getpwent d_getpwent
13635 : see if getpwent_r exists
13636 set getpwent_r d_getpwent_r
13638 case "$d_getpwent_r" in
13640 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13641 case "$d_getpwent_r_proto:$usethreads" in
13642 ":define") d_getpwent_r_proto=define
13643 set d_getpwent_r_proto getpwent_r $hdrs
13647 case "$d_getpwent_r_proto" in
13649 case "$getpwent_r_proto" in
13650 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13651 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13653 case "$getpwent_r_proto" in
13654 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13655 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13657 case "$getpwent_r_proto" in
13658 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13659 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13661 case "$getpwent_r_proto" in
13662 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13663 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13665 case "$getpwent_r_proto" in
13666 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13667 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13669 case "$getpwent_r_proto" in
13670 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13671 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13673 case "$getpwent_r_proto" in
13674 ''|0) d_getpwent_r=undef
13676 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13677 * ) case "$getpwent_r_proto" in
13678 REENTRANT_PROTO*) ;;
13679 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13681 echo "Prototype: $try" ;;
13684 *) case "$usethreads" in
13685 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13692 *) getpwent_r_proto=0
13696 : see if getpwnam_r exists
13697 set getpwnam_r d_getpwnam_r
13699 case "$d_getpwnam_r" in
13701 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13702 case "$d_getpwnam_r_proto:$usethreads" in
13703 ":define") d_getpwnam_r_proto=define
13704 set d_getpwnam_r_proto getpwnam_r $hdrs
13708 case "$d_getpwnam_r_proto" in
13710 case "$getpwnam_r_proto" in
13711 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13712 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13714 case "$getpwnam_r_proto" in
13715 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13716 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13718 case "$getpwnam_r_proto" in
13719 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13720 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13722 case "$getpwnam_r_proto" in
13723 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13724 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13726 case "$getpwnam_r_proto" in
13727 ''|0) d_getpwnam_r=undef
13729 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13730 * ) case "$getpwnam_r_proto" in
13731 REENTRANT_PROTO*) ;;
13732 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13734 echo "Prototype: $try" ;;
13737 *) case "$usethreads" in
13738 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13745 *) getpwnam_r_proto=0
13749 : see if getpwuid_r exists
13750 set getpwuid_r d_getpwuid_r
13752 case "$d_getpwuid_r" in
13754 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13755 case "$d_getpwuid_r_proto:$usethreads" in
13756 ":define") d_getpwuid_r_proto=define
13757 set d_getpwuid_r_proto getpwuid_r $hdrs
13761 case "$d_getpwuid_r_proto" in
13763 case "$getpwuid_r_proto" in
13764 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13765 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13767 case "$getpwuid_r_proto" in
13768 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13769 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13771 case "$getpwuid_r_proto" in
13772 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13773 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13775 case "$getpwuid_r_proto" in
13776 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13777 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13779 case "$getpwuid_r_proto" in
13780 ''|0) d_getpwuid_r=undef
13782 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13783 * ) case "$getpwuid_r_proto" in
13784 REENTRANT_PROTO*) ;;
13785 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13787 echo "Prototype: $try" ;;
13790 *) case "$usethreads" in
13791 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13798 *) getpwuid_r_proto=0
13803 : see if getservbyname exists
13804 set getservbyname d_getsbyname
13807 : see if getservbyport exists
13808 set getservbyport d_getsbyport
13811 : see if getservent exists
13812 set getservent d_getsent
13815 : see if getservbyname_r exists
13816 set getservbyname_r d_getservbyname_r
13818 case "$d_getservbyname_r" in
13820 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13821 case "$d_getservbyname_r_proto:$usethreads" in
13822 ":define") d_getservbyname_r_proto=define
13823 set d_getservbyname_r_proto getservbyname_r $hdrs
13827 case "$d_getservbyname_r_proto" in
13829 case "$getservbyname_r_proto" in
13830 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13831 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13833 case "$getservbyname_r_proto" in
13834 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13835 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13837 case "$getservbyname_r_proto" in
13838 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13839 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13841 case "$getservbyname_r_proto" in
13842 ''|0) d_getservbyname_r=undef
13843 getservbyname_r_proto=0
13844 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13845 * ) case "$getservbyname_r_proto" in
13846 REENTRANT_PROTO*) ;;
13847 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13849 echo "Prototype: $try" ;;
13852 *) case "$usethreads" in
13853 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13855 d_getservbyname_r=undef
13856 getservbyname_r_proto=0
13860 *) getservbyname_r_proto=0
13864 : see if getservbyport_r exists
13865 set getservbyport_r d_getservbyport_r
13867 case "$d_getservbyport_r" in
13869 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13870 case "$d_getservbyport_r_proto:$usethreads" in
13871 ":define") d_getservbyport_r_proto=define
13872 set d_getservbyport_r_proto getservbyport_r $hdrs
13876 case "$d_getservbyport_r_proto" in
13878 case "$getservbyport_r_proto" in
13879 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13880 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13882 case "$getservbyport_r_proto" in
13883 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13884 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13886 case "$getservbyport_r_proto" in
13887 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13888 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13890 case "$getservbyport_r_proto" in
13891 ''|0) d_getservbyport_r=undef
13892 getservbyport_r_proto=0
13893 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13894 * ) case "$getservbyport_r_proto" in
13895 REENTRANT_PROTO*) ;;
13896 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13898 echo "Prototype: $try" ;;
13901 *) case "$usethreads" in
13902 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13904 d_getservbyport_r=undef
13905 getservbyport_r_proto=0
13909 *) getservbyport_r_proto=0
13913 : see if getservent_r exists
13914 set getservent_r d_getservent_r
13916 case "$d_getservent_r" in
13918 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13919 case "$d_getservent_r_proto:$usethreads" in
13920 ":define") d_getservent_r_proto=define
13921 set d_getservent_r_proto getservent_r $hdrs
13925 case "$d_getservent_r_proto" in
13927 case "$getservent_r_proto" in
13928 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13929 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13931 case "$getservent_r_proto" in
13932 ''|0) try='int getservent_r(struct servent*, char*, int);'
13933 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13935 case "$getservent_r_proto" in
13936 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13937 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13939 case "$getservent_r_proto" in
13940 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13941 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13943 case "$getservent_r_proto" in
13944 ''|0) d_getservent_r=undef
13945 getservent_r_proto=0
13946 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13947 * ) case "$getservent_r_proto" in
13948 REENTRANT_PROTO*) ;;
13949 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13951 echo "Prototype: $try" ;;
13954 *) case "$usethreads" in
13955 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13957 d_getservent_r=undef
13958 getservent_r_proto=0
13962 *) getservent_r_proto=0
13966 : see if prototypes for various getservxxx netdb.h functions are available
13968 set d_getservprotos getservent $i_netdb netdb.h
13971 : see if getspnam exists
13972 set getspnam d_getspnam
13975 : see if this is a shadow.h system
13976 set shadow.h i_shadow
13979 : see if getspnam_r exists
13980 set getspnam_r d_getspnam_r
13982 case "$d_getspnam_r" in
13984 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13985 case "$d_getspnam_r_proto:$usethreads" in
13986 ":define") d_getspnam_r_proto=define
13987 set d_getspnam_r_proto getspnam_r $hdrs
13991 case "$d_getspnam_r_proto" in
13993 case "$getspnam_r_proto" in
13994 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13995 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13997 case "$getspnam_r_proto" in
13998 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13999 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14001 case "$getspnam_r_proto" in
14002 ''|0) d_getspnam_r=undef
14004 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14005 * ) case "$getspnam_r_proto" in
14006 REENTRANT_PROTO*) ;;
14007 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14009 echo "Prototype: $try" ;;
14012 *) case "$usethreads" in
14013 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14020 *) getspnam_r_proto=0
14024 : see if gettimeofday or ftime exists
14025 set gettimeofday d_gettimeod
14027 case "$d_gettimeod" in
14033 val="$undef"; set d_ftime; eval $setvar
14036 case "$d_gettimeod$d_ftime" in
14039 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14043 : see if gmtime_r exists
14044 set gmtime_r d_gmtime_r
14046 case "$d_gmtime_r" in
14048 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14049 case "$d_gmtime_r_proto:$usethreads" in
14050 ":define") d_gmtime_r_proto=define
14051 set d_gmtime_r_proto gmtime_r $hdrs
14055 case "$d_gmtime_r_proto" in
14057 case "$gmtime_r_proto" in
14058 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14059 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14061 case "$gmtime_r_proto" in
14062 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14063 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14065 case "$gmtime_r_proto" in
14066 ''|0) d_gmtime_r=undef
14068 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14069 * ) case "$gmtime_r_proto" in
14070 REENTRANT_PROTO*) ;;
14071 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14073 echo "Prototype: $try" ;;
14076 *) case "$usethreads" in
14077 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14084 *) gmtime_r_proto=0
14088 : see if hasmntopt exists
14089 set hasmntopt d_hasmntopt
14092 : see if this is a netinet/in.h or sys/in.h system
14093 set netinet/in.h i_niin sys/in.h i_sysin
14096 : see if arpa/inet.h has to be included
14097 set arpa/inet.h i_arpainet
14100 : see if htonl --and friends-- exists
14105 : Maybe they are macros.
14108 $cat >htonl.c <<EOM
14110 #include <sys/types.h>
14111 #$i_niin I_NETINET_IN
14113 #$i_arpainet I_ARPA_INET
14114 #ifdef I_NETINET_IN
14115 #include <netinet/in.h>
14118 #include <sys/in.h>
14121 #include <arpa/inet.h>
14124 printf("Defined as a macro.");
14127 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14128 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14130 echo "But it seems to be defined as a macro." >&4
14138 : see if ilogbl exists
14139 set ilogbl d_ilogbl
14144 if set index val -f; eval $csym; $val; then
14145 if set strchr val -f d_strchr; eval $csym; $val; then
14146 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14149 echo "strchr() found." >&4
14153 echo "index() found." >&4
14158 echo "index() found." >&4
14161 if set strchr val -f d_strchr; eval $csym; $val; then
14164 echo "strchr() found." >&4
14166 echo "No index() or strchr() found!" >&4
14171 set d_strchr; eval $setvar
14173 set d_index; eval $setvar
14175 : check whether inet_aton exists
14176 set inet_aton d_inetaton
14181 $cat >isascii.c <<EOCP
14184 #$i_stdlib I_STDLIB
14186 #include <stdlib.h>
14197 if eval $compile; then
14198 echo "isascii() found." >&4
14201 echo "isascii() NOT found." >&4
14208 : see if isfinite exists
14209 set isfinite d_isfinite
14212 : see if isinf exists
14216 : see if isnan exists
14220 : see if isnanl exists
14221 set isnanl d_isnanl
14224 : see if killpg exists
14225 set killpg d_killpg
14228 : see if lchown exists
14230 $cat > try.c <<'EOCP'
14231 /* System header to define __stub macros and hopefully few prototypes,
14232 which can conflict with char lchown(); below. */
14233 #include <assert.h>
14234 /* Override any gcc2 internal prototype to avoid an error. */
14235 /* We use char because int might match the return type of a gcc2
14236 builtin and then its argument prototype would still apply. */
14239 /* The GNU C library defines this for functions which it implements
14240 to always fail with ENOSYS. Some functions are actually named
14241 something starting with __ and the normal name is an alias. */
14242 #if defined (__stub_lchown) || defined (__stub___lchown)
14250 if eval $compile; then
14251 $echo "lchown() found." >&4
14254 $echo "lchown() NOT found." >&4
14260 : See if number of significant digits in a double precision number is known
14262 $cat >ldbl_dig.c <<EOM
14263 #$i_limits I_LIMITS
14266 #include <limits.h>
14272 printf("Contains LDBL_DIG");
14275 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14276 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14277 echo "LDBL_DIG found." >&4
14280 echo "LDBL_DIG NOT found." >&4
14287 : see if this is a math.h system
14291 d_libm_lib_version="$undef"
14294 : check to see if math.h defines _LIB_VERSION
14296 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14298 #include <unistd.h>
14300 int main (int argc, char *argv[])
14302 printf ("%d\n", _LIB_VERSION);
14307 if eval $compile; then
14309 echo "Yes, it does ($foo)" >&4
14310 d_libm_lib_version="$define"
14312 echo "No, it does not (probably harmless)\n" >&4
14314 $rm -f try.* try core core.try.*
14319 : see if link exists
14323 : see if localtime_r exists
14324 set localtime_r d_localtime_r
14326 case "$d_localtime_r" in
14328 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14329 case "$d_localtime_r_proto:$usethreads" in
14330 ":define") d_localtime_r_proto=define
14331 set d_localtime_r_proto localtime_r $hdrs
14335 case "$d_localtime_r_proto" in
14337 case "$localtime_r_proto" in
14338 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14339 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14341 case "$localtime_r_proto" in
14342 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14343 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14345 case "$localtime_r_proto" in
14346 ''|0) d_localtime_r=undef
14347 localtime_r_proto=0
14348 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14349 * ) case "$localtime_r_proto" in
14350 REENTRANT_PROTO*) ;;
14351 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14353 echo "Prototype: $try" ;;
14356 *) case "$usethreads" in
14357 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14359 d_localtime_r=undef
14360 localtime_r_proto=0
14364 *) localtime_r_proto=0
14368 : see if localeconv exists
14369 set localeconv d_locconv
14372 : see if lockf exists
14376 : see if prototype for lseek is available
14378 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14381 : see if lstat exists
14385 : see if madvise exists
14386 set madvise d_madvise
14389 : see if malloc_size exists
14390 set malloc_size d_malloc_size
14393 : see if malloc_size_good exists
14394 set malloc_good_size d_malloc_good_size
14397 : see if mblen exists
14401 : see if mbstowcs exists
14402 set mbstowcs d_mbstowcs
14405 : see if mbtowc exists
14406 set mbtowc d_mbtowc
14409 : see if memchr exists
14410 set memchr d_memchr
14413 : see if memcmp exists
14414 set memcmp d_memcmp
14417 : see if memcpy exists
14418 set memcpy d_memcpy
14421 : see if memmove exists
14422 set memmove d_memmove
14425 : see if memset exists
14426 set memset d_memset
14429 : see if mkdir exists
14433 : see if mkdtemp exists
14434 set mkdtemp d_mkdtemp
14437 : see if mkfifo exists
14438 set mkfifo d_mkfifo
14441 : see if mkstemp exists
14442 set mkstemp d_mkstemp
14445 : see if mkstemps exists
14446 set mkstemps d_mkstemps
14449 : see if mktime exists
14450 set mktime d_mktime
14453 : see if this is a sys/mman.h system
14454 set sys/mman.h i_sysmman
14457 : see if mmap exists
14460 : see what shmat returns
14461 : default to something harmless
14463 case "$i_sysmman$d_mmap" in
14465 $cat >mmap.c <<'END'
14466 #include <sys/mman.h>
14469 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14474 echo "and it returns ($mmaptype)." >&4
14480 : see if sqrtl exists
14484 : see if scalbnl exists
14485 set scalbnl d_scalbnl
14488 : see if modfl exists
14492 : see if prototype for modfl is available
14494 set d_modflproto modfl $i_math math.h
14497 d_modfl_pow32_bug="$undef"
14499 case "$d_longdbl$d_modfl" in
14502 Checking to see whether your modfl() is okay for large values...
14508 if $test "X$d_modflproto" != "X$define"; then
14509 $cat >>try.c <<EOCP
14510 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14511 long double modfl (long double, long double *);
14514 $cat >>try.c <<EOCP
14516 long double nv = 4294967303.15;
14522 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14526 case "$osname:$gccversion" in
14527 aix:) saveccflags="$ccflags"
14528 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14531 if eval $compile; then
14534 *" 4294967303.150000 1.150000 4294967302.000000")
14535 echo >&4 "Your modfl() is broken for large values."
14536 d_modfl_pow32_bug="$define"
14538 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14542 *" 4294967303.150000 0.150000 4294967303.000000")
14543 echo >&4 "Your modfl() seems okay for large values."
14545 *) echo >&4 "I don't understand your modfl() at all."
14549 $rm -f try.* try core core.try.*
14551 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14554 case "$osname:$gccversion" in
14555 aix:) ccflags="$saveccflags" ;; # restore
14560 if $test "$uselongdouble" = "$define"; then
14562 if $test "$d_sqrtl" != "$define"; then
14563 message="$message sqrtl"
14565 if $test "$d_modfl" != "$define"; then
14566 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14567 echo "You have both aintl and copysignl, so I can emulate modfl."
14569 message="$message modfl"
14572 if $test "$d_frexpl" != "$define"; then
14573 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14574 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14576 message="$message frexpl"
14580 if $test "$message" != ""; then
14583 *** You requested the use of long doubles but you do not seem to have
14584 *** the following mathematical functions needed for long double support:
14586 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14587 *** Cannot continue, aborting.
14595 : see if mprotect exists
14596 set mprotect d_mprotect
14599 : see if msgctl exists
14600 set msgctl d_msgctl
14603 : see if msgget exists
14604 set msgget d_msgget
14607 : see if msgsnd exists
14608 set msgsnd d_msgsnd
14611 : see if msgrcv exists
14612 set msgrcv d_msgrcv
14615 : see how much of the 'msg*(2)' library is present.
14618 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14619 *"$undef"*) h_msg=false;;
14623 case "`ipcs 2>&1`" in
14624 "SVID messages"*"not configured"*)
14625 echo "Your $osname does not have the msg*(2) configured." >&4
14628 set msgctl d_msgctl
14630 set msgget d_msgget
14632 set msgsnd d_msgsnd
14634 set msgrcv d_msgrcv
14640 : we could also check for sys/ipc.h ...
14641 if $h_msg && $test `./findhdr sys/msg.h`; then
14642 echo "You have the full msg*(2) library." >&4
14645 echo "You don't have the full msg*(2) library." >&4
14653 echo "Checking to see if your system supports struct msghdr..." >&4
14654 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14656 case "$d_msghdr_s" in
14657 "$define") echo "Yes, it does." ;;
14658 *) echo "No, it doesn't." ;;
14662 : see if msync exists
14666 : see if munmap exists
14667 set munmap d_munmap
14670 : see if nice exists
14674 : see if this is a langinfo.h system
14675 set langinfo.h i_langinfo
14678 : see if nl_langinfo exists
14679 set nl_langinfo d_nl_langinfo
14682 : check for length of character
14684 case "$charsize" in
14686 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14689 #$i_stdlib I_STDLIB
14691 #include <stdlib.h>
14695 printf("%d\n", (int)sizeof(char));
14700 if eval $compile_ok; then
14704 echo "(I can't seem to compile the test program. Guessing...)"
14711 rp="What is the size of a character (in bytes)?"
14716 : check for volatile keyword
14718 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14719 $cat >try.c <<'EOCP'
14722 typedef struct _goo_struct goo_struct;
14723 goo_struct * volatile goo = ((goo_struct *)0);
14724 struct _goo_struct {
14729 typedef unsigned short foo_t;
14730 char *volatile foo;
14732 volatile foo_t blech;
14736 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14738 echo "Yup, it does."
14741 echo "Nope, it doesn't."
14749 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14751 case "$use64bitint:$d_quad:$quadtype" in
14754 uvtype="$uquadtype"
14759 uvtype="unsigned long"
14765 case "$uselongdouble:$d_longdbl" in
14767 nvtype="long double"
14768 nvsize=$longdblsize
14775 $echo "(IV will be "$ivtype", $ivsize bytes)"
14776 $echo "(UV will be "$uvtype", $uvsize bytes)"
14777 $echo "(NV will be "$nvtype", $nvsize bytes)"
14780 #$i_inttypes I_INTTYPES
14782 #include <inttypes.h>
14787 int8_t i = INT8_MAX;
14788 uint8_t u = UINT8_MAX;
14789 printf("int8_t\n");
14792 int16_t i = INT16_MAX;
14793 uint16_t i = UINT16_MAX;
14794 printf("int16_t\n");
14797 int32_t i = INT32_MAX;
14798 uint32_t u = UINT32_MAX;
14799 printf("int32_t\n");
14805 '') case "$charsize" in
14807 u8type="unsigned char"
14816 if eval $compile; then
14817 case "`$run ./try`" in
14818 int8_t) i8type=int8_t
14828 '') if $test $charsize -ge 1; then
14830 u8type="unsigned char"
14838 '') case "$shortsize" in
14840 u16type="unsigned short"
14848 '') set try -DINT16
14849 if eval $compile; then
14850 case "`$run ./try`" in
14862 '') if $test $shortsize -ge 2; then
14864 u16type="unsigned short"
14872 '') case "$longsize" in
14874 u32type="unsigned long"
14878 *) case "$intsize" in
14880 u32type="unsigned int"
14890 '') set try -DINT32
14891 if eval $compile; then
14892 case "`$run ./try`" in
14904 '') if $test $intsize -ge 4; then
14906 u32type="unsigned int"
14914 '') case "$d_quad:$quadtype" in
14916 i64type="$quadtype"
14917 u64type="$uquadtype"
14925 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14926 : volatile so that the compiler has to store it out to memory.
14927 if test X"$d_volatile" = X"$define"; then
14932 #$i_stdlib I_STDLIB
14934 #include <stdlib.h>
14936 #include <sys/types.h>
14937 #include <signal.h>
14939 $volatile int bletched = 0;
14940 $signal_t blech(s) int s; { bletched = 1; }
14945 int n = 8 * $uvsize;
14948 signal(SIGFPE, blech);
14951 for (i = 0; i < n; i++) {
14952 u = u << 1 | ($uvtype)1;
14954 if (($uvtype)d != u)
14958 d = ($nvtype)(u - 1);
14959 if (($uvtype)d != (u - 1))
14967 printf("%d\n", ((i == n) ? -n : i));
14973 d_nv_preserves_uv="$undef"
14974 if eval $compile; then
14975 nv_preserves_uv_bits="`$run ./try`"
14977 case "$nv_preserves_uv_bits" in
14979 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14980 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14981 d_nv_preserves_uv="$define"
14983 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14984 d_nv_preserves_uv="$undef" ;;
14985 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14986 nv_preserves_uv_bits="$undef" ;;
14991 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
14992 : volatile so that the compiler has to store it out to memory.
14993 if test X"$d_volatile" = X"$define"; then
14998 #$i_stdlib I_STDLIB
15000 #include <stdlib.h>
15002 #$i_string I_STRING
15004 # include <string.h>
15006 # include <strings.h>
15008 #include <sys/types.h>
15009 #include <signal.h>
15011 $volatile int bletched = 0;
15012 $signal_t blech(s) int s; { bletched = 1; }
15015 int checkit($nvtype d, char *where) {
15016 unsigned char *p = (char *)&d;
15017 unsigned char *end = p + sizeof(d);
15027 printf("No - %s: 0x", where);
15029 printf ("%02X", *p++);
15034 int main(int argc, char **argv) {
15037 fail += checkit(d, "0.0");
15039 /* The compiler shouldn't be assuming that bletched is 0 */
15042 fail += checkit(d, "bleched");
15045 signal(SIGFPE, blech);
15048 /* Paranoia - the compiler should have no way of knowing that ANSI says
15049 that argv[argc] will always be NULL. Actually, if it did assume this it
15050 would be buggy, as this is C and main() can be called from elsewhere in
15052 d = argv[argc] ? 1 : 0;
15055 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15058 fail += checkit(d, "ternary");
15060 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15063 printf("No - memset doesn't give 0.0\n");
15064 /* This might just blow up: */
15065 printf("(gives %g)\n", d);
15071 printf("No - something bleched\n");
15076 printf("No - %d fail(s)\n", fail);
15085 d_nv_zero_is_allbits_zero="$undef"
15086 if eval $compile; then
15092 0.0 is represented as all bits zero in memory
15094 d_nv_zero_is_allbits_zero="$define"
15097 0.0 is not represented as all bits zero in memory
15099 d_nv_zero_is_allbits_zero="$undef"
15104 0.0 is not represented as all bits zero in memory
15106 d_nv_zero_is_allbits_zero="$undef"
15114 : check for off64_t
15116 echo "Checking to see if you have off64_t..." >&4
15118 #include <sys/types.h>
15119 #include <unistd.h>
15120 int main() { off64_t x = 7; }
15123 if eval $compile; then
15125 echo "You have off64_t."
15128 echo "You do not have off64_t."
15129 case "$lseeksize" in
15130 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15137 : how to create joinable pthreads
15138 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15140 echo "Checking what constant to use for creating joinable pthreads..." >&4
15141 $cat >try.c <<'EOCP'
15142 #include <pthread.h>
15144 int detachstate = JOINABLE;
15147 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15148 if eval $compile; then
15149 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15150 val="$undef" # Yes, undef.
15151 set d_old_pthread_create_joinable
15154 set old_pthread_create_joinable
15157 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15158 if eval $compile; then
15159 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15161 set d_old_pthread_create_joinable
15163 val=PTHREAD_CREATE_UNDETACHED
15164 set old_pthread_create_joinable
15167 set try -DJOINABLE=__UNDETACHED
15168 if eval $compile; then
15169 echo "You seem to use __UNDETACHED." >&4
15171 set d_old_pthread_create_joinable
15174 set old_pthread_create_joinable
15177 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15179 set d_old_pthread_create_joinable
15182 set old_pthread_create_joinable
15189 d_old_pthread_create_joinable="$undef"
15190 old_pthread_create_joinable=""
15193 : see if pause exists
15197 : see if pipe exists
15201 : see if poll exists
15205 : see if readlink exists
15206 set readlink d_readlink
15212 case "$d_readlink" in
15214 if $issymlink /proc/self/exe ; then
15215 $ls -l /proc/self/exe > reflect
15216 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15217 echo "You have Linux-like /proc/self/exe."
15218 procselfexe='"/proc/self/exe"'
15222 if $issymlink /proc/curproc/file ; then
15223 $ls -l /proc/curproc/file > reflect
15224 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15225 echo "You have BSD-like /proc/curproc/file."
15226 procselfexe='"/proc/curproc/file"'
15236 : see whether the pthread_atfork exists
15238 #include <pthread.h>
15241 #ifdef PTHREAD_ATFORK
15242 pthread_atfork(NULL,NULL,NULL);
15247 : see if pthread_atfork exists
15248 set try -DPTHREAD_ATFORK
15249 if eval $compile; then
15254 case "$usethreads" in
15257 $define) echo 'pthread_atfork found.' >&4 ;;
15258 *) echo 'pthread_atfork NOT found.' >&4 ;;
15261 set d_pthread_atfork
15264 : see if pthread_attr_setscope exists
15265 set pthread_attr_setscope d_pthread_attr_setscope
15269 : see whether the various POSIXish _yields exist
15271 #include <pthread.h>
15277 #ifdef PTHREAD_YIELD
15280 #ifdef PTHREAD_YIELD_NULL
15281 pthread_yield(NULL);
15287 : see if sched_yield exists
15288 set try -DSCHED_YIELD
15289 if eval $compile; then
15291 sched_yield='sched_yield()'
15295 case "$usethreads" in
15298 $define) echo 'sched_yield() found.' >&4 ;;
15299 *) echo 'sched_yield() NOT found.' >&4 ;;
15305 : see if pthread_yield exists
15306 set try -DPTHREAD_YIELD
15307 if eval $compile; then
15309 case "$sched_yield" in
15310 '') sched_yield='pthread_yield()' ;;
15313 set try -DPTHREAD_YIELD_NULL
15314 if eval $compile; then
15316 case "$sched_yield" in
15317 '') sched_yield='pthread_yield(NULL)' ;;
15323 case "$usethreads" in
15326 $define) echo 'pthread_yield() found.' >&4 ;;
15327 *) echo 'pthread_yield() NOT found.' >&4 ;;
15331 set d_pthread_yield
15334 case "$sched_yield" in
15335 '') sched_yield=undef ;;
15340 : see if random_r exists
15341 set random_r d_random_r
15343 case "$d_random_r" in
15345 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15346 case "$d_random_r_proto:$usethreads" in
15347 ":define") d_random_r_proto=define
15348 set d_random_r_proto random_r $hdrs
15352 case "$d_random_r_proto" in
15354 case "$random_r_proto" in
15355 ''|0) try='int random_r(int*, struct random_data*);'
15356 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15358 case "$random_r_proto" in
15359 ''|0) try='int random_r(long*, struct random_data*);'
15360 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15362 case "$random_r_proto" in
15363 ''|0) try='int random_r(struct random_data*, int32_t*);'
15364 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15366 case "$random_r_proto" in
15367 ''|0) d_random_r=undef
15369 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15370 * ) case "$random_r_proto" in
15371 REENTRANT_PROTO*) ;;
15372 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15374 echo "Prototype: $try" ;;
15377 *) case "$usethreads" in
15378 define) echo "random_r has no prototype, not using it." >&4 ;;
15385 *) random_r_proto=0
15389 : see if readdir and friends exist
15390 set readdir d_readdir
15392 set seekdir d_seekdir
15394 set telldir d_telldir
15396 set rewinddir d_rewinddir
15399 : see if readdir64_r exists
15400 set readdir64_r d_readdir64_r
15402 case "$d_readdir64_r" in
15404 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15405 case "$d_readdir64_r_proto:$usethreads" in
15406 ":define") d_readdir64_r_proto=define
15407 set d_readdir64_r_proto readdir64_r $hdrs
15411 case "$d_readdir64_r_proto" in
15413 case "$readdir64_r_proto" in
15414 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15415 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15417 case "$readdir64_r_proto" in
15418 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15419 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15421 case "$readdir64_r_proto" in
15422 ''|0) d_readdir64_r=undef
15423 readdir64_r_proto=0
15424 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15425 * ) case "$readdir64_r_proto" in
15426 REENTRANT_PROTO*) ;;
15427 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15429 echo "Prototype: $try" ;;
15432 *) case "$usethreads" in
15433 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15435 d_readdir64_r=undef
15436 readdir64_r_proto=0
15440 *) readdir64_r_proto=0
15444 : see if readdir_r exists
15445 set readdir_r d_readdir_r
15447 case "$d_readdir_r" in
15449 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15450 case "$d_readdir_r_proto:$usethreads" in
15451 ":define") d_readdir_r_proto=define
15452 set d_readdir_r_proto readdir_r $hdrs
15456 case "$d_readdir_r_proto" in
15458 case "$readdir_r_proto" in
15459 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15460 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15462 case "$readdir_r_proto" in
15463 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15464 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15466 case "$readdir_r_proto" in
15467 ''|0) d_readdir_r=undef
15469 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15470 * ) case "$readdir_r_proto" in
15471 REENTRANT_PROTO*) ;;
15472 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15474 echo "Prototype: $try" ;;
15477 *) case "$usethreads" in
15478 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15485 *) readdir_r_proto=0
15489 : see if readv exists
15493 : see if recvmsg exists
15494 set recvmsg d_recvmsg
15497 : see if rename exists
15498 set rename d_rename
15501 : see if rmdir exists
15505 : see if memory.h is available.
15510 : See if it conflicts with string.h
15516 $cppstdin $cppflags $cppminus < $strings > mem.h
15517 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15519 echo "We won't be including <memory.h>."
15529 : can bcopy handle overlapping blocks?
15532 case "$d_memmove" in
15533 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15534 *) case "$d_bcopy" in
15536 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15538 #$i_memory I_MEMORY
15539 #$i_stdlib I_STDLIB
15540 #$i_string I_STRING
15541 #$i_unistd I_UNISTD
15543 $cat >>try.c <<'EOCP'
15546 # include <memory.h>
15549 # include <stdlib.h>
15552 # include <string.h>
15554 # include <strings.h>
15557 # include <unistd.h> /* Needed for NetBSD */
15561 char buf[128], abc[128];
15567 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15568 try to store the string in read-only memory. */
15569 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15571 for (align = 7; align >= 0; align--) {
15572 for (len = 36; len; len--) {
15574 bcopy(abc, b, len);
15575 for (off = 1; off <= len; off++) {
15576 bcopy(b, b+off, len);
15577 bcopy(b+off, b, len);
15578 if (bcmp(b, abc, len))
15587 if eval $compile_ok; then
15588 if ./try 2>/dev/null; then
15589 echo "Yes, it can."
15592 echo "It can't, sorry."
15595 echo "(I can't compile the test program, so we'll assume not...)"
15599 $rm -f try.* try core
15605 : can memcpy handle overlapping blocks?
15608 case "$d_memmove" in
15609 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15610 *) case "$d_memcpy" in
15612 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15614 #$i_memory I_MEMORY
15615 #$i_stdlib I_STDLIB
15616 #$i_string I_STRING
15617 #$i_unistd I_UNISTD
15619 $cat >>try.c <<'EOCP'
15622 # include <memory.h>
15625 # include <stdlib.h>
15628 # include <string.h>
15630 # include <strings.h>
15633 # include <unistd.h> /* Needed for NetBSD */
15637 char buf[128], abc[128];
15643 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15644 try to store the string in read-only memory. */
15645 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15647 for (align = 7; align >= 0; align--) {
15648 for (len = 36; len; len--) {
15650 memcpy(b, abc, len);
15651 for (off = 1; off <= len; off++) {
15652 memcpy(b+off, b, len);
15653 memcpy(b, b+off, len);
15654 if (memcmp(b, abc, len))
15663 if eval $compile_ok; then
15664 if ./try 2>/dev/null; then
15665 echo "Yes, it can."
15668 echo "It can't, sorry."
15671 echo "(I can't compile the test program, so we'll assume not...)"
15675 $rm -f try.* try core
15681 : can memcmp be trusted to compare relative magnitude?
15683 case "$d_memcmp" in
15686 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15688 #$i_memory I_MEMORY
15689 #$i_stdlib I_STDLIB
15690 #$i_string I_STRING
15691 #$i_unistd I_UNISTD
15693 $cat >>try.c <<'EOCP'
15696 # include <memory.h>
15699 # include <stdlib.h>
15702 # include <string.h>
15704 # include <strings.h>
15707 # include <unistd.h> /* Needed for NetBSD */
15713 if ((a < b) && memcmp(&a, &b, 1) < 0)
15719 if eval $compile_ok; then
15720 if $run ./try 2>/dev/null; then
15721 echo "Yes, it can."
15724 echo "No, it can't (it uses signed chars)."
15727 echo "(I can't compile the test program, so we'll assume not...)"
15731 $rm -f try.* try core
15735 : see if prototype for sbrk is available
15737 set d_sbrkproto sbrk $i_unistd unistd.h
15740 : see if select exists
15741 set select d_select
15744 : see if semctl exists
15745 set semctl d_semctl
15748 : see if semget exists
15749 set semget d_semget
15752 : see if semop exists
15756 : see how much of the 'sem*(2)' library is present.
15759 case "$d_semctl$d_semget$d_semop" in
15760 *"$undef"*) h_sem=false;;
15764 case "`ipcs 2>&1`" in
15765 "SVID messages"*"not configured"*)
15766 echo "Your $osname does not have the sem*(2) configured." >&4
15769 set semctl d_semctl
15771 set semget d_semget
15779 : we could also check for sys/ipc.h ...
15780 if $h_sem && $test `./findhdr sys/sem.h`; then
15781 echo "You have the full sem*(2) library." >&4
15784 echo "You don't have the full sem*(2) library." >&4
15790 : see whether sys/sem.h defines union semun
15792 $cat > try.c <<'END'
15793 #include <sys/types.h>
15794 #include <sys/ipc.h>
15795 #include <sys/sem.h>
15796 int main () { union semun semun; semun.buf = 0; }
15799 if eval $compile; then
15800 echo "You have union semun in <sys/sem.h>." >&4
15803 echo "You do not have union semun in <sys/sem.h>." >&4
15810 : see how to do semctl IPC_STAT
15817 # define S_IRUSR S_IREAD
15818 # define S_IWUSR S_IWRITE
15819 # define S_IXUSR S_IEXEC
15821 # define S_IRUSR 0400
15822 # define S_IWUSR 0200
15823 # define S_IXUSR 0100
15825 # define S_IRGRP (S_IRUSR>>3)
15826 # define S_IWGRP (S_IWUSR>>3)
15827 # define S_IXGRP (S_IXUSR>>3)
15828 # define S_IROTH (S_IRUSR>>6)
15829 # define S_IWOTH (S_IWUSR>>6)
15830 # define S_IXOTH (S_IXUSR>>6)
15833 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15834 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15835 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15838 : see whether semctl IPC_STAT can use union semun
15839 case "$d_semctl_semun" in
15843 #include <sys/types.h>
15844 #include <sys/ipc.h>
15845 #include <sys/sem.h>
15846 #include <sys/stat.h>
15853 #$d_union_semun HAS_UNION_SEMUN
15856 #ifndef HAS_UNION_SEMUN
15859 struct semid_ds *buf;
15860 unsigned short *array;
15866 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15867 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15869 struct semid_ds argbuf;
15872 st = semctl(sem, 0, IPC_STAT, arg);
15876 # endif /* IPC_STAT */
15877 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15879 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15880 # endif /* IPC_RMID */
15881 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15883 #endif /* IPC_PRIVATE && ... */
15884 printf("semget failed: errno = %d\n", errno);
15889 if eval $compile; then
15892 semun) val="$define" ;;
15900 case "$d_semctl_semun" in
15902 echo "You can use union semun for semctl IPC_STAT." >&4
15905 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15910 : see whether semctl IPC_STAT can use struct semid_ds pointer
15911 case "$d_semctl_semid_ds" in
15914 $cat > try.c <<'END'
15915 #include <sys/types.h>
15916 #include <sys/ipc.h>
15917 #include <sys/sem.h>
15918 #include <sys/stat.h>
15926 struct semid_ds arg;
15929 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15930 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15933 st = semctl(sem, 0, IPC_STAT, &arg);
15935 printf("semid_ds\n");
15937 # endif /* IPC_STAT */
15938 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15940 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15941 # endif /* IPC_RMID */
15942 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15944 #endif /* IPC_PRIVATE && ... */
15945 printf("semget failed: errno = %d\n", errno);
15951 if eval $compile; then
15954 semid_ds) val="$define" ;;
15958 set d_semctl_semid_ds
15962 case "$d_semctl_semid_ds" in
15964 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15966 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15973 # We do not have the full sem*(2) library, so assume we can not
15979 set d_semctl_semid_ds
15984 : see if sendmsg exists
15985 set sendmsg d_sendmsg
15988 : see if setegid exists
15989 set setegid d_setegid
15992 : see if seteuid exists
15993 set seteuid d_seteuid
15996 : see if setgrent exists
15997 set setgrent d_setgrent
16000 : see if setgrent_r exists
16001 set setgrent_r d_setgrent_r
16003 case "$d_setgrent_r" in
16005 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16006 case "$d_setgrent_r_proto:$usethreads" in
16007 ":define") d_setgrent_r_proto=define
16008 set d_setgrent_r_proto setgrent_r $hdrs
16012 case "$d_setgrent_r_proto" in
16014 case "$setgrent_r_proto" in
16015 ''|0) try='int setgrent_r(FILE**);'
16016 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16018 case "$setgrent_r_proto" in
16019 ''|0) try='void setgrent_r(FILE**);'
16020 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16022 case "$setgrent_r_proto" in
16023 ''|0) d_setgrent_r=undef
16025 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16026 * ) case "$setgrent_r_proto" in
16027 REENTRANT_PROTO*) ;;
16028 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16030 echo "Prototype: $try" ;;
16033 *) case "$usethreads" in
16034 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16041 *) setgrent_r_proto=0
16045 : see if sethostent exists
16046 set sethostent d_sethent
16049 : see if sethostent_r exists
16050 set sethostent_r d_sethostent_r
16052 case "$d_sethostent_r" in
16054 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16055 case "$d_sethostent_r_proto:$usethreads" in
16056 ":define") d_sethostent_r_proto=define
16057 set d_sethostent_r_proto sethostent_r $hdrs
16061 case "$d_sethostent_r_proto" in
16063 case "$sethostent_r_proto" in
16064 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16065 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16067 case "$sethostent_r_proto" in
16068 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16069 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16071 case "$sethostent_r_proto" in
16072 ''|0) d_sethostent_r=undef
16073 sethostent_r_proto=0
16074 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16075 * ) case "$sethostent_r_proto" in
16076 REENTRANT_PROTO*) ;;
16077 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16079 echo "Prototype: $try" ;;
16082 *) case "$usethreads" in
16083 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16085 d_sethostent_r=undef
16086 sethostent_r_proto=0
16090 *) sethostent_r_proto=0
16094 : see if setitimer exists
16095 set setitimer d_setitimer
16098 : see if setlinebuf exists
16099 set setlinebuf d_setlinebuf
16102 : see if setlocale exists
16103 set setlocale d_setlocale
16106 : see if locale.h is available
16107 set locale.h i_locale
16110 : see if setlocale_r exists
16111 set setlocale_r d_setlocale_r
16113 case "$d_setlocale_r" in
16115 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16116 case "$d_setlocale_r_proto:$usethreads" in
16117 ":define") d_setlocale_r_proto=define
16118 set d_setlocale_r_proto setlocale_r $hdrs
16122 case "$d_setlocale_r_proto" in
16124 case "$setlocale_r_proto" in
16125 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16126 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16128 case "$setlocale_r_proto" in
16129 ''|0) d_setlocale_r=undef
16130 setlocale_r_proto=0
16131 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16132 * ) case "$setlocale_r_proto" in
16133 REENTRANT_PROTO*) ;;
16134 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16136 echo "Prototype: $try" ;;
16139 *) case "$usethreads" in
16140 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16142 d_setlocale_r=undef
16143 setlocale_r_proto=0
16147 *) setlocale_r_proto=0
16151 : see if setnetent exists
16152 set setnetent d_setnent
16155 : see if setnetent_r exists
16156 set setnetent_r d_setnetent_r
16158 case "$d_setnetent_r" in
16160 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16161 case "$d_setnetent_r_proto:$usethreads" in
16162 ":define") d_setnetent_r_proto=define
16163 set d_setnetent_r_proto setnetent_r $hdrs
16167 case "$d_setnetent_r_proto" in
16169 case "$setnetent_r_proto" in
16170 ''|0) try='int setnetent_r(int, struct netent_data*);'
16171 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16173 case "$setnetent_r_proto" in
16174 ''|0) try='void setnetent_r(int, struct netent_data*);'
16175 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16177 case "$setnetent_r_proto" in
16178 ''|0) d_setnetent_r=undef
16179 setnetent_r_proto=0
16180 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16181 * ) case "$setnetent_r_proto" in
16182 REENTRANT_PROTO*) ;;
16183 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16185 echo "Prototype: $try" ;;
16188 *) case "$usethreads" in
16189 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16191 d_setnetent_r=undef
16192 setnetent_r_proto=0
16196 *) setnetent_r_proto=0
16200 : see if setprotoent exists
16201 set setprotoent d_setpent
16204 : see if setpgid exists
16205 set setpgid d_setpgid
16208 : see if setpgrp2 exists
16209 set setpgrp2 d_setpgrp2
16212 : see if setpriority exists
16213 set setpriority d_setprior
16216 : see if setproctitle exists
16217 set setproctitle d_setproctitle
16220 : see if setprotoent_r exists
16221 set setprotoent_r d_setprotoent_r
16223 case "$d_setprotoent_r" in
16225 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16226 case "$d_setprotoent_r_proto:$usethreads" in
16227 ":define") d_setprotoent_r_proto=define
16228 set d_setprotoent_r_proto setprotoent_r $hdrs
16232 case "$d_setprotoent_r_proto" in
16234 case "$setprotoent_r_proto" in
16235 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16236 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16238 case "$setprotoent_r_proto" in
16239 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16240 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16242 case "$setprotoent_r_proto" in
16243 ''|0) d_setprotoent_r=undef
16244 setprotoent_r_proto=0
16245 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16246 * ) case "$setprotoent_r_proto" in
16247 REENTRANT_PROTO*) ;;
16248 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16250 echo "Prototype: $try" ;;
16253 *) case "$usethreads" in
16254 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16256 d_setprotoent_r=undef
16257 setprotoent_r_proto=0
16261 *) setprotoent_r_proto=0
16265 : see if setpwent exists
16266 set setpwent d_setpwent
16269 : see if setpwent_r exists
16270 set setpwent_r d_setpwent_r
16272 case "$d_setpwent_r" in
16274 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16275 case "$d_setpwent_r_proto:$usethreads" in
16276 ":define") d_setpwent_r_proto=define
16277 set d_setpwent_r_proto setpwent_r $hdrs
16281 case "$d_setpwent_r_proto" in
16283 case "$setpwent_r_proto" in
16284 ''|0) try='int setpwent_r(FILE**);'
16285 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16287 case "$setpwent_r_proto" in
16288 ''|0) try='void setpwent_r(FILE**);'
16289 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16291 case "$setpwent_r_proto" in
16292 ''|0) d_setpwent_r=undef
16294 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16295 * ) case "$setpwent_r_proto" in
16296 REENTRANT_PROTO*) ;;
16297 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16299 echo "Prototype: $try" ;;
16302 *) case "$usethreads" in
16303 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16310 *) setpwent_r_proto=0
16314 : see if setregid exists
16315 set setregid d_setregid
16317 set setresgid d_setresgid
16320 : see if setreuid exists
16321 set setreuid d_setreuid
16323 set setresuid d_setresuid
16326 : see if setrgid exists
16327 set setrgid d_setrgid
16330 : see if setruid exists
16331 set setruid d_setruid
16334 : see if setservent exists
16335 set setservent d_setsent
16338 : see if setservent_r exists
16339 set setservent_r d_setservent_r
16341 case "$d_setservent_r" in
16343 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16344 case "$d_setservent_r_proto:$usethreads" in
16345 ":define") d_setservent_r_proto=define
16346 set d_setservent_r_proto setservent_r $hdrs
16350 case "$d_setservent_r_proto" in
16352 case "$setservent_r_proto" in
16353 ''|0) try='int setservent_r(int, struct servent_data*);'
16354 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16356 case "$setservent_r_proto" in
16357 ''|0) try='void setservent_r(int, struct servent_data*);'
16358 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16360 case "$setservent_r_proto" in
16361 ''|0) d_setservent_r=undef
16362 setservent_r_proto=0
16363 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16364 * ) case "$setservent_r_proto" in
16365 REENTRANT_PROTO*) ;;
16366 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16368 echo "Prototype: $try" ;;
16371 *) case "$usethreads" in
16372 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16374 d_setservent_r=undef
16375 setservent_r_proto=0
16379 *) setservent_r_proto=0
16383 : see if setsid exists
16384 set setsid d_setsid
16387 : see if setvbuf exists
16388 set setvbuf d_setvbuf
16391 : see if sfio.h is available
16396 : see if sfio library is available
16407 : Ok, but do we want to use it.
16411 true|$define|[yY]*) dflt='y';;
16414 echo "$package can use the sfio library, but it is experimental."
16415 case "$useperlio" in
16417 echo "For sfio also the PerlIO abstraction layer is needed."
16418 echo "Earlier you said you wouldn't want that."
16421 rp="You seem to have sfio available, do you want to try using it?"
16424 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16425 useperlio="$define"
16428 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16433 *) case "$usesfio" in
16434 true|$define|[yY]*)
16435 echo "Sorry, cannot find sfio on this machine." >&4
16436 echo "Ignoring your setting of usesfio=$usesfio." >&4
16445 $define) usesfio='true';;
16446 *) usesfio='false';;
16450 *) : Remove sfio from list of libraries to use
16453 echo "Removing unneeded -lsfio from library list" >&4
16454 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16457 echo "libs = $libs" >&4
16464 : see if shmctl exists
16465 set shmctl d_shmctl
16468 : see if shmget exists
16469 set shmget d_shmget
16472 : see if shmat exists
16475 : see what shmat returns
16478 $cat >shmat.c <<'END'
16479 #include <sys/shm.h>
16482 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16487 echo "and it returns ($shmattype)." >&4
16488 : see if a prototype for shmat is available
16489 xxx=`./findhdr sys/shm.h`
16490 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16491 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16502 set d_shmatprototype
16505 : see if shmdt exists
16509 : see how much of the 'shm*(2)' library is present.
16512 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16513 *"$undef"*) h_shm=false;;
16517 case "`ipcs 2>&1`" in
16518 "SVID shared memory"*"not configured"*)
16519 echo "Your $osname does not have the shm*(2) configured." >&4
16522 set shmctl d_shmctl
16524 set shmget d_shmget
16534 : we could also check for sys/ipc.h ...
16535 if $h_shm && $test `./findhdr sys/shm.h`; then
16536 echo "You have the full shm*(2) library." >&4
16539 echo "You don't have the full shm*(2) library." >&4
16546 : see if we have sigaction
16547 if set sigaction val -f d_sigaction; eval $csym; $val; then
16548 echo 'sigaction() found.' >&4
16551 #include <sys/types.h>
16552 #include <signal.h>
16553 #$i_stdlib I_STDLIB
16555 #include <stdlib.h>
16559 struct sigaction act, oact;
16561 oact.sa_handler = 0;
16562 /* so that act and oact are used */
16563 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16567 if eval $compile_ok; then
16570 echo "But you don't seem to have a useable struct sigaction." >&4
16574 echo 'sigaction NOT found.' >&4
16577 set d_sigaction; eval $setvar
16578 $rm -f try try$_o try.c
16580 : see if sigprocmask exists
16581 set sigprocmask d_sigprocmask
16584 : see if sigsetjmp exists
16586 case "$d_sigsetjmp" in
16589 #include <setjmp.h>
16590 #$i_stdlib I_STDLIB
16592 #include <stdlib.h>
16598 if (sigsetjmp(env,1))
16601 siglongjmp(env, 1);
16606 if eval $compile; then
16607 if $run ./try >/dev/null 2>&1; then
16608 echo "POSIX sigsetjmp found." >&4
16612 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16618 echo "sigsetjmp not found." >&4
16622 *) val="$d_sigsetjmp"
16623 case "$d_sigsetjmp" in
16624 $define) echo "POSIX sigsetjmp found." >&4;;
16625 $undef) echo "sigsetjmp not found." >&4;;
16633 : see if snprintf exists
16634 set snprintf d_snprintf
16637 : see if vsnprintf exists
16638 set vsnprintf d_vsnprintf
16641 case "$d_snprintf-$d_vsnprintf" in
16644 Checking whether your snprintf() and vsnprintf() work okay...
16646 $cat >try.c <<'EOCP'
16647 /* v?snprintf testing logic courtesy of Russ Allbery.
16648 * According to C99:
16649 * - if the buffer is too short it still must be \0-terminated
16650 * - if the buffer is too short the potentially required length
16651 * must be returned and not -1
16652 * - if the buffer is NULL the potentially required length
16653 * must be returned and not -1 or core dump
16656 #include <stdarg.h>
16660 int test (char *format, ...)
16665 va_start (args, format);
16666 count = vsnprintf (buf, sizeof buf, format, args);
16673 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16674 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16678 if eval $compile; then
16681 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16683 Your snprintf() and snprintf() don't seem to be working okay.
16685 d_snprintf="$undef"
16686 d_vsnprintf="$undef"
16690 echo "(I can't seem to compile the test program--assuming they don't)"
16691 d_snprintf="$undef"
16692 d_vsnprintf="$undef"
16694 $rm -f try.* try core core.try.*
16698 : see if sockatmark exists
16699 set sockatmark d_sockatmark
16702 : see if prototype for sockatmark is available
16704 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16707 : see if socks5_init exists
16708 set socks5_init d_socks5_init
16711 : see if sprintf returns the length of the string in the buffer as per ANSI
16712 $echo "Checking whether sprintf returns the length of the string..." >&4
16715 #$i_stdlib I_STDLIB
16717 #include <stdlib.h>
16719 #$i_string I_STRING
16721 # include <string.h>
16723 # include <strings.h>
16732 int check (size_t expect, int test) {
16733 size_t got = strlen(buffer);
16737 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16742 int main(int argc, char **argv) {
16745 check(sprintf(buffer, ""), ++test);
16746 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16747 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16754 d_sprintf_returns_strlen="$undef"
16755 if eval $compile; then
16759 sprintf returns the length of the string (as ANSI says it should)
16761 d_sprintf_returns_strlen="$define"
16764 sprintf does not return the length of the string (how old is this system?)
16766 d_sprintf_returns_strlen="$undef"
16773 : see if srand48_r exists
16774 set srand48_r d_srand48_r
16776 case "$d_srand48_r" in
16778 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16779 case "$d_srand48_r_proto:$usethreads" in
16780 ":define") d_srand48_r_proto=define
16781 set d_srand48_r_proto srand48_r $hdrs
16785 case "$d_srand48_r_proto" in
16787 case "$srand48_r_proto" in
16788 ''|0) try='int srand48_r(long, struct drand48_data*);'
16789 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16791 case "$srand48_r_proto" in
16792 ''|0) d_srand48_r=undef
16794 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16795 * ) case "$srand48_r_proto" in
16796 REENTRANT_PROTO*) ;;
16797 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16799 echo "Prototype: $try" ;;
16802 *) case "$usethreads" in
16803 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16810 *) srand48_r_proto=0
16814 : see if srandom_r exists
16815 set srandom_r d_srandom_r
16817 case "$d_srandom_r" in
16819 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16820 case "$d_srandom_r_proto:$usethreads" in
16821 ":define") d_srandom_r_proto=define
16822 set d_srandom_r_proto srandom_r $hdrs
16826 case "$d_srandom_r_proto" in
16828 case "$srandom_r_proto" in
16829 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16830 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16832 case "$srandom_r_proto" in
16833 ''|0) d_srandom_r=undef
16835 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16836 * ) case "$srandom_r_proto" in
16837 REENTRANT_PROTO*) ;;
16838 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16840 echo "Prototype: $try" ;;
16843 *) case "$usethreads" in
16844 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16851 *) srandom_r_proto=0
16855 : see if prototype for setresgid is available
16857 set d_sresgproto setresgid $i_unistd unistd.h
16860 : see if prototype for setresuid is available
16862 set d_sresuproto setresuid $i_unistd unistd.h
16865 : see if sys/stat.h is available
16866 set sys/stat.h i_sysstat
16870 : see if stat knows about block sizes
16872 echo "Checking to see if your struct stat has st_blocks field..." >&4
16873 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16877 : see if this is a sys/vfs.h system
16878 set sys/vfs.h i_sysvfs
16882 : see if this is a sys/statfs.h system
16883 set sys/statfs.h i_sysstatfs
16888 echo "Checking to see if your system supports struct statfs..." >&4
16889 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
16891 case "$d_statfs_s" in
16892 "$define") echo "Yes, it does." ;;
16893 *) echo "No, it doesn't." ;;
16898 : see if struct statfs knows about f_flags
16899 case "$d_statfs_s" in
16902 echo "Checking to see if your struct statfs has f_flags field..." >&4
16903 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
16907 set d_statfs_f_flags
16911 case "$d_statfs_f_flags" in
16912 "$define") echo "Yes, it does." ;;
16913 *) echo "No, it doesn't." ;;
16917 Checking how to access stdio streams by file descriptor number...
16919 case "$stdio_stream_array" in
16920 '') $cat >try.c <<EOCP
16923 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16927 for s in _iob __iob __sF
16929 set try -DSTDIO_STREAM_ARRAY=$s
16930 if eval $compile; then
16931 case "`$run ./try`" in
16932 yes) stdio_stream_array=$s; break ;;
16936 $rm -f try.* try$exe_ext
16938 case "$stdio_stream_array" in
16940 I can't figure out how to access stdio streams by file descriptor number.
16942 d_stdio_stream_array="$undef"
16945 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16947 d_stdio_stream_array="$define"
16951 : see if strcoll exists
16952 set strcoll d_strcoll
16955 : check for structure copying
16957 echo "Checking to see if your C compiler can copy structs..." >&4
16958 $cat >try.c <<'EOCP'
16968 if $cc -c try.c >/dev/null 2>&1 ; then
16970 echo "Yup, it can."
16973 echo "Nope, it can't."
16979 : see if strerror and/or sys_errlist[] exist
16981 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16982 if set strerror val -f d_strerror; eval $csym; $val; then
16983 echo 'strerror() found.' >&4
16984 d_strerror="$define"
16985 d_strerrm='strerror(e)'
16986 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16987 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16988 d_syserrlst="$define"
16990 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16991 d_syserrlst="$undef"
16993 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16994 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16995 echo 'strerror() found in string header.' >&4
16996 d_strerror="$define"
16997 d_strerrm='strerror(e)'
16998 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16999 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17000 d_syserrlst="$define"
17002 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17003 d_syserrlst="$undef"
17005 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17006 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17007 d_strerror="$undef"
17008 d_syserrlst="$define"
17009 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17011 echo 'strerror() and sys_errlist[] NOT found.' >&4
17012 d_strerror="$undef"
17013 d_syserrlst="$undef"
17014 d_strerrm='"unknown"'
17018 : see if strerror_r exists
17019 set strerror_r d_strerror_r
17021 case "$d_strerror_r" in
17023 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17024 case "$d_strerror_r_proto:$usethreads" in
17025 ":define") d_strerror_r_proto=define
17026 set d_strerror_r_proto strerror_r $hdrs
17030 case "$d_strerror_r_proto" in
17032 case "$strerror_r_proto" in
17033 ''|0) try='int strerror_r(int, char*, size_t);'
17034 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17036 case "$strerror_r_proto" in
17037 ''|0) try='int strerror_r(int, char*, int);'
17038 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17040 case "$strerror_r_proto" in
17041 ''|0) try='char* strerror_r(int, char*, size_t);'
17042 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17044 case "$strerror_r_proto" in
17045 ''|0) d_strerror_r=undef
17047 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17048 * ) case "$strerror_r_proto" in
17049 REENTRANT_PROTO*) ;;
17050 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17052 echo "Prototype: $try" ;;
17055 *) case "$usethreads" in
17056 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17063 *) strerror_r_proto=0
17067 : see if strftime exists
17068 set strftime d_strftime
17071 : see if strlcat exists
17072 set strlcat d_strlcat
17075 : see if strlcpy exists
17076 set strlcpy d_strlcpy
17079 : see if strtod exists
17080 set strtod d_strtod
17083 : see if strtol exists
17084 set strtol d_strtol
17087 : see if strtold exists
17088 set strtold d_strtold
17091 : see if strtoll exists
17092 set strtoll d_strtoll
17095 case "$d_longlong-$d_strtoll" in
17098 Checking whether your strtoll() works okay...
17100 $cat >try.c <<'EOCP'
17103 #define strtoll __strtoll
17106 #define strtoll _strtoll
17109 extern long long int strtoll(char *s, char **, int);
17110 static int bad = 0;
17111 int check(char *s, long long ell, int een) {
17114 gll = strtoll(s, 0, 10);
17115 if (!((gll == ell) && (errno == een)))
17119 check(" 1", 1LL, 0);
17120 check(" 0", 0LL, 0);
17121 check("-1", -1LL, 0);
17122 check("-9223372036854775808", -9223372036854775808LL, 0);
17123 check("-9223372036854775808", -9223372036854775808LL, 0);
17124 check(" 9223372036854775807", 9223372036854775807LL, 0);
17125 check("-9223372036854775808", -9223372036854775808LL, 0);
17126 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17127 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17133 if eval $compile; then
17136 ok) echo "Your strtoll() seems to be working okay." ;;
17138 Your strtoll() doesn't seem to be working okay.
17144 echo "(I can't seem to compile the test program--assuming it doesn't)"
17150 : see if strtoq exists
17151 set strtoq d_strtoq
17154 : see if strtoul exists
17155 set strtoul d_strtoul
17158 case "$d_strtoul" in
17161 Checking whether your strtoul() works okay...
17163 $cat >try.c <<'EOCP'
17166 extern unsigned long int strtoul(char *s, char **, int);
17167 static int bad = 0;
17168 void check(char *s, unsigned long eul, int een) {
17171 gul = strtoul(s, 0, 10);
17172 if (!((gul == eul) && (errno == een)))
17176 check(" 1", 1L, 0);
17177 check(" 0", 0L, 0);
17179 case "$longsize" in
17181 $cat >>try.c <<'EOCP'
17182 check("18446744073709551615", 18446744073709551615UL, 0);
17183 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17184 #if 0 /* strtoul() for /^-/ strings is undefined. */
17185 check("-1", 18446744073709551615UL, 0);
17186 check("-18446744073709551614", 2, 0);
17187 check("-18446744073709551615", 1, 0);
17188 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17189 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17194 $cat >>try.c <<'EOCP'
17195 check("4294967295", 4294967295UL, 0);
17196 check("4294967296", 4294967295UL, ERANGE);
17197 #if 0 /* strtoul() for /^-/ strings is undefined. */
17198 check("-1", 4294967295UL, 0);
17199 check("-4294967294", 2, 0);
17200 check("-4294967295", 1, 0);
17201 check("-4294967296", 4294967295UL, ERANGE);
17202 check("-4294967297", 4294967295UL, ERANGE);
17207 : Should we write these tests to be more portable by sprintf-ing
17208 : ~0 and then manipulating that char string as input for strtol?
17211 $cat >>try.c <<'EOCP'
17218 if eval $compile; then
17219 case "`$run ./try`" in
17220 ok) echo "Your strtoul() seems to be working okay." ;;
17222 Your strtoul() doesn't seem to be working okay.
17231 : see if strtoull exists
17232 set strtoull d_strtoull
17235 case "$d_longlong-$d_strtoull" in
17238 Checking whether your strtoull() works okay...
17240 $cat >try.c <<'EOCP'
17243 #define strtoull __strtoull
17246 extern unsigned long long int strtoull(char *s, char **, int);
17247 static int bad = 0;
17248 int check(char *s, long long eull, int een) {
17251 gull = strtoull(s, 0, 10);
17252 if (!((gull == eull) && (errno == een)))
17256 check(" 1", 1LL, 0);
17257 check(" 0", 0LL, 0);
17258 check("18446744073709551615", 18446744073709551615ULL, 0);
17259 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17260 #if 0 /* strtoull() for /^-/ strings is undefined. */
17261 check("-1", 18446744073709551615ULL, 0);
17262 check("-18446744073709551614", 2LL, 0);
17263 check("-18446744073709551615", 1LL, 0);
17264 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17265 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17272 if eval $compile; then
17273 case "`$run ./try`" in
17274 ok) echo "Your strtoull() seems to be working okay." ;;
17276 Your strtoull() doesn't seem to be working okay.
17278 d_strtoull="$undef"
17285 : see if strtouq exists
17286 set strtouq d_strtouq
17289 case "$d_strtouq" in
17292 Checking whether your strtouq() works okay...
17294 $cat >try.c <<'EOCP'
17297 extern unsigned long long int strtouq(char *s, char **, int);
17298 static int bad = 0;
17299 void check(char *s, unsigned long long eull, int een) {
17300 unsigned long long gull;
17302 gull = strtouq(s, 0, 10);
17303 if (!((gull == eull) && (errno == een)))
17307 check(" 1", 1LL, 0);
17308 check(" 0", 0LL, 0);
17309 check("18446744073709551615", 18446744073709551615ULL, 0);
17310 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17311 #if 0 /* strtouq() for /^-/ strings is undefined. */
17312 check("-1", 18446744073709551615ULL, 0);
17313 check("-18446744073709551614", 2LL, 0);
17314 check("-18446744073709551615", 1LL, 0);
17315 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17316 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17324 if eval $compile; then
17325 case "`$run ./try`" in
17326 ok) echo "Your strtouq() seems to be working okay." ;;
17328 Your strtouq() doesn't seem to be working okay.
17337 : see if strxfrm exists
17338 set strxfrm d_strxfrm
17341 : see if symlink exists
17342 set symlink d_symlink
17345 : see if syscall exists
17346 set syscall d_syscall
17349 : see if prototype for syscall is available
17351 set d_syscallproto syscall $i_unistd unistd.h
17354 : see if sysconf exists
17355 set sysconf d_sysconf
17358 : see if system exists
17359 set system d_system
17362 : see if tcgetpgrp exists
17363 set tcgetpgrp d_tcgetpgrp
17366 : see if tcsetpgrp exists
17367 set tcsetpgrp d_tcsetpgrp
17370 : see if prototype for telldir is available
17372 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17375 : see if time exists
17377 if test "X$d_time" = X -o X"$timetype" = X; then
17378 if set time val -f d_time; eval $csym; $val; then
17379 echo 'time() found.' >&4
17381 rp="What is the type returned by time() on this system?"
17382 set time_t timetype long stdio.h sys/types.h
17385 echo 'time() not found, hope that will do.' >&4
17393 : see if this is a sys/times.h system
17394 set sys/times.h i_systimes
17397 : see if times exists
17399 if set times val -f d_times; eval $csym; $val; then
17400 echo 'times() found.' >&4
17403 case "$i_systimes" in
17404 "$define") inc='sys/times.h';;
17406 rp="What is the type returned by times() on this system?"
17407 set clock_t clocktype long stdio.h sys/types.h $inc
17410 echo 'times() NOT found, hope that will do.' >&4
17415 : see if tmpnam_r exists
17416 set tmpnam_r d_tmpnam_r
17418 case "$d_tmpnam_r" in
17420 hdrs="$i_systypes sys/types.h define stdio.h "
17421 case "$d_tmpnam_r_proto:$usethreads" in
17422 ":define") d_tmpnam_r_proto=define
17423 set d_tmpnam_r_proto tmpnam_r $hdrs
17427 case "$d_tmpnam_r_proto" in
17429 case "$tmpnam_r_proto" in
17430 ''|0) try='char* tmpnam_r(char*);'
17431 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17433 case "$tmpnam_r_proto" in
17434 ''|0) d_tmpnam_r=undef
17436 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17437 * ) case "$tmpnam_r_proto" in
17438 REENTRANT_PROTO*) ;;
17439 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17441 echo "Prototype: $try" ;;
17444 *) case "$usethreads" in
17445 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17452 *) tmpnam_r_proto=0
17456 : see if truncate exists
17457 set truncate d_truncate
17460 : see if ttyname_r exists
17461 set ttyname_r d_ttyname_r
17463 case "$d_ttyname_r" in
17465 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17466 case "$d_ttyname_r_proto:$usethreads" in
17467 ":define") d_ttyname_r_proto=define
17468 set d_ttyname_r_proto ttyname_r $hdrs
17472 case "$d_ttyname_r_proto" in
17474 case "$ttyname_r_proto" in
17475 ''|0) try='int ttyname_r(int, char*, size_t);'
17476 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17478 case "$ttyname_r_proto" in
17479 ''|0) try='int ttyname_r(int, char*, int);'
17480 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17482 case "$ttyname_r_proto" in
17483 ''|0) try='char* ttyname_r(int, char*, int);'
17484 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17486 case "$ttyname_r_proto" in
17487 ''|0) d_ttyname_r=undef
17489 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17490 * ) case "$ttyname_r_proto" in
17491 REENTRANT_PROTO*) ;;
17492 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17494 echo "Prototype: $try" ;;
17497 *) case "$usethreads" in
17498 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17505 *) ttyname_r_proto=0
17509 : see if tzname[] exists
17511 if set tzname val -a d_tzname; eval $csym; $val; then
17513 echo 'tzname[] found.' >&4
17516 echo 'tzname[] NOT found.' >&4
17522 next|rhapsody|darwin) multiarch="$define" ;;
17524 case "$multiarch" in
17525 ''|[nN]*) multiarch="$undef" ;;
17528 : check for ordering of bytes in a UV
17530 case "$usecrosscompile$multiarch" in
17533 You seem to be either cross-compiling or doing a multiarchitecture build,
17534 skipping the byteorder check.
17540 case "$byteorder" in
17543 In the following, larger digits indicate more significance. A big-endian
17544 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17545 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17546 machines may have weird orders like 3412. A Cray will report 87654321,
17547 an Alpha will report 12345678. If the test program works the default is
17549 I'm now running the test program...
17553 #$i_stdlib I_STDLIB
17555 #include <stdlib.h>
17557 #include <sys/types.h>
17558 typedef $uvtype UV;
17568 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17570 u.l = (UV)0x04030201;
17571 for (i = 0; i < $uvsize; i++)
17572 printf("%c", u.c[i]+'0');
17579 if eval $compile && ./try > /dev/null; then
17582 [1-4][1-4][1-4][1-4]|12345678|87654321)
17583 echo "(The test program ran ok.)"
17584 echo "byteorder=$dflt"
17587 ????|????????) echo "(The test program ran ok.)" ;;
17588 *) echo "(The test program didn't run right for some reason.)" ;;
17593 (I can't seem to compile the test program. Guessing big-endian...)
17596 case "$xxx_prompt" in
17598 rp="What is the order of bytes in $uvtype?"
17614 Checking to see whether you can access character data unalignedly...
17616 case "$d_u32align" in
17617 '') $cat >try.c <<EOCP
17619 #$i_stdlib I_STDLIB
17621 #include <stdlib.h>
17623 #define U32 $u32type
17624 #define BYTEORDER 0x$byteorder
17626 #include <signal.h>
17628 $signal_t bletch(s) int s; { exit(4); }
17631 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17636 if (sizeof(U32) != 4) {
17637 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17644 signal(SIGBUS, bletch);
17656 for (i = 0; i < 4; i++) {
17657 up = (U32*)(buf + i);
17658 if (! ((*up == 1 << (8*i)) || /* big-endian */
17659 (*up == 1 << (8*(3-i))) /* little-endian */
17663 printf("read failed (%x)\n", *up);
17669 for (i = 0; i < 4; i++) {
17670 up = (U32*)(buf + i);
17672 if (*up != 0xBeef) {
17673 printf("write failed (%x)\n", *up);
17687 if eval $compile_ok; then
17688 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17689 $run ./try 2>&1 >/dev/null
17692 You can access character data pretty unalignedly.
17694 d_u32align="$undef"
17697 It seems that you must access character data in an aligned manner.
17699 d_u32align="$define"
17703 rp='Can you access character data at unaligned addresses?'
17707 [yY]*) d_u32align="$undef" ;;
17708 *) d_u32align="$define" ;;
17711 $rm -f core core.try.* try.core
17715 : see if ualarm exists
17716 set ualarm d_ualarm
17719 : see if umask exists
17723 : see if unordered exists
17724 set unordered d_unordered
17727 : see if unsetenv exists
17728 set unsetenv d_unsetenv
17731 : see if usleep exists
17732 set usleep d_usleep
17735 : see if prototype for usleep is available
17737 set d_usleepproto usleep $i_unistd unistd.h
17740 : see if ustat exists
17744 : backward compatibility for d_hvfork
17745 if test X$d_hvfork != X; then
17746 d_vfork="$d_hvfork"
17749 : see if there is a vfork
17754 : Ok, but do we want to use it. vfork is reportedly unreliable in
17755 : perl on Solaris 2.x, and probably elsewhere.
17759 case "$usevfork" in
17765 Perl can only use a vfork() that doesn't suffer from strict
17766 restrictions on calling functions or modifying global data in
17767 the child. For example, glibc-2.1 contains such a vfork()
17768 that is unsuitable. If your system provides a proper fork()
17769 call, chances are that you do NOT want perl to use vfork().
17772 rp="Do you still want to use vfork()?"
17777 echo "Ok, we won't use vfork()."
17786 $define) usevfork='true';;
17787 *) usevfork='false';;
17790 : see if closedir exists
17791 set closedir d_closedir
17794 case "$d_closedir" in
17797 echo "Checking whether closedir() returns a status..." >&4
17799 #$i_dirent I_DIRENT /**/
17800 #$i_sysdir I_SYS_DIR /**/
17801 #$i_sysndir I_SYS_NDIR /**/
17802 #$i_systypes I_SYS_TYPES /**/
17804 #if defined(I_SYS_TYPES)
17805 #include <sys/types.h>
17807 #if defined(I_DIRENT)
17808 #include <dirent.h>
17809 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17810 #include <sys/dir.h>
17814 #include <sys/ndir.h>
17818 #include <ndir.h> /* may be wrong in the future */
17820 #include <sys/dir.h>
17825 int main() { return closedir(opendir(".")); }
17828 if eval $compile_ok; then
17829 if $run ./try > /dev/null 2>&1 ; then
17830 echo "Yes, it does."
17833 echo "No, it doesn't."
17837 echo "(I can't seem to compile the test program--assuming it doesn't)"
17845 set d_void_closedir
17848 : see if there is a wait4
17852 : see if waitpid exists
17853 set waitpid d_waitpid
17856 : see if wcstombs exists
17857 set wcstombs d_wcstombs
17860 : see if wctomb exists
17861 set wctomb d_wctomb
17864 : see if writev exists
17865 set writev d_writev
17868 : preserve RCS keywords in files with variable substitution, grrr
17873 Revision='$Revision'
17875 : check for alignment requirements
17877 case "$usecrosscompile$multiarch" in
17880 You seem to be either cross-compiling or doing a multiarchitecture build,
17881 skipping the memory alignment check.
17884 case "$alignbytes" in
17885 '') alignbytes=8 ;;
17889 case "$alignbytes" in
17890 '') echo "Checking alignment constraints..." >&4
17891 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17892 $cat >try.c <<'EOCP'
17893 typedef long double NV;
17896 $cat >try.c <<'EOCP'
17900 $cat >>try.c <<'EOCP'
17908 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17913 if eval $compile_ok; then
17917 echo "(I can't seem to compile the test program...)"
17920 *) dflt="$alignbytes"
17923 rp="Doubles must be aligned on a how-many-byte boundary?"
17931 : set the base revision
17934 : how do we concatenate cpp tokens here?
17936 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17937 $cat >cpp_stuff.c <<'EOCP'
17938 #define RCAT(a,b)a/**/b
17939 #define ACAT(a,b)a ## b
17943 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17944 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17945 echo "Oh! Smells like ANSI's been here." >&4
17946 echo "We can catify or stringify, separately or together!"
17948 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17949 echo "Ah, yes! The good old days!" >&4
17950 echo "However, in the good old days we don't know how to stringify and"
17951 echo "catify at the same time."
17955 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17956 You're going to have to edit the values of CAT[2-5] in config.h...
17958 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17962 : see if this is a db.h system
17968 : Check db version.
17970 echo "Checking Berkeley DB version ..." >&4
17976 #include <sys/types.h>
17978 #$i_stdlib I_STDLIB
17980 #include <stdlib.h>
17983 int main(int argc, char *argv[])
17985 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17986 int Major, Minor, Patch ;
17987 unsigned long Version ;
17988 (void)db_version(&Major, &Minor, &Patch) ;
17990 printf("%d %d %d %d %d %d\n",
17991 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17992 Major, Minor, Patch);
17995 printf("You have Berkeley DB Version 2 or greater.\n");
17997 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17998 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17999 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18000 Major, Minor, Patch) ;
18002 /* check that db.h & libdb are compatible */
18003 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18004 printf("db.h and libdb are incompatible.\n") ;
18008 printf("db.h and libdb are compatible.\n") ;
18010 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18011 + DB_VERSION_PATCH ;
18013 /* needs to be >= 2.3.4 */
18014 if (Version < 2003004) {
18015 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18016 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18022 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18027 printf("You have Berkeley DB Version 1.\n");
18028 exit(0); /* DB version < 2: the coast is clear. */
18030 exit(1); /* <db.h> not Berkeley DB? */
18036 if eval $compile_ok && $run ./try; then
18037 echo 'Looks OK.' >&4
18039 db_version_major=$1
18040 db_version_minor=$2
18041 db_version_patch=$3
18043 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18047 : Remove db from list of libraries to use
18048 echo "Removing unusable -ldb from library list" >&4
18049 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18052 echo "libs = $libs" >&4
18062 : Check the return type needed for hash
18064 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18070 #include <sys/types.h>
18073 #ifndef DB_VERSION_MAJOR
18074 u_int32_t hash_cb (ptr, size)
18082 info.hash = hash_cb;
18086 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18087 if $contains warning try.out >>/dev/null 2>&1 ; then
18090 db_hashtype='u_int32_t'
18093 : XXX Maybe we should just give up here.
18094 db_hashtype=u_int32_t
18096 echo "Help: I can't seem to compile the db test program." >&4
18097 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18100 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18102 *) db_hashtype=u_int32_t
18107 : Check the return type needed for prefix
18109 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18115 #include <sys/types.h>
18118 #ifndef DB_VERSION_MAJOR
18119 size_t prefix_cb (key1, key2)
18127 info.prefix = prefix_cb;
18131 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18132 if $contains warning try.out >>/dev/null 2>&1 ; then
18133 db_prefixtype='int'
18135 db_prefixtype='size_t'
18138 db_prefixtype='size_t'
18139 : XXX Maybe we should just give up here.
18141 echo "Help: I can't seem to compile the db test program." >&4
18142 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18145 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18147 *) db_prefixtype='size_t'
18152 : How can we generate normalized random numbers ?
18154 echo "Looking for a random number function..." >&4
18155 case "$randfunc" in
18157 if set drand48 val -f; eval $csym; $val; then
18159 echo "Good, found drand48()." >&4
18160 elif set random val -f; eval $csym; $val; then
18162 echo "OK, found random()." >&4
18165 echo "Yick, looks like I have to use rand()." >&4
18176 *-Dmy_rand=*|*-Dmy_srand=*)
18177 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18178 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18179 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18180 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18184 while $test "$cont"; do
18185 rp="Use which function to generate random numbers?"
18187 if $test "$ans" = "$dflt"; then
18193 if set $ans val -f; eval $csym; $val; then
18197 rp="I cannot find function $ans. Use that name anyway?"
18206 case "$randfunc" in
18208 drand01="drand48()"
18214 case "$randbits" in
18216 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18218 #$i_unistd I_UNISTD
18219 #$i_stdlib I_STDLIB
18222 # include <unistd.h>
18225 # include <stdlib.h>
18230 register unsigned long tmp;
18231 register unsigned long max = 0L;
18233 for (i = 1000; i; i--) {
18234 tmp = (unsigned long) $randfunc();
18235 if (tmp > max) max = tmp;
18237 for (i = 0; max; i++)
18243 if eval $compile_ok; then
18247 echo "(I can't seem to compile the test program...)"
18254 rp="How many bits does your $randfunc() function produce?"
18258 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18259 seedfunc="s$randfunc"
18260 randseedtype=unsigned
18264 rp="How many bits does your $randfunc() function produce?"
18267 seedfunc="s$randfunc"
18268 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18269 if set $seedfunc val -f; eval $csym; $val; then
18270 echo "(Using $seedfunc() to seed random generator)"
18272 echo "(Warning: no $seedfunc() to seed random generator)"
18275 randseedtype=unsigned
18283 echo "Determining whether or not we are on an EBCDIC system..." >&4
18284 $cat >try.c <<'EOM'
18287 if ('M'==0xd4) return 0;
18294 if eval $compile_ok; then
18295 if $run ./try; then
18296 echo "You seem to speak EBCDIC." >&4
18299 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18302 echo "I'm unable to compile the test program." >&4
18303 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18311 Checking how to flush all pending stdio output...
18313 # I only know how to find the first 32 possibly open files on SunOS.
18314 # See also hints/sunos_4_1.sh and util.c --AD
18316 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18318 $cat >>try.c <<EOCP
18320 #$i_stdlib I_STDLIB
18322 #include <stdlib.h>
18324 #$i_unistd I_UNISTD
18326 # include <unistd.h>
18328 #$d_sysconf HAS_SYSCONF
18329 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18330 #ifdef HAS_STDIO_STREAM_ARRAY
18331 # define STDIO_STREAM_ARRAY $stdio_stream_array
18336 p = fopen("try.out", "w");
18340 # ifdef TRY_FPRINTF
18344 #ifdef TRY_FFLUSH_NULL
18347 #ifdef TRY_FFLUSH_ALL
18349 long open_max = -1;
18350 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18351 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18353 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18354 open_max = sysconf(_SC_OPEN_MAX);
18357 open_max = FOPEN_MAX;
18360 open_max = OPEN_MAX;
18369 # ifdef HAS_STDIO_STREAM_ARRAY
18370 if (open_max > 0) {
18372 for (i = 0; i < open_max; i++)
18373 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18374 STDIO_STREAM_ARRAY[i]._file < open_max &&
18375 STDIO_STREAM_ARRAY[i]._flag)
18376 fflush(&STDIO_STREAM_ARRAY[i]);
18384 : first we have to find out how _not_ to flush
18386 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18388 set try -DTRY_FPUTC
18389 if eval $compile; then
18390 $run ./try 2>/dev/null
18393 if $test ! -s try.out -a "X$code" = X42; then
18399 set try -DTRY_FPRINTF
18400 if eval $compile; then
18401 $run ./try 2>/dev/null
18404 if $test ! -s try.out -a "X$code" = X42; then
18405 output=-DTRY_FPRINTF
18411 : check for fflush NULL behaviour
18412 case "$fflushNULL" in
18413 '') set try -DTRY_FFLUSH_NULL $output
18414 if eval $compile; then
18415 $run ./try 2>/dev/null
18418 if $test -s try.out -a "X$code" = X42; then
18419 fflushNULL="`$cat try.out`"
18421 if $test "X$code" != X42; then
18423 (If this test failed, don't worry, we'll try another method shortly.)
18428 $rm -f core try.core core.try.*
18429 case "$fflushNULL" in
18431 Your fflush(NULL) works okay for output streams.
18432 Let's see if it clobbers input pipes...
18434 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18435 # bug that improperly flushes the input end of pipes. So we avoid the
18436 # autoflush on fork/system/exec support for now. :-(
18437 $cat >tryp.c <<EOCP
18440 main(int argc, char **argv)
18446 while ((i = getc(stdin)) != -1
18447 && (*bp++ = i) != '\n'
18448 && bp < &buf[1024])
18451 fprintf(stdout, "%s", buf);
18459 fflushNULL="$define"
18461 if eval $compile; then
18463 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18464 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18466 fflush(NULL) seems to behave okay with input streams.
18468 fflushNULL="$define"
18471 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18473 fflushNULL="$undef"
18476 $rm -f core tryp.c tryp.core core.tryp.*
18479 Your fflush(NULL) isn't working (contrary to ANSI C).
18481 fflushNULL="$undef"
18484 Cannot figure out whether your fflush(NULL) works or not.
18485 I'm assuming it doesn't (contrary to ANSI C).
18487 fflushNULL="$undef"
18491 $define|true|[yY]*)
18492 fflushNULL="$define"
18495 fflushNULL="$undef"
18498 : check explicit looping only if NULL did not work, and if the pipe
18499 : bug does not show up on an explicit flush too
18500 case "$fflushNULL" in
18502 $cat >tryp.c <<EOCP
18505 main(int argc, char **argv)
18511 while ((i = getc(stdin)) != -1
18512 && (*bp++ = i) != '\n'
18513 && bp < &buf[1024])
18516 fprintf(stdout, "%s", buf);
18525 if eval $compile; then
18527 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18528 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18530 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18532 : now check for fflushall behaviour
18533 case "$fflushall" in
18534 '') set try -DTRY_FFLUSH_ALL $output
18535 if eval $compile; then
18537 (Now testing the other method--but note that this also may fail.)
18539 $run ./try 2>/dev/null
18542 if $test -s try.out -a "X$code" = X42; then
18543 fflushall="`$cat try.out`"
18546 $rm -f core try.core core.try.*
18547 case "$fflushall" in
18549 Whew. Flushing explicitly all the stdio streams works.
18551 fflushall="$define"
18554 Sigh. Flushing explicitly all the stdio streams doesn't work.
18559 Cannot figure out whether flushing stdio streams explicitly works or not.
18560 I'm assuming it doesn't.
18566 "$define"|true|[yY]*)
18567 fflushall="$define"
18575 All is futile. Even fflush(stdin) clobbers input pipes!
18582 $rm -f core tryp.c tryp.core core.tryp.*
18584 *) fflushall="$undef"
18588 case "$fflushNULL$fflushall" in
18591 OK, I give up. I cannot figure out how to flush pending stdio output.
18592 We won't be flushing handles at all before fork/exec/popen.
18596 $rm -f try.* try$exe_ext
18598 : Store the full pathname to the ar program for use in the C program
18599 : Respect a hint or command line value for full_ar.
18604 : Store the full pathname to the sed program for use in the C program
18607 : see what type gids are declared as in the kernel
18609 echo "Looking for the type for group ids returned by getgid()."
18610 set gid_t gidtype xxx stdio.h sys/types.h
18614 xxx=`./findhdr sys/user.h`
18615 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18617 unsigned) dflt="$1 $2" ;;
18621 *) dflt="$gidtype";;
18624 gid_t) echo "gid_t found." ;;
18625 *) rp="What is the type for group ids returned by getgid()?"
18633 *_t) zzz="$gidtype" ;;
18636 echo "Checking the size of $zzz..." >&4
18638 #include <sys/types.h>
18640 #$i_stdlib I_STDLIB
18642 #include <stdlib.h>
18645 printf("%d\n", (int)sizeof($gidtype));
18650 if eval $compile_ok; then
18654 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18657 echo "Your $zzz is $gidsize bytes long."
18662 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18668 *_t) zzz="$gidtype" ;;
18671 echo "Checking the sign of $zzz..." >&4
18673 #include <sys/types.h>
18684 if eval $compile; then
18688 echo "(I can't execute the test program--guessing unsigned.)" >&4
18692 1) echo "Your $zzz is unsigned." ;;
18693 -1) echo "Your $zzz is signed." ;;
18699 echo "(I can't compile the test program--guessing unsigned.)" >&4
18705 if $test X"$quadtype" != X; then
18707 echo "Checking how to print 64-bit integers..." >&4
18709 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18710 $cat >try.c <<'EOCP'
18711 #include <sys/types.h>
18714 int q = 12345678901;
18715 printf("%ld\n", q);
18719 if eval $compile; then
18723 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18724 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18725 echo "We will use %d."
18731 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18732 $cat >try.c <<'EOCP'
18733 #include <sys/types.h>
18736 long q = 12345678901;
18737 printf("%ld\n", q);
18741 if eval $compile; then
18745 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18746 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18747 echo "We will use %ld."
18753 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18754 $cat >try.c <<'EOCP'
18755 #include <sys/types.h>
18756 #include <inttypes.h>
18759 int64_t q = 12345678901;
18760 printf("%" PRId64 "\n", q);
18764 if eval $compile; then
18768 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18769 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18770 echo "We will use the C9X style."
18776 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18778 #include <sys/types.h>
18781 $quadtype q = 12345678901;
18782 printf("%Ld\n", q);
18786 if eval $compile; then
18790 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18791 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18792 echo "We will use %Ld."
18798 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18799 $cat >try.c <<'EOCP'
18800 #include <sys/types.h>
18803 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18804 printf("%lld\n", q);
18808 if eval $compile; then
18812 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18813 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18814 echo "We will use the %lld style."
18820 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18822 #include <sys/types.h>
18825 $quadtype q = 12345678901;
18826 printf("%qd\n", q);
18830 if eval $compile; then
18834 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18835 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18836 echo "We will use %qd."
18842 if $test X"$sPRId64" = X; then
18843 echo "Cannot figure out how to print 64-bit integers." >&4
18851 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18852 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18854 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18855 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18861 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18863 if $test X"$ivsize" = X8; then
18864 ivdformat="$sPRId64"
18865 uvuformat="$sPRIu64"
18866 uvoformat="$sPRIo64"
18867 uvxformat="$sPRIx64"
18868 uvXUformat="$sPRIXU64"
18870 if $test X"$ivsize" = X"$longsize"; then
18877 if $test X"$ivsize" = X"$intsize"; then
18885 if $test X"$ivsize" = X"$shortsize"; then
18896 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18897 nveformat="$sPRIeldbl"
18898 nvfformat="$sPRIfldbl"
18899 nvgformat="$sPRIgldbl"
18900 nvEUformat="$sPRIEUldbl"
18901 nvFUformat="$sPRIFUldbl"
18902 nvGUformat="$sPRIGUldbl"
18912 case "$ivdformat" in
18913 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18920 $echo "Checking the format string to be used for gids..." >&4
18923 -1) if $test X"$gidsize" = X"$ivsize"; then
18924 gidformat="$ivdformat"
18926 if $test X"$gidsize" = X"$longsize"; then
18929 if $test X"$gidsize" = X"$intsize"; then
18932 if $test X"$gidsize" = X"$shortsize"; then
18939 *) if $test X"$gidsize" = X"$uvsize"; then
18940 gidformat="$uvuformat"
18942 if $test X"$gidsize" = X"$longsize"; then
18945 if $test X"$gidsize" = X"$intsize"; then
18948 if $test X"$gidsize" = X"$shortsize"; then
18957 : see if getgroups exists
18958 set getgroups d_getgrps
18961 : see if setgroups exists
18962 set setgroups d_setgrps
18966 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18968 case "$d_getgrps$d_setgrps" in
18970 case "$groupstype" in
18971 '') dflt="$gidtype" ;;
18972 *) dflt="$groupstype" ;;
18975 What type of pointer is the second argument to getgroups() and setgroups()?
18976 Usually this is the same as group ids, $gidtype, but not always.
18979 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18983 *) groupstype="$gidtype";;
18987 echo "Checking if your $make program sets \$(MAKE)..." >&4
18988 case "$make_set_make" in
18990 $sed 's/^X //' > testmake.mak << 'EOF'
18992 X @echo 'maketemp="$(MAKE)"'
18994 case "`$make -f testmake.mak 2>/dev/null`" in
18995 *maketemp=*) make_set_make='#' ;;
18996 *) make_set_make="MAKE=$make" ;;
18998 $rm -f testmake.mak
19001 case "$make_set_make" in
19002 '#') echo "Yup, it does.";;
19003 *) echo "Nope, it doesn't.";;
19006 : see what type is used for mode_t
19007 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19008 set mode_t modetype int stdio.h sys/types.h
19011 : see if stdarg is available
19013 if $test `./findhdr stdarg.h`; then
19014 echo "<stdarg.h> found." >&4
19017 echo "<stdarg.h> NOT found." >&4
19021 : see if varags is available
19023 if $test `./findhdr varargs.h`; then
19024 echo "<varargs.h> found." >&4
19026 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
19029 : set up the varargs testing programs
19030 $cat > varargs.c <<EOP
19032 #include <stdarg.h>
19035 #include <varargs.h>
19039 int f(char *p, ...)
19053 p = va_arg(ap, char *);
19058 $cat > varargs <<EOP
19060 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
19069 : now check which varargs header should be included
19074 if `./varargs I_STDARG`; then
19076 elif `./varargs I_VARARGS`; then
19081 if `./varargs I_VARARGS`; then
19088 echo "I could not find the definition for va_dcl... You have problems..." >&4
19089 val="$undef"; set i_stdarg; eval $setvar
19090 val="$undef"; set i_varargs; eval $setvar
19095 case "$i_varhdr" in
19097 val="$define"; set i_stdarg; eval $setvar
19098 val="$undef"; set i_varargs; eval $setvar
19101 val="$undef"; set i_stdarg; eval $setvar
19102 val="$define"; set i_varargs; eval $setvar
19105 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
19109 : see if we need va_copy
19111 case "$i_stdarg" in
19114 #include <stdarg.h>
19116 #$i_stdlib I_STDLIB
19118 #include <stdlib.h>
19120 #include <signal.h>
19123 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19125 return vfprintf(f, fmt, *valp);
19129 myvfprintf(FILE *f, const char *fmt, va_list val)
19131 return ivfprintf(f, fmt, &val);
19135 myprintf(char *fmt, ...)
19138 va_start(val, fmt);
19139 return myvfprintf(stdout, fmt, val);
19143 main(int ac, char **av)
19145 signal(SIGSEGV, exit);
19147 myprintf("%s%cs all right, then\n", "that", '\'');
19152 if eval $compile && $run ./try 2>&1 >/dev/null; then
19153 case "`$run ./try`" in
19154 "that's all right, then")
19160 yes) echo "It seems that you don't need va_copy()." >&4
19161 need_va_copy="$undef"
19163 *) echo "It seems that va_copy() or similar will be needed." >&4
19164 need_va_copy="$define"
19167 $rm -f try.* core core.* *.core *.core.*
19169 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19173 : see what type is used for size_t
19174 rp="What is the type used for the length parameter for string functions?"
19175 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19178 : check for type of arguments to gethostbyaddr.
19179 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19180 case "$d_gethbyaddr" in
19184 Checking to see what type of arguments are accepted by gethostbyaddr().
19186 hdrs="$define sys/types.h
19187 $d_socket sys/socket.h
19188 $i_niin netinet/in.h
19190 $i_unistd unistd.h"
19191 : The first arg can 'char *' or 'void *'
19192 : The second arg is some of integral type
19193 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19194 for yyy in size_t long int; do
19195 case "$netdb_host_type" in
19196 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19197 if ./protochk "$try" $hdrs; then
19198 echo "Your system accepts $xxx for the first arg."
19199 echo "...and $yyy for the second arg."
19200 netdb_host_type="$xxx"
19201 netdb_hlen_type="$yyy"
19207 : In case none of those worked, prompt the user.
19208 case "$netdb_host_type" in
19209 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19212 netdb_host_type=$ans
19213 rp='What is the type for the 2nd argument to gethostbyaddr?'
19216 netdb_hlen_type=$ans
19220 *) : no gethostbyaddr, so pick harmless defaults
19221 netdb_host_type='char *'
19222 netdb_hlen_type="$sizetype"
19225 # Remove the "const" if needed. -- but then we'll have a
19227 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19230 : check for type of argument to gethostbyname.
19231 if test "X$netdb_name_type" = X ; then
19232 case "$d_gethbyname" in
19236 Checking to see what type of argument is accepted by gethostbyname().
19238 hdrs="$define sys/types.h
19239 $d_socket sys/socket.h
19240 $i_niin netinet/in.h
19242 $i_unistd unistd.h"
19243 for xxx in "const char *" "char *"; do
19244 case "$netdb_name_type" in
19245 '') try="extern struct hostent *gethostbyname($xxx);"
19246 if ./protochk "$try" $hdrs; then
19247 echo "Your system accepts $xxx."
19248 netdb_name_type="$xxx"
19253 : In case none of those worked, prompt the user.
19254 case "$netdb_name_type" in
19255 '') rp='What is the type for the 1st argument to gethostbyname?'
19258 netdb_name_type=$ans
19262 *) : no gethostbyname, so pick harmless default
19263 netdb_name_type='char *'
19268 : check for type of 1st argument to getnetbyaddr.
19269 if test "X$netdb_net_type" = X ; then
19270 case "$d_getnbyaddr" in
19274 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19276 hdrs="$define sys/types.h
19277 $d_socket sys/socket.h
19278 $i_niin netinet/in.h
19280 $i_unistd unistd.h"
19281 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19282 case "$netdb_net_type" in
19283 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19284 if ./protochk "$try" $hdrs; then
19285 echo "Your system accepts $xxx."
19286 netdb_net_type="$xxx"
19291 : In case none of those worked, prompt the user.
19292 case "$netdb_net_type" in
19293 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19296 netdb_net_type=$ans
19300 *) : no getnetbyaddr, so pick harmless default
19301 netdb_net_type='long'
19305 : locate the preferred pager for this system
19312 [a-zA-Z]:/*) dflt=$pg;;
19316 [a-zA-Z]:/*) dflt=$more;;
19320 [a-zA-Z]:/*) dflt=$less;;
19323 '') dflt=/usr/ucb/more;;
19327 : Instruct ./getfile to trust the hinted or previous pager value,
19328 : even if it does not begin with a slash. For example, on os2,
19329 : pager might be cmd /c more. See comments in UU/getfile.
19334 rp='What pager is used on your system?'
19338 : see what type pids are declared as in the kernel
19339 rp="What is the type of process ids on this system?"
19340 set pid_t pidtype int stdio.h sys/types.h
19343 : see if ar generates random libraries by itself
19345 echo "Checking how to generate random libraries on your machine..." >&4
19346 echo 'int bar1() { return bar2(); }' > bar1.c
19347 echo 'int bar2() { return 2; }' > bar2.c
19349 #$i_stdlib I_STDLIB
19351 #include <stdlib.h>
19353 int main() { printf("%d\n", bar1()); exit(0); }
19355 $cc $ccflags -c bar1.c >/dev/null 2>&1
19356 $cc $ccflags -c bar2.c >/dev/null 2>&1
19357 $cc $ccflags -c foo.c >/dev/null 2>&1
19358 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19359 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19360 $run ./foobar >/dev/null 2>&1; then
19361 echo "$ar appears to generate random libraries itself."
19363 if [ "X$ranlib" = "X" ]; then
19366 elif $ar s bar$_a >/dev/null 2>&1 &&
19367 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19368 $run ./foobar >/dev/null 2>&1; then
19369 echo "a table of contents needs to be added with '$ar s'."
19372 elif $ar ts bar$_a >/dev/null 2>&1 &&
19373 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19374 $run ./foobar >/dev/null 2>&1; then
19375 echo "a table of contents needs to be added with '$ar ts'."
19382 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19383 $test -f $ranlib || ranlib=''
19386 if $test -n "$ranlib"; then
19387 echo "your system has '$ranlib'; we'll use that."
19390 echo "your system doesn't seem to support random libraries"
19391 echo "so we'll use lorder and tsort to order the libraries."
19398 : check for type of arguments to select.
19399 case "$selecttype" in
19400 '') case "$d_select" in
19404 Checking to see what type of arguments are accepted by select().
19406 hdrs="$define sys/types.h
19407 $i_systime sys/time.h
19408 $i_sysselct sys/select.h
19409 $d_socket sys/socket.h"
19410 : The first arg can be int, unsigned, or size_t
19411 : The last arg may or may not be 'const'
19413 : void pointer has been seen but using that
19414 : breaks the selectminbits test
19415 for xxx in 'fd_set *' 'int *'; do
19416 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19417 for tmo in 'struct timeval *' 'const struct timeval *'; do
19419 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19420 if ./protochk "$try" $hdrs; then
19421 echo "Your system accepts $xxx."
19430 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19431 case "$d_fd_set" in
19432 $define) dflt="fd_set *" ;;
19441 *) : no select, so pick a harmless default
19448 : check for the select 'width'
19449 case "$selectminbits" in
19450 '') safebits=`expr $ptrsize \* 8`
19451 case "$d_select" in
19455 Checking to see on how many bits at a time your select() operates...
19458 #include <sys/types.h>
19460 #$i_systime I_SYS_TIME
19461 #$i_systimek I_SYS_TIME_KERNEL
19466 # ifdef I_SYS_TIME_KERNEL
19469 # include <sys/time.h>
19470 # ifdef I_SYS_TIME_KERNEL
19474 #$i_sysselct I_SYS_SELECT
19475 #ifdef I_SYS_SELECT
19476 #include <sys/select.h>
19478 #$d_socket HAS_SOCKET
19480 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19483 #$i_stdlib I_STDLIB
19485 #include <stdlib.h>
19488 #define S sizeof(*(b))
19490 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19491 #define NBITS (NBYTES * 8)
19493 char *s = malloc(NBYTES);
19502 fp = fopen("try.c", "r");
19508 b = ($selecttype)s;
19509 for (i = 0; i < NBITS; i++)
19513 select(fd + 1, b, 0, 0, &t);
19514 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19516 printf("%d\n", i + 1);
19521 if eval $compile_ok; then
19522 selectminbits=`$run ./try`
19523 case "$selectminbits" in
19525 Cannot figure out on how many bits at a time your select() operates.
19526 I'll play safe and guess it is $safebits bits.
19528 selectminbits=$safebits
19529 bits="$safebits bits"
19532 *) bits="$selectminbits bits" ;;
19534 echo "Your select() operates on $bits at a time." >&4
19536 rp='What is the minimum number of bits your select() operates on?'
19537 case "$byteorder" in
19538 12345678) dflt=64 ;;
19544 selectminbits="$val"
19548 *) : no select, so pick a harmless default
19549 selectminbits=$safebits
19555 : Trace out the files included by signal.h, then look for SIGxxx names.
19556 : Remove SIGARRAYSIZE used by HPUX.
19557 : Remove SIGSTKSIZE used by Linux.
19558 : Remove SIGSTKSZ used by Posix.
19559 : Remove SIGTYP void lines used by OS2.
19560 : Some cpps, like os390, dont give the file name anywhere
19561 if [ "X$fieldn" = X ]; then
19562 : Just make some guesses. We check them later.
19563 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19565 xxx=`echo '#include <signal.h>' |
19566 $cppstdin $cppminus $cppflags 2>/dev/null |
19567 $grep '^[ ]*#.*include' |
19568 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19570 : Check this list of files to be sure we have parsed the cpp output ok.
19571 : This will also avoid potentially non-existent files, such
19574 for xx in $xxx /dev/null ; do
19575 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19577 : If we have found no files, at least try signal.h
19578 case "$xxxfiles" in
19579 '') xxxfiles=`./findhdr signal.h` ;;
19582 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19583 print substr($2, 4, 20)
19585 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19586 print substr($3, 4, 20)
19588 : Append some common names just in case the awk scan failed.
19589 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19590 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19591 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19592 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19593 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19595 : generate a few handy files for later
19596 $cat > signal.c <<EOCP
19597 #include <sys/types.h>
19598 #include <signal.h>
19599 #$i_stdlib I_STDLIB
19601 #include <stdlib.h>
19606 /* Strange style to avoid deeply-nested #if/#else/#endif */
19609 # define NSIG (_NSIG)
19615 # define NSIG (SIGMAX+1)
19621 # define NSIG (SIG_MAX+1)
19627 # define NSIG (_SIG_MAX+1)
19633 # define NSIG (MAXSIG+1)
19639 # define NSIG (MAX_SIG+1)
19644 # ifdef SIGARRAYSIZE
19645 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19651 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19655 /* Default to some arbitrary number that's big enough to get most
19656 of the common signals.
19662 printf("NSIG %d\n", NSIG);
19668 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19670 printf "#ifdef SIG"; printf $1; printf "\n"
19671 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19672 printf $1; printf ");\n"
19676 printf "#endif /* JUST_NSIG */\n";
19677 printf "exit(0);\n}\n";
19680 $cat >signal.awk <<'EOP'
19681 BEGIN { ndups = 0 }
19682 $1 ~ /^NSIG$/ { nsig = $2 }
19683 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19684 if ($2 > maxsig) { maxsig = $2 }
19685 if (sig_name[$2]) {
19686 dup_name[ndups] = $1
19687 dup_num[ndups] = $2
19699 printf("NSIG %d\n", nsig);
19700 for (n = 1; n < nsig; n++) {
19702 printf("%s %d\n", sig_name[n], sig_num[n])
19705 printf("NUM%d %d\n", n, n)
19708 for (n = 0; n < ndups; n++) {
19709 printf("%s %d\n", dup_name[n], dup_num[n])
19713 $cat >signal_cmd <<EOS
19715 if $test -s signal.lst; then
19716 echo "Using your existing signal.lst file"
19721 $cat >>signal_cmd <<'EOS'
19724 if eval $compile_ok; then
19725 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19727 echo "(I can't seem be able to compile the whole test program)" >&4
19728 echo "(I'll try it in little pieces.)" >&4
19729 set signal -DJUST_NSIG
19730 if eval $compile_ok; then
19731 $run ./signal$_exe > signal.nsg
19734 echo "I can't seem to figure out how many signals you have." >&4
19735 echo "Guessing 50." >&4
19736 echo 'NSIG 50' > signal.nsg
19738 : Now look at all the signal names, one at a time.
19739 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19740 $cat > signal.c <<EOCP
19741 #include <sys/types.h>
19742 #include <signal.h>
19745 printf("$xx %d\n", SIG${xx});
19750 if eval $compile; then
19751 echo "SIG${xx} found."
19752 $run ./signal$_exe >> signal.ls1
19754 echo "SIG${xx} NOT found."
19757 if $test -s signal.ls1; then
19758 $cat signal.nsg signal.ls1 |
19759 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19763 if $test -s signal.lst; then
19766 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19767 echo 'kill -l' >signal
19768 set X `csh -f <signal`
19772 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19774 echo $@ | $tr ' ' $trnl | \
19775 $awk '{ printf "%s %d\n", $1, ++s; }
19776 END { printf "NSIG %d\n", ++s }' >signal.lst
19778 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19780 chmod a+x signal_cmd
19781 $eunicefix signal_cmd
19783 : generate list of signal names
19785 case "$sig_name_init" in
19787 *) case "$sig_num_init" in
19788 ''|*,*) doinit=yes ;;
19793 echo "Generating a list of signal names and numbers..." >&4
19795 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19796 sig_name=`$awk 'BEGIN { printf "ZERO " }
19797 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19798 sig_num=`$awk 'BEGIN { printf "0 " }
19799 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19800 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19801 !/^NSIG/ { printf "\"%s\", ", $1 }
19802 END { printf "0\n" }' signal.lst`
19803 sig_num_init=`$awk 'BEGIN { printf "0, " }
19804 !/^NSIG/ { printf "%d, ", $2}
19805 END { printf "0\n"}' signal.lst`
19808 echo "The following $sig_count signals are available:"
19810 echo $sig_name | $awk \
19811 'BEGIN { linelen = 0 }
19813 for (i = 1; i <= NF; i++) {
19814 name = "SIG" $i " "
19815 linelen = linelen + length(name)
19816 if (linelen > 70) {
19818 linelen = length(name)
19824 sig_size=`echo $sig_name | awk '{print NF}'`
19825 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19828 case "$sizetype" in
19829 *_t) zzz="$sizetype" ;;
19830 *) zzz="filesize" ;;
19832 echo "Checking the size of $zzz..." >&4
19834 #include <sys/types.h>
19836 #$i_stdlib I_STDLIB
19838 #include <stdlib.h>
19841 printf("%d\n", (int)sizeof($sizetype));
19846 if eval $compile_ok; then
19850 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19853 echo "Your $zzz size is $sizesize bytes."
19858 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19862 : check for socklen_t
19864 echo "Checking to see if you have socklen_t..." >&4
19866 #include <sys/types.h>
19867 #$d_socket HAS_SOCKET
19869 #include <sys/socket.h>
19871 int main() { socklen_t x = 16; }
19874 if eval $compile; then
19876 echo "You have socklen_t."
19879 echo "You do not have socklen_t."
19880 case "$sizetype" in
19881 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19888 : see if this is a socks.h system
19889 set socks.h i_socks
19892 : check for type of the size argument to socket calls
19893 case "$d_socket" in
19897 Checking to see what type is the last argument of accept().
19900 case "$d_socklen_t" in
19901 "$define") yyy="$yyy socklen_t"
19903 yyy="$yyy $sizetype int long unsigned"
19904 for xxx in $yyy; do
19905 case "$socksizetype" in
19906 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19907 case "$usesocks" in
19909 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19910 echo "Your system accepts '$xxx *' for the last argument of accept()."
19911 socksizetype="$xxx"
19914 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19915 echo "Your system accepts '$xxx *' for the last argument of accept()."
19916 socksizetype="$xxx"
19923 : In case none of those worked, prompt the user.
19924 case "$socksizetype" in
19925 '') rp='What is the type for socket address structure sizes?'
19932 *) : no sockets, so pick relatively harmless default
19937 : see what type is used for signed size_t
19938 set ssize_t ssizetype int stdio.h sys/types.h
19943 #$i_stdlib I_STDLIB
19945 #include <stdlib.h>
19947 #include <sys/types.h>
19948 #define Size_t $sizetype
19949 #define SSize_t $dflt
19952 if (sizeof(Size_t) == sizeof(SSize_t))
19954 else if (sizeof(Size_t) == sizeof(int))
19963 if eval $compile_ok && $run ./try > /dev/null; then
19964 ssizetype=`$run ./try`
19965 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19968 Help! I can't compile and run the ssize_t test program: please enlighten me!
19969 (This is probably a misconfiguration in your system or libraries, and
19970 you really ought to fix it. Still, I'll try anyway.)
19972 I need a type that is the same size as $sizetype, but is guaranteed to
19973 be signed. Common values are ssize_t, int and long.
19976 rp="What signed type is the same size as $sizetype?"
19982 : see what type of char stdio uses.
19984 echo '#include <stdio.h>' > stdio.c
19985 $cppstdin $cppminus < stdio.c > stdioh
19986 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19987 echo "Your stdio uses unsigned chars." >&4
19988 stdchar="unsigned char"
19990 echo "Your stdio uses signed chars." >&4
19993 $rm -f stdio.* stdioh
19995 : see what type uids are declared as in the kernel
19997 echo "Looking for the type for user ids returned by getuid()."
19998 set uid_t uidtype xxx stdio.h sys/types.h
20002 xxx=`./findhdr sys/user.h`
20003 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20005 unsigned) dflt="$1 $2" ;;
20009 *) dflt="$uidtype";;
20012 uid_t) echo "uid_t found." ;;
20013 *) rp="What is the type for user ids returned by getuid()?"
20021 *_t) zzz="$uidtype" ;;
20024 echo "Checking the size of $zzz..." >&4
20026 #include <sys/types.h>
20028 #$i_stdlib I_STDLIB
20030 #include <stdlib.h>
20033 printf("%d\n", (int)sizeof($uidtype));
20038 if eval $compile_ok; then
20042 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20045 echo "Your $zzz is $uidsize bytes long."
20050 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20055 *_t) zzz="$uidtype" ;;
20058 echo "Checking the sign of $zzz..." >&4
20060 #include <sys/types.h>
20071 if eval $compile; then
20075 echo "(I can't execute the test program--guessing unsigned.)" >&4
20079 1) echo "Your $zzz is unsigned." ;;
20080 -1) echo "Your $zzz is signed." ;;
20086 echo "(I can't compile the test program--guessing unsigned.)" >&4
20092 $echo "Checking the format string to be used for uids..." >&4
20095 -1) if $test X"$uidsize" = X"$ivsize"; then
20096 uidformat="$ivdformat"
20098 if $test X"$uidsize" = X"$longsize"; then
20101 if $test X"$uidsize" = X"$intsize"; then
20104 if $test X"$uidsize" = X"$shortsize"; then
20111 *) if $test X"$uidsize" = X"$uvsize"; then
20112 uidformat="$uvuformat"
20114 if $test X"$uidsize" = X"$longsize"; then
20117 if $test X"$uidsize" = X"$intsize"; then
20120 if $test X"$uidsize" = X"$shortsize"; then
20130 case "$usesitecustomize" in
20131 $define|true|[Yy]*)
20132 usesitecustomize="$define"
20135 usesitecustomize="$undef"
20139 : determine compiler compiler
20148 if $test -f "$byacc$_exe"; then
20150 comp="byacc or $comp"
20152 if $test -f "$bison$_exe"; then
20153 comp="$comp or bison -y"
20155 rp="Which compiler compiler ($comp) shall I use?"
20164 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20170 : see if this is a fp.h system
20174 : see if this is a fp_class.h system
20175 set fp_class.h i_fp_class
20178 : see if this is a ieeefp.h system
20179 case "$i_ieeefp" in
20180 '' ) set ieeefp.h i_ieeefp
20185 : see if this is a libutil.h system
20186 set libutil.h i_libutil
20189 : see if mach cthreads are available
20190 if test "X$usethreads" = "X$define"; then
20191 set mach/cthreads.h i_machcthr
20194 i_machcthr="$undef"
20199 : see if this is a mntent.h system
20200 set mntent.h i_mntent
20203 : see if ndbm.h is available
20209 # Some Linux distributions such as RedHat 7.1 put the
20210 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20211 if $test -f /usr/include/gdbm/ndbm.h; then
20212 echo '<gdbm/ndbm.h> found.'
20213 ccflags="$ccflags -I/usr/include/gdbm"
20214 cppflags="$cppflags -I/usr/include/gdbm"
20222 : see if dbm_open exists
20223 set dbm_open d_dbm_open
20225 case "$d_dbm_open" in
20228 echo "We won't be including <ndbm.h>"
20237 : see if net/errno.h is available
20239 set net/errno.h val
20242 : Unfortunately, it causes problems on some systems. Arrgh.
20245 cat > try.c <<'EOM'
20248 #include <net/errno.h>
20254 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20255 echo "We'll be including <net/errno.h>." >&4
20257 echo "We won't be including <net/errno.h>." >&4
20266 : see if netinet/tcp.h is available
20267 set netinet/tcp.h i_netinettcp
20270 : see if this is a poll.h system
20274 : see if this is a prot.h system
20279 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20280 $cat <<'EOSH' > Cppsym.know
20281 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20282 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20283 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20284 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20285 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20286 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20287 bull c cadmus clipper CMU COFF COMPILER_VERSION
20288 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20289 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20290 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20291 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20293 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20294 H3050R H3050RX hbullx20 hcx host_mips
20295 hp200 hp300 hp700 HP700 hp800 hp9000
20296 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20297 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20298 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20299 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20300 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20301 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20302 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20303 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20304 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20305 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20306 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20307 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20308 MATH_HAS_NO_SIDE_EFFECTS
20309 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20310 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20311 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20312 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20313 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20314 NetBSD news1500 news1700 news1800 news1900 news3700
20315 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20316 ns32016 ns32332 ns32k nsc32000
20317 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20318 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20319 pc532 pdp11 PGC PIC plexus PORTAR posix
20320 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20321 POSIX_C_SOURCE POSIX_SOURCE POWER
20322 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20323 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20324 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20325 sony sony_news sonyrisc sparc sparclite spectrum
20326 stardent stdc STDC_EXT stratos sun sun3 sun386
20327 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20328 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20329 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20330 sysV68 sysV88 Tek4132 Tek4300 titan
20331 TM3200 TM5400 TM5600
20332 tower tower32 tower32_200 tower32_600 tower32_700
20333 tower32_800 tower32_850 tss
20334 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20335 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20336 unix UNIX95 UNIX99 unixpc unos
20337 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20338 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20339 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20341 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20342 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20343 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20346 # Maybe put other stuff here too.
20347 cat <<EOSH >>Cppsym.know
20350 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20351 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20352 $cat Cppsym.know > Cppsym.c
20353 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20354 $rm -f Cppsym.a Cppsym.b Cppsym.c
20355 cat <<EOSH > Cppsym
20357 if $test \$# -gt 0; then
20358 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20359 if $test -s Cppsym.got; then
20366 $tr " " "$trnl" | ./Cppsym.try
20372 cat <<EOSH > Cppsym.try
20374 cat <<'EOCP' > try.c
20377 #define STRINGIFY(a) "a"
20379 #if cpp_stuff == 42
20380 #define StGiFy(a) #a
20381 #define STRINGIFY(a) StGiFy(a)
20383 #if $cpp_stuff != 1 && $cpp_stuff != 42
20384 # include "Bletch: How does this C preprocessor stringify macros?"
20390 cat <<'EOSH' >> Cppsym.try
20392 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20393 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20394 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20395 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20397 echo 'return 0;}' >> try.c
20399 cat <<EOSH >> Cppsym.try
20401 case "$osname-$gccversion" in
20402 irix-) ccflags="\$ccflags -woff 1178" ;;
20403 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20405 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20407 chmod +x Cppsym.try
20408 $eunicefix Cppsym.try
20409 ./Cppsym < Cppsym.know > Cppsym.true
20410 : Add in any linux cpp "predefined macros":
20411 case "$osname::$gccversion" in
20414 rm -f $tHdrH'.h' $tHdrH
20416 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20417 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20418 if [ -s $tHdrH'_cppsym.real' ]; then
20419 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20422 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20425 : now check the C compiler for additional symbols
20426 postprocess_cc_v=''
20428 aix) postprocess_cc_v="|$tr , ' '" ;;
20435 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20438 -D*) echo "\$i" | $sed 's/^-D//';;
20439 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20444 postprocess_cc_v=''
20447 ./ccsym > ccsym1.raw
20448 if $test -s ccsym1.raw; then
20449 $sort ccsym1.raw | $uniq >ccsym.raw
20451 mv ccsym1.raw ccsym.raw
20454 $awk '/\=/ { print $0; next }
20455 { print $0"=1" }' ccsym.raw >ccsym.list
20456 $comm -13 Cppsym.true ccsym.list >ccsym.own
20457 $comm -12 Cppsym.true ccsym.list >ccsym.com
20458 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20460 if $test -z ccsym.raw; then
20461 echo "Your C compiler doesn't seem to define any symbols!" >&4
20463 echo "However, your C preprocessor defines the following symbols:"
20466 cppsymbols=`$cat Cppsym.true`
20467 cppsymbols=`echo $cppsymbols`
20468 cppccsymbols="$cppsymbols"
20470 if $test -s ccsym.com; then
20471 echo "Your C compiler and pre-processor define these symbols:"
20472 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20475 cppccsymbols=`$cat ccsym.com`
20476 cppccsymbols=`echo $cppccsymbols`
20477 $test "$silent" || sleep 1
20479 if $test -s ccsym.cpp; then
20480 $test "$also" && echo " "
20481 echo "Your C pre-processor ${also}defines the following symbols:"
20482 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20484 cppsymbols=`$cat ccsym.cpp`
20485 cppsymbols=`echo $cppsymbols`
20486 $test "$silent" || sleep 1
20488 if $test -s ccsym.own; then
20489 $test "$also" && echo " "
20490 echo "Your C compiler ${also}defines the following cpp symbols:"
20491 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20492 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20493 ccsymbols=`$cat ccsym.own`
20494 ccsymbols=`echo $ccsymbols`
20495 $test "$silent" || sleep 1
20499 : see if this is a termio system
20503 if $test `./findhdr termios.h`; then
20504 set tcsetattr i_termios
20510 "$define") echo "You have POSIX termios.h... good!" >&4;;
20511 *) if ./Cppsym pyr; then
20512 case "`/bin/universe`" in
20513 ucb) if $test `./findhdr sgtty.h`; then
20515 echo "<sgtty.h> found." >&4
20517 echo "System is pyramid with BSD universe."
20518 echo "<sgtty.h> not found--you could have problems." >&4
20520 *) if $test `./findhdr termio.h`; then
20522 echo "<termio.h> found." >&4
20524 echo "System is pyramid with USG universe."
20525 echo "<termio.h> not found--you could have problems." >&4
20529 if $test `./findhdr termio.h`; then
20530 echo "<termio.h> found." >&4
20532 elif $test `./findhdr sgtty.h`; then
20533 echo "<sgtty.h> found." >&4
20536 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20539 if $test `./findhdr sgtty.h`; then
20540 echo "<sgtty.h> found." >&4
20542 elif $test `./findhdr termio.h`; then
20543 echo "<termio.h> found." >&4
20546 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20550 set i_termio; eval $setvar
20551 val=$val2; set i_sgtty; eval $setvar
20552 val=$val3; set i_termios; eval $setvar
20554 : see if stddef is available
20555 set stddef.h i_stddef
20558 : see if this is a sunmath.h system
20559 set sunmath.h i_sunmath
20562 : see if sys/access.h is available
20563 set sys/access.h i_sysaccess
20566 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20567 set sys/filio.h i_sysfilio
20570 if $test `./findhdr sys/ioctl.h`; then
20572 echo '<sys/ioctl.h> found.' >&4
20575 if $test $i_sysfilio = "$define"; then
20576 echo '<sys/ioctl.h> NOT found.' >&4
20578 $test $i_sgtty = "$define" && xxx="sgtty.h"
20579 $test $i_termio = "$define" && xxx="termio.h"
20580 $test $i_termios = "$define" && xxx="termios.h"
20581 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20587 : see if socket ioctl defs are in sys/sockio.h
20589 xxx=`./findhdr sys/sockio.h`
20590 if $test "$xxx"; then
20591 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20593 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20596 echo "No socket ioctls found in <sys/sockio.h>." >&4
20601 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20608 : see if this is a syslog.h system
20609 set syslog.h i_syslog
20613 : see if this is a sys/mode.h system
20614 set sys/mode.h i_sysmode
20617 : see if sys/resource.h has to be included
20618 set sys/resource.h i_sysresrc
20621 : see if sys/security.h is available
20622 set sys/security.h i_syssecrt
20625 : see if this is a sys/statvfs.h system
20626 set sys/statvfs.h i_sysstatvfs
20629 : see if this is a sys/un.h system
20630 set sys/un.h i_sysun
20634 : see if this is a sys/utsname.h system
20635 set sys/utsname.h i_sysutsname
20638 : see if this is a syswait system
20639 set sys/wait.h i_syswait
20642 : see if this is a ustat.h system
20643 set ustat.h i_ustat
20646 : see if this is an utime system
20647 set utime.h i_utime
20650 : see if this is a values.h system
20651 set values.h i_values
20654 : see if this is a vfork system
20657 set vfork.h i_vfork
20665 : see if gdbm.h is available
20670 : see if gdbm_open exists
20671 set gdbm_open d_gdbm_open
20673 case "$d_gdbm_open" in
20676 echo "We won't be including <gdbm.h>"
20686 echo "Looking for extensions..." >&4
20687 : If we are using the old config.sh, known_extensions may contain
20688 : old or inaccurate or duplicate values.
20689 known_extensions=''
20690 nonxs_extensions=''
20691 : We do not use find because it might not be available.
20692 : We do not just use MANIFEST because the user may have dropped
20693 : some additional extensions into the source tree and expect them
20696 : Function to recursively find available extensions, ignoring DynaLoader
20697 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20701 DynaLoader|dynaload) ;;
20703 if $test -f $xxx/$xxx.xs; then
20704 known_extensions="$known_extensions $1$xxx";
20705 elif $test -f $xxx/Makefile.PL; then
20706 nonxs_extensions="$nonxs_extensions $1$xxx";
20708 if $test -d $xxx -a $# -lt 10; then
20711 eval $find_extensions;
20723 eval $find_extensions
20724 # Special case: Add in threads/shared since it is not picked up by the
20725 # recursive find above (and adding in general recursive finding breaks
20726 # SDBM_File/sdbm). A.D. 10/25/2001.
20727 known_extensions="$known_extensions threads/shared"
20728 set X $nonxs_extensions
20730 nonxs_extensions="$*"
20731 set X $known_extensions
20733 known_extensions="$*"
20736 : Now see which are supported on this system.
20738 for xxx in $known_extensions ; do
20742 $define) avail_ext="$avail_ext $xxx" ;;
20745 GDBM_File|gdbm_fil)
20747 $define) avail_ext="$avail_ext $xxx" ;;
20750 I18N/Langinfo|i18n_lan)
20751 case "$i_langinfo$d_nl_langinfo" in
20752 $define$define) avail_ext="$avail_ext $xxx" ;;
20755 NDBM_File|ndbm_fil)
20758 case "$osname-$use64bitint" in
20761 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20764 *) avail_ext="$avail_ext $xxx" ;;
20769 ODBM_File|odbm_fil)
20770 case "${i_dbm}${i_rpcsvcdbm}" in
20772 case "$osname-$use64bitint" in
20775 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20778 *) avail_ext="$avail_ext $xxx" ;;
20784 case "$useposix" in
20785 true|define|y) avail_ext="$avail_ext $xxx" ;;
20789 case "$useopcode" in
20790 true|define|y) avail_ext="$avail_ext $xxx" ;;
20794 case "$d_socket" in
20797 beos) ;; # not unless BONE
20798 *) avail_ext="$avail_ext $xxx" ;;
20803 Sys/Syslog|sys/syslog)
20804 : XXX syslog requires socket
20805 case "$d_socket" in
20806 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20810 case "$usethreads" in
20812 case "$useithreads" in
20813 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20817 XS/APItest|xs/apitest)
20818 # This is just for testing. Skip it unless we have dynamic loading.
20821 $define) avail_ext="$avail_ext $xxx" ;;
20824 XS/Typemap|xs/typemap)
20825 # This is just for testing. Skip it unless we have dynamic loading.
20827 $define) avail_ext="$avail_ext $xxx" ;;
20830 threads|threads/shared)
20831 # threads and threads::shared are special cases.
20832 # To stop people from asking "Perl 5.8.0 was supposed
20833 # to have this new fancy threads implementation but my
20834 # perl doesn't have it" and from people trying to
20835 # (re)install the threads module using CPAN.pm and
20836 # CPAN.pm then offering to reinstall Perl 5.8.0,
20837 # the threads.pm and threads/shared.pm will always be
20838 # there, croaking informatively ("you need to rebuild
20839 # all of Perl with threads, sorry") when threads haven't
20840 # been compiled in.
20842 avail_ext="$avail_ext $xxx"
20845 : XXX Do we need a useipcsysv variable here
20846 case "${d_msg}${d_sem}${d_shm}" in
20847 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20850 *) avail_ext="$avail_ext $xxx"
20859 case "$onlyextensions" in
20861 *) keepextensions=''
20862 echo "You have requested that only certains extensions be included..." >&4
20863 for i in $onlyextensions; do
20864 case " $avail_ext " in
20866 echo "Keeping extension $i."
20867 keepextensions="$keepextensions $i"
20869 *) echo "Ignoring extension $i." ;;
20872 avail_ext="$keepextensions"
20876 case "$noextensions" in
20878 *) keepextensions=''
20879 echo "You have requested that certain extensions be ignored..." >&4
20880 for i in $avail_ext; do
20881 case " $noextensions " in
20882 *" $i "*) echo "Ignoring extension $i." ;;
20883 *) echo "Keeping extension $i.";
20884 keepextensions="$keepextensions $i"
20888 avail_ext="$keepextensions"
20892 : Now see which nonxs extensions are supported on this system.
20893 : For now assume all are.
20895 for xxx in $nonxs_extensions ; do
20897 *) nonxs_ext="$nonxs_ext $xxx"
20909 A number of extensions are supplied with $package. You may choose to
20910 compile these extensions for dynamic loading (the default), compile
20911 them into the $package executable (static loading), or not include
20912 them at all. Answer "none" to include no extensions.
20913 Note that DynaLoader is always built and need not be mentioned here.
20916 case "$dynamic_ext" in
20918 : Exclude those listed in static_ext
20920 for xxx in $avail_ext; do
20921 case " $static_ext " in
20923 *) dflt="$dflt $xxx" ;;
20930 *) dflt="$dynamic_ext"
20931 # Perhaps we are reusing an old out-of-date config.sh.
20934 if test X"$dynamic_ext" != X"$avail_ext"; then
20936 NOTICE: Your previous config.sh list may be incorrect.
20937 The extensions now available to you are
20939 but the default list from your previous config.sh is
20951 rp="What extensions do you wish to load dynamically?"
20954 none) dynamic_ext=' ' ;;
20955 *) dynamic_ext="$ans" ;;
20958 case "$static_ext" in
20960 : Exclude those already listed in dynamic linking
20962 for xxx in $avail_ext; do
20963 case " $dynamic_ext " in
20965 *) dflt="$dflt $xxx" ;;
20972 *) dflt="$static_ext"
20979 rp="What extensions do you wish to load statically?"
20982 none) static_ext=' ' ;;
20983 *) static_ext="$ans" ;;
20988 A number of extensions are supplied with $package. Answer "none"
20989 to include no extensions.
20990 Note that DynaLoader is always built and need not be mentioned here.
20993 case "$static_ext" in
20994 '') dflt="$avail_ext" ;;
20995 *) dflt="$static_ext"
20996 # Perhaps we are reusing an old out-of-date config.sh.
20999 if test X"$static_ext" != X"$avail_ext"; then
21001 NOTICE: Your previous config.sh list may be incorrect.
21002 The extensions now available to you are
21004 but the default list from your previous config.sh is
21013 : Exclude those that are not xs extensions
21017 rp="What extensions do you wish to include?"
21020 none) static_ext=' ' ;;
21021 *) static_ext="$ans" ;;
21026 # Encode is a special case. If we are building Encode as a static
21027 # extension, we need to explicitly list its subextensions as well.
21028 # For other nested extensions, this is handled automatically by
21029 # the appropriate Makefile.PL.
21030 case " $static_ext " in
21031 *" Encode "*) # Add the subextensions of Encode
21033 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21034 static_ext="$static_ext Encode/$xxx"
21040 set X $dynamic_ext $static_ext $nonxs_ext
21044 # Sanity check: We require an extension suitable for use with
21045 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21046 # should show up as failures in the test suite, but it's helpful to
21047 # catch them now.) The 'extensions' list is normally sorted
21048 # alphabetically, so we need to accept either
21049 # DB_File ... Fcntl ... IO ....
21050 # or something like
21051 # Fcntl ... NDBM_File ... IO ....
21052 case " $extensions" in
21053 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21054 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21055 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21056 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21057 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21061 : Remove libraries needed only for extensions
21062 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21063 : The exception is SunOS 4.x, which needs them.
21064 case "${osname}X${osvers}" in
21068 *) case "$usedl" in
21069 $define|true|[yY]*)
21070 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21074 *) perllibs="$libs"
21080 : Remove build directory name from cppstdin so it can be used from
21081 : either the present location or the final installed location.
21083 : Get out of the UU directory to get correct path name.
21085 case "$cppstdin" in
21087 echo "Stripping down cppstdin path name"
21093 : end of configuration questions
21095 echo "End of configuration questions."
21098 : back to where it started
21099 if test -d ../UU; then
21103 : configuration may be patched via a 'config.arch' file
21104 if $test -f config.arch; then
21105 echo "I see a config.arch file, loading it."
21109 : configuration may be patched via a 'config.over' file
21110 if $test -f config.over; then
21113 rp='I see a config.over file. Do you wish to load it?'
21116 n*) echo "OK, I'll ignore it.";;
21118 echo "Configuration override changes have been loaded."
21123 : in case they want portability, strip down executable paths
21124 case "$d_portable" in
21127 echo "Stripping down executable paths..." >&4
21128 for file in $loclist $trylist; do
21130 eval $file=`basename $temp`
21135 : create config.sh file
21137 echo "Creating config.sh..." >&4
21138 $spitshell <<EOT >config.sh
21141 # This file was produced by running the Configure script. It holds all the
21142 # definitions figured out by Configure. Should you modify one of these values,
21143 # do not forget to propagate your changes by running "Configure -der". You may
21144 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21147 # Package name : $package
21148 # Source directory : $src
21149 # Configuration time: $cf_time
21150 # Configured by : $cf_by
21151 # Target system : $myuname
21161 Revision='$Revision'
21169 alignbytes='$alignbytes'
21170 ansi2knr='$ansi2knr'
21171 aphostname='$aphostname'
21172 api_revision='$api_revision'
21173 api_subversion='$api_subversion'
21174 api_version='$api_version'
21175 api_versionstring='$api_versionstring'
21178 archlibexp='$archlibexp'
21179 archname64='$archname64'
21180 archname='$archname'
21181 archobjs='$archobjs'
21182 asctime_r_proto='$asctime_r_proto'
21190 byteorder='$byteorder'
21192 castflags='$castflags'
21195 cccdlflags='$cccdlflags'
21196 ccdlflags='$ccdlflags'
21198 ccflags_uselargefiles='$ccflags_uselargefiles'
21200 ccsymbols='$ccsymbols'
21201 ccversion='$ccversion'
21203 cf_email='$cf_email'
21205 charsize='$charsize'
21209 clocktype='$clocktype'
21211 compress='$compress'
21212 contains='$contains'
21216 cpp_stuff='$cpp_stuff'
21217 cppccsymbols='$cppccsymbols'
21218 cppflags='$cppflags'
21220 cppminus='$cppminus'
21222 cppstdin='$cppstdin'
21223 cppsymbols='$cppsymbols'
21224 crypt_r_proto='$crypt_r_proto'
21225 cryptlib='$cryptlib'
21227 ctermid_r_proto='$ctermid_r_proto'
21228 ctime_r_proto='$ctime_r_proto'
21229 d_Gconvert='$d_Gconvert'
21230 d_PRIEUldbl='$d_PRIEUldbl'
21231 d_PRIFUldbl='$d_PRIFUldbl'
21232 d_PRIGUldbl='$d_PRIGUldbl'
21233 d_PRIXU64='$d_PRIXU64'
21234 d_PRId64='$d_PRId64'
21235 d_PRIeldbl='$d_PRIeldbl'
21236 d_PRIfldbl='$d_PRIfldbl'
21237 d_PRIgldbl='$d_PRIgldbl'
21238 d_PRIi64='$d_PRIi64'
21239 d_PRIo64='$d_PRIo64'
21240 d_PRIu64='$d_PRIu64'
21241 d_PRIx64='$d_PRIx64'
21242 d_SCNfldbl='$d_SCNfldbl'
21243 d__fwalk='$d__fwalk'
21244 d_access='$d_access'
21245 d_accessx='$d_accessx'
21248 d_archlib='$d_archlib'
21249 d_asctime_r='$d_asctime_r'
21252 d_attribute_format='$d_attribute_format'
21253 d_attribute_malloc='$d_attribute_malloc'
21254 d_attribute_nonnull='$d_attribute_nonnull'
21255 d_attribute_noreturn='$d_attribute_noreturn'
21256 d_attribute_pure='$d_attribute_pure'
21257 d_attribute_unused='$d_attribute_unused'
21258 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21262 d_bsdgetpgrp='$d_bsdgetpgrp'
21263 d_bsdsetpgrp='$d_bsdsetpgrp'
21264 d_builtin_choose_expr='$d_builtin_choose_expr'
21265 d_builtin_expect='$d_builtin_expect'
21267 d_casti32='$d_casti32'
21268 d_castneg='$d_castneg'
21269 d_charvspr='$d_charvspr'
21271 d_chroot='$d_chroot'
21272 d_chsize='$d_chsize'
21274 d_clearenv='$d_clearenv'
21275 d_closedir='$d_closedir'
21276 d_cmsghdr_s='$d_cmsghdr_s'
21278 d_copysignl='$d_copysignl'
21280 d_crypt_r='$d_crypt_r'
21282 d_ctermid_r='$d_ctermid_r'
21283 d_ctime_r='$d_ctime_r'
21284 d_cuserid='$d_cuserid'
21285 d_dbl_dig='$d_dbl_dig'
21286 d_dbminitproto='$d_dbminitproto'
21287 d_difftime='$d_difftime'
21289 d_dirnamlen='$d_dirnamlen'
21290 d_dlerror='$d_dlerror'
21291 d_dlopen='$d_dlopen'
21292 d_dlsymun='$d_dlsymun'
21293 d_dosuid='$d_dosuid'
21294 d_drand48_r='$d_drand48_r'
21295 d_drand48proto='$d_drand48proto'
21297 d_eaccess='$d_eaccess'
21298 d_endgrent='$d_endgrent'
21299 d_endgrent_r='$d_endgrent_r'
21300 d_endhent='$d_endhent'
21301 d_endhostent_r='$d_endhostent_r'
21302 d_endnent='$d_endnent'
21303 d_endnetent_r='$d_endnetent_r'
21304 d_endpent='$d_endpent'
21305 d_endprotoent_r='$d_endprotoent_r'
21306 d_endpwent='$d_endpwent'
21307 d_endpwent_r='$d_endpwent_r'
21308 d_endsent='$d_endsent'
21309 d_endservent_r='$d_endservent_r'
21310 d_eofnblk='$d_eofnblk'
21311 d_eunice='$d_eunice'
21312 d_faststdio='$d_faststdio'
21313 d_fchdir='$d_fchdir'
21314 d_fchmod='$d_fchmod'
21315 d_fchown='$d_fchown'
21317 d_fcntl_can_lock='$d_fcntl_can_lock'
21318 d_fd_macros='$d_fd_macros'
21319 d_fd_set='$d_fd_set'
21320 d_fds_bits='$d_fds_bits'
21321 d_fgetpos='$d_fgetpos'
21322 d_finite='$d_finite'
21323 d_finitel='$d_finitel'
21324 d_flexfnam='$d_flexfnam'
21326 d_flockproto='$d_flockproto'
21328 d_fp_class='$d_fp_class'
21329 d_fpathconf='$d_fpathconf'
21330 d_fpclass='$d_fpclass'
21331 d_fpclassify='$d_fpclassify'
21332 d_fpclassl='$d_fpclassl'
21333 d_fpos64_t='$d_fpos64_t'
21334 d_frexpl='$d_frexpl'
21335 d_fs_data_s='$d_fs_data_s'
21336 d_fseeko='$d_fseeko'
21337 d_fsetpos='$d_fsetpos'
21338 d_fstatfs='$d_fstatfs'
21339 d_fstatvfs='$d_fstatvfs'
21341 d_ftello='$d_ftello'
21343 d_futimes='$d_futimes'
21344 d_getcwd='$d_getcwd'
21345 d_getespwnam='$d_getespwnam'
21346 d_getfsstat='$d_getfsstat'
21347 d_getgrent='$d_getgrent'
21348 d_getgrent_r='$d_getgrent_r'
21349 d_getgrgid_r='$d_getgrgid_r'
21350 d_getgrnam_r='$d_getgrnam_r'
21351 d_getgrps='$d_getgrps'
21352 d_gethbyaddr='$d_gethbyaddr'
21353 d_gethbyname='$d_gethbyname'
21354 d_gethent='$d_gethent'
21355 d_gethname='$d_gethname'
21356 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21357 d_gethostbyname_r='$d_gethostbyname_r'
21358 d_gethostent_r='$d_gethostent_r'
21359 d_gethostprotos='$d_gethostprotos'
21360 d_getitimer='$d_getitimer'
21361 d_getlogin='$d_getlogin'
21362 d_getlogin_r='$d_getlogin_r'
21363 d_getmnt='$d_getmnt'
21364 d_getmntent='$d_getmntent'
21365 d_getnbyaddr='$d_getnbyaddr'
21366 d_getnbyname='$d_getnbyname'
21367 d_getnent='$d_getnent'
21368 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21369 d_getnetbyname_r='$d_getnetbyname_r'
21370 d_getnetent_r='$d_getnetent_r'
21371 d_getnetprotos='$d_getnetprotos'
21372 d_getpagsz='$d_getpagsz'
21373 d_getpbyname='$d_getpbyname'
21374 d_getpbynumber='$d_getpbynumber'
21375 d_getpent='$d_getpent'
21376 d_getpgid='$d_getpgid'
21377 d_getpgrp2='$d_getpgrp2'
21378 d_getpgrp='$d_getpgrp'
21379 d_getppid='$d_getppid'
21380 d_getprior='$d_getprior'
21381 d_getprotobyname_r='$d_getprotobyname_r'
21382 d_getprotobynumber_r='$d_getprotobynumber_r'
21383 d_getprotoent_r='$d_getprotoent_r'
21384 d_getprotoprotos='$d_getprotoprotos'
21385 d_getprpwnam='$d_getprpwnam'
21386 d_getpwent='$d_getpwent'
21387 d_getpwent_r='$d_getpwent_r'
21388 d_getpwnam_r='$d_getpwnam_r'
21389 d_getpwuid_r='$d_getpwuid_r'
21390 d_getsbyname='$d_getsbyname'
21391 d_getsbyport='$d_getsbyport'
21392 d_getsent='$d_getsent'
21393 d_getservbyname_r='$d_getservbyname_r'
21394 d_getservbyport_r='$d_getservbyport_r'
21395 d_getservent_r='$d_getservent_r'
21396 d_getservprotos='$d_getservprotos'
21397 d_getspnam='$d_getspnam'
21398 d_getspnam_r='$d_getspnam_r'
21399 d_gettimeod='$d_gettimeod'
21400 d_gmtime_r='$d_gmtime_r'
21401 d_gnulibc='$d_gnulibc'
21402 d_grpasswd='$d_grpasswd'
21403 d_hasmntopt='$d_hasmntopt'
21405 d_ilogbl='$d_ilogbl'
21407 d_inetaton='$d_inetaton'
21408 d_int64_t='$d_int64_t'
21409 d_isascii='$d_isascii'
21410 d_isfinite='$d_isfinite'
21413 d_isnanl='$d_isnanl'
21414 d_killpg='$d_killpg'
21415 d_lchown='$d_lchown'
21416 d_ldbl_dig='$d_ldbl_dig'
21417 d_libm_lib_version='$d_libm_lib_version'
21419 d_localtime_r='$d_localtime_r'
21420 d_locconv='$d_locconv'
21422 d_longdbl='$d_longdbl'
21423 d_longlong='$d_longlong'
21424 d_lseekproto='$d_lseekproto'
21426 d_madvise='$d_madvise'
21427 d_malloc_good_size='$d_malloc_good_size'
21428 d_malloc_size='$d_malloc_size'
21430 d_mbstowcs='$d_mbstowcs'
21431 d_mbtowc='$d_mbtowc'
21432 d_memchr='$d_memchr'
21433 d_memcmp='$d_memcmp'
21434 d_memcpy='$d_memcpy'
21435 d_memmove='$d_memmove'
21436 d_memset='$d_memset'
21438 d_mkdtemp='$d_mkdtemp'
21439 d_mkfifo='$d_mkfifo'
21440 d_mkstemp='$d_mkstemp'
21441 d_mkstemps='$d_mkstemps'
21442 d_mktime='$d_mktime'
21445 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21446 d_modflproto='$d_modflproto'
21447 d_mprotect='$d_mprotect'
21449 d_msg_ctrunc='$d_msg_ctrunc'
21450 d_msg_dontroute='$d_msg_dontroute'
21451 d_msg_oob='$d_msg_oob'
21452 d_msg_peek='$d_msg_peek'
21453 d_msg_proxy='$d_msg_proxy'
21454 d_msgctl='$d_msgctl'
21455 d_msgget='$d_msgget'
21456 d_msghdr_s='$d_msghdr_s'
21457 d_msgrcv='$d_msgrcv'
21458 d_msgsnd='$d_msgsnd'
21460 d_munmap='$d_munmap'
21461 d_mymalloc='$d_mymalloc'
21463 d_nl_langinfo='$d_nl_langinfo'
21464 d_nv_preserves_uv='$d_nv_preserves_uv'
21465 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21466 d_off64_t='$d_off64_t'
21467 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21468 d_oldpthreads='$d_oldpthreads'
21469 d_oldsock='$d_oldsock'
21471 d_pathconf='$d_pathconf'
21473 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21474 d_phostname='$d_phostname'
21477 d_portable='$d_portable'
21478 d_procselfexe='$d_procselfexe'
21479 d_pthread_atfork='$d_pthread_atfork'
21480 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21481 d_pthread_yield='$d_pthread_yield'
21483 d_pwchange='$d_pwchange'
21484 d_pwclass='$d_pwclass'
21485 d_pwcomment='$d_pwcomment'
21486 d_pwexpire='$d_pwexpire'
21487 d_pwgecos='$d_pwgecos'
21488 d_pwpasswd='$d_pwpasswd'
21489 d_pwquota='$d_pwquota'
21492 d_random_r='$d_random_r'
21493 d_readdir64_r='$d_readdir64_r'
21494 d_readdir='$d_readdir'
21495 d_readdir_r='$d_readdir_r'
21496 d_readlink='$d_readlink'
21498 d_recvmsg='$d_recvmsg'
21499 d_rename='$d_rename'
21500 d_rewinddir='$d_rewinddir'
21502 d_safebcpy='$d_safebcpy'
21503 d_safemcpy='$d_safemcpy'
21504 d_sanemcmp='$d_sanemcmp'
21505 d_sbrkproto='$d_sbrkproto'
21506 d_scalbnl='$d_scalbnl'
21507 d_sched_yield='$d_sched_yield'
21508 d_scm_rights='$d_scm_rights'
21509 d_seekdir='$d_seekdir'
21510 d_select='$d_select'
21512 d_semctl='$d_semctl'
21513 d_semctl_semid_ds='$d_semctl_semid_ds'
21514 d_semctl_semun='$d_semctl_semun'
21515 d_semget='$d_semget'
21517 d_sendmsg='$d_sendmsg'
21518 d_setegid='$d_setegid'
21519 d_seteuid='$d_seteuid'
21520 d_setgrent='$d_setgrent'
21521 d_setgrent_r='$d_setgrent_r'
21522 d_setgrps='$d_setgrps'
21523 d_sethent='$d_sethent'
21524 d_sethostent_r='$d_sethostent_r'
21525 d_setitimer='$d_setitimer'
21526 d_setlinebuf='$d_setlinebuf'
21527 d_setlocale='$d_setlocale'
21528 d_setlocale_r='$d_setlocale_r'
21529 d_setnent='$d_setnent'
21530 d_setnetent_r='$d_setnetent_r'
21531 d_setpent='$d_setpent'
21532 d_setpgid='$d_setpgid'
21533 d_setpgrp2='$d_setpgrp2'
21534 d_setpgrp='$d_setpgrp'
21535 d_setprior='$d_setprior'
21536 d_setproctitle='$d_setproctitle'
21537 d_setprotoent_r='$d_setprotoent_r'
21538 d_setpwent='$d_setpwent'
21539 d_setpwent_r='$d_setpwent_r'
21540 d_setregid='$d_setregid'
21541 d_setresgid='$d_setresgid'
21542 d_setresuid='$d_setresuid'
21543 d_setreuid='$d_setreuid'
21544 d_setrgid='$d_setrgid'
21545 d_setruid='$d_setruid'
21546 d_setsent='$d_setsent'
21547 d_setservent_r='$d_setservent_r'
21548 d_setsid='$d_setsid'
21549 d_setvbuf='$d_setvbuf'
21553 d_shmatprototype='$d_shmatprototype'
21554 d_shmctl='$d_shmctl'
21556 d_shmget='$d_shmget'
21557 d_sigaction='$d_sigaction'
21558 d_sigprocmask='$d_sigprocmask'
21559 d_sigsetjmp='$d_sigsetjmp'
21560 d_snprintf='$d_snprintf'
21561 d_sockatmark='$d_sockatmark'
21562 d_sockatmarkproto='$d_sockatmarkproto'
21563 d_socket='$d_socket'
21564 d_socklen_t='$d_socklen_t'
21565 d_sockpair='$d_sockpair'
21566 d_socks5_init='$d_socks5_init'
21567 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21569 d_srand48_r='$d_srand48_r'
21570 d_srandom_r='$d_srandom_r'
21571 d_sresgproto='$d_sresgproto'
21572 d_sresuproto='$d_sresuproto'
21573 d_statblks='$d_statblks'
21574 d_statfs_f_flags='$d_statfs_f_flags'
21575 d_statfs_s='$d_statfs_s'
21576 d_statvfs='$d_statvfs'
21577 d_stdio_cnt_lval='$d_stdio_cnt_lval'
21578 d_stdio_ptr_lval='$d_stdio_ptr_lval'
21579 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21580 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21581 d_stdio_stream_array='$d_stdio_stream_array'
21582 d_stdiobase='$d_stdiobase'
21583 d_stdstdio='$d_stdstdio'
21584 d_strchr='$d_strchr'
21585 d_strcoll='$d_strcoll'
21586 d_strctcpy='$d_strctcpy'
21587 d_strerrm='$d_strerrm'
21588 d_strerror='$d_strerror'
21589 d_strerror_r='$d_strerror_r'
21590 d_strftime='$d_strftime'
21591 d_strlcat='$d_strlcat'
21592 d_strlcpy='$d_strlcpy'
21593 d_strtod='$d_strtod'
21594 d_strtol='$d_strtol'
21595 d_strtold='$d_strtold'
21596 d_strtoll='$d_strtoll'
21597 d_strtoq='$d_strtoq'
21598 d_strtoul='$d_strtoul'
21599 d_strtoull='$d_strtoull'
21600 d_strtouq='$d_strtouq'
21601 d_strxfrm='$d_strxfrm'
21602 d_suidsafe='$d_suidsafe'
21603 d_symlink='$d_symlink'
21604 d_syscall='$d_syscall'
21605 d_syscallproto='$d_syscallproto'
21606 d_sysconf='$d_sysconf'
21607 d_sysernlst='$d_sysernlst'
21608 d_syserrlst='$d_syserrlst'
21609 d_system='$d_system'
21610 d_tcgetpgrp='$d_tcgetpgrp'
21611 d_tcsetpgrp='$d_tcsetpgrp'
21612 d_telldir='$d_telldir'
21613 d_telldirproto='$d_telldirproto'
21616 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21617 d_tm_tm_zone='$d_tm_tm_zone'
21618 d_tmpnam_r='$d_tmpnam_r'
21619 d_truncate='$d_truncate'
21620 d_ttyname_r='$d_ttyname_r'
21621 d_tzname='$d_tzname'
21622 d_u32align='$d_u32align'
21623 d_ualarm='$d_ualarm'
21626 d_union_semun='$d_union_semun'
21627 d_unordered='$d_unordered'
21628 d_unsetenv='$d_unsetenv'
21629 d_usleep='$d_usleep'
21630 d_usleepproto='$d_usleepproto'
21632 d_vendorarch='$d_vendorarch'
21633 d_vendorbin='$d_vendorbin'
21634 d_vendorlib='$d_vendorlib'
21635 d_vendorscript='$d_vendorscript'
21637 d_void_closedir='$d_void_closedir'
21638 d_voidsig='$d_voidsig'
21639 d_voidtty='$d_voidtty'
21640 d_volatile='$d_volatile'
21641 d_vprintf='$d_vprintf'
21642 d_vsnprintf='$d_vsnprintf'
21644 d_waitpid='$d_waitpid'
21645 d_wcstombs='$d_wcstombs'
21646 d_wctomb='$d_wctomb'
21647 d_writev='$d_writev'
21650 db_hashtype='$db_hashtype'
21651 db_prefixtype='$db_prefixtype'
21652 db_version_major='$db_version_major'
21653 db_version_minor='$db_version_minor'
21654 db_version_patch='$db_version_patch'
21655 defvoidused='$defvoidused'
21656 direntrytype='$direntrytype'
21659 doublesize='$doublesize'
21661 drand48_r_proto='$drand48_r_proto'
21662 dynamic_ext='$dynamic_ext'
21668 endgrent_r_proto='$endgrent_r_proto'
21669 endhostent_r_proto='$endhostent_r_proto'
21670 endnetent_r_proto='$endnetent_r_proto'
21671 endprotoent_r_proto='$endprotoent_r_proto'
21672 endpwent_r_proto='$endpwent_r_proto'
21673 endservent_r_proto='$endservent_r_proto'
21674 eunicefix='$eunicefix'
21677 extensions='$extensions'
21679 fflushNULL='$fflushNULL'
21680 fflushall='$fflushall'
21682 firstmakefile='$firstmakefile'
21684 fpossize='$fpossize'
21685 fpostype='$fpostype'
21686 freetype='$freetype'
21689 full_csh='$full_csh'
21690 full_sed='$full_sed'
21691 gccansipedantic='$gccansipedantic'
21692 gccosandvers='$gccosandvers'
21693 gccversion='$gccversion'
21694 getgrent_r_proto='$getgrent_r_proto'
21695 getgrgid_r_proto='$getgrgid_r_proto'
21696 getgrnam_r_proto='$getgrnam_r_proto'
21697 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21698 gethostbyname_r_proto='$gethostbyname_r_proto'
21699 gethostent_r_proto='$gethostent_r_proto'
21700 getlogin_r_proto='$getlogin_r_proto'
21701 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21702 getnetbyname_r_proto='$getnetbyname_r_proto'
21703 getnetent_r_proto='$getnetent_r_proto'
21704 getprotobyname_r_proto='$getprotobyname_r_proto'
21705 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21706 getprotoent_r_proto='$getprotoent_r_proto'
21707 getpwent_r_proto='$getpwent_r_proto'
21708 getpwnam_r_proto='$getpwnam_r_proto'
21709 getpwuid_r_proto='$getpwuid_r_proto'
21710 getservbyname_r_proto='$getservbyname_r_proto'
21711 getservbyport_r_proto='$getservbyport_r_proto'
21712 getservent_r_proto='$getservent_r_proto'
21713 getspnam_r_proto='$getspnam_r_proto'
21714 gidformat='$gidformat'
21720 gmtime_r_proto='$gmtime_r_proto'
21721 gnulibc_version='$gnulibc_version'
21723 groupcat='$groupcat'
21724 groupstype='$groupstype'
21727 h_sysfile='$h_sysfile'
21730 html1dir='$html1dir'
21731 html1direxp='$html1direxp'
21732 html3dir='$html3dir'
21733 html3direxp='$html3direxp'
21742 i_arpainet='$i_arpainet'
21743 i_bsdioctl='$i_bsdioctl'
21747 i_dirent='$i_dirent'
21753 i_fp_class='$i_fp_class'
21756 i_ieeefp='$i_ieeefp'
21757 i_inttypes='$i_inttypes'
21758 i_langinfo='$i_langinfo'
21759 i_libutil='$i_libutil'
21760 i_limits='$i_limits'
21761 i_locale='$i_locale'
21762 i_machcthr='$i_machcthr'
21763 i_malloc='$i_malloc'
21765 i_memory='$i_memory'
21766 i_mntent='$i_mntent'
21769 i_neterrno='$i_neterrno'
21770 i_netinettcp='$i_netinettcp'
21774 i_pthread='$i_pthread'
21776 i_rpcsvcdbm='$i_rpcsvcdbm'
21779 i_shadow='$i_shadow'
21781 i_stdarg='$i_stdarg'
21782 i_stddef='$i_stddef'
21783 i_stdlib='$i_stdlib'
21784 i_string='$i_string'
21785 i_sunmath='$i_sunmath'
21786 i_sysaccess='$i_sysaccess'
21787 i_sysdir='$i_sysdir'
21788 i_sysfile='$i_sysfile'
21789 i_sysfilio='$i_sysfilio'
21791 i_sysioctl='$i_sysioctl'
21792 i_syslog='$i_syslog'
21793 i_sysmman='$i_sysmman'
21794 i_sysmode='$i_sysmode'
21795 i_sysmount='$i_sysmount'
21796 i_sysndir='$i_sysndir'
21797 i_sysparam='$i_sysparam'
21798 i_sysresrc='$i_sysresrc'
21799 i_syssecrt='$i_syssecrt'
21800 i_sysselct='$i_sysselct'
21801 i_syssockio='$i_syssockio'
21802 i_sysstat='$i_sysstat'
21803 i_sysstatfs='$i_sysstatfs'
21804 i_sysstatvfs='$i_sysstatvfs'
21805 i_systime='$i_systime'
21806 i_systimek='$i_systimek'
21807 i_systimes='$i_systimes'
21808 i_systypes='$i_systypes'
21809 i_sysuio='$i_sysuio'
21811 i_sysutsname='$i_sysutsname'
21812 i_sysvfs='$i_sysvfs'
21813 i_syswait='$i_syswait'
21814 i_termio='$i_termio'
21815 i_termios='$i_termios'
21817 i_unistd='$i_unistd'
21820 i_values='$i_values'
21821 i_varargs='$i_varargs'
21822 i_varhdr='$i_varhdr'
21824 ignore_versioned_solibs='$ignore_versioned_solibs'
21825 inc_version_list='$inc_version_list'
21826 inc_version_list_init='$inc_version_list_init'
21829 installarchlib='$installarchlib'
21830 installbin='$installbin'
21831 installhtml1dir='$installhtml1dir'
21832 installhtml3dir='$installhtml3dir'
21833 installman1dir='$installman1dir'
21834 installman3dir='$installman3dir'
21835 installprefix='$installprefix'
21836 installprefixexp='$installprefixexp'
21837 installprivlib='$installprivlib'
21838 installscript='$installscript'
21839 installsitearch='$installsitearch'
21840 installsitebin='$installsitebin'
21841 installsitehtml1dir='$installsitehtml1dir'
21842 installsitehtml3dir='$installsitehtml3dir'
21843 installsitelib='$installsitelib'
21844 installsiteman1dir='$installsiteman1dir'
21845 installsiteman3dir='$installsiteman3dir'
21846 installsitescript='$installsitescript'
21847 installstyle='$installstyle'
21848 installusrbinperl='$installusrbinperl'
21849 installvendorarch='$installvendorarch'
21850 installvendorbin='$installvendorbin'
21851 installvendorhtml1dir='$installvendorhtml1dir'
21852 installvendorhtml3dir='$installvendorhtml3dir'
21853 installvendorlib='$installvendorlib'
21854 installvendorman1dir='$installvendorman1dir'
21855 installvendorman3dir='$installvendorman3dir'
21856 installvendorscript='$installvendorscript'
21858 issymlink='$issymlink'
21859 ivdformat='$ivdformat'
21862 known_extensions='$known_extensions'
21865 lddlflags='$lddlflags'
21867 ldflags_uselargefiles='$ldflags_uselargefiles'
21868 ldlibpthname='$ldlibpthname'
21875 libsdirs='$libsdirs'
21876 libsfiles='$libsfiles'
21877 libsfound='$libsfound'
21878 libspath='$libspath'
21879 libswanted='$libswanted'
21880 libswanted_uselargefiles='$libswanted_uselargefiles'
21886 localtime_r_proto='$localtime_r_proto'
21887 locincpth='$locincpth'
21888 loclibpth='$loclibpth'
21889 longdblsize='$longdblsize'
21890 longlongsize='$longlongsize'
21891 longsize='$longsize'
21895 lseeksize='$lseeksize'
21896 lseektype='$lseektype'
21901 make_set_make='$make_set_make'
21902 mallocobj='$mallocobj'
21903 mallocsrc='$mallocsrc'
21904 malloctype='$malloctype'
21906 man1direxp='$man1direxp'
21909 man3direxp='$man3direxp'
21911 mips_type='$mips_type'
21912 mistrustnm='$mistrustnm'
21914 mmaptype='$mmaptype'
21915 modetype='$modetype'
21917 multiarch='$multiarch'
21919 myarchname='$myarchname'
21920 mydomain='$mydomain'
21921 myhostname='$myhostname'
21924 need_va_copy='$need_va_copy'
21925 netdb_hlen_type='$netdb_hlen_type'
21926 netdb_host_type='$netdb_host_type'
21927 netdb_name_type='$netdb_name_type'
21928 netdb_net_type='$netdb_net_type'
21931 nm_so_opt='$nm_so_opt'
21932 nonxs_ext='$nonxs_ext'
21934 nvEUformat='$nvEUformat'
21935 nvFUformat='$nvFUformat'
21936 nvGUformat='$nvGUformat'
21937 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21938 nveformat='$nveformat'
21939 nvfformat='$nvfformat'
21940 nvgformat='$nvgformat'
21943 o_nonblock='$o_nonblock'
21945 old_pthread_create_joinable='$old_pthread_create_joinable'
21946 optimize='$optimize'
21947 orderlib='$orderlib'
21950 otherlibdirs='$otherlibdirs'
21954 patchlevel='$patchlevel'
21955 path_sep='$path_sep'
21958 perl_patchlevel='$perl_patchlevel'
21959 perladmin='$perladmin'
21960 perllibs='$perllibs'
21961 perlpath='$perlpath'
21963 phostname='$phostname'
21969 prefixexp='$prefixexp'
21971 privlibexp='$privlibexp'
21972 procselfexe='$procselfexe'
21973 prototype='$prototype'
21975 quadkind='$quadkind'
21976 quadtype='$quadtype'
21977 randbits='$randbits'
21978 randfunc='$randfunc'
21979 random_r_proto='$random_r_proto'
21980 randseedtype='$randseedtype'
21982 rd_nodata='$rd_nodata'
21983 readdir64_r_proto='$readdir64_r_proto'
21984 readdir_r_proto='$readdir_r_proto'
21985 revision='$revision'
21990 sPRIEUldbl='$sPRIEUldbl'
21991 sPRIFUldbl='$sPRIFUldbl'
21992 sPRIGUldbl='$sPRIGUldbl'
21993 sPRIXU64='$sPRIXU64'
21995 sPRIeldbl='$sPRIeldbl'
21996 sPRIfldbl='$sPRIfldbl'
21997 sPRIgldbl='$sPRIgldbl'
22002 sSCNfldbl='$sSCNfldbl'
22003 sched_yield='$sched_yield'
22004 scriptdir='$scriptdir'
22005 scriptdirexp='$scriptdirexp'
22007 seedfunc='$seedfunc'
22008 selectminbits='$selectminbits'
22009 selecttype='$selecttype'
22010 sendmail='$sendmail'
22011 setgrent_r_proto='$setgrent_r_proto'
22012 sethostent_r_proto='$sethostent_r_proto'
22013 setlocale_r_proto='$setlocale_r_proto'
22014 setnetent_r_proto='$setnetent_r_proto'
22015 setprotoent_r_proto='$setprotoent_r_proto'
22016 setpwent_r_proto='$setpwent_r_proto'
22017 setservent_r_proto='$setservent_r_proto'
22020 sharpbang='$sharpbang'
22021 shmattype='$shmattype'
22022 shortsize='$shortsize'
22025 sig_count='$sig_count'
22026 sig_name='$sig_name'
22027 sig_name_init='$sig_name_init'
22029 sig_num_init='$sig_num_init'
22030 sig_size='$sig_size'
22031 signal_t='$signal_t'
22032 sitearch='$sitearch'
22033 sitearchexp='$sitearchexp'
22035 sitebinexp='$sitebinexp'
22036 sitehtml1dir='$sitehtml1dir'
22037 sitehtml1direxp='$sitehtml1direxp'
22038 sitehtml3dir='$sitehtml3dir'
22039 sitehtml3direxp='$sitehtml3direxp'
22041 sitelib_stem='$sitelib_stem'
22042 sitelibexp='$sitelibexp'
22043 siteman1dir='$siteman1dir'
22044 siteman1direxp='$siteman1direxp'
22045 siteman3dir='$siteman3dir'
22046 siteman3direxp='$siteman3direxp'
22047 siteprefix='$siteprefix'
22048 siteprefixexp='$siteprefixexp'
22049 sitescript='$sitescript'
22050 sitescriptexp='$sitescriptexp'
22051 sizesize='$sizesize'
22052 sizetype='$sizetype'
22056 sockethdr='$sockethdr'
22057 socketlib='$socketlib'
22058 socksizetype='$socksizetype'
22060 spackage='$spackage'
22061 spitshell='$spitshell'
22062 srand48_r_proto='$srand48_r_proto'
22063 srandom_r_proto='$srandom_r_proto'
22065 ssizetype='$ssizetype'
22066 startperl='$startperl'
22068 static_ext='$static_ext'
22070 stdio_base='$stdio_base'
22071 stdio_bufsiz='$stdio_bufsiz'
22072 stdio_cnt='$stdio_cnt'
22073 stdio_filbuf='$stdio_filbuf'
22074 stdio_ptr='$stdio_ptr'
22075 stdio_stream_array='$stdio_stream_array'
22076 strerror_r_proto='$strerror_r_proto'
22079 subversion='$subversion'
22083 targetarch='$targetarch'
22087 timeincl='$timeincl'
22088 timetype='$timetype'
22089 tmpnam_r_proto='$tmpnam_r_proto'
22095 ttyname_r_proto='$ttyname_r_proto'
22104 uidformat='$uidformat'
22110 uquadtype='$uquadtype'
22111 use5005threads='$use5005threads'
22112 use64bitall='$use64bitall'
22113 use64bitint='$use64bitint'
22114 usecrosscompile='$usecrosscompile'
22116 usefaststdio='$usefaststdio'
22117 useithreads='$useithreads'
22118 uselargefiles='$uselargefiles'
22119 uselongdouble='$uselongdouble'
22120 usemallocwrap='$usemallocwrap'
22121 usemorebits='$usemorebits'
22122 usemultiplicity='$usemultiplicity'
22123 usemymalloc='$usemymalloc'
22125 useopcode='$useopcode'
22126 useperlio='$useperlio'
22127 useposix='$useposix'
22128 usereentrant='$usereentrant'
22129 userelocatableinc='$userelocatableinc'
22131 useshrplib='$useshrplib'
22132 usesitecustomize='$usesitecustomize'
22133 usesocks='$usesocks'
22134 usethreads='$usethreads'
22135 usevendorprefix='$usevendorprefix'
22136 usevfork='$usevfork'
22139 uvXUformat='$uvXUformat'
22140 uvoformat='$uvoformat'
22143 uvuformat='$uvuformat'
22144 uvxformat='$uvxformat'
22145 vendorarch='$vendorarch'
22146 vendorarchexp='$vendorarchexp'
22147 vendorbin='$vendorbin'
22148 vendorbinexp='$vendorbinexp'
22149 vendorhtml1dir='$vendorhtml1dir'
22150 vendorhtml1direxp='$vendorhtml1direxp'
22151 vendorhtml3dir='$vendorhtml3dir'
22152 vendorhtml3direxp='$vendorhtml3direxp'
22153 vendorlib='$vendorlib'
22154 vendorlib_stem='$vendorlib_stem'
22155 vendorlibexp='$vendorlibexp'
22156 vendorman1dir='$vendorman1dir'
22157 vendorman1direxp='$vendorman1direxp'
22158 vendorman3dir='$vendorman3dir'
22159 vendorman3direxp='$vendorman3direxp'
22160 vendorprefix='$vendorprefix'
22161 vendorprefixexp='$vendorprefixexp'
22162 vendorscript='$vendorscript'
22163 vendorscriptexp='$vendorscriptexp'
22165 version_patchlevel_string='$version_patchlevel_string'
22166 versiononly='$versiononly'
22168 voidflags='$voidflags'
22171 yaccflags='$yaccflags'
22176 : Add in command line options if available
22177 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22179 : add special variables
22180 $test -f $src/patchlevel.h && \
22181 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22182 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22183 echo "PERL_CONFIG_SH=true" >>config.sh
22185 : propagate old symbols
22186 if $test -f UU/config.sh; then
22187 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22188 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22189 $sort | $uniq -u >UU/oldsyms
22190 set X `cat UU/oldsyms`
22196 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22198 echo "# Variables propagated from previous config.sh file." >>config.sh
22199 for sym in `cat UU/oldsyms`; do
22200 echo " Propagating $hint variable "'$'"$sym..."
22201 eval 'tmp="$'"${sym}"'"'
22203 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22209 : Finish up by extracting the .SH files
22213 echo "Extraction done."
22223 If you'd like to make any changes to the config.sh file before I begin
22224 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22227 rp="Press return or use a shell escape to edit config.sh:"
22232 *) : in case they cannot read
22233 sh 1>&4 -c "$ans";;
22238 : if this fails, just run all the .SH files by hand
22247 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22254 Now you need to generate make dependencies by running "$make depend".
22255 You might prefer to run it in background: "$make depend > makedepend.out &"
22256 It can take a while, so you might not want to run it right now.
22261 rp="Run $make depend now?"
22265 $make depend && echo "Now you must run '$make'."
22268 echo "You must run '$make depend' then '$make'."
22271 elif test -f [Mm]akefile; then
22273 echo "Now you must run a $make."
22275 echo "Configure done."
22278 if $test -f Policy.sh; then
22281 If you compile $package on a different machine or from a different object
22282 directory, copy the Policy.sh file from this object directory to the
22283 new one before you run Configure -- this will help you with most of
22284 the policy defaults.
22288 if $test -f config.msg; then
22289 echo "Hmm. I also noted the following information while running:"
22291 $cat config.msg >&4
22294 $rm -f kit*isdone ark*isdone