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 package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Mon Sep 29 18:14:44 CEST 2008 [metaconfig 3.5 PL0]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
335 initialinstalllocation=''
362 d_attribute_format=''
363 d_attribute_malloc=''
364 d_attribute_nonnull=''
365 d_attribute_noreturn=''
367 d_attribute_unused=''
368 d_attribute_warn_unused_result=''
369 d_printf_format_null=''
372 d_builtin_choose_expr=''
375 d_c99_variadic_macros=''
422 endhostent_r_proto=''
428 endprotoent_r_proto=''
434 endservent_r_proto=''
486 gethostbyaddr_r_proto=''
488 gethostbyname_r_proto=''
490 gethostent_r_proto=''
502 getnetbyaddr_r_proto=''
504 getnetbyname_r_proto=''
518 d_getprotobyname_r=''
519 getprotobyname_r_proto=''
520 d_getprotobynumber_r=''
521 getprotobynumber_r_proto=''
523 getprotoent_r_proto=''
535 getservbyname_r_proto=''
537 getservbyport_r_proto=''
539 getservent_r_proto=''
563 d_libm_lib_version=''
566 d_localtime_r_needs_tzset=''
577 d_malloc_good_size=''
619 d_old_pthread_create_joinable=''
620 old_pthread_create_joinable=''
622 d_pthread_attr_setscope=''
661 sethostent_r_proto=''
678 setprotoent_r_proto=''
690 setservent_r_proto=''
724 d_sprintf_returns_strlen=''
739 d_stdio_ptr_lval_nochange_cnt=''
740 d_stdio_ptr_lval_sets_cnt=''
951 d_inc_version_list=''
953 inc_version_list_init=''
972 ignore_versioned_solibs=''
1036 d_perl_otherlibdirs=''
1044 api_versionstring=''
1050 version_patchlevel_string=''
1054 d_nv_preserves_uv=''
1055 d_nv_zero_is_allbits_zero=''
1066 nv_overflows_integers_at=''
1067 nv_preserves_uv_bits=''
1139 installsitehtml1dir=''
1142 installsitehtml3dir=''
1149 installsiteman1dir=''
1152 installsiteman3dir=''
1157 installsitescript=''
1172 d_stdio_stream_array=''
1173 stdio_stream_array=''
1190 ccflags_uselargefiles=''
1191 ldflags_uselargefiles=''
1192 libswanted_uselargefiles=''
1212 installvendorarch=''
1219 installvendorhtml1dir=''
1221 vendorhtml1direxp=''
1222 installvendorhtml3dir=''
1224 vendorhtml3direxp=''
1230 installvendorman1dir=''
1233 installvendorman3dir=''
1240 installvendorscript=''
1253 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1256 : We must find out about Eunice early
1258 if test -f /etc/unixtovms; then
1259 eunicefix=/etc/unixtovms
1261 if test -f /etc/unixtovms.exe; then
1262 eunicefix=/etc/unixtovms.exe
1265 : Set executable suffix now -- needed before hints available
1266 if test -f "/libs/version.library"; then
1269 elif test -f "/system/gnu_library/bin/ar.pm"; then
1272 elif test -n "$DJGPP"; then
1275 elif test -d c:/. -o -n "$is_os2" ; then
1282 : Trailing extension. Override this in a hint file, if needed.
1283 : Extra object files, if any, needed on this platform.
1287 : change the next line if compiling for Xenix/286 on Xenix/386
1288 xlibpth='/usr/lib/386 /lib/386'
1289 : Possible local library directories to search.
1290 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1291 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1293 : general looking path for locating libraries
1294 glibpth="/lib /usr/lib $xlibpth"
1295 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1296 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1297 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1298 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1300 : Private path used by Configure to find libraries. Its value
1301 : is prepended to libpth. This variable takes care of special
1302 : machines, like the mips. Usually, it should be empty.
1305 : default library list
1307 : some systems want to use only the non-versioned libso:s
1308 ignore_versioned_solibs=''
1309 : set usethreads on the Configure command line to enable threads.
1310 usereentrant='undef'
1311 : full support for void wanted by default
1314 : Possible local include directories to search.
1315 : Set locincpth to "" in a hint file to defeat local include searches.
1316 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1317 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1319 : no include file wanted by default
1322 : Enable -DEBUGGING and -DDEBUGGING from the command line
1329 : set useposix=false in your hint file to disable the POSIX extension.
1331 : set useopcode=false in your hint file to disable the Opcode extension.
1334 ccflags_uselargefiles=''
1335 ldflags_uselargefiles=''
1336 libswanted_uselargefiles=''
1337 : set usemultiplicity on the Configure command line to enable multiplicity.
1338 : set usesocks on the Configure command line to enable socks.
1339 : List of libraries we want.
1340 : If anyone needs extra -lxxx, put those in a hint file.
1341 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1342 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1343 : We probably want to search /usr/shlib before most other libraries.
1344 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1345 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1346 glibpth="/usr/shlib $glibpth"
1347 : Do not use vfork unless overridden by a hint file.
1350 : Find the basic shell for Bourne shell scripts
1354 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1357 if test -f "$xxx"; then
1360 : Build up a list and do a single loop so we can 'break' out.
1361 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1362 for xxx in sh bash ksh pdksh ash; do
1364 try="$try ${p}/${xxx}"
1368 if test -f "$xxx"; then
1371 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1374 elif test -f "$xxx.exe"; then
1385 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1387 Usually it's in /bin/sh. How did you even get this far?
1388 Please contact me (Perl Maintainers) at perlbug@perl.org and
1389 we'll try to straighten this all out.
1395 : see if sh knows # comments
1396 if `$sh -c '#' >/dev/null 2>&1`; then
1400 test -f $xcat$_exe || xcat=/usr/bin/cat
1401 if test ! -f $xcat$_exe; then
1402 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1403 if test -f $p/cat$_exe; then
1408 if test ! -f $xcat$_exe; then
1409 echo "Can't find cat anywhere!"
1413 echo "#!$xcat" >sharp
1416 ./sharp > today 2>/dev/null
1417 if test -s today; then
1420 echo "#! $xcat" > sharp
1423 ./sharp > today 2>/dev/null
1424 if test -s today; then
1432 echo "Your $sh doesn't grok # comments--I will strip them later on."
1435 echo "exec grep -v '^[ ]*#'" >spitshell
1437 $eunicefix spitshell
1438 spitshell=`pwd`/spitshell
1440 echo "I presume that if # doesn't work, #! won't work either!"
1445 : figure out how to guarantee sh startup
1447 '') startsh=${sharpbang}${sh} ;;
1459 : echo "Yup, it does."
1461 echo "Hmm... '$startsh' does not guarantee sh startup..."
1462 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1466 : Save command line options in file UU/cmdline.opt for later use in
1467 : generating config.sh.
1468 cat > cmdline.opt <<EOSH
1469 : Configure command line arguments.
1478 cat >>cmdline.opt <<EOSH
1479 config_arg$argn='$arg'
1481 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1484 arg_exp=`cat cmdl.opt`
1485 args_exp="$args_exp$args_sep'$arg_exp'"
1486 argn=`expr $argn + 1`
1491 : produce awk script to parse command line options
1492 cat >options.awk <<'EOF'
1494 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1496 len = length(optstr);
1497 for (i = 1; i <= len; i++) {
1498 c = substr(optstr, i, 1);
1499 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1510 if (substr(str, 1, 1) != "-") {
1511 printf("'%s'\n", str);
1515 for (i = 2; i <= len; i++) {
1516 c = substr(str, i, 1);
1518 printf("-%s\n", substr(str, i));
1524 printf("'%s'\n", substr(str, i + 1));
1537 : process the command line options
1538 set X `for arg in "$@"; do echo "X$arg"; done |
1539 sed -e s/X// | awk -f options.awk`
1544 : set up default values
1554 rm -f optdef.sh posthint.sh
1555 cat >optdef.sh <<EOS
1561 while test $# -gt 0; do
1563 -d) shift; fastread=yes;;
1564 -e) shift; alldone=cont;;
1568 if test -r "$1"; then
1571 echo "$me: cannot read config file $1." >&2
1577 -h) shift; error=true;;
1578 -r) shift; reuseval=true;;
1579 -s) shift; silent=true; realsilent=true;;
1580 -E) shift; alldone=exit;;
1581 -K) shift; knowitall=true;;
1582 -O) shift; override=true;;
1583 -S) shift; silent=true; extractsh=true;;
1588 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1589 echo "$me: ignoring -D $1" >&2
1592 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1593 *) echo "$1='define'" >> optdef.sh;;
1600 *=) echo "$1" >> optdef.sh;;
1602 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1603 echo "$me: ignoring -U $1" >&2
1605 *) echo "$1='undef'" >> optdef.sh;;
1616 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1620 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1621 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1627 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1628 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1629 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1630 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1631 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1632 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1638 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1640 echo "$yyy=''" >> posthint.sh ;;
1645 echo "$yyy='$zzz'" >> posthint.sh ;;
1647 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1649 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1654 echo "$yyy=$zzz" >> posthint.sh ;;
1655 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1659 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1662 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1670 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1671 [-U symbol] [-U symbol=] [-A command:symbol...]
1672 -d : use defaults for all answers.
1673 -e : go on without questioning past the production of config.sh.
1674 -f : specify an alternate default configuration file.
1675 -h : print this help message and exit (with an error status).
1676 -r : reuse C symbols value if possible (skips costly nm extraction).
1677 -s : silent mode, only echoes questions and essential information.
1678 -D : define symbol to have some value:
1679 -D symbol symbol gets the value 'define'
1680 -D symbol=value symbol gets the value 'value'
1681 common used examples (see INSTALL for more info):
1682 -Duse64bitint use 64bit integers
1683 -Duse64bitall use 64bit integers and pointers
1684 -Dusethreads use thread support
1685 -Dinc_version_list=none do not include older perl trees in @INC
1686 -DEBUGGING=none DEBUGGING options
1687 -Dcc=gcc choose your compiler
1688 -Dprefix=/opt/perl5 choose your destination
1689 -E : stop at the end of questions, after having produced config.sh.
1690 -K : do not use unless you know what you are doing.
1691 -O : let -D and -U override definitions from loaded configuration file.
1692 -S : perform variable substitutions on all .SH files (can mix with -f)
1693 -U : undefine symbol:
1694 -U symbol symbol gets the value 'undef'
1695 -U symbol= symbol gets completely empty
1697 -A : manipulate symbol after the platform specific hints have been applied:
1698 -A append:symbol=value append value to symbol
1699 -A symbol=value like append:, but with a separating space
1700 -A define:symbol=value define symbol to have value
1701 -A clear:symbol define symbol to be ''
1702 -A define:symbol define symbol to be 'define'
1703 -A eval:symbol=value define symbol to be eval of value
1704 -A prepend:symbol=value prepend value to symbol
1705 -A undef:symbol define symbol to be 'undef'
1706 -A undef:symbol= define symbol to be ''
1707 e.g.: -A prepend:libswanted='cl pthread '
1708 -A ccflags=-DSOME_MACRO
1709 -V : print version number and exit (with a zero status).
1716 case "$fastread$alldone" in
1719 case "$extractsh" in
1722 if test ! -t 0; then
1723 echo "Say 'sh Configure', not 'sh <Configure'"
1733 true) exec 1>/dev/null;;
1736 : run the defines and the undefines, if any, but leave the file out there...
1739 : create the posthint manipulation script and leave the file out there...
1744 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1745 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1746 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1747 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1748 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1751 : Some greps do not return status, grrr.
1752 echo "grimblepritz" >grimble
1753 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1755 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1761 : the following should work in any shell
1765 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1766 cat >contains <<'EOSS'
1767 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1772 : Find the path to the source tree
1775 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1779 *) src=`cd ../$src && pwd` ;;
1792 if test -f $rsrc/Configure && \
1793 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1795 : found it, so we are ok.
1798 for src in . .. ../.. ../../.. ../../../..; do
1799 if test -f ../$src/Configure && \
1800 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1811 Sorry, I can't seem to locate the source dir for $package. Please start
1812 Configure with an explicit path -- i.e. /some/path/Configure.
1820 echo "Sources for $package found in \"$src\"." >&4
1824 : script used to extract .SH files with variable substitutions
1825 cat >extract <<'EOS'
1827 echo "Doing variable substitutions on .SH files..."
1828 if test -f MANIFEST; then
1829 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1831 echo "(Looking for .SH files under the source directory.)"
1832 set x `(cd "$src"; find . -name "*.SH" -print)`
1836 0) set x `(cd "$src"; echo *.SH)`; shift;;
1838 if test ! -f "$src/$1"; then
1844 while test $name; do
1845 if test ! -d "$name"; then
1846 create="$name $create";
1847 name=`echo $name | sed -e "s|^[^/]*$||"`;
1848 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1853 for file in $create; do
1862 dir=`expr X$file : 'X\(.*\)/'`
1863 file=`expr X$file : 'X.*/\(.*\)'`
1864 (cd "$dir" && . ./$file)
1874 dir=`expr X$file : 'X\(.*\)/'`
1875 file=`expr X$file : 'X.*/\(.*\)'`
1876 (set x $dir; shift; eval $mkdir_p)
1877 sh <"$src/$dir/$file"
1886 if test -f "$src/config_h.SH"; then
1887 if test ! -f config.h; then
1888 : oops, they left it out of MANIFEST, probably, so do it anyway.
1889 . "$src/config_h.SH"
1894 : extract files and exit if asked to do so
1895 case "$extractsh" in
1897 case "$realsilent" in
1901 case "$config_sh" in
1902 '') config_sh='config.sh';;
1905 echo "Fetching answers from $config_sh..."
1908 test "$override" && . ./optdef.sh
1912 echo "Extraction done."
1917 : Eunice requires " " instead of "", can you believe it
1920 echo "Beginning of configuration questions for $package."
1922 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1924 : first determine how to suppress newline on echo command
1926 echo "Checking echo to see how to suppress newlines..."
1927 (echo "hi there\c" ; echo " ") >.echotmp
1928 if $contains c .echotmp >/dev/null 2>&1 ; then
1939 echo $n "The star should be here-->$c"
1943 : Now test for existence of everything in MANIFEST
1945 if test -f "$rsrc/MANIFEST"; then
1946 echo "First let's make sure your kit is complete. Checking..." >&4
1947 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1948 (split -l 50 2>/dev/null || split -50)
1951 for filelist in x??; do
1952 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1953 >/dev/null 2>>"$tmppwd/missing")
1955 if test -s missing; then
1959 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1961 You have the option of continuing the configuration process, despite the
1962 distinct possibility that your kit is damaged, by typing 'y'es. If you
1963 do, don't blame me if something goes wrong. I advise you to type 'n'o
1964 and contact the author (perlbug@perl.org).
1967 echo $n "Continue? [n] $c" >&4
1971 echo "Continuing..." >&4
1975 echo "ABORTING..." >&4
1980 echo "Looks good..."
1983 echo "There is no MANIFEST file. I hope your kit is complete !"
1987 : Find the appropriate value for a newline for tr
1989 if test -n "$DJGPP"; then
1992 if test X"$trnl" = X; then
1993 case "`echo foo|tr '\n' x 2>/dev/null`" in
1997 if test X"$trnl" = X; then
1998 case "`echo foo|tr '\012' x 2>/dev/null`" in
1999 foox) trnl='\012' ;;
2002 if test X"$trnl" = X; then
2003 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2004 fooxy) trnl='\n\r' ;;
2007 if test X"$trnl" = X; then
2010 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2016 : compute the number of columns on the terminal for proper question formatting
2021 : set up the echo used in my read
2022 myecho="case \"\$xxxm\" in
2023 '') echo $n \"\$rp $c\" >&4;;
2025 '') echo $n \"[\$xxxm] $c\";;
2027 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2029 echo $n \"[\$xxxm] $c\" >&4
2031 echo $n \"\$rp [\$xxxm] $c\" >&4
2037 : now set up to do reads with possible shell escape and default assignment
2043 case "\$fastread" in
2044 yes) case "\$dflt" in
2047 case "\$silent-\$rp" in
2052 *) case "\$silent" in
2053 true) case "\$rp" in
2058 while expr "X\$ans" : "X!" >/dev/null; do
2062 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2070 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2079 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2084 echo "(OK, I'll run with -d after this question.)" >&4
2087 echo "*** Sorry, \$1 not supported yet." >&4
2097 echo "*** Substitution done -- please confirm."
2099 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2104 echo "*** Error -- try again."
2111 case "\$ans\$xxxm\$nostick" in
2123 : create .config dir to save info across Configure sessions
2124 test -d ../.config || mkdir ../.config
2125 cat >../.config/README <<EOF
2126 This directory created by Configure to save information that should
2127 persist across sessions for $package.
2129 You may safely delete it if you wish.
2132 : See if we are using a devel version and want that
2133 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2135 $define|true|[yY]*) ;;
2136 *) case "$xversion" in
2139 *** WHOA THERE!!! ***
2141 This is an UNSTABLE DEVELOPMENT release.
2142 The version of this $package distribution is $xversion, that is, odd,
2143 (as opposed to even) and that signifies a development release.
2144 If you want a maintenance release, you want an even-numbered version.
2146 Do ***NOT*** install this into production use.
2147 Data corruption and crashes are possible.
2149 It is most seriously suggested that you do not continue any further
2150 unless you want to help in developing and debugging Perl.
2152 If you *still* want to build perl, you can answer 'y' now,
2153 or pass -Dusedevel to Configure.
2156 rp='Do you really want to continue?'
2160 [yY]) echo >&4 "Okay, continuing."
2161 usedevel="$define" ;;
2162 *) echo >&4 "Okay, bye."
2172 case "$versiononly" in
2173 '') versiononly="$define" ;;
2175 case "$installusrbinperl" in
2176 '') installusrbinperl="$undef" ;;
2181 : general instructions
2184 user=`(logname) 2>/dev/null`
2186 '') user=`whoami 2>&1`;;
2188 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2191 rp='Would you like to see the instructions?'
2202 This installation shell script will examine your system and ask you questions
2203 to determine how the perl5 package should be installed. If you get
2204 stuck on a question, you may use a ! shell escape to start a subshell or
2205 execute a command. Many of the questions will have default answers in square
2206 brackets; typing carriage return will give you the default.
2208 On some of the questions which ask for file or directory names you are allowed
2209 to use the ~name construct to specify the login directory belonging to "name",
2210 even if you don't have a shell which knows about that. Questions where this is
2211 allowed will be marked "(~name ok)".
2215 dflt='Type carriage return to continue'
2219 The prompter used in this script allows you to use shell variables and
2220 backticks in your answers. You may use $1, $2, etc... to refer to the words
2221 in the default answer, as if the default line was a set of arguments given to a
2222 script shell. This means you may also use $* to repeat the whole default line,
2223 so you do not have to re-type everything to add something to the default.
2225 Everytime there is a substitution, you will have to confirm. If there is an
2226 error (e.g. an unmatched backtick), the default answer will remain unchanged
2227 and you will be prompted again.
2229 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2230 the questions and use the computed defaults (or the previous answers if there
2231 was already a config.sh file). Type 'Configure -h' for a list of options.
2232 You may also start interactively and then answer '& -d' at any prompt to turn
2233 on the non-interactive behaviour for the remainder of the execution.
2239 Much effort has been expended to ensure that this shell script will run on any
2240 Unix system. If despite that it blows up on yours, your best bet is to edit
2241 Configure and run it again. If you can't run Configure for some reason,
2242 you'll have to generate a config.sh file by hand. Whatever problems you
2243 have, let me (perlbug@perl.org) know how I blew it.
2245 This installation script affects things in two ways:
2247 1) it may do direct variable substitutions on some of the files included
2249 2) it builds a config.h file for inclusion in C programs. You may edit
2250 any of these files as the need arises after running this script.
2252 If you make a mistake on a question, there is no easy way to back up to it
2253 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2254 files. Configure will offer to let you do this before it runs the SH files.
2257 dflt='Type carriage return to continue'
2259 case "$firsttime" in
2260 true) echo $user >>../.config/instruct;;
2264 : find out where common programs are
2266 echo "Locating common programs..." >&4
2279 if test -d \$dir/\$thing; then
2285 for thisthing in \$dir/\$thing; do
2286 : just loop through to pick last item
2288 if test -f \$thisthing; then
2291 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2294 elif test -f \$dir/\$thing.exe; then
2295 if test -n "$DJGPP"; then
2296 echo \$dir/\$thing.exe
2297 elif test "$eunicefix" != ":"; then
2298 : on Eunice apparently
2350 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2351 pth="$pth /lib /usr/lib"
2352 for file in $loclist; do
2356 if test -f "$xxx"; then
2359 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2360 xxx=`./loc $file $file $pth`
2363 '') xxx=`./loc $file $file $pth`;;
2364 *) xxx=`./loc $xxx $xxx $pth`;;
2366 eval $file=$xxx$_exe
2370 echo $file is in $xxx.
2373 echo $file is in $xxx.
2376 echo "I don't know where '$file' is, and my life depends on it." >&4
2377 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2383 echo "Don't worry if any of the following aren't found..."
2385 for file in $trylist; do
2389 if test -f "$xxx"; then
2392 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2393 xxx=`./loc $file $file $pth`
2396 '') xxx=`./loc $file $file $pth`;;
2397 *) xxx=`./loc $xxx $xxx $pth`;;
2399 eval $file=$xxx$_exe
2403 echo $file is in $xxx.
2406 echo $file is in $xxx.
2409 echo "I don't see $file out there, $say."
2416 echo "Substituting grep for egrep."
2423 echo "Substituting cp for ln."
2432 echo "I can't find make or gmake, and my life depends on it." >&4
2433 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2441 *) # We can't have osname yet.
2442 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2443 # Assume that gmake, if found, is definitely GNU make
2444 # and prefer it over the system make.
2445 echo "Substituting gmake for make."
2453 echo "Hopefully test is built into your sh."
2456 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2457 echo "Using the test built into your sh."
2465 echo "Hopefully echo is built into your sh."
2470 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2471 $echo $n "hi there$c" >foo1
2472 echo $n "hi there$c" >foo2
2473 if cmp foo1 foo2 >/dev/null 2>&1; then
2474 echo "They are compatible. In fact, they may be identical."
2481 They are not compatible! You are probably running ksh on a non-USG system.
2482 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2483 have echo built in and we may have to run some Bourne shell scripts. That
2484 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2487 $echo $n "The star should be here-->$c"
2494 # This question was auctioned at YAPC::Europe-2007 in Vienna
2495 # I never promised you could answer it. I only auctioned the question.
2497 The following message is sponsored by
2499 Dresden.pm<--The stars should be here.
2501 Dear Perl user, system administrator or package
2502 maintainer, the Perl community sends greetings to
2503 you. Do you (emblematical) greet back [Y/n]? n
2507 : Check what type of C compiler we use
2511 cat <<'EOSC' >>trygcc
2516 int main(int argc, char *argv[]) {
2520 if $cc -o try $ccflags $ldflags try.c; then
2523 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2529 # Skip this test because it gives a false match on output like:
2530 # ./trygcc: line 23: cc: command not found
2531 # case "`$cc -v -c try.c 2>&1`" in
2532 # *gcc*) trygcc=no ;;
2534 if $test X"$trygcc" = Xyes; then
2535 if gcc -o try -c try.c; then
2537 echo "You seem to have a working gcc, though." >&4
2538 # Switching compilers may undo the work of hints files.
2539 # The most common problem is -D_REENTRANT for threads.
2540 # This heuristic catches that case, but gets false positives
2541 # if -Dusethreads was not actually specified. Better to
2542 # bail out here with a useful message than fail
2543 # mysteriously later. Should we perhaps just try to
2544 # re-invoke Configure -Dcc=gcc config_args ?
2545 if $test -f usethreads.cbu; then
2548 *** However, any setting of the C compiler flags (e.g. for thread support)
2549 *** will be lost. It may be necessary for you to restart Configure and
2550 *** add -Dcc=gcc to your Configure command line.
2553 rp="Would you like to go ahead and try gcc anyway?"
2556 rp="Would you like to use it?"
2559 if $test -f myread; then
2562 if $test -f UU/myread; then
2565 echo "Cannot find myread, sorry. Aborting." >&2
2570 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2583 cat <<'EOSC' >>checkcc
2588 int main(int argc, char *argv[]) {
2592 if $cc -o try $ccflags $ldflags try.c; then
2595 if $test X"$despair" = Xyes; then
2596 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2599 You need to find a working C compiler.
2600 Either (purchase and) install the C compiler supplied by your OS vendor,
2601 or for a free C compiler try http://gcc.gnu.org/
2602 I cannot continue any further, aborting.
2611 : determine whether symbolic links are supported
2614 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2615 echo "Symbolic links are supported." >&4
2618 echo "Symbolic links are NOT supported." >&4
2623 : determine whether symbolic links are supported
2627 echo "Checking how to test for symbolic links..." >&4
2629 if $test "X$issymlink" = X; then
2631 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2632 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2634 if test $? = 0; then
2637 echo "Your builtin 'test -h' may be broken." >&4
2640 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2643 if test -f "$p/$test"; then
2652 echo "Trying external '$test -h'." >&4
2653 issymlink="$test -h"
2654 if $test ! -h sym >/dev/null 2>&1; then
2655 echo "External '$test -h' is broken, too." >&4
2663 if $test "X$issymlink" = X; then
2664 if $test -L sym 2>/dev/null; then
2665 issymlink="$test -L"
2666 echo "The builtin '$test -L' worked." >&4
2669 if $test "X$issymlink" != X; then
2670 echo "You can test for symbolic links with '$issymlink'." >&4
2672 echo "I do not know how you can test for symbolic links." >&4
2676 *) echo "No symbolic links, so not testing for their testing..." >&4
2681 : Make symlinks util
2682 case "$mksymlinks" in
2685 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2688 *) case "$lns:$issymlink" in
2689 *"ln"*" -s:"*"test -"?)
2690 echo "Creating the symbolic links..." >&4
2691 echo "(First creating the subdirectories...)" >&4
2693 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2695 test -z "$directory" && break
2699 if test ! -d t/base; then
2700 echo "Failed to create the subdirectories. Aborting." >&4
2703 echo "(Then creating the symlinks...)" >&4
2704 awk '{print $1}' $src/MANIFEST | while true; do
2706 test -z "$filename" && break
2707 if test -f $filename; then
2708 if $issymlink $filename; then
2712 if test -f $filename; then
2713 echo "$filename already exists, not symlinking."
2715 ln -s $src/$filename $filename
2719 if test ! -f t/base/lex.t; then
2720 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2725 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2733 : Check for Cross-Compilation
2734 case "$usecrosscompile" in
2736 $echo "Cross-compiling..."
2739 *-*-gcc) # A cross-compiling gcc, probably.
2740 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2742 # leave out ld, choosing it is more complex
2744 ranlib=$targetarch-ranlib
2745 $echo 'extern int foo;' > try.c
2746 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2748 if $test $# -gt 0; then
2750 incpth="`$echo $incpth|$sed 's/^ //'`"
2751 echo "Guessing incpth '$incpth'." >&4
2753 j="`$echo $i|$sed 's,/include$,/lib,'`"
2754 if $test -d $j; then
2758 libpth="`$echo $libpth|$sed 's/^ //'`"
2759 echo "Guessing libpth '$libpth'." >&4
2764 case "$targetarch" in
2765 '') echo "Targetarch not defined." >&4; croak=y ;;
2766 *) echo "Using targetarch $targetarch." >&4 ;;
2769 '') echo "Incpth not defined." >&4; croak=y ;;
2770 *) echo "Using incpth '$incpth'." >&4 ;;
2773 '') echo "Libpth not defined." >&4; croak=y ;;
2774 *) echo "Using libpth '$libpth'." >&4 ;;
2777 '') for i in $incpth; do
2778 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2780 echo "Guessing usrinc $usrinc." >&4
2785 '') echo "Usrinc not defined." >&4; croak=y ;;
2788 *) echo "Using usrinc $usrinc." >&4 ;;
2790 case "$targethost" in
2791 '') echo "Targethost not defined." >&4; croak=y ;;
2792 *) echo "Using targethost $targethost." >&4
2797 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2800 /*) run=$src/Cross/run
2801 targetmkdir=$src/Cross/mkdir
2803 from=$src/Cross/from
2805 *) pwd=`$test -f ../Configure & cd ..; pwd`
2807 targetmkdir=$pwd/Cross/mkdir
2809 from=$pwd/Cross/from
2812 case "$targetrun" in
2813 '') targetrun=ssh ;;
2818 case "$targetfrom" in
2819 '') targetfrom=scp ;;
2823 from=$from-$targetfrom
2824 case "$targetdir" in
2826 echo "Guessing targetdir $targetdir." >&4
2829 case "$targetuser" in
2831 echo "Guessing targetuser $targetuser." >&4
2834 case "$targetfrom" in
2838 case "$targetrun" in
2850 '') cwd=$targetdir ;;
2854 if $test ! -f \$exe.xok; then
2858 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2861 *) echo "Unknown targetrun '$targetrun'" >&4
2865 case "$targetmkdir" in
2867 cat >$targetmkdir <<EOF
2869 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2871 $chmod a+rx $targetmkdir
2873 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2885 $targetmkdir \`dirname \$f\`
2886 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2889 $targetmkdir $targetdir/\`dirname \$f\`
2890 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2903 $mkdir -p $targetdir/\`dirname \$f\`
2904 $cp \$f $targetdir/\$f || exit 1
2907 $targetmkdir $targetdir/\`dirname \$f\`
2908 $cp \$f $targetdir/\$f || exit 1
2915 *) echo "Unknown targetto '$targetto'" >&4
2919 case "$targetfrom" in
2926 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2931 cp) cat >$from <<EOF
2936 cp $targetdir/\$f . || exit 1
2941 *) echo "Unknown targetfrom '$targetfrom'" >&4
2945 if $test ! -f $run; then
2946 echo "Target 'run' script '$run' not found." >&4
2950 if $test ! -f $to; then
2951 echo "Target 'to' script '$to' not found." >&4
2955 if $test ! -f $from; then
2956 echo "Target 'from' script '$from' not found." >&4
2960 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2964 Using '$run' for remote execution,
2965 and '$from' and '$to'
2966 for remote file transfer.
2972 usecrosscompile='undef'
2977 : see whether [:lower:] and [:upper:] are supported character classes
2979 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2981 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2985 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2986 # (0xd9 and 0xe2), therefore that is a nice testing point.
2987 if test "X$up" = X -o "X$low" = X; then
2988 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2994 if test "X$up" = X -o "X$low" = X; then
2995 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3001 if test "X$up" = X -o "X$low" = X; then
3002 case "`echo RS | od -x 2>/dev/null`" in
3004 echo "Hey, this might be EBCDIC." >&4
3005 if test "X$up" = X -o "X$low" = X; then
3006 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3007 rs) up='[A-IJ-RS-Z]'
3012 if test "X$up" = X -o "X$low" = X; then
3013 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3023 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3025 echo "Using $up and $low to convert case." >&4
3028 echo "I don't know how to translate letters from upper to lower case." >&4
3029 echo "Your tr is not acting any way I know of." >&4
3033 : set up the translation script tr, must be called with ./tr of course
3037 '[A-Z][a-z]') exec $tr '$up' '$low';;
3038 '[a-z][A-Z]') exec $tr '$low' '$up';;
3045 : Try to determine whether config.sh was made on this system
3046 case "$config_sh" in
3048 myuname=`$uname -a 2>/dev/null`
3049 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3050 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3051 # because the A-Z/a-z are not consecutive.
3052 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3053 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3054 newmyuname="$myuname"
3056 case "$knowitall" in
3058 if test -f ../config.sh; then
3059 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3060 eval "`grep myuname= ../config.sh`"
3062 if test "X$myuname" = "X$newmyuname"; then
3070 : Get old answers from old config file if Configure was run on the
3071 : same system, otherwise use the hints.
3074 if test -f config.sh; then
3076 rp="I see a config.sh file. Shall I use it to set the defaults?"
3079 n*|N*) echo "OK, I'll ignore it."
3080 mv config.sh config.sh.old
3081 myuname="$newmyuname"
3083 *) echo "Fetching default answers from your old config.sh file..." >&4
3091 : Older versions did not always set $sh. Catch re-use of such
3101 if test ! -f config.sh; then
3104 First time through, eh? I have some defaults handy for some systems
3105 that need some extra help getting the Configure answers right:
3108 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3110 : Half the following guesses are probably wrong... If you have better
3111 : tests or hints, please send them to perlbug@perl.org
3112 : The metaconfig authors would also appreciate a copy...
3113 $test -f /irix && osname=irix
3114 $test -f /xenix && osname=sco_xenix
3115 $test -f /dynix && osname=dynix
3116 $test -f /dnix && osname=dnix
3117 $test -f /lynx.os && osname=lynxos
3118 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3119 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3120 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3121 $test -f /bin/mips && /bin/mips && osname=mips
3122 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3123 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3124 $test -d /usr/apollo/bin && osname=apollo
3125 $test -f /etc/saf/_sactab && osname=svr4
3126 $test -d /usr/include/minix && osname=minix
3127 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3128 if $test -d /MachTen -o -d /MachTen_Folder; then
3130 if $test -x /sbin/version; then
3131 osvers=`/sbin/version | $awk '{print $2}' |
3132 $sed -e 's/[A-Za-z]$//'`
3133 elif $test -x /usr/etc/version; then
3134 osvers=`/usr/etc/version | $awk '{print $2}' |
3135 $sed -e 's/[A-Za-z]$//'`
3141 $test -f /sys/posix.dll &&
3142 $test -f /usr/bin/what &&
3143 set X `/usr/bin/what /sys/posix.dll` &&
3144 $test "$3" = UWIN &&
3148 if $test -f $uname; then
3156 umips) osname=umips ;;
3159 [23]100) osname=mips ;;
3160 next*) osname=next ;;
3162 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3163 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3166 elif $test -f /etc/kconfig; then
3168 if test "$lns" = "$ln -s"; then
3170 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3172 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3179 if test -n "$DJGPP"; then
3188 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3190 # oslevel can fail with:
3191 # oslevel: Unable to acquire lock.
3192 *not\ found) osvers="$4"."$3" ;;
3193 '<3240'|'<>3240') osvers=3.2.0 ;;
3194 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3195 '=3250'|'>3250') osvers=3.2.5 ;;
3199 bsd386) osname=bsd386
3202 cygwin*) osname=cygwin
3205 *dc.osx) osname=dcosx
3211 domainos) osname=apollo
3217 dragonfly) osname=dragonfly
3220 dynixptx*) osname=dynixptx
3221 osvers=`echo "$4"|sed 's/^v//'`
3223 freebsd) osname=freebsd
3225 genix) osname=genix ;;
3229 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3245 netbsd*) osname=netbsd
3248 news-os) osvers="$3"
3250 4*) osname=newsos4 ;;
3254 next*) osname=next ;;
3255 nonstop-ux) osname=nonstopux ;;
3256 openbsd) osname=openbsd
3262 POSIX-BC | posix-bc ) osname=posix-bc
3265 powerux | power_ux | powermax_os | powermaxos | \
3266 powerunix | power_unix) osname=powerux
3272 solaris) osname=solaris
3274 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3281 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3285 titanos) osname=titanos
3294 ultrix) osname=ultrix
3297 osf1|mls+) case "$5" in
3300 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3303 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3306 hp*) osname=hp_osf1 ;;
3307 mips) osname=mips_osf1 ;;
3310 # UnixWare 7.1.2 is known as Open UNIX 8
3311 openunix|unixware) osname=svr5
3319 $2) case "$osname" in
3323 : svr4.x or possibly later
3333 if test -f /stand/boot ; then
3334 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3335 if test -n "$INITPROG" -a -f "$INITPROG"; then
3336 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3337 if test -n "$isesix"; then
3345 *) if test -f /etc/systemid; then
3347 set `echo $3 | $sed 's/\./ /g'` $4
3348 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3350 elif $test -f $src/hints/sco_$1_$2.sh; then
3352 elif $test -f $src/hints/sco_$1.sh; then
3357 '') : Still unknown. Probably a generic Sys V.
3366 *) case "$osname" in
3367 '') : Still unknown. Probably a generic BSD.
3375 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3376 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3377 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3380 $rm -f UU/kernel.what
3381 elif test -d c:/. -o -n "$is_os2" ; then
3388 case "$targetarch" in
3391 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3396 : Now look for a hint file osname_osvers, unless one has been
3397 : specified already.
3400 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3401 : Also try without trailing minor version numbers.
3402 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3403 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3404 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3405 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3408 *) case "$osvers" in
3411 *) if $test -f $src/hints/$file.sh ; then
3413 elif $test -f $src/hints/$xfile.sh ; then
3415 elif $test -f $src/hints/$xxfile.sh ; then
3417 elif $test -f $src/hints/$xxxfile.sh ; then
3419 elif $test -f $src/hints/$xxxxfile.sh ; then
3421 elif $test -f "$src/hints/${osname}.sh" ; then
3430 if $test -f Policy.sh ; then
3433 none) dflt="Policy" ;;
3434 *) dflt="Policy $dflt" ;;
3439 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3443 if $test -f Policy.sh ; then
3446 There's also a Policy hint file available, which should make the
3447 site-specific (policy) questions easier to answer.
3454 You may give one or more space-separated answers, or "none" if appropriate.
3455 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3456 previous run of Configure, you may specify it as well as or instead of
3457 OS-specific hints. If hints are provided for your OS, you should use them:
3458 although Perl can probably be built without hints on many platforms, using
3459 hints often improve performance and may enable features that Configure can't
3460 set up on its own. If there are no hints that match your OS, specify "none";
3461 DO NOT give a wrong version or a wrong OS.
3465 rp="Which of these apply, if any?"
3468 for file in $tans; do
3469 if $test X$file = XPolicy -a -f Policy.sh; then
3471 $cat Policy.sh >> UU/config.sh
3472 elif $test -f $src/hints/$file.sh; then
3473 . $src/hints/$file.sh
3474 $cat $src/hints/$file.sh >> UU/config.sh
3475 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3478 : Give one chance to correct a possible typo.
3479 echo "$file.sh does not exist"
3481 rp="hint to use instead?"
3483 for file in $ans; do
3484 if $test -f "$src/hints/$file.sh"; then
3485 . $src/hints/$file.sh
3486 $cat $src/hints/$file.sh >> UU/config.sh
3487 elif $test X$ans = X -o X$ans = Xnone ; then
3490 echo "$file.sh does not exist -- ignored."
3497 : Remember our hint file for later.
3498 if $test -f "$src/hints/$file.sh" ; then
3508 echo "Fetching default answers from $config_sh..." >&4
3512 cp $config_sh config.sh 2>/dev/null
3522 test "$override" && . ./optdef.sh
3524 : Restore computed paths
3525 for file in $loclist $trylist; do
3526 eval $file="\$_$file"
3531 Configure uses the operating system name and version to set some defaults.
3532 The default value is probably right if the name rings a bell. Otherwise,
3533 since spelling matters for me, either accept the default or answer "none"
3540 ''|' '|none) dflt=none ;;
3541 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3544 *) dflt="$osname" ;;
3546 rp="Operating system name?"
3550 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3556 ''|' '|none) dflt=none ;;
3557 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3558 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3560 ''|' ') dflt=none ;;
3565 *) dflt="$osvers" ;;
3567 rp="Operating system version?"
3577 : who configured the system
3578 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3581 cf_by=`(logname) 2>/dev/null`
3584 cf_by=`(whoami) 2>/dev/null`
3586 "") cf_by=unknown ;;
3591 : decide how portable to be. Allow command line overrides.
3592 case "$d_portable" in
3594 *) d_portable="$define" ;;
3597 : set up shell script to do ~ expansion
3603 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3606 if $test -f /bin/csh; then
3607 /bin/csh -f -c "glob \$1"
3612 name=\`$expr x\$1 : '..\([^/]*\)'\`
3613 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3614 if $test ! -d "\$dir"; then
3616 echo "\$me: can't locate home directory for: \$name" >&2
3621 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3637 : now set up to get a file name
3641 cat <<'EOSC' >>getfile
3657 : getfile will accept an answer from the comma-separated list
3658 : enclosed in parentheses even if it does not meet other criteria.
3659 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3660 fn=`echo $fn | sed 's/(.*)//'`
3666 loc_file=`expr $fn : '.*:\(.*\)'`
3667 fn=`expr $fn : '\(.*\):.*'`
3675 */*) fullpath=true;;
3684 *e*) exp_file=true;;
3687 *p*) nopath_ok=true;;
3692 *d*) type='Directory';;
3693 *l*) type='Locate';;
3698 Locate) what='File';;
3703 case "$d_portable" in
3711 while test "$type"; do
3716 true) rp="$rp (~name ok)";;
3719 if test -f UU/getfile.ok && \
3720 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3739 value=`UU/filexp $ans`
3742 if test "$ans" != "$value"; then
3743 echo "(That expands to $value on this system.)"
3757 /*) value="$ansexp" ;;
3758 [a-zA-Z]:/*) value="$ansexp" ;;
3763 echo "I shall only accept a full path name, as in /bin/ls." >&4
3764 echo "Use a ! shell escape if you wish to check pathnames." >&4
3767 echo "Please give a full path name, starting with slash." >&4
3770 echo "Note that using ~name is ok provided it expands well." >&4
3783 for fp in $gfpth; do
3784 if test "X$fp" = X.; then
3789 if test -f "$pf"; then
3791 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3793 echo "($value is not a plain file, but that's ok.)"
3796 if test X"$type" = X; then
3803 for fp in $gfpth; do
3804 if test "X$fp" = X.; then
3809 direxp="$fp/$ansexp"
3811 if test -d "$direxp"; then
3819 if test -d "$ansexp"; then
3820 echo "(Looking for $loc_file in directory $value.)"
3821 value="$value/$loc_file"
3822 ansexp="$ansexp/$loc_file"
3824 if test -f "$ansexp"; then
3827 case "$nopath_ok" in
3828 true) case "$value" in
3830 *) echo "Assuming $value will be in people's path."
3846 if test "$fastread" = yes; then
3851 rp="$what $value doesn't exist. Use that name anyway?"
3870 test "X$gfpthkeep" != Xy && gfpth=""
3873 : determine root of directory hierarchy where package will be installed.
3876 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3879 dflt=`echo "$prefix" | sed 's/.$//'`
3887 By default, $package will be installed in $dflt/bin, manual pages
3888 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3889 installation directories. Typically this is something like /usr/local.
3890 If you wish to have binaries under /usr/bin but other parts of the
3891 installation under /usr/local, that's ok: you will be prompted
3892 separately for each of the installation directories, the prefix being
3893 only used to set the defaults.
3897 rp='Installation prefix to use?'
3905 *) oldprefix="$prefix";;
3912 : allow them to override the AFS root
3915 *) afsroot=$afsroot ;;
3921 $define|true) afs=true ;;
3922 $undef|false) afs=false ;;
3923 *) if $test -d $afsroot; then
3931 echo "AFS may be running... I'll be extra cautious then..." >&4
3933 echo "AFS does not seem to be running..." >&4
3936 : determine installation prefix for where package is to be installed.
3940 Since you are running AFS, I need to distinguish the directory in which
3941 files will reside from the directory in which they are installed (and from
3942 which they are presumably copied to the former directory by occult means).
3945 case "$installprefix" in
3946 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3947 *) dflt="$installprefix";;
3952 In some special cases, particularly when building $package for distribution,
3953 it is convenient to distinguish the directory in which files should be
3954 installed from the directory ($prefix) in which they will
3955 eventually reside. For most users, these two directories are the same.
3958 case "$installprefix" in
3960 *) dflt=$installprefix;;
3964 rp='What installation prefix should I use for installing files?'
3966 installprefix="$ans"
3967 installprefixexp="$ansexp"
3969 : Perform the prefixexp/installprefixexp correction if necessary
3970 cat <<EOS >installprefix
3973 cat <<'EOSC' >>installprefix
3974 : Change installation prefix, if necessary.
3975 if $test X"$prefix" != X"$installprefix"; then
3976 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3978 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3981 chmod +x installprefix
3982 $eunicefix installprefix
3984 : Set variables such as privlib and privlibexp from the output of ./getfile
3985 : performing the prefixexp/installprefixexp correction if necessary.
3986 cat <<EOS >setprefixvar
3989 cat <<'EOSC' >>setprefixvar
3990 eval "${prefixvar}=\"\$ans\""
3991 eval "${prefixvar}exp=\"\$ansexp\""
3994 chmod +x setprefixvar
3995 $eunicefix setprefixvar
3997 : set up the script used to warn in case of inconsistency
4006 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4008 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4009 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4014 echo "*** WHOA THERE!!! ***" >&4
4015 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4018 rp=" Keep the $hint value?"
4021 y) td=$was; tu=$was;;
4025 : function used to set '$1' to '$val'
4026 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4028 $define$undef) . ./whoa; eval "$var=\$td";;
4029 $undef$define) . ./whoa; eval "$var=\$tu";;
4030 *) eval "$var=$val";;
4033 : Check is we will use socks
4035 $define|true|[yY]*) dflt='y';;
4040 Perl can be built to use the SOCKS proxy protocol library. To do so,
4041 Configure must be run with -Dusesocks. If you use SOCKS you also need
4042 to use the PerlIO abstraction layer, this will be implicitly selected.
4044 If this doesn't make any sense to you, just accept the default '$dflt'.
4046 rp='Build Perl for SOCKS?'
4049 y|Y) val="$define" ;;
4056 $define|true|[yY]*) useperlio="$define";;
4059 : Check if we want perlio
4060 case "$useperlio" in
4061 $define|true|[yY]*|'') dflt='y';;
4066 Previous version of $package used the standard IO mechanisms as
4067 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4068 alternate IO mechanisms via the PerlIO abstraction layer, but the
4069 stdio mechanism is still available if needed. The abstraction layer
4070 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4071 Using PerlIO with sfio may cause problems with some extension modules.
4073 If this doesn't make any sense to you, just accept the default '$dflt'.
4075 rp='Use the PerlIO abstraction layer?'
4082 echo "Ok, doing things the stdio way."
4091 case "$useperlio" in
4092 $define|true|[yY]*) ;;
4095 You are using the SOCKS proxy protocol library which means that you
4096 should also use the PerlIO layer. You may be headed for trouble.
4104 : get the patchlevel
4106 echo "Getting the current patchlevel..." >&4
4107 if $test -r $rsrc/patchlevel.h;then
4108 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4109 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4110 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4111 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4112 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4113 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4114 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4123 $echo "(You do not have patchlevel.h. Eek.)"
4125 if $test -r $rsrc/.patch ; then
4126 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4127 perl_patchlevel=`cat $rsrc/.patch`
4130 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4131 version_patchlevel_string="version $patchlevel subversion $subversion"
4132 case "$perl_patchlevel" in
4134 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4137 $echo "(You have $package $version_patchlevel_string.)"
4141 : XXX Should be a Configure test for double-dots in filenames.
4142 version=`echo $revision $patchlevel $subversion | \
4143 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4144 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4145 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4148 version=`echo $revision $patchlevel $subversion | \
4149 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4150 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4151 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4154 : Special case the 5.005_xx maintenance series, which used 5.005
4155 : without any subversion label as a subdirectory in $sitelib
4156 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4157 api_versionstring='5.005'
4160 : Do we want threads support and if so, what type
4161 case "$usethreads" in
4162 $define|true|[yY]*) dflt='y';;
4163 *) # Catch case where user specified ithreads or 5005threads but
4164 # forgot -Dusethreads (A.D. 4/2002)
4165 case "$useithreads$use5005threads" in
4167 case "$useperlio" in
4168 "$define") dflt='y' ;;
4178 Perl can be built to take advantage of threads on some systems.
4179 To do so, Configure can be run with -Dusethreads.
4181 Note that Perl built with threading support runs slightly slower
4182 and uses more memory than plain Perl. The current implementation
4183 is believed to be stable, but it is fairly new, and so should be
4184 treated with caution.
4186 If this doesn't make any sense to you, just accept the default '$dflt'.
4188 rp='Build a threading Perl?'
4191 y|Y) val="$define" ;;
4197 if $test $patchlevel -lt 9; then
4198 case "$usethreads" in
4202 Since release 5.6, Perl has had two different threading implementations,
4203 the newer interpreter-based version (ithreads) with one interpreter per
4204 thread, and the older 5.005 version (5005threads).
4205 The 5005threads version is effectively unmaintained and will probably be
4206 removed in Perl 5.10, so there should be no need to build a Perl using it
4207 unless needed for backwards compatibility with some existing 5.005threads
4211 : Default to ithreads unless overridden on command line or with
4214 case "$use5005threads" in
4215 $define|true|[yY]*) dflt='n';;
4217 case "$useithreads" in
4218 $undef|false|[nN]*) dflt='n';;
4220 rp='Use the newer interpreter-based ithreads?'
4223 y|Y) val="$define" ;;
4228 : Now set use5005threads to the opposite value.
4229 case "$useithreads" in
4230 $define) val="$undef" ;;
4237 useithreads="$undef"
4238 use5005threads="$undef"
4242 case "$useithreads$use5005threads" in
4246 You cannot have both the ithreads and the 5.005 threads enabled
4247 at the same time. Disabling the 5.005 threads since they are
4248 much less stable than the ithreads.
4251 use5005threads="$undef"
4256 : perl-5.9.x and later
4258 if test X"$usethreads" = "X$define"; then
4259 case "$use5005threads" in
4263 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4270 use5005threads="$undef"
4271 useithreads="$usethreads"
4274 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4277 *** To build with ithreads you must also use the PerlIO layer.
4278 *** Cannot continue, aborting.
4284 case "$d_oldpthreads" in
4285 '') : Configure tests would be welcome here. For now, assume undef.
4287 *) val="$d_oldpthreads" ;;
4293 : Look for a hint-file generated 'call-back-unit'. If the
4294 : user has specified that a threading perl is to be built,
4295 : we may need to set or change some other defaults.
4296 if $test -f usethreads.cbu; then
4297 echo "Your platform has some specific hints regarding threaded builds, using them..."
4300 case "$usethreads" in
4301 "$define"|true|[yY]*)
4303 (Your platform does not have any specific hints for threaded builds.
4304 Assuming POSIX threads, then.)
4310 : Check if multiplicity is required
4313 Perl can be built so that multiple Perl interpreters can coexist
4314 within the same Perl executable.
4317 case "$useithreads" in
4320 This multiple interpreter support is required for interpreter-based threads.
4324 *) case "$usemultiplicity" in
4325 $define|true|[yY]*) dflt='y';;
4329 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4330 rp='Build Perl for multiplicity?'
4333 y|Y) val="$define" ;;
4341 : Check if morebits is requested
4342 case "$usemorebits" in
4343 "$define"|true|[yY]*)
4344 use64bitint="$define"
4345 uselongdouble="$define"
4346 usemorebits="$define"
4348 *) usemorebits="$undef"
4352 : Determine the C compiler to be used
4358 rp="Use which C compiler?"
4362 : See whether they have no cc but they do have gcc
4364 if $test -f cc.cbu; then
4369 : make some quick guesses about what we are up against
4371 $echo $n "Hmm... $c"
4381 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4382 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4384 echo "Looks kind of like an OSF/1 system, but we'll see..."
4386 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4387 xxx=`./loc addbib blurfl $pth`
4388 if $test -f $xxx; then
4389 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4393 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4394 echo "Looks kind of like an extended USG system, but we'll see..."
4396 echo "Looks kind of like a USG system, but we'll see..."
4400 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4401 echo "Looks kind of like a BSD system, but we'll see..."
4405 echo "Looks kind of like a Version 7 system, but we'll see..."
4408 case "$eunicefix" in
4411 There is, however, a strange, musty smell in the air that reminds me of
4412 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4416 : it so happens the Eunice I know will not run shell scripts in Unix format
4420 echo "Congratulations. You aren't running Eunice."
4424 : Detect OS2. The p_ variable is set above in the Head.U unit.
4425 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4426 : semicolon as a patch separator
4431 I have the feeling something is not exactly right, however...don't tell me...
4432 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4433 (Or you may be running DOS with DJGPP.)
4438 if test -f /xenix; then
4439 echo "Actually, this looks more like a XENIX system..."
4444 echo "It's not Xenix..."
4449 if test -f /venix; then
4450 echo "Actually, this looks more like a VENIX system..."
4457 echo "Nor is it Venix..."
4460 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4461 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4464 : Check if we are using GNU gcc and what its version is
4466 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4470 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4472 printf("%s\n", __VERSION__);
4474 printf("%s\n", "1");
4480 if $cc -o try $ccflags $ldflags try.c; then
4481 gccversion=`$run ./try`
4482 case "$gccversion" in
4483 '') echo "You are not using GNU cc." ;;
4484 *) echo "You are using GNU cc $gccversion."
4490 echo "*** WHOA THERE!!! ***" >&4
4491 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4492 case "$knowitall" in
4494 echo " You'd better start hunting for one and let me know about it." >&4
4500 case "$gccversion" in
4501 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4503 case "$gccversion" in
4504 '') gccosandvers='' ;;
4505 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4506 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4508 case "$gccosandvers" in
4509 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4510 $osname$osvers) ;; # looking good
4511 $osname*) cat <<EOM >&4
4513 *** WHOA THERE!!! ***
4515 Your gcc has not been compiled for the exact release of
4516 your operating system ($gccosandvers versus $osname$osvers).
4518 In general it is a good idea to keep gcc synchronized with
4519 the operating system because otherwise serious problems
4520 may ensue when trying to compile software, like Perl.
4522 I'm trying to be optimistic here, though, and will continue.
4523 If later during the configuration and build icky compilation
4524 problems appear (headerfile conflicts being the most common
4525 manifestation), I suggest reinstalling the gcc to match
4526 your operating system release.
4530 *) gccosandvers='' ;; # failed to parse, better be silent
4538 # gcc 3.* complain about adding -Idirectories that they already know about,
4539 # so we will take those off from locincpth.
4540 case "$gccversion" in
4542 echo "main(){}">try.c
4543 for incdir in $locincpth; do
4544 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4545 grep '^c[cp]p*[01]: warning: changing search order '`
4546 if test "X$warn" != X; then
4547 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4553 : What should the include directory be ?
4555 $echo $n "Hmm... $c"
4559 if $test -f /bin/mips && /bin/mips; then
4560 echo "Looks like a MIPS system..."
4561 $cat >usr.c <<'EOCP'
4562 #ifdef SYSTYPE_BSD43
4566 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4567 dflt='/bsd43/usr/include'
4571 mips_type='System V'
4573 $rm -f usr.c usr.out
4574 echo "and you're compiling with the $mips_type compiler and libraries."
4578 echo "Doesn't look like a MIPS system."
4588 case "$xxx_prompt" in
4591 rp='Where are the include files you want to use?'
4599 : see how we invoke the C preprocessor
4601 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4602 cat <<'EOT' >testcpp.c
4608 if test ! -f cppstdin; then
4609 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4610 # AIX cc -E doesn't show the absolute headerfile
4611 # locations but we'll cheat by using the -M flag.
4612 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
4614 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4617 echo "Keeping your $hint cppstdin wrapper."
4620 wrapper=`pwd`/cppstdin
4624 if $test "X$cppstdin" != "X" && \
4625 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4626 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4628 echo "You used to use $cppstdin $cppminus so we'll use that again."
4630 '') echo "But let's see if we can live without a wrapper..." ;;
4632 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4633 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4635 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4638 echo "(However, $cpprun $cpplast does not work, let's see...)"
4646 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4653 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4654 $cc -E <testcpp.c >testcpp.out 2>&1; \
4655 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4656 echo "Yup, it does."
4659 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4660 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4661 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4662 echo "Yup, it does."
4665 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4666 $cc -P <testcpp.c >testcpp.out 2>&1; \
4667 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4668 echo "Yipee, that works!"
4671 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4672 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4673 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4674 echo "At long last!"
4677 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4678 $cpp <testcpp.c >testcpp.out 2>&1; \
4679 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4683 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4684 $cpp - <testcpp.c >testcpp.out 2>&1; \
4685 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4686 echo "Hooray, it works! I was beginning to wonder."
4689 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4690 $wrapper <testcpp.c >testcpp.out 2>&1; \
4691 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4697 rp="No dice. I can't find a C preprocessor. Name one:"
4701 $x_cpp <testcpp.c >testcpp.out 2>&1
4702 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4703 echo "OK, that will do." >&4
4705 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4720 echo "Perhaps can we force $cc -E using a wrapper..."
4721 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4722 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4728 echo "Nope, we'll have to live without it..."
4742 "$wrapper"|'cppstdin') ;;
4743 *) $rm -f $wrapper;;
4745 $rm -f testcpp.c testcpp.out
4747 : Set private lib path
4750 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4755 '') dlist="$loclibpth $plibpth $glibpth";;
4756 *) dlist="$libpth";;
4759 : Now check and see which directories actually exist, avoiding duplicates
4763 if $test -d $xxx; then
4766 *) libpth="$libpth $xxx";;
4772 Some systems have incompatible or broken versions of libraries. Among
4773 the directories listed in the question below, please remove any you
4774 know not to be holding relevant libraries, and add any that are needed.
4775 Say "none" for none.
4786 rp="Directories to use for library searches?"
4793 : compute shared library extension
4796 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4806 On some systems, shared libraries may be available. Answer 'none' if
4807 you want to suppress searching of shared libraries for the remainder
4808 of this configuration.
4811 rp='What is the file extension used for shared libraries?'
4815 : Define several unixisms.
4816 : Hints files or command line option can be used to override them.
4817 : The convoluted testing is in case hints files set either the old
4820 '') case "$exe_ext" in
4822 *) _exe="$exe_ext" ;;
4827 '') case "$lib_ext" in
4834 '') case "$obj_ext" in
4841 '') case "$path_sep" in
4852 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4854 : Which makefile gets called first. This is used by make depend.
4855 case "$firstmakefile" in
4856 '') firstmakefile='makefile';;
4859 : Check for uselongdouble support
4861 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4864 case "$uselongdouble" in
4865 $define|true|[yY]*) dflt='y';;
4870 Perl can be built to take advantage of long doubles which
4871 (if available) may give more accuracy and range for floating point numbers.
4873 If this doesn't make any sense to you, just accept the default '$dflt'.
4875 rp='Try to use long doubles if available?'
4878 y|Y) val="$define" ;;
4884 case "$uselongdouble" in
4885 true|[yY]*) uselongdouble="$define" ;;
4888 : Look for a hint-file generated 'call-back-unit'. If the
4889 : user has specified that long doubles should be used,
4890 : we may need to set or change some other defaults.
4891 if $test -f uselongdouble.cbu; then
4892 echo "Your platform has some specific hints regarding long doubles, using them..."
4893 . ./uselongdouble.cbu
4895 case "$uselongdouble" in
4898 (Your platform does not have any specific hints for long doubles.)
4904 : Looking for optional libraries
4906 echo "Checking for optional libraries..." >&4
4911 case "$libswanted" in
4912 '') libswanted='c_s';;
4915 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4921 for thisdir in $libpth $xlibpth; do
4922 test -d $thisdir && libspath="$libspath $thisdir"
4924 for thislib in $libswanted; do
4925 for thisdir in $libspath; do
4927 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4928 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4929 $test -f "$xxx" && eval $libscheck
4930 $test -f "$xxx" && libstyle=shared
4932 if test ! -f "$xxx"; then
4933 xxx=$thisdir/lib$thislib.$so
4934 $test -f "$xxx" && eval $libscheck
4935 $test -f "$xxx" && libstyle=shared
4937 if test ! -f "$xxx"; then
4938 xxx=$thisdir/lib$thislib$_a
4939 $test -f "$xxx" && eval $libscheck
4940 $test -f "$xxx" && libstyle=static
4942 if test ! -f "$xxx"; then
4943 xxx=$thisdir/$thislib$_a
4944 $test -f "$xxx" && eval $libscheck
4945 $test -f "$xxx" && libstyle=static
4947 if test ! -f "$xxx"; then
4948 xxx=$thisdir/lib${thislib}_s$_a
4949 $test -f "$xxx" && eval $libscheck
4950 $test -f "$xxx" && libstyle=static
4951 $test -f "$xxx" && thislib=${thislib}_s
4953 if test ! -f "$xxx"; then
4954 xxx=$thisdir/Slib$thislib$_a
4955 $test -f "$xxx" && eval $libscheck
4956 $test -f "$xxx" && libstyle=static
4958 if $test -f "$xxx"; then
4960 shared) echo "Found -l$thislib (shared)." ;;
4961 static) echo "Found -l$thislib." ;;
4962 *) echo "Found -l$thislib ($libstyle)." ;;
4966 *) dflt="$dflt -l$thislib"
4967 libsfound="$libsfound $xxx"
4969 libsfiles="$libsfiles $yyy"
4970 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4971 case " $libsdirs " in
4973 *) libsdirs="$libsdirs $yyy" ;;
4980 if $test ! -f "$xxx"; then
4981 echo "No -l$thislib."
4992 ' '|'') dflt='none';;
4997 In order to compile $package on your machine, a number of libraries
4998 are usually needed. Include any other special libraries here as well.
4999 Say "none" for none. The default list is almost always right.
5003 rp="What libraries to use?"
5010 : determine optimization, if desired, or use for debug flag also
5012 ' '|$undef) dflt='none';;
5014 *) dflt="$optimize";;
5018 By default, $package compiles with the -O flag to use the optimizer.
5019 Alternately, you might want to use the symbolic debugger, which uses
5020 the -g flag (on traditional Unix systems). Either flag can be
5021 specified here. To use neither flag, specify the word "none".
5024 rp="What optimizer/debugger flag should be used?"
5028 'none') optimize=" ";;
5031 : Check what DEBUGGING is required from the command line
5032 : -DEBUGGING or -DDEBUGGING or
5033 : -DEBUGGING=both = -g + -DDEBUGGING
5034 : -DEBUGGING=-g or -Doptimize=-g = -g
5035 : -DEBUGGING=none or -UDEBUGGING =
5036 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5039 *) DEBUGGING=$EBUGGING ;;
5042 case "$DEBUGGING" in
5046 *) optimize="$optimize -g" ;;
5050 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5058 case "$DEBUGGING" in
5059 both|$define) dflt='-DDEBUGGING'
5062 : argument order is deliberate, as the flag will start with - which set could
5063 : think is an option
5064 checkccflag='check=$1; flag=$2; callback=$3;
5066 echo "Checking if your compiler accepts $flag" 2>&1;
5067 echo "int main(void) { return 0; }" > gcctest.c;
5068 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5069 echo "Yes, it does." 2>&1;
5070 if $test -s gcctest.out ; then
5071 echo "But your platform does not like it:";
5076 echo "Leaving current flags $ccflags alone." 2>&1
5078 *) dflt="$dflt $flag";
5084 echo "Nope, it does not, but that is ok." 2>&1;
5088 : We will not override a previous value, but we might want to
5089 : augment a hint file
5091 default|recommended)
5092 case "$gccversion" in
5093 1*) dflt="$dflt -fpcc-struct-return" ;;
5095 case "$optimize:$DEBUGGING" in
5096 *-g*:old) dflt="$dflt -DDEBUGGING";;
5098 case "$gccversion" in
5099 2*) if $test -d /etc/conf/kconfig.d &&
5100 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5102 # Interactive Systems (ISC) POSIX mode.
5107 case "$gccversion" in
5110 ?*) set strict-aliasing -fno-strict-aliasing
5114 # For gcc, adding -pipe speeds up compilations for some, but apparently
5115 # some assemblers can't read from stdin. (It also slows down compilations
5116 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5117 case "$gccversion" in
5123 # on x86_64 (at least) we require an extra library (libssp) in the
5124 # link command line. This library is not named, so I infer that it is
5125 # an implementation detail that may change. Hence the safest approach
5126 # is to add the flag to the flags passed to the compiler at link time,
5127 # as that way the compiler can do the right implementation dependant
5129 case "$gccversion" in
5130 ?*) set stack-protector -fstack-protector
5137 case "$mips_type" in
5138 *BSD*|'') inclwanted="$locincpth $usrinc";;
5139 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5141 for thisincl in $inclwanted; do
5142 if $test -d $thisincl; then
5143 if $test x$thisincl != x$usrinc; then
5145 *" -I$thisincl "*);;
5146 *) dflt="$dflt -I$thisincl ";;
5152 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5154 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5162 *) dflt="$dflt -D$2";;
5166 set signal.h LANGUAGE_C; eval $inctest
5170 ccflags="$ccflags -DSOCKS"
5175 default|recommended) dflt="$ccflags $dflt" ;;
5176 *) dflt="$ccflags";;
5185 Your C compiler may want other flags. For this question you should include
5186 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5187 but you should NOT include libraries or ld flags like -lwhatever. If you
5188 want $package to honor its debug switch, you should include -DDEBUGGING here.
5189 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5191 To use no flags, specify the word "none".
5197 rp="Any additional cc flags?"
5204 : the following weeds options from ccflags that are of no interest to cpp
5206 '') cppflags="$ccflags" ;;
5207 *) cppflags="$cppflags $ccflags" ;;
5209 case "$gccversion" in
5210 1*) cppflags="$cppflags -D__GNUC__"
5212 case "$mips_type" in
5214 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5220 echo "Let me guess what the preprocessor flags are..." >&4
5234 *) ftry="$previous $flag";;
5236 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5237 >cpp1.out 2>/dev/null && \
5238 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5239 >cpp2.out 2>/dev/null && \
5240 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5241 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5243 cppflags="$cppflags $ftry"
5253 *-*) echo "They appear to be: $cppflags";;
5255 $rm -f cpp.c cpp?.out
5259 : flags used in final linking phase
5261 '') if ./venix; then
5267 *-posix*) dflt="$dflt -posix" ;;
5270 *) dflt="$ldflags";;
5272 # See note above about -fstack-protector
5274 *-fstack-protector*)
5276 *-fstack-protector*) ;; # Don't add it again
5277 *) dflt="$dflt -fstack-protector" ;;
5282 : Try to guess additional flags to pick up local libraries.
5283 for thislibdir in $libpth; do
5284 case " $loclibpth " in
5287 *"-L$thislibdir "*) ;;
5288 *) dflt="$dflt -L$thislibdir" ;;
5300 Your C linker may need flags. For this question you should
5301 include -L/whatever and any other flags used by the C linker, but you
5302 should NOT include libraries like -lwhatever.
5304 Make sure you include the appropriate -L/path flags if your C linker
5305 does not normally search all of the directories you specified above,
5308 To use no flags, specify the word "none".
5312 rp="Any additional ld flags (NOT including libraries)?"
5318 rmlist="$rmlist pdp11"
5322 echo "Checking your choice of C compiler and flags for coherency..." >&4
5323 $cat > try.c <<'EOF'
5325 int main() { printf("Ok\n"); return(0); }
5327 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5329 $cat >try.msg <<'EOM'
5330 I've tried to compile and run the following simple program:
5333 $cat try.c >> try.msg
5335 $cat >> try.msg <<EOM
5342 and I got the following output:
5346 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5347 if $sh -c "$run ./try " >>try.msg 2>&1; then
5351 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5354 cat >> try.msg <<'EOQS'
5355 If $libs contains -lsfio, and sfio is mis-configured, then it
5356 sometimes (apparently) runs and exits with a 0 status, but with no
5357 output! It may have to do with sfio's use of _exit vs. exit.
5360 rp="You have a big problem. Shall I abort Configure"
5367 echo "The program compiled OK, but exited with status $?." >>try.msg
5368 rp="You have a problem. Shall I abort Configure"
5372 echo "I can't compile the test program." >>try.msg
5373 rp="You have a BIG problem. Shall I abort Configure"
5379 case "$knowitall" in
5381 echo "(The supplied flags or libraries might be incorrect.)"
5389 *) echo "Ok. Stopping Configure." >&4
5394 n) echo "OK, that should do.";;
5396 $rm_try gcctest gcctest.out
5398 : define a shorthand compile call
5402 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5403 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5407 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5408 : define a shorthand compile call for compilations that should be ok.
5412 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5414 : determine filename position in cpp output
5416 echo "Computing filename position in cpp output for #include directives..." >&4
5418 vos) testaccess=-e ;;
5421 echo '#include <stdio.h>' > foo.c
5424 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5425 $grep '^[ ]*#.*stdio\.h' | \
5426 while read cline; do
5429 while $test \$# -gt 0; do
5430 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5435 pos=\`expr \$pos + 1\`
5447 *) pos="${fieldn}th";;
5449 echo "Your cpp writes the filename in the $pos field of the line."
5452 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5453 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5456 : locate header file
5461 for usrincdir in $usrinc
5463 if test -f \$usrincdir/\$wanted; then
5464 echo "\$usrincdir/\$wanted"
5468 awkprg='{ print \$$fieldn }'
5469 echo "#include <\$wanted>" > foo\$\$.c
5470 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5471 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5472 while read cline; do
5473 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5475 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5476 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5481 # status = 0: grep returned 0 lines, case statement not executed
5482 # status = 1: headerfile found
5483 # status = 2: while loop executed, no headerfile found
5487 if test \$status -eq 1; then
5494 : define an alternate in-header-list? function
5495 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5496 cont=true; xxf="echo \"<\$1> found.\" >&4";
5497 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5498 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5500 case $# in 4) instead=instead;; *) instead="at last";; esac;
5501 while $test "$cont"; do
5503 var=$2; eval "was=\$$2";
5504 if $test "$xxx" && $test -r "$xxx";
5506 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5509 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5510 set $yyy; shift; shift; yyy=$@;
5511 case $# in 0) cont="";;
5512 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5513 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5514 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5515 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5519 do set $yyy; var=$2; eval "was=\$$2";
5520 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5521 set $yyy; shift; shift; yyy=$@;
5524 : see if stdlib is available
5525 set stdlib.h i_stdlib
5528 : check for lengths of integral types
5532 echo "Checking to see how big your integers are..." >&4
5541 printf("intsize=%d;\n", (int)sizeof(int));
5542 printf("longsize=%d;\n", (int)sizeof(long));
5543 printf("shortsize=%d;\n", (int)sizeof(short));
5548 if eval $compile_ok && $run ./try > /dev/null; then
5550 echo "Your integers are $intsize bytes long."
5551 echo "Your long integers are $longsize bytes long."
5552 echo "Your short integers are $shortsize bytes long."
5556 Help! I can't compile and run the intsize test program: please enlighten me!
5557 (This is probably a misconfiguration in your system or libraries, and
5558 you really ought to fix it. Still, I'll try anyway.)
5562 rp="What is the size of an integer (in bytes)?"
5566 rp="What is the size of a long integer (in bytes)?"
5570 rp="What is the size of a short integer (in bytes)?"
5578 : check for long long
5580 echo "Checking to see if you have long long..." >&4
5581 echo 'int main() { long long x = 7; return 0; }' > try.c
5583 if eval $compile; then
5585 echo "You have long long."
5588 echo "You do not have long long."
5594 : check for length of long long
5595 case "${d_longlong}${longlongsize}" in
5598 echo "Checking to see how big your long longs are..." >&4
5599 $cat >try.c <<'EOCP'
5603 printf("%d\n", (int)sizeof(long long));
5608 if eval $compile_ok; then
5609 longlongsize=`$run ./try`
5610 echo "Your long longs are $longlongsize bytes long."
5614 echo "(I can't seem to compile the test program. Guessing...)"
5615 rp="What is the size of a long long (in bytes)?"
5619 if $test "X$longsize" = "X$longlongsize"; then
5620 echo "(That isn't any different from an ordinary long.)"
5626 : see if inttypes.h is available
5627 : we want a real compile instead of Inhdr because some systems
5628 : have an inttypes.h which includes non-existent headers
5631 #include <inttypes.h>
5633 static int32_t foo32 = 0x12345678;
5637 if eval $compile; then
5638 echo "<inttypes.h> found." >&4
5641 echo "<inttypes.h> NOT found." >&4
5650 echo "Checking to see if you have int64_t..." >&4
5652 #include <sys/types.h>
5653 #$i_inttypes I_INTTYPES
5655 #include <inttypes.h>
5657 int main() { int64_t x = 7; }
5660 if eval $compile; then
5662 echo "You have int64_t."
5665 echo "You do not have int64_t."
5671 : Check if 64bit ints have a quad type
5673 echo "Checking which 64-bit integer type we could use..." >&4
5679 val='"unsigned int"'
5684 *) case "$longsize" in
5688 val='"unsigned long"'
5693 *) case "$d_longlong:$longlongsize" in
5698 val='"unsigned long long"'
5703 *) case "$d_int64_t" in
5722 '') echo "Alas, no 64-bit integer types in sight." >&4
5725 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5730 : Do we want 64bit support
5731 case "$uselonglong" in
5732 "$define"|true|[yY]*)
5735 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5737 use64bitint="$define"
5740 case "$use64bits" in
5741 "$define"|true|[yY]*)
5744 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5746 use64bitint="$define"
5749 case "$use64bitints" in
5750 "$define"|true|[yY]*)
5753 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5755 use64bitint="$define"
5758 case "$use64bitsint" in
5759 "$define"|true|[yY]*)
5762 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5764 use64bitint="$define"
5767 case "$uselonglongs" in
5768 "$define"|true|[yY]*)
5771 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5773 use64bitint="$define"
5776 case "$use64bitsall" in
5777 "$define"|true|[yY]*)
5780 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5782 use64bitall="$define"
5787 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5789 case "$use64bitall" in
5790 "$define"|true|[yY]*) use64bitint="$define" ;;
5796 You have natively 64-bit long integers.
5800 *) case "$use64bitint" in
5801 "$define"|true|[yY]*) dflt='y';;
5810 Perl can be built to take advantage of 64-bit integer types
5811 on some systems. To do so, Configure can be run with -Duse64bitint.
5812 Choosing this option will most probably introduce binary incompatibilities.
5814 If this doesn't make any sense to you, just accept the default '$dflt'.
5815 (The default has been chosen based on your configuration.)
5817 rp='Try to use 64-bit integers, if available?'
5820 [yY]*) val="$define" ;;
5828 case "$use64bitall" in
5829 "$define"|true|[yY]*) dflt='y' ;;
5830 *) case "$longsize" in
5838 You may also choose to try maximal 64-bitness. It means using as much
5839 64-bitness as possible on the platform. This in turn means even more
5840 binary incompatibilities. On the other hand, your platform may not
5841 have any more 64-bitness available than what you already have chosen.
5843 If this doesn't make any sense to you, just accept the default '$dflt'.
5844 (The default has been chosen based on your configuration.)
5846 rp='Try to use maximal 64-bit support, if available?'
5849 [yY]*) val="$define" ;;
5854 case "$use64bitall" in
5856 case "$use64bitint" in
5860 Since you have chosen a maximally 64-bit build, I'm also turning on
5861 the use of 64-bit integers.
5863 use64bitint="$define" ;;
5868 : Look for a hint-file generated 'call-back-unit'. If the
5869 : user has specified that a 64-bit perl is to be built,
5870 : we may need to set or change some other defaults.
5871 if $test -f use64bitint.cbu; then
5872 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5875 case "$use64bitint" in
5876 "$define"|true|[yY]*)
5878 4) case "$archname64" in
5879 '') archname64=64int ;;
5886 : Look for a hint-file generated 'call-back-unit'. If the
5887 : user has specified that a maximally 64-bit perl is to be built,
5888 : we may need to set or change some other defaults.
5889 if $test -f use64bitall.cbu; then
5890 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5893 case "$use64bitall" in
5894 "$define"|true|[yY]*)
5896 4) case "$archname64" in
5897 ''|64int) archname64=64all ;;
5904 case "$d_quad:$use64bitint" in
5908 *** You have chosen to use 64-bit integers,
5909 *** but none can be found.
5910 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5911 *** Cannot continue, aborting.
5918 : check for length of double
5920 case "$doublesize" in
5922 echo "Checking to see how big your double precision numbers are..." >&4
5931 printf("%d\n", (int)sizeof(double));
5936 if eval $compile_ok; then
5937 doublesize=`$run ./try`
5938 echo "Your double is $doublesize bytes long."
5941 echo "(I can't seem to compile the test program. Guessing...)"
5942 rp="What is the size of a double precision number (in bytes)?"
5950 : check for long doubles
5952 echo "Checking to see if you have long double..." >&4
5953 echo 'int main() { long double x = 7.0; }' > try.c
5955 if eval $compile; then
5957 echo "You have long double."
5960 echo "You do not have long double."
5966 : check for length of long double
5967 case "${d_longdbl}${longdblsize}" in
5970 echo "Checking to see how big your long doubles are..." >&4
5971 $cat >try.c <<'EOCP'
5975 printf("%d\n", sizeof(long double));
5980 if eval $compile; then
5981 longdblsize=`$run ./try`
5982 echo "Your long doubles are $longdblsize bytes long."
5986 echo "(I can't seem to compile the test program. Guessing...)" >&4
5987 rp="What is the size of a long double (in bytes)?"
5991 if $test "X$doublesize" = "X$longdblsize"; then
5992 echo "That isn't any different from an ordinary double."
5993 echo "I'll keep your setting anyway, but you may see some"
5994 echo "harmless compilation warnings."
6000 : determine the architecture name
6002 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6003 tarch=`arch`"-$osname"
6004 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6005 if uname -m > tmparch 2>&1 ; then
6006 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6007 -e 's/$/'"-$osname/" tmparch`
6015 case "$myarchname" in
6018 echo "(Your architecture name used to be $myarchname.)"
6022 case "$targetarch" in
6024 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6029 *) dflt="$archname";;
6031 rp='What is your architecture name'
6034 case "$usethreads" in
6036 echo "Threads selected." >&4
6038 *-thread*) echo "...and architecture name already has -thread." >&4
6040 *) archname="$archname-thread"
6041 echo "...setting architecture name to $archname." >&4
6046 case "$usemultiplicity" in
6048 echo "Multiplicity selected." >&4
6050 *-multi*) echo "...and architecture name already has -multi." >&4
6052 *) archname="$archname-multi"
6053 echo "...setting architecture name to $archname." >&4
6058 case "$use64bitint$use64bitall" in
6060 case "$archname64" in
6062 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6065 case "$use64bitint" in
6066 "$define") echo "64 bit integers selected." >&4 ;;
6068 case "$use64bitall" in
6069 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6072 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6074 *) archname="$archname-$archname64"
6075 echo "...setting architecture name to $archname." >&4
6081 case "$uselongdouble" in
6083 echo "Long doubles selected." >&4
6084 case "$longdblsize" in
6086 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6090 *-ld*) echo "...and architecture name already has -ld." >&4
6092 *) archname="$archname-ld"
6093 echo "...setting architecture name to $archname." >&4
6100 case "$useperlio" in
6102 echo "Perlio selected." >&4
6105 echo "Perlio not selected, using stdio." >&4
6107 *-stdio*) echo "...and architecture name already has -stdio." >&4
6109 *) archname="$archname-stdio"
6110 echo "...setting architecture name to $archname." >&4
6115 if $test -f archname.cbu; then
6116 echo "Your platform has some specific hints for architecture name, using them..."
6120 : set the prefixit variable, to compute a suitable default value
6121 prefixit='case "$3" in
6123 case "$oldprefix" in
6124 "") eval "$1=\"\$$2\"";;
6131 ""|" ") eval "$1=\"\$$2\"";;
6137 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6139 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6140 /*-$oldprefix/*|\~*-$oldprefix/*)
6141 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6142 *) eval "$1=\"\$$2\"";;
6146 : determine installation style
6147 : For now, try to deduce it from prefix unless it is already set.
6148 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6149 case "$installstyle" in
6150 '') case "$prefix" in
6151 *perl*) dflt='lib';;
6152 *) dflt='lib/perl5' ;;
6155 *) dflt="$installstyle" ;;
6157 : Probably not worth prompting for this since we prompt for all
6158 : the directories individually, and the prompt would be too long and
6162 : determine where public executables go
6167 rp='Pathname where the public executables will reside?'
6169 if $test "X$ansexp" != "X$binexp"; then
6173 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6174 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6175 : this via initialinstalllocation
6178 case "$userelocatableinc" in
6179 $define|true|[yY]*) dflt='y' ;;
6184 Would you like to build Perl so that the installation is relocatable, so that
6185 library paths in @INC are determined relative to the path of the perl binary?
6186 This is not advised for system Perl installs, or if you need to run setid
6187 scripts or scripts under taint mode.
6189 If this doesn't make any sense to you, just accept the default '$dflt'.
6191 rp='Use relocatable @INC?'
6194 y|Y) val="$define" ;;
6197 set userelocatableinc
6200 initialinstalllocation="$binexp"
6201 : Default prefix is now "up one level from where the binaries are"
6202 case "$userelocatableinc" in
6208 installprefixexp=".../.."
6212 : determine where private library files go
6213 : Usual default is /usr/local/lib/perl5/$version.
6214 : Also allow things like /opt/perl/lib/$version, since
6215 : /opt/perl/lib/perl5... would be redundant.
6216 : The default "style" setting is made in installstyle.U
6217 case "$installstyle" in
6218 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6219 *) set dflt privlib lib/$version ;;
6224 There are some auxiliary files for $package that need to be put into a
6225 private library directory that is accessible by everyone.
6230 rp='Pathname where the private library files will reside?'
6235 : set the prefixup variable, to restore leading tilda escape
6236 prefixup='case "$prefixexp" in
6238 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6241 : determine where public architecture dependent libraries go
6244 : privlib default is /usr/local/lib/$package/$version
6245 : archlib default is /usr/local/lib/$package/$version/$archname
6246 : privlib may have an optional trailing /share.
6247 tdflt=`echo $privlib | $sed 's,/share$,,'`
6248 tdflt=$tdflt/$archname
6257 $spackage contains architecture-dependent library files. If you are
6258 sharing libraries in a heterogeneous environment, you might store
6259 these files in a separate location. Otherwise, you can just include
6260 them with the rest of the public library files.
6265 rp='Where do you want to put the public architecture-dependent libraries?'
6269 if $test X"$archlib" = X"$privlib"; then
6275 : see if setuid scripts can be secure
6278 Some kernels have a bug that prevents setuid #! scripts from being
6279 secure. Some sites have disabled setuid #! scripts because of this.
6281 First let's decide if your kernel supports secure setuid #! scripts.
6282 (If setuid #! scripts would be secure but have been disabled anyway,
6283 don't say that they are secure if asked.)
6288 if $test -d /dev/fd; then
6289 echo "#!$ls" >reflect
6290 chmod +x,u+s reflect
6291 ./reflect >flect 2>&1
6292 if $contains "/dev/fd" flect >/dev/null; then
6293 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6297 If you are not sure if they are secure, I can check but I'll need a
6298 username and password different from the one you are using right now.
6299 If you don't have such a username or don't want me to test, simply
6303 rp='Other username to test security of setuid scripts with?'
6308 case "$d_suidsafe" in
6309 '') echo "I'll assume setuid scripts are *not* secure." >&4
6312 echo "Well, the $hint value is *not* secure." >&4
6314 *) echo "Well, the $hint value *is* secure." >&4
6319 $rm -f reflect flect
6320 echo "#!$ls" >reflect
6321 chmod +x,u+s reflect
6324 echo '"su" will (probably) prompt you for '"$ans's password."
6325 su $ans -c './reflect >flect'
6326 if $contains "/dev/fd" flect >/dev/null; then
6327 echo "Okay, it looks like setuid scripts are secure." >&4
6330 echo "I don't think setuid scripts are secure." >&4
6335 rp='Does your kernel have *secure* setuid scripts?'
6338 [yY]*) val="$define";;
6343 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6344 echo "(That's for file descriptors, not floppy disks.)"
6350 $rm -f reflect flect
6352 : now see if they want to do setuid emulation
6355 case "$d_suidsafe" in
6358 echo "No need to emulate SUID scripts since they are secure here." >&4
6362 Some systems have disabled setuid scripts, especially systems where
6363 setuid scripts cannot be secure. On systems where setuid scripts have
6364 been disabled, the setuid/setgid bits on scripts are currently
6365 useless. It is possible for $package to detect those bits and emulate
6366 setuid/setgid in a secure fashion. This emulation will only work if
6367 setuid scripts have been disabled in your kernel.
6371 "$define") dflt=y ;;
6374 rp="Do you want to do setuid/setgid emulation?"
6377 [yY]*) val="$define";;
6385 : Find perl5.005 or later.
6386 echo "Looking for a previously installed perl5.005 or later... "
6388 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6389 : Check if this perl is recent and can load a simple module
6390 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6393 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6403 '') echo "None found. That's ok.";;
6404 *) echo "Using $perl5." ;;
6407 : Set the siteprefix variables
6410 After $package is installed, you may wish to install various
6411 add-on modules and utilities. Typically, these add-ons will
6412 be installed under $prefix with the rest
6413 of this package. However, you may wish to install such add-ons
6414 elsewhere under a different prefix.
6416 If you do not wish to put everything under a single prefix, that's
6417 ok. You will be prompted for the individual locations; this siteprefix
6418 is only used to suggest the defaults.
6420 The default should be fine for most people.
6424 rp='Installation prefix to use for add-on modules and utilities?'
6425 : XXX Here might be another good place for an installstyle setting.
6426 case "$siteprefix" in
6428 *) dflt=$siteprefix ;;
6431 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6433 case "$siteprefix" in
6437 *) oldsiteprefix="$prefix";;
6442 siteprefixexp="$ansexp"
6444 : determine where site specific libraries go.
6445 : Usual default is /usr/local/lib/perl5/site_perl/$version
6446 : The default "style" setting is made in installstyle.U
6447 : XXX No longer works with Prefixit stuff.
6448 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6450 '') case "$installstyle" in
6451 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6452 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6460 The installation process will create a directory for
6461 site-specific extensions and modules. Most users find it convenient
6462 to place all site-specific files in this directory rather than in the
6463 main distribution directory.
6467 rp='Pathname for the site-specific library files?'
6471 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6473 : Determine list of previous versions to include in @INC
6474 $cat > getverlist <<EOPL
6477 \$api_versionstring = "$api_versionstring";
6478 \$version = "$version";
6479 \$stem = "$sitelib_stem";
6480 \$archname = "$archname";
6482 $cat >> getverlist <<'EOPL'
6483 # The list found is store twice for each entry: the original name, and
6484 # the binary broken down version as pack "sss", so sorting is easy and
6485 # unambiguous. This will work for all versions that have a maximum of
6486 # three digit groups, separate by '.'s or '_'s. Names are extended with
6487 # ".0.0" to ensure at least three elements for the pack.
6488 # -- H.Merijn Brand (m)'06 23-10-2006
6490 # Can't have leading @ because metaconfig interprets it as a command!
6491 ;@inc_version_list=();
6492 # XXX Redo to do opendir/readdir?
6495 ;@candidates = map {
6496 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6502 ($pversion, $aversion, $vsn5005) = map {
6503 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6504 foreach $d (@candidates) {
6505 if ($d->[1] lt $pversion) {
6506 if ($d->[1] ge $aversion) {
6507 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6509 elsif ($d->[1] ge $vsn5005) {
6510 unshift(@inc_version_list, grep { -d } $d->[0]);
6514 # Skip newer version. I.e. don't look in
6515 # 5.7.0 if we're installing 5.6.1.
6519 if (@inc_version_list) {
6520 print join(' ', @inc_version_list);
6523 # Blank space to preserve value for next Configure run.
6528 case "$inc_version_list" in
6529 '') if test -x "$perl5$exe_ext"; then
6530 dflt=`$perl5 getverlist`
6535 $undef) dflt='none' ;;
6536 *) eval dflt=\"$inc_version_list\" ;;
6539 ''|' ') dflt=none ;;
6546 In order to ease the process of upgrading, this version of perl
6547 can be configured to use modules built and installed with earlier
6548 versions of perl that were installed under $prefix. Specify here
6549 the list of earlier versions that this version of perl should check.
6550 If Configure detected no earlier versions of perl installed under
6551 $prefix, then the list will be empty. Answer 'none' to tell perl
6552 to not search earlier versions.
6554 The default should almost always be sensible, so if you're not sure,
6555 just accept the default.
6558 rp='List of earlier versions to include in @INC?'
6561 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6562 *) inc_version_list="$ans" ;;
6564 case "$inc_version_list" in
6566 inc_version_list_init='0'
6567 d_inc_version_list="$undef"
6569 *) inc_version_list_init=`echo $inc_version_list |
6570 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6571 d_inc_version_list="$define"
6576 : see if malloc/malloc.h has to be included
6577 set malloc/malloc.h i_mallocmalloc
6580 : see if this is a malloc.h system
6581 : we want a real compile instead of Inhdr because some systems have a
6582 : malloc.h that just gives a compile error saying to use stdlib.h instead
6587 #$i_mallocmalloc I_MALLOCMALLOC
6588 #ifdef I_MALLOCMALLOC
6589 # include <malloc/malloc.h>
6592 int main () { return 0; }
6595 if eval $compile; then
6596 echo "<malloc.h> found." >&4
6599 echo "<malloc.h> NOT found." >&4
6606 : check for void type
6608 echo "Checking to see how well your C compiler groks the void type..." >&4
6609 case "$voidflags" in
6621 extern void moo(); /* function returning void */
6622 void (*goo)(); /* ptr to func returning void */
6624 void *hue; /* generic ptr */
6637 int main() { sub(); }
6639 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6640 voidflags=$defvoidused
6641 echo "Good. It appears to support void to the level $package wants.">&4
6642 if $contains warning .out >/dev/null 2>&1; then
6643 echo "However, you might get some warnings that look like this:"
6647 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6648 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6649 echo "It supports 1..."
6650 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6651 echo "It also supports 2..."
6652 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6654 echo "And it supports 4 but not 8 definitely."
6656 echo "It doesn't support 4..."
6657 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6659 echo "But it supports 8."
6662 echo "Neither does it support 8."
6666 echo "It does not support 2..."
6667 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6669 echo "But it supports 4 and 8."
6671 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6673 echo "And it supports 4 but has not heard about 8."
6675 echo "However it supports 8 but not 4."
6680 echo "There is no support at all for void."
6685 case "$voidflags" in
6688 Support flag bits are:
6689 1: basic void declarations.
6690 2: arrays of pointers to functions returning void.
6691 4: operations between pointers to and addresses of void functions.
6692 8: generic void pointers.
6695 rp="Your void support flags add up to what?"
6702 : check for length of pointer
6706 echo "Checking to see how big your pointers are..." >&4
6707 if test "$voidflags" -gt 7; then
6708 echo '#define VOID_PTR char *' > try.c
6710 echo '#define VOID_PTR void *' > try.c
6720 printf("%d\n", (int)sizeof(VOID_PTR));
6725 if eval $compile_ok; then
6726 ptrsize=`$run ./try`
6727 echo "Your pointers are $ptrsize bytes long."
6730 echo "(I can't seem to compile the test program. Guessing...)" >&4
6731 rp="What is the size of a pointer (in bytes)?"
6738 case "$use64bitall" in
6739 "$define"|true|[yY]*)
6743 *** You have chosen a maximally 64-bit build,
6744 *** but your pointers are only 4 bytes wide.
6745 *** Please rerun Configure without -Duse64bitall.
6750 *** Since you have quads, you could possibly try with -Duse64bitint.
6755 *** Cannot continue, aborting.
6766 : determine whether to use malloc wrapping
6768 case "$usemallocwrap" in
6769 [yY]*|true|$define) dflt='y' ;;
6770 [nN]*|false|$undef) dflt='n' ;;
6771 *) case "$usedevel" in
6772 [yY]*|true|$define) dflt='y' ;;
6777 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6779 usemallocwrap="$ans"
6782 usemallocwrap="$define" ;;
6784 usemallocwrap="$undef" ;;
6787 : determine which malloc to compile in
6789 case "$usemymalloc" in
6790 [yY]*|true|$define) dflt='y' ;;
6791 [nN]*|false|$undef) dflt='n' ;;
6792 *) case "$ptrsize" in
6798 rp="Do you wish to attempt to use the malloc that comes with $package?"
6804 mallocsrc='malloc.c'
6805 mallocobj="malloc$_o"
6806 d_mymalloc="$define"
6809 : Remove malloc from list of libraries to use
6810 echo "Removing unneeded -lmalloc from library list" >&4
6811 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6814 echo "libs = $libs" >&4
6826 : compute the return types of malloc and free
6828 $cat >malloc.c <<END
6832 #include <sys/types.h>
6846 case "$malloctype" in
6848 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6855 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6859 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6866 echo "Your system uses $freetype free(), it would seem." >&4
6868 : determine where site specific architecture-dependent libraries go.
6869 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6870 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6871 : sitelib may have an optional trailing /share.
6873 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6874 dflt="$dflt/$archname"
6879 set sitearch sitearch none
6883 The installation process will also create a directory for
6884 architecture-dependent site-specific extensions and modules.
6888 rp='Pathname for the site-specific architecture-dependent library files?'
6892 if $test X"$sitearch" = X"$sitelib"; then
6895 d_sitearch="$define"
6898 : Set the vendorprefix variables
6901 The installation process will also create a directory for
6902 vendor-supplied add-ons. Vendors who supply perl with their system
6903 may find it convenient to place all vendor-supplied files in this
6904 directory rather than in the main distribution directory. This will
6905 ease upgrades between binary-compatible maintenance versions of perl.
6907 Of course you may also use these directories in whatever way you see
6908 fit. For example, you might use them to access modules shared over a
6909 company-wide network.
6911 The default answer should be fine for most people.
6912 This causes further questions about vendor add-ons to be skipped
6913 and no vendor-specific directories will be configured for perl.
6916 rp='Do you want to configure vendor-specific add-on directories?'
6917 case "$usevendorprefix" in
6918 define|true|[yY]*) dflt=y ;;
6919 *) : User may have set vendorprefix directly on Configure command line.
6920 case "$vendorprefix" in
6929 rp='Installation prefix to use for vendor-supplied add-ons?'
6930 case "$vendorprefix" in
6932 *) dflt=$vendorprefix ;;
6935 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6937 case "$vendorprefix" in
6941 *) oldvendorprefix="$prefix";;
6945 usevendorprefix="$define"
6947 vendorprefixexp="$ansexp"
6949 *) usevendorprefix="$undef"
6955 : Set the vendorlib variables
6956 case "$vendorprefix" in
6957 '') d_vendorlib="$undef"
6961 *) d_vendorlib="$define"
6962 : determine where vendor-supplied modules go.
6963 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6964 case "$vendorlib" in
6966 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6967 case "$installstyle" in
6968 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6969 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6972 *) dflt="$vendorlib"
6976 rp='Pathname for the vendor-supplied library files?'
6979 vendorlibexp="$ansexp"
6982 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6986 : Set the vendorarch variables
6987 case "$vendorprefix" in
6988 '') d_vendorarch="$undef"
6992 *) d_vendorarch="$define"
6993 : determine where vendor-supplied architecture-dependent libraries go.
6994 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6995 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6996 : vendorlib may have an optional trailing /share.
6997 case "$vendorarch" in
6998 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6999 dflt="$dflt/$archname"
7001 *) dflt="$vendorarch" ;;
7004 rp='Pathname for vendor-supplied architecture-dependent files?'
7007 vendorarchexp="$ansexp"
7010 prefixvar=vendorarch
7013 : Final catch-all directories to search
7016 Lastly, you can have perl look in other directories for extensions and
7017 modules in addition to those already specified.
7018 These directories will be searched after
7022 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7023 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7025 case "$otherlibdirs" in
7026 ''|' ') dflt='none' ;;
7027 *) dflt="$otherlibdirs" ;;
7030 Enter a colon-separated set of extra paths to include in perl's @INC
7031 search path, or enter 'none' for no extra paths.
7035 rp='Colon-separated list of additional directories for perl to search?'
7038 ' '|''|none) otherlibdirs=' ' ;;
7039 *) otherlibdirs="$ans" ;;
7041 case "$otherlibdirs" in
7045 set d_perl_otherlibdirs
7048 : Cruising for prototypes
7050 echo "Checking out function prototypes..." >&4
7051 $cat >prototype.c <<EOCP
7056 int main(int argc, char *argv[]) {
7059 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7060 echo "Your C compiler appears to support function prototypes."
7063 echo "Your C compiler doesn't seem to understand function prototypes."
7070 : Check if ansi2knr is required
7071 case "$prototype" in
7073 *) ansi2knr='ansi2knr'
7078 This version of $package can only be compiled by a compiler that
7079 understands function prototypes. Unfortunately, your C compiler
7081 doesn't seem to understand them. Sorry about that.
7083 If GNU cc is available for your system, perhaps you could try that instead.
7085 Eventually, we hope to support building Perl with pre-ANSI compilers.
7086 If you would like to help in that effort, please contact <perlbug@perl.org>.
7088 Aborting Configure now.
7095 dflt_dtrace='/usr/sbin/dtrace'
7098 Perl can be built to support DTrace on platforms that support it.
7099 DTrace is a diagnosis and performance analysis tool from Sun.
7101 If this doesn't make any sense to you, just accept the default '$dflt'.
7105 case "$usedtrace" in
7111 dflt_dtrace=$usedtrace
7118 rp='Support DTrace if available?'
7121 y|Y) val="$define" ;;
7127 test "X$usedtrace" != "X$define" && break
7130 rp='Where is the dtrace executable?'
7139 if $dtrace -h -s ../perldtrace.d \
7140 -o perldtrace.tmp >/dev/null 2>&1 \
7141 && rm -f perldtrace.tmp
7144 echo "Good: your $dtrace knows about the -h flag."
7148 *** $me: Fatal Error: $dtrace doesn't support -h flag
7150 *** Your installed dtrace doesn't support the -h switch to compile a D
7151 *** program into a C header. Can't continue.
7163 *** $me: Fatal Error: $dtrace not found.
7170 echo "*** $dtrace was not found."
7176 : See if we want extra modules installed
7183 Perl can be built with extra modules or bundles of modules which
7184 will be fetched from the CPAN and installed alongside Perl.
7186 Notice that you will need access to the CPAN; either via the Internet,
7187 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7188 be asked later to configure the CPAN.pm module which will in turn do
7189 the installation of the rest of the extra modules or bundles.)
7191 Notice also that if the modules require any external software such as
7192 libraries and headers (the libz library and the zlib.h header for the
7193 Compress::Zlib module, for example) you MUST have any such software
7194 already installed, this configuration process will NOT install such
7197 If this doesn't make any sense to you, just accept the default '$dflt'.
7199 rp='Install any extra modules (y or n)?'
7205 Please list any extra modules or bundles to be installed from CPAN,
7206 with spaces between the names. The names can be in any format the
7207 'install' command of CPAN.pm will understand. (Answer 'none',
7208 without the quotes, to install no extra modules or bundles.)
7218 $rm -f ../extras.lst
7220 *) echo "(Saving the list of extras for later...)"
7221 echo "$extras" > ../extras.lst
7229 : determine where html pages for programs go
7230 set html1dir html1dir none
7234 If you wish to install html files for programs in $spackage, indicate
7235 the appropriate directory here. To skip installing html files,
7239 ''|none|$undef|' ') dflt=none ;;
7240 *) dflt=$html1dir ;;
7243 rp="Directory for the main $spackage html pages?"
7247 : Use ' ' for none so value is preserved next time through Configure
7248 $test X"$html1dir" = "X" && html1dir=' '
7250 : determine where html pages for libraries and modules go
7251 set html3dir html3dir none
7255 If you wish to install html files for modules associated with $spackage,
7256 indicate the appropriate directory here. To skip installing html files,
7259 : There is no obvious default. If they have specified html1dir, then
7260 : try to key off that, possibly changing .../html1 into .../html3.
7262 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7263 *) dflt=$html3dir ;;
7266 rp="Directory for the $spackage module html pages?"
7270 : Use ' ' for none so value is preserved next time through Configure
7271 $test X"$html3dir" = "X" && html3dir=' '
7273 : determine whether to install perl also as /usr/bin/perl
7276 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7278 Many scripts expect perl to be installed as /usr/bin/perl.
7280 If you want to, I can install the perl you are about to compile
7281 as /usr/bin/perl (in addition to $bin/perl).
7283 if test -f /usr/bin/perl; then
7286 However, please note that because you already have a /usr/bin/perl,
7287 overwriting that with a new Perl would very probably cause problems.
7288 Therefore I'm assuming you don't want to do that (unless you insist).
7291 case "$installusrbinperl" in
7292 "$define"|[yY]*) dflt='y';;
7298 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7301 case "$installusrbinperl" in
7302 "$undef"|[nN]*) dflt='n';;
7306 rp="Do you want to install perl as /usr/bin/perl?"
7309 [yY]*) val="$define";;
7315 set installusrbinperl
7318 : Check if we are using the GNU C library
7320 echo "Checking for GNU C Library..." >&4
7322 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7323 alone are insufficient to distinguish different versions, such as
7324 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7325 libc version 2.1.0. A. Dougherty, June 3, 2002.
7331 # ifdef __GLIBC_MINOR__
7332 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7333 # include <gnu/libc-version.h>
7334 printf("%s\n", gnu_get_libc_version());
7336 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7339 printf("%d\n", __GLIBC__);
7348 if eval $compile_ok && $run ./try > glibc.ver; then
7350 gnulibc_version=`$cat glibc.ver`
7351 echo "You are using the GNU C Library version $gnulibc_version"
7355 echo "You are not using the GNU C Library"
7361 : see if nm is to be used to determine whether a symbol is defined or not
7365 case "$d_gnulibc" in
7368 echo "nm probably won't work on the GNU C Library." >&4
7374 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7376 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7377 echo "'nm' won't be sufficient on this sytem." >&4
7383 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7384 if $test $dflt -gt 20; then
7394 true|$define) dflt=y;;
7401 I can use $nm to extract the symbols from your C libraries. This
7402 is a time consuming task which may generate huge output on the disk (up
7403 to 3 megabytes) but that should make the symbols extraction faster. The
7404 alternative is to skip the 'nm' extraction part and to compile a small
7405 test program instead to determine whether each symbol is present. If
7406 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7407 this may be the best solution.
7409 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7412 rp="Shall I use $nm to extract C symbols from the libraries?"
7415 [Nn]*) usenm=false;;
7424 : nm options which may be necessary
7426 '') if $test -f /mach_boot; then
7428 elif $test -d /usr/ccs/lib; then
7429 nm_opt='-p' # Solaris (and SunOS?)
7430 elif $test -f /dgux; then
7432 elif $test -f /lib64/rld; then
7433 nm_opt='-p' # 64-bit Irix
7439 : nm options which may be necessary for shared libraries but illegal
7440 : for archive libraries. Thank you, Linux.
7441 case "$nm_so_opt" in
7442 '') case "$myuname" in
7444 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7445 nm_so_opt='--dynamic'
7452 : Figure out where the libc is located
7455 : get list of predefined functions in a handy place
7460 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7466 *) for thislib in $libs; do
7469 : Handle C library specially below.
7472 thislib=`echo $thislib | $sed -e 's/^-l//'`
7473 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7475 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7477 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7479 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7481 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7483 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7485 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7490 libnames="$libnames $try"
7492 *) libnames="$libnames $thislib" ;;
7501 for xxx in $libpth; do
7502 $test -r $1 || set $xxx/libc.$so
7503 : The messy sed command sorts on library version numbers.
7505 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7506 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7508 s/[0-9][0-9]*/0000&/g
7509 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7512 $sort | $sed -e 's/^.* //'`
7515 $test -r $1 || set /usr/ccs/lib/libc.$so
7516 $test -r $1 || set /lib/libsys_s$_a
7522 if $test -r "$1"; then
7523 echo "Your (shared) C library seems to be in $1."
7525 elif $test -r /lib/libc && $test -r /lib/clib; then
7526 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7528 libc='/lib/clib /lib/libc'
7529 if $test -r /lib/syslib; then
7530 echo "(Your math library is in /lib/syslib.)"
7531 libc="$libc /lib/syslib"
7533 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7534 echo "Your C library seems to be in $libc, as you said before."
7535 elif $test -r $incpath/usr/lib/libc$_a; then
7536 libc=$incpath/usr/lib/libc$_a;
7537 echo "Your C library seems to be in $libc. That's fine."
7538 elif $test -r /lib/libc$_a; then
7540 echo "Your C library seems to be in $libc. You're normal."
7542 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7544 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7545 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7546 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7548 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7550 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7553 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7555 if $test -r "$tans"; then
7556 echo "Your C library seems to be in $tans, of all places."
7562 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7566 If the guess above is wrong (which it might be if you're using a strange
7567 compiler, or your machine supports multiple models), you can override it here.
7572 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7574 I can't seem to find your C library. I've looked in the following places:
7577 $sed 's/^/ /' libpath
7580 None of these seems to contain your C library. I need to get its name...
7585 rp='Where is your C library?'
7590 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7591 set X `cat libnames`
7594 case $# in 1) xxx=file; esac
7595 echo "Extracting names from the following $xxx for later perusal:" >&4
7597 $sed 's/^/ /' libnames >&4
7599 $echo $n "This may take a while...$c" >&4
7603 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7604 *) $nm $nm_opt $file 2>/dev/null;;
7609 $grep fprintf libc.tmp > libc.ptf
7610 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7611 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7613 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7617 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7621 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7625 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7629 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7633 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7637 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7638 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7640 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7642 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7644 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7646 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7648 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7650 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7652 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7654 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7656 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7658 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7660 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7662 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7664 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7666 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7671 $nm -p $* 2>/dev/null >libc.tmp
7672 $grep fprintf libc.tmp > libc.ptf
7673 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7674 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7680 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7682 if $ar t $libc > libc.tmp && \
7683 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7685 for thisname in $libnames $libc; do
7686 $ar t $thisname >>libc.tmp
7688 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7690 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7691 for thisname in $libnames $libc; do
7692 $ar tv $thisname >>libc.tmp
7693 emximp -o tmp.imp $thisname \
7695 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7696 < tmp.imp >>libc.tmp
7699 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7702 echo "$ar didn't seem to work right." >&4
7703 echo "Maybe this is a Cray...trying bld instead..." >&4
7705 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7708 for thisname in $libnames; do
7710 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7711 $ar t $thisname >>libc.tmp
7715 echo "That didn't work either. Giving up." >&4
7725 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7726 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7728 *) if $test -f /lib/syscalls.exp; then
7730 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7731 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7732 /lib/syscalls.exp >>libc.list
7738 $rm -f libnames libpath
7740 : see if dld is available
7744 : Check if we are using C++
7746 echo "Checking for C++..." >&4
7747 $cat >try.c <<'EOCP'
7759 if eval $compile_ok && $run ./try; then
7761 echo "You are using a C++ compiler."
7764 echo "You are not using a C++ compiler."
7770 : is a C symbol defined?
7773 -v) tf=libc.tmp; tdc="";;
7774 -a) tf=libc.tmp; tdc="[]";;
7775 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7778 case "$reuseval-$4" in
7780 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7785 case "$d_cplusplus" in
7786 $define) extern_C=\"C\";;
7788 if $test "$runnm" = true; then
7789 if $contains $tlook $tf >/dev/null 2>&1; then
7791 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7792 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7793 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7794 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7798 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7799 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7805 $define) tval=true;;
7812 : define an is-in-libc? function
7813 inlibc='echo " "; td=$define; tu=$undef;
7814 sym=$1; var=$2; eval "was=\$$2";
7816 case "$reuseval$was" in
7826 echo "$sym() found." >&4;
7827 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7829 echo "$sym() NOT found." >&4;
7830 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7834 $define) echo "$sym() found." >&4;;
7835 *) echo "$sym() NOT found." >&4;;
7839 : see if dlopen exists
7841 xxx_ccflags="$ccflags"
7843 : with g++ one needs -shared to get is-in-libc to work for dlopen
7844 case "$gccversion" in
7846 *) case "$d_cplusplus" in
7847 "$define") ccflags="$ccflags -shared" ;;
7854 ccflags="$xxx_ccflags"
7856 : see if this is a unistd.h system
7857 set unistd.h i_unistd
7860 : determine which dynamic loading, if any, to compile in
7862 dldir="ext/DynaLoader"
7875 $define) dflt='y' ;;
7878 $define) dflt='y' ;;
7880 : Does a dl_xxx.xs file exist for this operating system
7881 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7884 rp="Do you wish to use dynamic loading?"
7891 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7892 dflt="$dldir/dl_${osname}.xs"
7893 elif $test "$d_dlopen" = "$define" ; then
7894 dflt="$dldir/dl_dlopen.xs"
7895 elif $test "$i_dld" = "$define" ; then
7896 dflt="$dldir/dl_dld.xs"
7901 *) dflt="$dldir/$dlsrc"
7904 echo "The following dynamic loading files are available:"
7905 : Can not go over to $dldir because getfile has path hard-coded in.
7906 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7907 rp="Source file to use for dynamic loading"
7913 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7917 Some systems may require passing special flags to $cc -c to
7918 compile modules that will be used to create a shared library.
7919 To use no flags, say "none".
7922 case "$cccdlflags" in
7923 '') case "$gccversion" in
7924 '') case "$osname" in
7926 next) dflt='none' ;;
7927 irix*) dflt='-KPIC' ;;
7928 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7929 sunos) dflt='-pic' ;;
7933 *) case "$osname" in
7934 darwin) dflt='none' ;;
7935 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7940 *) dflt="$cccdlflags" ;;
7942 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7945 none) cccdlflags=' ' ;;
7946 *) cccdlflags="$ans" ;;
7951 Some systems use ld to create libraries that can be dynamically loaded,
7952 while other systems (such as those using ELF) use $cc.
7956 '') $cat >try.c <<EOM
7957 /* Test for whether ELF binaries are produced */
7969 int i = open("a.out",O_RDONLY);
7972 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7973 exit(0); /* succeed (yes, it's ELF) */
7978 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7980 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7984 echo "I'll use ld to build dynamic libraries."
7993 rp="What command should be used to create dynamic libraries?"
7999 Some systems may require passing special flags to $ld to create a
8000 library that can be dynamically loaded. If your ld flags include
8001 -L/other/path options to locate libraries outside your loader's normal
8002 search path, you may need to specify those -L options here as well. To
8003 use no flags, say "none".
8006 case "$lddlflags" in
8007 '') case "$osname" in
8008 beos) dflt='-nostart' ;;
8010 case "$gccversion" in
8011 '') dflt="$dflt +vnocompatwarnings" ;;
8014 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8015 next) dflt='none' ;;
8016 solaris) dflt='-G' ;;
8017 sunos) dflt='-assert nodefinitions' ;;
8018 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8022 *) dflt="$lddlflags" ;;
8025 : Try to guess additional flags to pick up local libraries.
8026 : Be careful not to append to a plain 'none'
8030 for thisflag in $ldflags; do
8035 *) dflt="$dflt $thisflag" ;;
8042 ''|' ') dflt='none' ;;
8046 *-fstack-protector*)
8048 *-fstack-protector*) ;; # Don't add it again
8049 *) dflt="$dflt -fstack-protector" ;;
8055 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8058 none) lddlflags=' ' ;;
8059 *) lddlflags="$ans" ;;
8064 Some systems may require passing special flags to $cc to indicate that
8065 the resulting executable will use dynamic linking. To use no flags,
8069 case "$ccdlflags" in
8070 '') case "$osname" in
8071 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8072 next|sunos) dflt='none' ;;
8076 *) dflt="$ccdlflags" ;;
8078 rp="Any special flags to pass to $cc to use dynamic linking?"
8081 none) ccdlflags=' ' ;;
8082 *) ccdlflags="$ans" ;;
8093 : Do we want a shared libperl?
8097 # No dynamic loading being used, so don't bother even to prompt.
8100 *) case "$useshrplib" in
8101 '') case "$osname" in
8102 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8104 also='Building a shared libperl is required for dynamic loading to work on your system.'
8109 also='Building a shared libperl is needed for MAB support.'
8127 The perl executable is normally obtained by linking perlmain.c with
8128 libperl${_a}, any static extensions (usually just DynaLoader), and
8129 any other libraries needed on this system (such as -lm, etc.). Since
8130 your system supports dynamic loading, it is probably possible to build
8131 a shared libperl.$so. If you will have more than one executable linked
8132 to libperl.$so, this will significantly reduce the size of each
8133 executable, but it may have a noticeable effect on performance. The
8134 default is probably sensible for your system.
8138 rp="Build a shared libperl.$so (y/n)"
8142 useshrplib='true' ;;
8143 *) useshrplib='false' ;;
8148 case "$useshrplib" in
8152 # Figure out a good name for libperl.so. Since it gets stored in
8153 # a version-specific architecture-dependent library, the version
8154 # number isn't really that important, except for making cc/ld happy.
8156 # A name such as libperl.so.10.1
8157 majmin="libperl.$so.$patchlevel.$subversion"
8158 # A name such as libperl.so.100
8159 majonly=`echo $patchlevel $subversion |
8160 $awk '{printf "%d%02d", $1, $2}'`
8161 majonly=libperl.$so.$majonly
8162 # I'd prefer to keep the os-specific stuff here to a minimum, and
8163 # rely on figuring it out from the naming of libc.
8164 case "${osname}${osvers}" in
8167 # XXX How handle the --version stuff for MAB?
8169 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8172 cygwin*) # ld links now against the dll directly
8173 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8174 majonly=`echo $patchlevel $subversion |
8175 $awk '{printf "%03d%03d", $1, $2}'`
8176 majonly=cygperl5.$majonly.$so
8179 *) # Try to guess based on whether libc has major.minor.
8181 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8182 *libc.$so.[0-9]*) dflt=$majonly ;;
8183 *) dflt=libperl.$so ;;
8193 I need to select a good name for the shared libperl. If your system uses
8194 library names with major and minor numbers, then you might want something
8195 like $majmin. Alternatively, if your system uses a single version
8196 number for shared libraries, then you might want to use $majonly.
8197 Or, your system might be quite happy with a simple libperl.$so.
8199 Since the shared libperl will get installed into a version-specific
8200 architecture-dependent directory, the version number of the shared perl
8201 library probably isn't important, so the default should be o.k.
8204 rp='What name do you want to give to the shared libperl?'
8207 echo "Ok, I'll use $libperl"
8210 libperl="libperl${_a}"
8214 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8218 WARNING: Use of the shrpdir variable for the installation location of
8219 the shared $libperl is not supported. It was never documented and
8220 will not work in this version. Let me (perlbug@perl.org)
8221 know of any problems this may cause.
8227 But your current setting of $shrpdir is
8228 the default anyway, so it's harmless.
8233 Further, your current attempted setting of $shrpdir
8234 conflicts with the value of $archlibexp/CORE
8235 that installperl will use.
8242 # How will the perl executable find the installed shared $libperl?
8243 # Add $xxx to ccdlflags.
8244 # If we can't figure out a command-line option, use $shrpenv to
8245 # set env LD_RUN_PATH. The main perl makefile uses this.
8246 shrpdir=$archlibexp/CORE
8249 if "$useshrplib"; then
8252 # We'll set it in Makefile.SH...
8257 freebsd|netbsd|openbsd|interix|dragonfly)
8258 xxx="-Wl,-R$shrpdir"
8260 bsdos|linux|irix*|dec_osf|gnu*)
8261 xxx="-Wl,-rpath,$shrpdir"
8264 # next doesn't like the default...
8267 # beos doesn't like the default, either.
8270 # hpux doesn't like the default, either.
8271 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8274 # cygwin needs only ldlibpth
8277 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8283 # Only add $xxx if it isn't already in ccdlflags.
8284 case " $ccdlflags " in
8286 *) ccdlflags="$ccdlflags $xxx"
8289 Adding $xxx to the flags
8290 passed to $ld so that the perl executable will find the
8291 installed shared $libperl.
8299 # Fix ccdlflags in AIX for building external extensions.
8300 # (For building Perl itself bare -bE:perl.exp is needed,
8301 # Makefile.SH takes care of this.)
8303 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8305 # Respect a hint or command-line value.
8307 '') shrpenv="$tmp_shrpenv" ;;
8309 case "$ldlibpthname" in
8310 '') ldlibpthname=LD_LIBRARY_PATH ;;
8311 none) ldlibpthname='' ;;
8314 : determine where manual pages are on this system
8318 syspath='/usr/share/man/man1 /usr/man/man1'
8319 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8320 syspath="$syspath /usr/man/u_man/man1"
8321 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8322 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8323 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8324 sysman=`./loc . /usr/man/man1 $syspath`
8327 if $test -d "$sysman"; then
8328 echo "System manual is in $sysman." >&4
8330 echo "Could not find manual pages in source form." >&4
8333 : determine where manual pages go
8334 set man1dir man1dir none
8338 $spackage has manual pages available in source form.
8342 echo "However, you don't have nroff, so they're probably useless to you."
8344 '') man1dir="none";;
8347 echo "If you don't want the manual sources installed, answer 'none'."
8352 lookpath="$prefixexp/share/man/man1"
8353 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8354 lookpath="$lookpath $prefixexp/man/p_man/man1"
8355 lookpath="$lookpath $prefixexp/man/u_man/man1"
8356 lookpath="$lookpath $prefixexp/man/man.1"
8358 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8359 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8369 rp="Where do the main $spackage manual pages (source) go?"
8371 if $test "X$man1direxp" != "X$ansexp"; then
8382 : What suffix to use on installed man pages
8389 rp="What suffix should be used for the main $spackage man pages?"
8391 '') case "$man1dir" in
8405 *) dflt="$man1ext";;
8412 : see if we can have long filenames
8414 first=123456789abcdef
8416 if (echo hi >$first) 2>/dev/null; then
8417 if $test -f 123456789abcde; then
8418 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8421 echo 'You can have filenames longer than 14 characters.'>&4
8426 You can't have filenames longer than 14 chars.
8427 You can't even think about them!
8433 $rm -rf 123456789abcde*
8435 : determine where library module manual pages go
8436 set man3dir man3dir none
8440 $spackage has manual pages for many of the library modules.
8446 However, you don't have nroff, so they're probably useless to you.
8449 '') man3dir="none";;
8453 case "$d_flexfnam" in
8456 However, your system can't handle the long file names like File::Basename.3.
8459 '') man3dir="none";;
8463 echo "If you don't want the manual sources installed, answer 'none'."
8464 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8466 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8467 if $test -d "$privlib/man/man3"; then
8470 WARNING: Previous versions of perl installed man3 pages into
8471 $privlib/man/man3. This version will suggest a
8472 new default of $dflt.
8476 rp='Do you wish to preserve the old behavior?(y/n)'
8479 y*) dflt="$privlib/man/man3" ;;
8484 *) dflt="$man3dir" ;;
8491 rp="Where do the $package library man pages (source) go?"
8501 : What suffix to use on installed man pages
8507 rp="What suffix should be used for the $package library man pages?"
8509 '') case "$man3dir" in
8523 *) dflt="$man3ext";;
8530 : see if we have to deal with yellow pages, now NIS.
8531 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8532 if $test -f /usr/etc/nibindd; then
8534 echo "I'm fairly confident you're on a NeXT."
8536 rp='Do you get the hosts file via NetInfo?'
8545 y*) hostcat='nidump hosts .';;
8546 *) case "$hostcat" in
8547 nidump*) hostcat='';;
8557 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8565 rp='Are you getting the hosts file via yellow pages?'
8568 y*) hostcat='ypcat hosts';;
8569 *) hostcat='cat /etc/hosts';;
8575 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8578 '') test -f /etc/group && groupcat='cat /etc/group';;
8581 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8584 : now get the host name
8586 echo "Figuring out host name..." >&4
8587 case "$myhostname" in
8589 echo 'Maybe "hostname" will work...'
8590 if tans=`sh -c hostname 2>&1` ; then
8598 if $test "$cont"; then
8600 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8601 if tans=`cat /etc/systemid 2>&1` ; then
8603 phostname='cat /etc/systemid'
8604 echo "Whadyaknow. Xenix always was a bit strange..."
8607 elif $test -r /etc/systemid; then
8608 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8611 if $test "$cont"; then
8612 echo 'No, maybe "uuname -l" will work...'
8613 if tans=`sh -c 'uuname -l' 2>&1` ; then
8615 phostname='uuname -l'
8617 echo 'Strange. Maybe "uname -n" will work...'
8618 if tans=`sh -c 'uname -n' 2>&1` ; then
8620 phostname='uname -n'
8622 echo 'Oh well, maybe I can mine it out of whoami.h...'
8623 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8624 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8625 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8627 case "$myhostname" in
8628 '') echo "Does this machine have an identity crisis or something?"
8631 echo "Well, you said $myhostname before..."
8632 phostname='echo $myhostname';;
8638 case "$myhostname" in
8639 '') myhostname=noname ;;
8641 : you do not want to know about this
8646 if $test "$myhostname" ; then
8648 rp='Your host name appears to be "'$myhostname'".'" Right?"
8656 : bad guess or no guess
8657 while $test "X$myhostname" = X ; do
8659 rp="Please type the (one word) name of your host:"
8664 : translate upper to lower if necessary
8665 case "$myhostname" in
8667 echo "(Normalizing case in your host name)"
8668 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8672 case "$myhostname" in
8674 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8675 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8676 echo "(Trimming domain name from host name--host name is now $myhostname)"
8678 *) case "$mydomain" in
8681 test "X$hostcat" = "Xypcat hosts" &&
8682 ypmatch "$myhostname" hosts 2>/dev/null |\
8683 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8686 test "X$hostcat" != "X" &&
8687 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8688 /[ ]$myhostname[ . ]/p" > hosts
8691 if $test -f hosts; then
8692 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8693 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8694 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8695 hosts | $sort | $uniq | \
8696 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8697 case `$echo X$dflt` in
8698 X*\ *) echo "(Several hosts in the database matched hostname)"
8701 X.) echo "(You do not have fully-qualified names in the hosts database)"
8705 echo "(I cannot locate a hosts database anywhere)"
8710 tans=`./loc resolv.conf X /etc /usr/etc`
8711 if $test -f "$tans"; then
8712 echo "(Attempting domain name extraction from $tans)"
8713 dflt=.`$sed -n -e 's/ / /g' \
8714 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8717 .) dflt=.`$sed -n -e 's/ / /g' \
8718 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8726 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8727 dflt=.`sh -c domainname 2>/dev/null`
8730 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8734 case "$dflt$osname" in
8735 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8736 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8740 .) echo "(Lost all hope -- silly guess then)"
8746 *) dflt="$mydomain";;
8750 rp="What is your domain name?"
8760 : translate upper to lower if necessary
8763 echo "(Normalizing case in your domain name)"
8764 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8768 : a little sanity check here
8769 case "$phostname" in
8772 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8773 $myhostname$mydomain|$myhostname) ;;
8775 case "$phostname" in
8777 echo "(That doesn't agree with your whoami.h file, by the way.)"
8780 echo "(That doesn't agree with your $phostname command, by the way.)"
8788 : determine the e-mail address of the user who is running us
8791 I need to get your e-mail address in Internet format if possible, i.e.
8792 something like user@host.domain. Please answer accurately since I have
8793 no easy means to double check it. The default value provided below
8794 is most probably close to reality but may not be valid from outside
8795 your organization...
8799 while test "$cont"; do
8801 '') dflt="$cf_by@$myhostname$mydomain";;
8802 *) dflt="$cf_email";;
8804 rp='What is your e-mail address?'
8810 rp='Address does not look like an Internet one. Use it anyway?'
8824 : Ask e-mail of administrator
8827 If you or somebody else will be maintaining perl at your site, please
8828 fill in the correct e-mail address here so that they may be contacted
8829 if necessary. Currently, the "perlbug" program included with perl
8830 will send mail to this address in addition to perlbug@perl.org. You may
8831 enter "none" for no administrator.
8834 case "$perladmin" in
8835 '') dflt="$cf_email";;
8836 *) dflt="$perladmin";;
8838 rp='Perl administrator e-mail address'
8842 : determine whether to only install version-specific parts.
8845 Do you want to install only the version-specific parts of the perl
8846 distribution? Usually you do *not* want to do this.
8848 case "$versiononly" in
8849 "$define"|[Yy]*|true) dflt='y' ;;
8852 rp="Do you want to install only the version-specific parts of perl?"
8855 [yY]*) val="$define";;
8861 case "$versiononly" in
8862 "$define") inc_version_list=''
8863 inc_version_list_init=0
8867 : figure out how to guarantee perl startup
8868 : XXX Note that this currently takes advantage of the bug that binexp ignores
8869 : the Configure -Dinstallprefix setting, which in turn means that under
8870 : relocatable @INC, initialinstalllocation is what binexp started as.
8871 case "$startperl" in
8873 case "$sharpbang" in
8877 I can use the #! construct to start perl on your system. This will
8878 make startup of perl scripts faster, but may cause problems if you
8879 want to share those scripts and perl is not in a standard place
8880 ($initialinstalllocation/perl) on all your platforms. The alternative
8881 is to force a shell by starting the script with a single ':' character.
8884 case "$versiononly" in
8885 "$define") dflt="$initialinstalllocation/perl$version";;
8886 *) dflt="$initialinstalllocation/perl";;
8888 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8891 none) startperl=": # use perl";;
8892 *) startperl="#!$ans"
8893 if $test 30 -lt `echo "$ans" | wc -c`; then
8896 WARNING: Some systems limit the #! command to 32 characters.
8897 If you experience difficulty running Perl scripts with #!, try
8898 installing Perl in a directory with a shorter pathname.
8904 *) startperl=": # use perl"
8909 echo "I'll use $startperl to start perl scripts."
8911 : figure best path for perl in scripts
8914 case "$versiononly" in
8915 "$define") perlpath="$initialinstalllocation/perl$version";;
8916 *) perlpath="$initialinstalllocation/perl";;
8918 case "$startperl" in
8923 I will use the "eval 'exec'" idiom to start Perl on your system.
8924 I can use the full path of your Perl binary for this purpose, but
8925 doing so may cause problems if you want to share those scripts and
8926 Perl is not always in a standard place ($initialinstalllocation/perl).
8929 dflt="$initialinstalllocation/perl"
8930 rp="What path shall I use in \"eval 'exec'\"?"
8937 case "$startperl" in
8939 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8942 : determine where public executable scripts go
8943 set scriptdir scriptdir
8945 case "$scriptdir" in
8948 : guess some guesses
8949 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8950 $test -d /usr/share/bin && dflt=/usr/share/bin
8951 $test -d /usr/local/script && dflt=/usr/local/script
8952 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8953 $test -d $prefixexp/script && dflt=$prefixexp/script
8957 *) dflt="$scriptdir"
8962 Some installations have a separate directory just for executable scripts so
8963 that they can mount it across multiple architectures but keep the scripts in
8964 one spot. You might, for example, have a subdirectory of /usr/share for this.
8965 Or you might just lump your scripts in with all your other executables.
8969 rp='Where do you keep publicly executable scripts?'
8971 if $test "X$ansexp" != "X$scriptdirexp"; then
8977 : A little fix up for an irregularly named variable.
8978 installscript="$installscriptdir"
8980 : determine where add-on public executables go
8982 '') dflt=$siteprefix/bin ;;
8986 rp='Pathname where the add-on public executables should be installed?'
8991 : determine where add-on html pages go
8992 : There is no standard location, so try to copy the previously-selected
8993 : directory structure for the core html pages.
8994 case "$sitehtml1dir" in
8995 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8996 *) dflt=$sitehtml1dir ;;
8999 ''|' ') dflt=none ;;
9002 rp='Pathname where the site-specific html pages should be installed?'
9004 prefixvar=sitehtml1dir
9007 : determine where add-on library html pages go
9008 : There is no standard location, so try to copy the previously-selected
9009 : directory structure for the core html pages.
9010 case "$sitehtml3dir" in
9011 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9012 *) dflt=$sitehtml3dir ;;
9015 ''|' ') dflt=none ;;
9018 rp='Pathname where the site-specific library html pages should be installed?'
9020 prefixvar=sitehtml3dir
9023 : determine where add-on manual pages go
9024 case "$siteman1dir" in
9025 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9026 *) dflt=$siteman1dir ;;
9029 ''|' ') dflt=none ;;
9032 rp='Pathname where the site-specific manual pages should be installed?'
9034 prefixvar=siteman1dir
9037 : determine where add-on library man pages go
9038 case "$siteman3dir" in
9039 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9040 *) dflt=$siteman3dir ;;
9043 ''|' ') dflt=none ;;
9046 rp='Pathname where the site-specific library manual pages should be installed?'
9048 prefixvar=siteman3dir
9051 : determine where add-on public executable scripts go
9052 case "$sitescript" in
9053 '') dflt=$siteprefix/script
9054 $test -d $dflt || dflt=$sitebin ;;
9055 *) dflt="$sitescript" ;;
9058 rp='Pathname where add-on public executable scripts should be installed?'
9060 prefixvar=sitescript
9063 : Check if faststdio is requested and available
9064 case "$usefaststdio" in
9065 $define|true|[yY]*|'')
9066 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9076 Perl can be built to use 'fast stdio', which means using the stdio
9077 library but also directly manipulating the stdio buffers to enable
9078 faster I/O. Using stdio is better for backward compatibility (especially
9079 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9080 interface has been preferred instead of stdio.
9082 If this doesn't make any sense to you, just accept the default '$dflt'.
9084 rp='Use the "fast stdio" if available?'
9087 y|Y) val="$define" ;;
9094 : define an is-a-typedef? function
9095 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9097 "") inclist="sys/types.h";;
9099 eval "varval=\$$var";
9103 for inc in $inclist; do
9104 echo "#include <$inc>" >>temp.c;
9106 echo "#ifdef $type" >> temp.c;
9107 echo "printf(\"We have $type\");" >> temp.c;
9108 echo "#endif" >> temp.c;
9109 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9110 if $contains $type temp.E >/dev/null 2>&1; then
9116 *) eval "$var=\$varval";;
9119 : define an is-a-typedef? function that prompts if the type is not available.
9120 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9122 "") inclist="sys/types.h";;
9124 eval "varval=\$$var";
9128 for inc in $inclist; do
9129 echo "#include <$inc>" >>temp.c;
9131 echo "#ifdef $type" >> temp.c;
9132 echo "printf(\"We have $type\");" >> temp.c;
9133 echo "#endif" >> temp.c;
9134 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9136 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9137 if $contains $type temp.E >/dev/null 2>&1; then
9138 echo "$type found." >&4;
9141 echo "$type NOT found." >&4;
9147 *) eval "$var=\$varval";;
9150 : see what type lseek is declared as in the kernel
9151 rp="What is the type used for lseek's offset on this system?"
9152 set off_t lseektype long stdio.h sys/types.h
9156 echo "Checking to see how big your file offsets are..." >&4
9158 #include <sys/types.h>
9162 printf("%d\n", (int)sizeof($lseektype));
9167 if eval $compile_ok; then
9168 lseeksize=`$run ./try`
9169 echo "Your file offsets are $lseeksize bytes long."
9173 echo "(I can't seem to compile the test program. Guessing...)"
9174 rp="What is the size of your file offsets (in bytes)?"
9180 : see what type file positions are declared as in the library
9181 rp="What is the type for file position used by fsetpos()?"
9182 set fpos_t fpostype long stdio.h sys/types.h
9185 : Check size for Fpos_t
9188 *_t) zzz="$fpostype" ;;
9191 echo "Checking the size of $zzz..." >&4
9193 #include <sys/types.h>
9200 printf("%d\n", (int)sizeof($fpostype));
9205 if eval $compile_ok; then
9209 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9212 echo "Your $zzz is $fpossize bytes long."
9218 echo "(I can't compile the test program. Guessing...)" >&4
9219 rp="What is the size of your file positions (in bytes)?"
9224 : Check for large file support
9225 # Backward compatibility (uselfs is deprecated).
9227 "$define"|true|[yY]*)
9230 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9232 uselargefiles="$define"
9236 case "$lseeksize:$fpossize" in
9239 You can have files larger than 2 gigabytes.
9242 *) case "$uselargefiles" in
9243 "$undef"|false|[nN]*) dflt='n' ;;
9248 Perl can be built to understand large files (files larger than 2 gigabytes)
9249 on some systems. To do so, Configure can be run with -Duselargefiles.
9251 If this doesn't make any sense to you, just accept the default '$dflt'.
9253 rp='Try to understand large files, if available?'
9256 y|Y) val="$define" ;;
9263 : Look for a hint-file generated 'call-back-unit'. If the
9264 : user has specified that a large files perl is to be built,
9265 : we may need to set or change some other defaults.
9266 if $test -f uselargefiles.cbu; then
9267 echo "Your platform has some specific hints regarding large file builds, using them..."
9268 . ./uselargefiles.cbu
9270 case "$uselargefiles" in
9272 if $test -f uselargefiles.cbu; then
9274 echo "Rechecking to see how big your file offsets are..." >&4
9276 #include <sys/types.h>
9280 printf("%d\n", (int)sizeof($lseektype));
9285 if eval $compile_ok; then
9286 lseeksize=`$run ./try`
9287 $echo "Your file offsets are now $lseeksize bytes long."
9291 echo "(I can't seem to compile the test program. Guessing...)"
9292 rp="What is the size of your file offsets (in bytes)?"
9297 *_t) zzz="$fpostype" ;;
9300 $echo $n "Rechecking the size of $zzz...$c" >&4
9302 #include <sys/types.h>
9309 printf("%d\n", (int)sizeof($fpostype));
9314 if eval $compile_ok; then
9319 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9322 echo " $fpossize bytes." >&4
9328 echo "(I can't compile the test program. Guessing...)" >&4
9329 rp="What is the size of your file positions (in bytes)?"
9338 : Set the vendorbin variables
9339 case "$vendorprefix" in
9340 '') d_vendorbin="$undef"
9344 *) d_vendorbin="$define"
9345 : determine where vendor-supplied executables go.
9346 case "$vendorbin" in
9347 '') dflt=$vendorprefix/bin ;;
9348 *) dflt="$vendorbin" ;;
9351 rp='Pathname for the vendor-supplied executables directory?'
9354 vendorbinexp="$ansexp"
9360 : Set the vendorhtml1dir variables
9361 case "$vendorprefix" in
9362 '') vendorhtml1dir=''
9363 vendorhtml1direxp=''
9365 *) : determine where vendor-supplied html pages go.
9366 : There is no standard location, so try to copy the previously-selected
9367 : directory structure for the core html pages.
9368 : XXX Better default suggestions would be welcome.
9369 case "$vendorhtml1dir" in
9370 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9371 *) dflt=$vendorhtml1dir ;;
9374 ''|' ') dflt=none ;;
9377 rp='Pathname for the vendor-supplied html pages?'
9379 vendorhtml1dir="$ans"
9380 vendorhtml1direxp="$ansexp"
9383 : Use ' ' for none so value is preserved next time through Configure
9384 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9385 prefixvar=vendorhtml1dir
9388 : Set the vendorhtml3dir variables
9389 case "$vendorprefix" in
9390 '') vendorhtml3dir=''
9391 vendorhtml3direxp=''
9393 *) : determine where vendor-supplied module html pages go.
9394 : There is no standard location, so try to copy the previously-selected
9395 : directory structure for the core html pages.
9396 : XXX Better default suggestions would be welcome.
9397 case "$vendorhtml3dir" in
9398 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9399 *) dflt=$vendorhtml3dir ;;
9402 ''|' ') dflt=none ;;
9405 rp='Pathname for the vendor-supplied html pages?'
9407 vendorhtml3dir="$ans"
9408 vendorhtml3direxp="$ansexp"
9411 : Use ' ' for none so value is preserved next time through Configure
9412 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9413 prefixvar=vendorhtml3dir
9416 : Set the vendorman1dir variables
9417 case "$vendorprefix" in
9418 '') vendorman1dir=''
9421 *) : determine where vendor-supplied manual pages go.
9422 case "$vendorman1dir" in
9423 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9424 *) dflt=$vendorman1dir ;;
9427 ''|' ') dflt=none ;;
9430 rp='Pathname for the vendor-supplied manual section 1 pages?'
9432 vendorman1dir="$ans"
9433 vendorman1direxp="$ansexp"
9436 : Use ' ' for none so value is preserved next time through Configure
9437 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9438 prefixvar=vendorman1dir
9441 : Set the vendorman3dir variables
9442 case "$vendorprefix" in
9443 '') vendorman3dir=''
9446 *) : determine where vendor-supplied module manual pages go.
9447 case "$vendorman3dir" in
9448 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9449 *) dflt=$vendorman3dir ;;
9452 ''|' ') dflt=none ;;
9455 rp='Pathname for the vendor-supplied manual section 3 pages?'
9457 vendorman3dir="$ans"
9458 vendorman3direxp="$ansexp"
9461 : Use ' ' for none so value is preserved next time through Configure
9462 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9463 prefixvar=vendorman3dir
9466 : Set the vendorscript variables
9467 case "$vendorprefix" in
9468 '') d_vendorscript="$undef"
9472 *) d_vendorscript="$define"
9473 : determine where vendor-supplied scripts go.
9474 case "$vendorscript" in
9475 '') dflt=$vendorprefix/script
9476 $test -d $dflt || dflt=$vendorbin ;;
9477 *) dflt="$vendorscript" ;;
9481 The installation process will create a directory for
9482 vendor-supplied scripts.
9486 rp='Pathname for the vendor-supplied scripts directory?'
9489 vendorscriptexp="$ansexp"
9492 prefixvar=vendorscript
9495 : see if qgcvt exists
9499 : Check print/scan long double stuff
9502 if $test X"$d_longdbl" = X"$define"; then
9504 echo "Checking how to print long doubles..." >&4
9506 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9507 $cat >try.c <<'EOCP'
9508 #include <sys/types.h>
9512 printf("%.3f\n", d);
9516 if eval $compile; then
9520 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9521 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9522 echo "We will use %f."
9528 if $test X"$sPRIfldbl" = X; then
9529 $cat >try.c <<'EOCP'
9530 #include <sys/types.h>
9533 long double d = 123.456;
9534 printf("%.3Lf\n", d);
9538 if eval $compile; then
9542 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9543 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9544 echo "We will use %Lf."
9550 if $test X"$sPRIfldbl" = X; then
9551 $cat >try.c <<'EOCP'
9552 #include <sys/types.h>
9555 long double d = 123.456;
9556 printf("%.3llf\n", d);
9560 if eval $compile; then
9564 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9565 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9566 echo "We will use %llf."
9572 if $test X"$sPRIfldbl" = X; then
9573 $cat >try.c <<'EOCP'
9574 #include <sys/types.h>
9577 long double d = 123.456;
9578 printf("%.3lf\n", d);
9582 if eval $compile; then
9586 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9587 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9588 echo "We will use %lf."
9594 if $test X"$sPRIfldbl" = X; then
9595 echo "Cannot figure out how to print long doubles." >&4
9597 sSCNfldbl=$sPRIfldbl # expect consistency
9604 case "$sPRIfldbl" in
9605 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9606 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9607 d_SCNfldbl="$undef";
9609 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9610 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9611 d_SCNfldbl="$define";
9615 : Check how to convert floats to strings.
9617 if test "X$d_Gconvert" = X; then
9620 echo "Checking for an efficient way to convert floats to strings."
9622 case "$uselongdouble" in
9623 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9625 case "$d_longdbl" in
9626 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9628 case "$d_PRIgldbl" in
9629 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9633 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9634 char *myname = "gconvert";
9637 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9638 char *myname = "gcvt";
9641 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9642 char *myname = "qgcvt";
9643 #define DOUBLETYPE long double
9646 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9648 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9650 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9653 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9655 char *myname = "sprintf";
9659 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9660 #define DOUBLETYPE long double
9662 #define DOUBLETYPE double
9668 #define I_STDLIB $i_stdlib
9674 checkit(expect, got)
9678 if (strcmp(expect, got)) {
9679 printf("%s oddity: Expected %s, got %s\n",
9680 myname, expect, got);
9690 /* This must be 1st test on (which?) platform */
9691 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9692 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9693 checkit("0.1", buf);
9695 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9696 checkit("0.01", buf);
9698 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9699 checkit("0.001", buf);
9701 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9702 checkit("0.0001", buf);
9704 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9705 if (strlen(buf) > 5)
9706 checkit("9e-005", buf); /* for Microsoft ?? */
9708 checkit("9e-05", buf);
9710 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9713 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9714 checkit("1.1", buf);
9716 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9717 checkit("1.01", buf);
9719 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9720 checkit("1.001", buf);
9722 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9723 checkit("1.0001", buf);
9725 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9726 checkit("1.00001", buf);
9728 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9729 checkit("1.000001", buf);
9731 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9734 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9737 /* Some Linux gcvt's give 1.e+5 here. */
9738 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9739 checkit("100000", buf);
9741 /* Some Linux gcvt's give -1.e+5 here. */
9742 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9743 checkit("-100000", buf);
9745 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9746 checkit("123.456", buf);
9748 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9749 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9750 /* 34 should be enough to scare even long double
9751 * places into using the e notation. */
9752 if (strlen(buf) > 5)
9753 checkit("1e+034", buf); /* for Microsoft */
9755 checkit("1e+34", buf);
9757 /* For Perl, if you add additional tests here, also add them to
9758 * t/base/num.t for benefit of platforms not using Configure or
9759 * overriding d_Gconvert */
9764 : first add preferred functions to our list
9766 for xxx_convert in $gconvert_preference; do
9767 case $xxx_convert in
9768 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9769 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9772 : then add any others
9773 for xxx_convert in gconvert gcvt sprintf; do
9776 *) xxx_list="$xxx_list $xxx_convert" ;;
9780 case "$d_longdbl$uselongdouble" in
9782 : again, add prefered functions to our list first
9784 for xxx_convert in $gconvert_ld_preference; do
9785 case $xxx_convert in
9786 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9787 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9790 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9791 for xxx_convert in qgcvt sprintf $xxx_list; do
9792 case "$xxx_ld_list" in
9793 $xxx_convert*|*" $xxx_convert"*) ;;
9794 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9797 : if sprintf cannot do long doubles, move it to the end
9798 if test "$d_PRIgldbl" != "$define"; then
9799 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9801 : if no qgcvt, remove it
9802 if test "$d_qgcvt" != "$define"; then
9803 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9806 xxx_list="$xxx_ld_list"
9810 for xxx_convert in $xxx_list; do
9811 echo "Trying $xxx_convert..."
9812 $rm -f try try$_o core
9813 set try -DTRY_$xxx_convert
9814 if eval $compile; then
9815 echo "$xxx_convert() found." >&4
9817 echo "I'll use $xxx_convert to convert floats into a string." >&4
9820 echo "...But $xxx_convert didn't work as I expected."
9824 echo "$xxx_convert NOT found." >&4
9828 if test X$xxx_convert = X; then
9829 echo "*** WHOA THERE!!! ***" >&4
9830 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9834 case "$xxx_convert" in
9835 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9836 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9837 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9838 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9839 "$define$define$define")
9840 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9841 "$define$define$undef")
9842 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9843 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9851 : see if _fwalk exists
9855 : Initialize h_fcntl
9858 : Initialize h_sysfile
9861 : access call always available on UNIX
9865 : locate the flags for 'access()'
9869 $cat >access.c <<EOCP
9870 #include <sys/types.h>
9875 #include <sys/file.h>
9888 : check sys/file.h first, no particular reason here
9889 if $test `./findhdr sys/file.h` && \
9890 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9892 echo "<sys/file.h> defines the *_OK access constants." >&4
9893 elif $test `./findhdr fcntl.h` && \
9894 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9896 echo "<fcntl.h> defines the *_OK access constants." >&4
9897 elif $test `./findhdr unistd.h` && \
9898 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9899 echo "<unistd.h> defines the *_OK access constants." >&4
9901 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9907 : see if accessx exists
9908 set accessx d_accessx
9911 : see if aintl exists
9915 : see if alarm exists
9919 : see if POSIX threads are available
9920 set pthread.h i_pthread
9923 : define a fucntion to check prototypes
9924 $cat > protochk <<EOSH
9927 optimize="$optimize"
9929 prototype="$prototype"
9932 usethreads=$usethreads
9933 i_pthread=$i_pthread
9934 pthread_h_first=$pthread_h_first
9937 $cat >> protochk <<'EOSH'
9942 while test $# -ge 2; do
9944 $define) echo "#include <$2>" >> try.c ;;
9945 literal) echo "$2" >> try.c ;;
9947 # Extra magic for the benefit of systems that need pthread.h
9948 # to be included early to correctly detect threadsafe functions.
9949 # Such functions must guarantee themselves, though, that the usethreads
9950 # and i_pthread have been defined, before calling protochk.
9951 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9952 echo "#include <pthread.h>" >> try.c
9957 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9958 cat >> try.c <<'EOCP'
9959 #ifdef CAN_PROTOTYPE
9960 #define _(args) args
9965 echo "$foo" >> try.c
9966 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9967 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9975 : Define hasproto macro for Configure internal use
9976 hasproto='varname=$1; func=$2; shift; shift;
9977 while $test $# -ge 2; do
9979 $define) echo "#include <$2>";;
9983 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9984 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9985 echo "$func() prototype found.";
9988 echo "$func() prototype NOT found.";
9995 : see if sys/types.h has to be included
9996 set sys/types.h i_systypes
9999 : see if sys/select.h has to be included
10000 set sys/select.h i_sysselct
10003 : Define hasfield macro for Configure internal use
10004 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10005 while $test $# -ge 2; do
10007 $define) echo "#include <$2>";;
10011 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10013 if eval $compile; then
10022 : see if we should include time.h, sys/time.h, or both
10024 if test "X$timeincl" = X; then
10025 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10026 $echo $n "I'm now running the test program...$c"
10028 #include <sys/types.h>
10033 #ifdef SYSTIMEKERNEL
10036 #include <sys/time.h>
10039 #include <sys/select.h>
10041 #$i_stdlib I_STDLIB
10043 #include <stdlib.h>
10049 struct timeval bar;
10052 struct timezone tzp;
10054 if (foo.tm_sec == foo.tm_sec)
10057 if (bar.tv_sec == bar.tv_sec)
10064 for s_timezone in '-DS_TIMEZONE' ''; do
10066 for s_timeval in '-DS_TIMEVAL' ''; do
10067 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10068 for i_time in '' '-DI_TIME'; do
10069 for i_systime in '-DI_SYSTIME' ''; do
10072 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10073 if eval $compile; then
10074 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10078 $echo $n "Succeeded with $flags$c"
10090 *SYSTIMEKERNEL*) i_systimek="$define"
10091 timeincl=`./findhdr sys/time.h`
10092 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10093 *) i_systimek="$undef";;
10096 *I_TIME*) i_time="$define"
10097 timeincl=`./findhdr time.h`" $timeincl"
10098 echo "We'll include <time.h>." >&4;;
10099 *) i_time="$undef";;
10102 *I_SYSTIME*) i_systime="$define"
10103 timeincl=`./findhdr sys/time.h`" $timeincl"
10104 echo "We'll include <sys/time.h>." >&4;;
10105 *) i_systime="$undef";;
10109 : see if struct tm knows about tm_zone
10110 case "$i_systime$i_time" in
10113 echo "Checking to see if your struct tm has tm_zone field..." >&4
10114 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10122 case "$d_tm_tm_zone" in
10123 "$define") echo "Yes, it does." ;;
10124 *) echo "No, it doesn't." ;;
10126 : see if struct tm knows about tm_gmtoff
10127 case "$i_systime$i_time" in
10130 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10131 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10139 case "$d_tm_tm_gmtoff" in
10140 "$define") echo "Yes, it does." ;;
10141 *) echo "No, it doesn't." ;;
10144 : see if asctime_r exists
10145 set asctime_r d_asctime_r
10147 case "$d_asctime_r" in
10149 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10150 case "$d_asctime_r_proto:$usethreads" in
10151 ":define") d_asctime_r_proto=define
10152 set d_asctime_r_proto asctime_r $hdrs
10156 case "$d_asctime_r_proto" in
10158 case "$asctime_r_proto" in
10159 ''|0) try='char* asctime_r(const struct tm*, char*);'
10160 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10162 case "$asctime_r_proto" in
10163 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10164 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10166 case "$asctime_r_proto" in
10167 ''|0) try='int asctime_r(const struct tm*, char*);'
10168 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10170 case "$asctime_r_proto" in
10171 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10172 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10174 case "$asctime_r_proto" in
10175 ''|0) d_asctime_r=undef
10177 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10178 * ) case "$asctime_r_proto" in
10179 REENTRANT_PROTO*) ;;
10180 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10182 echo "Prototype: $try" ;;
10185 *) case "$usethreads" in
10186 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10193 *) asctime_r_proto=0
10197 : see if atolf exists
10201 : see if atoll exists
10205 : Look for GCC-style attribute format
10206 case "$d_attribute_format" in
10209 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10210 $cat >attrib.c <<'EOCP'
10212 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10214 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10215 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10216 echo "Your C compiler doesn't support __attribute__((format))."
10219 echo "Your C compiler supports __attribute__((format))."
10223 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10227 *) val="$d_attribute_format" ;;
10229 set d_attribute_format
10233 : Look for GCC-style attribute format with null format allowed
10234 case "$d_printf_format_null" in
10235 '') case "$d_attribute_format" in
10238 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10239 $cat >attrib.c <<EOCP
10241 #$i_stdlib I_STDLIB
10243 #include <stdlib.h>
10245 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10246 int null_printf (char* pat,...) { return (int)pat; }
10247 int main () { exit(null_printf(NULL)); }
10249 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10250 : run the executable in case it produces a run-time warning
10251 if $run ./attrib >>attrib.out 2>&1; then
10252 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10253 echo "Your C compiler doesn't allow __printf__ format to be null."
10256 echo "Your C compiler allows __printf__ format to be null."
10260 echo "Your C compiler executable failed with __printf__ format null."
10264 echo "Your C compiler fails with __printf__ format null."
10271 *) val="$d_printf_format_null" ;;
10273 set d_printf_format_null
10277 : Look for GCC-style attribute malloc
10278 case "$d_attribute_malloc" in
10281 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10282 $cat >attrib.c <<'EOCP'
10284 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10286 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10287 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10288 echo "Your C compiler doesn't support __attribute__((malloc))."
10291 echo "Your C compiler supports __attribute__((malloc))."
10295 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10299 *) val="$d_attribute_malloc" ;;
10301 set d_attribute_malloc
10305 : Look for GCC-style attribute nonnull
10306 case "$d_attribute_nonnull" in
10309 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10310 $cat >attrib.c <<'EOCP'
10312 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10314 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10315 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10316 echo "Your C compiler doesn't support __attribute__((nonnull))."
10319 echo "Your C compiler supports __attribute__((nonnull))."
10323 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10327 *) val="$d_attribute_nonnull" ;;
10329 set d_attribute_nonnull
10333 : Look for GCC-style attribute noreturn
10334 case "$d_attribute_noreturn" in
10337 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10338 $cat >attrib.c <<'EOCP'
10340 void fall_over_dead( void ) __attribute__((noreturn));
10342 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10343 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10344 echo "Your C compiler doesn't support __attribute__((noreturn))."
10347 echo "Your C compiler supports __attribute__((noreturn))."
10351 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10355 *) val="$d_attribute_noreturn" ;;
10357 set d_attribute_noreturn
10361 : Look for GCC-style attribute pure
10362 case "$d_attribute_pure" in
10365 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10366 $cat >attrib.c <<'EOCP'
10368 int square( int n ) __attribute__((pure));
10370 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10371 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10372 echo "Your C compiler doesn't support __attribute__((pure))."
10375 echo "Your C compiler supports __attribute__((pure))."
10379 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10383 *) val="$d_attribute_pure" ;;
10385 set d_attribute_pure
10389 : Look for GCC-style attribute unused
10390 case "$d_attribute_unused" in
10393 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10394 $cat >attrib.c <<'EOCP'
10396 int do_something( int dummy __attribute__((unused)), int n );
10398 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10399 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10400 echo "Your C compiler doesn't support __attribute__((unused))."
10403 echo "Your C compiler supports __attribute__((unused))."
10407 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10411 *) val="$d_attribute_unused" ;;
10413 set d_attribute_unused
10417 : Look for GCC-style attribute warn_unused_result
10418 case "$d_attribute_warn_unused_result" in
10421 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10422 $cat >attrib.c <<'EOCP'
10424 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10426 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10427 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10428 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10431 echo "Your C compiler supports __attribute__((warn_unused_result))."
10435 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10439 *) val="$d_attribute_warn_unused_result" ;;
10441 set d_attribute_warn_unused_result
10445 : see if bcmp exists
10449 : see if bcopy exists
10453 : see if getpgrp exists
10454 set getpgrp d_getpgrp
10457 case "$d_getpgrp" in
10460 echo "Checking to see which flavor of getpgrp is in use..."
10462 #$i_unistd I_UNISTD
10463 #include <sys/types.h>
10465 # include <unistd.h>
10467 #$i_stdlib I_STDLIB
10469 #include <stdlib.h>
10473 if (getuid() == 0) {
10474 printf("(I see you are running Configure as super-user...)\n");
10477 #ifdef TRY_BSD_PGRP
10478 if (getpgrp(1) == 0)
10487 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10488 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10490 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10491 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10494 echo "I can't seem to compile and run the test program."
10496 xxx="a USG one, i.e. you use getpgrp()."
10498 # SVR4 systems can appear rather BSD-ish.
10499 case "$i_unistd" in
10501 xxx="a BSD one, i.e. you use getpgrp(pid)."
10505 xxx="probably a USG one, i.e. you use getpgrp()."
10510 echo "Assuming your getpgrp is $xxx" >&4
10519 : see if setpgrp exists
10520 set setpgrp d_setpgrp
10523 case "$d_setpgrp" in
10526 echo "Checking to see which flavor of setpgrp is in use..."
10528 #$i_unistd I_UNISTD
10529 #include <sys/types.h>
10531 # include <unistd.h>
10533 #$i_stdlib I_STDLIB
10535 #include <stdlib.h>
10539 if (getuid() == 0) {
10540 printf("(I see you are running Configure as super-user...)\n");
10543 #ifdef TRY_BSD_PGRP
10544 if (-1 == setpgrp(1, 1))
10547 if (setpgrp() != -1)
10553 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10554 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10556 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10557 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10560 echo "(I can't seem to compile and run the test program.)"
10562 xxx="a USG one, i.e. you use setpgrp()."
10564 # SVR4 systems can appear rather BSD-ish.
10565 case "$i_unistd" in
10567 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10571 xxx="probably a USG one, i.e. you use setpgrp()."
10576 echo "Assuming your setpgrp is $xxx" >&4
10585 : Look for GCC-style __builtin_choose_expr
10586 case "$d_builtin_choose_expr" in
10589 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10590 $cat >try.c <<'EOCP'
10591 #include <assert.h>
10592 #include <stdlib.h>
10595 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10598 assert( SYRINX(1) == 2112 );
10599 assert( SYRINX(1) != 5150 );
10600 assert( SYRINX(0) == 5150 );
10601 assert( SYRINX(0) != 2112 );
10602 puts( "All good!" );
10608 if eval $compile && $run ./try; then
10609 echo "Your C compiler supports __builtin_choose_expr."
10612 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10616 *) val="$d_builtin_choose_expr" ;;
10619 set d_builtin_choose_expr
10623 : Look for GCC-style __builtin_expect
10624 case "$d_builtin_expect" in
10627 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10628 $cat >try.c <<'EOCP'
10631 if ( __builtin_expect(n, 0) ) n = 1;
10632 /* Remember shell exit code truth is 0, C truth is non-zero */
10637 if eval $compile && $run ./try; then
10638 echo "Your C compiler supports __builtin_expect."
10641 echo "Your C compiler doesn't seem to understand __builtin_expect."
10645 *) val="$d_builtin_expect" ;;
10648 set d_builtin_expect
10652 : see if bzero exists
10656 : see if stdarg is available
10658 if $test `./findhdr stdarg.h`; then
10659 echo "<stdarg.h> found." >&4
10662 echo "<stdarg.h> NOT found." >&4
10666 : see if varags is available
10668 if $test `./findhdr varargs.h`; then
10669 echo "<varargs.h> found." >&4
10671 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10674 : set up the varargs testing programs
10675 $cat > varargs.c <<EOP
10677 #include <stdarg.h>
10680 #include <varargs.h>
10684 int f(char *p, ...)
10698 p = va_arg(ap, char *);
10704 $cat > varargs <<EOP
10706 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10715 : now check which varargs header should be included
10720 if `./varargs I_STDARG`; then
10722 elif `./varargs I_VARARGS`; then
10727 if `./varargs I_VARARGS`; then
10734 echo "I could not find the definition for va_dcl... You have problems..." >&4
10735 val="$undef"; set i_stdarg; eval $setvar
10736 val="$undef"; set i_varargs; eval $setvar
10741 case "$i_varhdr" in
10743 val="$define"; set i_stdarg; eval $setvar
10744 val="$undef"; set i_varargs; eval $setvar
10747 val="$undef"; set i_stdarg; eval $setvar
10748 val="$define"; set i_varargs; eval $setvar
10751 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10755 : see if the Compiler supports C99 variadic macros
10756 case "$i_stdarg$i_stdlib" in
10758 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10761 #include <stdarg.h>
10763 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10767 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10773 if eval $compile && $run ./try 2>&1 >/dev/null; then
10774 case "`$run ./try`" in
10776 echo "You have C99 variadic macros." >&4
10777 d_c99_variadic_macros="$define"
10780 echo "You don't have functional C99 variadic macros." >&4
10781 d_c99_variadic_macros="$undef"
10785 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10786 d_c99_variadic_macros="$undef"
10791 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10792 d_c99_variadic_macros="$undef"
10796 : see if signal is declared as pointer to function returning int or void
10798 xxx=`./findhdr signal.h`
10799 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10800 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10801 echo "You have int (*signal())() instead of void." >&4
10803 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10804 echo "You have void (*signal())()." >&4
10806 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10807 echo "You have int (*signal())() instead of void." >&4
10809 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10810 echo "You have void (*signal())()." >&4
10813 case "$d_voidsig" in
10815 echo "I can't determine whether signal handler returns void or int..." >&4
10817 rp="What type does your signal handler return?"
10820 v*) val="$define";;
10824 echo "As you already told me, signal handler returns void." >&4
10827 *) echo "As you already told me, signal handler returns int." >&4
10834 case "$d_voidsig" in
10835 "$define") signal_t="void";;
10836 *) signal_t="int";;
10840 : check for ability to cast large floats to 32-bit ints.
10842 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10843 if $test "$intsize" -ge 4; then
10850 #$i_stdlib I_STDLIB
10852 #include <stdlib.h>
10854 #include <sys/types.h>
10855 #include <signal.h>
10856 $signal_t blech(int s) { exit(3); }
10863 signal(SIGFPE, blech);
10865 /* Don't let compiler optimize the test away. Store the number
10866 in a writable string for gcc to pass to sscanf under HP/UX.
10868 sprintf(str, "2147483647");
10869 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10873 /* x86 processors will probably give 0x8000 0000, which is a
10874 sign change. We don't want that. We want to mimic SPARC
10875 behavior here, which is to preserve the sign and give
10878 if (i32 != ($xxx) f)
10884 if eval $compile_ok; then
10888 echo "(I can't seem to compile the test program--assuming it can't)"
10893 echo "Yup, it can."
10896 echo "Nope, it can't."
10903 : check for ability to cast negative floats to unsigned
10905 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10908 #$i_stdlib I_STDLIB
10910 #include <stdlib.h>
10912 #include <sys/types.h>
10913 #include <signal.h>
10914 $signal_t blech(int s) { exit(7); }
10915 $signal_t blech_in_list(int s) { exit(4); }
10916 unsigned long dummy_long(unsigned long p) { return p; }
10917 unsigned int dummy_int(unsigned int p) { return p; }
10918 unsigned short dummy_short(unsigned short p) { return p; }
10922 unsigned long along;
10924 unsigned short ashort;
10928 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10929 a direct f = -123. assignment. gcc-2.8.0 reportedly
10930 optimized the whole file away
10932 /* Store the number in a writable string for gcc to pass to
10933 sscanf under HP/UX.
10935 sprintf(str, "-123");
10936 sscanf(str, "%lf", &f); /* f = -123.; */
10938 signal(SIGFPE, blech);
10939 along = (unsigned long)f;
10940 aint = (unsigned int)f;
10941 ashort = (unsigned short)f;
10942 if (along != (unsigned long)-123)
10944 if (aint != (unsigned int)-123)
10946 if (ashort != (unsigned short)-123)
10948 sprintf(str, "1073741824.");
10949 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10952 along = (unsigned long)f;
10953 if (along != 0x80000000)
10957 along = (unsigned long)f;
10958 if (along != 0x7fffffff)
10962 along = (unsigned long)f;
10963 if (along != 0x80000001)
10967 signal(SIGFPE, blech_in_list);
10968 sprintf(str, "123.");
10969 sscanf(str, "%lf", &f); /* f = 123.; */
10970 along = dummy_long((unsigned long)f);
10971 aint = dummy_int((unsigned int)f);
10972 ashort = dummy_short((unsigned short)f);
10973 if (along != (unsigned long)123)
10975 if (aint != (unsigned int)123)
10977 if (ashort != (unsigned short)123)
10984 if eval $compile_ok; then
10988 echo "(I can't seem to compile the test program--assuming it can't)"
10991 case "$castflags" in
10993 echo "Yup, it can."
10996 echo "Nope, it can't."
11003 : see if vprintf exists
11005 if set vprintf val -f d_vprintf; eval $csym; $val; then
11006 echo 'vprintf() found.' >&4
11009 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11010 #$i_varargs I_VARARGS
11012 #$i_stdlib I_STDLIB
11013 #$i_unistd I_UNISTD
11016 # include <stdarg.h>
11017 #else /* I_VARARGS */
11018 # include <varargs.h>
11022 # include <unistd.h>
11026 # include <stdlib.h>
11029 #include <stdio.h> /* vsprintf prototype */
11032 void xxx(int n, ...)
11037 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11039 int main() { xxx(1, "foo"); }
11041 #else /* I_VARARGS */
11049 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11051 int main() { xxx("foo"); }
11057 if eval $compile_ok; then
11058 if $run ./try; then
11059 echo "Your vsprintf() returns (int)." >&4
11062 echo "Your vsprintf() returns (char*)." >&4
11066 echo 'I am unable to compile the vsprintf() test program.' >&4
11067 # We shouldn't get here. If we do, assume the standard signature,
11068 # not the old BSD one.
11069 echo 'Guessing that vsprintf() returns (int).' >&4
11073 echo 'vprintf() NOT found.' >&4
11084 : see if chown exists
11088 : see if chroot exists
11089 set chroot d_chroot
11092 : see if chsize exists
11093 set chsize d_chsize
11096 : see if class exists
11100 : see if clearenv exists
11101 set clearenv d_clearenv
11104 : Define hasstruct macro for Configure internal use
11105 hasstruct='varname=$1; struct=$2; shift; shift;
11106 while $test $# -ge 2; do
11108 $define) echo "#include <$2>";;
11112 echo "int main () { struct $struct foo; }" >> try.c;
11114 if eval $compile; then
11123 : see whether socket exists
11127 $echo $n "Hmm... $c" >&4
11128 if set socket val -f d_socket; eval $csym; $val; then
11129 echo "Looks like you have Berkeley networking support." >&4
11131 if set setsockopt val -f; eval $csym; $val; then
11134 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11135 d_oldsock="$define"
11138 if $contains socklib libc.list >/dev/null 2>&1; then
11139 echo "Looks like you have Berkeley networking support." >&4
11141 : we will have to assume that it supports the 4.2 BSD interface
11144 echo "You don't have Berkeley networking in libc$_a..." >&4
11145 if test "X$d_socket" = "X$define"; then
11146 echo "...but you seem to believe that you have sockets." >&4
11148 for net in net socket
11150 if test -f /usr/lib/lib$net$_a; then
11151 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11152 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11153 if $contains socket libc.list >/dev/null 2>&1; then
11158 echo "...but the Wollongong group seems to have hacked it in." >&4
11159 sockethdr="-I/usr/netinclude"
11162 echo "Found Berkeley sockets interface in lib$net." >&4
11163 if $contains setsockopt libc.list >/dev/null 2>&1; then
11166 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11167 d_oldsock="$define"
11173 if test "X$d_socket" != "X$define"; then
11174 echo "or anywhere else I see." >&4
11182 : see if socketpair exists
11183 set socketpair d_sockpair
11188 echo "Checking the availability of certain socket constants..." >&4
11189 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11190 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11192 #include <sys/types.h>
11193 #include <sys/socket.h>
11199 set try; if eval $compile; then
11202 set d_${enum}; eval $setvar
11206 : see if this is a sys/uio.h system
11207 set sys/uio.h i_sysuio
11210 : Check for cmsghdr support
11212 echo "Checking to see if your system supports struct cmsghdr..." >&4
11213 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11215 case "$d_cmsghdr_s" in
11216 "$define") echo "Yes, it does." ;;
11217 *) echo "No, it doesn't." ;;
11221 : check for const keyword
11223 echo 'Checking to see if your C compiler knows about "const"...' >&4
11224 $cat >const.c <<'EOCP'
11225 typedef struct spug { int drokk; } spug;
11229 const spug y = { 0 };
11232 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11234 echo "Yup, it does."
11237 echo "Nope, it doesn't."
11242 : see if copysignl exists
11243 set copysignl d_copysignl
11246 : see if crypt exists
11251 $define) cryptlib='' ;;
11252 *) if set crypt val -f d_crypt; eval $csym; $val; then
11253 echo 'crypt() found.' >&4
11257 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11258 if $test -z "$cryptlib"; then
11259 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11263 if $test -z "$cryptlib"; then
11264 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11268 if $test -z "$cryptlib"; then
11269 cryptlib=`./loc libcrypt$_a "" $libpth`
11273 if $test -z "$cryptlib"; then
11274 echo 'crypt() NOT found.' >&4
11285 : see if this is a crypt.h system
11286 set crypt.h i_crypt
11289 : see if crypt_r exists
11290 set crypt_r d_crypt_r
11292 case "$d_crypt_r" in
11294 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11295 case "$d_crypt_r_proto:$usethreads" in
11296 ":define") d_crypt_r_proto=define
11297 set d_crypt_r_proto crypt_r $hdrs
11301 case "$d_crypt_r_proto" in
11303 case "$crypt_r_proto" in
11304 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11305 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11307 case "$crypt_r_proto" in
11308 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11309 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11311 case "$crypt_r_proto" in
11312 ''|0) d_crypt_r=undef
11314 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11315 * ) case "$crypt_r_proto" in
11316 REENTRANT_PROTO*) ;;
11317 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11319 echo "Prototype: $try" ;;
11322 *) case "$usethreads" in
11323 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11334 : get csh whereabouts
11336 'csh') val="$undef" ;;
11337 *) val="$define" ;;
11341 : Respect a hint or command line value for full_csh.
11342 case "$full_csh" in
11343 '') full_csh=$csh ;;
11346 : see if ctermid exists
11347 set ctermid d_ctermid
11350 : see if ctermid_r exists
11351 set ctermid_r d_ctermid_r
11353 case "$d_ctermid_r" in
11355 hdrs="$i_systypes sys/types.h define stdio.h "
11356 case "$d_ctermid_r_proto:$usethreads" in
11357 ":define") d_ctermid_r_proto=define
11358 set d_ctermid_r_proto ctermid_r $hdrs
11362 case "$d_ctermid_r_proto" in
11364 case "$ctermid_r_proto" in
11365 ''|0) try='char* ctermid_r(char*);'
11366 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11368 case "$ctermid_r_proto" in
11369 ''|0) d_ctermid_r=undef
11371 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11372 * ) case "$ctermid_r_proto" in
11373 REENTRANT_PROTO*) ;;
11374 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11376 echo "Prototype: $try" ;;
11379 *) case "$usethreads" in
11380 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11387 *) ctermid_r_proto=0
11391 : see if ctime_r exists
11392 set ctime_r d_ctime_r
11394 case "$d_ctime_r" in
11396 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11397 case "$d_ctime_r_proto:$usethreads" in
11398 ":define") d_ctime_r_proto=define
11399 set d_ctime_r_proto ctime_r $hdrs
11403 case "$d_ctime_r_proto" in
11405 case "$ctime_r_proto" in
11406 ''|0) try='char* ctime_r(const time_t*, char*);'
11407 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11409 case "$ctime_r_proto" in
11410 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11411 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11413 case "$ctime_r_proto" in
11414 ''|0) try='int ctime_r(const time_t*, char*);'
11415 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11417 case "$ctime_r_proto" in
11418 ''|0) try='int ctime_r(const time_t*, char*, int);'
11419 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11421 case "$ctime_r_proto" in
11422 ''|0) d_ctime_r=undef
11424 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11425 * ) case "$ctime_r_proto" in
11426 REENTRANT_PROTO*) ;;
11427 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11429 echo "Prototype: $try" ;;
11432 *) case "$usethreads" in
11433 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11444 : see if cuserid exists
11445 set cuserid d_cuserid
11448 : see if this is a limits.h system
11449 set limits.h i_limits
11452 : see if this is a float.h system
11453 set float.h i_float
11456 : See if number of significant digits in a double precision number is known
11458 $cat >dbl_dig.c <<EOM
11459 #$i_limits I_LIMITS
11462 #include <limits.h>
11468 printf("Contains DBL_DIG");
11471 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11472 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11473 echo "DBL_DIG found." >&4
11476 echo "DBL_DIG NOT found." >&4
11483 : see if dbm.h is available
11484 : see if dbmclose exists
11485 set dbmclose d_dbmclose
11488 case "$d_dbmclose" in
11498 *) set rpcsvc/dbm.h i_rpcsvcdbm
11503 *) echo "We won't be including <dbm.h>"
11513 : see if prototype for dbminit is available
11515 set d_dbminitproto dbminit $i_dbm dbm.h
11518 : see if difftime exists
11519 set difftime d_difftime
11522 : see if this is a dirent system
11524 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11526 echo "<dirent.h> found." >&4
11529 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11530 echo "<sys/dir.h> found." >&4
11533 xinc=`./findhdr sys/ndir.h`
11535 echo "<dirent.h> NOT found." >&4
11540 : Look for type of directory structure.
11542 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11544 case "$direntrytype" in
11546 case "$i_dirent" in
11547 $define) guess1='struct dirent' ;;
11548 *) guess1='struct direct' ;;
11551 *) guess1="$direntrytype"
11556 'struct dirent') guess2='struct direct' ;;
11557 *) guess2='struct dirent' ;;
11560 if $contains "$guess1" try.c >/dev/null 2>&1; then
11561 direntrytype="$guess1"
11562 echo "Your directory entries are $direntrytype." >&4
11563 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11564 direntrytype="$guess2"
11565 echo "Your directory entries seem to be $direntrytype." >&4
11567 echo "I don't recognize your system's directory entries." >&4
11568 rp="What type is used for directory entries on this system?"
11571 direntrytype="$ans"
11575 : see if the directory entry stores field length
11577 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11578 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11579 echo "Good, your directory entry keeps length information in d_namlen." >&4
11582 echo "Your directory entry does not know about the d_namlen field." >&4
11589 : Look for DIR.dd_fd
11590 case "$i_dirent" in
11592 echo "Checking to see if DIR has a dd_fd member variable" >&4
11594 #$i_stdlib I_STDLIB
11596 #include <stdlib.h>
11598 #include <dirent.h>
11608 if eval $compile; then
11609 echo "Yes, it does."
11612 echo "No, it does not."
11617 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11625 : see if this is an sysdir system
11626 set sys/dir.h i_sysdir
11629 : see if this is an sysndir system
11630 set sys/ndir.h i_sysndir
11635 $cat >dirfd.c <<EOM
11637 #$i_stdlib I_STDLIB
11639 #include <stdlib.h>
11641 #$i_dirent I_DIRENT /**/
11642 #$i_sysdir I_SYS_DIR /**/
11643 #$i_sysndir I_SYS_NDIR /**/
11644 #$i_systypes I_SYS_TYPES /**/
11645 #if defined(I_SYS_TYPES)
11646 #include <sys/types.h>
11648 #if defined(I_DIRENT)
11649 #include <dirent.h>
11650 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11651 #include <sys/dir.h>
11655 #include <sys/ndir.h>
11659 #include <ndir.h> /* may be wrong in the future */
11661 #include <sys/dir.h>
11667 DIR *dirp = opendir(".");
11668 if (dirfd(dirp) >= 0)
11676 if eval $compile; then
11680 $define) echo "dirfd() found." >&4 ;;
11681 *) echo "dirfd() NOT found." >&4 ;;
11687 : see if dlerror exists
11690 set dlerror d_dlerror
11694 : see if dlfcn is available
11695 set dlfcn.h i_dlfcn
11698 : Check what extension to use for shared libs
11703 On a few systems, the dynamically loaded modules that perl generates and uses
11704 will need a different extension than shared libs. The default will probably
11710 *) dflt="$dlext" ;;
11712 rp='What is the extension of dynamically loaded modules'
11721 : Check if dlsym need a leading underscore
11727 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11728 $cat >dyna.c <<'EOM'
11735 #$i_stdlib I_STDLIB
11737 #include <stdlib.h>
11741 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11743 #include <sys/types.h>
11748 extern int fred() ;
11757 int mode = RTLD_LAZY ;
11759 handle = dlopen("./dyna.$dlext", mode) ;
11760 if (handle == NULL) {
11765 symbol = dlsym(handle, "fred") ;
11766 if (symbol == NULL) {
11767 /* try putting a leading underscore */
11768 symbol = dlsym(handle, "_fred") ;
11769 if (symbol == NULL) {
11782 : Call the object file tmp-dyna.o in case dlext=o.
11783 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11784 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11785 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11786 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11789 1) echo "Test program failed using dlopen." >&4
11790 echo "Perhaps you should not use dynamic loading." >&4;;
11791 2) echo "Test program failed using dlsym." >&4
11792 echo "Perhaps you should not use dynamic loading." >&4;;
11793 3) echo "dlsym needs a leading underscore" >&4
11795 4) echo "dlsym doesn't need a leading underscore." >&4;;
11798 echo "I can't compile and run the test program." >&4
11799 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11804 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11809 : see if drand48_r exists
11810 set drand48_r d_drand48_r
11812 case "$d_drand48_r" in
11814 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11815 case "$d_drand48_r_proto:$usethreads" in
11816 ":define") d_drand48_r_proto=define
11817 set d_drand48_r_proto drand48_r $hdrs
11821 case "$d_drand48_r_proto" in
11823 case "$drand48_r_proto" in
11824 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11825 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11827 case "$drand48_r_proto" in
11828 ''|0) d_drand48_r=undef
11830 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11831 * ) case "$drand48_r_proto" in
11832 REENTRANT_PROTO*) ;;
11833 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11835 echo "Prototype: $try" ;;
11838 *) case "$usethreads" in
11839 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11846 *) drand48_r_proto=0
11850 : see if prototype for drand48 is available
11852 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11855 : see if dup2 exists
11859 : see if eaccess exists
11860 set eaccess d_eaccess
11863 : see if endgrent exists
11864 set endgrent d_endgrent
11867 : see if this is an grp system
11873 xxx=`./findhdr grp.h`
11874 $cppstdin $cppflags $cppminus < $xxx >$$.h
11876 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11888 set d_grpasswd; eval $setvar
11892 : see if endgrent_r exists
11893 set endgrent_r d_endgrent_r
11895 case "$d_endgrent_r" in
11897 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11898 case "$d_endgrent_r_proto:$usethreads" in
11899 ":define") d_endgrent_r_proto=define
11900 set d_endgrent_r_proto endgrent_r $hdrs
11904 case "$d_endgrent_r_proto" in
11906 case "$endgrent_r_proto" in
11907 ''|0) try='int endgrent_r(FILE**);'
11908 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11910 case "$endgrent_r_proto" in
11911 ''|0) try='void endgrent_r(FILE**);'
11912 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11914 case "$endgrent_r_proto" in
11915 ''|0) d_endgrent_r=undef
11917 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11918 * ) case "$endgrent_r_proto" in
11919 REENTRANT_PROTO*) ;;
11920 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11922 echo "Prototype: $try" ;;
11925 *) case "$usethreads" in
11926 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11933 *) endgrent_r_proto=0
11937 : see if endhostent exists
11938 set endhostent d_endhent
11941 : see if this is a netdb.h system
11942 set netdb.h i_netdb
11945 : see if endhostent_r exists
11946 set endhostent_r d_endhostent_r
11948 case "$d_endhostent_r" in
11950 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11951 case "$d_endhostent_r_proto:$usethreads" in
11952 ":define") d_endhostent_r_proto=define
11953 set d_endhostent_r_proto endhostent_r $hdrs
11957 case "$d_endhostent_r_proto" in
11959 case "$endhostent_r_proto" in
11960 ''|0) try='int endhostent_r(struct hostent_data*);'
11961 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11963 case "$endhostent_r_proto" in
11964 ''|0) try='void endhostent_r(struct hostent_data*);'
11965 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11967 case "$endhostent_r_proto" in
11968 ''|0) d_endhostent_r=undef
11969 endhostent_r_proto=0
11970 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11971 * ) case "$endhostent_r_proto" in
11972 REENTRANT_PROTO*) ;;
11973 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11975 echo "Prototype: $try" ;;
11978 *) case "$usethreads" in
11979 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11981 d_endhostent_r=undef
11982 endhostent_r_proto=0
11986 *) endhostent_r_proto=0
11990 : see if endnetent exists
11991 set endnetent d_endnent
11994 : see if endnetent_r exists
11995 set endnetent_r d_endnetent_r
11997 case "$d_endnetent_r" in
11999 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12000 case "$d_endnetent_r_proto:$usethreads" in
12001 ":define") d_endnetent_r_proto=define
12002 set d_endnetent_r_proto endnetent_r $hdrs
12006 case "$d_endnetent_r_proto" in
12008 case "$endnetent_r_proto" in
12009 ''|0) try='int endnetent_r(struct netent_data*);'
12010 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
12012 case "$endnetent_r_proto" in
12013 ''|0) try='void endnetent_r(struct netent_data*);'
12014 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
12016 case "$endnetent_r_proto" in
12017 ''|0) d_endnetent_r=undef
12018 endnetent_r_proto=0
12019 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12020 * ) case "$endnetent_r_proto" in
12021 REENTRANT_PROTO*) ;;
12022 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12024 echo "Prototype: $try" ;;
12027 *) case "$usethreads" in
12028 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12030 d_endnetent_r=undef
12031 endnetent_r_proto=0
12035 *) endnetent_r_proto=0
12039 : see if endprotoent exists
12040 set endprotoent d_endpent
12043 : see if endprotoent_r exists
12044 set endprotoent_r d_endprotoent_r
12046 case "$d_endprotoent_r" in
12048 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12049 case "$d_endprotoent_r_proto:$usethreads" in
12050 ":define") d_endprotoent_r_proto=define
12051 set d_endprotoent_r_proto endprotoent_r $hdrs
12055 case "$d_endprotoent_r_proto" in
12057 case "$endprotoent_r_proto" in
12058 ''|0) try='int endprotoent_r(struct protoent_data*);'
12059 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12061 case "$endprotoent_r_proto" in
12062 ''|0) try='void endprotoent_r(struct protoent_data*);'
12063 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12065 case "$endprotoent_r_proto" in
12066 ''|0) d_endprotoent_r=undef
12067 endprotoent_r_proto=0
12068 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12069 * ) case "$endprotoent_r_proto" in
12070 REENTRANT_PROTO*) ;;
12071 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12073 echo "Prototype: $try" ;;
12076 *) case "$usethreads" in
12077 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12079 d_endprotoent_r=undef
12080 endprotoent_r_proto=0
12084 *) endprotoent_r_proto=0
12088 : see if endpwent exists
12089 set endpwent d_endpwent
12092 : see if this is a pwd.h system
12098 xxx=`./findhdr pwd.h`
12099 $cppstdin $cppflags $cppminus < $xxx >$$.h
12101 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12109 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12117 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12125 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12133 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12141 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12149 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12157 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12169 set d_pwquota; eval $setvar
12170 set d_pwage; eval $setvar
12171 set d_pwchange; eval $setvar
12172 set d_pwclass; eval $setvar
12173 set d_pwexpire; eval $setvar
12174 set d_pwcomment; eval $setvar
12175 set d_pwgecos; eval $setvar
12176 set d_pwpasswd; eval $setvar
12180 : see if endpwent_r exists
12181 set endpwent_r d_endpwent_r
12183 case "$d_endpwent_r" in
12185 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12186 case "$d_endpwent_r_proto:$usethreads" in
12187 ":define") d_endpwent_r_proto=define
12188 set d_endpwent_r_proto endpwent_r $hdrs
12192 case "$d_endpwent_r_proto" in
12194 case "$endpwent_r_proto" in
12195 ''|0) try='int endpwent_r(FILE**);'
12196 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12198 case "$endpwent_r_proto" in
12199 ''|0) try='void endpwent_r(FILE**);'
12200 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12202 case "$endpwent_r_proto" in
12203 ''|0) d_endpwent_r=undef
12205 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12206 * ) case "$endpwent_r_proto" in
12207 REENTRANT_PROTO*) ;;
12208 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12210 echo "Prototype: $try" ;;
12213 *) case "$usethreads" in
12214 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12221 *) endpwent_r_proto=0
12225 : see if endservent exists
12226 set endservent d_endsent
12229 : see if endservent_r exists
12230 set endservent_r d_endservent_r
12232 case "$d_endservent_r" in
12234 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12235 case "$d_endservent_r_proto:$usethreads" in
12236 ":define") d_endservent_r_proto=define
12237 set d_endservent_r_proto endservent_r $hdrs
12241 case "$d_endservent_r_proto" in
12243 case "$endservent_r_proto" in
12244 ''|0) try='int endservent_r(struct servent_data*);'
12245 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12247 case "$endservent_r_proto" in
12248 ''|0) try='void endservent_r(struct servent_data*);'
12249 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12251 case "$endservent_r_proto" in
12252 ''|0) d_endservent_r=undef
12253 endservent_r_proto=0
12254 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12255 * ) case "$endservent_r_proto" in
12256 REENTRANT_PROTO*) ;;
12257 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12259 echo "Prototype: $try" ;;
12262 *) case "$usethreads" in
12263 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12265 d_endservent_r=undef
12266 endservent_r_proto=0
12270 *) endservent_r_proto=0
12274 : Locate the flags for 'open()'
12277 #include <sys/types.h>
12282 #include <sys/file.h>
12284 #$i_stdlib I_STDLIB
12286 #include <stdlib.h>
12297 : check sys/file.h first to get FREAD on Sun
12298 if $test `./findhdr sys/file.h` && \
12299 set try -DI_SYS_FILE && eval $compile; then
12301 echo "<sys/file.h> defines the O_* constants..." >&4
12302 if $run ./try; then
12303 echo "and you have the 3 argument form of open()." >&4
12306 echo "but not the 3 argument form of open(). Oh, well." >&4
12309 elif $test `./findhdr fcntl.h` && \
12310 set try -DI_FCNTL && eval $compile; then
12312 echo "<fcntl.h> defines the O_* constants..." >&4
12313 if $run ./try; then
12314 echo "and you have the 3 argument form of open()." >&4
12317 echo "but not the 3 argument form of open(). Oh, well." >&4
12322 echo "I can't find the O_* constant definitions! You got problems." >&4
12328 : script used to emit important warnings
12331 if test \$# -gt 0; then
12336 echo "*** WARNING:" >&4
12337 sed -e 's/^/*** /' <msg >&4
12339 cat msg >>config.msg
12340 echo " " >>config.msg
12346 : see which of string.h or strings.h is needed
12348 strings=`./findhdr string.h`
12349 if $test "$strings" && $test -r "$strings"; then
12350 echo "Using <string.h> instead of <strings.h>." >&4
12354 strings=`./findhdr strings.h`
12355 if $test "$strings" && $test -r "$strings"; then
12356 echo "Using <strings.h> instead of <string.h>." >&4
12358 ./warn "No string header found -- You'll surely have problems."
12363 case "$i_string" in
12364 "$undef") strings=`./findhdr strings.h`;;
12365 *) strings=`./findhdr string.h`;;
12368 : see if this is a sys/file.h system
12373 : do we need to include sys/file.h ?
12377 if $h_sysfile; then
12379 echo "We'll be including <sys/file.h>." >&4
12382 echo "We won't be including <sys/file.h>." >&4
12392 : see if fcntl.h is there
12397 : see if we can include fcntl.h
12403 echo "We'll be including <fcntl.h>." >&4
12406 if $h_sysfile; then
12407 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12409 echo "We won't be including <fcntl.h>." >&4
12421 : see if fork exists
12425 : see if pipe exists
12429 : check for non-blocking I/O stuff
12430 case "$h_sysfile" in
12431 true) echo "#include <sys/file.h>" > head.c;;
12434 true) echo "#include <fcntl.h>" > head.c;;
12435 *) echo "#include <sys/fcntl.h>" > head.c;;
12440 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12441 case "$o_nonblock" in
12443 $cat head.c > try.c
12444 $cat >>try.c <<EOCP
12446 #$i_stdlib I_STDLIB
12448 #include <stdlib.h>
12456 printf("O_NONBLOCK\n");
12460 printf("O_NDELAY\n");
12464 printf("FNDELAY\n");
12471 if eval $compile_ok; then
12472 o_nonblock=`$run ./try`
12473 case "$o_nonblock" in
12474 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12475 *) echo "Seems like we can use $o_nonblock.";;
12478 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12481 *) echo "Using $hint value $o_nonblock.";;
12486 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12489 case "$d_fork:$d_pipe" in
12491 $cat head.c > try.c
12492 $cat >>try.c <<EOCP
12494 #include <sys/types.h>
12495 #include <signal.h>
12497 #$i_stdlib I_STDLIB
12499 #include <stdlib.h>
12505 #define MY_O_NONBLOCK $o_nonblock
12506 #ifndef errno /* XXX need better Configure test */
12509 #$i_unistd I_UNISTD
12511 #include <unistd.h>
12513 #$i_string I_STRING
12515 #include <string.h>
12517 #include <strings.h>
12519 $signal_t blech(int x) { exit(3); }
12521 $cat >> try.c <<'EOCP'
12529 pipe(pd); /* Down: child -> parent */
12530 pipe(pu); /* Up: parent -> child */
12533 close(pd[1]); /* Parent reads from pd[0] */
12534 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12536 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12541 signal(SIGALRM, blech);
12543 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12545 sprintf(string, "%d\n", ret);
12546 write(2, string, strlen(string));
12549 if (errno == EAGAIN) {
12550 printf("EAGAIN\n");
12555 if (errno == EWOULDBLOCK)
12556 printf("EWOULDBLOCK\n");
12559 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12560 sleep(2); /* Give it time to close our pipe */
12562 ret = read(pd[0], buf, 1); /* Should read EOF */
12564 sprintf(string, "%d\n", ret);
12565 write(4, string, strlen(string));
12569 close(pd[0]); /* We write to pd[1] */
12570 close(pu[1]); /* We read from pu[0] */
12571 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12572 close(pd[1]); /* Pipe pd is now fully closed! */
12573 exit(0); /* Bye bye, thank you for playing! */
12577 if eval $compile_ok; then
12578 echo "$startsh" >mtry
12579 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12581 ./mtry >/dev/null 2>&1
12583 0) eagain=`$cat try.out`;;
12584 1) echo "Could not perform non-blocking setting!";;
12585 2) echo "I did a successful read() for something that was not there!";;
12586 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12587 4) echo "Could not find F_SETFL!";;
12588 *) echo "Something terribly wrong happened during testing.";;
12590 rd_nodata=`$cat try.ret`
12591 echo "A read() system call with no data present returns $rd_nodata."
12592 case "$rd_nodata" in
12595 echo "(That's peculiar, fixing that to be -1.)"
12601 echo "Forcing errno EAGAIN on read() with no data available."
12605 echo "Your read() sets errno to $eagain when no data is available."
12608 status=`$cat try.err`
12610 0) echo "And it correctly returns 0 to signal EOF.";;
12611 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12612 *) echo "However, your read() returns '$status' on EOF??";;
12615 if test "$status" = "$rd_nodata"; then
12616 echo "WARNING: you can't distinguish between EOF and no data!"
12620 echo "I can't compile the test program--assuming errno EAGAIN will do."
12624 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12633 echo "Using $hint value $eagain."
12634 echo "Your read() returns $rd_nodata when no data is present."
12635 case "$d_eofnblk" in
12636 "$define") echo "And you can see EOF because read() returns 0.";;
12637 "$undef") echo "But you can't see EOF status from read() returned value.";;
12639 echo "(Assuming you can't see EOF status from read anyway.)"
12645 $rm_try head.c mtry
12647 : see if _ptr and _cnt from stdio act std
12650 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12651 echo "(Looks like you have stdio.h from BSD.)"
12652 case "$stdio_ptr" in
12653 '') stdio_ptr='((fp)->_p)'
12656 *) ptr_lval=$d_stdio_ptr_lval;;
12658 case "$stdio_cnt" in
12659 '') stdio_cnt='((fp)->_r)'
12662 *) cnt_lval=$d_stdio_cnt_lval;;
12664 case "$stdio_base" in
12665 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12667 case "$stdio_bufsiz" in
12668 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12670 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12671 echo "(Looks like you have stdio.h from Linux.)"
12672 case "$stdio_ptr" in
12673 '') stdio_ptr='((fp)->_IO_read_ptr)'
12676 *) ptr_lval=$d_stdio_ptr_lval;;
12678 case "$stdio_cnt" in
12679 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12682 *) cnt_lval=$d_stdio_cnt_lval;;
12684 case "$stdio_base" in
12685 '') stdio_base='((fp)->_IO_read_base)';;
12687 case "$stdio_bufsiz" in
12688 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12691 case "$stdio_ptr" in
12692 '') stdio_ptr='((fp)->_ptr)'
12695 *) ptr_lval=$d_stdio_ptr_lval;;
12697 case "$stdio_cnt" in
12698 '') stdio_cnt='((fp)->_cnt)'
12701 *) cnt_lval=$d_stdio_cnt_lval;;
12703 case "$stdio_base" in
12704 '') stdio_base='((fp)->_base)';;
12706 case "$stdio_bufsiz" in
12707 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12711 : test whether _ptr and _cnt really work
12712 echo "Checking how std your stdio is..." >&4
12715 #$i_stdlib I_STDLIB
12717 #include <stdlib.h>
12719 #define FILE_ptr(fp) $stdio_ptr
12720 #define FILE_cnt(fp) $stdio_cnt
12722 FILE *fp = fopen("try.c", "r");
12725 18 <= FILE_cnt(fp) &&
12726 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12734 if eval $compile && $to try.c; then
12735 if $run ./try; then
12736 echo "Your stdio acts pretty std."
12739 echo "Your stdio isn't very std."
12742 echo "Your stdio doesn't appear very std."
12746 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12747 # direct buffer manipulation no longer works. The Configure tests
12748 # should be changed to correctly detect this, but until then,
12749 # the following check should at least let perl compile and run.
12750 # (This quick fix should be updated before 5.8.1.)
12751 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12752 # A. Dougherty, June 3, 2002.
12753 case "$d_gnulibc" in
12755 case "$gnulibc_version" in
12759 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12768 : Can _ptr be used as an lvalue?
12769 case "$d_stdstdio$ptr_lval" in
12770 $define$define) val=$define ;;
12773 set d_stdio_ptr_lval
12776 : Can _cnt be used as an lvalue?
12777 case "$d_stdstdio$cnt_lval" in
12778 $define$define) val=$define ;;
12781 set d_stdio_cnt_lval
12785 : test whether setting _ptr sets _cnt as a side effect
12786 d_stdio_ptr_lval_sets_cnt="$undef"
12787 d_stdio_ptr_lval_nochange_cnt="$undef"
12788 case "$d_stdio_ptr_lval$d_stdstdio" in
12790 echo "Checking to see what happens if we set the stdio ptr..." >&4
12793 /* Can we scream? */
12794 /* Eat dust sed :-) */
12795 /* In the buffer space, no one can hear you scream. */
12796 #$i_stdlib I_STDLIB
12798 #include <stdlib.h>
12800 #define FILE_ptr(fp) $stdio_ptr
12801 #define FILE_cnt(fp) $stdio_cnt
12802 #include <sys/types.h>
12804 FILE *fp = fopen("try.c", "r");
12809 puts("Fail even to read");
12812 c = getc(fp); /* Read away the first # */
12814 puts("Fail even to read");
12818 18 <= FILE_cnt(fp) &&
12819 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12821 puts("Fail even to read");
12824 ptr = (char*) FILE_ptr(fp);
12825 cnt = (size_t)FILE_cnt(fp);
12827 FILE_ptr(fp) += 42;
12829 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12830 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12833 if (FILE_cnt(fp) <= 20) {
12834 printf ("Fail (<20 chars to test)");
12837 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12838 puts("Fail compare");
12841 if (cnt == FILE_cnt(fp)) {
12842 puts("Pass_unchanged");
12845 if (FILE_cnt(fp) == (cnt - 42)) {
12846 puts("Pass_changed");
12849 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12855 if eval $compile && $to try.c; then
12856 case `$run ./try` in
12858 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12859 d_stdio_ptr_lval_sets_cnt="$define" ;;
12861 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12862 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12864 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12866 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12869 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12875 : see if _base is also standard
12877 case "$d_stdstdio" in
12881 #$i_stdlib I_STDLIB
12883 #include <stdlib.h>
12885 #define FILE_base(fp) $stdio_base
12886 #define FILE_bufsiz(fp) $stdio_bufsiz
12888 FILE *fp = fopen("try.c", "r");
12891 19 <= FILE_bufsiz(fp) &&
12892 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12899 if eval $compile && $to try.c; then
12900 if $run ./try; then
12901 echo "And its _base field acts std."
12904 echo "But its _base field isn't std."
12907 echo "However, it seems to be lacking the _base field."
12915 : see if fast_stdio exists
12917 case "$d_stdstdio:$d_stdio_ptr_lval" in
12919 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12921 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12932 : see if fchdir exists
12933 set fchdir d_fchdir
12936 : see if fchmod exists
12937 set fchmod d_fchmod
12940 : see if fchown exists
12941 set fchown d_fchown
12944 : see if this is an fcntl system
12948 : See if fcntl-based locking works.
12951 #$i_stdlib I_STDLIB
12953 #include <stdlib.h>
12955 #include <unistd.h>
12957 #include <signal.h>
12958 $signal_t blech(int x) { exit(3); }
12960 #if defined(F_SETLK) && defined(F_SETLKW)
12961 struct flock flock;
12963 fd = open("try.c", O_RDONLY);
12964 flock.l_type = F_RDLCK;
12965 flock.l_whence = SEEK_SET;
12966 flock.l_start = flock.l_len = 0;
12967 signal(SIGALRM, blech);
12969 retval = fcntl(fd, F_SETLK, &flock);
12971 (retval < 0 ? exit(2) : exit(0));
12977 echo "Checking if fcntl-based file locking works... "
12981 if eval $compile_ok; then
12982 if $run ./try; then
12983 echo "Yes, it seems to work."
12986 echo "Nope, it didn't work."
12991 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12992 *** This is (almost) impossible.
12993 *** If your NFS lock daemons are not feeling well, something like
12994 *** this may happen, please investigate. Cannot continue, aborting.
13002 echo "I'm unable to compile the test program, so I'll assume not."
13007 echo "Nope, since you don't even have fcntl()."
13010 set d_fcntl_can_lock
13014 : check for fd_set items
13017 Checking to see how well your C compiler handles fd_set and friends ...
13020 #$i_stdlib I_STDLIB
13022 #include <stdlib.h>
13024 #$i_systime I_SYS_TIME
13025 #$i_sysselct I_SYS_SELECT
13026 #$d_socket HAS_SOCKET
13027 #include <sys/types.h>
13029 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13032 #include <sys/time.h>
13034 #ifdef I_SYS_SELECT
13035 #include <sys/select.h>
13044 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13052 if eval $compile; then
13053 d_fds_bits="$define"
13055 echo "Well, your system knows about the normal fd_set typedef..." >&4
13056 if $run ./try; then
13057 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13058 d_fd_macros="$define"
13061 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13063 d_fd_macros="$undef"
13067 Hmm, your compiler has some difficulty with fd_set. Checking further...
13070 if eval $compile; then
13071 d_fds_bits="$undef"
13073 echo "Well, your system has some sort of fd_set available..." >&4
13074 if $run ./try; then
13075 echo "and you have the normal fd_set macros." >&4
13076 d_fd_macros="$define"
13079 but not the normal fd_set macros! Gross! More work for me...
13081 d_fd_macros="$undef"
13084 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13086 d_fds_bits="$undef"
13087 d_fd_macros="$undef"
13092 : see if fgetpos exists
13093 set fgetpos d_fgetpos
13096 : see if finite exists
13097 set finite d_finite
13100 : see if finitel exists
13101 set finitel d_finitel
13104 : see if flock exists
13108 : see if prototype for flock is available
13110 set d_flockproto flock $i_sysfile sys/file.h
13113 : see if fp_class exists
13114 set fp_class d_fp_class
13117 : see if pathconf exists
13118 set pathconf d_pathconf
13121 : see if fpathconf exists
13122 set fpathconf d_fpathconf
13125 : see if fpclass exists
13126 set fpclass d_fpclass
13129 : see if fpclassify exists
13130 set fpclassify d_fpclassify
13133 : see if fpclassl exists
13134 set fpclassl d_fpclassl
13137 : check for fpos64_t
13139 echo "Checking to see if you have fpos64_t..." >&4
13142 int main() { fpos64_t x = 7; }
13145 if eval $compile; then
13147 echo "You have fpos64_t."
13150 echo "You do not have fpos64_t."
13151 case "$fpossize" in
13152 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13159 : see if frexpl exists
13160 set frexpl d_frexpl
13163 : see if this is a sys/param system
13164 set sys/param.h i_sysparam
13167 : see if this is a sys/mount.h system
13168 set sys/mount.h i_sysmount
13171 : Check for fs_data_s
13173 echo "Checking to see if your system supports struct fs_data..." >&4
13174 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13176 case "$d_fs_data_s" in
13177 "$define") echo "Yes, it does." ;;
13178 *) echo "No, it doesn't." ;;
13181 : see if fseeko exists
13182 set fseeko d_fseeko
13184 case "$longsize" in
13185 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13188 : see if fsetpos exists
13189 set fsetpos d_fsetpos
13192 : see if fstatfs exists
13193 set fstatfs d_fstatfs
13196 : see if statvfs exists
13197 set statvfs d_statvfs
13200 : see if fstatvfs exists
13201 set fstatvfs d_fstatvfs
13205 : see if fsync exists
13209 : see if ftello exists
13210 set ftello d_ftello
13212 case "$longsize" in
13213 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13216 : check for a working futimes
13219 echo "Checking if you have a working futimes()" >&4
13222 #include <sys/time.h>
13229 fd = open ("try.c", O_RDWR);
13230 if (-1 == fd) exit (1);
13231 rv = futimes (fd, NULL);
13232 exit (rv == -1 ? errno : 0);
13236 if eval $compile; then
13240 0) echo "Yes, you have" >&4
13241 d_futimes="$define"
13243 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13247 echo "No, it does not (probably harmless)" >&4
13251 : see if getcwd exists
13252 set getcwd d_getcwd
13255 : see if getespwnam exists
13256 set getespwnam d_getespwnam
13259 : see if getfsstat exists
13260 set getfsstat d_getfsstat
13263 : see if getgrent exists
13264 set getgrent d_getgrent
13267 : see if getgrent_r exists
13268 set getgrent_r d_getgrent_r
13270 case "$d_getgrent_r" in
13272 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13273 case "$d_getgrent_r_proto:$usethreads" in
13274 ":define") d_getgrent_r_proto=define
13275 set d_getgrent_r_proto getgrent_r $hdrs
13279 case "$d_getgrent_r_proto" in
13281 case "$getgrent_r_proto" in
13282 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13283 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13285 case "$getgrent_r_proto" in
13286 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13287 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13289 case "$getgrent_r_proto" in
13290 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13291 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13293 case "$getgrent_r_proto" in
13294 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13295 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13297 case "$getgrent_r_proto" in
13298 ''|0) try='int getgrent_r(struct group*, char*, int);'
13299 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13301 case "$getgrent_r_proto" in
13302 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13303 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13305 case "$getgrent_r_proto" in
13306 ''|0) d_getgrent_r=undef
13308 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13309 * ) case "$getgrent_r_proto" in
13310 REENTRANT_PROTO*) ;;
13311 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13313 echo "Prototype: $try" ;;
13316 *) case "$usethreads" in
13317 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13324 *) getgrent_r_proto=0
13328 : see if getgrgid_r exists
13329 set getgrgid_r d_getgrgid_r
13331 case "$d_getgrgid_r" in
13333 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13334 case "$d_getgrgid_r_proto:$usethreads" in
13335 ":define") d_getgrgid_r_proto=define
13336 set d_getgrgid_r_proto getgrgid_r $hdrs
13340 case "$d_getgrgid_r_proto" in
13342 case "$getgrgid_r_proto" in
13343 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13344 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13346 case "$getgrgid_r_proto" in
13347 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13348 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13350 case "$getgrgid_r_proto" in
13351 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13352 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13354 case "$getgrgid_r_proto" in
13355 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13356 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13358 case "$getgrgid_r_proto" in
13359 ''|0) d_getgrgid_r=undef
13361 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13362 * ) case "$getgrgid_r_proto" in
13363 REENTRANT_PROTO*) ;;
13364 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13366 echo "Prototype: $try" ;;
13369 *) case "$usethreads" in
13370 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13377 *) getgrgid_r_proto=0
13381 : see if getgrnam_r exists
13382 set getgrnam_r d_getgrnam_r
13384 case "$d_getgrnam_r" in
13386 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13387 case "$d_getgrnam_r_proto:$usethreads" in
13388 ":define") d_getgrnam_r_proto=define
13389 set d_getgrnam_r_proto getgrnam_r $hdrs
13393 case "$d_getgrnam_r_proto" in
13395 case "$getgrnam_r_proto" in
13396 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13397 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13399 case "$getgrnam_r_proto" in
13400 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13401 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13403 case "$getgrnam_r_proto" in
13404 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13405 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13407 case "$getgrnam_r_proto" in
13408 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13409 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13411 case "$getgrnam_r_proto" in
13412 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13413 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13415 case "$getgrnam_r_proto" in
13416 ''|0) d_getgrnam_r=undef
13418 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13419 * ) case "$getgrnam_r_proto" in
13420 REENTRANT_PROTO*) ;;
13421 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13423 echo "Prototype: $try" ;;
13426 *) case "$usethreads" in
13427 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13434 *) getgrnam_r_proto=0
13438 : see if gethostbyaddr exists
13439 set gethostbyaddr d_gethbyaddr
13442 : see if gethostbyname exists
13443 set gethostbyname d_gethbyname
13446 : see if gethostent exists
13447 set gethostent d_gethent
13450 : see how we will look up host name
13453 if set gethostname val -f d_gethname; eval $csym; $val; then
13454 echo 'gethostname() found.' >&4
13455 d_gethname="$define"
13458 if set uname val -f d_uname; eval $csym; $val; then
13461 uname() was found, but you're running xenix, and older versions of xenix
13462 have a broken uname(). If you don't really know whether your xenix is old
13463 enough to have a broken system call, use the default answer.
13468 "$define") dflt=n;;
13470 rp='Is your uname() broken?'
13473 n*) d_uname="$define"; call=uname;;
13476 echo 'uname() found.' >&4
13483 case "$d_gethname" in
13484 '') d_gethname="$undef";;
13487 '') d_uname="$undef";;
13489 case "$d_uname$d_gethname" in
13494 Every now and then someone has a $call() that lies about the hostname
13495 but can't be fixed for political or economic reasons. If you wish, I can
13496 pretend $call() isn't there and maybe compute hostname at run-time
13497 thanks to the '$phostname' command.
13500 rp="Shall I ignore $call() from now on?"
13503 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13506 case "$phostname" in
13507 '') aphostname='';;
13508 *) case "$aphostname" in
13510 *) set X $phostname
13514 file=`./loc $file $file $pth`
13515 aphostname=`echo $file $*`
13520 case "$d_uname$d_gethname" in
13523 case "$phostname" in
13525 echo "There will be no way for $package to get your hostname." >&4;;
13527 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13531 case "$d_phostname" in
13532 '') d_phostname="$undef";;
13535 : see if gethostbyaddr_r exists
13536 set gethostbyaddr_r d_gethostbyaddr_r
13538 case "$d_gethostbyaddr_r" in
13540 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13541 case "$d_gethostbyaddr_r_proto:$usethreads" in
13542 ":define") d_gethostbyaddr_r_proto=define
13543 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13547 case "$d_gethostbyaddr_r_proto" in
13549 case "$gethostbyaddr_r_proto" in
13550 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13551 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13553 case "$gethostbyaddr_r_proto" in
13554 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13555 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13557 case "$gethostbyaddr_r_proto" in
13558 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13559 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13561 case "$gethostbyaddr_r_proto" in
13562 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13563 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13565 case "$gethostbyaddr_r_proto" in
13566 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13567 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13569 case "$gethostbyaddr_r_proto" in
13570 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13571 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13573 case "$gethostbyaddr_r_proto" in
13574 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13575 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13577 case "$gethostbyaddr_r_proto" in
13578 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13579 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13581 case "$gethostbyaddr_r_proto" in
13582 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13583 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13585 case "$gethostbyaddr_r_proto" in
13586 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13587 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13589 case "$gethostbyaddr_r_proto" in
13590 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13591 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13593 case "$gethostbyaddr_r_proto" in
13594 ''|0) d_gethostbyaddr_r=undef
13595 gethostbyaddr_r_proto=0
13596 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13597 * ) case "$gethostbyaddr_r_proto" in
13598 REENTRANT_PROTO*) ;;
13599 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13601 echo "Prototype: $try" ;;
13604 *) case "$usethreads" in
13605 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13607 d_gethostbyaddr_r=undef
13608 gethostbyaddr_r_proto=0
13612 *) gethostbyaddr_r_proto=0
13616 : see if gethostbyname_r exists
13617 set gethostbyname_r d_gethostbyname_r
13619 case "$d_gethostbyname_r" in
13621 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13622 case "$d_gethostbyname_r_proto:$usethreads" in
13623 ":define") d_gethostbyname_r_proto=define
13624 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13628 case "$d_gethostbyname_r_proto" in
13630 case "$gethostbyname_r_proto" in
13631 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13632 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13634 case "$gethostbyname_r_proto" in
13635 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13636 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13638 case "$gethostbyname_r_proto" in
13639 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13640 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13642 case "$gethostbyname_r_proto" in
13643 ''|0) d_gethostbyname_r=undef
13644 gethostbyname_r_proto=0
13645 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13646 * ) case "$gethostbyname_r_proto" in
13647 REENTRANT_PROTO*) ;;
13648 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13650 echo "Prototype: $try" ;;
13653 *) case "$usethreads" in
13654 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13656 d_gethostbyname_r=undef
13657 gethostbyname_r_proto=0
13661 *) gethostbyname_r_proto=0
13665 : see if gethostent_r exists
13666 set gethostent_r d_gethostent_r
13668 case "$d_gethostent_r" in
13670 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13671 case "$d_gethostent_r_proto:$usethreads" in
13672 ":define") d_gethostent_r_proto=define
13673 set d_gethostent_r_proto gethostent_r $hdrs
13677 case "$d_gethostent_r_proto" in
13679 case "$gethostent_r_proto" in
13680 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13681 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13683 case "$gethostent_r_proto" in
13684 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13685 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13687 case "$gethostent_r_proto" in
13688 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13689 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13691 case "$gethostent_r_proto" in
13692 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13693 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13695 case "$gethostent_r_proto" in
13696 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13697 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13699 case "$gethostent_r_proto" in
13700 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13701 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13703 case "$gethostent_r_proto" in
13704 ''|0) d_gethostent_r=undef
13705 gethostent_r_proto=0
13706 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13707 * ) case "$gethostent_r_proto" in
13708 REENTRANT_PROTO*) ;;
13709 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13711 echo "Prototype: $try" ;;
13714 *) case "$usethreads" in
13715 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13717 d_gethostent_r=undef
13718 gethostent_r_proto=0
13722 *) gethostent_r_proto=0
13726 : see if prototypes for various gethostxxx netdb.h functions are available
13728 set d_gethostprotos gethostent $i_netdb netdb.h
13731 : see if getitimer exists
13732 set getitimer d_getitimer
13735 : see if getlogin exists
13736 set getlogin d_getlogin
13739 : see if getlogin_r exists
13740 set getlogin_r d_getlogin_r
13742 case "$d_getlogin_r" in
13744 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13745 case "$d_getlogin_r_proto:$usethreads" in
13746 ":define") d_getlogin_r_proto=define
13747 set d_getlogin_r_proto getlogin_r $hdrs
13751 case "$d_getlogin_r_proto" in
13753 case "$getlogin_r_proto" in
13754 ''|0) try='int getlogin_r(char*, size_t);'
13755 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13757 case "$getlogin_r_proto" in
13758 ''|0) try='int getlogin_r(char*, int);'
13759 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13761 case "$getlogin_r_proto" in
13762 ''|0) try='char* getlogin_r(char*, size_t);'
13763 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13765 case "$getlogin_r_proto" in
13766 ''|0) try='char* getlogin_r(char*, int);'
13767 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13769 case "$getlogin_r_proto" in
13770 ''|0) d_getlogin_r=undef
13772 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13773 * ) case "$getlogin_r_proto" in
13774 REENTRANT_PROTO*) ;;
13775 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13777 echo "Prototype: $try" ;;
13780 *) case "$usethreads" in
13781 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13788 *) getlogin_r_proto=0
13792 : see if getmnt exists
13793 set getmnt d_getmnt
13796 : see if getmntent exists
13797 set getmntent d_getmntent
13800 : see if getnetbyaddr exists
13801 set getnetbyaddr d_getnbyaddr
13804 : see if getnetbyname exists
13805 set getnetbyname d_getnbyname
13808 : see if getnetent exists
13809 set getnetent d_getnent
13812 : see if getnetbyaddr_r exists
13813 set getnetbyaddr_r d_getnetbyaddr_r
13815 case "$d_getnetbyaddr_r" in
13817 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13818 case "$d_getnetbyaddr_r_proto:$usethreads" in
13819 ":define") d_getnetbyaddr_r_proto=define
13820 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13824 case "$d_getnetbyaddr_r_proto" in
13826 case "$getnetbyaddr_r_proto" in
13827 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13828 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13830 case "$getnetbyaddr_r_proto" in
13831 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13832 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13834 case "$getnetbyaddr_r_proto" in
13835 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13836 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13838 case "$getnetbyaddr_r_proto" in
13839 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13840 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13842 case "$getnetbyaddr_r_proto" in
13843 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13844 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13846 case "$getnetbyaddr_r_proto" in
13847 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13848 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13850 case "$getnetbyaddr_r_proto" in
13851 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13852 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13854 case "$getnetbyaddr_r_proto" in
13855 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13856 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13858 case "$getnetbyaddr_r_proto" in
13859 ''|0) d_getnetbyaddr_r=undef
13860 getnetbyaddr_r_proto=0
13861 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13862 * ) case "$getnetbyaddr_r_proto" in
13863 REENTRANT_PROTO*) ;;
13864 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13866 echo "Prototype: $try" ;;
13869 *) case "$usethreads" in
13870 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13872 d_getnetbyaddr_r=undef
13873 getnetbyaddr_r_proto=0
13877 *) getnetbyaddr_r_proto=0
13881 : see if getnetbyname_r exists
13882 set getnetbyname_r d_getnetbyname_r
13884 case "$d_getnetbyname_r" in
13886 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13887 case "$d_getnetbyname_r_proto:$usethreads" in
13888 ":define") d_getnetbyname_r_proto=define
13889 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13893 case "$d_getnetbyname_r_proto" in
13895 case "$getnetbyname_r_proto" in
13896 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13897 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13899 case "$getnetbyname_r_proto" in
13900 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13901 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13903 case "$getnetbyname_r_proto" in
13904 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13905 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13907 case "$getnetbyname_r_proto" in
13908 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13909 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13911 case "$getnetbyname_r_proto" in
13912 ''|0) d_getnetbyname_r=undef
13913 getnetbyname_r_proto=0
13914 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13915 * ) case "$getnetbyname_r_proto" in
13916 REENTRANT_PROTO*) ;;
13917 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13919 echo "Prototype: $try" ;;
13922 *) case "$usethreads" in
13923 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13925 d_getnetbyname_r=undef
13926 getnetbyname_r_proto=0
13930 *) getnetbyname_r_proto=0
13934 : see if getnetent_r exists
13935 set getnetent_r d_getnetent_r
13937 case "$d_getnetent_r" in
13939 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13940 case "$d_getnetent_r_proto:$usethreads" in
13941 ":define") d_getnetent_r_proto=define
13942 set d_getnetent_r_proto getnetent_r $hdrs
13946 case "$d_getnetent_r_proto" in
13948 case "$getnetent_r_proto" in
13949 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13950 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13952 case "$getnetent_r_proto" in
13953 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13954 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13956 case "$getnetent_r_proto" in
13957 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13958 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13960 case "$getnetent_r_proto" in
13961 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13962 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13964 case "$getnetent_r_proto" in
13965 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13966 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13968 case "$getnetent_r_proto" in
13969 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13970 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13972 case "$getnetent_r_proto" in
13973 ''|0) d_getnetent_r=undef
13974 getnetent_r_proto=0
13975 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13976 * ) case "$getnetent_r_proto" in
13977 REENTRANT_PROTO*) ;;
13978 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13980 echo "Prototype: $try" ;;
13983 *) case "$usethreads" in
13984 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13986 d_getnetent_r=undef
13987 getnetent_r_proto=0
13991 *) getnetent_r_proto=0
13995 : see if prototypes for various getnetxxx netdb.h functions are available
13997 set d_getnetprotos getnetent $i_netdb netdb.h
14000 : see if getpagesize exists
14001 set getpagesize d_getpagsz
14004 : Optional checks for getprotobyname and getprotobynumber
14006 : see if getprotobyname exists
14007 set getprotobyname d_getpbyname
14010 : see if getprotobynumber exists
14011 set getprotobynumber d_getpbynumber
14014 : see if getprotoent exists
14015 set getprotoent d_getpent
14018 : see if getpgid exists
14019 set getpgid d_getpgid
14022 : see if getpgrp2 exists
14023 set getpgrp2 d_getpgrp2
14026 : see if getppid exists
14027 set getppid d_getppid
14030 : see if getpriority exists
14031 set getpriority d_getprior
14034 : see if getprotobyname_r exists
14035 set getprotobyname_r d_getprotobyname_r
14037 case "$d_getprotobyname_r" in
14039 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14040 case "$d_getprotobyname_r_proto:$usethreads" in
14041 ":define") d_getprotobyname_r_proto=define
14042 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14046 case "$d_getprotobyname_r_proto" in
14048 case "$getprotobyname_r_proto" in
14049 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14050 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14052 case "$getprotobyname_r_proto" in
14053 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14054 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14056 case "$getprotobyname_r_proto" in
14057 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14058 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14060 case "$getprotobyname_r_proto" in
14061 ''|0) d_getprotobyname_r=undef
14062 getprotobyname_r_proto=0
14063 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14064 * ) case "$getprotobyname_r_proto" in
14065 REENTRANT_PROTO*) ;;
14066 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14068 echo "Prototype: $try" ;;
14071 *) case "$usethreads" in
14072 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14074 d_getprotobyname_r=undef
14075 getprotobyname_r_proto=0
14079 *) getprotobyname_r_proto=0
14083 : see if getprotobynumber_r exists
14084 set getprotobynumber_r d_getprotobynumber_r
14086 case "$d_getprotobynumber_r" in
14088 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14089 case "$d_getprotobynumber_r_proto:$usethreads" in
14090 ":define") d_getprotobynumber_r_proto=define
14091 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14095 case "$d_getprotobynumber_r_proto" in
14097 case "$getprotobynumber_r_proto" in
14098 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14099 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14101 case "$getprotobynumber_r_proto" in
14102 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14103 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14105 case "$getprotobynumber_r_proto" in
14106 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14107 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14109 case "$getprotobynumber_r_proto" in
14110 ''|0) d_getprotobynumber_r=undef
14111 getprotobynumber_r_proto=0
14112 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14113 * ) case "$getprotobynumber_r_proto" in
14114 REENTRANT_PROTO*) ;;
14115 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14117 echo "Prototype: $try" ;;
14120 *) case "$usethreads" in
14121 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14123 d_getprotobynumber_r=undef
14124 getprotobynumber_r_proto=0
14128 *) getprotobynumber_r_proto=0
14132 : see if getprotoent_r exists
14133 set getprotoent_r d_getprotoent_r
14135 case "$d_getprotoent_r" in
14137 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14138 case "$d_getprotoent_r_proto:$usethreads" in
14139 ":define") d_getprotoent_r_proto=define
14140 set d_getprotoent_r_proto getprotoent_r $hdrs
14144 case "$d_getprotoent_r_proto" in
14146 case "$getprotoent_r_proto" in
14147 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14148 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14150 case "$getprotoent_r_proto" in
14151 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14152 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14154 case "$getprotoent_r_proto" in
14155 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14156 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14158 case "$getprotoent_r_proto" in
14159 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14160 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14162 case "$getprotoent_r_proto" in
14163 ''|0) d_getprotoent_r=undef
14164 getprotoent_r_proto=0
14165 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14166 * ) case "$getprotoent_r_proto" in
14167 REENTRANT_PROTO*) ;;
14168 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14170 echo "Prototype: $try" ;;
14173 *) case "$usethreads" in
14174 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14176 d_getprotoent_r=undef
14177 getprotoent_r_proto=0
14181 *) getprotoent_r_proto=0
14185 : see if prototypes for various getprotoxxx netdb.h functions are available
14187 set d_getprotoprotos getprotoent $i_netdb netdb.h
14190 : see if getprpwnam exists
14191 set getprpwnam d_getprpwnam
14194 : see if getpwent exists
14195 set getpwent d_getpwent
14198 : see if getpwent_r exists
14199 set getpwent_r d_getpwent_r
14201 case "$d_getpwent_r" in
14203 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14204 case "$d_getpwent_r_proto:$usethreads" in
14205 ":define") d_getpwent_r_proto=define
14206 set d_getpwent_r_proto getpwent_r $hdrs
14210 case "$d_getpwent_r_proto" in
14212 case "$getpwent_r_proto" in
14213 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14214 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14216 case "$getpwent_r_proto" in
14217 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14218 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14220 case "$getpwent_r_proto" in
14221 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14222 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14224 case "$getpwent_r_proto" in
14225 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14226 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14228 case "$getpwent_r_proto" in
14229 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14230 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14232 case "$getpwent_r_proto" in
14233 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14234 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14236 case "$getpwent_r_proto" in
14237 ''|0) d_getpwent_r=undef
14239 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14240 * ) case "$getpwent_r_proto" in
14241 REENTRANT_PROTO*) ;;
14242 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14244 echo "Prototype: $try" ;;
14247 *) case "$usethreads" in
14248 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14255 *) getpwent_r_proto=0
14259 : see if getpwnam_r exists
14260 set getpwnam_r d_getpwnam_r
14262 case "$d_getpwnam_r" in
14264 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14265 case "$d_getpwnam_r_proto:$usethreads" in
14266 ":define") d_getpwnam_r_proto=define
14267 set d_getpwnam_r_proto getpwnam_r $hdrs
14271 case "$d_getpwnam_r_proto" in
14273 case "$getpwnam_r_proto" in
14274 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14275 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14277 case "$getpwnam_r_proto" in
14278 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14279 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14281 case "$getpwnam_r_proto" in
14282 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14283 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14285 case "$getpwnam_r_proto" in
14286 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14287 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14289 case "$getpwnam_r_proto" in
14290 ''|0) d_getpwnam_r=undef
14292 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14293 * ) case "$getpwnam_r_proto" in
14294 REENTRANT_PROTO*) ;;
14295 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14297 echo "Prototype: $try" ;;
14300 *) case "$usethreads" in
14301 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14308 *) getpwnam_r_proto=0
14312 : see if getpwuid_r exists
14313 set getpwuid_r d_getpwuid_r
14315 case "$d_getpwuid_r" in
14317 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14318 case "$d_getpwuid_r_proto:$usethreads" in
14319 ":define") d_getpwuid_r_proto=define
14320 set d_getpwuid_r_proto getpwuid_r $hdrs
14324 case "$d_getpwuid_r_proto" in
14326 case "$getpwuid_r_proto" in
14327 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14328 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14330 case "$getpwuid_r_proto" in
14331 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14332 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14334 case "$getpwuid_r_proto" in
14335 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14336 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14338 case "$getpwuid_r_proto" in
14339 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14340 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14342 case "$getpwuid_r_proto" in
14343 ''|0) d_getpwuid_r=undef
14345 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14346 * ) case "$getpwuid_r_proto" in
14347 REENTRANT_PROTO*) ;;
14348 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14350 echo "Prototype: $try" ;;
14353 *) case "$usethreads" in
14354 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14361 *) getpwuid_r_proto=0
14365 : Optional checks for getsbyname and getsbyport
14367 : see if getservbyname exists
14368 set getservbyname d_getsbyname
14371 : see if getservbyport exists
14372 set getservbyport d_getsbyport
14375 : see if getservent exists
14376 set getservent d_getsent
14379 : see if getservbyname_r exists
14380 set getservbyname_r d_getservbyname_r
14382 case "$d_getservbyname_r" in
14384 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14385 case "$d_getservbyname_r_proto:$usethreads" in
14386 ":define") d_getservbyname_r_proto=define
14387 set d_getservbyname_r_proto getservbyname_r $hdrs
14391 case "$d_getservbyname_r_proto" in
14393 case "$getservbyname_r_proto" in
14394 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14395 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14397 case "$getservbyname_r_proto" in
14398 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14399 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14401 case "$getservbyname_r_proto" in
14402 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14403 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14405 case "$getservbyname_r_proto" in
14406 ''|0) d_getservbyname_r=undef
14407 getservbyname_r_proto=0
14408 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14409 * ) case "$getservbyname_r_proto" in
14410 REENTRANT_PROTO*) ;;
14411 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14413 echo "Prototype: $try" ;;
14416 *) case "$usethreads" in
14417 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14419 d_getservbyname_r=undef
14420 getservbyname_r_proto=0
14424 *) getservbyname_r_proto=0
14428 : see if getservbyport_r exists
14429 set getservbyport_r d_getservbyport_r
14431 case "$d_getservbyport_r" in
14433 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14434 case "$d_getservbyport_r_proto:$usethreads" in
14435 ":define") d_getservbyport_r_proto=define
14436 set d_getservbyport_r_proto getservbyport_r $hdrs
14440 case "$d_getservbyport_r_proto" in
14442 case "$getservbyport_r_proto" in
14443 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14444 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14446 case "$getservbyport_r_proto" in
14447 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14448 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14450 case "$getservbyport_r_proto" in
14451 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14452 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14454 case "$getservbyport_r_proto" in
14455 ''|0) d_getservbyport_r=undef
14456 getservbyport_r_proto=0
14457 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14458 * ) case "$getservbyport_r_proto" in
14459 REENTRANT_PROTO*) ;;
14460 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14462 echo "Prototype: $try" ;;
14465 *) case "$usethreads" in
14466 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14468 d_getservbyport_r=undef
14469 getservbyport_r_proto=0
14473 *) getservbyport_r_proto=0
14477 : see if getservent_r exists
14478 set getservent_r d_getservent_r
14480 case "$d_getservent_r" in
14482 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14483 case "$d_getservent_r_proto:$usethreads" in
14484 ":define") d_getservent_r_proto=define
14485 set d_getservent_r_proto getservent_r $hdrs
14489 case "$d_getservent_r_proto" in
14491 case "$getservent_r_proto" in
14492 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14493 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14495 case "$getservent_r_proto" in
14496 ''|0) try='int getservent_r(struct servent*, char*, int);'
14497 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14499 case "$getservent_r_proto" in
14500 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14501 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14503 case "$getservent_r_proto" in
14504 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14505 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14507 case "$getservent_r_proto" in
14508 ''|0) d_getservent_r=undef
14509 getservent_r_proto=0
14510 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14511 * ) case "$getservent_r_proto" in
14512 REENTRANT_PROTO*) ;;
14513 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14515 echo "Prototype: $try" ;;
14518 *) case "$usethreads" in
14519 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14521 d_getservent_r=undef
14522 getservent_r_proto=0
14526 *) getservent_r_proto=0
14530 : see if prototypes for various getservxxx netdb.h functions are available
14532 set d_getservprotos getservent $i_netdb netdb.h
14535 : see if getspnam exists
14536 set getspnam d_getspnam
14539 : see if this is a shadow.h system
14540 set shadow.h i_shadow
14543 : see if getspnam_r exists
14544 set getspnam_r d_getspnam_r
14546 case "$d_getspnam_r" in
14548 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14549 case "$d_getspnam_r_proto:$usethreads" in
14550 ":define") d_getspnam_r_proto=define
14551 set d_getspnam_r_proto getspnam_r $hdrs
14555 case "$d_getspnam_r_proto" in
14557 case "$getspnam_r_proto" in
14558 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14559 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14561 case "$getspnam_r_proto" in
14562 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14563 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14565 case "$getspnam_r_proto" in
14566 ''|0) d_getspnam_r=undef
14568 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14569 * ) case "$getspnam_r_proto" in
14570 REENTRANT_PROTO*) ;;
14571 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14573 echo "Prototype: $try" ;;
14576 *) case "$usethreads" in
14577 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14584 *) getspnam_r_proto=0
14588 : see if gettimeofday or ftime exists
14589 set gettimeofday d_gettimeod
14591 case "$d_gettimeod" in
14597 val="$undef"; set d_ftime; eval $setvar
14600 case "$d_gettimeod$d_ftime" in
14603 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14607 : see if gmtime_r exists
14608 set gmtime_r d_gmtime_r
14610 case "$d_gmtime_r" in
14612 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14613 case "$d_gmtime_r_proto:$usethreads" in
14614 ":define") d_gmtime_r_proto=define
14615 set d_gmtime_r_proto gmtime_r $hdrs
14619 case "$d_gmtime_r_proto" in
14621 case "$gmtime_r_proto" in
14622 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14623 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14625 case "$gmtime_r_proto" in
14626 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14627 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14629 case "$gmtime_r_proto" in
14630 ''|0) d_gmtime_r=undef
14632 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14633 * ) case "$gmtime_r_proto" in
14634 REENTRANT_PROTO*) ;;
14635 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14637 echo "Prototype: $try" ;;
14640 *) case "$usethreads" in
14641 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14648 *) gmtime_r_proto=0
14652 : see if hasmntopt exists
14653 set hasmntopt d_hasmntopt
14656 : see if this is a netinet/in.h or sys/in.h system
14657 set netinet/in.h i_niin sys/in.h i_sysin
14660 : see if arpa/inet.h has to be included
14661 set arpa/inet.h i_arpainet
14664 : see if htonl --and friends-- exists
14669 : Maybe they are macros.
14672 $cat >htonl.c <<EOM
14674 #include <sys/types.h>
14675 #$i_niin I_NETINET_IN
14677 #$i_arpainet I_ARPA_INET
14678 #ifdef I_NETINET_IN
14679 #include <netinet/in.h>
14682 #include <sys/in.h>
14685 #include <arpa/inet.h>
14688 printf("Defined as a macro.");
14691 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14692 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14694 echo "But it seems to be defined as a macro." >&4
14702 : see if ilogbl exists
14703 set ilogbl d_ilogbl
14708 if set index val -f; eval $csym; $val; then
14709 if set strchr val -f d_strchr; eval $csym; $val; then
14710 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14713 echo "strchr() found." >&4
14717 echo "index() found." >&4
14722 echo "index() found." >&4
14725 if set strchr val -f d_strchr; eval $csym; $val; then
14728 echo "strchr() found." >&4
14730 echo "No index() or strchr() found!" >&4
14735 set d_strchr; eval $setvar
14737 set d_index; eval $setvar
14739 : check whether inet_aton exists
14740 set inet_aton d_inetaton
14745 $cat >isascii.c <<EOCP
14748 #$i_stdlib I_STDLIB
14750 #include <stdlib.h>
14761 if eval $compile; then
14762 echo "isascii() found." >&4
14765 echo "isascii() NOT found." >&4
14772 : see if isfinite exists
14773 set isfinite d_isfinite
14776 : see if isinf exists
14780 : see if isnan exists
14784 : see if isnanl exists
14785 set isnanl d_isnanl
14788 : see if killpg exists
14789 set killpg d_killpg
14792 : see if lchown exists
14794 $cat > try.c <<'EOCP'
14795 /* System header to define __stub macros and hopefully few prototypes,
14796 which can conflict with char lchown(); below. */
14797 #include <assert.h>
14798 /* Override any gcc2 internal prototype to avoid an error. */
14799 /* We use char because int might match the return type of a gcc2
14800 builtin and then its argument prototype would still apply. */
14803 /* The GNU C library defines this for functions which it implements
14804 to always fail with ENOSYS. Some functions are actually named
14805 something starting with __ and the normal name is an alias. */
14806 #if defined (__stub_lchown) || defined (__stub___lchown)
14814 if eval $compile; then
14815 $echo "lchown() found." >&4
14818 $echo "lchown() NOT found." >&4
14824 : See if number of significant digits in a double precision number is known
14826 $cat >ldbl_dig.c <<EOM
14827 #$i_limits I_LIMITS
14830 #include <limits.h>
14836 printf("Contains LDBL_DIG");
14839 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14840 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14841 echo "LDBL_DIG found." >&4
14844 echo "LDBL_DIG NOT found." >&4
14851 : see if this is a math.h system
14855 : check to see if math.h defines _LIB_VERSION
14856 d_libm_lib_version="$undef"
14860 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14862 #include <unistd.h>
14864 int main (int argc, char *argv[])
14866 printf ("%d\n", _LIB_VERSION);
14871 if eval $compile; then
14873 echo "Yes, it does ($foo)" >&4
14874 d_libm_lib_version="$define"
14876 echo "No, it does not (probably harmless)" >&4
14883 : see if link exists
14887 : see if localtime_r exists
14888 set localtime_r d_localtime_r
14890 case "$d_localtime_r" in
14892 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14893 case "$d_localtime_r_proto:$usethreads" in
14894 ":define") d_localtime_r_proto=define
14895 set d_localtime_r_proto localtime_r $hdrs
14899 case "$d_localtime_r_proto" in
14901 case "$localtime_r_proto" in
14902 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14903 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14905 case "$localtime_r_proto" in
14906 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14907 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14909 case "$localtime_r_proto" in
14910 ''|0) d_localtime_r=undef
14911 localtime_r_proto=0
14912 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14913 * ) case "$localtime_r_proto" in
14914 REENTRANT_PROTO*) ;;
14915 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14917 echo "Prototype: $try" ;;
14920 *) case "$usethreads" in
14921 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14923 d_localtime_r=undef
14924 localtime_r_proto=0
14928 *) localtime_r_proto=0
14932 : see if localtime_r calls tzset
14933 case "$localtime_r_proto" in
14936 /* Does our libc's localtime_r call tzset ?
14937 * return 0 if so, 1 otherwise.
14939 #include <sys/types.h>
14940 #include <unistd.h>
14942 #include <string.h>
14943 #include <malloc.h>
14946 time_t t = time(0L);
14947 char w_tz[]="TZ" "=GMT+5",
14948 e_tz[]="TZ" "=GMT-5",
14949 *tz_e = (char*)malloc(16),
14950 *tz_w = (char*)malloc(16);
14951 struct tm tm_e, tm_w;
14952 memset(&tm_e,'\0',sizeof(struct tm));
14953 memset(&tm_w,'\0',sizeof(struct tm));
14958 localtime_r(&t, &tm_e);
14961 localtime_r(&t, &tm_w);
14963 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14969 if eval $compile; then
14970 if $run ./try; then
14971 d_localtime_r_needs_tzset=undef;
14973 d_localtime_r_needs_tzset=define;
14976 d_localtime_r_needs_tzset=undef;
14980 d_localtime_r_needs_tzset=undef;
14985 : see if localeconv exists
14986 set localeconv d_locconv
14989 : see if lockf exists
14993 : see if prototype for lseek is available
14995 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14998 : see if lstat exists
15002 : see if madvise exists
15003 set madvise d_madvise
15006 : see if malloc_size exists
15007 set malloc_size d_malloc_size
15010 : see if malloc_size_good exists
15011 set malloc_good_size d_malloc_good_size
15014 : see if mblen exists
15018 : see if mbstowcs exists
15019 set mbstowcs d_mbstowcs
15022 : see if mbtowc exists
15023 set mbtowc d_mbtowc
15026 : see if memchr exists
15027 set memchr d_memchr
15030 : see if memcmp exists
15031 set memcmp d_memcmp
15034 : see if memcpy exists
15035 set memcpy d_memcpy
15038 : see if memmove exists
15039 set memmove d_memmove
15042 : see if memset exists
15043 set memset d_memset
15046 : see if mkdir exists
15050 : see if mkdtemp exists
15051 set mkdtemp d_mkdtemp
15054 : see if mkfifo exists
15055 set mkfifo d_mkfifo
15058 : see if mkstemp exists
15059 set mkstemp d_mkstemp
15062 : see if mkstemps exists
15063 set mkstemps d_mkstemps
15066 : see if mktime exists
15067 set mktime d_mktime
15070 : see if this is a sys/mman.h system
15071 set sys/mman.h i_sysmman
15074 : see if mmap exists
15077 : see what shmat returns
15078 : default to something harmless
15080 case "$i_sysmman$d_mmap" in
15082 $cat >mmap.c <<'END'
15083 #include <sys/mman.h>
15086 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15091 echo "and it returns ($mmaptype)." >&4
15097 : see if sqrtl exists
15101 : see if scalbnl exists
15102 set scalbnl d_scalbnl
15105 : see if modfl exists
15109 : see if prototype for modfl is available
15111 set d_modflproto modfl $i_math math.h
15114 d_modfl_pow32_bug="$undef"
15116 case "$d_longdbl$d_modfl" in
15119 Checking to see whether your modfl() is okay for large values...
15125 if $test "X$d_modflproto" != "X$define"; then
15126 $cat >>try.c <<EOCP
15127 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15128 long double modfl (long double, long double *);
15131 $cat >>try.c <<EOCP
15133 long double nv = 4294967303.15;
15139 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15143 case "$osname:$gccversion" in
15144 aix:) saveccflags="$ccflags"
15145 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15148 if eval $compile; then
15151 *" 4294967303.150000 1.150000 4294967302.000000")
15152 echo >&4 "Your modfl() is broken for large values."
15153 d_modfl_pow32_bug="$define"
15155 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15159 *" 4294967303.150000 0.150000 4294967303.000000")
15160 echo >&4 "Your modfl() seems okay for large values."
15162 *) echo >&4 "I don't understand your modfl() at all."
15168 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15171 case "$osname:$gccversion" in
15172 aix:) ccflags="$saveccflags" ;; # restore
15177 if $test "$uselongdouble" = "$define"; then
15179 if $test "$d_sqrtl" != "$define"; then
15180 message="$message sqrtl"
15182 if $test "$d_modfl" != "$define"; then
15183 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15184 echo "You have both aintl and copysignl, so I can emulate modfl."
15186 message="$message modfl"
15189 if $test "$d_frexpl" != "$define"; then
15190 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15191 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15193 message="$message frexpl"
15197 if $test "$message" != ""; then
15200 *** You requested the use of long doubles but you do not seem to have
15201 *** the following mathematical functions needed for long double support:
15203 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15204 *** Cannot continue, aborting.
15212 : see if mprotect exists
15213 set mprotect d_mprotect
15216 : see if msgctl exists
15217 set msgctl d_msgctl
15220 : see if msgget exists
15221 set msgget d_msgget
15224 : see if msgsnd exists
15225 set msgsnd d_msgsnd
15228 : see if msgrcv exists
15229 set msgrcv d_msgrcv
15232 : see how much of the 'msg*(2)' library is present.
15235 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15236 *"$undef"*) h_msg=false;;
15240 case "`ipcs 2>&1`" in
15241 "SVID messages"*"not configured"*)
15242 echo "Your $osname does not have the msg*(2) configured." >&4
15245 set msgctl d_msgctl
15247 set msgget d_msgget
15249 set msgsnd d_msgsnd
15251 set msgrcv d_msgrcv
15257 : we could also check for sys/ipc.h ...
15258 if $h_msg && $test `./findhdr sys/msg.h`; then
15259 echo "You have the full msg*(2) library." >&4
15262 echo "You don't have the full msg*(2) library." >&4
15268 : Check for msghdr_s
15270 echo "Checking to see if your system supports struct msghdr..." >&4
15271 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15273 case "$d_msghdr_s" in
15274 "$define") echo "Yes, it does." ;;
15275 *) echo "No, it doesn't." ;;
15279 : see if msync exists
15283 : see if munmap exists
15284 set munmap d_munmap
15287 : see if nice exists
15291 : see if this is a langinfo.h system
15292 set langinfo.h i_langinfo
15295 : see if nl_langinfo exists
15296 set nl_langinfo d_nl_langinfo
15299 : check for volatile keyword
15301 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15302 $cat >try.c <<'EOCP'
15305 typedef struct _goo_struct goo_struct;
15306 goo_struct * volatile goo = ((goo_struct *)0);
15307 struct _goo_struct {
15312 typedef unsigned short foo_t;
15313 char *volatile foo;
15315 volatile foo_t blech;
15319 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15321 echo "Yup, it does."
15324 echo "Nope, it doesn't."
15330 : Check basic sizes
15332 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15334 case "$use64bitint:$d_quad:$quadtype" in
15337 uvtype="$uquadtype"
15342 uvtype="unsigned long"
15348 case "$uselongdouble:$d_longdbl" in
15350 nvtype="long double"
15351 nvsize=$longdblsize
15358 $echo "(IV will be "$ivtype", $ivsize bytes)"
15359 $echo "(UV will be "$uvtype", $uvsize bytes)"
15360 $echo "(NV will be "$nvtype", $nvsize bytes)"
15363 #$i_inttypes I_INTTYPES
15365 #include <inttypes.h>
15370 int8_t i = INT8_MAX;
15371 uint8_t u = UINT8_MAX;
15372 printf("int8_t\n");
15375 int16_t i = INT16_MAX;
15376 uint16_t i = UINT16_MAX;
15377 printf("int16_t\n");
15380 int32_t i = INT32_MAX;
15381 uint32_t u = UINT32_MAX;
15382 printf("int32_t\n");
15387 i8type="signed char"
15388 u8type="unsigned char"
15393 '') case "$shortsize" in
15395 u16type="unsigned short"
15403 '') set try -DINT16
15404 if eval $compile; then
15405 case "`$run ./try`" in
15417 '') if $test $shortsize -ge 2; then
15419 u16type="unsigned short"
15427 '') case "$longsize" in
15429 u32type="unsigned long"
15433 *) case "$intsize" in
15435 u32type="unsigned int"
15445 '') set try -DINT32
15446 if eval $compile; then
15447 case "`$run ./try`" in
15459 '') if $test $intsize -ge 4; then
15461 u32type="unsigned int"
15469 '') case "$d_quad:$quadtype" in
15471 i64type="$quadtype"
15472 u64type="$uquadtype"
15480 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15481 : volatile so that the compiler has to store it out to memory.
15482 if test X"$d_volatile" = X"$define"; then
15487 #$i_stdlib I_STDLIB
15489 #include <stdlib.h>
15491 #include <sys/types.h>
15492 #include <signal.h>
15494 $volatile int bletched = 0;
15495 $signal_t blech(int s) { bletched = 1; }
15500 int n = 8 * $uvsize;
15503 signal(SIGFPE, blech);
15506 for (i = 0; i < n; i++) {
15507 u = u << 1 | ($uvtype)1;
15509 if (($uvtype)d != u)
15513 d = ($nvtype)(u - 1);
15514 if (($uvtype)d != (u - 1))
15521 printf("%d\n", ((i == n) ? -n : i));
15527 d_nv_preserves_uv="$undef"
15528 if eval $compile; then
15529 nv_preserves_uv_bits="`$run ./try`"
15531 case "$nv_preserves_uv_bits" in
15533 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15534 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15535 d_nv_preserves_uv="$define"
15537 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15538 d_nv_preserves_uv="$undef" ;;
15539 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15540 nv_preserves_uv_bits="0" ;;
15544 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15545 : volatile so that the compiler has to store it out to memory.
15546 if test X"$d_volatile" = X"$define"; then
15552 typedef $nvtype NV;
15559 while(count < 256) {
15560 $volatile NV up = value + 1.0;
15561 $volatile NV negated = -value;
15562 $volatile NV down = negated - 1.0;
15563 $volatile NV got_up = up - value;
15564 int up_good = got_up == 1.0;
15565 int got_down = down - negated;
15566 int down_good = got_down == -1.0;
15568 if (down_good != up_good) {
15570 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15571 up_good, (double) got_up, down_good, (double) got_down,
15572 count, (double) value);
15579 fputs("256.0", stdout);
15582 fputs("2.0", stdout);
15588 fputs("*", stdout);
15594 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15595 count, (double) value);
15601 nv_overflows_integers_at='0'
15602 if eval $compile; then
15608 The largest integer your NVs can preserve is equal to $xxx
15610 nv_overflows_integers_at="$xxx"
15613 Cannot determine the largest integer value your NVs can hold, unexpected output
15620 Cannot determine the largest integer value your NVs can hold
15627 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15628 : volatile so that the compiler has to store it out to memory.
15629 if test X"$d_volatile" = X"$define"; then
15634 #$i_stdlib I_STDLIB
15636 #include <stdlib.h>
15638 #$i_string I_STRING
15640 # include <string.h>
15642 # include <strings.h>
15644 #include <sys/types.h>
15645 #include <signal.h>
15647 $volatile int bletched = 0;
15648 $signal_t blech(int s) { bletched = 1; }
15651 int checkit($nvtype d, char *where) {
15652 unsigned char *p = (char *)&d;
15653 unsigned char *end = p + sizeof(d);
15663 printf("No - %s: 0x", where);
15665 printf ("%02X", *p++);
15670 int main(int argc, char **argv) {
15673 fail += checkit(d, "0.0");
15675 /* The compiler shouldn't be assuming that bletched is 0 */
15678 fail += checkit(d, "bleched");
15681 signal(SIGFPE, blech);
15684 /* Paranoia - the compiler should have no way of knowing that ANSI says
15685 that argv[argc] will always be NULL. Actually, if it did assume this it
15686 would be buggy, as this is C and main() can be called from elsewhere in
15688 d = argv[argc] ? 1 : 0;
15691 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15694 fail += checkit(d, "ternary");
15696 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15699 printf("No - memset doesn't give 0.0\n");
15700 /* This might just blow up: */
15701 printf("(gives %g)\n", d);
15707 printf("No - something bleched\n");
15712 printf("No - %d fail(s)\n", fail);
15721 d_nv_zero_is_allbits_zero="$undef"
15722 if eval $compile; then
15728 0.0 is represented as all bits zero in memory
15730 d_nv_zero_is_allbits_zero="$define"
15733 0.0 is not represented as all bits zero in memory
15735 d_nv_zero_is_allbits_zero="$undef"
15740 0.0 is not represented as all bits zero in memory
15742 d_nv_zero_is_allbits_zero="$undef"
15748 : check for off64_t
15750 echo "Checking to see if you have off64_t..." >&4
15752 #include <sys/types.h>
15753 #include <unistd.h>
15754 int main() { off64_t x = 7; }
15757 if eval $compile; then
15759 echo "You have off64_t."
15762 echo "You do not have off64_t."
15763 case "$lseeksize" in
15764 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15771 : how to create joinable pthreads
15772 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15774 echo "Checking what constant to use for creating joinable pthreads..." >&4
15775 $cat >try.c <<'EOCP'
15776 #include <pthread.h>
15778 int detachstate = JOINABLE;
15781 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15782 if eval $compile; then
15783 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15784 val="$undef" # Yes, undef.
15785 set d_old_pthread_create_joinable
15788 set old_pthread_create_joinable
15791 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15792 if eval $compile; then
15793 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15795 set d_old_pthread_create_joinable
15797 val=PTHREAD_CREATE_UNDETACHED
15798 set old_pthread_create_joinable
15801 set try -DJOINABLE=__UNDETACHED
15802 if eval $compile; then
15803 echo "You seem to use __UNDETACHED." >&4
15805 set d_old_pthread_create_joinable
15808 set old_pthread_create_joinable
15811 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15813 set d_old_pthread_create_joinable
15816 set old_pthread_create_joinable
15823 d_old_pthread_create_joinable="$undef"
15824 old_pthread_create_joinable=""
15827 : see if pause exists
15831 : see if poll exists
15835 : see if readlink exists
15836 set readlink d_readlink
15839 : Check if exe is symlink to abs path of executing program
15843 case "$d_readlink" in
15845 if $issymlink /proc/self/exe ; then
15846 $ls -l /proc/self/exe > reflect
15847 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15848 echo "You have Linux-like /proc/self/exe."
15849 procselfexe='"/proc/self/exe"'
15853 if $issymlink /proc/curproc/file ; then
15854 $ls -l /proc/curproc/file > reflect
15855 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15856 echo "You have BSD-like /proc/curproc/file."
15857 procselfexe='"/proc/curproc/file"'
15867 : backward compatibility for d_hvfork
15868 if test X$d_hvfork != X; then
15869 d_vfork="$d_hvfork"
15872 : see if there is a vfork
15877 d_pseudofork=$undef
15879 : Ok, but do we want to use it. vfork is reportedly unreliable in
15880 : perl on Solaris 2.x, and probably elsewhere.
15884 case "$usevfork" in
15890 Perl can only use a vfork() that doesn't suffer from strict
15891 restrictions on calling functions or modifying global data in
15892 the child. For example, glibc-2.1 contains such a vfork()
15893 that is unsuitable. If your system provides a proper fork()
15894 call, chances are that you do NOT want perl to use vfork().
15897 rp="Do you still want to use vfork()?"
15902 echo "Ok, we won't use vfork()."
15911 $define) usevfork='true';;
15912 *) usevfork='false';;
15915 : see whether the pthread_atfork exists
15917 #include <pthread.h>
15920 #ifdef PTHREAD_ATFORK
15921 pthread_atfork(NULL,NULL,NULL);
15926 : see if pthread_atfork exists
15927 set try -DPTHREAD_ATFORK
15928 if eval $compile; then
15933 case "$usethreads" in
15936 $define) echo 'pthread_atfork found.' >&4 ;;
15937 *) echo 'pthread_atfork NOT found.' >&4 ;;
15940 set d_pthread_atfork
15943 : see if pthread_attr_setscope exists
15944 set pthread_attr_setscope d_pthread_attr_setscope
15947 : see whether the various POSIXish _yields exist
15949 #include <pthread.h>
15955 #ifdef PTHREAD_YIELD
15958 #ifdef PTHREAD_YIELD_NULL
15959 pthread_yield(NULL);
15965 : see if sched_yield exists
15966 set try -DSCHED_YIELD
15967 if eval $compile; then
15969 sched_yield='sched_yield()'
15973 case "$usethreads" in
15976 $define) echo 'sched_yield() found.' >&4 ;;
15977 *) echo 'sched_yield() NOT found.' >&4 ;;
15983 : see if pthread_yield exists
15984 set try -DPTHREAD_YIELD
15985 if eval $compile; then
15987 case "$sched_yield" in
15988 '') sched_yield='pthread_yield()' ;;
15991 set try -DPTHREAD_YIELD_NULL
15992 if eval $compile; then
15994 case "$sched_yield" in
15995 '') sched_yield='pthread_yield(NULL)' ;;
16001 case "$usethreads" in
16004 $define) echo 'pthread_yield() found.' >&4 ;;
16005 *) echo 'pthread_yield() NOT found.' >&4 ;;
16009 set d_pthread_yield
16011 case "$sched_yield" in
16012 '') sched_yield=undef ;;
16016 : see if random_r exists
16017 set random_r d_random_r
16019 case "$d_random_r" in
16021 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16022 case "$d_random_r_proto:$usethreads" in
16023 ":define") d_random_r_proto=define
16024 set d_random_r_proto random_r $hdrs
16028 case "$d_random_r_proto" in
16030 case "$random_r_proto" in
16031 ''|0) try='int random_r(int*, struct random_data*);'
16032 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
16034 case "$random_r_proto" in
16035 ''|0) try='int random_r(long*, struct random_data*);'
16036 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
16038 case "$random_r_proto" in
16039 ''|0) try='int random_r(struct random_data*, int32_t*);'
16040 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
16042 case "$random_r_proto" in
16043 ''|0) d_random_r=undef
16045 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16046 * ) case "$random_r_proto" in
16047 REENTRANT_PROTO*) ;;
16048 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16050 echo "Prototype: $try" ;;
16053 *) case "$usethreads" in
16054 define) echo "random_r has no prototype, not using it." >&4 ;;
16061 *) random_r_proto=0
16065 : see if readdir and friends exist
16066 set readdir d_readdir
16068 set seekdir d_seekdir
16070 set telldir d_telldir
16072 set rewinddir d_rewinddir
16075 : see if readdir64_r exists
16076 set readdir64_r d_readdir64_r
16078 case "$d_readdir64_r" in
16080 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16081 case "$d_readdir64_r_proto:$usethreads" in
16082 ":define") d_readdir64_r_proto=define
16083 set d_readdir64_r_proto readdir64_r $hdrs
16087 case "$d_readdir64_r_proto" in
16089 case "$readdir64_r_proto" in
16090 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16091 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16093 case "$readdir64_r_proto" in
16094 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16095 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16097 case "$readdir64_r_proto" in
16098 ''|0) d_readdir64_r=undef
16099 readdir64_r_proto=0
16100 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16101 * ) case "$readdir64_r_proto" in
16102 REENTRANT_PROTO*) ;;
16103 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16105 echo "Prototype: $try" ;;
16108 *) case "$usethreads" in
16109 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16111 d_readdir64_r=undef
16112 readdir64_r_proto=0
16116 *) readdir64_r_proto=0
16120 : see if readdir_r exists
16121 set readdir_r d_readdir_r
16123 case "$d_readdir_r" in
16125 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16126 case "$d_readdir_r_proto:$usethreads" in
16127 ":define") d_readdir_r_proto=define
16128 set d_readdir_r_proto readdir_r $hdrs
16132 case "$d_readdir_r_proto" in
16134 case "$readdir_r_proto" in
16135 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16136 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16138 case "$readdir_r_proto" in
16139 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16140 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16142 case "$readdir_r_proto" in
16143 ''|0) d_readdir_r=undef
16145 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16146 * ) case "$readdir_r_proto" in
16147 REENTRANT_PROTO*) ;;
16148 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16150 echo "Prototype: $try" ;;
16153 *) case "$usethreads" in
16154 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16161 *) readdir_r_proto=0
16165 : see if readv exists
16169 : see if recvmsg exists
16170 set recvmsg d_recvmsg
16173 : see if rename exists
16174 set rename d_rename
16177 : see if rmdir exists
16181 : see if memory.h is available.
16186 : See if it conflicts with string.h
16192 $cppstdin $cppflags $cppminus < $strings > mem.h
16193 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16195 echo "We won't be including <memory.h>."
16205 : can bcopy handle overlapping blocks?
16208 case "$d_memmove" in
16209 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16210 *) case "$d_bcopy" in
16212 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16214 #$i_memory I_MEMORY
16215 #$i_stdlib I_STDLIB
16216 #$i_string I_STRING
16217 #$i_unistd I_UNISTD
16219 $cat >>try.c <<'EOCP'
16222 # include <memory.h>
16225 # include <stdlib.h>
16228 # include <string.h>
16230 # include <strings.h>
16233 # include <unistd.h> /* Needed for NetBSD */
16237 char buf[128], abc[128];
16243 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16244 try to store the string in read-only memory. */
16245 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16247 for (align = 7; align >= 0; align--) {
16248 for (len = 36; len; len--) {
16250 bcopy(abc, b, len);
16251 for (off = 1; off <= len; off++) {
16252 bcopy(b, b+off, len);
16253 bcopy(b+off, b, len);
16254 if (bcmp(b, abc, len))
16263 if eval $compile_ok; then
16264 if $run ./try 2>/dev/null; then
16265 echo "Yes, it can."
16268 echo "It can't, sorry."
16271 echo "(I can't compile the test program, so we'll assume not...)"
16281 : can memcpy handle overlapping blocks?
16284 case "$d_memmove" in
16285 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16286 *) case "$d_memcpy" in
16288 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16290 #$i_memory I_MEMORY
16291 #$i_stdlib I_STDLIB
16292 #$i_string I_STRING
16293 #$i_unistd I_UNISTD
16295 $cat >>try.c <<'EOCP'
16298 # include <memory.h>
16301 # include <stdlib.h>
16304 # include <string.h>
16306 # include <strings.h>
16309 # include <unistd.h> /* Needed for NetBSD */
16313 char buf[128], abc[128];
16319 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16320 try to store the string in read-only memory. */
16321 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16323 for (align = 7; align >= 0; align--) {
16324 for (len = 36; len; len--) {
16326 memcpy(b, abc, len);
16327 for (off = 1; off <= len; off++) {
16328 memcpy(b+off, b, len);
16329 memcpy(b, b+off, len);
16330 if (memcmp(b, abc, len))
16339 if eval $compile_ok; then
16340 if $run ./try 2>/dev/null; then
16341 echo "Yes, it can."
16344 echo "It can't, sorry."
16347 echo "(I can't compile the test program, so we'll assume not...)"
16357 : can memcmp be trusted to compare relative magnitude?
16359 case "$d_memcmp" in
16362 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16364 #$i_memory I_MEMORY
16365 #$i_stdlib I_STDLIB
16366 #$i_string I_STRING
16367 #$i_unistd I_UNISTD
16369 $cat >>try.c <<'EOCP'
16372 # include <memory.h>
16375 # include <stdlib.h>
16378 # include <string.h>
16380 # include <strings.h>
16383 # include <unistd.h> /* Needed for NetBSD */
16389 if ((a < b) && memcmp(&a, &b, 1) < 0)
16395 if eval $compile_ok; then
16396 if $run ./try 2>/dev/null; then
16397 echo "Yes, it can."
16400 echo "No, it can't (it uses signed chars)."
16403 echo "(I can't compile the test program, so we'll assume not...)"
16411 : see if prototype for sbrk is available
16413 set d_sbrkproto sbrk $i_unistd unistd.h
16416 : see if select exists
16417 set select d_select
16420 : see if semctl exists
16421 set semctl d_semctl
16424 : see if semget exists
16425 set semget d_semget
16428 : see if semop exists
16432 : see how much of the 'sem*(2)' library is present.
16435 case "$d_semctl$d_semget$d_semop" in
16436 *"$undef"*) h_sem=false;;
16440 case "`ipcs 2>&1`" in
16441 "SVID messages"*"not configured"*)
16442 echo "Your $osname does not have the sem*(2) configured." >&4
16445 set semctl d_semctl
16447 set semget d_semget
16455 : we could also check for sys/ipc.h ...
16456 if $h_sem && $test `./findhdr sys/sem.h`; then
16457 echo "You have the full sem*(2) library." >&4
16460 echo "You don't have the full sem*(2) library." >&4
16466 : see whether sys/sem.h defines union semun
16468 $cat > try.c <<'END'
16469 #include <sys/types.h>
16470 #include <sys/ipc.h>
16471 #include <sys/sem.h>
16472 int main () { union semun semun; semun.buf = 0; }
16475 if eval $compile; then
16476 echo "You have union semun in <sys/sem.h>." >&4
16479 echo "You do not have union semun in <sys/sem.h>." >&4
16486 : see how to do semctl IPC_STAT
16490 $cat > tryh.h <<END
16493 # define S_IRUSR S_IREAD
16494 # define S_IWUSR S_IWRITE
16495 # define S_IXUSR S_IEXEC
16497 # define S_IRUSR 0400
16498 # define S_IWUSR 0200
16499 # define S_IXUSR 0100
16501 # define S_IRGRP (S_IRUSR>>3)
16502 # define S_IWGRP (S_IWUSR>>3)
16503 # define S_IXGRP (S_IXUSR>>3)
16504 # define S_IROTH (S_IRUSR>>6)
16505 # define S_IWOTH (S_IWUSR>>6)
16506 # define S_IXOTH (S_IXUSR>>6)
16509 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16510 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16511 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16514 : see whether semctl IPC_STAT can use union semun
16515 case "$d_semctl_semun" in
16519 #include <sys/types.h>
16520 #include <sys/ipc.h>
16521 #include <sys/sem.h>
16522 #include <sys/stat.h>
16529 #$d_union_semun HAS_UNION_SEMUN
16532 #ifndef HAS_UNION_SEMUN
16535 struct semid_ds *buf;
16536 unsigned short *array;
16542 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16543 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16545 struct semid_ds argbuf;
16548 st = semctl(sem, 0, IPC_STAT, arg);
16552 # endif /* IPC_STAT */
16553 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16555 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16556 # endif /* IPC_RMID */
16557 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16559 #endif /* IPC_PRIVATE && ... */
16560 printf("semget failed: errno = %d\n", errno);
16565 if eval $compile; then
16568 semun) val="$define" ;;
16576 case "$d_semctl_semun" in
16578 echo "You can use union semun for semctl IPC_STAT." >&4
16581 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16586 : see whether semctl IPC_STAT can use struct semid_ds pointer
16587 case "$d_semctl_semid_ds" in
16590 $cat > try.c <<'END'
16591 #include <sys/types.h>
16592 #include <sys/ipc.h>
16593 #include <sys/sem.h>
16594 #include <sys/stat.h>
16602 struct semid_ds arg;
16605 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16606 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16609 st = semctl(sem, 0, IPC_STAT, &arg);
16611 printf("semid_ds\n");
16613 # endif /* IPC_STAT */
16614 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16616 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16617 # endif /* IPC_RMID */
16618 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16620 #endif /* IPC_PRIVATE && ... */
16621 printf("semget failed: errno = %d\n", errno);
16627 if eval $compile; then
16630 semid_ds) val="$define" ;;
16634 set d_semctl_semid_ds
16638 case "$d_semctl_semid_ds" in
16640 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16642 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16648 # We do not have the full sem*(2) library, so assume we can not
16654 set d_semctl_semid_ds
16660 : see if sendmsg exists
16661 set sendmsg d_sendmsg
16664 : see if setegid exists
16665 set setegid d_setegid
16668 : see if seteuid exists
16669 set seteuid d_seteuid
16672 : see if setgrent exists
16673 set setgrent d_setgrent
16676 : see if setgrent_r exists
16677 set setgrent_r d_setgrent_r
16679 case "$d_setgrent_r" in
16681 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16682 case "$d_setgrent_r_proto:$usethreads" in
16683 ":define") d_setgrent_r_proto=define
16684 set d_setgrent_r_proto setgrent_r $hdrs
16688 case "$d_setgrent_r_proto" in
16690 case "$setgrent_r_proto" in
16691 ''|0) try='int setgrent_r(FILE**);'
16692 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16694 case "$setgrent_r_proto" in
16695 ''|0) try='void setgrent_r(FILE**);'
16696 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16698 case "$setgrent_r_proto" in
16699 ''|0) d_setgrent_r=undef
16701 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16702 * ) case "$setgrent_r_proto" in
16703 REENTRANT_PROTO*) ;;
16704 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16706 echo "Prototype: $try" ;;
16709 *) case "$usethreads" in
16710 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16717 *) setgrent_r_proto=0
16721 : see if sethostent exists
16722 set sethostent d_sethent
16725 : see if sethostent_r exists
16726 set sethostent_r d_sethostent_r
16728 case "$d_sethostent_r" in
16730 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16731 case "$d_sethostent_r_proto:$usethreads" in
16732 ":define") d_sethostent_r_proto=define
16733 set d_sethostent_r_proto sethostent_r $hdrs
16737 case "$d_sethostent_r_proto" in
16739 case "$sethostent_r_proto" in
16740 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16741 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16743 case "$sethostent_r_proto" in
16744 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16745 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16747 case "$sethostent_r_proto" in
16748 ''|0) d_sethostent_r=undef
16749 sethostent_r_proto=0
16750 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16751 * ) case "$sethostent_r_proto" in
16752 REENTRANT_PROTO*) ;;
16753 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16755 echo "Prototype: $try" ;;
16758 *) case "$usethreads" in
16759 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16761 d_sethostent_r=undef
16762 sethostent_r_proto=0
16766 *) sethostent_r_proto=0
16770 : see if setitimer exists
16771 set setitimer d_setitimer
16774 : see if setlinebuf exists
16775 set setlinebuf d_setlinebuf
16778 : see if setlocale exists
16779 set setlocale d_setlocale
16782 : see if locale.h is available
16783 set locale.h i_locale
16786 : see if setlocale_r exists
16787 set setlocale_r d_setlocale_r
16789 case "$d_setlocale_r" in
16791 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16792 case "$d_setlocale_r_proto:$usethreads" in
16793 ":define") d_setlocale_r_proto=define
16794 set d_setlocale_r_proto setlocale_r $hdrs
16798 case "$d_setlocale_r_proto" in
16800 case "$setlocale_r_proto" in
16801 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16802 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16804 case "$setlocale_r_proto" in
16805 ''|0) d_setlocale_r=undef
16806 setlocale_r_proto=0
16807 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16808 * ) case "$setlocale_r_proto" in
16809 REENTRANT_PROTO*) ;;
16810 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16812 echo "Prototype: $try" ;;
16815 *) case "$usethreads" in
16816 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16818 d_setlocale_r=undef
16819 setlocale_r_proto=0
16823 *) setlocale_r_proto=0
16827 : see if setnetent exists
16828 set setnetent d_setnent
16831 : see if setnetent_r exists
16832 set setnetent_r d_setnetent_r
16834 case "$d_setnetent_r" in
16836 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16837 case "$d_setnetent_r_proto:$usethreads" in
16838 ":define") d_setnetent_r_proto=define
16839 set d_setnetent_r_proto setnetent_r $hdrs
16843 case "$d_setnetent_r_proto" in
16845 case "$setnetent_r_proto" in
16846 ''|0) try='int setnetent_r(int, struct netent_data*);'
16847 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16849 case "$setnetent_r_proto" in
16850 ''|0) try='void setnetent_r(int, struct netent_data*);'
16851 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16853 case "$setnetent_r_proto" in
16854 ''|0) d_setnetent_r=undef
16855 setnetent_r_proto=0
16856 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16857 * ) case "$setnetent_r_proto" in
16858 REENTRANT_PROTO*) ;;
16859 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16861 echo "Prototype: $try" ;;
16864 *) case "$usethreads" in
16865 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16867 d_setnetent_r=undef
16868 setnetent_r_proto=0
16872 *) setnetent_r_proto=0
16876 : see if setprotoent exists
16877 set setprotoent d_setpent
16880 : see if setpgid exists
16881 set setpgid d_setpgid
16884 : see if setpgrp2 exists
16885 set setpgrp2 d_setpgrp2
16888 : see if setpriority exists
16889 set setpriority d_setprior
16892 : see if setproctitle exists
16893 set setproctitle d_setproctitle
16896 : see if setprotoent_r exists
16897 set setprotoent_r d_setprotoent_r
16899 case "$d_setprotoent_r" in
16901 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16902 case "$d_setprotoent_r_proto:$usethreads" in
16903 ":define") d_setprotoent_r_proto=define
16904 set d_setprotoent_r_proto setprotoent_r $hdrs
16908 case "$d_setprotoent_r_proto" in
16910 case "$setprotoent_r_proto" in
16911 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16912 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16914 case "$setprotoent_r_proto" in
16915 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16916 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16918 case "$setprotoent_r_proto" in
16919 ''|0) d_setprotoent_r=undef
16920 setprotoent_r_proto=0
16921 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16922 * ) case "$setprotoent_r_proto" in
16923 REENTRANT_PROTO*) ;;
16924 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16926 echo "Prototype: $try" ;;
16929 *) case "$usethreads" in
16930 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16932 d_setprotoent_r=undef
16933 setprotoent_r_proto=0
16937 *) setprotoent_r_proto=0
16941 : see if setpwent exists
16942 set setpwent d_setpwent
16945 : see if setpwent_r exists
16946 set setpwent_r d_setpwent_r
16948 case "$d_setpwent_r" in
16950 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16951 case "$d_setpwent_r_proto:$usethreads" in
16952 ":define") d_setpwent_r_proto=define
16953 set d_setpwent_r_proto setpwent_r $hdrs
16957 case "$d_setpwent_r_proto" in
16959 case "$setpwent_r_proto" in
16960 ''|0) try='int setpwent_r(FILE**);'
16961 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16963 case "$setpwent_r_proto" in
16964 ''|0) try='void setpwent_r(FILE**);'
16965 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16967 case "$setpwent_r_proto" in
16968 ''|0) d_setpwent_r=undef
16970 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16971 * ) case "$setpwent_r_proto" in
16972 REENTRANT_PROTO*) ;;
16973 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16975 echo "Prototype: $try" ;;
16978 *) case "$usethreads" in
16979 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16986 *) setpwent_r_proto=0
16990 : see if setregid exists
16991 set setregid d_setregid
16993 set setresgid d_setresgid
16996 : see if setreuid exists
16997 set setreuid d_setreuid
16999 set setresuid d_setresuid
17002 : see if setrgid exists
17003 set setrgid d_setrgid
17006 : see if setruid exists
17007 set setruid d_setruid
17010 : see if setservent exists
17011 set setservent d_setsent
17014 : see if setservent_r exists
17015 set setservent_r d_setservent_r
17017 case "$d_setservent_r" in
17019 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17020 case "$d_setservent_r_proto:$usethreads" in
17021 ":define") d_setservent_r_proto=define
17022 set d_setservent_r_proto setservent_r $hdrs
17026 case "$d_setservent_r_proto" in
17028 case "$setservent_r_proto" in
17029 ''|0) try='int setservent_r(int, struct servent_data*);'
17030 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
17032 case "$setservent_r_proto" in
17033 ''|0) try='void setservent_r(int, struct servent_data*);'
17034 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
17036 case "$setservent_r_proto" in
17037 ''|0) d_setservent_r=undef
17038 setservent_r_proto=0
17039 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17040 * ) case "$setservent_r_proto" in
17041 REENTRANT_PROTO*) ;;
17042 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17044 echo "Prototype: $try" ;;
17047 *) case "$usethreads" in
17048 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17050 d_setservent_r=undef
17051 setservent_r_proto=0
17055 *) setservent_r_proto=0
17059 : see if setsid exists
17060 set setsid d_setsid
17063 : see if setvbuf exists
17064 set setvbuf d_setvbuf
17067 : see if sfio.h is available
17071 : see if sfio library is available
17082 : Ok, but do we want to use it.
17086 true|$define|[yY]*) dflt='y';;
17089 echo "$package can use the sfio library, but it is experimental."
17090 case "$useperlio" in
17092 echo "For sfio also the PerlIO abstraction layer is needed."
17093 echo "Earlier you said you wouldn't want that."
17096 rp="You seem to have sfio available, do you want to try using it?"
17099 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17100 useperlio="$define"
17103 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17108 *) case "$usesfio" in
17109 true|$define|[yY]*)
17110 echo "Sorry, cannot find sfio on this machine." >&4
17111 echo "Ignoring your setting of usesfio=$usesfio." >&4
17120 $define) usesfio='true';;
17121 *) usesfio='false';;
17125 *) : Remove sfio from list of libraries to use
17128 echo "Removing unneeded -lsfio from library list" >&4
17129 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17132 echo "libs = $libs" >&4
17139 : see if shmctl exists
17140 set shmctl d_shmctl
17143 : see if shmget exists
17144 set shmget d_shmget
17147 : see if shmat exists
17150 : see what shmat returns
17153 $cat >shmat.c <<'END'
17154 #include <sys/shm.h>
17157 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17162 echo "and it returns ($shmattype)." >&4
17163 : see if a prototype for shmat is available
17164 xxx=`./findhdr sys/shm.h`
17165 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17166 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17177 set d_shmatprototype
17180 : see if shmdt exists
17184 : see how much of the 'shm*(2)' library is present.
17187 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17188 *"$undef"*) h_shm=false;;
17192 case "`ipcs 2>&1`" in
17193 "SVID shared memory"*"not configured"*)
17194 echo "Your $osname does not have the shm*(2) configured." >&4
17197 set shmctl d_shmctl
17199 set shmget d_shmget
17209 : we could also check for sys/ipc.h ...
17210 if $h_shm && $test `./findhdr sys/shm.h`; then
17211 echo "You have the full shm*(2) library." >&4
17214 echo "You don't have the full shm*(2) library." >&4
17220 : see if we have sigaction
17222 if set sigaction val -f d_sigaction; eval $csym; $val; then
17223 echo 'sigaction() found.' >&4
17226 #include <sys/types.h>
17227 #include <signal.h>
17228 #$i_stdlib I_STDLIB
17230 #include <stdlib.h>
17234 struct sigaction act, oact;
17236 oact.sa_handler = 0;
17237 /* so that act and oact are used */
17238 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17242 if eval $compile_ok; then
17245 echo "But you don't seem to have a useable struct sigaction." >&4
17249 echo 'sigaction NOT found.' >&4
17252 set d_sigaction; eval $setvar
17255 : see if this is a sunmath.h system
17256 set sunmath.h i_sunmath
17259 : see if signbit exists
17260 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17263 #$i_sunmath I_SUNMATH
17267 #ifdef I_SUNMATH /* Solaris special math library */
17268 # include <sunmath.h>
17271 int main(int argc, char **argv)
17275 if ((signbit(x) == 0) && (signbit(y) != 0))
17283 if eval $compile; then
17284 if $run ./try; then
17288 $echo "Signbit seems to be available, but doesn't work as I expected."
17289 $echo "I won't use it." >&4
17300 : see if sigprocmask exists
17301 set sigprocmask d_sigprocmask
17304 : see if sigsetjmp exists
17306 case "$d_sigsetjmp" in
17309 #include <setjmp.h>
17310 #$i_stdlib I_STDLIB
17312 #include <stdlib.h>
17318 if (sigsetjmp(env,1))
17321 siglongjmp(env, 1);
17326 if eval $compile; then
17327 if $run ./try >/dev/null 2>&1; then
17328 echo "POSIX sigsetjmp found." >&4
17332 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17338 echo "sigsetjmp not found." >&4
17342 *) val="$d_sigsetjmp"
17343 case "$d_sigsetjmp" in
17344 $define) echo "POSIX sigsetjmp found." >&4;;
17345 $undef) echo "sigsetjmp not found." >&4;;
17353 : see if snprintf exists
17354 set snprintf d_snprintf
17357 : see if vsnprintf exists
17358 set vsnprintf d_vsnprintf
17361 case "$d_snprintf-$d_vsnprintf" in
17364 Checking whether your snprintf() and vsnprintf() work okay...
17366 $cat >try.c <<'EOCP'
17367 /* v?snprintf testing logic courtesy of Russ Allbery.
17368 * According to C99:
17369 * - if the buffer is too short it still must be \0-terminated
17370 * - if the buffer is too short the potentially required length
17371 * must be returned and not -1
17372 * - if the buffer is NULL the potentially required length
17373 * must be returned and not -1 or core dump
17376 #include <stdarg.h>
17380 int test (char *format, ...)
17385 va_start (args, format);
17386 count = vsnprintf (buf, sizeof buf, format, args);
17393 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17394 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17398 if eval $compile; then
17401 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17403 Your snprintf() and snprintf() don't seem to be working okay.
17405 d_snprintf="$undef"
17406 d_vsnprintf="$undef"
17410 echo "(I can't seem to compile the test program--assuming they don't)"
17411 d_snprintf="$undef"
17412 d_vsnprintf="$undef"
17418 : see if sockatmark exists
17419 set sockatmark d_sockatmark
17422 : see if prototype for sockatmark is available
17424 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17427 : see if socks5_init exists
17428 set socks5_init d_socks5_init
17431 : see if sprintf returns the length of the string in the buffer as per ANSI
17432 $echo "Checking whether sprintf returns the length of the string..." >&4
17435 #$i_stdlib I_STDLIB
17437 #include <stdlib.h>
17439 #$i_string I_STRING
17441 # include <string.h>
17443 # include <strings.h>
17452 int check (size_t expect, int test) {
17453 size_t got = strlen(buffer);
17457 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17462 int main(int argc, char **argv) {
17465 check(sprintf(buffer, ""), ++test);
17466 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17467 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17474 if eval $compile; then
17478 sprintf returns the length of the string (as ANSI says it should)
17480 d_sprintf_returns_strlen="$define"
17483 sprintf does not return the length of the string (how old is this system?)
17485 d_sprintf_returns_strlen="$undef"
17489 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17490 d_sprintf_returns_strlen="$undef"
17494 : see if srand48_r exists
17495 set srand48_r d_srand48_r
17497 case "$d_srand48_r" in
17499 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17500 case "$d_srand48_r_proto:$usethreads" in
17501 ":define") d_srand48_r_proto=define
17502 set d_srand48_r_proto srand48_r $hdrs
17506 case "$d_srand48_r_proto" in
17508 case "$srand48_r_proto" in
17509 ''|0) try='int srand48_r(long, struct drand48_data*);'
17510 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17512 case "$srand48_r_proto" in
17513 ''|0) d_srand48_r=undef
17515 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17516 * ) case "$srand48_r_proto" in
17517 REENTRANT_PROTO*) ;;
17518 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17520 echo "Prototype: $try" ;;
17523 *) case "$usethreads" in
17524 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17531 *) srand48_r_proto=0
17535 : see if srandom_r exists
17536 set srandom_r d_srandom_r
17538 case "$d_srandom_r" in
17540 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17541 case "$d_srandom_r_proto:$usethreads" in
17542 ":define") d_srandom_r_proto=define
17543 set d_srandom_r_proto srandom_r $hdrs
17547 case "$d_srandom_r_proto" in
17549 case "$srandom_r_proto" in
17550 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17551 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17553 case "$srandom_r_proto" in
17554 ''|0) d_srandom_r=undef
17556 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17557 * ) case "$srandom_r_proto" in
17558 REENTRANT_PROTO*) ;;
17559 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17561 echo "Prototype: $try" ;;
17564 *) case "$usethreads" in
17565 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17572 *) srandom_r_proto=0
17576 : see if prototype for setresgid is available
17578 set d_sresgproto setresgid $i_unistd unistd.h
17581 : see if prototype for setresuid is available
17583 set d_sresuproto setresuid $i_unistd unistd.h
17586 : see if sys/stat.h is available
17587 set sys/stat.h i_sysstat
17590 : see if stat knows about block sizes
17592 echo "Checking to see if your struct stat has st_blocks field..." >&4
17593 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17596 : see if this is a sys/vfs.h system
17597 set sys/vfs.h i_sysvfs
17600 : see if this is a sys/statfs.h system
17601 set sys/statfs.h i_sysstatfs
17604 : Check for statfs_s
17606 echo "Checking to see if your system supports struct statfs..." >&4
17607 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
17609 case "$d_statfs_s" in
17610 "$define") echo "Yes, it does." ;;
17611 *) echo "No, it doesn't." ;;
17615 : see if struct statfs knows about f_flags
17616 case "$d_statfs_s" in
17619 echo "Checking to see if your struct statfs has f_flags field..." >&4
17620 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
17624 set d_statfs_f_flags
17628 case "$d_statfs_f_flags" in
17629 "$define") echo "Yes, it does." ;;
17630 *) echo "No, it doesn't." ;;
17633 : Check stream access
17635 Checking how to access stdio streams by file descriptor number...
17637 case "$stdio_stream_array" in
17638 '') $cat >try.c <<EOCP
17641 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17645 for s in _iob __iob __sF
17647 set try -DSTDIO_STREAM_ARRAY=$s
17648 if eval $compile; then
17649 case "`$run ./try`" in
17650 yes) stdio_stream_array=$s; break ;;
17656 case "$stdio_stream_array" in
17658 I can't figure out how to access stdio streams by file descriptor number.
17660 d_stdio_stream_array="$undef"
17663 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17665 d_stdio_stream_array="$define"
17669 : see if strcoll exists
17670 set strcoll d_strcoll
17673 : check for structure copying
17675 echo "Checking to see if your C compiler can copy structs..." >&4
17676 $cat >try.c <<'EOCP'
17686 if $cc -c try.c >/dev/null 2>&1 ; then
17688 echo "Yup, it can."
17691 echo "Nope, it can't."
17697 : see if strerror and/or sys_errlist[] exist
17699 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17700 if set strerror val -f d_strerror; eval $csym; $val; then
17701 echo 'strerror() found.' >&4
17702 d_strerror="$define"
17703 d_strerrm='strerror(e)'
17704 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17705 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17706 d_syserrlst="$define"
17708 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17709 d_syserrlst="$undef"
17711 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17712 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17713 echo 'strerror() found in string header.' >&4
17714 d_strerror="$define"
17715 d_strerrm='strerror(e)'
17716 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17717 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17718 d_syserrlst="$define"
17720 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17721 d_syserrlst="$undef"
17723 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17724 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17725 d_strerror="$undef"
17726 d_syserrlst="$define"
17727 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17729 echo 'strerror() and sys_errlist[] NOT found.' >&4
17730 d_strerror="$undef"
17731 d_syserrlst="$undef"
17732 d_strerrm='"unknown"'
17736 : see if strerror_r exists
17737 set strerror_r d_strerror_r
17739 case "$d_strerror_r" in
17741 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17742 case "$d_strerror_r_proto:$usethreads" in
17743 ":define") d_strerror_r_proto=define
17744 set d_strerror_r_proto strerror_r $hdrs
17748 case "$d_strerror_r_proto" in
17750 case "$strerror_r_proto" in
17751 ''|0) try='int strerror_r(int, char*, size_t);'
17752 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17754 case "$strerror_r_proto" in
17755 ''|0) try='int strerror_r(int, char*, int);'
17756 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17758 case "$strerror_r_proto" in
17759 ''|0) try='char* strerror_r(int, char*, size_t);'
17760 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17762 case "$strerror_r_proto" in
17763 ''|0) d_strerror_r=undef
17765 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17766 * ) case "$strerror_r_proto" in
17767 REENTRANT_PROTO*) ;;
17768 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17770 echo "Prototype: $try" ;;
17773 *) case "$usethreads" in
17774 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17781 *) strerror_r_proto=0
17785 : see if strftime exists
17786 set strftime d_strftime
17789 : see if strlcat exists
17790 set strlcat d_strlcat
17793 : see if strlcpy exists
17794 set strlcpy d_strlcpy
17797 : see if strtod exists
17798 set strtod d_strtod
17801 : see if strtol exists
17802 set strtol d_strtol
17805 : see if strtold exists
17806 set strtold d_strtold
17809 : see if strtoll exists
17810 set strtoll d_strtoll
17813 case "$d_longlong-$d_strtoll" in
17816 Checking whether your strtoll() works okay...
17818 $cat >try.c <<'EOCP'
17821 #define strtoll __strtoll
17824 #define strtoll _strtoll
17827 extern long long int strtoll(char *s, char **, int);
17828 static int bad = 0;
17829 int check(char *s, long long ell, int een) {
17832 gll = strtoll(s, 0, 10);
17833 if (!((gll == ell) && (errno == een)))
17837 check(" 1", 1LL, 0);
17838 check(" 0", 0LL, 0);
17839 check("-1", -1LL, 0);
17840 check("-9223372036854775808", -9223372036854775808LL, 0);
17841 check("-9223372036854775808", -9223372036854775808LL, 0);
17842 check(" 9223372036854775807", 9223372036854775807LL, 0);
17843 check("-9223372036854775808", -9223372036854775808LL, 0);
17844 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17845 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17851 if eval $compile; then
17854 ok) echo "Your strtoll() seems to be working okay." ;;
17856 Your strtoll() doesn't seem to be working okay.
17862 echo "(I can't seem to compile the test program--assuming it doesn't)"
17868 : see if strtoq exists
17869 set strtoq d_strtoq
17872 : see if strtoul exists
17873 set strtoul d_strtoul
17876 case "$d_strtoul" in
17879 Checking whether your strtoul() works okay...
17881 $cat >try.c <<'EOCP'
17884 extern unsigned long int strtoul(char *s, char **, int);
17885 static int bad = 0;
17886 void check(char *s, unsigned long eul, int een) {
17889 gul = strtoul(s, 0, 10);
17890 if (!((gul == eul) && (errno == een)))
17894 check(" 1", 1L, 0);
17895 check(" 0", 0L, 0);
17897 case "$longsize" in
17899 $cat >>try.c <<'EOCP'
17900 check("18446744073709551615", 18446744073709551615UL, 0);
17901 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17902 #if 0 /* strtoul() for /^-/ strings is undefined. */
17903 check("-1", 18446744073709551615UL, 0);
17904 check("-18446744073709551614", 2, 0);
17905 check("-18446744073709551615", 1, 0);
17906 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17907 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17912 $cat >>try.c <<'EOCP'
17913 check("4294967295", 4294967295UL, 0);
17914 check("4294967296", 4294967295UL, ERANGE);
17915 #if 0 /* strtoul() for /^-/ strings is undefined. */
17916 check("-1", 4294967295UL, 0);
17917 check("-4294967294", 2, 0);
17918 check("-4294967295", 1, 0);
17919 check("-4294967296", 4294967295UL, ERANGE);
17920 check("-4294967297", 4294967295UL, ERANGE);
17925 : Should we write these tests to be more portable by sprintf-ing
17926 : ~0 and then manipulating that char string as input for strtol?
17929 $cat >>try.c <<'EOCP'
17936 if eval $compile; then
17937 case "`$run ./try`" in
17938 ok) echo "Your strtoul() seems to be working okay." ;;
17940 Your strtoul() doesn't seem to be working okay.
17946 echo "(I can't seem to compile the test program--assuming it doesn't)"
17952 : see if strtoull exists
17953 set strtoull d_strtoull
17956 case "$d_longlong-$d_strtoull" in
17959 Checking whether your strtoull() works okay...
17961 $cat >try.c <<'EOCP'
17964 #define strtoull __strtoull
17967 extern unsigned long long int strtoull(char *s, char **, int);
17968 static int bad = 0;
17969 int check(char *s, long long eull, int een) {
17972 gull = strtoull(s, 0, 10);
17973 if (!((gull == eull) && (errno == een)))
17977 check(" 1", 1LL, 0);
17978 check(" 0", 0LL, 0);
17979 check("18446744073709551615", 18446744073709551615ULL, 0);
17980 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17981 #if 0 /* strtoull() for /^-/ strings is undefined. */
17982 check("-1", 18446744073709551615ULL, 0);
17983 check("-18446744073709551614", 2LL, 0);
17984 check("-18446744073709551615", 1LL, 0);
17985 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17986 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17993 if eval $compile; then
17994 case "`$run ./try`" in
17995 ok) echo "Your strtoull() seems to be working okay." ;;
17997 Your strtoull() doesn't seem to be working okay.
17999 d_strtoull="$undef"
18003 echo "(I can't seem to compile the test program--assuming it doesn't)"
18004 d_strtoull="$undef"
18009 : see if strtouq exists
18010 set strtouq d_strtouq
18013 case "$d_strtouq" in
18016 Checking whether your strtouq() works okay...
18018 $cat >try.c <<'EOCP'
18021 extern unsigned long long int strtouq(char *s, char **, int);
18022 static int bad = 0;
18023 void check(char *s, unsigned long long eull, int een) {
18024 unsigned long long gull;
18026 gull = strtouq(s, 0, 10);
18027 if (!((gull == eull) && (errno == een)))
18031 check(" 1", 1LL, 0);
18032 check(" 0", 0LL, 0);
18033 check("18446744073709551615", 18446744073709551615ULL, 0);
18034 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18035 #if 0 /* strtouq() for /^-/ strings is undefined. */
18036 check("-1", 18446744073709551615ULL, 0);
18037 check("-18446744073709551614", 2LL, 0);
18038 check("-18446744073709551615", 1LL, 0);
18039 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18040 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18048 if eval $compile; then
18049 case "`$run ./try`" in
18050 ok) echo "Your strtouq() seems to be working okay." ;;
18052 Your strtouq() doesn't seem to be working okay.
18058 echo "(I can't seem to compile the test program--assuming it doesn't)"
18064 : see if strxfrm exists
18065 set strxfrm d_strxfrm
18068 : see if symlink exists
18069 set symlink d_symlink
18072 : see if syscall exists
18073 set syscall d_syscall
18076 : see if prototype for syscall is available
18078 set d_syscallproto syscall $i_unistd unistd.h
18081 : see if sysconf exists
18082 set sysconf d_sysconf
18085 : see if system exists
18086 set system d_system
18089 : see if tcgetpgrp exists
18090 set tcgetpgrp d_tcgetpgrp
18093 : see if tcsetpgrp exists
18094 set tcsetpgrp d_tcsetpgrp
18097 : see if prototype for telldir is available
18099 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18102 : see if time exists
18104 if test "X$d_time" = X -o X"$timetype" = X; then
18105 if set time val -f d_time; eval $csym; $val; then
18106 echo 'time() found.' >&4
18108 rp="What is the type returned by time() on this system?"
18109 set time_t timetype long stdio.h sys/types.h
18112 echo 'time() not found, hope that will do.' >&4
18120 : see if timegm exists
18121 set timegm d_timegm
18124 : see if this is a sys/times.h system
18125 set sys/times.h i_systimes
18128 : see if times exists
18130 if set times val -f d_times; eval $csym; $val; then
18131 echo 'times() found.' >&4
18134 case "$i_systimes" in
18135 "$define") inc='sys/times.h';;
18137 rp="What is the type returned by times() on this system?"
18138 set clock_t clocktype long stdio.h sys/types.h $inc
18141 echo 'times() NOT found, hope that will do.' >&4
18146 : see if tmpnam_r exists
18147 set tmpnam_r d_tmpnam_r
18149 case "$d_tmpnam_r" in
18151 hdrs="$i_systypes sys/types.h define stdio.h "
18152 case "$d_tmpnam_r_proto:$usethreads" in
18153 ":define") d_tmpnam_r_proto=define
18154 set d_tmpnam_r_proto tmpnam_r $hdrs
18158 case "$d_tmpnam_r_proto" in
18160 case "$tmpnam_r_proto" in
18161 ''|0) try='char* tmpnam_r(char*);'
18162 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18164 case "$tmpnam_r_proto" in
18165 ''|0) d_tmpnam_r=undef
18167 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18168 * ) case "$tmpnam_r_proto" in
18169 REENTRANT_PROTO*) ;;
18170 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18172 echo "Prototype: $try" ;;
18175 *) case "$usethreads" in
18176 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18183 *) tmpnam_r_proto=0
18187 : see if truncate exists
18188 set truncate d_truncate
18191 : see if ttyname_r exists
18192 set ttyname_r d_ttyname_r
18194 case "$d_ttyname_r" in
18196 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18197 case "$d_ttyname_r_proto:$usethreads" in
18198 ":define") d_ttyname_r_proto=define
18199 set d_ttyname_r_proto ttyname_r $hdrs
18203 case "$d_ttyname_r_proto" in
18205 case "$ttyname_r_proto" in
18206 ''|0) try='int ttyname_r(int, char*, size_t);'
18207 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18209 case "$ttyname_r_proto" in
18210 ''|0) try='int ttyname_r(int, char*, int);'
18211 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18213 case "$ttyname_r_proto" in
18214 ''|0) try='char* ttyname_r(int, char*, int);'
18215 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18217 case "$ttyname_r_proto" in
18218 ''|0) d_ttyname_r=undef
18220 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18221 * ) case "$ttyname_r_proto" in
18222 REENTRANT_PROTO*) ;;
18223 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18225 echo "Prototype: $try" ;;
18228 *) case "$usethreads" in
18229 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18236 *) ttyname_r_proto=0
18240 : see if tzname[] exists
18242 if set tzname val -a d_tzname; eval $csym; $val; then
18244 echo 'tzname[] found.' >&4
18247 echo 'tzname[] NOT found.' >&4
18252 : Check if is a multiplatform env
18254 next|rhapsody|darwin) multiarch="$define" ;;
18256 case "$multiarch" in
18257 ''|[nN]*) multiarch="$undef" ;;
18260 : check for ordering of bytes in a UV
18262 case "$usecrosscompile$multiarch" in
18265 You seem to be either cross-compiling or doing a multiarchitecture build,
18266 skipping the byteorder check.
18272 case "$byteorder" in
18275 In the following, larger digits indicate more significance. A big-endian
18276 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18277 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18278 machines may have weird orders like 3412. A Cray will report 87654321,
18279 an Alpha will report 12345678. If the test program works the default is
18281 I'm now running the test program...
18285 #$i_stdlib I_STDLIB
18287 #include <stdlib.h>
18289 #include <sys/types.h>
18290 typedef $uvtype UV;
18300 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18302 u.l = (UV)0x04030201;
18303 for (i = 0; i < $uvsize; i++)
18304 printf("%c", u.c[i]+'0');
18311 if eval $compile && $run ./try > /dev/null; then
18314 [1-4][1-4][1-4][1-4]|12345678|87654321)
18315 echo "(The test program ran ok.)"
18316 echo "byteorder=$dflt"
18319 ????|????????) echo "(The test program ran ok.)" ;;
18320 *) echo "(The test program didn't run right for some reason.)" ;;
18325 (I can't seem to compile the test program. Guessing big-endian...)
18328 case "$xxx_prompt" in
18330 rp="What is the order of bytes in $uvtype?"
18343 : Checking 32bit aligndness
18346 Checking to see whether you can access character data unalignedly...
18348 case "$d_u32align" in
18349 '') $cat >try.c <<EOCP
18351 #$i_stdlib I_STDLIB
18353 #include <stdlib.h>
18355 #define U32 $u32type
18356 #define BYTEORDER 0x$byteorder
18358 #include <signal.h>
18360 $signal_t bletch(int s) { exit(4); }
18363 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18368 if (sizeof(U32) != 4) {
18369 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18376 signal(SIGBUS, bletch);
18388 for (i = 0; i < 4; i++) {
18389 up = (U32*)(buf + i);
18390 if (! ((*up == 1 << (8*i)) || /* big-endian */
18391 (*up == 1 << (8*(3-i))) /* little-endian */
18395 printf("read failed (%x)\n", *up);
18401 for (i = 0; i < 4; i++) {
18402 up = (U32*)(buf + i);
18404 if (*up != 0xBeef) {
18405 printf("write failed (%x)\n", *up);
18419 if eval $compile_ok; then
18420 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18421 $run ./try 2>&1 >/dev/null
18424 You can access character data pretty unalignedly.
18426 d_u32align="$undef"
18429 It seems that you must access character data in an aligned manner.
18431 d_u32align="$define"
18435 rp='Can you access character data at unaligned addresses?'
18439 [yY]*) d_u32align="$undef" ;;
18440 *) d_u32align="$define" ;;
18447 : see if ualarm exists
18448 set ualarm d_ualarm
18451 : see if umask exists
18455 : see if unordered exists
18456 set unordered d_unordered
18459 : see if unsetenv exists
18460 set unsetenv d_unsetenv
18463 : see if usleep exists
18464 set usleep d_usleep
18467 : see if prototype for usleep is available
18469 set d_usleepproto usleep $i_unistd unistd.h
18472 : see if ustat exists
18476 : see if closedir exists
18477 set closedir d_closedir
18480 case "$d_closedir" in
18483 echo "Checking whether closedir() returns a status..." >&4
18485 #$i_dirent I_DIRENT /**/
18486 #$i_sysdir I_SYS_DIR /**/
18487 #$i_sysndir I_SYS_NDIR /**/
18488 #$i_systypes I_SYS_TYPES /**/
18490 #if defined(I_SYS_TYPES)
18491 #include <sys/types.h>
18493 #if defined(I_DIRENT)
18494 #include <dirent.h>
18495 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18496 #include <sys/dir.h>
18500 #include <sys/ndir.h>
18504 #include <ndir.h> /* may be wrong in the future */
18506 #include <sys/dir.h>
18511 int main() { return closedir(opendir(".")); }
18514 if eval $compile_ok; then
18515 if $run ./try > /dev/null 2>&1 ; then
18516 echo "Yes, it does."
18519 echo "No, it doesn't."
18523 echo "(I can't seem to compile the test program--assuming it doesn't)"
18531 set d_void_closedir
18535 : see if there is a wait4
18539 : see if waitpid exists
18540 set waitpid d_waitpid
18543 : see if wcstombs exists
18544 set wcstombs d_wcstombs
18547 : see if wctomb exists
18548 set wctomb d_wctomb
18551 : see if writev exists
18552 set writev d_writev
18555 : preserve RCS keywords in files with variable substitution, grrr
18560 Revision='$Revision'
18562 : check for alignment requirements
18564 case "$usecrosscompile$multiarch" in
18567 You seem to be either cross-compiling or doing a multiarchitecture build,
18568 skipping the memory alignment check.
18571 case "$alignbytes" in
18572 '') alignbytes=8 ;;
18576 case "$alignbytes" in
18577 '') echo "Checking alignment constraints..." >&4
18578 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18579 $cat >try.c <<'EOCP'
18580 typedef long double NV;
18583 $cat >try.c <<'EOCP'
18587 $cat >>try.c <<'EOCP'
18595 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18600 if eval $compile_ok; then
18604 echo "(I can't seem to compile the test program...)"
18607 *) dflt="$alignbytes"
18610 rp="Doubles must be aligned on a how-many-byte boundary?"
18618 : set the base revision
18621 : how do we concatenate cpp tokens here?
18623 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18624 $cat >cpp_stuff.c <<'EOCP'
18625 #define RCAT(a,b)a/**/b
18626 #define ACAT(a,b)a ## b
18630 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18631 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18632 echo "Oh! Smells like ANSI's been here." >&4
18633 echo "We can catify or stringify, separately or together!"
18635 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18636 echo "Ah, yes! The good old days!" >&4
18637 echo "However, in the good old days we don't know how to stringify and"
18638 echo "catify at the same time."
18642 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18643 You're going to have to edit the values of CAT[2-5] in config.h...
18645 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18649 : see if this is a db.h system
18655 : Check db version.
18657 echo "Checking Berkeley DB version ..." >&4
18663 #include <sys/types.h>
18665 #$i_stdlib I_STDLIB
18667 #include <stdlib.h>
18670 int main(int argc, char *argv[])
18672 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18673 int Major, Minor, Patch ;
18674 unsigned long Version ;
18675 (void)db_version(&Major, &Minor, &Patch) ;
18677 printf("%d %d %d %d %d %d\n",
18678 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18679 Major, Minor, Patch);
18682 printf("You have Berkeley DB Version 2 or greater.\n");
18684 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18685 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18686 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18687 Major, Minor, Patch) ;
18689 /* check that db.h & libdb are compatible */
18690 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18691 printf("db.h and libdb are incompatible.\n") ;
18695 printf("db.h and libdb are compatible.\n") ;
18697 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18698 + DB_VERSION_PATCH ;
18700 /* needs to be >= 2.3.4 */
18701 if (Version < 2003004) {
18702 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18703 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18709 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18714 printf("You have Berkeley DB Version 1.\n");
18715 exit(0); /* DB version < 2: the coast is clear. */
18717 exit(1); /* <db.h> not Berkeley DB? */
18723 if eval $compile_ok && $run ./try; then
18724 echo 'Looks OK.' >&4
18726 db_version_major=$1
18727 db_version_minor=$2
18728 db_version_patch=$3
18730 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18734 : Remove db from list of libraries to use
18735 echo "Removing unusable -ldb from library list" >&4
18736 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18739 echo "libs = $libs" >&4
18749 : Check the return type needed for hash
18751 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18757 #include <sys/types.h>
18760 #ifndef DB_VERSION_MAJOR
18761 u_int32_t hash_cb (ptr, size)
18769 info.hash = hash_cb;
18773 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18774 if $contains warning try.out >>/dev/null 2>&1 ; then
18777 db_hashtype='u_int32_t'
18780 : XXX Maybe we should just give up here.
18781 db_hashtype=u_int32_t
18783 echo "Help: I can't seem to compile the db test program." >&4
18784 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18787 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18789 *) db_hashtype=u_int32_t
18794 : Check the return type needed for prefix
18796 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18802 #include <sys/types.h>
18805 #ifndef DB_VERSION_MAJOR
18806 size_t prefix_cb (key1, key2)
18814 info.prefix = prefix_cb;
18818 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18819 if $contains warning try.out >>/dev/null 2>&1 ; then
18820 db_prefixtype='int'
18822 db_prefixtype='size_t'
18825 db_prefixtype='size_t'
18826 : XXX Maybe we should just give up here.
18828 echo "Help: I can't seem to compile the db test program." >&4
18829 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18832 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18834 *) db_prefixtype='size_t'
18838 : How can we generate normalized random numbers ?
18840 echo "Looking for a random number function..." >&4
18841 case "$randfunc" in
18843 if set drand48 val -f; eval $csym; $val; then
18845 echo "Good, found drand48()." >&4
18846 elif set random val -f; eval $csym; $val; then
18848 echo "OK, found random()." >&4
18851 echo "Yick, looks like I have to use rand()." >&4
18862 *-Dmy_rand=*|*-Dmy_srand=*)
18863 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18864 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18865 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18866 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18870 while $test "$cont"; do
18871 rp="Use which function to generate random numbers?"
18873 if $test "$ans" = "$dflt"; then
18879 if set $ans val -f; eval $csym; $val; then
18883 rp="I cannot find function $ans. Use that name anyway?"
18892 case "$randfunc" in
18894 drand01="drand48()"
18900 case "$randbits" in
18902 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18904 #$i_unistd I_UNISTD
18905 #$i_stdlib I_STDLIB
18908 # include <unistd.h>
18911 # include <stdlib.h>
18916 register unsigned long tmp;
18917 register unsigned long max = 0L;
18919 for (i = 1000; i; i--) {
18920 tmp = (unsigned long) $randfunc();
18921 if (tmp > max) max = tmp;
18923 for (i = 0; max; i++)
18929 if eval $compile_ok; then
18933 echo "(I can't seem to compile the test program...)"
18940 rp="How many bits does your $randfunc() function produce?"
18944 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18945 seedfunc="s$randfunc"
18946 randseedtype=unsigned
18950 rp="How many bits does your $randfunc() function produce?"
18953 seedfunc="s$randfunc"
18954 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18955 if set $seedfunc val -f; eval $csym; $val; then
18956 echo "(Using $seedfunc() to seed random generator)"
18958 echo "(Warning: no $seedfunc() to seed random generator)"
18961 randseedtype=unsigned
18968 : Determine if this is an EBCDIC system
18970 echo "Determining whether or not we are on an EBCDIC system..." >&4
18971 $cat >try.c <<'EOM'
18974 if ('M'==0xd4) return 0;
18981 if eval $compile_ok; then
18982 if $run ./try; then
18983 echo "You seem to speak EBCDIC." >&4
18986 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18989 echo "I'm unable to compile the test program." >&4
18990 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18996 : Check how to flush
18999 Checking how to flush all pending stdio output...
19001 # I only know how to find the first 32 possibly open files on SunOS.
19002 # See also hints/sunos_4_1.sh and util.c --AD
19004 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19006 $cat >>try.c <<EOCP
19008 #$i_stdlib I_STDLIB
19010 #include <stdlib.h>
19012 #$i_unistd I_UNISTD
19014 # include <unistd.h>
19016 #$d_sysconf HAS_SYSCONF
19017 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19018 #ifdef HAS_STDIO_STREAM_ARRAY
19019 # define STDIO_STREAM_ARRAY $stdio_stream_array
19024 p = fopen("try.out", "w");
19028 # ifdef TRY_FPRINTF
19032 #ifdef TRY_FFLUSH_NULL
19035 #ifdef TRY_FFLUSH_ALL
19037 long open_max = -1;
19038 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19039 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19041 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19042 open_max = sysconf(_SC_OPEN_MAX);
19045 open_max = FOPEN_MAX;
19048 open_max = OPEN_MAX;
19057 # ifdef HAS_STDIO_STREAM_ARRAY
19058 if (open_max > 0) {
19060 for (i = 0; i < open_max; i++)
19061 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19062 STDIO_STREAM_ARRAY[i]._file < open_max &&
19063 STDIO_STREAM_ARRAY[i]._flag)
19064 fflush(&STDIO_STREAM_ARRAY[i]);
19072 : first we have to find out how _not_ to flush
19074 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19076 set try -DTRY_FPUTC
19077 if eval $compile; then
19078 $run ./try 2>/dev/null
19081 if $test ! -s try.out -a "X$code" = X42; then
19087 set try -DTRY_FPRINTF
19088 if eval $compile; then
19089 $run ./try 2>/dev/null
19092 if $test ! -s try.out -a "X$code" = X42; then
19093 output=-DTRY_FPRINTF
19099 : check for fflush NULL behaviour
19100 case "$fflushNULL" in
19101 '') set try -DTRY_FFLUSH_NULL $output
19102 if eval $compile; then
19103 $run ./try 2>/dev/null
19106 if $test -s try.out -a "X$code" = X42; then
19107 fflushNULL="`$cat try.out`"
19109 if $test "X$code" != X42; then
19111 (If this test failed, don't worry, we'll try another method shortly.)
19116 $rm -f core try.core core.try.*
19117 case "$fflushNULL" in
19119 Your fflush(NULL) works okay for output streams.
19120 Let's see if it clobbers input pipes...
19122 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19123 # bug that improperly flushes the input end of pipes. So we avoid the
19124 # autoflush on fork/system/exec support for now. :-(
19125 $cat >tryp.c <<EOCP
19128 main(int argc, char **argv)
19134 while ((i = getc(stdin)) != -1
19135 && (*bp++ = i) != '\n'
19136 && bp < &buf[1024])
19139 fprintf(stdout, "%s", buf);
19147 fflushNULL="$define"
19149 if eval $compile; then
19151 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19152 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19154 fflush(NULL) seems to behave okay with input streams.
19156 fflushNULL="$define"
19159 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19161 fflushNULL="$undef"
19164 $rm -f core tryp.c tryp.core core.tryp.*
19167 Your fflush(NULL) isn't working (contrary to ANSI C).
19169 fflushNULL="$undef"
19172 Cannot figure out whether your fflush(NULL) works or not.
19173 I'm assuming it doesn't (contrary to ANSI C).
19175 fflushNULL="$undef"
19179 $define|true|[yY]*)
19180 fflushNULL="$define"
19183 fflushNULL="$undef"
19186 : check explicit looping only if NULL did not work, and if the pipe
19187 : bug does not show up on an explicit flush too
19188 case "$fflushNULL" in
19190 $cat >tryp.c <<EOCP
19193 main(int argc, char **argv)
19199 while ((i = getc(stdin)) != -1
19200 && (*bp++ = i) != '\n'
19201 && bp < &buf[1024])
19204 fprintf(stdout, "%s", buf);
19213 if eval $compile; then
19215 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19216 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19218 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19220 : now check for fflushall behaviour
19221 case "$fflushall" in
19222 '') set try -DTRY_FFLUSH_ALL $output
19223 if eval $compile; then
19225 (Now testing the other method--but note that this also may fail.)
19227 $run ./try 2>/dev/null
19230 if $test -s try.out -a "X$code" = X42; then
19231 fflushall="`$cat try.out`"
19235 case "$fflushall" in
19237 Whew. Flushing explicitly all the stdio streams works.
19239 fflushall="$define"
19242 Sigh. Flushing explicitly all the stdio streams doesn't work.
19247 Cannot figure out whether flushing stdio streams explicitly works or not.
19248 I'm assuming it doesn't.
19254 "$define"|true|[yY]*)
19255 fflushall="$define"
19263 All is futile. Even fflush(stdin) clobbers input pipes!
19270 $rm -f core tryp.c tryp.core core.tryp.*
19272 *) fflushall="$undef"
19276 case "$fflushNULL$fflushall" in
19279 OK, I give up. I cannot figure out how to flush pending stdio output.
19280 We won't be flushing handles at all before fork/exec/popen.
19286 : Store the full pathname to the ar program for use in the C program
19287 : Respect a hint or command line value for full_ar.
19292 : Store the full pathname to the sed program for use in the C program
19295 : see what type gids are declared as in the kernel
19297 echo "Looking for the type for group ids returned by getgid()."
19298 set gid_t gidtype xxx stdio.h sys/types.h
19302 xxx=`./findhdr sys/user.h`
19303 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19305 unsigned) dflt="$1 $2" ;;
19309 *) dflt="$gidtype";;
19312 gid_t) echo "gid_t found." ;;
19313 *) rp="What is the type for group ids returned by getgid()?"
19319 : Check the size of GID
19322 *_t) zzz="$gidtype" ;;
19325 echo "Checking the size of $zzz..." >&4
19327 #include <sys/types.h>
19329 #$i_stdlib I_STDLIB
19331 #include <stdlib.h>
19334 printf("%d\n", (int)sizeof($gidtype));
19339 if eval $compile_ok; then
19343 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19346 echo "Your $zzz is $gidsize bytes long."
19351 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19355 : Check if GID is signed
19358 *_t) zzz="$gidtype" ;;
19361 echo "Checking the sign of $zzz..." >&4
19363 #include <sys/types.h>
19374 if eval $compile; then
19378 echo "(I can't execute the test program--guessing unsigned.)" >&4
19382 1) echo "Your $zzz is unsigned." ;;
19383 -1) echo "Your $zzz is signed." ;;
19389 echo "(I can't compile the test program--guessing unsigned.)" >&4
19393 : Check 64bit sizes
19396 if $test X"$quadtype" != X; then
19398 echo "Checking how to print 64-bit integers..." >&4
19400 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19401 $cat >try.c <<'EOCP'
19402 #include <sys/types.h>
19405 int q = 12345678901;
19406 printf("%ld\n", q);
19410 if eval $compile; then
19414 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19415 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19416 echo "We will use %d."
19422 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19423 $cat >try.c <<'EOCP'
19424 #include <sys/types.h>
19427 long q = 12345678901;
19428 printf("%ld\n", q);
19432 if eval $compile; then
19436 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19437 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19438 echo "We will use %ld."
19444 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19445 $cat >try.c <<'EOCP'
19446 #include <sys/types.h>
19447 #include <inttypes.h>
19450 int64_t q = 12345678901;
19451 printf("%" PRId64 "\n", q);
19455 if eval $compile; then
19459 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19460 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19461 echo "We will use the C9X style."
19467 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19469 #include <sys/types.h>
19472 $quadtype q = 12345678901;
19473 printf("%Ld\n", q);
19477 if eval $compile; then
19481 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19482 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19483 echo "We will use %Ld."
19489 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19490 $cat >try.c <<'EOCP'
19491 #include <sys/types.h>
19494 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19495 printf("%lld\n", q);
19499 if eval $compile; then
19503 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19504 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19505 echo "We will use the %lld style."
19511 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19513 #include <sys/types.h>
19516 $quadtype q = 12345678901;
19517 printf("%qd\n", q);
19521 if eval $compile; then
19525 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19526 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19527 echo "We will use %qd."
19533 if $test X"$sPRId64" = X; then
19534 echo "Cannot figure out how to print 64-bit integers." >&4
19541 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19542 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19544 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19545 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19549 : Check format strings for internal types
19551 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19553 if $test X"$ivsize" = X8; then
19554 ivdformat="$sPRId64"
19555 uvuformat="$sPRIu64"
19556 uvoformat="$sPRIo64"
19557 uvxformat="$sPRIx64"
19558 uvXUformat="$sPRIXU64"
19560 if $test X"$ivsize" = X"$longsize"; then
19567 if $test X"$ivsize" = X"$intsize"; then
19575 if $test X"$ivsize" = X"$shortsize"; then
19586 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19587 nveformat="$sPRIeldbl"
19588 nvfformat="$sPRIfldbl"
19589 nvgformat="$sPRIgldbl"
19590 nvEUformat="$sPRIEUldbl"
19591 nvFUformat="$sPRIFUldbl"
19592 nvGUformat="$sPRIGUldbl"
19602 case "$ivdformat" in
19603 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19608 : Check format string for GID
19611 $echo "Checking the format string to be used for gids..." >&4
19614 -1) if $test X"$gidsize" = X"$ivsize"; then
19615 gidformat="$ivdformat"
19617 if $test X"$gidsize" = X"$longsize"; then
19620 if $test X"$gidsize" = X"$intsize"; then
19623 if $test X"$gidsize" = X"$shortsize"; then
19630 *) if $test X"$gidsize" = X"$uvsize"; then
19631 gidformat="$uvuformat"
19633 if $test X"$gidsize" = X"$longsize"; then
19636 if $test X"$gidsize" = X"$intsize"; then
19639 if $test X"$gidsize" = X"$shortsize"; then
19648 : see if getgroups exists
19649 set getgroups d_getgrps
19652 : see if setgroups exists
19653 set setgroups d_setgrps
19656 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19658 case "$d_getgrps$d_setgrps" in
19660 case "$groupstype" in
19661 '') dflt="$gidtype" ;;
19662 *) dflt="$groupstype" ;;
19665 What type of pointer is the second argument to getgroups() and setgroups()?
19666 Usually this is the same as group ids, $gidtype, but not always.
19669 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19673 *) groupstype="$gidtype";;
19676 : MAD = Misc Attribute Definition
19678 if $test $patchlevel -lt 9; then
19679 : MAD is not available in 5.8.x or earlier.
19683 $define|true|[yY]*) dflt='y' ;;
19688 Would you like to build with Misc Attribute Decoration? This is development
19689 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19690 overhead on the interpreter.
19692 If this doesn't make any sense to you, just accept the default '$dflt'.
19694 rp='Build Perl with MAD?'
19699 madlyh='madly.h madly.act madly.tab'
19701 madlyobj="madly$_o" ;;
19710 : check whether make sets MAKE
19712 echo "Checking if your $make program sets \$(MAKE)..." >&4
19713 case "$make_set_make" in
19715 $sed 's/^X //' > testmake.mak << 'EOF'
19717 X @echo 'maketemp="$(MAKE)"'
19719 case "`$make -f testmake.mak 2>/dev/null`" in
19720 *maketemp=*) make_set_make='#' ;;
19721 *) make_set_make="MAKE=$make" ;;
19723 $rm -f testmake.mak
19726 case "$make_set_make" in
19727 '#') echo "Yup, it does.";;
19728 *) echo "Nope, it doesn't.";;
19731 : see what type is used for mode_t
19732 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19733 set mode_t modetype int stdio.h sys/types.h
19736 : see if we need va_copy
19738 case "$i_stdarg" in
19741 #include <stdarg.h>
19743 #$i_stdlib I_STDLIB
19745 #include <stdlib.h>
19747 #include <signal.h>
19750 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19752 return vfprintf(f, fmt, *valp);
19756 myvfprintf(FILE *f, const char *fmt, va_list val)
19758 return ivfprintf(f, fmt, &val);
19762 myprintf(char *fmt, ...)
19765 va_start(val, fmt);
19766 return myvfprintf(stdout, fmt, val);
19770 main(int ac, char **av)
19772 signal(SIGSEGV, exit);
19774 myprintf("%s%cs all right, then\n", "that", '\'');
19779 if eval $compile && $run ./try 2>&1 >/dev/null; then
19780 case "`$run ./try`" in
19781 "that's all right, then")
19787 yes) echo "It seems that you don't need va_copy()." >&4
19788 need_va_copy="$undef"
19790 *) echo "It seems that va_copy() or similar will be needed." >&4
19791 need_va_copy="$define"
19796 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19800 : see what type is used for size_t
19801 rp="What is the type used for the length parameter for string functions?"
19802 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19805 : check for type of arguments to gethostbyaddr.
19806 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19807 case "$d_gethbyaddr" in
19811 Checking to see what type of arguments are accepted by gethostbyaddr().
19813 hdrs="$define sys/types.h
19814 $d_socket sys/socket.h
19815 $i_niin netinet/in.h
19817 $i_unistd unistd.h"
19818 : The first arg can 'char *' or 'void *'
19819 : The second arg is some of integral type
19820 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19821 for yyy in size_t long int; do
19822 case "$netdb_host_type" in
19823 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19824 if ./protochk "$try" $hdrs; then
19825 echo "Your system accepts $xxx for the first arg."
19826 echo "...and $yyy for the second arg."
19827 netdb_host_type="$xxx"
19828 netdb_hlen_type="$yyy"
19834 : In case none of those worked, prompt the user.
19835 case "$netdb_host_type" in
19836 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19839 netdb_host_type=$ans
19840 rp='What is the type for the 2nd argument to gethostbyaddr?'
19843 netdb_hlen_type=$ans
19847 *) : no gethostbyaddr, so pick harmless defaults
19848 netdb_host_type='char *'
19849 netdb_hlen_type="$sizetype"
19852 # Remove the "const" if needed. -- but then we'll have a
19854 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19857 : check for type of argument to gethostbyname.
19858 if test "X$netdb_name_type" = X ; then
19859 case "$d_gethbyname" in
19863 Checking to see what type of argument is accepted by gethostbyname().
19865 hdrs="$define sys/types.h
19866 $d_socket sys/socket.h
19867 $i_niin netinet/in.h
19869 $i_unistd unistd.h"
19870 for xxx in "const char *" "char *"; do
19871 case "$netdb_name_type" in
19872 '') try="extern struct hostent *gethostbyname($xxx);"
19873 if ./protochk "$try" $hdrs; then
19874 echo "Your system accepts $xxx."
19875 netdb_name_type="$xxx"
19880 : In case none of those worked, prompt the user.
19881 case "$netdb_name_type" in
19882 '') rp='What is the type for the 1st argument to gethostbyname?'
19885 netdb_name_type=$ans
19889 *) : no gethostbyname, so pick harmless default
19890 netdb_name_type='char *'
19895 : check for type of 1st argument to getnetbyaddr.
19896 if test "X$netdb_net_type" = X ; then
19897 case "$d_getnbyaddr" in
19901 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19903 hdrs="$define sys/types.h
19904 $d_socket sys/socket.h
19905 $i_niin netinet/in.h
19907 $i_unistd unistd.h"
19908 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19909 case "$netdb_net_type" in
19910 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19911 if ./protochk "$try" $hdrs; then
19912 echo "Your system accepts $xxx."
19913 netdb_net_type="$xxx"
19918 : In case none of those worked, prompt the user.
19919 case "$netdb_net_type" in
19920 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19923 netdb_net_type=$ans
19927 *) : no getnetbyaddr, so pick harmless default
19928 netdb_net_type='long'
19932 : locate the preferred pager for this system
19939 [a-zA-Z]:/*) dflt=$pg;;
19943 [a-zA-Z]:/*) dflt=$more;;
19947 [a-zA-Z]:/*) dflt=$less;;
19950 '') dflt=/usr/ucb/more;;
19958 rp='What pager is used on your system?'
19962 : see what type pids are declared as in the kernel
19963 rp="What is the type of process ids on this system?"
19964 set pid_t pidtype int stdio.h sys/types.h
19967 : see if ar generates random libraries by itself
19969 echo "Checking how to generate random libraries on your machine..." >&4
19970 echo 'int bar1() { return bar2(); }' > bar1.c
19971 echo 'int bar2() { return 2; }' > bar2.c
19973 #$i_stdlib I_STDLIB
19975 #include <stdlib.h>
19977 int main() { printf("%d\n", bar1()); exit(0); }
19979 $cc $ccflags -c bar1.c >/dev/null 2>&1
19980 $cc $ccflags -c bar2.c >/dev/null 2>&1
19981 $cc $ccflags -c foo.c >/dev/null 2>&1
19982 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19983 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19984 $run ./foobar >/dev/null 2>&1; then
19985 echo "$ar appears to generate random libraries itself."
19987 if [ "X$ranlib" = "X" ]; then
19990 elif $ar s bar$_a >/dev/null 2>&1 &&
19991 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19992 $run ./foobar >/dev/null 2>&1; then
19993 echo "a table of contents needs to be added with '$ar s'."
19996 elif $ar ts bar$_a >/dev/null 2>&1 &&
19997 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19998 $run ./foobar >/dev/null 2>&1; then
19999 echo "a table of contents needs to be added with '$ar ts'."
20006 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20007 $test -f $ranlib || ranlib=''
20010 if $test -n "$ranlib"; then
20011 echo "your system has '$ranlib'; we'll use that."
20014 echo "your system doesn't seem to support random libraries"
20015 echo "so we'll use lorder and tsort to order the libraries."
20022 : see if this is a values.h system
20023 set values.h i_values
20026 : Check the max offset that gmtime and localtime accept
20027 echo "Checking max offsets that gmtime () accepts"
20030 define) yyy="#include <values.h>" ;;
20034 case "$sGMTIME_min/$sGMTIME_max" in
20037 #include <sys/types.h>
20046 void gm_check (time_t t)
20049 if (tmp == NULL || tmp->tm_year < -1900)
20060 gm_check (MAXLONG);
20062 if (tmp == NULL || tmp->tm_year < 0) {
20063 for (i = 63; i >= 0; i--) {
20064 time_t x = pt | ((time_t)1 << i);
20065 if (x < 0) continue;
20069 printf ("sGMTIME_max=%ld\n", pt);
20078 gm_check (MINLONG);
20081 for (i = 36; i >= 0; i--) {
20082 time_t x = pt - ((time_t)1 << i);
20083 if (x > 0) continue;
20087 printf ("sGMTIME_min=%ld\n", pt);
20091 int main (int argc, char *argv[])
20093 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20100 if eval $compile; then
20103 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20109 echo "Checking max offsets that localtime () accepts"
20111 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20114 #include <sys/types.h>
20123 void local_check (time_t t)
20125 tmp = localtime (&t);
20126 if (tmp == NULL || tmp->tm_year < -1900)
20130 } /* local_check */
20137 local_check (MAXLONG);
20139 if (tmp == NULL || tmp->tm_year < 0) {
20140 for (i = 63; i >= 0; i--) {
20141 time_t x = pt | ((time_t)1 << i);
20142 if (x < 0) continue;
20146 printf ("sLOCALTIME_max=%ld\n", pt);
20155 local_check (MINLONG);
20158 for (i = 36; i >= 0; i--) {
20159 time_t x = pt - ((time_t)1 << i);
20160 if (x > 0) continue;
20164 printf ("sLOCALTIME_min=%ld\n", pt);
20168 int main (int argc, char *argv[])
20176 if eval $compile; then
20179 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20185 : check for type of arguments to select.
20186 case "$selecttype" in
20187 '') case "$d_select" in
20191 Checking to see what type of arguments are accepted by select().
20193 hdrs="$define sys/types.h
20194 $i_systime sys/time.h
20195 $i_sysselct sys/select.h
20196 $d_socket sys/socket.h"
20197 : The first arg can be int, unsigned, or size_t
20198 : The last arg may or may not be 'const'
20200 : void pointer has been seen but using that
20201 : breaks the selectminbits test
20202 for xxx in 'fd_set *' 'int *'; do
20203 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20204 for tmo in 'struct timeval *' 'const struct timeval *'; do
20206 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20207 if ./protochk "$try" $hdrs; then
20208 echo "Your system accepts $xxx."
20217 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20218 case "$d_fd_set" in
20219 $define) dflt="fd_set *" ;;
20228 *) : no select, so pick a harmless default
20235 : check for the select 'width'
20236 case "$selectminbits" in
20237 '') safebits=`expr $ptrsize \* 8`
20238 case "$d_select" in
20242 Checking to see on how many bits at a time your select() operates...
20245 #include <sys/types.h>
20247 #$i_systime I_SYS_TIME
20248 #$i_systimek I_SYS_TIME_KERNEL
20253 # ifdef I_SYS_TIME_KERNEL
20256 # include <sys/time.h>
20257 # ifdef I_SYS_TIME_KERNEL
20261 #$i_sysselct I_SYS_SELECT
20262 #ifdef I_SYS_SELECT
20263 #include <sys/select.h>
20265 #$d_socket HAS_SOCKET
20267 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20270 #$i_stdlib I_STDLIB
20272 #include <stdlib.h>
20275 #define S sizeof(*(b))
20277 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20278 #define NBITS (NBYTES * 8)
20280 char *s = (char *)malloc(NBYTES);
20289 fp = fopen("try.c", "r");
20295 b = ($selecttype)s;
20296 for (i = 0; i < NBITS; i++)
20300 select(fd + 1, b, 0, 0, &t);
20301 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20303 printf("%d\n", i + 1);
20308 if eval $compile_ok; then
20309 selectminbits=`$run ./try`
20310 case "$selectminbits" in
20312 Cannot figure out on how many bits at a time your select() operates.
20313 I'll play safe and guess it is $safebits bits.
20315 selectminbits=$safebits
20316 bits="$safebits bits"
20319 *) bits="$selectminbits bits" ;;
20321 echo "Your select() operates on $bits at a time." >&4
20323 rp='What is the minimum number of bits your select() operates on?'
20324 case "$byteorder" in
20325 12345678) dflt=64 ;;
20331 selectminbits="$val"
20335 *) : no select, so pick a harmless default
20336 selectminbits=$safebits
20342 : Trace out the files included by signal.h, then look for SIGxxx names.
20343 if [ "X$fieldn" = X ]; then
20344 : Just make some guesses. We check them later.
20345 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20347 xxx=`echo '#include <signal.h>' |
20348 $cppstdin $cppminus $cppflags 2>/dev/null |
20349 $grep '^[ ]*#.*include' |
20350 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20351 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20354 for xx in $xxx /dev/null ; do
20355 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20357 case "$xxxfiles" in
20358 '') xxxfiles=`./findhdr signal.h` ;;
20361 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20362 print substr($2, 4, 20)
20364 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20365 print substr($3, 4, 20)
20367 : Append some common names just in case the awk scan failed.
20368 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20369 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20370 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20371 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20372 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20374 : generate a few handy files for later
20375 $cat > signal.c <<EOCP
20376 #include <sys/types.h>
20377 #include <signal.h>
20378 #$i_stdlib I_STDLIB
20380 #include <stdlib.h>
20385 /* Strange style to avoid deeply-nested #if/#else/#endif */
20388 # define NSIG (_NSIG)
20394 # define NSIG (SIGMAX+1)
20400 # define NSIG (SIG_MAX+1)
20406 # define NSIG (_SIG_MAX+1)
20412 # define NSIG (MAXSIG+1)
20418 # define NSIG (MAX_SIG+1)
20423 # ifdef SIGARRAYSIZE
20424 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20430 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20434 /* Default to some arbitrary number that's big enough to get most
20435 of the common signals.
20441 printf("NSIG %d\n", NSIG);
20447 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20449 printf "#ifdef SIG"; printf $1; printf "\n"
20450 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20451 printf $1; printf ");\n"
20455 printf "#endif /* JUST_NSIG */\n";
20456 printf "exit(0);\n}\n";
20459 $cat >signal.awk <<'EOP'
20460 BEGIN { ndups = 0 }
20461 $1 ~ /^NSIG$/ { nsig = $2 }
20462 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20463 if ($2 > maxsig) { maxsig = $2 }
20464 if (sig_name[$2]) {
20465 dup_name[ndups] = $1
20466 dup_num[ndups] = $2
20478 printf("NSIG %d\n", nsig);
20479 for (n = 1; n < nsig; n++) {
20481 printf("%s %d\n", sig_name[n], sig_num[n])
20484 printf("NUM%d %d\n", n, n)
20487 for (n = 0; n < ndups; n++) {
20488 printf("%s %d\n", dup_name[n], dup_num[n])
20492 $cat >signal_cmd <<EOS
20494 if $test -s signal.lst; then
20495 echo "Using your existing signal.lst file"
20500 $cat >>signal_cmd <<'EOS'
20503 if eval $compile_ok; then
20504 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20505 $uniq | $awk -f signal.awk >signal.lst
20507 echo "(I can't seem be able to compile the whole test program)" >&4
20508 echo "(I'll try it in little pieces.)" >&4
20509 set signal -DJUST_NSIG
20510 if eval $compile_ok; then
20511 $run ./signal$_exe > signal.nsg
20514 echo "I can't seem to figure out how many signals you have." >&4
20515 echo "Guessing 50." >&4
20516 echo 'NSIG 50' > signal.nsg
20518 : Now look at all the signal names, one at a time.
20519 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20520 $cat > signal.c <<EOCP
20521 #include <sys/types.h>
20522 #include <signal.h>
20525 printf("$xx %d\n", SIG${xx});
20530 if eval $compile; then
20531 echo "SIG${xx} found."
20532 $run ./signal$_exe >> signal.ls1
20534 echo "SIG${xx} NOT found."
20537 if $test -s signal.ls1; then
20538 $cat signal.nsg signal.ls1 |
20539 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20543 if $test -s signal.lst; then
20546 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20547 echo 'kill -l' >signal
20548 set X `csh -f <signal`
20552 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20554 echo $@ | $tr ' ' $trnl | \
20555 $awk '{ printf "%s %d\n", $1, ++s; }
20556 END { printf "NSIG %d\n", ++s }' >signal.lst
20558 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20560 chmod a+x signal_cmd
20561 $eunicefix signal_cmd
20563 : generate list of signal names
20565 case "$sig_name_init" in
20567 *) case "$sig_num_init" in
20568 ''|*,*) doinit=yes ;;
20573 echo "Generating a list of signal names and numbers..." >&4
20575 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20576 sig_name=`$awk 'BEGIN { printf "ZERO " }
20577 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20578 sig_num=`$awk 'BEGIN { printf "0 " }
20579 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20580 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20581 !/^NSIG/ { printf "\"%s\", ", $1 }
20582 END { printf "0\n" }' signal.lst`
20583 sig_num_init=`$awk 'BEGIN { printf "0, " }
20584 !/^NSIG/ { printf "%d, ", $2}
20585 END { printf "0\n"}' signal.lst`
20588 echo "The following $sig_count signals are available:"
20590 echo $sig_name | $awk \
20591 'BEGIN { linelen = 0 }
20593 for (i = 1; i <= NF; i++) {
20594 name = "SIG" $i " "
20595 linelen = linelen + length(name)
20596 if (linelen > 70) {
20598 linelen = length(name)
20604 sig_size=`echo $sig_name | awk '{print NF}'`
20605 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20607 : Check size of size
20609 case "$sizetype" in
20610 *_t) zzz="$sizetype" ;;
20611 *) zzz="filesize" ;;
20613 echo "Checking the size of $zzz..." >&4
20615 #include <sys/types.h>
20617 #$i_stdlib I_STDLIB
20619 #include <stdlib.h>
20622 printf("%d\n", (int)sizeof($sizetype));
20627 if eval $compile_ok; then
20631 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20634 echo "Your $zzz size is $sizesize bytes."
20639 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20643 : check for socklen_t
20645 echo "Checking to see if you have socklen_t..." >&4
20647 #include <sys/types.h>
20648 #$d_socket HAS_SOCKET
20650 #include <sys/socket.h>
20652 int main() { socklen_t x = 16; }
20655 if eval $compile; then
20657 echo "You have socklen_t."
20660 echo "You do not have socklen_t."
20661 case "$sizetype" in
20662 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20669 : see if this is a socks.h system
20670 set socks.h i_socks
20673 : check for type of the size argument to socket calls
20674 case "$d_socket" in
20678 Checking to see what type is the last argument of accept().
20681 case "$d_socklen_t" in
20682 "$define") yyy="$yyy socklen_t"
20684 yyy="$yyy $sizetype int long unsigned"
20685 for xxx in $yyy; do
20686 case "$socksizetype" in
20687 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20688 case "$usesocks" in
20690 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20691 echo "Your system accepts '$xxx *' for the last argument of accept()."
20692 socksizetype="$xxx"
20695 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20696 echo "Your system accepts '$xxx *' for the last argument of accept()."
20697 socksizetype="$xxx"
20704 : In case none of those worked, prompt the user.
20705 case "$socksizetype" in
20706 '') rp='What is the type for socket address structure sizes?'
20713 *) : no sockets, so pick relatively harmless default
20718 : see what type is used for signed size_t
20719 set ssize_t ssizetype int stdio.h sys/types.h
20724 #$i_stdlib I_STDLIB
20726 #include <stdlib.h>
20728 #include <sys/types.h>
20729 #define Size_t $sizetype
20730 #define SSize_t $dflt
20733 if (sizeof(Size_t) == sizeof(SSize_t))
20735 else if (sizeof(Size_t) == sizeof(int))
20744 if eval $compile_ok && $run ./try > /dev/null; then
20745 ssizetype=`$run ./try`
20746 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20749 Help! I can't compile and run the ssize_t test program: please enlighten me!
20750 (This is probably a misconfiguration in your system or libraries, and
20751 you really ought to fix it. Still, I'll try anyway.)
20753 I need a type that is the same size as $sizetype, but is guaranteed to
20754 be signed. Common values are ssize_t, int and long.
20757 rp="What signed type is the same size as $sizetype?"
20763 : see what type of char stdio uses.
20765 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20766 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20767 echo "Your stdio uses unsigned chars." >&4
20768 stdchar="unsigned char"
20770 echo "Your stdio uses signed chars." >&4
20775 : see what type uids are declared as in the kernel
20777 echo "Looking for the type for user ids returned by getuid()."
20778 set uid_t uidtype xxx stdio.h sys/types.h
20782 xxx=`./findhdr sys/user.h`
20783 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20785 unsigned) dflt="$1 $2" ;;
20789 *) dflt="$uidtype";;
20792 uid_t) echo "uid_t found." ;;
20793 *) rp="What is the type for user ids returned by getuid()?"
20799 : Check size of UID
20802 *_t) zzz="$uidtype" ;;
20805 echo "Checking the size of $zzz..." >&4
20807 #include <sys/types.h>
20809 #$i_stdlib I_STDLIB
20811 #include <stdlib.h>
20814 printf("%d\n", (int)sizeof($uidtype));
20819 if eval $compile_ok; then
20823 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20826 echo "Your $zzz is $uidsize bytes long."
20831 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20834 : Check if UID is signed
20837 *_t) zzz="$uidtype" ;;
20840 echo "Checking the sign of $zzz..." >&4
20842 #include <sys/types.h>
20853 if eval $compile; then
20857 echo "(I can't execute the test program--guessing unsigned.)" >&4
20861 1) echo "Your $zzz is unsigned." ;;
20862 -1) echo "Your $zzz is signed." ;;
20868 echo "(I can't compile the test program--guessing unsigned.)" >&4
20872 : Check format string for UID
20874 $echo "Checking the format string to be used for uids..." >&4
20877 -1) if $test X"$uidsize" = X"$ivsize"; then
20878 uidformat="$ivdformat"
20880 if $test X"$uidsize" = X"$longsize"; then
20883 if $test X"$uidsize" = X"$intsize"; then
20886 if $test X"$uidsize" = X"$shortsize"; then
20893 *) if $test X"$uidsize" = X"$uvsize"; then
20894 uidformat="$uvuformat"
20896 if $test X"$uidsize" = X"$longsize"; then
20899 if $test X"$uidsize" = X"$intsize"; then
20902 if $test X"$uidsize" = X"$shortsize"; then
20911 : Check if site customization support was requested
20912 case "$usesitecustomize" in
20913 $define|true|[Yy]*)
20914 usesitecustomize="$define"
20917 usesitecustomize="$undef"
20921 : determine compiler compiler
20930 if $test -f "$byacc$_exe"; then
20932 comp="byacc or $comp"
20934 if $test -f "$bison$_exe"; then
20935 comp="$comp or bison -y"
20937 rp="Which compiler compiler ($comp) shall I use?"
20946 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20952 : see if this is a assert.h system
20953 set assert.h i_assert
20956 : see if this is a fp.h system
20960 : see if this is a fp_class.h system
20961 set fp_class.h i_fp_class
20964 : see if gdbm.h is available
20969 : see if gdbm_open exists
20970 set gdbm_open d_gdbm_open
20972 case "$d_gdbm_open" in
20975 echo "We won't be including <gdbm.h>"
20984 : see if ndbm.h is available
20987 : Compatibility location for RedHat 7.1
20988 set gdbm/ndbm.h i_gdbmndbm
20990 : Compatibility location for Debian 4.0
20991 set gdbm-ndbm.h i_gdbm_ndbm
20994 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
20995 : see if dbm_open exists
20996 set dbm_open d_dbm_open
20998 case "$d_dbm_open" in
21001 i_gdbmndbm="$undef"
21002 i_gdbm_ndbm="$undef"
21003 echo "We won't be including <ndbm.h>"
21013 : see if this is a ieeefp.h system
21014 case "$i_ieeefp" in
21015 '' ) set ieeefp.h i_ieeefp
21020 : see if this is a libutil.h system
21021 set libutil.h i_libutil
21024 : see if mach cthreads are available
21025 if test "X$usethreads" = "X$define"; then
21026 set mach/cthreads.h i_machcthr
21029 i_machcthr="$undef"
21032 : see if this is a mntent.h system
21033 set mntent.h i_mntent
21036 : see if net/errno.h is available
21038 set net/errno.h val
21041 : Unfortunately, it causes problems on some systems. Arrgh.
21044 cat > try.c <<'EOM'
21047 #include <net/errno.h>
21053 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21054 echo "We'll be including <net/errno.h>." >&4
21056 echo "We won't be including <net/errno.h>." >&4
21065 : see if netinet/tcp.h is available
21066 set netinet/tcp.h i_netinettcp
21069 : see if this is a poll.h system
21073 : see if this is a prot.h system
21077 : Preprocessor symbols
21079 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21080 $cat <<'EOSH' > Cppsym.know
21081 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21082 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21083 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21084 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21085 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21086 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21087 bull c cadmus clipper CMU COFF COMPILER_VERSION
21088 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21089 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21090 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21091 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21093 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21094 H3050R H3050RX hbullx20 hcx host_mips
21095 hp200 hp300 hp700 HP700 hp800 hp9000
21096 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21097 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21098 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21099 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21100 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21101 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21102 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21103 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21104 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21105 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21106 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21107 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21108 MATH_HAS_NO_SIDE_EFFECTS
21109 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21110 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21111 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21112 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21113 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21114 NetBSD news1500 news1700 news1800 news1900 news3700
21115 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21116 ns32016 ns32332 ns32k nsc32000
21117 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21118 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21119 pc532 pdp11 PGC PIC plexus PORTAR posix
21120 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21121 POSIX_C_SOURCE POSIX_SOURCE POWER
21122 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21123 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21124 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21125 sony sony_news sonyrisc sparc sparclite spectrum
21126 stardent stdc STDC_EXT stratos sun sun3 sun386
21127 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21128 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21129 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21130 sysV68 sysV88 Tek4132 Tek4300 titan
21131 TM3200 TM5400 TM5600
21132 tower tower32 tower32_200 tower32_600 tower32_700
21133 tower32_800 tower32_850 tss
21134 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21135 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21136 unix UNIX95 UNIX99 unixpc unos
21137 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21138 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21139 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21141 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21142 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21143 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21146 # Maybe put other stuff here too.
21147 cat <<EOSH >>Cppsym.know
21150 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21151 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21152 $cat Cppsym.know > Cppsym.c
21153 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21154 $rm -f Cppsym.a Cppsym.b Cppsym.c
21155 cat <<EOSH > Cppsym
21157 if $test \$# -gt 0; then
21158 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21159 if $test -s Cppsym.got; then
21166 $tr " " "$trnl" | ./Cppsym.try
21172 cat <<EOSH > Cppsym.try
21174 cat <<'EOCP' > try.c
21177 #define STRINGIFY(a) "a"
21179 #if cpp_stuff == 42
21180 #define StGiFy(a) #a
21181 #define STRINGIFY(a) StGiFy(a)
21183 #if $cpp_stuff != 1 && $cpp_stuff != 42
21184 # include "Bletch: How does this C preprocessor stringify macros?"
21190 cat <<'EOSH' >> Cppsym.try
21192 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21193 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21194 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21195 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21197 echo 'return 0;}' >> try.c
21199 cat <<EOSH >> Cppsym.try
21201 case "$osname-$gccversion" in
21202 irix-) ccflags="\$ccflags -woff 1178" ;;
21203 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21205 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21207 chmod +x Cppsym.try
21208 $eunicefix Cppsym.try
21209 ./Cppsym < Cppsym.know > Cppsym.true
21210 : Add in any linux cpp "predefined macros":
21211 case "$osname::$gccversion" in
21214 rm -f $tHdrH'.h' $tHdrH
21216 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21217 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21218 if [ -s $tHdrH'_cppsym.real' ]; then
21219 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21222 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21225 : now check the C compiler for additional symbols
21226 postprocess_cc_v=''
21228 aix) postprocess_cc_v="|$tr , ' '" ;;
21235 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21238 -D*) echo "\$i" | $sed 's/^-D//';;
21239 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21244 postprocess_cc_v=''
21247 ./ccsym > ccsym1.raw
21248 if $test -s ccsym1.raw; then
21249 $sort ccsym1.raw | $uniq >ccsym.raw
21251 mv ccsym1.raw ccsym.raw
21254 $awk '/\=/ { print $0; next }
21255 { print $0"=1" }' ccsym.raw >ccsym.list
21256 $comm -13 Cppsym.true ccsym.list >ccsym.own
21257 $comm -12 Cppsym.true ccsym.list >ccsym.com
21258 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21260 if $test -z ccsym.raw; then
21261 echo "Your C compiler doesn't seem to define any symbols!" >&4
21263 echo "However, your C preprocessor defines the following symbols:"
21266 cppsymbols=`$cat Cppsym.true`
21267 cppsymbols=`echo $cppsymbols`
21268 cppccsymbols="$cppsymbols"
21270 if $test -s ccsym.com; then
21271 echo "Your C compiler and pre-processor define these symbols:"
21272 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21275 cppccsymbols=`$cat ccsym.com`
21276 cppccsymbols=`echo $cppccsymbols`
21277 $test "$silent" || sleep 1
21279 if $test -s ccsym.cpp; then
21280 $test "$also" && echo " "
21281 echo "Your C pre-processor ${also}defines the following symbols:"
21282 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21284 cppsymbols=`$cat ccsym.cpp`
21285 cppsymbols=`echo $cppsymbols`
21286 $test "$silent" || sleep 1
21288 if $test -s ccsym.own; then
21289 $test "$also" && echo " "
21290 echo "Your C compiler ${also}defines the following cpp symbols:"
21291 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21292 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21293 ccsymbols=`$cat ccsym.own`
21294 ccsymbols=`echo $ccsymbols`
21295 $test "$silent" || sleep 1
21299 : see if this is a termio system
21303 if $test `./findhdr termios.h`; then
21304 set tcsetattr i_termios
21310 "$define") echo "You have POSIX termios.h... good!" >&4;;
21311 *) if ./Cppsym pyr; then
21312 case "`/bin/universe`" in
21313 ucb) if $test `./findhdr sgtty.h`; then
21315 echo "<sgtty.h> found." >&4
21317 echo "System is pyramid with BSD universe."
21318 ./warn "<sgtty.h> not found--you could have problems."
21320 *) if $test `./findhdr termio.h`; then
21322 echo "<termio.h> found." >&4
21324 echo "System is pyramid with USG universe."
21325 ./warn "<termio.h> not found--you could have problems."
21329 if $test `./findhdr termio.h`; then
21330 echo "<termio.h> found." >&4
21332 elif $test `./findhdr sgtty.h`; then
21333 echo "<sgtty.h> found." >&4
21336 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21339 if $test `./findhdr sgtty.h`; then
21340 echo "<sgtty.h> found." >&4
21342 elif $test `./findhdr termio.h`; then
21343 echo "<termio.h> found." >&4
21346 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21350 set i_termio; eval $setvar
21351 val=$val2; set i_sgtty; eval $setvar
21352 val=$val3; set i_termios; eval $setvar
21354 : see if stddef is available
21355 set stddef.h i_stddef
21358 : see if sys/access.h is available
21359 set sys/access.h i_sysaccess
21362 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21363 set sys/filio.h i_sysfilio
21366 if $test `./findhdr sys/ioctl.h`; then
21368 echo '<sys/ioctl.h> found.' >&4
21371 if $test $i_sysfilio = "$define"; then
21372 echo '<sys/ioctl.h> NOT found.' >&4
21374 $test $i_sgtty = "$define" && xxx="sgtty.h"
21375 $test $i_termio = "$define" && xxx="termio.h"
21376 $test $i_termios = "$define" && xxx="termios.h"
21377 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21383 : see if socket ioctl defs are in sys/sockio.h
21385 xxx=`./findhdr sys/sockio.h`
21386 if $test "$xxx"; then
21387 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21389 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21392 echo "No socket ioctls found in <sys/sockio.h>." >&4
21397 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21403 : see if this is a syslog.h system
21404 set syslog.h i_syslog
21407 : see if this is a sys/mode.h system
21408 set sys/mode.h i_sysmode
21411 : see if there is a sys/poll.h file
21412 set sys/poll.h i_syspoll
21415 : see if sys/resource.h has to be included
21416 set sys/resource.h i_sysresrc
21419 : see if sys/security.h is available
21420 set sys/security.h i_syssecrt
21423 : see if this is a sys/statvfs.h system
21424 set sys/statvfs.h i_sysstatvfs
21427 : see if this is a sys/un.h system
21428 set sys/un.h i_sysun
21431 : see if this is a sys/utsname.h system
21432 set sys/utsname.h i_sysutsname
21435 : see if this is a syswait system
21436 set sys/wait.h i_syswait
21439 : see if this is a ustat.h system
21440 set ustat.h i_ustat
21443 : see if this is an utime system
21444 set utime.h i_utime
21447 : see if this is a vfork system
21450 set vfork.h i_vfork
21460 echo "Looking for extensions..." >&4
21461 : If we are using the old config.sh, known_extensions may contain
21462 : old or inaccurate or duplicate values.
21463 known_extensions=''
21464 nonxs_extensions=''
21465 : We do not use find because it might not be available.
21466 : We do not just use MANIFEST because the user may have dropped
21467 : some additional extensions into the source tree and expect them
21470 : Function to recursively find available extensions, ignoring DynaLoader
21471 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21475 DynaLoader|dynaload) ;;
21477 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21478 known_extensions="$known_extensions $1$xxx";
21479 elif $test -f $xxx/Makefile.PL; then
21480 nonxs_extensions="$nonxs_extensions $1$xxx";
21482 if $test -d $xxx -a $# -lt 10; then
21485 eval $find_extensions;
21497 eval $find_extensions
21498 # Special case: Add in modules that nest beyond the first level.
21499 # Currently threads/shared and Hash/Util/FieldHash, since they are
21500 # not picked up by the recursive find above (and adding in general
21501 # recursive finding breaks SDBM_File/sdbm).
21502 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21503 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21504 set X $known_extensions
21506 known_extensions="$*"
21507 set X $nonxs_extensions
21509 nonxs_extensions="$*"
21512 : Now see which are supported on this system.
21514 for xxx in $known_extensions ; do
21518 $define) avail_ext="$avail_ext $xxx" ;;
21521 GDBM_File|gdbm_fil)
21523 $define) avail_ext="$avail_ext $xxx" ;;
21526 I18N/Langinfo|i18n_lan)
21527 case "$i_langinfo$d_nl_langinfo" in
21528 $define$define) avail_ext="$avail_ext $xxx" ;;
21532 : XXX Do we need a useipcsysv variable here
21533 case "${d_msg}${d_sem}${d_shm}" in
21534 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21537 NDBM_File|ndbm_fil)
21540 case "$osname-$use64bitint" in
21543 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21546 *) avail_ext="$avail_ext $xxx" ;;
21551 ODBM_File|odbm_fil)
21552 case "${i_dbm}${i_rpcsvcdbm}" in
21554 case "$d_cplusplus" in
21555 define) ;; # delete as a function name will not work
21556 *) case "$osname-$use64bitint" in
21559 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21562 *) avail_ext="$avail_ext $xxx" ;;
21570 case "$useopcode" in
21571 true|define|y) avail_ext="$avail_ext $xxx" ;;
21575 case "$useposix" in
21576 true|define|y) avail_ext="$avail_ext $xxx" ;;
21580 case "$d_socket" in
21583 beos) ;; # not unless BONE
21584 *) avail_ext="$avail_ext $xxx" ;;
21589 Sys/Syslog|sys/syslog)
21590 : XXX syslog requires socket
21591 case "$d_socket" in
21592 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21596 case "$usethreads" in
21598 case "$use5005threads" in
21599 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21603 threads|threads/shared)
21604 # threads and threads::shared are special cases.
21605 # To stop people from asking "Perl 5.8.0 was supposed
21606 # to have this new fancy threads implementation but my
21607 # perl doesn't have it" and from people trying to
21608 # (re)install the threads module using CPAN.pm and
21609 # CPAN.pm then offering to reinstall Perl 5.8.0,
21610 # the threads.pm and threads/shared.pm will always be
21611 # there, croaking informatively ("you need to rebuild
21612 # all of Perl with threads, sorry") when threads haven't
21613 # been compiled in.
21615 avail_ext="$avail_ext $xxx"
21619 cygwin) avail_ext="$avail_ext $xxx" ;;
21622 XS/APItest|xs/apitest)
21623 # This is just for testing. Skip it unless we have dynamic loading.
21626 $define) avail_ext="$avail_ext $xxx" ;;
21629 XS/Typemap|xs/typemap)
21630 # This is just for testing. Skip it unless we have dynamic loading.
21632 $define) avail_ext="$avail_ext $xxx" ;;
21635 *) avail_ext="$avail_ext $xxx"
21644 case "$onlyextensions" in
21646 *) keepextensions=''
21647 echo "You have requested that only certains extensions be included..." >&4
21648 for i in $onlyextensions; do
21649 case " $avail_ext " in
21651 echo "Keeping extension $i."
21652 keepextensions="$keepextensions $i"
21654 *) echo "Ignoring extension $i." ;;
21657 avail_ext="$keepextensions"
21661 case "$noextensions" in
21663 *) keepextensions=''
21664 echo "You have requested that certain extensions be ignored..." >&4
21665 for i in $avail_ext; do
21666 case " $noextensions " in
21667 *" $i "*) echo "Ignoring extension $i." ;;
21668 *) echo "Keeping extension $i.";
21669 keepextensions="$keepextensions $i"
21673 avail_ext="$keepextensions"
21677 : Now see which nonxs extensions are supported on this system.
21678 : For now assume all are.
21680 for xxx in $nonxs_extensions ; do
21682 *) nonxs_ext="$nonxs_ext $xxx"
21694 A number of extensions are supplied with $package. You may choose to
21695 compile these extensions for dynamic loading (the default), compile
21696 them into the $package executable (static loading), or not include
21697 them at all. Answer "none" to include no extensions.
21698 Note that DynaLoader is always built and need not be mentioned here.
21701 case "$dynamic_ext" in
21703 : Exclude those listed in static_ext
21705 for xxx in $avail_ext; do
21706 case " $static_ext " in
21708 *) dflt="$dflt $xxx" ;;
21715 *) dflt="$dynamic_ext"
21716 # Perhaps we are reusing an old out-of-date config.sh.
21719 if test X"$dynamic_ext" != X"$avail_ext"; then
21721 NOTICE: Your previous config.sh list may be incorrect.
21722 The extensions now available to you are
21724 but the default list from your previous config.sh is
21736 rp="What extensions do you wish to load dynamically?"
21739 none) dynamic_ext=' ' ;;
21740 *) dynamic_ext="$ans" ;;
21743 case "$static_ext" in
21745 : Exclude those already listed in dynamic linking
21747 for xxx in $avail_ext; do
21748 case " $dynamic_ext " in
21750 *) dflt="$dflt $xxx" ;;
21757 *) dflt="$static_ext"
21764 rp="What extensions do you wish to load statically?"
21767 none) static_ext=' ' ;;
21768 *) static_ext="$ans" ;;
21773 A number of extensions are supplied with $package. Answer "none"
21774 to include no extensions.
21775 Note that DynaLoader is always built and need not be mentioned here.
21778 case "$static_ext" in
21779 '') dflt="$avail_ext" ;;
21780 *) dflt="$static_ext"
21781 # Perhaps we are reusing an old out-of-date config.sh.
21784 if test X"$static_ext" != X"$avail_ext"; then
21786 NOTICE: Your previous config.sh list may be incorrect.
21787 The extensions now available to you are
21789 but the default list from your previous config.sh is
21798 : Exclude those that are not xs extensions
21802 rp="What extensions do you wish to include?"
21805 none) static_ext=' ' ;;
21806 *) static_ext="$ans" ;;
21811 # Encode is a special case. If we are building Encode as a static
21812 # extension, we need to explicitly list its subextensions as well.
21813 # For other nested extensions, this is handled automatically by
21814 # the appropriate Makefile.PL.
21815 case " $static_ext " in
21816 *" Encode "*) # Add the subextensions of Encode
21818 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21819 static_ext="$static_ext Encode/$xxx"
21825 set X $dynamic_ext $static_ext $nonxs_ext
21829 # Sanity check: We require an extension suitable for use with
21830 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21831 # should show up as failures in the test suite, but it's helpful to
21832 # catch them now.) The 'extensions' list is normally sorted
21833 # alphabetically, so we need to accept either
21834 # DB_File ... Fcntl ... IO ....
21835 # or something like
21836 # Fcntl ... NDBM_File ... IO ....
21837 case " $extensions" in
21838 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21839 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21840 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21841 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21842 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21846 : Remove libraries needed only for extensions
21847 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21848 : The exception is SunOS 4.x, which needs them.
21849 case "${osname}X${osvers}" in
21853 *) case "$usedl" in
21854 $define|true|[yY]*)
21855 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21859 *) perllibs="$libs"
21865 : Remove build directory name from cppstdin so it can be used from
21866 : either the present location or the final installed location.
21868 : Get out of the UU directory to get correct path name.
21870 case "$cppstdin" in
21872 echo "Stripping down cppstdin path name"
21878 : end of configuration questions
21880 echo "End of configuration questions."
21883 : back to where it started
21884 if test -d ../UU; then
21888 : configuration may be unconditionally patched via a 'config.arch' file
21889 if $test -f config.arch; then
21890 echo "I see a config.arch file, loading it." >&4
21894 : configuration may be patched via a 'config.over' file
21895 if $test -f config.over; then
21898 rp='I see a config.over file. Do you wish to load it?'
21901 n*) echo "OK, I'll ignore it.";;
21903 echo "Configuration override changes have been loaded."
21908 : in case they want portability, strip down executable paths
21909 case "$d_portable" in
21912 echo "Stripping down executable paths..." >&4
21913 for file in $loclist $trylist; do
21915 eval $file=`basename $temp`
21920 : create config.sh file
21922 echo "Creating config.sh..." >&4
21923 $spitshell <<EOT >config.sh
21926 # This file was produced by running the Configure script. It holds all the
21927 # definitions figured out by Configure. Should you modify one of these values,
21928 # do not forget to propagate your changes by running "Configure -der". You may
21929 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21932 # Package name : $package
21933 # Source directory : $src
21934 # Configuration time: $cf_time
21935 # Configured by : $cf_by
21936 # Target system : $myuname
21939 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21940 $spitshell <<EOT >>config.sh
21949 Revision='$Revision'
21957 alignbytes='$alignbytes'
21958 ansi2knr='$ansi2knr'
21959 aphostname='$aphostname'
21960 api_revision='$api_revision'
21961 api_subversion='$api_subversion'
21962 api_version='$api_version'
21963 api_versionstring='$api_versionstring'
21966 archlibexp='$archlibexp'
21967 archname64='$archname64'
21968 archname='$archname'
21969 archobjs='$archobjs'
21970 asctime_r_proto='$asctime_r_proto'
21978 byteorder='$byteorder'
21980 castflags='$castflags'
21983 cccdlflags='$cccdlflags'
21984 ccdlflags='$ccdlflags'
21986 ccflags_uselargefiles='$ccflags_uselargefiles'
21988 ccsymbols='$ccsymbols'
21989 ccversion='$ccversion'
21991 cf_email='$cf_email'
21996 clocktype='$clocktype'
21998 compress='$compress'
21999 contains='$contains'
22003 cpp_stuff='$cpp_stuff'
22004 cppccsymbols='$cppccsymbols'
22005 cppflags='$cppflags'
22007 cppminus='$cppminus'
22009 cppstdin='$cppstdin'
22010 cppsymbols='$cppsymbols'
22011 crypt_r_proto='$crypt_r_proto'
22012 cryptlib='$cryptlib'
22014 ctermid_r_proto='$ctermid_r_proto'
22015 ctime_r_proto='$ctime_r_proto'
22016 d_Gconvert='$d_Gconvert'
22017 d_PRIEUldbl='$d_PRIEUldbl'
22018 d_PRIFUldbl='$d_PRIFUldbl'
22019 d_PRIGUldbl='$d_PRIGUldbl'
22020 d_PRIXU64='$d_PRIXU64'
22021 d_PRId64='$d_PRId64'
22022 d_PRIeldbl='$d_PRIeldbl'
22023 d_PRIfldbl='$d_PRIfldbl'
22024 d_PRIgldbl='$d_PRIgldbl'
22025 d_PRIi64='$d_PRIi64'
22026 d_PRIo64='$d_PRIo64'
22027 d_PRIu64='$d_PRIu64'
22028 d_PRIx64='$d_PRIx64'
22029 d_SCNfldbl='$d_SCNfldbl'
22030 d__fwalk='$d__fwalk'
22031 d_access='$d_access'
22032 d_accessx='$d_accessx'
22035 d_archlib='$d_archlib'
22036 d_asctime_r='$d_asctime_r'
22039 d_attribute_format='$d_attribute_format'
22040 d_attribute_malloc='$d_attribute_malloc'
22041 d_attribute_nonnull='$d_attribute_nonnull'
22042 d_attribute_noreturn='$d_attribute_noreturn'
22043 d_attribute_pure='$d_attribute_pure'
22044 d_attribute_unused='$d_attribute_unused'
22045 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22049 d_bsdgetpgrp='$d_bsdgetpgrp'
22050 d_bsdsetpgrp='$d_bsdsetpgrp'
22051 d_builtin_choose_expr='$d_builtin_choose_expr'
22052 d_builtin_expect='$d_builtin_expect'
22054 d_c99_variadic_macros='$d_c99_variadic_macros'
22055 d_casti32='$d_casti32'
22056 d_castneg='$d_castneg'
22057 d_charvspr='$d_charvspr'
22059 d_chroot='$d_chroot'
22060 d_chsize='$d_chsize'
22062 d_clearenv='$d_clearenv'
22063 d_closedir='$d_closedir'
22064 d_cmsghdr_s='$d_cmsghdr_s'
22066 d_copysignl='$d_copysignl'
22067 d_cplusplus='$d_cplusplus'
22069 d_crypt_r='$d_crypt_r'
22071 d_ctermid='$d_ctermid'
22072 d_ctermid_r='$d_ctermid_r'
22073 d_ctime_r='$d_ctime_r'
22074 d_cuserid='$d_cuserid'
22075 d_dbl_dig='$d_dbl_dig'
22076 d_dbminitproto='$d_dbminitproto'
22077 d_difftime='$d_difftime'
22078 d_dir_dd_fd='$d_dir_dd_fd'
22080 d_dirnamlen='$d_dirnamlen'
22081 d_dlerror='$d_dlerror'
22082 d_dlopen='$d_dlopen'
22083 d_dlsymun='$d_dlsymun'
22084 d_dosuid='$d_dosuid'
22085 d_drand48_r='$d_drand48_r'
22086 d_drand48proto='$d_drand48proto'
22088 d_eaccess='$d_eaccess'
22089 d_endgrent='$d_endgrent'
22090 d_endgrent_r='$d_endgrent_r'
22091 d_endhent='$d_endhent'
22092 d_endhostent_r='$d_endhostent_r'
22093 d_endnent='$d_endnent'
22094 d_endnetent_r='$d_endnetent_r'
22095 d_endpent='$d_endpent'
22096 d_endprotoent_r='$d_endprotoent_r'
22097 d_endpwent='$d_endpwent'
22098 d_endpwent_r='$d_endpwent_r'
22099 d_endsent='$d_endsent'
22100 d_endservent_r='$d_endservent_r'
22101 d_eofnblk='$d_eofnblk'
22102 d_eunice='$d_eunice'
22103 d_faststdio='$d_faststdio'
22104 d_fchdir='$d_fchdir'
22105 d_fchmod='$d_fchmod'
22106 d_fchown='$d_fchown'
22108 d_fcntl_can_lock='$d_fcntl_can_lock'
22109 d_fd_macros='$d_fd_macros'
22110 d_fd_set='$d_fd_set'
22111 d_fds_bits='$d_fds_bits'
22112 d_fgetpos='$d_fgetpos'
22113 d_finite='$d_finite'
22114 d_finitel='$d_finitel'
22115 d_flexfnam='$d_flexfnam'
22117 d_flockproto='$d_flockproto'
22119 d_fp_class='$d_fp_class'
22120 d_fpathconf='$d_fpathconf'
22121 d_fpclass='$d_fpclass'
22122 d_fpclassify='$d_fpclassify'
22123 d_fpclassl='$d_fpclassl'
22124 d_fpos64_t='$d_fpos64_t'
22125 d_frexpl='$d_frexpl'
22126 d_fs_data_s='$d_fs_data_s'
22127 d_fseeko='$d_fseeko'
22128 d_fsetpos='$d_fsetpos'
22129 d_fstatfs='$d_fstatfs'
22130 d_fstatvfs='$d_fstatvfs'
22132 d_ftello='$d_ftello'
22134 d_futimes='$d_futimes'
22135 d_getcwd='$d_getcwd'
22136 d_getespwnam='$d_getespwnam'
22137 d_getfsstat='$d_getfsstat'
22138 d_getgrent='$d_getgrent'
22139 d_getgrent_r='$d_getgrent_r'
22140 d_getgrgid_r='$d_getgrgid_r'
22141 d_getgrnam_r='$d_getgrnam_r'
22142 d_getgrps='$d_getgrps'
22143 d_gethbyaddr='$d_gethbyaddr'
22144 d_gethbyname='$d_gethbyname'
22145 d_gethent='$d_gethent'
22146 d_gethname='$d_gethname'
22147 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22148 d_gethostbyname_r='$d_gethostbyname_r'
22149 d_gethostent_r='$d_gethostent_r'
22150 d_gethostprotos='$d_gethostprotos'
22151 d_getitimer='$d_getitimer'
22152 d_getlogin='$d_getlogin'
22153 d_getlogin_r='$d_getlogin_r'
22154 d_getmnt='$d_getmnt'
22155 d_getmntent='$d_getmntent'
22156 d_getnbyaddr='$d_getnbyaddr'
22157 d_getnbyname='$d_getnbyname'
22158 d_getnent='$d_getnent'
22159 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22160 d_getnetbyname_r='$d_getnetbyname_r'
22161 d_getnetent_r='$d_getnetent_r'
22162 d_getnetprotos='$d_getnetprotos'
22163 d_getpagsz='$d_getpagsz'
22164 d_getpbyname='$d_getpbyname'
22165 d_getpbynumber='$d_getpbynumber'
22166 d_getpent='$d_getpent'
22167 d_getpgid='$d_getpgid'
22168 d_getpgrp2='$d_getpgrp2'
22169 d_getpgrp='$d_getpgrp'
22170 d_getppid='$d_getppid'
22171 d_getprior='$d_getprior'
22172 d_getprotobyname_r='$d_getprotobyname_r'
22173 d_getprotobynumber_r='$d_getprotobynumber_r'
22174 d_getprotoent_r='$d_getprotoent_r'
22175 d_getprotoprotos='$d_getprotoprotos'
22176 d_getprpwnam='$d_getprpwnam'
22177 d_getpwent='$d_getpwent'
22178 d_getpwent_r='$d_getpwent_r'
22179 d_getpwnam_r='$d_getpwnam_r'
22180 d_getpwuid_r='$d_getpwuid_r'
22181 d_getsbyname='$d_getsbyname'
22182 d_getsbyport='$d_getsbyport'
22183 d_getsent='$d_getsent'
22184 d_getservbyname_r='$d_getservbyname_r'
22185 d_getservbyport_r='$d_getservbyport_r'
22186 d_getservent_r='$d_getservent_r'
22187 d_getservprotos='$d_getservprotos'
22188 d_getspnam='$d_getspnam'
22189 d_getspnam_r='$d_getspnam_r'
22190 d_gettimeod='$d_gettimeod'
22191 d_gmtime_r='$d_gmtime_r'
22192 d_gnulibc='$d_gnulibc'
22193 d_grpasswd='$d_grpasswd'
22194 d_hasmntopt='$d_hasmntopt'
22196 d_ilogbl='$d_ilogbl'
22197 d_inc_version_list='$d_inc_version_list'
22199 d_inetaton='$d_inetaton'
22200 d_int64_t='$d_int64_t'
22201 d_isascii='$d_isascii'
22202 d_isfinite='$d_isfinite'
22205 d_isnanl='$d_isnanl'
22206 d_killpg='$d_killpg'
22207 d_lchown='$d_lchown'
22208 d_ldbl_dig='$d_ldbl_dig'
22209 d_libm_lib_version='$d_libm_lib_version'
22211 d_localtime_r='$d_localtime_r'
22212 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22213 d_locconv='$d_locconv'
22215 d_longdbl='$d_longdbl'
22216 d_longlong='$d_longlong'
22217 d_lseekproto='$d_lseekproto'
22219 d_madvise='$d_madvise'
22220 d_malloc_good_size='$d_malloc_good_size'
22221 d_malloc_size='$d_malloc_size'
22223 d_mbstowcs='$d_mbstowcs'
22224 d_mbtowc='$d_mbtowc'
22225 d_memchr='$d_memchr'
22226 d_memcmp='$d_memcmp'
22227 d_memcpy='$d_memcpy'
22228 d_memmove='$d_memmove'
22229 d_memset='$d_memset'
22231 d_mkdtemp='$d_mkdtemp'
22232 d_mkfifo='$d_mkfifo'
22233 d_mkstemp='$d_mkstemp'
22234 d_mkstemps='$d_mkstemps'
22235 d_mktime='$d_mktime'
22238 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22239 d_modflproto='$d_modflproto'
22240 d_mprotect='$d_mprotect'
22242 d_msg_ctrunc='$d_msg_ctrunc'
22243 d_msg_dontroute='$d_msg_dontroute'
22244 d_msg_oob='$d_msg_oob'
22245 d_msg_peek='$d_msg_peek'
22246 d_msg_proxy='$d_msg_proxy'
22247 d_msgctl='$d_msgctl'
22248 d_msgget='$d_msgget'
22249 d_msghdr_s='$d_msghdr_s'
22250 d_msgrcv='$d_msgrcv'
22251 d_msgsnd='$d_msgsnd'
22253 d_munmap='$d_munmap'
22254 d_mymalloc='$d_mymalloc'
22257 d_nl_langinfo='$d_nl_langinfo'
22258 d_nv_preserves_uv='$d_nv_preserves_uv'
22259 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22260 d_off64_t='$d_off64_t'
22261 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22262 d_oldpthreads='$d_oldpthreads'
22263 d_oldsock='$d_oldsock'
22265 d_pathconf='$d_pathconf'
22267 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22268 d_phostname='$d_phostname'
22271 d_portable='$d_portable'
22272 d_printf_format_null='$d_printf_format_null'
22273 d_procselfexe='$d_procselfexe'
22274 d_pseudofork='$d_pseudofork'
22275 d_pthread_atfork='$d_pthread_atfork'
22276 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22277 d_pthread_yield='$d_pthread_yield'
22279 d_pwchange='$d_pwchange'
22280 d_pwclass='$d_pwclass'
22281 d_pwcomment='$d_pwcomment'
22282 d_pwexpire='$d_pwexpire'
22283 d_pwgecos='$d_pwgecos'
22284 d_pwpasswd='$d_pwpasswd'
22285 d_pwquota='$d_pwquota'
22288 d_random_r='$d_random_r'
22289 d_readdir64_r='$d_readdir64_r'
22290 d_readdir='$d_readdir'
22291 d_readdir_r='$d_readdir_r'
22292 d_readlink='$d_readlink'
22294 d_recvmsg='$d_recvmsg'
22295 d_rename='$d_rename'
22296 d_rewinddir='$d_rewinddir'
22298 d_safebcpy='$d_safebcpy'
22299 d_safemcpy='$d_safemcpy'
22300 d_sanemcmp='$d_sanemcmp'
22301 d_sbrkproto='$d_sbrkproto'
22302 d_scalbnl='$d_scalbnl'
22303 d_sched_yield='$d_sched_yield'
22304 d_scm_rights='$d_scm_rights'
22305 d_seekdir='$d_seekdir'
22306 d_select='$d_select'
22308 d_semctl='$d_semctl'
22309 d_semctl_semid_ds='$d_semctl_semid_ds'
22310 d_semctl_semun='$d_semctl_semun'
22311 d_semget='$d_semget'
22313 d_sendmsg='$d_sendmsg'
22314 d_setegid='$d_setegid'
22315 d_seteuid='$d_seteuid'
22316 d_setgrent='$d_setgrent'
22317 d_setgrent_r='$d_setgrent_r'
22318 d_setgrps='$d_setgrps'
22319 d_sethent='$d_sethent'
22320 d_sethostent_r='$d_sethostent_r'
22321 d_setitimer='$d_setitimer'
22322 d_setlinebuf='$d_setlinebuf'
22323 d_setlocale='$d_setlocale'
22324 d_setlocale_r='$d_setlocale_r'
22325 d_setnent='$d_setnent'
22326 d_setnetent_r='$d_setnetent_r'
22327 d_setpent='$d_setpent'
22328 d_setpgid='$d_setpgid'
22329 d_setpgrp2='$d_setpgrp2'
22330 d_setpgrp='$d_setpgrp'
22331 d_setprior='$d_setprior'
22332 d_setproctitle='$d_setproctitle'
22333 d_setprotoent_r='$d_setprotoent_r'
22334 d_setpwent='$d_setpwent'
22335 d_setpwent_r='$d_setpwent_r'
22336 d_setregid='$d_setregid'
22337 d_setresgid='$d_setresgid'
22338 d_setresuid='$d_setresuid'
22339 d_setreuid='$d_setreuid'
22340 d_setrgid='$d_setrgid'
22341 d_setruid='$d_setruid'
22342 d_setsent='$d_setsent'
22343 d_setservent_r='$d_setservent_r'
22344 d_setsid='$d_setsid'
22345 d_setvbuf='$d_setvbuf'
22349 d_shmatprototype='$d_shmatprototype'
22350 d_shmctl='$d_shmctl'
22352 d_shmget='$d_shmget'
22353 d_sigaction='$d_sigaction'
22354 d_signbit='$d_signbit'
22355 d_sigprocmask='$d_sigprocmask'
22356 d_sigsetjmp='$d_sigsetjmp'
22357 d_sitearch='$d_sitearch'
22358 d_snprintf='$d_snprintf'
22359 d_sockatmark='$d_sockatmark'
22360 d_sockatmarkproto='$d_sockatmarkproto'
22361 d_socket='$d_socket'
22362 d_socklen_t='$d_socklen_t'
22363 d_sockpair='$d_sockpair'
22364 d_socks5_init='$d_socks5_init'
22365 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22367 d_srand48_r='$d_srand48_r'
22368 d_srandom_r='$d_srandom_r'
22369 d_sresgproto='$d_sresgproto'
22370 d_sresuproto='$d_sresuproto'
22371 d_statblks='$d_statblks'
22372 d_statfs_f_flags='$d_statfs_f_flags'
22373 d_statfs_s='$d_statfs_s'
22374 d_statvfs='$d_statvfs'
22375 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22376 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22377 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22378 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22379 d_stdio_stream_array='$d_stdio_stream_array'
22380 d_stdiobase='$d_stdiobase'
22381 d_stdstdio='$d_stdstdio'
22382 d_strchr='$d_strchr'
22383 d_strcoll='$d_strcoll'
22384 d_strctcpy='$d_strctcpy'
22385 d_strerrm='$d_strerrm'
22386 d_strerror='$d_strerror'
22387 d_strerror_r='$d_strerror_r'
22388 d_strftime='$d_strftime'
22389 d_strlcat='$d_strlcat'
22390 d_strlcpy='$d_strlcpy'
22391 d_strtod='$d_strtod'
22392 d_strtol='$d_strtol'
22393 d_strtold='$d_strtold'
22394 d_strtoll='$d_strtoll'
22395 d_strtoq='$d_strtoq'
22396 d_strtoul='$d_strtoul'
22397 d_strtoull='$d_strtoull'
22398 d_strtouq='$d_strtouq'
22399 d_strxfrm='$d_strxfrm'
22400 d_suidsafe='$d_suidsafe'
22401 d_symlink='$d_symlink'
22402 d_syscall='$d_syscall'
22403 d_syscallproto='$d_syscallproto'
22404 d_sysconf='$d_sysconf'
22405 d_sysernlst='$d_sysernlst'
22406 d_syserrlst='$d_syserrlst'
22407 d_system='$d_system'
22408 d_tcgetpgrp='$d_tcgetpgrp'
22409 d_tcsetpgrp='$d_tcsetpgrp'
22410 d_telldir='$d_telldir'
22411 d_telldirproto='$d_telldirproto'
22413 d_timegm='$d_timegm'
22415 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22416 d_tm_tm_zone='$d_tm_tm_zone'
22417 d_tmpnam_r='$d_tmpnam_r'
22418 d_truncate='$d_truncate'
22419 d_ttyname_r='$d_ttyname_r'
22420 d_tzname='$d_tzname'
22421 d_u32align='$d_u32align'
22422 d_ualarm='$d_ualarm'
22425 d_union_semun='$d_union_semun'
22426 d_unordered='$d_unordered'
22427 d_unsetenv='$d_unsetenv'
22428 d_usleep='$d_usleep'
22429 d_usleepproto='$d_usleepproto'
22431 d_vendorarch='$d_vendorarch'
22432 d_vendorbin='$d_vendorbin'
22433 d_vendorlib='$d_vendorlib'
22434 d_vendorscript='$d_vendorscript'
22436 d_void_closedir='$d_void_closedir'
22437 d_voidsig='$d_voidsig'
22438 d_voidtty='$d_voidtty'
22439 d_volatile='$d_volatile'
22440 d_vprintf='$d_vprintf'
22441 d_vsnprintf='$d_vsnprintf'
22443 d_waitpid='$d_waitpid'
22444 d_wcstombs='$d_wcstombs'
22445 d_wctomb='$d_wctomb'
22446 d_writev='$d_writev'
22449 db_hashtype='$db_hashtype'
22450 db_prefixtype='$db_prefixtype'
22451 db_version_major='$db_version_major'
22452 db_version_minor='$db_version_minor'
22453 db_version_patch='$db_version_patch'
22454 defvoidused='$defvoidused'
22455 direntrytype='$direntrytype'
22458 doublesize='$doublesize'
22460 drand48_r_proto='$drand48_r_proto'
22462 dynamic_ext='$dynamic_ext'
22468 endgrent_r_proto='$endgrent_r_proto'
22469 endhostent_r_proto='$endhostent_r_proto'
22470 endnetent_r_proto='$endnetent_r_proto'
22471 endprotoent_r_proto='$endprotoent_r_proto'
22472 endpwent_r_proto='$endpwent_r_proto'
22473 endservent_r_proto='$endservent_r_proto'
22474 eunicefix='$eunicefix'
22477 extensions='$extensions'
22479 fflushNULL='$fflushNULL'
22480 fflushall='$fflushall'
22482 firstmakefile='$firstmakefile'
22484 fpossize='$fpossize'
22485 fpostype='$fpostype'
22486 freetype='$freetype'
22489 full_csh='$full_csh'
22490 full_sed='$full_sed'
22491 gccansipedantic='$gccansipedantic'
22492 gccosandvers='$gccosandvers'
22493 gccversion='$gccversion'
22494 getgrent_r_proto='$getgrent_r_proto'
22495 getgrgid_r_proto='$getgrgid_r_proto'
22496 getgrnam_r_proto='$getgrnam_r_proto'
22497 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22498 gethostbyname_r_proto='$gethostbyname_r_proto'
22499 gethostent_r_proto='$gethostent_r_proto'
22500 getlogin_r_proto='$getlogin_r_proto'
22501 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22502 getnetbyname_r_proto='$getnetbyname_r_proto'
22503 getnetent_r_proto='$getnetent_r_proto'
22504 getprotobyname_r_proto='$getprotobyname_r_proto'
22505 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22506 getprotoent_r_proto='$getprotoent_r_proto'
22507 getpwent_r_proto='$getpwent_r_proto'
22508 getpwnam_r_proto='$getpwnam_r_proto'
22509 getpwuid_r_proto='$getpwuid_r_proto'
22510 getservbyname_r_proto='$getservbyname_r_proto'
22511 getservbyport_r_proto='$getservbyport_r_proto'
22512 getservent_r_proto='$getservent_r_proto'
22513 getspnam_r_proto='$getspnam_r_proto'
22514 gidformat='$gidformat'
22520 gmtime_r_proto='$gmtime_r_proto'
22521 gnulibc_version='$gnulibc_version'
22523 groupcat='$groupcat'
22524 groupstype='$groupstype'
22527 h_sysfile='$h_sysfile'
22530 html1dir='$html1dir'
22531 html1direxp='$html1direxp'
22532 html3dir='$html3dir'
22533 html3direxp='$html3direxp'
22542 i_arpainet='$i_arpainet'
22543 i_assert='$i_assert'
22544 i_bsdioctl='$i_bsdioctl'
22548 i_dirent='$i_dirent'
22554 i_fp_class='$i_fp_class'
22556 i_gdbm_ndbm='$i_gdbm_ndbm'
22557 i_gdbmndbm='$i_gdbmndbm'
22559 i_ieeefp='$i_ieeefp'
22560 i_inttypes='$i_inttypes'
22561 i_langinfo='$i_langinfo'
22562 i_libutil='$i_libutil'
22563 i_limits='$i_limits'
22564 i_locale='$i_locale'
22565 i_machcthr='$i_machcthr'
22566 i_malloc='$i_malloc'
22567 i_mallocmalloc='$i_mallocmalloc'
22569 i_memory='$i_memory'
22570 i_mntent='$i_mntent'
22573 i_neterrno='$i_neterrno'
22574 i_netinettcp='$i_netinettcp'
22578 i_pthread='$i_pthread'
22580 i_rpcsvcdbm='$i_rpcsvcdbm'
22583 i_shadow='$i_shadow'
22585 i_stdarg='$i_stdarg'
22586 i_stddef='$i_stddef'
22587 i_stdlib='$i_stdlib'
22588 i_string='$i_string'
22589 i_sunmath='$i_sunmath'
22590 i_sysaccess='$i_sysaccess'
22591 i_sysdir='$i_sysdir'
22592 i_sysfile='$i_sysfile'
22593 i_sysfilio='$i_sysfilio'
22595 i_sysioctl='$i_sysioctl'
22596 i_syslog='$i_syslog'
22597 i_sysmman='$i_sysmman'
22598 i_sysmode='$i_sysmode'
22599 i_sysmount='$i_sysmount'
22600 i_sysndir='$i_sysndir'
22601 i_sysparam='$i_sysparam'
22602 i_syspoll='$i_syspoll'
22603 i_sysresrc='$i_sysresrc'
22604 i_syssecrt='$i_syssecrt'
22605 i_sysselct='$i_sysselct'
22606 i_syssockio='$i_syssockio'
22607 i_sysstat='$i_sysstat'
22608 i_sysstatfs='$i_sysstatfs'
22609 i_sysstatvfs='$i_sysstatvfs'
22610 i_systime='$i_systime'
22611 i_systimek='$i_systimek'
22612 i_systimes='$i_systimes'
22613 i_systypes='$i_systypes'
22614 i_sysuio='$i_sysuio'
22616 i_sysutsname='$i_sysutsname'
22617 i_sysvfs='$i_sysvfs'
22618 i_syswait='$i_syswait'
22619 i_termio='$i_termio'
22620 i_termios='$i_termios'
22622 i_unistd='$i_unistd'
22625 i_values='$i_values'
22626 i_varargs='$i_varargs'
22627 i_varhdr='$i_varhdr'
22629 ignore_versioned_solibs='$ignore_versioned_solibs'
22630 inc_version_list='$inc_version_list'
22631 inc_version_list_init='$inc_version_list_init'
22634 initialinstalllocation='$initialinstalllocation'
22635 installarchlib='$installarchlib'
22636 installbin='$installbin'
22637 installhtml1dir='$installhtml1dir'
22638 installhtml3dir='$installhtml3dir'
22639 installman1dir='$installman1dir'
22640 installman3dir='$installman3dir'
22641 installprefix='$installprefix'
22642 installprefixexp='$installprefixexp'
22643 installprivlib='$installprivlib'
22644 installscript='$installscript'
22645 installsitearch='$installsitearch'
22646 installsitebin='$installsitebin'
22647 installsitehtml1dir='$installsitehtml1dir'
22648 installsitehtml3dir='$installsitehtml3dir'
22649 installsitelib='$installsitelib'
22650 installsiteman1dir='$installsiteman1dir'
22651 installsiteman3dir='$installsiteman3dir'
22652 installsitescript='$installsitescript'
22653 installstyle='$installstyle'
22654 installusrbinperl='$installusrbinperl'
22655 installvendorarch='$installvendorarch'
22656 installvendorbin='$installvendorbin'
22657 installvendorhtml1dir='$installvendorhtml1dir'
22658 installvendorhtml3dir='$installvendorhtml3dir'
22659 installvendorlib='$installvendorlib'
22660 installvendorman1dir='$installvendorman1dir'
22661 installvendorman3dir='$installvendorman3dir'
22662 installvendorscript='$installvendorscript'
22664 issymlink='$issymlink'
22665 ivdformat='$ivdformat'
22668 known_extensions='$known_extensions'
22671 lddlflags='$lddlflags'
22673 ldflags_uselargefiles='$ldflags_uselargefiles'
22674 ldlibpthname='$ldlibpthname'
22681 libsdirs='$libsdirs'
22682 libsfiles='$libsfiles'
22683 libsfound='$libsfound'
22684 libspath='$libspath'
22685 libswanted='$libswanted'
22686 libswanted_uselargefiles='$libswanted_uselargefiles'
22692 localtime_r_proto='$localtime_r_proto'
22693 locincpth='$locincpth'
22694 loclibpth='$loclibpth'
22695 longdblsize='$longdblsize'
22696 longlongsize='$longlongsize'
22697 longsize='$longsize'
22701 lseeksize='$lseeksize'
22702 lseektype='$lseektype'
22705 madlyobj='$madlyobj'
22706 madlysrc='$madlysrc'
22710 make_set_make='$make_set_make'
22711 mallocobj='$mallocobj'
22712 mallocsrc='$mallocsrc'
22713 malloctype='$malloctype'
22715 man1direxp='$man1direxp'
22718 man3direxp='$man3direxp'
22720 mips_type='$mips_type'
22721 mistrustnm='$mistrustnm'
22723 mmaptype='$mmaptype'
22724 modetype='$modetype'
22726 multiarch='$multiarch'
22728 myarchname='$myarchname'
22729 mydomain='$mydomain'
22730 myhostname='$myhostname'
22733 need_va_copy='$need_va_copy'
22734 netdb_hlen_type='$netdb_hlen_type'
22735 netdb_host_type='$netdb_host_type'
22736 netdb_name_type='$netdb_name_type'
22737 netdb_net_type='$netdb_net_type'
22740 nm_so_opt='$nm_so_opt'
22741 nonxs_ext='$nonxs_ext'
22743 nvEUformat='$nvEUformat'
22744 nvFUformat='$nvFUformat'
22745 nvGUformat='$nvGUformat'
22746 nv_overflows_integers_at='$nv_overflows_integers_at'
22747 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22748 nveformat='$nveformat'
22749 nvfformat='$nvfformat'
22750 nvgformat='$nvgformat'
22753 o_nonblock='$o_nonblock'
22755 old_pthread_create_joinable='$old_pthread_create_joinable'
22756 optimize='$optimize'
22757 orderlib='$orderlib'
22760 otherlibdirs='$otherlibdirs'
22764 patchlevel='$patchlevel'
22765 path_sep='$path_sep'
22768 perl_patchlevel='$perl_patchlevel'
22769 perladmin='$perladmin'
22770 perllibs='$perllibs'
22771 perlpath='$perlpath'
22773 phostname='$phostname'
22779 prefixexp='$prefixexp'
22781 privlibexp='$privlibexp'
22782 procselfexe='$procselfexe'
22783 prototype='$prototype'
22785 quadkind='$quadkind'
22786 quadtype='$quadtype'
22787 randbits='$randbits'
22788 randfunc='$randfunc'
22789 random_r_proto='$random_r_proto'
22790 randseedtype='$randseedtype'
22792 rd_nodata='$rd_nodata'
22793 readdir64_r_proto='$readdir64_r_proto'
22794 readdir_r_proto='$readdir_r_proto'
22795 revision='$revision'
22801 sGMTIME_max='$sGMTIME_max'
22802 sGMTIME_min='$sGMTIME_min'
22803 sLOCALTIME_max='$sLOCALTIME_max'
22804 sLOCALTIME_min='$sLOCALTIME_min'
22805 sPRIEUldbl='$sPRIEUldbl'
22806 sPRIFUldbl='$sPRIFUldbl'
22807 sPRIGUldbl='$sPRIGUldbl'
22808 sPRIXU64='$sPRIXU64'
22810 sPRIeldbl='$sPRIeldbl'
22811 sPRIfldbl='$sPRIfldbl'
22812 sPRIgldbl='$sPRIgldbl'
22817 sSCNfldbl='$sSCNfldbl'
22818 sched_yield='$sched_yield'
22819 scriptdir='$scriptdir'
22820 scriptdirexp='$scriptdirexp'
22822 seedfunc='$seedfunc'
22823 selectminbits='$selectminbits'
22824 selecttype='$selecttype'
22825 sendmail='$sendmail'
22826 setgrent_r_proto='$setgrent_r_proto'
22827 sethostent_r_proto='$sethostent_r_proto'
22828 setlocale_r_proto='$setlocale_r_proto'
22829 setnetent_r_proto='$setnetent_r_proto'
22830 setprotoent_r_proto='$setprotoent_r_proto'
22831 setpwent_r_proto='$setpwent_r_proto'
22832 setservent_r_proto='$setservent_r_proto'
22835 sharpbang='$sharpbang'
22836 shmattype='$shmattype'
22837 shortsize='$shortsize'
22840 sig_count='$sig_count'
22841 sig_name='$sig_name'
22842 sig_name_init='$sig_name_init'
22844 sig_num_init='$sig_num_init'
22845 sig_size='$sig_size'
22846 signal_t='$signal_t'
22847 sitearch='$sitearch'
22848 sitearchexp='$sitearchexp'
22850 sitebinexp='$sitebinexp'
22851 sitehtml1dir='$sitehtml1dir'
22852 sitehtml1direxp='$sitehtml1direxp'
22853 sitehtml3dir='$sitehtml3dir'
22854 sitehtml3direxp='$sitehtml3direxp'
22856 sitelib_stem='$sitelib_stem'
22857 sitelibexp='$sitelibexp'
22858 siteman1dir='$siteman1dir'
22859 siteman1direxp='$siteman1direxp'
22860 siteman3dir='$siteman3dir'
22861 siteman3direxp='$siteman3direxp'
22862 siteprefix='$siteprefix'
22863 siteprefixexp='$siteprefixexp'
22864 sitescript='$sitescript'
22865 sitescriptexp='$sitescriptexp'
22866 sizesize='$sizesize'
22867 sizetype='$sizetype'
22871 sockethdr='$sockethdr'
22872 socketlib='$socketlib'
22873 socksizetype='$socksizetype'
22875 spackage='$spackage'
22876 spitshell='$spitshell'
22877 srand48_r_proto='$srand48_r_proto'
22878 srandom_r_proto='$srandom_r_proto'
22880 ssizetype='$ssizetype'
22881 startperl='$startperl'
22883 static_ext='$static_ext'
22885 stdio_base='$stdio_base'
22886 stdio_bufsiz='$stdio_bufsiz'
22887 stdio_cnt='$stdio_cnt'
22888 stdio_filbuf='$stdio_filbuf'
22889 stdio_ptr='$stdio_ptr'
22890 stdio_stream_array='$stdio_stream_array'
22891 strerror_r_proto='$strerror_r_proto'
22894 subversion='$subversion'
22898 targetarch='$targetarch'
22902 timeincl='$timeincl'
22903 timetype='$timetype'
22904 tmpnam_r_proto='$tmpnam_r_proto'
22910 ttyname_r_proto='$ttyname_r_proto'
22919 uidformat='$uidformat'
22925 uquadtype='$uquadtype'
22926 use5005threads='$use5005threads'
22927 use64bitall='$use64bitall'
22928 use64bitint='$use64bitint'
22929 usecrosscompile='$usecrosscompile'
22931 usedtrace='$usedtrace'
22932 usefaststdio='$usefaststdio'
22933 useithreads='$useithreads'
22934 uselargefiles='$uselargefiles'
22935 uselongdouble='$uselongdouble'
22936 usemallocwrap='$usemallocwrap'
22937 usemorebits='$usemorebits'
22938 usemultiplicity='$usemultiplicity'
22939 usemymalloc='$usemymalloc'
22941 useopcode='$useopcode'
22942 useperlio='$useperlio'
22943 useposix='$useposix'
22944 usereentrant='$usereentrant'
22945 userelocatableinc='$userelocatableinc'
22947 useshrplib='$useshrplib'
22948 usesitecustomize='$usesitecustomize'
22949 usesocks='$usesocks'
22950 usethreads='$usethreads'
22951 usevendorprefix='$usevendorprefix'
22952 usevfork='$usevfork'
22955 uvXUformat='$uvXUformat'
22956 uvoformat='$uvoformat'
22959 uvuformat='$uvuformat'
22960 uvxformat='$uvxformat'
22961 vendorarch='$vendorarch'
22962 vendorarchexp='$vendorarchexp'
22963 vendorbin='$vendorbin'
22964 vendorbinexp='$vendorbinexp'
22965 vendorhtml1dir='$vendorhtml1dir'
22966 vendorhtml1direxp='$vendorhtml1direxp'
22967 vendorhtml3dir='$vendorhtml3dir'
22968 vendorhtml3direxp='$vendorhtml3direxp'
22969 vendorlib='$vendorlib'
22970 vendorlib_stem='$vendorlib_stem'
22971 vendorlibexp='$vendorlibexp'
22972 vendorman1dir='$vendorman1dir'
22973 vendorman1direxp='$vendorman1direxp'
22974 vendorman3dir='$vendorman3dir'
22975 vendorman3direxp='$vendorman3direxp'
22976 vendorprefix='$vendorprefix'
22977 vendorprefixexp='$vendorprefixexp'
22978 vendorscript='$vendorscript'
22979 vendorscriptexp='$vendorscriptexp'
22981 version_patchlevel_string='$version_patchlevel_string'
22982 versiononly='$versiononly'
22984 voidflags='$voidflags'
22987 yaccflags='$yaccflags'
22992 : Add in command line options if available
22993 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22995 : add special variables
22996 $test -f $src/patchlevel.h && \
22997 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22998 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22999 echo "PERL_CONFIG_SH=true" >>config.sh
23001 : propagate old symbols
23002 if $test -f UU/config.sh; then
23003 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23004 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23005 config.sh config.sh UU/oldconfig.sh |\
23006 $sort | $uniq -u >UU/oldsyms
23007 set X `cat UU/oldsyms`
23013 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23015 echo ": Variables propagated from previous config.sh file." >>config.sh
23016 for sym in `cat UU/oldsyms`; do
23017 echo " Propagating $hint variable "'$'"$sym..."
23018 eval 'tmp="$'"${sym}"'"'
23020 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23026 : Finish up by extracting the .SH files
23030 echo "Extraction done."
23040 If you'd like to make any changes to the config.sh file before I begin
23041 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23044 rp="Press return or use a shell escape to edit config.sh:"
23049 *) : in case they cannot read
23050 sh 1>&4 -c "$ans";;
23055 : if this fails, just run all the .SH files by hand
23064 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23071 Now you need to generate make dependencies by running "$make depend".
23072 You might prefer to run it in background: "$make depend > makedepend.out &"
23073 It can take a while, so you might not want to run it right now.
23078 rp="Run $make depend now?"
23082 $make depend && echo "Now you must run '$make'."
23085 echo "You must run '$make depend' then '$make'."
23088 elif test -f [Mm]akefile; then
23090 echo "Now you must run a $make."
23092 echo "Configure done."
23095 if $test -f Policy.sh; then
23098 If you compile $package on a different machine or from a different object
23099 directory, copy the Policy.sh file from this object directory to the
23100 new one before you run Configure -- this will help you with most of
23101 the policy defaults.
23105 if $test -f config.msg; then
23106 echo "Hmm. I also noted the following information while running:"
23108 $cat config.msg >&4
23111 $rm -f kit*isdone ark*isdone