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 Jul 7 21:59:59 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=''
950 d_inc_version_list=''
952 inc_version_list_init=''
971 ignore_versioned_solibs=''
1035 d_perl_otherlibdirs=''
1043 api_versionstring=''
1049 version_patchlevel_string=''
1053 d_nv_preserves_uv=''
1054 d_nv_zero_is_allbits_zero=''
1065 nv_overflows_integers_at=''
1066 nv_preserves_uv_bits=''
1138 installsitehtml1dir=''
1141 installsitehtml3dir=''
1148 installsiteman1dir=''
1151 installsiteman3dir=''
1156 installsitescript=''
1171 d_stdio_stream_array=''
1172 stdio_stream_array=''
1187 ccflags_uselargefiles=''
1188 ldflags_uselargefiles=''
1189 libswanted_uselargefiles=''
1209 installvendorarch=''
1216 installvendorhtml1dir=''
1218 vendorhtml1direxp=''
1219 installvendorhtml3dir=''
1221 vendorhtml3direxp=''
1227 installvendorman1dir=''
1230 installvendorman3dir=''
1237 installvendorscript=''
1250 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1253 : We must find out about Eunice early
1255 if test -f /etc/unixtovms; then
1256 eunicefix=/etc/unixtovms
1258 if test -f /etc/unixtovms.exe; then
1259 eunicefix=/etc/unixtovms.exe
1262 : Set executable suffix now -- needed before hints available
1263 if test -f "/libs/version.library"; then
1266 elif test -f "/system/gnu_library/bin/ar.pm"; then
1269 elif test -n "$DJGPP"; then
1272 elif test -d c:/. -o -n "$is_os2" ; then
1279 : Trailing extension. Override this in a hint file, if needed.
1280 : Extra object files, if any, needed on this platform.
1284 : change the next line if compiling for Xenix/286 on Xenix/386
1285 xlibpth='/usr/lib/386 /lib/386'
1286 : Possible local library directories to search.
1287 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1288 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1290 : general looking path for locating libraries
1291 glibpth="/lib /usr/lib $xlibpth"
1292 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1293 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1294 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1295 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1297 : Private path used by Configure to find libraries. Its value
1298 : is prepended to libpth. This variable takes care of special
1299 : machines, like the mips. Usually, it should be empty.
1302 : default library list
1304 : some systems want to use only the non-versioned libso:s
1305 ignore_versioned_solibs=''
1306 : set usethreads on the Configure command line to enable threads.
1307 usereentrant='undef'
1308 : full support for void wanted by default
1311 : Possible local include directories to search.
1312 : Set locincpth to "" in a hint file to defeat local include searches.
1313 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1314 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1316 : no include file wanted by default
1319 : Enable -DEBUGGING and -DDEBUGGING from the command line
1326 : set useposix=false in your hint file to disable the POSIX extension.
1328 : set useopcode=false in your hint file to disable the Opcode extension.
1331 ccflags_uselargefiles=''
1332 ldflags_uselargefiles=''
1333 libswanted_uselargefiles=''
1334 : set usemultiplicity on the Configure command line to enable multiplicity.
1335 : set usesocks on the Configure command line to enable socks.
1336 : List of libraries we want.
1337 : If anyone needs extra -lxxx, put those in a hint file.
1338 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1339 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1340 : We probably want to search /usr/shlib before most other libraries.
1341 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1342 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1343 glibpth="/usr/shlib $glibpth"
1344 : Do not use vfork unless overridden by a hint file.
1347 : Find the basic shell for Bourne shell scripts
1351 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1354 if test -f "$xxx"; then
1357 : Build up a list and do a single loop so we can 'break' out.
1358 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1359 for xxx in sh bash ksh pdksh ash; do
1361 try="$try ${p}/${xxx}"
1365 if test -f "$xxx"; then
1368 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1371 elif test -f "$xxx.exe"; then
1382 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1384 Usually it's in /bin/sh. How did you even get this far?
1385 Please contact me (Perl Maintainers) at perlbug@perl.org and
1386 we'll try to straighten this all out.
1392 : see if sh knows # comments
1393 if `$sh -c '#' >/dev/null 2>&1`; then
1397 test -f $xcat$_exe || xcat=/usr/bin/cat
1398 if test ! -f $xcat$_exe; then
1399 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1400 if test -f $p/cat$_exe; then
1405 if test ! -f $xcat$_exe; then
1406 echo "Can't find cat anywhere!"
1410 echo "#!$xcat" >sharp
1413 ./sharp > today 2>/dev/null
1414 if test -s today; then
1417 echo "#! $xcat" > sharp
1420 ./sharp > today 2>/dev/null
1421 if test -s today; then
1429 echo "Your $sh doesn't grok # comments--I will strip them later on."
1432 echo "exec grep -v '^[ ]*#'" >spitshell
1434 $eunicefix spitshell
1435 spitshell=`pwd`/spitshell
1437 echo "I presume that if # doesn't work, #! won't work either!"
1442 : figure out how to guarantee sh startup
1444 '') startsh=${sharpbang}${sh} ;;
1456 : echo "Yup, it does."
1458 echo "Hmm... '$startsh' does not guarantee sh startup..."
1459 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1463 : Save command line options in file UU/cmdline.opt for later use in
1464 : generating config.sh.
1465 cat > cmdline.opt <<EOSH
1466 : Configure command line arguments.
1475 cat >>cmdline.opt <<EOSH
1476 config_arg$argn='$arg'
1478 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1481 arg_exp=`cat cmdl.opt`
1482 args_exp="$args_exp$args_sep'$arg_exp'"
1483 argn=`expr $argn + 1`
1488 : produce awk script to parse command line options
1489 cat >options.awk <<'EOF'
1491 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1493 len = length(optstr);
1494 for (i = 1; i <= len; i++) {
1495 c = substr(optstr, i, 1);
1496 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1507 if (substr(str, 1, 1) != "-") {
1508 printf("'%s'\n", str);
1512 for (i = 2; i <= len; i++) {
1513 c = substr(str, i, 1);
1515 printf("-%s\n", substr(str, i));
1521 printf("'%s'\n", substr(str, i + 1));
1534 : process the command line options
1535 set X `for arg in "$@"; do echo "X$arg"; done |
1536 sed -e s/X// | awk -f options.awk`
1541 : set up default values
1551 rm -f optdef.sh posthint.sh
1552 cat >optdef.sh <<EOS
1558 while test $# -gt 0; do
1560 -d) shift; fastread=yes;;
1561 -e) shift; alldone=cont;;
1565 if test -r "$1"; then
1568 echo "$me: cannot read config file $1." >&2
1574 -h) shift; error=true;;
1575 -r) shift; reuseval=true;;
1576 -s) shift; silent=true; realsilent=true;;
1577 -E) shift; alldone=exit;;
1578 -K) shift; knowitall=true;;
1579 -O) shift; override=true;;
1580 -S) shift; silent=true; extractsh=true;;
1585 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1586 echo "$me: ignoring -D $1" >&2
1589 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1590 *) echo "$1='define'" >> optdef.sh;;
1597 *=) echo "$1" >> optdef.sh;;
1599 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1600 echo "$me: ignoring -U $1" >&2
1602 *) echo "$1='undef'" >> optdef.sh;;
1613 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1617 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1618 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1624 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1625 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1626 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1627 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1628 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1629 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1635 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1637 echo "$yyy=''" >> posthint.sh ;;
1642 echo "$yyy='$zzz'" >> posthint.sh ;;
1644 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1646 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1651 echo "$yyy=$zzz" >> posthint.sh ;;
1652 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1656 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1659 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1667 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1668 [-U symbol] [-U symbol=] [-A command:symbol...]
1669 -d : use defaults for all answers.
1670 -e : go on without questioning past the production of config.sh.
1671 -f : specify an alternate default configuration file.
1672 -h : print this help message and exit (with an error status).
1673 -r : reuse C symbols value if possible (skips costly nm extraction).
1674 -s : silent mode, only echoes questions and essential information.
1675 -D : define symbol to have some value:
1676 -D symbol symbol gets the value 'define'
1677 -D symbol=value symbol gets the value 'value'
1678 common used examples (see INSTALL for more info):
1679 -Duse64bitint use 64bit integers
1680 -Duse64bitall use 64bit integers and pointers
1681 -Dusethreads use thread support
1682 -Dinc_version_list=none do not include older perl trees in @INC
1683 -DEBUGGING=none DEBUGGING options
1684 -Dcc=gcc choose your compiler
1685 -Dprefix=/opt/perl5 choose your destination
1686 -E : stop at the end of questions, after having produced config.sh.
1687 -K : do not use unless you know what you are doing.
1688 -O : let -D and -U override definitions from loaded configuration file.
1689 -S : perform variable substitutions on all .SH files (can mix with -f)
1690 -U : undefine symbol:
1691 -U symbol symbol gets the value 'undef'
1692 -U symbol= symbol gets completely empty
1694 -A : manipulate symbol after the platform specific hints have been applied:
1695 -A append:symbol=value append value to symbol
1696 -A symbol=value like append:, but with a separating space
1697 -A define:symbol=value define symbol to have value
1698 -A clear:symbol define symbol to be ''
1699 -A define:symbol define symbol to be 'define'
1700 -A eval:symbol=value define symbol to be eval of value
1701 -A prepend:symbol=value prepend value to symbol
1702 -A undef:symbol define symbol to be 'undef'
1703 -A undef:symbol= define symbol to be ''
1704 e.g.: -A prepend:libswanted='cl pthread '
1705 -A ccflags=-DSOME_MACRO
1706 -V : print version number and exit (with a zero status).
1713 case "$fastread$alldone" in
1716 case "$extractsh" in
1719 if test ! -t 0; then
1720 echo "Say 'sh Configure', not 'sh <Configure'"
1730 true) exec 1>/dev/null;;
1733 : run the defines and the undefines, if any, but leave the file out there...
1736 : create the posthint manipulation script and leave the file out there...
1741 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1742 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1743 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1744 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1745 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1748 : Some greps do not return status, grrr.
1749 echo "grimblepritz" >grimble
1750 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1752 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1758 : the following should work in any shell
1762 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1763 cat >contains <<'EOSS'
1764 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1769 : Find the path to the source tree
1772 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1776 *) src=`cd ../$src && pwd` ;;
1789 if test -f $rsrc/Configure && \
1790 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1792 : found it, so we are ok.
1795 for src in . .. ../.. ../../.. ../../../..; do
1796 if test -f ../$src/Configure && \
1797 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1808 Sorry, I can't seem to locate the source dir for $package. Please start
1809 Configure with an explicit path -- i.e. /some/path/Configure.
1817 echo "Sources for $package found in \"$src\"." >&4
1821 : script used to extract .SH files with variable substitutions
1822 cat >extract <<'EOS'
1824 echo "Doing variable substitutions on .SH files..."
1825 if test -f MANIFEST; then
1826 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1828 echo "(Looking for .SH files under the source directory.)"
1829 set x `(cd "$src"; find . -name "*.SH" -print)`
1833 0) set x `(cd "$src"; echo *.SH)`; shift;;
1835 if test ! -f "$src/$1"; then
1841 while test $name; do
1842 if test ! -d "$name"; then
1843 create="$name $create";
1844 name=`echo $name | sed -e "s|^[^/]*$||"`;
1845 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1850 for file in $create; do
1859 dir=`expr X$file : 'X\(.*\)/'`
1860 file=`expr X$file : 'X.*/\(.*\)'`
1861 (cd "$dir" && . ./$file)
1871 dir=`expr X$file : 'X\(.*\)/'`
1872 file=`expr X$file : 'X.*/\(.*\)'`
1873 (set x $dir; shift; eval $mkdir_p)
1874 sh <"$src/$dir/$file"
1883 if test -f "$src/config_h.SH"; then
1884 if test ! -f config.h; then
1885 : oops, they left it out of MANIFEST, probably, so do it anyway.
1886 . "$src/config_h.SH"
1891 : extract files and exit if asked to do so
1892 case "$extractsh" in
1894 case "$realsilent" in
1898 case "$config_sh" in
1899 '') config_sh='config.sh';;
1902 echo "Fetching answers from $config_sh..."
1905 test "$override" && . ./optdef.sh
1909 echo "Extraction done."
1914 : Eunice requires " " instead of "", can you believe it
1917 echo "Beginning of configuration questions for $package."
1919 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1921 : first determine how to suppress newline on echo command
1923 echo "Checking echo to see how to suppress newlines..."
1924 (echo "hi there\c" ; echo " ") >.echotmp
1925 if $contains c .echotmp >/dev/null 2>&1 ; then
1936 echo $n "The star should be here-->$c"
1940 : Now test for existence of everything in MANIFEST
1942 if test -f "$rsrc/MANIFEST"; then
1943 echo "First let's make sure your kit is complete. Checking..." >&4
1944 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1945 (split -l 50 2>/dev/null || split -50)
1948 for filelist in x??; do
1949 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1950 >/dev/null 2>>"$tmppwd/missing")
1952 if test -s missing; then
1956 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1958 You have the option of continuing the configuration process, despite the
1959 distinct possibility that your kit is damaged, by typing 'y'es. If you
1960 do, don't blame me if something goes wrong. I advise you to type 'n'o
1961 and contact the author (perlbug@perl.org).
1964 echo $n "Continue? [n] $c" >&4
1968 echo "Continuing..." >&4
1972 echo "ABORTING..." >&4
1977 echo "Looks good..."
1980 echo "There is no MANIFEST file. I hope your kit is complete !"
1984 : Find the appropriate value for a newline for tr
1986 if test -n "$DJGPP"; then
1989 if test X"$trnl" = X; then
1990 case "`echo foo|tr '\n' x 2>/dev/null`" in
1994 if test X"$trnl" = X; then
1995 case "`echo foo|tr '\012' x 2>/dev/null`" in
1996 foox) trnl='\012' ;;
1999 if test X"$trnl" = X; then
2000 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2001 fooxy) trnl='\n\r' ;;
2004 if test X"$trnl" = X; then
2007 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2013 : compute the number of columns on the terminal for proper question formatting
2018 : set up the echo used in my read
2019 myecho="case \"\$xxxm\" in
2020 '') echo $n \"\$rp $c\" >&4;;
2022 '') echo $n \"[\$xxxm] $c\";;
2024 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2026 echo $n \"[\$xxxm] $c\" >&4
2028 echo $n \"\$rp [\$xxxm] $c\" >&4
2034 : now set up to do reads with possible shell escape and default assignment
2040 case "\$fastread" in
2041 yes) case "\$dflt" in
2044 case "\$silent-\$rp" in
2049 *) case "\$silent" in
2050 true) case "\$rp" in
2055 while expr "X\$ans" : "X!" >/dev/null; do
2059 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2067 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2076 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2081 echo "(OK, I'll run with -d after this question.)" >&4
2084 echo "*** Sorry, \$1 not supported yet." >&4
2094 echo "*** Substitution done -- please confirm."
2096 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2101 echo "*** Error -- try again."
2108 case "\$ans\$xxxm\$nostick" in
2120 : create .config dir to save info across Configure sessions
2121 test -d ../.config || mkdir ../.config
2122 cat >../.config/README <<EOF
2123 This directory created by Configure to save information that should
2124 persist across sessions for $package.
2126 You may safely delete it if you wish.
2129 : See if we are using a devel version and want that
2130 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2132 $define|true|[yY]*) ;;
2133 *) case "$xversion" in
2136 *** WHOA THERE!!! ***
2138 This is an UNSTABLE DEVELOPMENT release.
2139 The version of this $package distribution is $xversion, that is, odd,
2140 (as opposed to even) and that signifies a development release.
2141 If you want a maintenance release, you want an even-numbered version.
2143 Do ***NOT*** install this into production use.
2144 Data corruption and crashes are possible.
2146 It is most seriously suggested that you do not continue any further
2147 unless you want to help in developing and debugging Perl.
2149 If you *still* want to build perl, you can answer 'y' now,
2150 or pass -Dusedevel to Configure.
2153 rp='Do you really want to continue?'
2157 [yY]) echo >&4 "Okay, continuing."
2158 usedevel="$define" ;;
2159 *) echo >&4 "Okay, bye."
2169 case "$versiononly" in
2170 '') versiononly="$define" ;;
2172 case "$installusrbinperl" in
2173 '') installusrbinperl="$undef" ;;
2178 : general instructions
2181 user=`(logname) 2>/dev/null`
2183 '') user=`whoami 2>&1`;;
2185 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2188 rp='Would you like to see the instructions?'
2199 This installation shell script will examine your system and ask you questions
2200 to determine how the perl5 package should be installed. If you get
2201 stuck on a question, you may use a ! shell escape to start a subshell or
2202 execute a command. Many of the questions will have default answers in square
2203 brackets; typing carriage return will give you the default.
2205 On some of the questions which ask for file or directory names you are allowed
2206 to use the ~name construct to specify the login directory belonging to "name",
2207 even if you don't have a shell which knows about that. Questions where this is
2208 allowed will be marked "(~name ok)".
2212 dflt='Type carriage return to continue'
2216 The prompter used in this script allows you to use shell variables and
2217 backticks in your answers. You may use $1, $2, etc... to refer to the words
2218 in the default answer, as if the default line was a set of arguments given to a
2219 script shell. This means you may also use $* to repeat the whole default line,
2220 so you do not have to re-type everything to add something to the default.
2222 Everytime there is a substitution, you will have to confirm. If there is an
2223 error (e.g. an unmatched backtick), the default answer will remain unchanged
2224 and you will be prompted again.
2226 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2227 the questions and use the computed defaults (or the previous answers if there
2228 was already a config.sh file). Type 'Configure -h' for a list of options.
2229 You may also start interactively and then answer '& -d' at any prompt to turn
2230 on the non-interactive behaviour for the remainder of the execution.
2236 Much effort has been expended to ensure that this shell script will run on any
2237 Unix system. If despite that it blows up on yours, your best bet is to edit
2238 Configure and run it again. If you can't run Configure for some reason,
2239 you'll have to generate a config.sh file by hand. Whatever problems you
2240 have, let me (perlbug@perl.org) know how I blew it.
2242 This installation script affects things in two ways:
2244 1) it may do direct variable substitutions on some of the files included
2246 2) it builds a config.h file for inclusion in C programs. You may edit
2247 any of these files as the need arises after running this script.
2249 If you make a mistake on a question, there is no easy way to back up to it
2250 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2251 files. Configure will offer to let you do this before it runs the SH files.
2254 dflt='Type carriage return to continue'
2256 case "$firsttime" in
2257 true) echo $user >>../.config/instruct;;
2261 : find out where common programs are
2263 echo "Locating common programs..." >&4
2276 if test -d \$dir/\$thing; then
2282 for thisthing in \$dir/\$thing; do
2283 : just loop through to pick last item
2285 if test -f \$thisthing; then
2288 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2291 elif test -f \$dir/\$thing.exe; then
2292 if test -n "$DJGPP"; then
2293 echo \$dir/\$thing.exe
2294 elif test "$eunicefix" != ":"; then
2295 : on Eunice apparently
2347 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2348 pth="$pth /lib /usr/lib"
2349 for file in $loclist; do
2353 if test -f "$xxx"; then
2356 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2357 xxx=`./loc $file $file $pth`
2360 '') xxx=`./loc $file $file $pth`;;
2361 *) xxx=`./loc $xxx $xxx $pth`;;
2363 eval $file=$xxx$_exe
2367 echo $file is in $xxx.
2370 echo $file is in $xxx.
2373 echo "I don't know where '$file' is, and my life depends on it." >&4
2374 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2380 echo "Don't worry if any of the following aren't found..."
2382 for file in $trylist; do
2386 if test -f "$xxx"; then
2389 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2390 xxx=`./loc $file $file $pth`
2393 '') xxx=`./loc $file $file $pth`;;
2394 *) xxx=`./loc $xxx $xxx $pth`;;
2396 eval $file=$xxx$_exe
2400 echo $file is in $xxx.
2403 echo $file is in $xxx.
2406 echo "I don't see $file out there, $say."
2413 echo "Substituting grep for egrep."
2420 echo "Substituting cp for ln."
2429 echo "I can't find make or gmake, and my life depends on it." >&4
2430 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2438 *) # We can't have osname yet.
2439 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2440 # Assume that gmake, if found, is definitely GNU make
2441 # and prefer it over the system make.
2442 echo "Substituting gmake for make."
2450 echo "Hopefully test is built into your sh."
2453 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2454 echo "Using the test built into your sh."
2462 echo "Hopefully echo is built into your sh."
2467 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2468 $echo $n "hi there$c" >foo1
2469 echo $n "hi there$c" >foo2
2470 if cmp foo1 foo2 >/dev/null 2>&1; then
2471 echo "They are compatible. In fact, they may be identical."
2478 They are not compatible! You are probably running ksh on a non-USG system.
2479 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2480 have echo built in and we may have to run some Bourne shell scripts. That
2481 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2484 $echo $n "The star should be here-->$c"
2491 # This question was auctioned at YAPC::Europe-2007 in Vienna
2492 # I never promised you could answer it. I only auctioned the question.
2494 The following message is sponsored by
2496 Dresden.pm<--The stars should be here.
2498 Dear Perl user, system administrator or package
2499 maintainer, the Perl community sends greetings to
2500 you. Do you (emblematical) greet back [Y/n]? n
2504 : Check what type of C compiler we use
2508 cat <<'EOSC' >>trygcc
2513 int main(int argc, char *argv[]) {
2517 if $cc -o try $ccflags $ldflags try.c; then
2520 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2526 # Skip this test because it gives a false match on output like:
2527 # ./trygcc: line 23: cc: command not found
2528 # case "`$cc -v -c try.c 2>&1`" in
2529 # *gcc*) trygcc=no ;;
2531 if $test X"$trygcc" = Xyes; then
2532 if gcc -o try -c try.c; then
2534 echo "You seem to have a working gcc, though." >&4
2535 # Switching compilers may undo the work of hints files.
2536 # The most common problem is -D_REENTRANT for threads.
2537 # This heuristic catches that case, but gets false positives
2538 # if -Dusethreads was not actually specified. Better to
2539 # bail out here with a useful message than fail
2540 # mysteriously later. Should we perhaps just try to
2541 # re-invoke Configure -Dcc=gcc config_args ?
2542 if $test -f usethreads.cbu; then
2545 *** However, any setting of the C compiler flags (e.g. for thread support)
2546 *** will be lost. It may be necessary for you to restart Configure and
2547 *** add -Dcc=gcc to your Configure command line.
2550 rp="Would you like to go ahead and try gcc anyway?"
2553 rp="Would you like to use it?"
2556 if $test -f myread; then
2559 if $test -f UU/myread; then
2562 echo "Cannot find myread, sorry. Aborting." >&2
2567 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2580 cat <<'EOSC' >>checkcc
2585 int main(int argc, char *argv[]) {
2589 if $cc -o try $ccflags $ldflags try.c; then
2592 if $test X"$despair" = Xyes; then
2593 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2596 You need to find a working C compiler.
2597 Either (purchase and) install the C compiler supplied by your OS vendor,
2598 or for a free C compiler try http://gcc.gnu.org/
2599 I cannot continue any further, aborting.
2608 : determine whether symbolic links are supported
2611 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2612 echo "Symbolic links are supported." >&4
2615 echo "Symbolic links are NOT supported." >&4
2620 : determine whether symbolic links are supported
2624 echo "Checking how to test for symbolic links..." >&4
2626 if $test "X$issymlink" = X; then
2628 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2629 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2631 if test $? = 0; then
2634 echo "Your builtin 'test -h' may be broken." >&4
2637 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2640 if test -f "$p/$test"; then
2649 echo "Trying external '$test -h'." >&4
2650 issymlink="$test -h"
2651 if $test ! -h sym >/dev/null 2>&1; then
2652 echo "External '$test -h' is broken, too." >&4
2660 if $test "X$issymlink" = X; then
2661 if $test -L sym 2>/dev/null; then
2662 issymlink="$test -L"
2663 echo "The builtin '$test -L' worked." >&4
2666 if $test "X$issymlink" != X; then
2667 echo "You can test for symbolic links with '$issymlink'." >&4
2669 echo "I do not know how you can test for symbolic links." >&4
2673 *) echo "No symbolic links, so not testing for their testing..." >&4
2678 : Make symlinks util
2679 case "$mksymlinks" in
2682 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2685 *) case "$lns:$issymlink" in
2686 *"ln"*" -s:"*"test -"?)
2687 echo "Creating the symbolic links..." >&4
2688 echo "(First creating the subdirectories...)" >&4
2690 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2692 test -z "$directory" && break
2696 if test ! -d t/base; then
2697 echo "Failed to create the subdirectories. Aborting." >&4
2700 echo "(Then creating the symlinks...)" >&4
2701 awk '{print $1}' $src/MANIFEST | while true; do
2703 test -z "$filename" && break
2704 if test -f $filename; then
2705 if $issymlink $filename; then
2709 if test -f $filename; then
2710 echo "$filename already exists, not symlinking."
2712 ln -s $src/$filename $filename
2716 if test ! -f t/base/lex.t; then
2717 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2722 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2730 : Check for Cross-Compilation
2731 case "$usecrosscompile" in
2733 $echo "Cross-compiling..."
2736 *-*-gcc) # A cross-compiling gcc, probably.
2737 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2739 # leave out ld, choosing it is more complex
2741 ranlib=$targetarch-ranlib
2742 $echo 'extern int foo;' > try.c
2743 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2745 if $test $# -gt 0; then
2747 incpth="`$echo $incpth|$sed 's/^ //'`"
2748 echo "Guessing incpth '$incpth'." >&4
2750 j="`$echo $i|$sed 's,/include$,/lib,'`"
2751 if $test -d $j; then
2755 libpth="`$echo $libpth|$sed 's/^ //'`"
2756 echo "Guessing libpth '$libpth'." >&4
2761 case "$targetarch" in
2762 '') echo "Targetarch not defined." >&4; croak=y ;;
2763 *) echo "Using targetarch $targetarch." >&4 ;;
2766 '') echo "Incpth not defined." >&4; croak=y ;;
2767 *) echo "Using incpth '$incpth'." >&4 ;;
2770 '') echo "Libpth not defined." >&4; croak=y ;;
2771 *) echo "Using libpth '$libpth'." >&4 ;;
2774 '') for i in $incpth; do
2775 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2777 echo "Guessing usrinc $usrinc." >&4
2782 '') echo "Usrinc not defined." >&4; croak=y ;;
2785 *) echo "Using usrinc $usrinc." >&4 ;;
2787 case "$targethost" in
2788 '') echo "Targethost not defined." >&4; croak=y ;;
2789 *) echo "Using targethost $targethost." >&4
2794 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2797 /*) run=$src/Cross/run
2798 targetmkdir=$src/Cross/mkdir
2800 from=$src/Cross/from
2802 *) pwd=`$test -f ../Configure & cd ..; pwd`
2804 targetmkdir=$pwd/Cross/mkdir
2806 from=$pwd/Cross/from
2809 case "$targetrun" in
2810 '') targetrun=ssh ;;
2815 case "$targetfrom" in
2816 '') targetfrom=scp ;;
2820 from=$from-$targetfrom
2821 case "$targetdir" in
2823 echo "Guessing targetdir $targetdir." >&4
2826 case "$targetuser" in
2828 echo "Guessing targetuser $targetuser." >&4
2831 case "$targetfrom" in
2835 case "$targetrun" in
2847 '') cwd=$targetdir ;;
2851 if $test ! -f \$exe.xok; then
2855 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2858 *) echo "Unknown targetrun '$targetrun'" >&4
2862 case "$targetmkdir" in
2864 cat >$targetmkdir <<EOF
2866 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2868 $chmod a+rx $targetmkdir
2870 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2882 $targetmkdir \`dirname \$f\`
2883 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2886 $targetmkdir $targetdir/\`dirname \$f\`
2887 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2900 $mkdir -p $targetdir/\`dirname \$f\`
2901 $cp \$f $targetdir/\$f || exit 1
2904 $targetmkdir $targetdir/\`dirname \$f\`
2905 $cp \$f $targetdir/\$f || exit 1
2912 *) echo "Unknown targetto '$targetto'" >&4
2916 case "$targetfrom" in
2923 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2928 cp) cat >$from <<EOF
2933 cp $targetdir/\$f . || exit 1
2938 *) echo "Unknown targetfrom '$targetfrom'" >&4
2942 if $test ! -f $run; then
2943 echo "Target 'run' script '$run' not found." >&4
2947 if $test ! -f $to; then
2948 echo "Target 'to' script '$to' not found." >&4
2952 if $test ! -f $from; then
2953 echo "Target 'from' script '$from' not found." >&4
2957 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2961 Using '$run' for remote execution,
2962 and '$from' and '$to'
2963 for remote file transfer.
2969 usecrosscompile='undef'
2974 : see whether [:lower:] and [:upper:] are supported character classes
2976 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2978 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2982 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2983 # (0xd9 and 0xe2), therefore that is a nice testing point.
2984 if test "X$up" = X -o "X$low" = X; then
2985 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2991 if test "X$up" = X -o "X$low" = X; then
2992 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2998 if test "X$up" = X -o "X$low" = X; then
2999 case "`echo RS | od -x 2>/dev/null`" in
3001 echo "Hey, this might be EBCDIC." >&4
3002 if test "X$up" = X -o "X$low" = X; then
3003 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3004 rs) up='[A-IJ-RS-Z]'
3009 if test "X$up" = X -o "X$low" = X; then
3010 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3020 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3022 echo "Using $up and $low to convert case." >&4
3025 echo "I don't know how to translate letters from upper to lower case." >&4
3026 echo "Your tr is not acting any way I know of." >&4
3030 : set up the translation script tr, must be called with ./tr of course
3034 '[A-Z][a-z]') exec $tr '$up' '$low';;
3035 '[a-z][A-Z]') exec $tr '$low' '$up';;
3042 : Try to determine whether config.sh was made on this system
3043 case "$config_sh" in
3045 myuname=`$uname -a 2>/dev/null`
3046 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3047 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3048 # because the A-Z/a-z are not consecutive.
3049 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3050 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3051 newmyuname="$myuname"
3053 case "$knowitall" in
3055 if test -f ../config.sh; then
3056 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3057 eval "`grep myuname= ../config.sh`"
3059 if test "X$myuname" = "X$newmyuname"; then
3067 : Get old answers from old config file if Configure was run on the
3068 : same system, otherwise use the hints.
3071 if test -f config.sh; then
3073 rp="I see a config.sh file. Shall I use it to set the defaults?"
3076 n*|N*) echo "OK, I'll ignore it."
3077 mv config.sh config.sh.old
3078 myuname="$newmyuname"
3080 *) echo "Fetching default answers from your old config.sh file..." >&4
3088 : Older versions did not always set $sh. Catch re-use of such
3098 if test ! -f config.sh; then
3101 First time through, eh? I have some defaults handy for some systems
3102 that need some extra help getting the Configure answers right:
3105 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3107 : Half the following guesses are probably wrong... If you have better
3108 : tests or hints, please send them to perlbug@perl.org
3109 : The metaconfig authors would also appreciate a copy...
3110 $test -f /irix && osname=irix
3111 $test -f /xenix && osname=sco_xenix
3112 $test -f /dynix && osname=dynix
3113 $test -f /dnix && osname=dnix
3114 $test -f /lynx.os && osname=lynxos
3115 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3116 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3117 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3118 $test -f /bin/mips && /bin/mips && osname=mips
3119 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3120 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3121 $test -d /usr/apollo/bin && osname=apollo
3122 $test -f /etc/saf/_sactab && osname=svr4
3123 $test -d /usr/include/minix && osname=minix
3124 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3125 if $test -d /MachTen -o -d /MachTen_Folder; then
3127 if $test -x /sbin/version; then
3128 osvers=`/sbin/version | $awk '{print $2}' |
3129 $sed -e 's/[A-Za-z]$//'`
3130 elif $test -x /usr/etc/version; then
3131 osvers=`/usr/etc/version | $awk '{print $2}' |
3132 $sed -e 's/[A-Za-z]$//'`
3138 $test -f /sys/posix.dll &&
3139 $test -f /usr/bin/what &&
3140 set X `/usr/bin/what /sys/posix.dll` &&
3141 $test "$3" = UWIN &&
3145 if $test -f $uname; then
3153 umips) osname=umips ;;
3156 [23]100) osname=mips ;;
3157 next*) osname=next ;;
3159 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3160 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3163 elif $test -f /etc/kconfig; then
3165 if test "$lns" = "$ln -s"; then
3167 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3169 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3176 if test -n "$DJGPP"; then
3185 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3187 # oslevel can fail with:
3188 # oslevel: Unable to acquire lock.
3189 *not\ found) osvers="$4"."$3" ;;
3190 '<3240'|'<>3240') osvers=3.2.0 ;;
3191 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3192 '=3250'|'>3250') osvers=3.2.5 ;;
3196 bsd386) osname=bsd386
3199 cygwin*) osname=cygwin
3202 *dc.osx) osname=dcosx
3208 domainos) osname=apollo
3214 dragonfly) osname=dragonfly
3217 dynixptx*) osname=dynixptx
3218 osvers=`echo "$4"|sed 's/^v//'`
3220 freebsd) osname=freebsd
3222 genix) osname=genix ;;
3226 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3242 netbsd*) osname=netbsd
3245 news-os) osvers="$3"
3247 4*) osname=newsos4 ;;
3251 next*) osname=next ;;
3252 nonstop-ux) osname=nonstopux ;;
3253 openbsd) osname=openbsd
3259 POSIX-BC | posix-bc ) osname=posix-bc
3262 powerux | power_ux | powermax_os | powermaxos | \
3263 powerunix | power_unix) osname=powerux
3269 solaris) osname=solaris
3271 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3278 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3282 titanos) osname=titanos
3291 ultrix) osname=ultrix
3294 osf1|mls+) case "$5" in
3297 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3300 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3303 hp*) osname=hp_osf1 ;;
3304 mips) osname=mips_osf1 ;;
3307 # UnixWare 7.1.2 is known as Open UNIX 8
3308 openunix|unixware) osname=svr5
3316 $2) case "$osname" in
3320 : svr4.x or possibly later
3330 if test -f /stand/boot ; then
3331 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3332 if test -n "$INITPROG" -a -f "$INITPROG"; then
3333 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3334 if test -n "$isesix"; then
3342 *) if test -f /etc/systemid; then
3344 set `echo $3 | $sed 's/\./ /g'` $4
3345 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3347 elif $test -f $src/hints/sco_$1_$2.sh; then
3349 elif $test -f $src/hints/sco_$1.sh; then
3354 '') : Still unknown. Probably a generic Sys V.
3363 *) case "$osname" in
3364 '') : Still unknown. Probably a generic BSD.
3372 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3373 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3374 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3377 $rm -f UU/kernel.what
3378 elif test -d c:/. -o -n "$is_os2" ; then
3385 case "$targetarch" in
3388 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3393 : Now look for a hint file osname_osvers, unless one has been
3394 : specified already.
3397 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3398 : Also try without trailing minor version numbers.
3399 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3400 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3401 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3402 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3405 *) case "$osvers" in
3408 *) if $test -f $src/hints/$file.sh ; then
3410 elif $test -f $src/hints/$xfile.sh ; then
3412 elif $test -f $src/hints/$xxfile.sh ; then
3414 elif $test -f $src/hints/$xxxfile.sh ; then
3416 elif $test -f $src/hints/$xxxxfile.sh ; then
3418 elif $test -f "$src/hints/${osname}.sh" ; then
3427 if $test -f Policy.sh ; then
3430 none) dflt="Policy" ;;
3431 *) dflt="Policy $dflt" ;;
3436 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3440 if $test -f Policy.sh ; then
3443 There's also a Policy hint file available, which should make the
3444 site-specific (policy) questions easier to answer.
3451 You may give one or more space-separated answers, or "none" if appropriate.
3452 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3453 previous run of Configure, you may specify it as well as or instead of
3454 OS-specific hints. If hints are provided for your OS, you should use them:
3455 although Perl can probably be built without hints on many platforms, using
3456 hints often improve performance and may enable features that Configure can't
3457 set up on its own. If there are no hints that match your OS, specify "none";
3458 DO NOT give a wrong version or a wrong OS.
3462 rp="Which of these apply, if any?"
3465 for file in $tans; do
3466 if $test X$file = XPolicy -a -f Policy.sh; then
3468 $cat Policy.sh >> UU/config.sh
3469 elif $test -f $src/hints/$file.sh; then
3470 . $src/hints/$file.sh
3471 $cat $src/hints/$file.sh >> UU/config.sh
3472 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3475 : Give one chance to correct a possible typo.
3476 echo "$file.sh does not exist"
3478 rp="hint to use instead?"
3480 for file in $ans; do
3481 if $test -f "$src/hints/$file.sh"; then
3482 . $src/hints/$file.sh
3483 $cat $src/hints/$file.sh >> UU/config.sh
3484 elif $test X$ans = X -o X$ans = Xnone ; then
3487 echo "$file.sh does not exist -- ignored."
3494 : Remember our hint file for later.
3495 if $test -f "$src/hints/$file.sh" ; then
3505 echo "Fetching default answers from $config_sh..." >&4
3509 cp $config_sh config.sh 2>/dev/null
3519 test "$override" && . ./optdef.sh
3521 : Restore computed paths
3522 for file in $loclist $trylist; do
3523 eval $file="\$_$file"
3528 Configure uses the operating system name and version to set some defaults.
3529 The default value is probably right if the name rings a bell. Otherwise,
3530 since spelling matters for me, either accept the default or answer "none"
3537 ''|' '|none) dflt=none ;;
3538 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3541 *) dflt="$osname" ;;
3543 rp="Operating system name?"
3547 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3553 ''|' '|none) dflt=none ;;
3554 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3555 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3557 ''|' ') dflt=none ;;
3562 *) dflt="$osvers" ;;
3564 rp="Operating system version?"
3574 : who configured the system
3575 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3578 cf_by=`(logname) 2>/dev/null`
3581 cf_by=`(whoami) 2>/dev/null`
3583 "") cf_by=unknown ;;
3588 : decide how portable to be. Allow command line overrides.
3589 case "$d_portable" in
3591 *) d_portable="$define" ;;
3594 : set up shell script to do ~ expansion
3600 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3603 if $test -f /bin/csh; then
3604 /bin/csh -f -c "glob \$1"
3609 name=\`$expr x\$1 : '..\([^/]*\)'\`
3610 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3611 if $test ! -d "\$dir"; then
3613 echo "\$me: can't locate home directory for: \$name" >&2
3618 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3634 : now set up to get a file name
3638 cat <<'EOSC' >>getfile
3654 : getfile will accept an answer from the comma-separated list
3655 : enclosed in parentheses even if it does not meet other criteria.
3656 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3657 fn=`echo $fn | sed 's/(.*)//'`
3663 loc_file=`expr $fn : '.*:\(.*\)'`
3664 fn=`expr $fn : '\(.*\):.*'`
3672 */*) fullpath=true;;
3681 *e*) exp_file=true;;
3684 *p*) nopath_ok=true;;
3689 *d*) type='Directory';;
3690 *l*) type='Locate';;
3695 Locate) what='File';;
3700 case "$d_portable" in
3708 while test "$type"; do
3713 true) rp="$rp (~name ok)";;
3716 if test -f UU/getfile.ok && \
3717 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3736 value=`UU/filexp $ans`
3739 if test "$ans" != "$value"; then
3740 echo "(That expands to $value on this system.)"
3754 /*) value="$ansexp" ;;
3755 [a-zA-Z]:/*) value="$ansexp" ;;
3760 echo "I shall only accept a full path name, as in /bin/ls." >&4
3761 echo "Use a ! shell escape if you wish to check pathnames." >&4
3764 echo "Please give a full path name, starting with slash." >&4
3767 echo "Note that using ~name is ok provided it expands well." >&4
3780 for fp in $gfpth; do
3781 if test "X$fp" = X.; then
3786 if test -f "$pf"; then
3788 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3790 echo "($value is not a plain file, but that's ok.)"
3793 if test X"$type" = X; then
3800 for fp in $gfpth; do
3801 if test "X$fp" = X.; then
3806 direxp="$fp/$ansexp"
3808 if test -d "$direxp"; then
3816 if test -d "$ansexp"; then
3817 echo "(Looking for $loc_file in directory $value.)"
3818 value="$value/$loc_file"
3819 ansexp="$ansexp/$loc_file"
3821 if test -f "$ansexp"; then
3824 case "$nopath_ok" in
3825 true) case "$value" in
3827 *) echo "Assuming $value will be in people's path."
3843 if test "$fastread" = yes; then
3848 rp="$what $value doesn't exist. Use that name anyway?"
3867 test "X$gfpthkeep" != Xy && gfpth=""
3870 : determine root of directory hierarchy where package will be installed.
3873 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3876 dflt=`echo "$prefix" | sed 's/.$//'`
3884 By default, $package will be installed in $dflt/bin, manual pages
3885 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3886 installation directories. Typically this is something like /usr/local.
3887 If you wish to have binaries under /usr/bin but other parts of the
3888 installation under /usr/local, that's ok: you will be prompted
3889 separately for each of the installation directories, the prefix being
3890 only used to set the defaults.
3894 rp='Installation prefix to use?'
3902 *) oldprefix="$prefix";;
3909 : allow them to override the AFS root
3912 *) afsroot=$afsroot ;;
3918 $define|true) afs=true ;;
3919 $undef|false) afs=false ;;
3920 *) if $test -d $afsroot; then
3928 echo "AFS may be running... I'll be extra cautious then..." >&4
3930 echo "AFS does not seem to be running..." >&4
3933 : determine installation prefix for where package is to be installed.
3937 Since you are running AFS, I need to distinguish the directory in which
3938 files will reside from the directory in which they are installed (and from
3939 which they are presumably copied to the former directory by occult means).
3942 case "$installprefix" in
3943 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3944 *) dflt="$installprefix";;
3949 In some special cases, particularly when building $package for distribution,
3950 it is convenient to distinguish the directory in which files should be
3951 installed from the directory ($prefix) in which they will
3952 eventually reside. For most users, these two directories are the same.
3955 case "$installprefix" in
3957 *) dflt=$installprefix;;
3961 rp='What installation prefix should I use for installing files?'
3963 installprefix="$ans"
3964 installprefixexp="$ansexp"
3966 : Perform the prefixexp/installprefixexp correction if necessary
3967 cat <<EOS >installprefix
3970 cat <<'EOSC' >>installprefix
3971 : Change installation prefix, if necessary.
3972 if $test X"$prefix" != X"$installprefix"; then
3973 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3975 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3978 chmod +x installprefix
3979 $eunicefix installprefix
3981 : Set variables such as privlib and privlibexp from the output of ./getfile
3982 : performing the prefixexp/installprefixexp correction if necessary.
3983 cat <<EOS >setprefixvar
3986 cat <<'EOSC' >>setprefixvar
3987 eval "${prefixvar}=\"\$ans\""
3988 eval "${prefixvar}exp=\"\$ansexp\""
3991 chmod +x setprefixvar
3992 $eunicefix setprefixvar
3994 : set up the script used to warn in case of inconsistency
4003 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4005 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4006 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4011 echo "*** WHOA THERE!!! ***" >&4
4012 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4015 rp=" Keep the $hint value?"
4018 y) td=$was; tu=$was;;
4022 : function used to set '$1' to '$val'
4023 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4025 $define$undef) . ./whoa; eval "$var=\$td";;
4026 $undef$define) . ./whoa; eval "$var=\$tu";;
4027 *) eval "$var=$val";;
4030 : Check is we will use socks
4032 $define|true|[yY]*) dflt='y';;
4037 Perl can be built to use the SOCKS proxy protocol library. To do so,
4038 Configure must be run with -Dusesocks. If you use SOCKS you also need
4039 to use the PerlIO abstraction layer, this will be implicitly selected.
4041 If this doesn't make any sense to you, just accept the default '$dflt'.
4043 rp='Build Perl for SOCKS?'
4046 y|Y) val="$define" ;;
4053 $define|true|[yY]*) useperlio="$define";;
4056 : Check if we want perlio
4057 case "$useperlio" in
4058 $define|true|[yY]*|'') dflt='y';;
4063 Previous version of $package used the standard IO mechanisms as
4064 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4065 alternate IO mechanisms via the PerlIO abstraction layer, but the
4066 stdio mechanism is still available if needed. The abstraction layer
4067 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4068 Using PerlIO with sfio may cause problems with some extension modules.
4070 If this doesn't make any sense to you, just accept the default '$dflt'.
4072 rp='Use the PerlIO abstraction layer?'
4079 echo "Ok, doing things the stdio way."
4088 case "$useperlio" in
4089 $define|true|[yY]*) ;;
4092 You are using the SOCKS proxy protocol library which means that you
4093 should also use the PerlIO layer. You may be headed for trouble.
4101 : get the patchlevel
4103 echo "Getting the current patchlevel..." >&4
4104 if $test -r $rsrc/patchlevel.h;then
4105 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4106 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4107 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4108 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4109 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4110 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4111 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4120 $echo "(You do not have patchlevel.h. Eek.)"
4122 if $test -r $rsrc/.patch ; then
4123 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4124 perl_patchlevel=`cat $rsrc/.patch`
4127 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4128 version_patchlevel_string="version $patchlevel subversion $subversion"
4129 case "$perl_patchlevel" in
4131 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4134 $echo "(You have $package $version_patchlevel_string.)"
4138 : XXX Should be a Configure test for double-dots in filenames.
4139 version=`echo $revision $patchlevel $subversion | \
4140 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4141 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4142 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4145 version=`echo $revision $patchlevel $subversion | \
4146 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4147 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4148 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4151 : Special case the 5.005_xx maintenance series, which used 5.005
4152 : without any subversion label as a subdirectory in $sitelib
4153 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4154 api_versionstring='5.005'
4157 : Do we want threads support and if so, what type
4158 case "$usethreads" in
4159 $define|true|[yY]*) dflt='y';;
4160 *) # Catch case where user specified ithreads or 5005threads but
4161 # forgot -Dusethreads (A.D. 4/2002)
4162 case "$useithreads$use5005threads" in
4164 case "$useperlio" in
4165 "$define") dflt='y' ;;
4175 Perl can be built to take advantage of threads on some systems.
4176 To do so, Configure can be run with -Dusethreads.
4178 Note that Perl built with threading support runs slightly slower
4179 and uses more memory than plain Perl. The current implementation
4180 is believed to be stable, but it is fairly new, and so should be
4181 treated with caution.
4183 If this doesn't make any sense to you, just accept the default '$dflt'.
4185 rp='Build a threading Perl?'
4188 y|Y) val="$define" ;;
4194 if $test $patchlevel -lt 9; then
4195 case "$usethreads" in
4199 Since release 5.6, Perl has had two different threading implementations,
4200 the newer interpreter-based version (ithreads) with one interpreter per
4201 thread, and the older 5.005 version (5005threads).
4202 The 5005threads version is effectively unmaintained and will probably be
4203 removed in Perl 5.10, so there should be no need to build a Perl using it
4204 unless needed for backwards compatibility with some existing 5.005threads
4208 : Default to ithreads unless overridden on command line or with
4211 case "$use5005threads" in
4212 $define|true|[yY]*) dflt='n';;
4214 case "$useithreads" in
4215 $undef|false|[nN]*) dflt='n';;
4217 rp='Use the newer interpreter-based ithreads?'
4220 y|Y) val="$define" ;;
4225 : Now set use5005threads to the opposite value.
4226 case "$useithreads" in
4227 $define) val="$undef" ;;
4234 useithreads="$undef"
4235 use5005threads="$undef"
4239 case "$useithreads$use5005threads" in
4243 You cannot have both the ithreads and the 5.005 threads enabled
4244 at the same time. Disabling the 5.005 threads since they are
4245 much less stable than the ithreads.
4248 use5005threads="$undef"
4253 : perl-5.9.x and later
4255 if test X"$usethreads" = "X$define"; then
4256 case "$use5005threads" in
4260 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4267 use5005threads="$undef"
4268 useithreads="$usethreads"
4271 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4274 *** To build with ithreads you must also use the PerlIO layer.
4275 *** Cannot continue, aborting.
4281 case "$d_oldpthreads" in
4282 '') : Configure tests would be welcome here. For now, assume undef.
4284 *) val="$d_oldpthreads" ;;
4290 : Look for a hint-file generated 'call-back-unit'. If the
4291 : user has specified that a threading perl is to be built,
4292 : we may need to set or change some other defaults.
4293 if $test -f usethreads.cbu; then
4294 echo "Your platform has some specific hints regarding threaded builds, using them..."
4297 case "$usethreads" in
4298 "$define"|true|[yY]*)
4300 (Your platform does not have any specific hints for threaded builds.
4301 Assuming POSIX threads, then.)
4307 : Check if multiplicity is required
4310 Perl can be built so that multiple Perl interpreters can coexist
4311 within the same Perl executable.
4314 case "$useithreads" in
4317 This multiple interpreter support is required for interpreter-based threads.
4321 *) case "$usemultiplicity" in
4322 $define|true|[yY]*) dflt='y';;
4326 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4327 rp='Build Perl for multiplicity?'
4330 y|Y) val="$define" ;;
4338 : Check if morebits is requested
4339 case "$usemorebits" in
4340 "$define"|true|[yY]*)
4341 use64bitint="$define"
4342 uselongdouble="$define"
4343 usemorebits="$define"
4345 *) usemorebits="$undef"
4349 : Determine the C compiler to be used
4355 rp="Use which C compiler?"
4359 : See whether they have no cc but they do have gcc
4361 if $test -f cc.cbu; then
4366 : make some quick guesses about what we are up against
4368 $echo $n "Hmm... $c"
4378 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4379 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4381 echo "Looks kind of like an OSF/1 system, but we'll see..."
4383 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4384 xxx=`./loc addbib blurfl $pth`
4385 if $test -f $xxx; then
4386 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4390 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4391 echo "Looks kind of like an extended USG system, but we'll see..."
4393 echo "Looks kind of like a USG system, but we'll see..."
4397 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4398 echo "Looks kind of like a BSD system, but we'll see..."
4402 echo "Looks kind of like a Version 7 system, but we'll see..."
4405 case "$eunicefix" in
4408 There is, however, a strange, musty smell in the air that reminds me of
4409 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4413 : it so happens the Eunice I know will not run shell scripts in Unix format
4417 echo "Congratulations. You aren't running Eunice."
4421 : Detect OS2. The p_ variable is set above in the Head.U unit.
4422 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4423 : semicolon as a patch separator
4428 I have the feeling something is not exactly right, however...don't tell me...
4429 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4430 (Or you may be running DOS with DJGPP.)
4435 if test -f /xenix; then
4436 echo "Actually, this looks more like a XENIX system..."
4441 echo "It's not Xenix..."
4446 if test -f /venix; then
4447 echo "Actually, this looks more like a VENIX system..."
4454 echo "Nor is it Venix..."
4457 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4458 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4461 : Check if we are using GNU gcc and what its version is
4463 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4467 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4469 printf("%s\n", __VERSION__);
4471 printf("%s\n", "1");
4477 if $cc -o try $ccflags $ldflags try.c; then
4478 gccversion=`$run ./try`
4479 case "$gccversion" in
4480 '') echo "You are not using GNU cc." ;;
4481 *) echo "You are using GNU cc $gccversion."
4487 echo "*** WHOA THERE!!! ***" >&4
4488 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4489 case "$knowitall" in
4491 echo " You'd better start hunting for one and let me know about it." >&4
4497 case "$gccversion" in
4498 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4500 case "$gccversion" in
4501 '') gccosandvers='' ;;
4502 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4503 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4505 case "$gccosandvers" in
4506 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4507 $osname$osvers) ;; # looking good
4508 $osname*) cat <<EOM >&4
4510 *** WHOA THERE!!! ***
4512 Your gcc has not been compiled for the exact release of
4513 your operating system ($gccosandvers versus $osname$osvers).
4515 In general it is a good idea to keep gcc synchronized with
4516 the operating system because otherwise serious problems
4517 may ensue when trying to compile software, like Perl.
4519 I'm trying to be optimistic here, though, and will continue.
4520 If later during the configuration and build icky compilation
4521 problems appear (headerfile conflicts being the most common
4522 manifestation), I suggest reinstalling the gcc to match
4523 your operating system release.
4527 *) gccosandvers='' ;; # failed to parse, better be silent
4535 # gcc 3.* complain about adding -Idirectories that they already know about,
4536 # so we will take those off from locincpth.
4537 case "$gccversion" in
4539 echo "main(){}">try.c
4540 for incdir in $locincpth; do
4541 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4542 grep '^c[cp]p*[01]: warning: changing search order '`
4543 if test "X$warn" != X; then
4544 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4550 : What should the include directory be ?
4552 $echo $n "Hmm... $c"
4556 if $test -f /bin/mips && /bin/mips; then
4557 echo "Looks like a MIPS system..."
4558 $cat >usr.c <<'EOCP'
4559 #ifdef SYSTYPE_BSD43
4563 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4564 dflt='/bsd43/usr/include'
4568 mips_type='System V'
4570 $rm -f usr.c usr.out
4571 echo "and you're compiling with the $mips_type compiler and libraries."
4575 echo "Doesn't look like a MIPS system."
4585 case "$xxx_prompt" in
4588 rp='Where are the include files you want to use?'
4596 : see how we invoke the C preprocessor
4598 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4599 cat <<'EOT' >testcpp.c
4605 if test ! -f cppstdin; then
4606 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4607 # AIX cc -E doesn't show the absolute headerfile
4608 # locations but we'll cheat by using the -M flag.
4609 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
4611 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4614 echo "Keeping your $hint cppstdin wrapper."
4617 wrapper=`pwd`/cppstdin
4621 if $test "X$cppstdin" != "X" && \
4622 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4623 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4625 echo "You used to use $cppstdin $cppminus so we'll use that again."
4627 '') echo "But let's see if we can live without a wrapper..." ;;
4629 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4630 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4632 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4635 echo "(However, $cpprun $cpplast does not work, let's see...)"
4643 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4650 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4651 $cc -E <testcpp.c >testcpp.out 2>&1; \
4652 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4653 echo "Yup, it does."
4656 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4657 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4658 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4659 echo "Yup, it does."
4662 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4663 $cc -P <testcpp.c >testcpp.out 2>&1; \
4664 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4665 echo "Yipee, that works!"
4668 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4669 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4670 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4671 echo "At long last!"
4674 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4675 $cpp <testcpp.c >testcpp.out 2>&1; \
4676 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4680 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4681 $cpp - <testcpp.c >testcpp.out 2>&1; \
4682 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4683 echo "Hooray, it works! I was beginning to wonder."
4686 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4687 $wrapper <testcpp.c >testcpp.out 2>&1; \
4688 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4694 rp="No dice. I can't find a C preprocessor. Name one:"
4698 $x_cpp <testcpp.c >testcpp.out 2>&1
4699 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4700 echo "OK, that will do." >&4
4702 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4717 echo "Perhaps can we force $cc -E using a wrapper..."
4718 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4719 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4725 echo "Nope, we'll have to live without it..."
4739 "$wrapper"|'cppstdin') ;;
4740 *) $rm -f $wrapper;;
4742 $rm -f testcpp.c testcpp.out
4744 : Set private lib path
4747 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4752 '') dlist="$loclibpth $plibpth $glibpth";;
4753 *) dlist="$libpth";;
4756 : Now check and see which directories actually exist, avoiding duplicates
4760 if $test -d $xxx; then
4763 *) libpth="$libpth $xxx";;
4769 Some systems have incompatible or broken versions of libraries. Among
4770 the directories listed in the question below, please remove any you
4771 know not to be holding relevant libraries, and add any that are needed.
4772 Say "none" for none.
4783 rp="Directories to use for library searches?"
4790 : compute shared library extension
4793 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4803 On some systems, shared libraries may be available. Answer 'none' if
4804 you want to suppress searching of shared libraries for the remainder
4805 of this configuration.
4808 rp='What is the file extension used for shared libraries?'
4812 : Define several unixisms.
4813 : Hints files or command line option can be used to override them.
4814 : The convoluted testing is in case hints files set either the old
4817 '') case "$exe_ext" in
4819 *) _exe="$exe_ext" ;;
4824 '') case "$lib_ext" in
4831 '') case "$obj_ext" in
4838 '') case "$path_sep" in
4849 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4851 : Which makefile gets called first. This is used by make depend.
4852 case "$firstmakefile" in
4853 '') firstmakefile='makefile';;
4856 : Check for uselongdouble support
4858 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4861 case "$uselongdouble" in
4862 $define|true|[yY]*) dflt='y';;
4867 Perl can be built to take advantage of long doubles which
4868 (if available) may give more accuracy and range for floating point numbers.
4870 If this doesn't make any sense to you, just accept the default '$dflt'.
4872 rp='Try to use long doubles if available?'
4875 y|Y) val="$define" ;;
4881 case "$uselongdouble" in
4882 true|[yY]*) uselongdouble="$define" ;;
4885 : Look for a hint-file generated 'call-back-unit'. If the
4886 : user has specified that long doubles should be used,
4887 : we may need to set or change some other defaults.
4888 if $test -f uselongdouble.cbu; then
4889 echo "Your platform has some specific hints regarding long doubles, using them..."
4890 . ./uselongdouble.cbu
4892 case "$uselongdouble" in
4895 (Your platform does not have any specific hints for long doubles.)
4901 : Looking for optional libraries
4903 echo "Checking for optional libraries..." >&4
4908 case "$libswanted" in
4909 '') libswanted='c_s';;
4912 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4918 for thisdir in $libpth $xlibpth; do
4919 test -d $thisdir && libspath="$libspath $thisdir"
4921 for thislib in $libswanted; do
4922 for thisdir in $libspath; do
4924 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4925 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=shared
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/lib$thislib.$so
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=shared
4934 if test ! -f "$xxx"; then
4935 xxx=$thisdir/lib$thislib$_a
4936 $test -f "$xxx" && eval $libscheck
4937 $test -f "$xxx" && libstyle=static
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/$thislib$_a
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=static
4944 if test ! -f "$xxx"; then
4945 xxx=$thisdir/lib${thislib}_s$_a
4946 $test -f "$xxx" && eval $libscheck
4947 $test -f "$xxx" && libstyle=static
4948 $test -f "$xxx" && thislib=${thislib}_s
4950 if test ! -f "$xxx"; then
4951 xxx=$thisdir/Slib$thislib$_a
4952 $test -f "$xxx" && eval $libscheck
4953 $test -f "$xxx" && libstyle=static
4955 if $test -f "$xxx"; then
4957 shared) echo "Found -l$thislib (shared)." ;;
4958 static) echo "Found -l$thislib." ;;
4959 *) echo "Found -l$thislib ($libstyle)." ;;
4963 *) dflt="$dflt -l$thislib"
4964 libsfound="$libsfound $xxx"
4966 libsfiles="$libsfiles $yyy"
4967 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4968 case " $libsdirs " in
4970 *) libsdirs="$libsdirs $yyy" ;;
4977 if $test ! -f "$xxx"; then
4978 echo "No -l$thislib."
4989 ' '|'') dflt='none';;
4994 In order to compile $package on your machine, a number of libraries
4995 are usually needed. Include any other special libraries here as well.
4996 Say "none" for none. The default list is almost always right.
5000 rp="What libraries to use?"
5007 : determine optimization, if desired, or use for debug flag also
5009 ' '|$undef) dflt='none';;
5011 *) dflt="$optimize";;
5015 By default, $package compiles with the -O flag to use the optimizer.
5016 Alternately, you might want to use the symbolic debugger, which uses
5017 the -g flag (on traditional Unix systems). Either flag can be
5018 specified here. To use neither flag, specify the word "none".
5021 rp="What optimizer/debugger flag should be used?"
5025 'none') optimize=" ";;
5028 : Check what DEBUGGING is required from the command line
5029 : -DEBUGGING or -DDEBUGGING or
5030 : -DEBUGGING=both = -g + -DDEBUGGING
5031 : -DEBUGGING=-g or -Doptimize=-g = -g
5032 : -DEBUGGING=none or -UDEBUGGING =
5033 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5036 *) DEBUGGING=$EBUGGING ;;
5039 case "$DEBUGGING" in
5043 *) optimize="$optimize -g" ;;
5047 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5055 case "$DEBUGGING" in
5056 both|$define) dflt='-DDEBUGGING'
5059 : argument order is deliberate, as the flag will start with - which set could
5060 : think is an option
5061 checkccflag='check=$1; flag=$2; callback=$3;
5063 echo "Checking if your compiler accepts $flag" 2>&1;
5064 echo "int main(void) { return 0; }" > gcctest.c;
5065 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5066 echo "Yes, it does." 2>&1;
5067 if $test -s gcctest.out ; then
5068 echo "But your platform does not like it:";
5073 echo "Leaving current flags $ccflags alone." 2>&1
5075 *) dflt="$dflt $flag";
5081 echo "Nope, it does not, but that is ok." 2>&1;
5085 : We will not override a previous value, but we might want to
5086 : augment a hint file
5088 default|recommended)
5089 case "$gccversion" in
5090 1*) dflt="$dflt -fpcc-struct-return" ;;
5092 case "$optimize:$DEBUGGING" in
5093 *-g*:old) dflt="$dflt -DDEBUGGING";;
5095 case "$gccversion" in
5096 2*) if $test -d /etc/conf/kconfig.d &&
5097 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5099 # Interactive Systems (ISC) POSIX mode.
5104 case "$gccversion" in
5107 ?*) set strict-aliasing -fno-strict-aliasing
5111 # For gcc, adding -pipe speeds up compilations for some, but apparently
5112 # some assemblers can't read from stdin. (It also slows down compilations
5113 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5114 case "$gccversion" in
5120 # on x86_64 (at least) we require an extra library (libssp) in the
5121 # link command line. This library is not named, so I infer that it is
5122 # an implementation detail that may change. Hence the safest approach
5123 # is to add the flag to the flags passed to the compiler at link time,
5124 # as that way the compiler can do the right implementation dependant
5126 case "$gccversion" in
5127 ?*) set stack-protector -fstack-protector
5134 case "$mips_type" in
5135 *BSD*|'') inclwanted="$locincpth $usrinc";;
5136 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5138 for thisincl in $inclwanted; do
5139 if $test -d $thisincl; then
5140 if $test x$thisincl != x$usrinc; then
5142 *" -I$thisincl "*);;
5143 *) dflt="$dflt -I$thisincl ";;
5149 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5151 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5159 *) dflt="$dflt -D$2";;
5163 set signal.h LANGUAGE_C; eval $inctest
5167 ccflags="$ccflags -DSOCKS"
5172 default|recommended) dflt="$ccflags $dflt" ;;
5173 *) dflt="$ccflags";;
5182 Your C compiler may want other flags. For this question you should include
5183 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5184 but you should NOT include libraries or ld flags like -lwhatever. If you
5185 want $package to honor its debug switch, you should include -DDEBUGGING here.
5186 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5188 To use no flags, specify the word "none".
5194 rp="Any additional cc flags?"
5201 : the following weeds options from ccflags that are of no interest to cpp
5203 '') cppflags="$ccflags" ;;
5204 *) cppflags="$cppflags $ccflags" ;;
5206 case "$gccversion" in
5207 1*) cppflags="$cppflags -D__GNUC__"
5209 case "$mips_type" in
5211 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5217 echo "Let me guess what the preprocessor flags are..." >&4
5231 *) ftry="$previous $flag";;
5233 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5234 >cpp1.out 2>/dev/null && \
5235 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5236 >cpp2.out 2>/dev/null && \
5237 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5238 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5240 cppflags="$cppflags $ftry"
5250 *-*) echo "They appear to be: $cppflags";;
5252 $rm -f cpp.c cpp?.out
5256 : flags used in final linking phase
5258 '') if ./venix; then
5264 *-posix*) dflt="$dflt -posix" ;;
5267 *) dflt="$ldflags";;
5269 # See note above about -fstack-protector
5271 *-fstack-protector*)
5273 *-fstack-protector*) ;; # Don't add it again
5274 *) dflt="$dflt -fstack-protector" ;;
5279 : Try to guess additional flags to pick up local libraries.
5280 for thislibdir in $libpth; do
5281 case " $loclibpth " in
5284 *"-L$thislibdir "*) ;;
5285 *) dflt="$dflt -L$thislibdir" ;;
5297 Your C linker may need flags. For this question you should
5298 include -L/whatever and any other flags used by the C linker, but you
5299 should NOT include libraries like -lwhatever.
5301 Make sure you include the appropriate -L/path flags if your C linker
5302 does not normally search all of the directories you specified above,
5305 To use no flags, specify the word "none".
5309 rp="Any additional ld flags (NOT including libraries)?"
5315 rmlist="$rmlist pdp11"
5319 echo "Checking your choice of C compiler and flags for coherency..." >&4
5320 $cat > try.c <<'EOF'
5322 int main() { printf("Ok\n"); return(0); }
5324 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5326 $cat >try.msg <<'EOM'
5327 I've tried to compile and run the following simple program:
5330 $cat try.c >> try.msg
5332 $cat >> try.msg <<EOM
5339 and I got the following output:
5343 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5344 if $sh -c "$run ./try " >>try.msg 2>&1; then
5348 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5351 cat >> try.msg <<'EOQS'
5352 If $libs contains -lsfio, and sfio is mis-configured, then it
5353 sometimes (apparently) runs and exits with a 0 status, but with no
5354 output! It may have to do with sfio's use of _exit vs. exit.
5357 rp="You have a big problem. Shall I abort Configure"
5364 echo "The program compiled OK, but exited with status $?." >>try.msg
5365 rp="You have a problem. Shall I abort Configure"
5369 echo "I can't compile the test program." >>try.msg
5370 rp="You have a BIG problem. Shall I abort Configure"
5376 case "$knowitall" in
5378 echo "(The supplied flags or libraries might be incorrect.)"
5386 *) echo "Ok. Stopping Configure." >&4
5391 n) echo "OK, that should do.";;
5393 $rm_try gcctest gcctest.out
5395 : define a shorthand compile call
5399 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5400 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5404 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5405 : define a shorthand compile call for compilations that should be ok.
5409 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5411 : determine filename position in cpp output
5413 echo "Computing filename position in cpp output for #include directives..." >&4
5415 vos) testaccess=-e ;;
5418 echo '#include <stdio.h>' > foo.c
5421 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5422 $grep '^[ ]*#.*stdio\.h' | \
5423 while read cline; do
5426 while $test \$# -gt 0; do
5427 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5432 pos=\`expr \$pos + 1\`
5444 *) pos="${fieldn}th";;
5446 echo "Your cpp writes the filename in the $pos field of the line."
5449 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5450 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5453 : locate header file
5458 for usrincdir in $usrinc
5460 if test -f \$usrincdir/\$wanted; then
5461 echo "\$usrincdir/\$wanted"
5465 awkprg='{ print \$$fieldn }'
5466 echo "#include <\$wanted>" > foo\$\$.c
5467 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5468 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5469 while read cline; do
5470 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5472 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5473 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5478 # status = 0: grep returned 0 lines, case statement not executed
5479 # status = 1: headerfile found
5480 # status = 2: while loop executed, no headerfile found
5484 if test \$status -eq 1; then
5491 : define an alternate in-header-list? function
5492 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5493 cont=true; xxf="echo \"<\$1> found.\" >&4";
5494 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5495 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5497 case $# in 4) instead=instead;; *) instead="at last";; esac;
5498 while $test "$cont"; do
5500 var=$2; eval "was=\$$2";
5501 if $test "$xxx" && $test -r "$xxx";
5503 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5506 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5507 set $yyy; shift; shift; yyy=$@;
5508 case $# in 0) cont="";;
5509 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5510 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5511 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5512 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5516 do set $yyy; var=$2; eval "was=\$$2";
5517 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5518 set $yyy; shift; shift; yyy=$@;
5521 : see if stdlib is available
5522 set stdlib.h i_stdlib
5525 : check for lengths of integral types
5529 echo "Checking to see how big your integers are..." >&4
5538 printf("intsize=%d;\n", (int)sizeof(int));
5539 printf("longsize=%d;\n", (int)sizeof(long));
5540 printf("shortsize=%d;\n", (int)sizeof(short));
5545 if eval $compile_ok && $run ./try > /dev/null; then
5547 echo "Your integers are $intsize bytes long."
5548 echo "Your long integers are $longsize bytes long."
5549 echo "Your short integers are $shortsize bytes long."
5553 Help! I can't compile and run the intsize test program: please enlighten me!
5554 (This is probably a misconfiguration in your system or libraries, and
5555 you really ought to fix it. Still, I'll try anyway.)
5559 rp="What is the size of an integer (in bytes)?"
5563 rp="What is the size of a long integer (in bytes)?"
5567 rp="What is the size of a short integer (in bytes)?"
5575 : check for long long
5577 echo "Checking to see if you have long long..." >&4
5578 echo 'int main() { long long x = 7; return 0; }' > try.c
5580 if eval $compile; then
5582 echo "You have long long."
5585 echo "You do not have long long."
5591 : check for length of long long
5592 case "${d_longlong}${longlongsize}" in
5595 echo "Checking to see how big your long longs are..." >&4
5596 $cat >try.c <<'EOCP'
5600 printf("%d\n", (int)sizeof(long long));
5605 if eval $compile_ok; then
5606 longlongsize=`$run ./try`
5607 echo "Your long longs are $longlongsize bytes long."
5611 echo "(I can't seem to compile the test program. Guessing...)"
5612 rp="What is the size of a long long (in bytes)?"
5616 if $test "X$longsize" = "X$longlongsize"; then
5617 echo "(That isn't any different from an ordinary long.)"
5623 : see if inttypes.h is available
5624 : we want a real compile instead of Inhdr because some systems
5625 : have an inttypes.h which includes non-existent headers
5628 #include <inttypes.h>
5630 static int32_t foo32 = 0x12345678;
5634 if eval $compile; then
5635 echo "<inttypes.h> found." >&4
5638 echo "<inttypes.h> NOT found." >&4
5647 echo "Checking to see if you have int64_t..." >&4
5649 #include <sys/types.h>
5650 #$i_inttypes I_INTTYPES
5652 #include <inttypes.h>
5654 int main() { int64_t x = 7; }
5657 if eval $compile; then
5659 echo "You have int64_t."
5662 echo "You do not have int64_t."
5668 : Check if 64bit ints have a quad type
5670 echo "Checking which 64-bit integer type we could use..." >&4
5676 val='"unsigned int"'
5681 *) case "$longsize" in
5685 val='"unsigned long"'
5690 *) case "$d_longlong:$longlongsize" in
5695 val='"unsigned long long"'
5700 *) case "$d_int64_t" in
5719 '') echo "Alas, no 64-bit integer types in sight." >&4
5722 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5727 : Do we want 64bit support
5728 case "$uselonglong" in
5729 "$define"|true|[yY]*)
5732 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5734 use64bitint="$define"
5737 case "$use64bits" in
5738 "$define"|true|[yY]*)
5741 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5743 use64bitint="$define"
5746 case "$use64bitints" in
5747 "$define"|true|[yY]*)
5750 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5752 use64bitint="$define"
5755 case "$use64bitsint" in
5756 "$define"|true|[yY]*)
5759 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5761 use64bitint="$define"
5764 case "$uselonglongs" in
5765 "$define"|true|[yY]*)
5768 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5770 use64bitint="$define"
5773 case "$use64bitsall" in
5774 "$define"|true|[yY]*)
5777 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5779 use64bitall="$define"
5784 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5786 case "$use64bitall" in
5787 "$define"|true|[yY]*) use64bitint="$define" ;;
5793 You have natively 64-bit long integers.
5797 *) case "$use64bitint" in
5798 "$define"|true|[yY]*) dflt='y';;
5807 Perl can be built to take advantage of 64-bit integer types
5808 on some systems. To do so, Configure can be run with -Duse64bitint.
5809 Choosing this option will most probably introduce binary incompatibilities.
5811 If this doesn't make any sense to you, just accept the default '$dflt'.
5812 (The default has been chosen based on your configuration.)
5814 rp='Try to use 64-bit integers, if available?'
5817 [yY]*) val="$define" ;;
5825 case "$use64bitall" in
5826 "$define"|true|[yY]*) dflt='y' ;;
5827 *) case "$longsize" in
5835 You may also choose to try maximal 64-bitness. It means using as much
5836 64-bitness as possible on the platform. This in turn means even more
5837 binary incompatibilities. On the other hand, your platform may not
5838 have any more 64-bitness available than what you already have chosen.
5840 If this doesn't make any sense to you, just accept the default '$dflt'.
5841 (The default has been chosen based on your configuration.)
5843 rp='Try to use maximal 64-bit support, if available?'
5846 [yY]*) val="$define" ;;
5851 case "$use64bitall" in
5853 case "$use64bitint" in
5857 Since you have chosen a maximally 64-bit build, I'm also turning on
5858 the use of 64-bit integers.
5860 use64bitint="$define" ;;
5865 : Look for a hint-file generated 'call-back-unit'. If the
5866 : user has specified that a 64-bit perl is to be built,
5867 : we may need to set or change some other defaults.
5868 if $test -f use64bitint.cbu; then
5869 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5872 case "$use64bitint" in
5873 "$define"|true|[yY]*)
5875 4) case "$archname64" in
5876 '') archname64=64int ;;
5883 : Look for a hint-file generated 'call-back-unit'. If the
5884 : user has specified that a maximally 64-bit perl is to be built,
5885 : we may need to set or change some other defaults.
5886 if $test -f use64bitall.cbu; then
5887 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5890 case "$use64bitall" in
5891 "$define"|true|[yY]*)
5893 4) case "$archname64" in
5894 ''|64int) archname64=64all ;;
5901 case "$d_quad:$use64bitint" in
5905 *** You have chosen to use 64-bit integers,
5906 *** but none can be found.
5907 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5908 *** Cannot continue, aborting.
5915 : check for length of double
5917 case "$doublesize" in
5919 echo "Checking to see how big your double precision numbers are..." >&4
5928 printf("%d\n", (int)sizeof(double));
5933 if eval $compile_ok; then
5934 doublesize=`$run ./try`
5935 echo "Your double is $doublesize bytes long."
5938 echo "(I can't seem to compile the test program. Guessing...)"
5939 rp="What is the size of a double precision number (in bytes)?"
5947 : check for long doubles
5949 echo "Checking to see if you have long double..." >&4
5950 echo 'int main() { long double x = 7.0; }' > try.c
5952 if eval $compile; then
5954 echo "You have long double."
5957 echo "You do not have long double."
5963 : check for length of long double
5964 case "${d_longdbl}${longdblsize}" in
5967 echo "Checking to see how big your long doubles are..." >&4
5968 $cat >try.c <<'EOCP'
5972 printf("%d\n", sizeof(long double));
5977 if eval $compile; then
5978 longdblsize=`$run ./try`
5979 echo "Your long doubles are $longdblsize bytes long."
5983 echo "(I can't seem to compile the test program. Guessing...)" >&4
5984 rp="What is the size of a long double (in bytes)?"
5988 if $test "X$doublesize" = "X$longdblsize"; then
5989 echo "That isn't any different from an ordinary double."
5990 echo "I'll keep your setting anyway, but you may see some"
5991 echo "harmless compilation warnings."
5997 : determine the architecture name
5999 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6000 tarch=`arch`"-$osname"
6001 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6002 if uname -m > tmparch 2>&1 ; then
6003 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6004 -e 's/$/'"-$osname/" tmparch`
6012 case "$myarchname" in
6015 echo "(Your architecture name used to be $myarchname.)"
6019 case "$targetarch" in
6021 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6026 *) dflt="$archname";;
6028 rp='What is your architecture name'
6031 case "$usethreads" in
6033 echo "Threads selected." >&4
6035 *-thread*) echo "...and architecture name already has -thread." >&4
6037 *) archname="$archname-thread"
6038 echo "...setting architecture name to $archname." >&4
6043 case "$usemultiplicity" in
6045 echo "Multiplicity selected." >&4
6047 *-multi*) echo "...and architecture name already has -multi." >&4
6049 *) archname="$archname-multi"
6050 echo "...setting architecture name to $archname." >&4
6055 case "$use64bitint$use64bitall" in
6057 case "$archname64" in
6059 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6062 case "$use64bitint" in
6063 "$define") echo "64 bit integers selected." >&4 ;;
6065 case "$use64bitall" in
6066 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6069 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6071 *) archname="$archname-$archname64"
6072 echo "...setting architecture name to $archname." >&4
6078 case "$uselongdouble" in
6080 echo "Long doubles selected." >&4
6081 case "$longdblsize" in
6083 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6087 *-ld*) echo "...and architecture name already has -ld." >&4
6089 *) archname="$archname-ld"
6090 echo "...setting architecture name to $archname." >&4
6097 case "$useperlio" in
6099 echo "Perlio selected." >&4
6102 echo "Perlio not selected, using stdio." >&4
6104 *-stdio*) echo "...and architecture name already has -stdio." >&4
6106 *) archname="$archname-stdio"
6107 echo "...setting architecture name to $archname." >&4
6112 if $test -f archname.cbu; then
6113 echo "Your platform has some specific hints for architecture name, using them..."
6117 : set the prefixit variable, to compute a suitable default value
6118 prefixit='case "$3" in
6120 case "$oldprefix" in
6121 "") eval "$1=\"\$$2\"";;
6128 ""|" ") eval "$1=\"\$$2\"";;
6134 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6136 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6137 /*-$oldprefix/*|\~*-$oldprefix/*)
6138 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6139 *) eval "$1=\"\$$2\"";;
6143 : determine installation style
6144 : For now, try to deduce it from prefix unless it is already set.
6145 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6146 case "$installstyle" in
6147 '') case "$prefix" in
6148 *perl*) dflt='lib';;
6149 *) dflt='lib/perl5' ;;
6152 *) dflt="$installstyle" ;;
6154 : Probably not worth prompting for this since we prompt for all
6155 : the directories individually, and the prompt would be too long and
6159 : determine where public executables go
6164 rp='Pathname where the public executables will reside?'
6166 if $test "X$ansexp" != "X$binexp"; then
6170 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6171 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6172 : this via initialinstalllocation
6175 case "$userelocatableinc" in
6176 $define|true|[yY]*) dflt='y' ;;
6181 Would you like to build Perl so that the installation is relocatable, so that
6182 library paths in @INC are determined relative to the path of the perl binary?
6183 This is not advised for system Perl installs, or if you need to run setid
6184 scripts or scripts under taint mode.
6186 If this doesn't make any sense to you, just accept the default '$dflt'.
6188 rp='Use relocatable @INC?'
6191 y|Y) val="$define" ;;
6194 set userelocatableinc
6197 initialinstalllocation="$binexp"
6198 : Default prefix is now "up one level from where the binaries are"
6199 case "$userelocatableinc" in
6205 installprefixexp=".../.."
6209 : determine where private library files go
6210 : Usual default is /usr/local/lib/perl5/$version.
6211 : Also allow things like /opt/perl/lib/$version, since
6212 : /opt/perl/lib/perl5... would be redundant.
6213 : The default "style" setting is made in installstyle.U
6214 case "$installstyle" in
6215 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6216 *) set dflt privlib lib/$version ;;
6221 There are some auxiliary files for $package that need to be put into a
6222 private library directory that is accessible by everyone.
6227 rp='Pathname where the private library files will reside?'
6232 : set the prefixup variable, to restore leading tilda escape
6233 prefixup='case "$prefixexp" in
6235 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6238 : determine where public architecture dependent libraries go
6241 : privlib default is /usr/local/lib/$package/$version
6242 : archlib default is /usr/local/lib/$package/$version/$archname
6243 : privlib may have an optional trailing /share.
6244 tdflt=`echo $privlib | $sed 's,/share$,,'`
6245 tdflt=$tdflt/$archname
6254 $spackage contains architecture-dependent library files. If you are
6255 sharing libraries in a heterogeneous environment, you might store
6256 these files in a separate location. Otherwise, you can just include
6257 them with the rest of the public library files.
6262 rp='Where do you want to put the public architecture-dependent libraries?'
6266 if $test X"$archlib" = X"$privlib"; then
6272 : see if setuid scripts can be secure
6275 Some kernels have a bug that prevents setuid #! scripts from being
6276 secure. Some sites have disabled setuid #! scripts because of this.
6278 First let's decide if your kernel supports secure setuid #! scripts.
6279 (If setuid #! scripts would be secure but have been disabled anyway,
6280 don't say that they are secure if asked.)
6285 if $test -d /dev/fd; then
6286 echo "#!$ls" >reflect
6287 chmod +x,u+s reflect
6288 ./reflect >flect 2>&1
6289 if $contains "/dev/fd" flect >/dev/null; then
6290 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6294 If you are not sure if they are secure, I can check but I'll need a
6295 username and password different from the one you are using right now.
6296 If you don't have such a username or don't want me to test, simply
6300 rp='Other username to test security of setuid scripts with?'
6305 case "$d_suidsafe" in
6306 '') echo "I'll assume setuid scripts are *not* secure." >&4
6309 echo "Well, the $hint value is *not* secure." >&4
6311 *) echo "Well, the $hint value *is* secure." >&4
6316 $rm -f reflect flect
6317 echo "#!$ls" >reflect
6318 chmod +x,u+s reflect
6321 echo '"su" will (probably) prompt you for '"$ans's password."
6322 su $ans -c './reflect >flect'
6323 if $contains "/dev/fd" flect >/dev/null; then
6324 echo "Okay, it looks like setuid scripts are secure." >&4
6327 echo "I don't think setuid scripts are secure." >&4
6332 rp='Does your kernel have *secure* setuid scripts?'
6335 [yY]*) val="$define";;
6340 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6341 echo "(That's for file descriptors, not floppy disks.)"
6347 $rm -f reflect flect
6349 : now see if they want to do setuid emulation
6352 case "$d_suidsafe" in
6355 echo "No need to emulate SUID scripts since they are secure here." >&4
6359 Some systems have disabled setuid scripts, especially systems where
6360 setuid scripts cannot be secure. On systems where setuid scripts have
6361 been disabled, the setuid/setgid bits on scripts are currently
6362 useless. It is possible for $package to detect those bits and emulate
6363 setuid/setgid in a secure fashion. This emulation will only work if
6364 setuid scripts have been disabled in your kernel.
6368 "$define") dflt=y ;;
6371 rp="Do you want to do setuid/setgid emulation?"
6374 [yY]*) val="$define";;
6382 : Find perl5.005 or later.
6383 echo "Looking for a previously installed perl5.005 or later... "
6385 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6386 : Check if this perl is recent and can load a simple module
6387 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6390 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6400 '') echo "None found. That's ok.";;
6401 *) echo "Using $perl5." ;;
6404 : Set the siteprefix variables
6407 After $package is installed, you may wish to install various
6408 add-on modules and utilities. Typically, these add-ons will
6409 be installed under $prefix with the rest
6410 of this package. However, you may wish to install such add-ons
6411 elsewhere under a different prefix.
6413 If you do not wish to put everything under a single prefix, that's
6414 ok. You will be prompted for the individual locations; this siteprefix
6415 is only used to suggest the defaults.
6417 The default should be fine for most people.
6421 rp='Installation prefix to use for add-on modules and utilities?'
6422 : XXX Here might be another good place for an installstyle setting.
6423 case "$siteprefix" in
6425 *) dflt=$siteprefix ;;
6428 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6430 case "$siteprefix" in
6434 *) oldsiteprefix="$prefix";;
6439 siteprefixexp="$ansexp"
6441 : determine where site specific libraries go.
6442 : Usual default is /usr/local/lib/perl5/site_perl/$version
6443 : The default "style" setting is made in installstyle.U
6444 : XXX No longer works with Prefixit stuff.
6445 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6447 '') case "$installstyle" in
6448 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6449 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6457 The installation process will create a directory for
6458 site-specific extensions and modules. Most users find it convenient
6459 to place all site-specific files in this directory rather than in the
6460 main distribution directory.
6464 rp='Pathname for the site-specific library files?'
6468 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6470 : Determine list of previous versions to include in @INC
6471 $cat > getverlist <<EOPL
6474 \$api_versionstring = "$api_versionstring";
6475 \$version = "$version";
6476 \$stem = "$sitelib_stem";
6477 \$archname = "$archname";
6479 $cat >> getverlist <<'EOPL'
6480 # The list found is store twice for each entry: the original name, and
6481 # the binary broken down version as pack "sss", so sorting is easy and
6482 # unambiguous. This will work for all versions that have a maximum of
6483 # three digit groups, separate by '.'s or '_'s. Names are extended with
6484 # ".0.0" to ensure at least three elements for the pack.
6485 # -- H.Merijn Brand (m)'06 23-10-2006
6487 # Can't have leading @ because metaconfig interprets it as a command!
6488 ;@inc_version_list=();
6489 # XXX Redo to do opendir/readdir?
6492 ;@candidates = map {
6493 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6499 ($pversion, $aversion, $vsn5005) = map {
6500 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6501 foreach $d (@candidates) {
6502 if ($d->[1] lt $pversion) {
6503 if ($d->[1] ge $aversion) {
6504 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6506 elsif ($d->[1] ge $vsn5005) {
6507 unshift(@inc_version_list, grep { -d } $d->[0]);
6511 # Skip newer version. I.e. don't look in
6512 # 5.7.0 if we're installing 5.6.1.
6516 if (@inc_version_list) {
6517 print join(' ', @inc_version_list);
6520 # Blank space to preserve value for next Configure run.
6525 case "$inc_version_list" in
6526 '') if test -x "$perl5$exe_ext"; then
6527 dflt=`$perl5 getverlist`
6532 $undef) dflt='none' ;;
6533 *) eval dflt=\"$inc_version_list\" ;;
6536 ''|' ') dflt=none ;;
6543 In order to ease the process of upgrading, this version of perl
6544 can be configured to use modules built and installed with earlier
6545 versions of perl that were installed under $prefix. Specify here
6546 the list of earlier versions that this version of perl should check.
6547 If Configure detected no earlier versions of perl installed under
6548 $prefix, then the list will be empty. Answer 'none' to tell perl
6549 to not search earlier versions.
6551 The default should almost always be sensible, so if you're not sure,
6552 just accept the default.
6555 rp='List of earlier versions to include in @INC?'
6558 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6559 *) inc_version_list="$ans" ;;
6561 case "$inc_version_list" in
6563 inc_version_list_init='0'
6564 d_inc_version_list="$undef"
6566 *) inc_version_list_init=`echo $inc_version_list |
6567 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6568 d_inc_version_list="$define"
6573 : see if malloc/malloc.h has to be included
6574 set malloc/malloc.h i_mallocmalloc
6577 : see if this is a malloc.h system
6578 : we want a real compile instead of Inhdr because some systems have a
6579 : malloc.h that just gives a compile error saying to use stdlib.h instead
6584 #$i_mallocmalloc I_MALLOCMALLOC
6585 #ifdef I_MALLOCMALLOC
6586 # include <malloc/malloc.h>
6589 int main () { return 0; }
6592 if eval $compile; then
6593 echo "<malloc.h> found." >&4
6596 echo "<malloc.h> NOT found." >&4
6603 : check for void type
6605 echo "Checking to see how well your C compiler groks the void type..." >&4
6606 case "$voidflags" in
6618 extern void moo(); /* function returning void */
6619 void (*goo)(); /* ptr to func returning void */
6621 void *hue; /* generic ptr */
6634 int main() { sub(); }
6636 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6637 voidflags=$defvoidused
6638 echo "Good. It appears to support void to the level $package wants.">&4
6639 if $contains warning .out >/dev/null 2>&1; then
6640 echo "However, you might get some warnings that look like this:"
6644 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6645 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6646 echo "It supports 1..."
6647 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6648 echo "It also supports 2..."
6649 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6651 echo "And it supports 4 but not 8 definitely."
6653 echo "It doesn't support 4..."
6654 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6656 echo "But it supports 8."
6659 echo "Neither does it support 8."
6663 echo "It does not support 2..."
6664 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6666 echo "But it supports 4 and 8."
6668 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6670 echo "And it supports 4 but has not heard about 8."
6672 echo "However it supports 8 but not 4."
6677 echo "There is no support at all for void."
6682 case "$voidflags" in
6685 Support flag bits are:
6686 1: basic void declarations.
6687 2: arrays of pointers to functions returning void.
6688 4: operations between pointers to and addresses of void functions.
6689 8: generic void pointers.
6692 rp="Your void support flags add up to what?"
6699 : check for length of pointer
6703 echo "Checking to see how big your pointers are..." >&4
6704 if test "$voidflags" -gt 7; then
6705 echo '#define VOID_PTR char *' > try.c
6707 echo '#define VOID_PTR void *' > try.c
6717 printf("%d\n", (int)sizeof(VOID_PTR));
6722 if eval $compile_ok; then
6723 ptrsize=`$run ./try`
6724 echo "Your pointers are $ptrsize bytes long."
6727 echo "(I can't seem to compile the test program. Guessing...)" >&4
6728 rp="What is the size of a pointer (in bytes)?"
6735 case "$use64bitall" in
6736 "$define"|true|[yY]*)
6740 *** You have chosen a maximally 64-bit build,
6741 *** but your pointers are only 4 bytes wide.
6742 *** Please rerun Configure without -Duse64bitall.
6747 *** Since you have quads, you could possibly try with -Duse64bitint.
6752 *** Cannot continue, aborting.
6763 : determine whether to use malloc wrapping
6765 case "$usemallocwrap" in
6766 [yY]*|true|$define) dflt='y' ;;
6767 [nN]*|false|$undef) dflt='n' ;;
6768 *) case "$usedevel" in
6769 [yY]*|true|$define) dflt='y' ;;
6774 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6776 usemallocwrap="$ans"
6779 usemallocwrap="$define" ;;
6781 usemallocwrap="$undef" ;;
6784 : determine which malloc to compile in
6786 case "$usemymalloc" in
6787 [yY]*|true|$define) dflt='y' ;;
6788 [nN]*|false|$undef) dflt='n' ;;
6789 *) case "$ptrsize" in
6795 rp="Do you wish to attempt to use the malloc that comes with $package?"
6801 mallocsrc='malloc.c'
6802 mallocobj="malloc$_o"
6803 d_mymalloc="$define"
6806 : Remove malloc from list of libraries to use
6807 echo "Removing unneeded -lmalloc from library list" >&4
6808 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6811 echo "libs = $libs" >&4
6823 : compute the return types of malloc and free
6825 $cat >malloc.c <<END
6829 #include <sys/types.h>
6843 case "$malloctype" in
6845 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6852 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6856 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6863 echo "Your system uses $freetype free(), it would seem." >&4
6865 : determine where site specific architecture-dependent libraries go.
6866 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6867 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6868 : sitelib may have an optional trailing /share.
6870 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6871 dflt="$dflt/$archname"
6876 set sitearch sitearch none
6880 The installation process will also create a directory for
6881 architecture-dependent site-specific extensions and modules.
6885 rp='Pathname for the site-specific architecture-dependent library files?'
6889 if $test X"$sitearch" = X"$sitelib"; then
6892 d_sitearch="$define"
6895 : Set the vendorprefix variables
6898 The installation process will also create a directory for
6899 vendor-supplied add-ons. Vendors who supply perl with their system
6900 may find it convenient to place all vendor-supplied files in this
6901 directory rather than in the main distribution directory. This will
6902 ease upgrades between binary-compatible maintenance versions of perl.
6904 Of course you may also use these directories in whatever way you see
6905 fit. For example, you might use them to access modules shared over a
6906 company-wide network.
6908 The default answer should be fine for most people.
6909 This causes further questions about vendor add-ons to be skipped
6910 and no vendor-specific directories will be configured for perl.
6913 rp='Do you want to configure vendor-specific add-on directories?'
6914 case "$usevendorprefix" in
6915 define|true|[yY]*) dflt=y ;;
6916 *) : User may have set vendorprefix directly on Configure command line.
6917 case "$vendorprefix" in
6926 rp='Installation prefix to use for vendor-supplied add-ons?'
6927 case "$vendorprefix" in
6929 *) dflt=$vendorprefix ;;
6932 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6934 case "$vendorprefix" in
6938 *) oldvendorprefix="$prefix";;
6942 usevendorprefix="$define"
6944 vendorprefixexp="$ansexp"
6946 *) usevendorprefix="$undef"
6952 : Set the vendorlib variables
6953 case "$vendorprefix" in
6954 '') d_vendorlib="$undef"
6958 *) d_vendorlib="$define"
6959 : determine where vendor-supplied modules go.
6960 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6961 case "$vendorlib" in
6963 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6964 case "$installstyle" in
6965 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6966 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6969 *) dflt="$vendorlib"
6973 rp='Pathname for the vendor-supplied library files?'
6976 vendorlibexp="$ansexp"
6979 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6983 : Set the vendorarch variables
6984 case "$vendorprefix" in
6985 '') d_vendorarch="$undef"
6989 *) d_vendorarch="$define"
6990 : determine where vendor-supplied architecture-dependent libraries go.
6991 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6992 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6993 : vendorlib may have an optional trailing /share.
6994 case "$vendorarch" in
6995 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6996 dflt="$dflt/$archname"
6998 *) dflt="$vendorarch" ;;
7001 rp='Pathname for vendor-supplied architecture-dependent files?'
7004 vendorarchexp="$ansexp"
7007 prefixvar=vendorarch
7010 : Final catch-all directories to search
7013 Lastly, you can have perl look in other directories for extensions and
7014 modules in addition to those already specified.
7015 These directories will be searched after
7019 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7020 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7022 case "$otherlibdirs" in
7023 ''|' ') dflt='none' ;;
7024 *) dflt="$otherlibdirs" ;;
7027 Enter a colon-separated set of extra paths to include in perl's @INC
7028 search path, or enter 'none' for no extra paths.
7032 rp='Colon-separated list of additional directories for perl to search?'
7035 ' '|''|none) otherlibdirs=' ' ;;
7036 *) otherlibdirs="$ans" ;;
7038 case "$otherlibdirs" in
7042 set d_perl_otherlibdirs
7045 : Cruising for prototypes
7047 echo "Checking out function prototypes..." >&4
7048 $cat >prototype.c <<EOCP
7053 int main(int argc, char *argv[]) {
7056 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7057 echo "Your C compiler appears to support function prototypes."
7060 echo "Your C compiler doesn't seem to understand function prototypes."
7067 : Check if ansi2knr is required
7068 case "$prototype" in
7070 *) ansi2knr='ansi2knr'
7075 This version of $package can only be compiled by a compiler that
7076 understands function prototypes. Unfortunately, your C compiler
7078 doesn't seem to understand them. Sorry about that.
7080 If GNU cc is available for your system, perhaps you could try that instead.
7082 Eventually, we hope to support building Perl with pre-ANSI compilers.
7083 If you would like to help in that effort, please contact <perlbug@perl.org>.
7085 Aborting Configure now.
7092 dflt_dtrace='/usr/sbin/dtrace'
7095 Perl can be built to support DTrace on platforms that support it.
7096 DTrace is a diagnosis and performance analysis tool from Sun.
7098 If this doesn't make any sense to you, just accept the default '$dflt'.
7102 case "$usedtrace" in
7108 dflt_dtrace=$usedtrace
7115 rp='Support DTrace if available?'
7118 y|Y) val="$define" ;;
7124 test "X$usedtrace" != "X$define" && break
7127 rp='Where is the dtrace executable?'
7136 if $dtrace -h -s ../perldtrace.d \
7137 -o perldtrace.tmp >/dev/null 2>&1 \
7138 && rm -f perldtrace.tmp
7141 echo "Good: your $dtrace knows about the -h flag."
7145 *** $me: Fatal Error: $dtrace doesn't support -h flag
7147 *** Your installed dtrace doesn't support the -h switch to compile a D
7148 *** program into a C header. Can't continue.
7160 *** $me: Fatal Error: $dtrace not found.
7167 echo "*** $dtrace was not found."
7173 : See if we want extra modules installed
7180 Perl can be built with extra modules or bundles of modules which
7181 will be fetched from the CPAN and installed alongside Perl.
7183 Notice that you will need access to the CPAN; either via the Internet,
7184 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7185 be asked later to configure the CPAN.pm module which will in turn do
7186 the installation of the rest of the extra modules or bundles.)
7188 Notice also that if the modules require any external software such as
7189 libraries and headers (the libz library and the zlib.h header for the
7190 Compress::Zlib module, for example) you MUST have any such software
7191 already installed, this configuration process will NOT install such
7194 If this doesn't make any sense to you, just accept the default '$dflt'.
7196 rp='Install any extra modules (y or n)?'
7202 Please list any extra modules or bundles to be installed from CPAN,
7203 with spaces between the names. The names can be in any format the
7204 'install' command of CPAN.pm will understand. (Answer 'none',
7205 without the quotes, to install no extra modules or bundles.)
7215 $rm -f ../extras.lst
7217 *) echo "(Saving the list of extras for later...)"
7218 echo "$extras" > ../extras.lst
7226 : determine where html pages for programs go
7227 set html1dir html1dir none
7231 If you wish to install html files for programs in $spackage, indicate
7232 the appropriate directory here. To skip installing html files,
7236 ''|none|$undef|' ') dflt=none ;;
7237 *) dflt=$html1dir ;;
7240 rp="Directory for the main $spackage html pages?"
7244 : Use ' ' for none so value is preserved next time through Configure
7245 $test X"$html1dir" = "X" && html1dir=' '
7247 : determine where html pages for libraries and modules go
7248 set html3dir html3dir none
7252 If you wish to install html files for modules associated with $spackage,
7253 indicate the appropriate directory here. To skip installing html files,
7256 : There is no obvious default. If they have specified html1dir, then
7257 : try to key off that, possibly changing .../html1 into .../html3.
7259 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7260 *) dflt=$html3dir ;;
7263 rp="Directory for the $spackage module html pages?"
7267 : Use ' ' for none so value is preserved next time through Configure
7268 $test X"$html3dir" = "X" && html3dir=' '
7270 : determine whether to install perl also as /usr/bin/perl
7273 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7275 Many scripts expect perl to be installed as /usr/bin/perl.
7277 If you want to, I can install the perl you are about to compile
7278 as /usr/bin/perl (in addition to $bin/perl).
7280 if test -f /usr/bin/perl; then
7283 However, please note that because you already have a /usr/bin/perl,
7284 overwriting that with a new Perl would very probably cause problems.
7285 Therefore I'm assuming you don't want to do that (unless you insist).
7288 case "$installusrbinperl" in
7289 "$define"|[yY]*) dflt='y';;
7295 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7298 case "$installusrbinperl" in
7299 "$undef"|[nN]*) dflt='n';;
7303 rp="Do you want to install perl as /usr/bin/perl?"
7306 [yY]*) val="$define";;
7312 set installusrbinperl
7315 : Check if we are using the GNU C library
7317 echo "Checking for GNU C Library..." >&4
7319 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7320 alone are insufficient to distinguish different versions, such as
7321 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7322 libc version 2.1.0. A. Dougherty, June 3, 2002.
7328 # ifdef __GLIBC_MINOR__
7329 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7330 # include <gnu/libc-version.h>
7331 printf("%s\n", gnu_get_libc_version());
7333 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7336 printf("%d\n", __GLIBC__);
7345 if eval $compile_ok && $run ./try > glibc.ver; then
7347 gnulibc_version=`$cat glibc.ver`
7348 echo "You are using the GNU C Library version $gnulibc_version"
7352 echo "You are not using the GNU C Library"
7358 : see if nm is to be used to determine whether a symbol is defined or not
7362 case "$d_gnulibc" in
7365 echo "nm probably won't work on the GNU C Library." >&4
7371 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7373 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7374 echo "'nm' won't be sufficient on this sytem." >&4
7380 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7381 if $test $dflt -gt 20; then
7391 true|$define) dflt=y;;
7398 I can use $nm to extract the symbols from your C libraries. This
7399 is a time consuming task which may generate huge output on the disk (up
7400 to 3 megabytes) but that should make the symbols extraction faster. The
7401 alternative is to skip the 'nm' extraction part and to compile a small
7402 test program instead to determine whether each symbol is present. If
7403 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7404 this may be the best solution.
7406 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7409 rp="Shall I use $nm to extract C symbols from the libraries?"
7412 [Nn]*) usenm=false;;
7421 : nm options which may be necessary
7423 '') if $test -f /mach_boot; then
7425 elif $test -d /usr/ccs/lib; then
7426 nm_opt='-p' # Solaris (and SunOS?)
7427 elif $test -f /dgux; then
7429 elif $test -f /lib64/rld; then
7430 nm_opt='-p' # 64-bit Irix
7436 : nm options which may be necessary for shared libraries but illegal
7437 : for archive libraries. Thank you, Linux.
7438 case "$nm_so_opt" in
7439 '') case "$myuname" in
7441 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7442 nm_so_opt='--dynamic'
7449 : Figure out where the libc is located
7452 : get list of predefined functions in a handy place
7457 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7463 *) for thislib in $libs; do
7466 : Handle C library specially below.
7469 thislib=`echo $thislib | $sed -e 's/^-l//'`
7470 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7472 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7474 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7476 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7478 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7480 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7482 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7487 libnames="$libnames $try"
7489 *) libnames="$libnames $thislib" ;;
7498 for xxx in $libpth; do
7499 $test -r $1 || set $xxx/libc.$so
7500 : The messy sed command sorts on library version numbers.
7502 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7503 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7505 s/[0-9][0-9]*/0000&/g
7506 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7509 $sort | $sed -e 's/^.* //'`
7512 $test -r $1 || set /usr/ccs/lib/libc.$so
7513 $test -r $1 || set /lib/libsys_s$_a
7519 if $test -r "$1"; then
7520 echo "Your (shared) C library seems to be in $1."
7522 elif $test -r /lib/libc && $test -r /lib/clib; then
7523 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7525 libc='/lib/clib /lib/libc'
7526 if $test -r /lib/syslib; then
7527 echo "(Your math library is in /lib/syslib.)"
7528 libc="$libc /lib/syslib"
7530 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7531 echo "Your C library seems to be in $libc, as you said before."
7532 elif $test -r $incpath/usr/lib/libc$_a; then
7533 libc=$incpath/usr/lib/libc$_a;
7534 echo "Your C library seems to be in $libc. That's fine."
7535 elif $test -r /lib/libc$_a; then
7537 echo "Your C library seems to be in $libc. You're normal."
7539 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7541 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7542 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7543 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7545 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7547 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7550 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7552 if $test -r "$tans"; then
7553 echo "Your C library seems to be in $tans, of all places."
7559 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7563 If the guess above is wrong (which it might be if you're using a strange
7564 compiler, or your machine supports multiple models), you can override it here.
7569 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7571 I can't seem to find your C library. I've looked in the following places:
7574 $sed 's/^/ /' libpath
7577 None of these seems to contain your C library. I need to get its name...
7582 rp='Where is your C library?'
7587 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7588 set X `cat libnames`
7591 case $# in 1) xxx=file; esac
7592 echo "Extracting names from the following $xxx for later perusal:" >&4
7594 $sed 's/^/ /' libnames >&4
7596 $echo $n "This may take a while...$c" >&4
7600 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7601 *) $nm $nm_opt $file 2>/dev/null;;
7606 $grep fprintf libc.tmp > libc.ptf
7607 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7608 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7610 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7612 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7614 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7616 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7618 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7620 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7622 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7624 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7626 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7628 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7630 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7632 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7634 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7635 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7639 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7643 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7645 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7647 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7649 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7651 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7653 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7655 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7657 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7659 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7661 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7663 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7665 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7668 $nm -p $* 2>/dev/null >libc.tmp
7669 $grep fprintf libc.tmp > libc.ptf
7670 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7671 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7677 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7679 if $ar t $libc > libc.tmp && \
7680 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7682 for thisname in $libnames $libc; do
7683 $ar t $thisname >>libc.tmp
7685 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7687 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7688 for thisname in $libnames $libc; do
7689 $ar tv $thisname >>libc.tmp
7690 emximp -o tmp.imp $thisname \
7692 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7693 < tmp.imp >>libc.tmp
7696 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7699 echo "$ar didn't seem to work right." >&4
7700 echo "Maybe this is a Cray...trying bld instead..." >&4
7702 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7705 for thisname in $libnames; do
7707 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7708 $ar t $thisname >>libc.tmp
7712 echo "That didn't work either. Giving up." >&4
7722 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7723 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7725 *) if $test -f /lib/syscalls.exp; then
7727 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7728 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7729 /lib/syscalls.exp >>libc.list
7735 $rm -f libnames libpath
7737 : see if dld is available
7741 : Check if we are using C++
7743 echo "Checking for C++..." >&4
7744 $cat >try.c <<'EOCP'
7756 if eval $compile_ok && $run ./try; then
7758 echo "You are using a C++ compiler."
7761 echo "You are not using a C++ compiler."
7767 : is a C symbol defined?
7770 -v) tf=libc.tmp; tdc="";;
7771 -a) tf=libc.tmp; tdc="[]";;
7772 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7775 case "$reuseval-$4" in
7777 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7782 case "$d_cplusplus" in
7783 $define) extern_C=\"C\";;
7785 if $test "$runnm" = true; then
7786 if $contains $tlook $tf >/dev/null 2>&1; then
7788 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7789 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7790 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7791 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7795 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7796 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7802 $define) tval=true;;
7809 : define an is-in-libc? function
7810 inlibc='echo " "; td=$define; tu=$undef;
7811 sym=$1; var=$2; eval "was=\$$2";
7813 case "$reuseval$was" in
7823 echo "$sym() found." >&4;
7824 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7826 echo "$sym() NOT found." >&4;
7827 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7831 $define) echo "$sym() found." >&4;;
7832 *) echo "$sym() NOT found." >&4;;
7836 : see if dlopen exists
7838 xxx_ccflags="$ccflags"
7840 : with g++ one needs -shared to get is-in-libc to work for dlopen
7841 case "$gccversion" in
7843 *) case "$d_cplusplus" in
7844 "$define") ccflags="$ccflags -shared" ;;
7851 ccflags="$xxx_ccflags"
7853 : see if this is a unistd.h system
7854 set unistd.h i_unistd
7857 : determine which dynamic loading, if any, to compile in
7859 dldir="ext/DynaLoader"
7872 $define) dflt='y' ;;
7875 $define) dflt='y' ;;
7877 : Does a dl_xxx.xs file exist for this operating system
7878 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7881 rp="Do you wish to use dynamic loading?"
7888 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7889 dflt="$dldir/dl_${osname}.xs"
7890 elif $test "$d_dlopen" = "$define" ; then
7891 dflt="$dldir/dl_dlopen.xs"
7892 elif $test "$i_dld" = "$define" ; then
7893 dflt="$dldir/dl_dld.xs"
7898 *) dflt="$dldir/$dlsrc"
7901 echo "The following dynamic loading files are available:"
7902 : Can not go over to $dldir because getfile has path hard-coded in.
7903 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7904 rp="Source file to use for dynamic loading"
7910 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7914 Some systems may require passing special flags to $cc -c to
7915 compile modules that will be used to create a shared library.
7916 To use no flags, say "none".
7919 case "$cccdlflags" in
7920 '') case "$gccversion" in
7921 '') case "$osname" in
7923 next) dflt='none' ;;
7924 irix*) dflt='-KPIC' ;;
7925 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7926 sunos) dflt='-pic' ;;
7930 *) case "$osname" in
7931 darwin) dflt='none' ;;
7932 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7937 *) dflt="$cccdlflags" ;;
7939 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7942 none) cccdlflags=' ' ;;
7943 *) cccdlflags="$ans" ;;
7948 Some systems use ld to create libraries that can be dynamically loaded,
7949 while other systems (such as those using ELF) use $cc.
7953 '') $cat >try.c <<EOM
7954 /* Test for whether ELF binaries are produced */
7966 int i = open("a.out",O_RDONLY);
7969 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7970 exit(0); /* succeed (yes, it's ELF) */
7975 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7977 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7981 echo "I'll use ld to build dynamic libraries."
7990 rp="What command should be used to create dynamic libraries?"
7996 Some systems may require passing special flags to $ld to create a
7997 library that can be dynamically loaded. If your ld flags include
7998 -L/other/path options to locate libraries outside your loader's normal
7999 search path, you may need to specify those -L options here as well. To
8000 use no flags, say "none".
8003 case "$lddlflags" in
8004 '') case "$osname" in
8005 beos) dflt='-nostart' ;;
8007 case "$gccversion" in
8008 '') dflt="$dflt +vnocompatwarnings" ;;
8011 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8012 next) dflt='none' ;;
8013 solaris) dflt='-G' ;;
8014 sunos) dflt='-assert nodefinitions' ;;
8015 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8019 *) dflt="$lddlflags" ;;
8022 : Try to guess additional flags to pick up local libraries.
8023 : Be careful not to append to a plain 'none'
8027 for thisflag in $ldflags; do
8032 *) dflt="$dflt $thisflag" ;;
8039 ''|' ') dflt='none' ;;
8043 *-fstack-protector*)
8045 *-fstack-protector*) ;; # Don't add it again
8046 *) dflt="$dflt -fstack-protector" ;;
8052 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8055 none) lddlflags=' ' ;;
8056 *) lddlflags="$ans" ;;
8061 Some systems may require passing special flags to $cc to indicate that
8062 the resulting executable will use dynamic linking. To use no flags,
8066 case "$ccdlflags" in
8067 '') case "$osname" in
8068 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8069 next|sunos) dflt='none' ;;
8073 *) dflt="$ccdlflags" ;;
8075 rp="Any special flags to pass to $cc to use dynamic linking?"
8078 none) ccdlflags=' ' ;;
8079 *) ccdlflags="$ans" ;;
8090 : Do we want a shared libperl?
8094 # No dynamic loading being used, so don't bother even to prompt.
8097 *) case "$useshrplib" in
8098 '') case "$osname" in
8099 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8101 also='Building a shared libperl is required for dynamic loading to work on your system.'
8106 also='Building a shared libperl is needed for MAB support.'
8124 The perl executable is normally obtained by linking perlmain.c with
8125 libperl${_a}, any static extensions (usually just DynaLoader), and
8126 any other libraries needed on this system (such as -lm, etc.). Since
8127 your system supports dynamic loading, it is probably possible to build
8128 a shared libperl.$so. If you will have more than one executable linked
8129 to libperl.$so, this will significantly reduce the size of each
8130 executable, but it may have a noticeable effect on performance. The
8131 default is probably sensible for your system.
8135 rp="Build a shared libperl.$so (y/n)"
8139 useshrplib='true' ;;
8140 *) useshrplib='false' ;;
8145 case "$useshrplib" in
8149 # Figure out a good name for libperl.so. Since it gets stored in
8150 # a version-specific architecture-dependent library, the version
8151 # number isn't really that important, except for making cc/ld happy.
8153 # A name such as libperl.so.3.1
8154 majmin="libperl.$so.$patchlevel.$subversion"
8155 # A name such as libperl.so.301
8156 majonly=`echo $patchlevel $subversion |
8157 $awk '{printf "%d%02d", $1, $2}'`
8158 majonly=libperl.$so.$majonly
8159 # I'd prefer to keep the os-specific stuff here to a minimum, and
8160 # rely on figuring it out from the naming of libc.
8161 case "${osname}${osvers}" in
8164 # XXX How handle the --version stuff for MAB?
8166 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8169 cygwin*) # ld links against an importlib
8170 dflt=libperl$lib_ext
8172 *) # Try to guess based on whether libc has major.minor.
8174 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8175 *libc.$so.[0-9]*) dflt=$majonly ;;
8176 *) dflt=libperl.$so ;;
8186 I need to select a good name for the shared libperl. If your system uses
8187 library names with major and minor numbers, then you might want something
8188 like $majmin. Alternatively, if your system uses a single version
8189 number for shared libraries, then you might want to use $majonly.
8190 Or, your system might be quite happy with a simple libperl.$so.
8192 Since the shared libperl will get installed into a version-specific
8193 architecture-dependent directory, the version number of the shared perl
8194 library probably isn't important, so the default should be o.k.
8197 rp='What name do you want to give to the shared libperl?'
8200 echo "Ok, I'll use $libperl"
8203 libperl="libperl${_a}"
8207 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8211 WARNING: Use of the shrpdir variable for the installation location of
8212 the shared $libperl is not supported. It was never documented and
8213 will not work in this version. Let me (perlbug@perl.org)
8214 know of any problems this may cause.
8220 But your current setting of $shrpdir is
8221 the default anyway, so it's harmless.
8226 Further, your current attempted setting of $shrpdir
8227 conflicts with the value of $archlibexp/CORE
8228 that installperl will use.
8235 # How will the perl executable find the installed shared $libperl?
8236 # Add $xxx to ccdlflags.
8237 # If we can't figure out a command-line option, use $shrpenv to
8238 # set env LD_RUN_PATH. The main perl makefile uses this.
8239 shrpdir=$archlibexp/CORE
8242 if "$useshrplib"; then
8245 # We'll set it in Makefile.SH...
8250 freebsd|netbsd|openbsd|interix|dragonfly)
8251 xxx="-Wl,-R$shrpdir"
8253 bsdos|linux|irix*|dec_osf|gnu*)
8254 xxx="-Wl,-rpath,$shrpdir"
8257 # next doesn't like the default...
8260 # beos doesn't like the default, either.
8263 # hpux doesn't like the default, either.
8264 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8267 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8273 # Only add $xxx if it isn't already in ccdlflags.
8274 case " $ccdlflags " in
8276 *) ccdlflags="$ccdlflags $xxx"
8279 Adding $xxx to the flags
8280 passed to $ld so that the perl executable will find the
8281 installed shared $libperl.
8289 # Fix ccdlflags in AIX for building external extensions.
8290 # (For building Perl itself bare -bE:perl.exp is needed,
8291 # Makefile.SH takes care of this.)
8293 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8295 # Respect a hint or command-line value.
8297 '') shrpenv="$tmp_shrpenv" ;;
8299 case "$ldlibpthname" in
8300 '') ldlibpthname=LD_LIBRARY_PATH ;;
8301 none) ldlibpthname='' ;;
8304 : determine where manual pages are on this system
8308 syspath='/usr/share/man/man1 /usr/man/man1'
8309 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8310 syspath="$syspath /usr/man/u_man/man1"
8311 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8312 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8313 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8314 sysman=`./loc . /usr/man/man1 $syspath`
8317 if $test -d "$sysman"; then
8318 echo "System manual is in $sysman." >&4
8320 echo "Could not find manual pages in source form." >&4
8323 : determine where manual pages go
8324 set man1dir man1dir none
8328 $spackage has manual pages available in source form.
8332 echo "However, you don't have nroff, so they're probably useless to you."
8334 '') man1dir="none";;
8337 echo "If you don't want the manual sources installed, answer 'none'."
8342 lookpath="$prefixexp/share/man/man1"
8343 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8344 lookpath="$lookpath $prefixexp/man/p_man/man1"
8345 lookpath="$lookpath $prefixexp/man/u_man/man1"
8346 lookpath="$lookpath $prefixexp/man/man.1"
8348 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8349 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8359 rp="Where do the main $spackage manual pages (source) go?"
8361 if $test "X$man1direxp" != "X$ansexp"; then
8372 : What suffix to use on installed man pages
8379 rp="What suffix should be used for the main $spackage man pages?"
8381 '') case "$man1dir" in
8395 *) dflt="$man1ext";;
8402 : see if we can have long filenames
8404 first=123456789abcdef
8406 if (echo hi >$first) 2>/dev/null; then
8407 if $test -f 123456789abcde; then
8408 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8411 echo 'You can have filenames longer than 14 characters.'>&4
8416 You can't have filenames longer than 14 chars.
8417 You can't even think about them!
8423 $rm -rf 123456789abcde*
8425 : determine where library module manual pages go
8426 set man3dir man3dir none
8430 $spackage has manual pages for many of the library modules.
8436 However, you don't have nroff, so they're probably useless to you.
8439 '') man3dir="none";;
8443 case "$d_flexfnam" in
8446 However, your system can't handle the long file names like File::Basename.3.
8449 '') man3dir="none";;
8453 echo "If you don't want the manual sources installed, answer 'none'."
8454 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8456 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8457 if $test -d "$privlib/man/man3"; then
8460 WARNING: Previous versions of perl installed man3 pages into
8461 $privlib/man/man3. This version will suggest a
8462 new default of $dflt.
8466 rp='Do you wish to preserve the old behavior?(y/n)'
8469 y*) dflt="$privlib/man/man3" ;;
8474 *) dflt="$man3dir" ;;
8481 rp="Where do the $package library man pages (source) go?"
8491 : What suffix to use on installed man pages
8497 rp="What suffix should be used for the $package library man pages?"
8499 '') case "$man3dir" in
8513 *) dflt="$man3ext";;
8520 : see if we have to deal with yellow pages, now NIS.
8521 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8522 if $test -f /usr/etc/nibindd; then
8524 echo "I'm fairly confident you're on a NeXT."
8526 rp='Do you get the hosts file via NetInfo?'
8535 y*) hostcat='nidump hosts .';;
8536 *) case "$hostcat" in
8537 nidump*) hostcat='';;
8547 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8555 rp='Are you getting the hosts file via yellow pages?'
8558 y*) hostcat='ypcat hosts';;
8559 *) hostcat='cat /etc/hosts';;
8565 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8568 '') test -f /etc/group && groupcat='cat /etc/group';;
8571 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8574 : now get the host name
8576 echo "Figuring out host name..." >&4
8577 case "$myhostname" in
8579 echo 'Maybe "hostname" will work...'
8580 if tans=`sh -c hostname 2>&1` ; then
8588 if $test "$cont"; then
8590 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8591 if tans=`cat /etc/systemid 2>&1` ; then
8593 phostname='cat /etc/systemid'
8594 echo "Whadyaknow. Xenix always was a bit strange..."
8597 elif $test -r /etc/systemid; then
8598 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8601 if $test "$cont"; then
8602 echo 'No, maybe "uuname -l" will work...'
8603 if tans=`sh -c 'uuname -l' 2>&1` ; then
8605 phostname='uuname -l'
8607 echo 'Strange. Maybe "uname -n" will work...'
8608 if tans=`sh -c 'uname -n' 2>&1` ; then
8610 phostname='uname -n'
8612 echo 'Oh well, maybe I can mine it out of whoami.h...'
8613 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8614 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8615 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8617 case "$myhostname" in
8618 '') echo "Does this machine have an identity crisis or something?"
8621 echo "Well, you said $myhostname before..."
8622 phostname='echo $myhostname';;
8628 case "$myhostname" in
8629 '') myhostname=noname ;;
8631 : you do not want to know about this
8636 if $test "$myhostname" ; then
8638 rp='Your host name appears to be "'$myhostname'".'" Right?"
8646 : bad guess or no guess
8647 while $test "X$myhostname" = X ; do
8649 rp="Please type the (one word) name of your host:"
8654 : translate upper to lower if necessary
8655 case "$myhostname" in
8657 echo "(Normalizing case in your host name)"
8658 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8662 case "$myhostname" in
8664 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8665 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8666 echo "(Trimming domain name from host name--host name is now $myhostname)"
8668 *) case "$mydomain" in
8671 test "X$hostcat" = "Xypcat hosts" &&
8672 ypmatch "$myhostname" hosts 2>/dev/null |\
8673 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8676 test "X$hostcat" != "X" &&
8677 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8678 /[ ]$myhostname[ . ]/p" > hosts
8681 if $test -f hosts; then
8682 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8683 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8684 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8685 hosts | $sort | $uniq | \
8686 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8687 case `$echo X$dflt` in
8688 X*\ *) echo "(Several hosts in the database matched hostname)"
8691 X.) echo "(You do not have fully-qualified names in the hosts database)"
8695 echo "(I cannot locate a hosts database anywhere)"
8700 tans=`./loc resolv.conf X /etc /usr/etc`
8701 if $test -f "$tans"; then
8702 echo "(Attempting domain name extraction from $tans)"
8703 dflt=.`$sed -n -e 's/ / /g' \
8704 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8705 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8707 .) dflt=.`$sed -n -e 's/ / /g' \
8708 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8709 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8716 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8717 dflt=.`sh -c domainname 2>/dev/null`
8720 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8724 case "$dflt$osname" in
8725 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8726 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8730 .) echo "(Lost all hope -- silly guess then)"
8736 *) dflt="$mydomain";;
8740 rp="What is your domain name?"
8750 : translate upper to lower if necessary
8753 echo "(Normalizing case in your domain name)"
8754 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8758 : a little sanity check here
8759 case "$phostname" in
8762 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8763 $myhostname$mydomain|$myhostname) ;;
8765 case "$phostname" in
8767 echo "(That doesn't agree with your whoami.h file, by the way.)"
8770 echo "(That doesn't agree with your $phostname command, by the way.)"
8778 : determine the e-mail address of the user who is running us
8781 I need to get your e-mail address in Internet format if possible, i.e.
8782 something like user@host.domain. Please answer accurately since I have
8783 no easy means to double check it. The default value provided below
8784 is most probably close to reality but may not be valid from outside
8785 your organization...
8789 while test "$cont"; do
8791 '') dflt="$cf_by@$myhostname$mydomain";;
8792 *) dflt="$cf_email";;
8794 rp='What is your e-mail address?'
8800 rp='Address does not look like an Internet one. Use it anyway?'
8814 : Ask e-mail of administrator
8817 If you or somebody else will be maintaining perl at your site, please
8818 fill in the correct e-mail address here so that they may be contacted
8819 if necessary. Currently, the "perlbug" program included with perl
8820 will send mail to this address in addition to perlbug@perl.org. You may
8821 enter "none" for no administrator.
8824 case "$perladmin" in
8825 '') dflt="$cf_email";;
8826 *) dflt="$perladmin";;
8828 rp='Perl administrator e-mail address'
8832 : determine whether to only install version-specific parts.
8835 Do you want to install only the version-specific parts of the perl
8836 distribution? Usually you do *not* want to do this.
8838 case "$versiononly" in
8839 "$define"|[Yy]*|true) dflt='y' ;;
8842 rp="Do you want to install only the version-specific parts of perl?"
8845 [yY]*) val="$define";;
8851 case "$versiononly" in
8852 "$define") inc_version_list=''
8853 inc_version_list_init=0
8857 : figure out how to guarantee perl startup
8858 : XXX Note that this currently takes advantage of the bug that binexp ignores
8859 : the Configure -Dinstallprefix setting, which in turn means that under
8860 : relocatable @INC, initialinstalllocation is what binexp started as.
8861 case "$startperl" in
8863 case "$sharpbang" in
8867 I can use the #! construct to start perl on your system. This will
8868 make startup of perl scripts faster, but may cause problems if you
8869 want to share those scripts and perl is not in a standard place
8870 ($initialinstalllocation/perl) on all your platforms. The alternative
8871 is to force a shell by starting the script with a single ':' character.
8874 case "$versiononly" in
8875 "$define") dflt="$initialinstalllocation/perl$version";;
8876 *) dflt="$initialinstalllocation/perl";;
8878 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8881 none) startperl=": # use perl";;
8882 *) startperl="#!$ans"
8883 if $test 30 -lt `echo "$ans" | wc -c`; then
8886 WARNING: Some systems limit the #! command to 32 characters.
8887 If you experience difficulty running Perl scripts with #!, try
8888 installing Perl in a directory with a shorter pathname.
8894 *) startperl=": # use perl"
8899 echo "I'll use $startperl to start perl scripts."
8901 : figure best path for perl in scripts
8904 case "$versiononly" in
8905 "$define") perlpath="$initialinstalllocation/perl$version";;
8906 *) perlpath="$initialinstalllocation/perl";;
8908 case "$startperl" in
8913 I will use the "eval 'exec'" idiom to start Perl on your system.
8914 I can use the full path of your Perl binary for this purpose, but
8915 doing so may cause problems if you want to share those scripts and
8916 Perl is not always in a standard place ($initialinstalllocation/perl).
8919 dflt="$initialinstalllocation/perl"
8920 rp="What path shall I use in \"eval 'exec'\"?"
8927 case "$startperl" in
8929 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8932 : determine where public executable scripts go
8933 set scriptdir scriptdir
8935 case "$scriptdir" in
8938 : guess some guesses
8939 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8940 $test -d /usr/share/bin && dflt=/usr/share/bin
8941 $test -d /usr/local/script && dflt=/usr/local/script
8942 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8943 $test -d $prefixexp/script && dflt=$prefixexp/script
8947 *) dflt="$scriptdir"
8952 Some installations have a separate directory just for executable scripts so
8953 that they can mount it across multiple architectures but keep the scripts in
8954 one spot. You might, for example, have a subdirectory of /usr/share for this.
8955 Or you might just lump your scripts in with all your other executables.
8959 rp='Where do you keep publicly executable scripts?'
8961 if $test "X$ansexp" != "X$scriptdirexp"; then
8967 : A little fix up for an irregularly named variable.
8968 installscript="$installscriptdir"
8970 : determine where add-on public executables go
8972 '') dflt=$siteprefix/bin ;;
8976 rp='Pathname where the add-on public executables should be installed?'
8981 : determine where add-on html pages go
8982 : There is no standard location, so try to copy the previously-selected
8983 : directory structure for the core html pages.
8984 case "$sitehtml1dir" in
8985 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8986 *) dflt=$sitehtml1dir ;;
8989 ''|' ') dflt=none ;;
8992 rp='Pathname where the site-specific html pages should be installed?'
8994 prefixvar=sitehtml1dir
8997 : determine where add-on library html pages go
8998 : There is no standard location, so try to copy the previously-selected
8999 : directory structure for the core html pages.
9000 case "$sitehtml3dir" in
9001 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9002 *) dflt=$sitehtml3dir ;;
9005 ''|' ') dflt=none ;;
9008 rp='Pathname where the site-specific library html pages should be installed?'
9010 prefixvar=sitehtml3dir
9013 : determine where add-on manual pages go
9014 case "$siteman1dir" in
9015 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9016 *) dflt=$siteman1dir ;;
9019 ''|' ') dflt=none ;;
9022 rp='Pathname where the site-specific manual pages should be installed?'
9024 prefixvar=siteman1dir
9027 : determine where add-on library man pages go
9028 case "$siteman3dir" in
9029 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9030 *) dflt=$siteman3dir ;;
9033 ''|' ') dflt=none ;;
9036 rp='Pathname where the site-specific library manual pages should be installed?'
9038 prefixvar=siteman3dir
9041 : determine where add-on public executable scripts go
9042 case "$sitescript" in
9043 '') dflt=$siteprefix/script
9044 $test -d $dflt || dflt=$sitebin ;;
9045 *) dflt="$sitescript" ;;
9048 rp='Pathname where add-on public executable scripts should be installed?'
9050 prefixvar=sitescript
9053 : Check if faststdio is requested and available
9054 case "$usefaststdio" in
9055 $define|true|[yY]*|'')
9056 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9066 Perl can be built to use 'fast stdio', which means using the stdio
9067 library but also directly manipulating the stdio buffers to enable
9068 faster I/O. Using stdio is better for backward compatibility (especially
9069 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9070 interface has been preferred instead of stdio.
9072 If this doesn't make any sense to you, just accept the default '$dflt'.
9074 rp='Use the "fast stdio" if available?'
9077 y|Y) val="$define" ;;
9084 : define an is-a-typedef? function
9085 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9087 "") inclist="sys/types.h";;
9089 eval "varval=\$$var";
9093 for inc in $inclist; do
9094 echo "#include <$inc>" >>temp.c;
9096 echo "#ifdef $type" >> temp.c;
9097 echo "printf(\"We have $type\");" >> temp.c;
9098 echo "#endif" >> temp.c;
9099 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9100 if $contains $type temp.E >/dev/null 2>&1; then
9106 *) eval "$var=\$varval";;
9109 : define an is-a-typedef? function that prompts if the type is not available.
9110 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9112 "") inclist="sys/types.h";;
9114 eval "varval=\$$var";
9118 for inc in $inclist; do
9119 echo "#include <$inc>" >>temp.c;
9121 echo "#ifdef $type" >> temp.c;
9122 echo "printf(\"We have $type\");" >> temp.c;
9123 echo "#endif" >> temp.c;
9124 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9126 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9127 if $contains $type temp.E >/dev/null 2>&1; then
9128 echo "$type found." >&4;
9131 echo "$type NOT found." >&4;
9137 *) eval "$var=\$varval";;
9140 : see what type lseek is declared as in the kernel
9141 rp="What is the type used for lseek's offset on this system?"
9142 set off_t lseektype long stdio.h sys/types.h
9146 echo "Checking to see how big your file offsets are..." >&4
9148 #include <sys/types.h>
9152 printf("%d\n", (int)sizeof($lseektype));
9157 if eval $compile_ok; then
9158 lseeksize=`$run ./try`
9159 echo "Your file offsets are $lseeksize bytes long."
9163 echo "(I can't seem to compile the test program. Guessing...)"
9164 rp="What is the size of your file offsets (in bytes)?"
9170 : see what type file positions are declared as in the library
9171 rp="What is the type for file position used by fsetpos()?"
9172 set fpos_t fpostype long stdio.h sys/types.h
9175 : Check size for Fpos_t
9178 *_t) zzz="$fpostype" ;;
9181 echo "Checking the size of $zzz..." >&4
9183 #include <sys/types.h>
9190 printf("%d\n", (int)sizeof($fpostype));
9195 if eval $compile_ok; then
9199 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9202 echo "Your $zzz is $fpossize bytes long."
9208 echo "(I can't compile the test program. Guessing...)" >&4
9209 rp="What is the size of your file positions (in bytes)?"
9214 : Check for large file support
9215 # Backward compatibility (uselfs is deprecated).
9217 "$define"|true|[yY]*)
9220 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9222 uselargefiles="$define"
9226 case "$lseeksize:$fpossize" in
9229 You can have files larger than 2 gigabytes.
9232 *) case "$uselargefiles" in
9233 "$undef"|false|[nN]*) dflt='n' ;;
9238 Perl can be built to understand large files (files larger than 2 gigabytes)
9239 on some systems. To do so, Configure can be run with -Duselargefiles.
9241 If this doesn't make any sense to you, just accept the default '$dflt'.
9243 rp='Try to understand large files, if available?'
9246 y|Y) val="$define" ;;
9253 : Look for a hint-file generated 'call-back-unit'. If the
9254 : user has specified that a large files perl is to be built,
9255 : we may need to set or change some other defaults.
9256 if $test -f uselargefiles.cbu; then
9257 echo "Your platform has some specific hints regarding large file builds, using them..."
9258 . ./uselargefiles.cbu
9260 case "$uselargefiles" in
9262 if $test -f uselargefiles.cbu; then
9264 echo "Rechecking to see how big your file offsets are..." >&4
9266 #include <sys/types.h>
9270 printf("%d\n", (int)sizeof($lseektype));
9275 if eval $compile_ok; then
9276 lseeksize=`$run ./try`
9277 $echo "Your file offsets are now $lseeksize bytes long."
9281 echo "(I can't seem to compile the test program. Guessing...)"
9282 rp="What is the size of your file offsets (in bytes)?"
9287 *_t) zzz="$fpostype" ;;
9290 $echo $n "Rechecking the size of $zzz...$c" >&4
9292 #include <sys/types.h>
9299 printf("%d\n", (int)sizeof($fpostype));
9304 if eval $compile_ok; then
9309 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9312 echo " $fpossize bytes." >&4
9318 echo "(I can't compile the test program. Guessing...)" >&4
9319 rp="What is the size of your file positions (in bytes)?"
9328 : Set the vendorbin variables
9329 case "$vendorprefix" in
9330 '') d_vendorbin="$undef"
9334 *) d_vendorbin="$define"
9335 : determine where vendor-supplied executables go.
9336 case "$vendorbin" in
9337 '') dflt=$vendorprefix/bin ;;
9338 *) dflt="$vendorbin" ;;
9341 rp='Pathname for the vendor-supplied executables directory?'
9344 vendorbinexp="$ansexp"
9350 : Set the vendorhtml1dir variables
9351 case "$vendorprefix" in
9352 '') vendorhtml1dir=''
9353 vendorhtml1direxp=''
9355 *) : determine where vendor-supplied html pages go.
9356 : There is no standard location, so try to copy the previously-selected
9357 : directory structure for the core html pages.
9358 : XXX Better default suggestions would be welcome.
9359 case "$vendorhtml1dir" in
9360 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9361 *) dflt=$vendorhtml1dir ;;
9364 ''|' ') dflt=none ;;
9367 rp='Pathname for the vendor-supplied html pages?'
9369 vendorhtml1dir="$ans"
9370 vendorhtml1direxp="$ansexp"
9373 : Use ' ' for none so value is preserved next time through Configure
9374 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9375 prefixvar=vendorhtml1dir
9378 : Set the vendorhtml3dir variables
9379 case "$vendorprefix" in
9380 '') vendorhtml3dir=''
9381 vendorhtml3direxp=''
9383 *) : determine where vendor-supplied module html pages go.
9384 : There is no standard location, so try to copy the previously-selected
9385 : directory structure for the core html pages.
9386 : XXX Better default suggestions would be welcome.
9387 case "$vendorhtml3dir" in
9388 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9389 *) dflt=$vendorhtml3dir ;;
9392 ''|' ') dflt=none ;;
9395 rp='Pathname for the vendor-supplied html pages?'
9397 vendorhtml3dir="$ans"
9398 vendorhtml3direxp="$ansexp"
9401 : Use ' ' for none so value is preserved next time through Configure
9402 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9403 prefixvar=vendorhtml3dir
9406 : Set the vendorman1dir variables
9407 case "$vendorprefix" in
9408 '') vendorman1dir=''
9411 *) : determine where vendor-supplied manual pages go.
9412 case "$vendorman1dir" in
9413 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9414 *) dflt=$vendorman1dir ;;
9417 ''|' ') dflt=none ;;
9420 rp='Pathname for the vendor-supplied manual section 1 pages?'
9422 vendorman1dir="$ans"
9423 vendorman1direxp="$ansexp"
9426 : Use ' ' for none so value is preserved next time through Configure
9427 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9428 prefixvar=vendorman1dir
9431 : Set the vendorman3dir variables
9432 case "$vendorprefix" in
9433 '') vendorman3dir=''
9436 *) : determine where vendor-supplied module manual pages go.
9437 case "$vendorman3dir" in
9438 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9439 *) dflt=$vendorman3dir ;;
9442 ''|' ') dflt=none ;;
9445 rp='Pathname for the vendor-supplied manual section 3 pages?'
9447 vendorman3dir="$ans"
9448 vendorman3direxp="$ansexp"
9451 : Use ' ' for none so value is preserved next time through Configure
9452 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9453 prefixvar=vendorman3dir
9456 : Set the vendorscript variables
9457 case "$vendorprefix" in
9458 '') d_vendorscript="$undef"
9462 *) d_vendorscript="$define"
9463 : determine where vendor-supplied scripts go.
9464 case "$vendorscript" in
9465 '') dflt=$vendorprefix/script
9466 $test -d $dflt || dflt=$vendorbin ;;
9467 *) dflt="$vendorscript" ;;
9471 The installation process will create a directory for
9472 vendor-supplied scripts.
9476 rp='Pathname for the vendor-supplied scripts directory?'
9479 vendorscriptexp="$ansexp"
9482 prefixvar=vendorscript
9485 : see if qgcvt exists
9489 : Check print/scan long double stuff
9492 if $test X"$d_longdbl" = X"$define"; then
9494 echo "Checking how to print long doubles..." >&4
9496 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9497 $cat >try.c <<'EOCP'
9498 #include <sys/types.h>
9502 printf("%.3f\n", d);
9506 if eval $compile; then
9510 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9511 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9512 echo "We will use %f."
9518 if $test X"$sPRIfldbl" = X; then
9519 $cat >try.c <<'EOCP'
9520 #include <sys/types.h>
9523 long double d = 123.456;
9524 printf("%.3Lf\n", d);
9528 if eval $compile; then
9532 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9533 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9534 echo "We will use %Lf."
9540 if $test X"$sPRIfldbl" = X; then
9541 $cat >try.c <<'EOCP'
9542 #include <sys/types.h>
9545 long double d = 123.456;
9546 printf("%.3llf\n", d);
9550 if eval $compile; then
9554 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9555 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9556 echo "We will use %llf."
9562 if $test X"$sPRIfldbl" = X; then
9563 $cat >try.c <<'EOCP'
9564 #include <sys/types.h>
9567 long double d = 123.456;
9568 printf("%.3lf\n", d);
9572 if eval $compile; then
9576 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9577 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9578 echo "We will use %lf."
9584 if $test X"$sPRIfldbl" = X; then
9585 echo "Cannot figure out how to print long doubles." >&4
9587 sSCNfldbl=$sPRIfldbl # expect consistency
9594 case "$sPRIfldbl" in
9595 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9596 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9597 d_SCNfldbl="$undef";
9599 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9600 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9601 d_SCNfldbl="$define";
9605 : Check how to convert floats to strings.
9607 if test "X$d_Gconvert" = X; then
9610 echo "Checking for an efficient way to convert floats to strings."
9612 case "$uselongdouble" in
9613 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9615 case "$d_longdbl" in
9616 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9618 case "$d_PRIgldbl" in
9619 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9623 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9624 char *myname = "gconvert";
9627 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9628 char *myname = "gcvt";
9631 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9632 char *myname = "qgcvt";
9633 #define DOUBLETYPE long double
9636 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9638 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9640 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9643 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9645 char *myname = "sprintf";
9649 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9650 #define DOUBLETYPE long double
9652 #define DOUBLETYPE double
9658 #define I_STDLIB $i_stdlib
9664 checkit(expect, got)
9668 if (strcmp(expect, got)) {
9669 printf("%s oddity: Expected %s, got %s\n",
9670 myname, expect, got);
9680 /* This must be 1st test on (which?) platform */
9681 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9682 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9683 checkit("0.1", buf);
9685 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9686 checkit("0.01", buf);
9688 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9689 checkit("0.001", buf);
9691 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9692 checkit("0.0001", buf);
9694 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9695 if (strlen(buf) > 5)
9696 checkit("9e-005", buf); /* for Microsoft ?? */
9698 checkit("9e-05", buf);
9700 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9703 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9704 checkit("1.1", buf);
9706 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9707 checkit("1.01", buf);
9709 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9710 checkit("1.001", buf);
9712 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9713 checkit("1.0001", buf);
9715 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9716 checkit("1.00001", buf);
9718 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9719 checkit("1.000001", buf);
9721 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9724 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9727 /* Some Linux gcvt's give 1.e+5 here. */
9728 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9729 checkit("100000", buf);
9731 /* Some Linux gcvt's give -1.e+5 here. */
9732 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9733 checkit("-100000", buf);
9735 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9736 checkit("123.456", buf);
9738 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9739 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9740 /* 34 should be enough to scare even long double
9741 * places into using the e notation. */
9742 if (strlen(buf) > 5)
9743 checkit("1e+034", buf); /* for Microsoft */
9745 checkit("1e+34", buf);
9747 /* For Perl, if you add additional tests here, also add them to
9748 * t/base/num.t for benefit of platforms not using Configure or
9749 * overriding d_Gconvert */
9754 : first add preferred functions to our list
9756 for xxx_convert in $gconvert_preference; do
9757 case $xxx_convert in
9758 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9759 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9762 : then add any others
9763 for xxx_convert in gconvert gcvt sprintf; do
9766 *) xxx_list="$xxx_list $xxx_convert" ;;
9770 case "$d_longdbl$uselongdouble" in
9772 : again, add prefered functions to our list first
9774 for xxx_convert in $gconvert_ld_preference; do
9775 case $xxx_convert in
9776 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9777 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9780 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9781 for xxx_convert in qgcvt sprintf $xxx_list; do
9782 case "$xxx_ld_list" in
9783 $xxx_convert*|*" $xxx_convert"*) ;;
9784 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9787 : if sprintf cannot do long doubles, move it to the end
9788 if test "$d_PRIgldbl" != "$define"; then
9789 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9791 : if no qgcvt, remove it
9792 if test "$d_qgcvt" != "$define"; then
9793 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9796 xxx_list="$xxx_ld_list"
9800 for xxx_convert in $xxx_list; do
9801 echo "Trying $xxx_convert..."
9802 $rm -f try try$_o core
9803 set try -DTRY_$xxx_convert
9804 if eval $compile; then
9805 echo "$xxx_convert() found." >&4
9807 echo "I'll use $xxx_convert to convert floats into a string." >&4
9810 echo "...But $xxx_convert didn't work as I expected."
9814 echo "$xxx_convert NOT found." >&4
9818 if test X$xxx_convert = X; then
9819 echo "*** WHOA THERE!!! ***" >&4
9820 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9824 case "$xxx_convert" in
9825 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9826 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9827 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9828 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9829 "$define$define$define")
9830 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9831 "$define$define$undef")
9832 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9833 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9841 : see if _fwalk exists
9845 : Initialize h_fcntl
9848 : Initialize h_sysfile
9851 : access call always available on UNIX
9855 : locate the flags for 'access()'
9859 $cat >access.c <<EOCP
9860 #include <sys/types.h>
9865 #include <sys/file.h>
9878 : check sys/file.h first, no particular reason here
9879 if $test `./findhdr sys/file.h` && \
9880 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9882 echo "<sys/file.h> defines the *_OK access constants." >&4
9883 elif $test `./findhdr fcntl.h` && \
9884 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9886 echo "<fcntl.h> defines the *_OK access constants." >&4
9887 elif $test `./findhdr unistd.h` && \
9888 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9889 echo "<unistd.h> defines the *_OK access constants." >&4
9891 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9897 : see if accessx exists
9898 set accessx d_accessx
9901 : see if aintl exists
9905 : see if alarm exists
9909 : see if POSIX threads are available
9910 set pthread.h i_pthread
9913 : define a fucntion to check prototypes
9914 $cat > protochk <<EOSH
9917 optimize="$optimize"
9919 prototype="$prototype"
9922 usethreads=$usethreads
9923 i_pthread=$i_pthread
9924 pthread_h_first=$pthread_h_first
9927 $cat >> protochk <<'EOSH'
9932 while test $# -ge 2; do
9934 $define) echo "#include <$2>" >> try.c ;;
9935 literal) echo "$2" >> try.c ;;
9937 # Extra magic for the benefit of systems that need pthread.h
9938 # to be included early to correctly detect threadsafe functions.
9939 # Such functions must guarantee themselves, though, that the usethreads
9940 # and i_pthread have been defined, before calling protochk.
9941 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9942 echo "#include <pthread.h>" >> try.c
9947 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9948 cat >> try.c <<'EOCP'
9949 #ifdef CAN_PROTOTYPE
9950 #define _(args) args
9955 echo "$foo" >> try.c
9956 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9957 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9965 : Define hasproto macro for Configure internal use
9966 hasproto='varname=$1; func=$2; shift; shift;
9967 while $test $# -ge 2; do
9969 $define) echo "#include <$2>";;
9973 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9974 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9975 echo "$func() prototype found.";
9978 echo "$func() prototype NOT found.";
9985 : see if sys/types.h has to be included
9986 set sys/types.h i_systypes
9989 : see if sys/select.h has to be included
9990 set sys/select.h i_sysselct
9993 : Define hasfield macro for Configure internal use
9994 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9995 while $test $# -ge 2; do
9997 $define) echo "#include <$2>";;
10001 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10003 if eval $compile; then
10012 : see if we should include time.h, sys/time.h, or both
10014 if test "X$timeincl" = X; then
10015 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10016 $echo $n "I'm now running the test program...$c"
10018 #include <sys/types.h>
10023 #ifdef SYSTIMEKERNEL
10026 #include <sys/time.h>
10029 #include <sys/select.h>
10031 #$i_stdlib I_STDLIB
10033 #include <stdlib.h>
10039 struct timeval bar;
10042 struct timezone tzp;
10044 if (foo.tm_sec == foo.tm_sec)
10047 if (bar.tv_sec == bar.tv_sec)
10054 for s_timezone in '-DS_TIMEZONE' ''; do
10056 for s_timeval in '-DS_TIMEVAL' ''; do
10057 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10058 for i_time in '' '-DI_TIME'; do
10059 for i_systime in '-DI_SYSTIME' ''; do
10062 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10063 if eval $compile; then
10064 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10068 $echo $n "Succeeded with $flags$c"
10080 *SYSTIMEKERNEL*) i_systimek="$define"
10081 timeincl=`./findhdr sys/time.h`
10082 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10083 *) i_systimek="$undef";;
10086 *I_TIME*) i_time="$define"
10087 timeincl=`./findhdr time.h`" $timeincl"
10088 echo "We'll include <time.h>." >&4;;
10089 *) i_time="$undef";;
10092 *I_SYSTIME*) i_systime="$define"
10093 timeincl=`./findhdr sys/time.h`" $timeincl"
10094 echo "We'll include <sys/time.h>." >&4;;
10095 *) i_systime="$undef";;
10099 : see if struct tm knows about tm_zone
10100 case "$i_systime$i_time" in
10103 echo "Checking to see if your struct tm has tm_zone field..." >&4
10104 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10112 case "$d_tm_tm_zone" in
10113 "$define") echo "Yes, it does." ;;
10114 *) echo "No, it doesn't." ;;
10116 : see if struct tm knows about tm_gmtoff
10117 case "$i_systime$i_time" in
10120 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10121 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10129 case "$d_tm_tm_gmtoff" in
10130 "$define") echo "Yes, it does." ;;
10131 *) echo "No, it doesn't." ;;
10134 : see if asctime_r exists
10135 set asctime_r d_asctime_r
10137 case "$d_asctime_r" in
10139 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10140 case "$d_asctime_r_proto:$usethreads" in
10141 ":define") d_asctime_r_proto=define
10142 set d_asctime_r_proto asctime_r $hdrs
10146 case "$d_asctime_r_proto" in
10148 case "$asctime_r_proto" in
10149 ''|0) try='char* asctime_r(const struct tm*, char*);'
10150 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10152 case "$asctime_r_proto" in
10153 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10154 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10156 case "$asctime_r_proto" in
10157 ''|0) try='int asctime_r(const struct tm*, char*);'
10158 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10160 case "$asctime_r_proto" in
10161 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10162 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10164 case "$asctime_r_proto" in
10165 ''|0) d_asctime_r=undef
10167 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10168 * ) case "$asctime_r_proto" in
10169 REENTRANT_PROTO*) ;;
10170 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10172 echo "Prototype: $try" ;;
10175 *) case "$usethreads" in
10176 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10183 *) asctime_r_proto=0
10187 : see if atolf exists
10191 : see if atoll exists
10195 : Look for GCC-style attribute format
10196 case "$d_attribute_format" in
10199 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10200 $cat >attrib.c <<'EOCP'
10202 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10204 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10205 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10206 echo "Your C compiler doesn't support __attribute__((format))."
10209 echo "Your C compiler supports __attribute__((format))."
10213 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10217 *) val="$d_attribute_format" ;;
10219 set d_attribute_format
10223 : Look for GCC-style attribute format with null format allowed
10224 case "$d_printf_format_null" in
10225 '') case "$d_attribute_format" in
10228 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10229 $cat >attrib.c <<EOCP
10231 #$i_stdlib I_STDLIB
10233 #include <stdlib.h>
10235 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10236 int null_printf (char* pat,...) { return (int)pat; }
10237 int main () { exit(null_printf(NULL)); }
10239 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10240 : run the executable in case it produces a run-time warning
10241 if $run ./attrib >>attrib.out 2>&1; then
10242 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10243 echo "Your C compiler doesn't allow __printf__ format to be null."
10246 echo "Your C compiler allows __printf__ format to be null."
10250 echo "Your C compiler executable failed with __printf__ format null."
10254 echo "Your C compiler fails with __printf__ format null."
10261 *) val="$d_printf_format_null" ;;
10263 set d_printf_format_null
10267 : Look for GCC-style attribute malloc
10268 case "$d_attribute_malloc" in
10271 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10272 $cat >attrib.c <<'EOCP'
10274 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10276 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10277 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10278 echo "Your C compiler doesn't support __attribute__((malloc))."
10281 echo "Your C compiler supports __attribute__((malloc))."
10285 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10289 *) val="$d_attribute_malloc" ;;
10291 set d_attribute_malloc
10295 : Look for GCC-style attribute nonnull
10296 case "$d_attribute_nonnull" in
10299 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10300 $cat >attrib.c <<'EOCP'
10302 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10304 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10305 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10306 echo "Your C compiler doesn't support __attribute__((nonnull))."
10309 echo "Your C compiler supports __attribute__((nonnull))."
10313 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10317 *) val="$d_attribute_nonnull" ;;
10319 set d_attribute_nonnull
10323 : Look for GCC-style attribute noreturn
10324 case "$d_attribute_noreturn" in
10327 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10328 $cat >attrib.c <<'EOCP'
10330 void fall_over_dead( void ) __attribute__((noreturn));
10332 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10333 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10334 echo "Your C compiler doesn't support __attribute__((noreturn))."
10337 echo "Your C compiler supports __attribute__((noreturn))."
10341 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10345 *) val="$d_attribute_noreturn" ;;
10347 set d_attribute_noreturn
10351 : Look for GCC-style attribute pure
10352 case "$d_attribute_pure" in
10355 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10356 $cat >attrib.c <<'EOCP'
10358 int square( int n ) __attribute__((pure));
10360 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10361 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10362 echo "Your C compiler doesn't support __attribute__((pure))."
10365 echo "Your C compiler supports __attribute__((pure))."
10369 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10373 *) val="$d_attribute_pure" ;;
10375 set d_attribute_pure
10379 : Look for GCC-style attribute unused
10380 case "$d_attribute_unused" in
10383 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10384 $cat >attrib.c <<'EOCP'
10386 int do_something( int dummy __attribute__((unused)), int n );
10388 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10389 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10390 echo "Your C compiler doesn't support __attribute__((unused))."
10393 echo "Your C compiler supports __attribute__((unused))."
10397 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10401 *) val="$d_attribute_unused" ;;
10403 set d_attribute_unused
10407 : Look for GCC-style attribute warn_unused_result
10408 case "$d_attribute_warn_unused_result" in
10411 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10412 $cat >attrib.c <<'EOCP'
10414 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10416 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10417 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10418 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10421 echo "Your C compiler supports __attribute__((warn_unused_result))."
10425 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10429 *) val="$d_attribute_warn_unused_result" ;;
10431 set d_attribute_warn_unused_result
10435 : see if bcmp exists
10439 : see if bcopy exists
10443 : see if getpgrp exists
10444 set getpgrp d_getpgrp
10447 case "$d_getpgrp" in
10450 echo "Checking to see which flavor of getpgrp is in use..."
10452 #$i_unistd I_UNISTD
10453 #include <sys/types.h>
10455 # include <unistd.h>
10457 #$i_stdlib I_STDLIB
10459 #include <stdlib.h>
10463 if (getuid() == 0) {
10464 printf("(I see you are running Configure as super-user...)\n");
10467 #ifdef TRY_BSD_PGRP
10468 if (getpgrp(1) == 0)
10477 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10478 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10480 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10481 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10484 echo "I can't seem to compile and run the test program."
10486 xxx="a USG one, i.e. you use getpgrp()."
10488 # SVR4 systems can appear rather BSD-ish.
10489 case "$i_unistd" in
10491 xxx="a BSD one, i.e. you use getpgrp(pid)."
10495 xxx="probably a USG one, i.e. you use getpgrp()."
10500 echo "Assuming your getpgrp is $xxx" >&4
10509 : see if setpgrp exists
10510 set setpgrp d_setpgrp
10513 case "$d_setpgrp" in
10516 echo "Checking to see which flavor of setpgrp is in use..."
10518 #$i_unistd I_UNISTD
10519 #include <sys/types.h>
10521 # include <unistd.h>
10523 #$i_stdlib I_STDLIB
10525 #include <stdlib.h>
10529 if (getuid() == 0) {
10530 printf("(I see you are running Configure as super-user...)\n");
10533 #ifdef TRY_BSD_PGRP
10534 if (-1 == setpgrp(1, 1))
10537 if (setpgrp() != -1)
10543 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10544 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10546 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10547 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10550 echo "(I can't seem to compile and run the test program.)"
10552 xxx="a USG one, i.e. you use setpgrp()."
10554 # SVR4 systems can appear rather BSD-ish.
10555 case "$i_unistd" in
10557 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10561 xxx="probably a USG one, i.e. you use setpgrp()."
10566 echo "Assuming your setpgrp is $xxx" >&4
10575 : Look for GCC-style __builtin_choose_expr
10576 case "$d_builtin_choose_expr" in
10579 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10580 $cat >try.c <<'EOCP'
10581 #include <assert.h>
10582 #include <stdlib.h>
10585 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10588 assert( SYRINX(1) == 2112 );
10589 assert( SYRINX(1) != 5150 );
10590 assert( SYRINX(0) == 5150 );
10591 assert( SYRINX(0) != 2112 );
10592 puts( "All good!" );
10598 if eval $compile && $run ./try; then
10599 echo "Your C compiler supports __builtin_choose_expr."
10602 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10606 *) val="$d_builtin_choose_expr" ;;
10609 set d_builtin_choose_expr
10613 : Look for GCC-style __builtin_expect
10614 case "$d_builtin_expect" in
10617 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10618 $cat >try.c <<'EOCP'
10621 if ( __builtin_expect(n, 0) ) n = 1;
10622 /* Remember shell exit code truth is 0, C truth is non-zero */
10627 if eval $compile && $run ./try; then
10628 echo "Your C compiler supports __builtin_expect."
10631 echo "Your C compiler doesn't seem to understand __builtin_expect."
10635 *) val="$d_builtin_expect" ;;
10638 set d_builtin_expect
10642 : see if bzero exists
10646 : see if stdarg is available
10648 if $test `./findhdr stdarg.h`; then
10649 echo "<stdarg.h> found." >&4
10652 echo "<stdarg.h> NOT found." >&4
10656 : see if varags is available
10658 if $test `./findhdr varargs.h`; then
10659 echo "<varargs.h> found." >&4
10661 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10664 : set up the varargs testing programs
10665 $cat > varargs.c <<EOP
10667 #include <stdarg.h>
10670 #include <varargs.h>
10674 int f(char *p, ...)
10688 p = va_arg(ap, char *);
10694 $cat > varargs <<EOP
10696 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10705 : now check which varargs header should be included
10710 if `./varargs I_STDARG`; then
10712 elif `./varargs I_VARARGS`; then
10717 if `./varargs I_VARARGS`; then
10724 echo "I could not find the definition for va_dcl... You have problems..." >&4
10725 val="$undef"; set i_stdarg; eval $setvar
10726 val="$undef"; set i_varargs; eval $setvar
10731 case "$i_varhdr" in
10733 val="$define"; set i_stdarg; eval $setvar
10734 val="$undef"; set i_varargs; eval $setvar
10737 val="$undef"; set i_stdarg; eval $setvar
10738 val="$define"; set i_varargs; eval $setvar
10741 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10745 : see if the Compiler supports C99 variadic macros
10746 case "$i_stdarg$i_stdlib" in
10748 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10751 #include <stdarg.h>
10753 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10757 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10763 if eval $compile && $run ./try 2>&1 >/dev/null; then
10764 case "`$run ./try`" in
10766 echo "You have C99 variadic macros." >&4
10767 d_c99_variadic_macros="$define"
10770 echo "You don't have functional C99 variadic macros." >&4
10771 d_c99_variadic_macros="$undef"
10775 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10776 d_c99_variadic_macros="$undef"
10781 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10782 d_c99_variadic_macros="$undef"
10786 : see if signal is declared as pointer to function returning int or void
10788 xxx=`./findhdr signal.h`
10789 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10790 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10791 echo "You have int (*signal())() instead of void." >&4
10793 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10794 echo "You have void (*signal())()." >&4
10796 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10797 echo "You have int (*signal())() instead of void." >&4
10799 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10800 echo "You have void (*signal())()." >&4
10803 case "$d_voidsig" in
10805 echo "I can't determine whether signal handler returns void or int..." >&4
10807 rp="What type does your signal handler return?"
10810 v*) val="$define";;
10814 echo "As you already told me, signal handler returns void." >&4
10817 *) echo "As you already told me, signal handler returns int." >&4
10824 case "$d_voidsig" in
10825 "$define") signal_t="void";;
10826 *) signal_t="int";;
10830 : check for ability to cast large floats to 32-bit ints.
10832 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10833 if $test "$intsize" -ge 4; then
10840 #$i_stdlib I_STDLIB
10842 #include <stdlib.h>
10844 #include <sys/types.h>
10845 #include <signal.h>
10846 $signal_t blech(int s) { exit(3); }
10853 signal(SIGFPE, blech);
10855 /* Don't let compiler optimize the test away. Store the number
10856 in a writable string for gcc to pass to sscanf under HP/UX.
10858 sprintf(str, "2147483647");
10859 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10863 /* x86 processors will probably give 0x8000 0000, which is a
10864 sign change. We don't want that. We want to mimic SPARC
10865 behavior here, which is to preserve the sign and give
10868 if (i32 != ($xxx) f)
10874 if eval $compile_ok; then
10878 echo "(I can't seem to compile the test program--assuming it can't)"
10883 echo "Yup, it can."
10886 echo "Nope, it can't."
10893 : check for ability to cast negative floats to unsigned
10895 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10898 #$i_stdlib I_STDLIB
10900 #include <stdlib.h>
10902 #include <sys/types.h>
10903 #include <signal.h>
10904 $signal_t blech(int s) { exit(7); }
10905 $signal_t blech_in_list(int s) { exit(4); }
10906 unsigned long dummy_long(unsigned long p) { return p; }
10907 unsigned int dummy_int(unsigned int p) { return p; }
10908 unsigned short dummy_short(unsigned short p) { return p; }
10912 unsigned long along;
10914 unsigned short ashort;
10918 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10919 a direct f = -123. assignment. gcc-2.8.0 reportedly
10920 optimized the whole file away
10922 /* Store the number in a writable string for gcc to pass to
10923 sscanf under HP/UX.
10925 sprintf(str, "-123");
10926 sscanf(str, "%lf", &f); /* f = -123.; */
10928 signal(SIGFPE, blech);
10929 along = (unsigned long)f;
10930 aint = (unsigned int)f;
10931 ashort = (unsigned short)f;
10932 if (along != (unsigned long)-123)
10934 if (aint != (unsigned int)-123)
10936 if (ashort != (unsigned short)-123)
10938 sprintf(str, "1073741824.");
10939 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10942 along = (unsigned long)f;
10943 if (along != 0x80000000)
10947 along = (unsigned long)f;
10948 if (along != 0x7fffffff)
10952 along = (unsigned long)f;
10953 if (along != 0x80000001)
10957 signal(SIGFPE, blech_in_list);
10958 sprintf(str, "123.");
10959 sscanf(str, "%lf", &f); /* f = 123.; */
10960 along = dummy_long((unsigned long)f);
10961 aint = dummy_int((unsigned int)f);
10962 ashort = dummy_short((unsigned short)f);
10963 if (along != (unsigned long)123)
10965 if (aint != (unsigned int)123)
10967 if (ashort != (unsigned short)123)
10974 if eval $compile_ok; then
10978 echo "(I can't seem to compile the test program--assuming it can't)"
10981 case "$castflags" in
10983 echo "Yup, it can."
10986 echo "Nope, it can't."
10993 : see if vprintf exists
10995 if set vprintf val -f d_vprintf; eval $csym; $val; then
10996 echo 'vprintf() found.' >&4
10999 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11000 #$i_varargs I_VARARGS
11002 #$i_stdlib I_STDLIB
11003 #$i_unistd I_UNISTD
11006 # include <stdarg.h>
11007 #else /* I_VARARGS */
11008 # include <varargs.h>
11012 # include <unistd.h>
11016 # include <stdlib.h>
11019 #include <stdio.h> /* vsprintf prototype */
11022 void xxx(int n, ...)
11027 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11029 int main() { xxx(1, "foo"); }
11031 #else /* I_VARARGS */
11039 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11041 int main() { xxx("foo"); }
11047 if eval $compile_ok; then
11048 if $run ./try; then
11049 echo "Your vsprintf() returns (int)." >&4
11052 echo "Your vsprintf() returns (char*)." >&4
11056 echo 'I am unable to compile the vsprintf() test program.' >&4
11057 # We shouldn't get here. If we do, assume the standard signature,
11058 # not the old BSD one.
11059 echo 'Guessing that vsprintf() returns (int).' >&4
11063 echo 'vprintf() NOT found.' >&4
11074 : see if chown exists
11078 : see if chroot exists
11079 set chroot d_chroot
11082 : see if chsize exists
11083 set chsize d_chsize
11086 : see if class exists
11090 : see if clearenv exists
11091 set clearenv d_clearenv
11094 : Define hasstruct macro for Configure internal use
11095 hasstruct='varname=$1; struct=$2; shift; shift;
11096 while $test $# -ge 2; do
11098 $define) echo "#include <$2>";;
11102 echo "int main () { struct $struct foo; }" >> try.c;
11104 if eval $compile; then
11113 : see whether socket exists
11117 $echo $n "Hmm... $c" >&4
11118 if set socket val -f d_socket; eval $csym; $val; then
11119 echo "Looks like you have Berkeley networking support." >&4
11121 if set setsockopt val -f; eval $csym; $val; then
11124 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11125 d_oldsock="$define"
11128 if $contains socklib libc.list >/dev/null 2>&1; then
11129 echo "Looks like you have Berkeley networking support." >&4
11131 : we will have to assume that it supports the 4.2 BSD interface
11134 echo "You don't have Berkeley networking in libc$_a..." >&4
11135 if test "X$d_socket" = "X$define"; then
11136 echo "...but you seem to believe that you have sockets." >&4
11138 for net in net socket
11140 if test -f /usr/lib/lib$net$_a; then
11141 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11142 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11143 if $contains socket libc.list >/dev/null 2>&1; then
11148 echo "...but the Wollongong group seems to have hacked it in." >&4
11149 sockethdr="-I/usr/netinclude"
11152 echo "Found Berkeley sockets interface in lib$net." >&4
11153 if $contains setsockopt libc.list >/dev/null 2>&1; then
11156 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11157 d_oldsock="$define"
11163 if test "X$d_socket" != "X$define"; then
11164 echo "or anywhere else I see." >&4
11172 : see if socketpair exists
11173 set socketpair d_sockpair
11178 echo "Checking the availability of certain socket constants..." >&4
11179 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11180 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11182 #include <sys/types.h>
11183 #include <sys/socket.h>
11189 set try; if eval $compile; then
11192 set d_${enum}; eval $setvar
11196 : see if this is a sys/uio.h system
11197 set sys/uio.h i_sysuio
11200 : Check for cmsghdr support
11202 echo "Checking to see if your system supports struct cmsghdr..." >&4
11203 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11205 case "$d_cmsghdr_s" in
11206 "$define") echo "Yes, it does." ;;
11207 *) echo "No, it doesn't." ;;
11211 : check for const keyword
11213 echo 'Checking to see if your C compiler knows about "const"...' >&4
11214 $cat >const.c <<'EOCP'
11215 typedef struct spug { int drokk; } spug;
11219 const spug y = { 0 };
11222 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11224 echo "Yup, it does."
11227 echo "Nope, it doesn't."
11232 : see if copysignl exists
11233 set copysignl d_copysignl
11236 : see if crypt exists
11241 $define) cryptlib='' ;;
11242 *) if set crypt val -f d_crypt; eval $csym; $val; then
11243 echo 'crypt() found.' >&4
11247 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11248 if $test -z "$cryptlib"; then
11249 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11253 if $test -z "$cryptlib"; then
11254 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11258 if $test -z "$cryptlib"; then
11259 cryptlib=`./loc libcrypt$_a "" $libpth`
11263 if $test -z "$cryptlib"; then
11264 echo 'crypt() NOT found.' >&4
11275 : see if this is a crypt.h system
11276 set crypt.h i_crypt
11279 : see if crypt_r exists
11280 set crypt_r d_crypt_r
11282 case "$d_crypt_r" in
11284 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11285 case "$d_crypt_r_proto:$usethreads" in
11286 ":define") d_crypt_r_proto=define
11287 set d_crypt_r_proto crypt_r $hdrs
11291 case "$d_crypt_r_proto" in
11293 case "$crypt_r_proto" in
11294 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11295 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11297 case "$crypt_r_proto" in
11298 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11299 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11301 case "$crypt_r_proto" in
11302 ''|0) d_crypt_r=undef
11304 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11305 * ) case "$crypt_r_proto" in
11306 REENTRANT_PROTO*) ;;
11307 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11309 echo "Prototype: $try" ;;
11312 *) case "$usethreads" in
11313 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11324 : get csh whereabouts
11326 'csh') val="$undef" ;;
11327 *) val="$define" ;;
11331 : Respect a hint or command line value for full_csh.
11332 case "$full_csh" in
11333 '') full_csh=$csh ;;
11336 : see if ctermid exists
11337 set ctermid d_ctermid
11340 : see if ctermid_r exists
11341 set ctermid_r d_ctermid_r
11343 case "$d_ctermid_r" in
11345 hdrs="$i_systypes sys/types.h define stdio.h "
11346 case "$d_ctermid_r_proto:$usethreads" in
11347 ":define") d_ctermid_r_proto=define
11348 set d_ctermid_r_proto ctermid_r $hdrs
11352 case "$d_ctermid_r_proto" in
11354 case "$ctermid_r_proto" in
11355 ''|0) try='char* ctermid_r(char*);'
11356 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11358 case "$ctermid_r_proto" in
11359 ''|0) d_ctermid_r=undef
11361 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11362 * ) case "$ctermid_r_proto" in
11363 REENTRANT_PROTO*) ;;
11364 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11366 echo "Prototype: $try" ;;
11369 *) case "$usethreads" in
11370 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11377 *) ctermid_r_proto=0
11381 : see if ctime_r exists
11382 set ctime_r d_ctime_r
11384 case "$d_ctime_r" in
11386 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11387 case "$d_ctime_r_proto:$usethreads" in
11388 ":define") d_ctime_r_proto=define
11389 set d_ctime_r_proto ctime_r $hdrs
11393 case "$d_ctime_r_proto" in
11395 case "$ctime_r_proto" in
11396 ''|0) try='char* ctime_r(const time_t*, char*);'
11397 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11399 case "$ctime_r_proto" in
11400 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11401 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11403 case "$ctime_r_proto" in
11404 ''|0) try='int ctime_r(const time_t*, char*);'
11405 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11407 case "$ctime_r_proto" in
11408 ''|0) try='int ctime_r(const time_t*, char*, int);'
11409 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11411 case "$ctime_r_proto" in
11412 ''|0) d_ctime_r=undef
11414 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11415 * ) case "$ctime_r_proto" in
11416 REENTRANT_PROTO*) ;;
11417 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11419 echo "Prototype: $try" ;;
11422 *) case "$usethreads" in
11423 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11434 : see if cuserid exists
11435 set cuserid d_cuserid
11438 : see if this is a limits.h system
11439 set limits.h i_limits
11442 : see if this is a float.h system
11443 set float.h i_float
11446 : See if number of significant digits in a double precision number is known
11448 $cat >dbl_dig.c <<EOM
11449 #$i_limits I_LIMITS
11452 #include <limits.h>
11458 printf("Contains DBL_DIG");
11461 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11462 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11463 echo "DBL_DIG found." >&4
11466 echo "DBL_DIG NOT found." >&4
11473 : see if dbm.h is available
11474 : see if dbmclose exists
11475 set dbmclose d_dbmclose
11478 case "$d_dbmclose" in
11488 *) set rpcsvc/dbm.h i_rpcsvcdbm
11493 *) echo "We won't be including <dbm.h>"
11503 : see if prototype for dbminit is available
11505 set d_dbminitproto dbminit $i_dbm dbm.h
11508 : see if difftime exists
11509 set difftime d_difftime
11512 : see if this is a dirent system
11514 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11516 echo "<dirent.h> found." >&4
11519 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11520 echo "<sys/dir.h> found." >&4
11523 xinc=`./findhdr sys/ndir.h`
11525 echo "<dirent.h> NOT found." >&4
11530 : Look for type of directory structure.
11532 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11534 case "$direntrytype" in
11536 case "$i_dirent" in
11537 $define) guess1='struct dirent' ;;
11538 *) guess1='struct direct' ;;
11541 *) guess1="$direntrytype"
11546 'struct dirent') guess2='struct direct' ;;
11547 *) guess2='struct dirent' ;;
11550 if $contains "$guess1" try.c >/dev/null 2>&1; then
11551 direntrytype="$guess1"
11552 echo "Your directory entries are $direntrytype." >&4
11553 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11554 direntrytype="$guess2"
11555 echo "Your directory entries seem to be $direntrytype." >&4
11557 echo "I don't recognize your system's directory entries." >&4
11558 rp="What type is used for directory entries on this system?"
11561 direntrytype="$ans"
11565 : see if the directory entry stores field length
11567 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11568 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11569 echo "Good, your directory entry keeps length information in d_namlen." >&4
11572 echo "Your directory entry does not know about the d_namlen field." >&4
11579 : Look for DIR.dd_fd
11580 case "$i_dirent" in
11582 echo "Checking to see if DIR has a dd_fd member variable" >&4
11584 #$i_stdlib I_STDLIB
11586 #include <stdlib.h>
11588 #include <dirent.h>
11598 if eval $compile; then
11599 echo "Yes, it does."
11602 echo "No, it does not."
11607 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11615 : see if this is an sysdir system
11616 set sys/dir.h i_sysdir
11619 : see if this is an sysndir system
11620 set sys/ndir.h i_sysndir
11625 $cat >dirfd.c <<EOM
11627 #$i_stdlib I_STDLIB
11629 #include <stdlib.h>
11631 #$i_dirent I_DIRENT /**/
11632 #$i_sysdir I_SYS_DIR /**/
11633 #$i_sysndir I_SYS_NDIR /**/
11634 #$i_systypes I_SYS_TYPES /**/
11635 #if defined(I_SYS_TYPES)
11636 #include <sys/types.h>
11638 #if defined(I_DIRENT)
11639 #include <dirent.h>
11640 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11641 #include <sys/dir.h>
11645 #include <sys/ndir.h>
11649 #include <ndir.h> /* may be wrong in the future */
11651 #include <sys/dir.h>
11657 DIR *dirp = opendir(".");
11658 if (dirfd(dirp) >= 0)
11666 if eval $compile; then
11670 $define) echo "dirfd() found." >&4 ;;
11671 *) echo "dirfd() NOT found." >&4 ;;
11677 : see if dlerror exists
11680 set dlerror d_dlerror
11684 : see if dlfcn is available
11685 set dlfcn.h i_dlfcn
11688 : Check what extension to use for shared libs
11693 On a few systems, the dynamically loaded modules that perl generates and uses
11694 will need a different extension than shared libs. The default will probably
11700 *) dflt="$dlext" ;;
11702 rp='What is the extension of dynamically loaded modules'
11711 : Check if dlsym need a leading underscore
11717 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11718 $cat >dyna.c <<'EOM'
11725 #$i_stdlib I_STDLIB
11727 #include <stdlib.h>
11731 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11733 #include <sys/types.h>
11738 extern int fred() ;
11747 int mode = RTLD_LAZY ;
11749 handle = dlopen("./dyna.$dlext", mode) ;
11750 if (handle == NULL) {
11755 symbol = dlsym(handle, "fred") ;
11756 if (symbol == NULL) {
11757 /* try putting a leading underscore */
11758 symbol = dlsym(handle, "_fred") ;
11759 if (symbol == NULL) {
11772 : Call the object file tmp-dyna.o in case dlext=o.
11773 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11774 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11775 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11776 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11779 1) echo "Test program failed using dlopen." >&4
11780 echo "Perhaps you should not use dynamic loading." >&4;;
11781 2) echo "Test program failed using dlsym." >&4
11782 echo "Perhaps you should not use dynamic loading." >&4;;
11783 3) echo "dlsym needs a leading underscore" >&4
11785 4) echo "dlsym doesn't need a leading underscore." >&4;;
11788 echo "I can't compile and run the test program." >&4
11789 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11794 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11799 : see if drand48_r exists
11800 set drand48_r d_drand48_r
11802 case "$d_drand48_r" in
11804 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11805 case "$d_drand48_r_proto:$usethreads" in
11806 ":define") d_drand48_r_proto=define
11807 set d_drand48_r_proto drand48_r $hdrs
11811 case "$d_drand48_r_proto" in
11813 case "$drand48_r_proto" in
11814 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11815 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11817 case "$drand48_r_proto" in
11818 ''|0) d_drand48_r=undef
11820 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11821 * ) case "$drand48_r_proto" in
11822 REENTRANT_PROTO*) ;;
11823 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11825 echo "Prototype: $try" ;;
11828 *) case "$usethreads" in
11829 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11836 *) drand48_r_proto=0
11840 : see if prototype for drand48 is available
11842 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11845 : see if dup2 exists
11849 : see if eaccess exists
11850 set eaccess d_eaccess
11853 : see if endgrent exists
11854 set endgrent d_endgrent
11857 : see if this is an grp system
11863 xxx=`./findhdr grp.h`
11864 $cppstdin $cppflags $cppminus < $xxx >$$.h
11866 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11878 set d_grpasswd; eval $setvar
11882 : see if endgrent_r exists
11883 set endgrent_r d_endgrent_r
11885 case "$d_endgrent_r" in
11887 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11888 case "$d_endgrent_r_proto:$usethreads" in
11889 ":define") d_endgrent_r_proto=define
11890 set d_endgrent_r_proto endgrent_r $hdrs
11894 case "$d_endgrent_r_proto" in
11896 case "$endgrent_r_proto" in
11897 ''|0) try='int endgrent_r(FILE**);'
11898 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11900 case "$endgrent_r_proto" in
11901 ''|0) try='void endgrent_r(FILE**);'
11902 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11904 case "$endgrent_r_proto" in
11905 ''|0) d_endgrent_r=undef
11907 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11908 * ) case "$endgrent_r_proto" in
11909 REENTRANT_PROTO*) ;;
11910 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11912 echo "Prototype: $try" ;;
11915 *) case "$usethreads" in
11916 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11923 *) endgrent_r_proto=0
11927 : see if endhostent exists
11928 set endhostent d_endhent
11931 : see if this is a netdb.h system
11932 set netdb.h i_netdb
11935 : see if endhostent_r exists
11936 set endhostent_r d_endhostent_r
11938 case "$d_endhostent_r" in
11940 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11941 case "$d_endhostent_r_proto:$usethreads" in
11942 ":define") d_endhostent_r_proto=define
11943 set d_endhostent_r_proto endhostent_r $hdrs
11947 case "$d_endhostent_r_proto" in
11949 case "$endhostent_r_proto" in
11950 ''|0) try='int endhostent_r(struct hostent_data*);'
11951 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11953 case "$endhostent_r_proto" in
11954 ''|0) try='void endhostent_r(struct hostent_data*);'
11955 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11957 case "$endhostent_r_proto" in
11958 ''|0) d_endhostent_r=undef
11959 endhostent_r_proto=0
11960 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11961 * ) case "$endhostent_r_proto" in
11962 REENTRANT_PROTO*) ;;
11963 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11965 echo "Prototype: $try" ;;
11968 *) case "$usethreads" in
11969 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11971 d_endhostent_r=undef
11972 endhostent_r_proto=0
11976 *) endhostent_r_proto=0
11980 : see if endnetent exists
11981 set endnetent d_endnent
11984 : see if endnetent_r exists
11985 set endnetent_r d_endnetent_r
11987 case "$d_endnetent_r" in
11989 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11990 case "$d_endnetent_r_proto:$usethreads" in
11991 ":define") d_endnetent_r_proto=define
11992 set d_endnetent_r_proto endnetent_r $hdrs
11996 case "$d_endnetent_r_proto" in
11998 case "$endnetent_r_proto" in
11999 ''|0) try='int endnetent_r(struct netent_data*);'
12000 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
12002 case "$endnetent_r_proto" in
12003 ''|0) try='void endnetent_r(struct netent_data*);'
12004 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
12006 case "$endnetent_r_proto" in
12007 ''|0) d_endnetent_r=undef
12008 endnetent_r_proto=0
12009 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12010 * ) case "$endnetent_r_proto" in
12011 REENTRANT_PROTO*) ;;
12012 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12014 echo "Prototype: $try" ;;
12017 *) case "$usethreads" in
12018 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12020 d_endnetent_r=undef
12021 endnetent_r_proto=0
12025 *) endnetent_r_proto=0
12029 : see if endprotoent exists
12030 set endprotoent d_endpent
12033 : see if endprotoent_r exists
12034 set endprotoent_r d_endprotoent_r
12036 case "$d_endprotoent_r" in
12038 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12039 case "$d_endprotoent_r_proto:$usethreads" in
12040 ":define") d_endprotoent_r_proto=define
12041 set d_endprotoent_r_proto endprotoent_r $hdrs
12045 case "$d_endprotoent_r_proto" in
12047 case "$endprotoent_r_proto" in
12048 ''|0) try='int endprotoent_r(struct protoent_data*);'
12049 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12051 case "$endprotoent_r_proto" in
12052 ''|0) try='void endprotoent_r(struct protoent_data*);'
12053 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12055 case "$endprotoent_r_proto" in
12056 ''|0) d_endprotoent_r=undef
12057 endprotoent_r_proto=0
12058 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12059 * ) case "$endprotoent_r_proto" in
12060 REENTRANT_PROTO*) ;;
12061 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12063 echo "Prototype: $try" ;;
12066 *) case "$usethreads" in
12067 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12069 d_endprotoent_r=undef
12070 endprotoent_r_proto=0
12074 *) endprotoent_r_proto=0
12078 : see if endpwent exists
12079 set endpwent d_endpwent
12082 : see if this is a pwd.h system
12088 xxx=`./findhdr pwd.h`
12089 $cppstdin $cppflags $cppminus < $xxx >$$.h
12091 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12099 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12107 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12115 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12123 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12131 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12139 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12147 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12159 set d_pwquota; eval $setvar
12160 set d_pwage; eval $setvar
12161 set d_pwchange; eval $setvar
12162 set d_pwclass; eval $setvar
12163 set d_pwexpire; eval $setvar
12164 set d_pwcomment; eval $setvar
12165 set d_pwgecos; eval $setvar
12166 set d_pwpasswd; eval $setvar
12170 : see if endpwent_r exists
12171 set endpwent_r d_endpwent_r
12173 case "$d_endpwent_r" in
12175 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12176 case "$d_endpwent_r_proto:$usethreads" in
12177 ":define") d_endpwent_r_proto=define
12178 set d_endpwent_r_proto endpwent_r $hdrs
12182 case "$d_endpwent_r_proto" in
12184 case "$endpwent_r_proto" in
12185 ''|0) try='int endpwent_r(FILE**);'
12186 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12188 case "$endpwent_r_proto" in
12189 ''|0) try='void endpwent_r(FILE**);'
12190 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12192 case "$endpwent_r_proto" in
12193 ''|0) d_endpwent_r=undef
12195 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12196 * ) case "$endpwent_r_proto" in
12197 REENTRANT_PROTO*) ;;
12198 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12200 echo "Prototype: $try" ;;
12203 *) case "$usethreads" in
12204 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12211 *) endpwent_r_proto=0
12215 : see if endservent exists
12216 set endservent d_endsent
12219 : see if endservent_r exists
12220 set endservent_r d_endservent_r
12222 case "$d_endservent_r" in
12224 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12225 case "$d_endservent_r_proto:$usethreads" in
12226 ":define") d_endservent_r_proto=define
12227 set d_endservent_r_proto endservent_r $hdrs
12231 case "$d_endservent_r_proto" in
12233 case "$endservent_r_proto" in
12234 ''|0) try='int endservent_r(struct servent_data*);'
12235 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12237 case "$endservent_r_proto" in
12238 ''|0) try='void endservent_r(struct servent_data*);'
12239 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12241 case "$endservent_r_proto" in
12242 ''|0) d_endservent_r=undef
12243 endservent_r_proto=0
12244 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12245 * ) case "$endservent_r_proto" in
12246 REENTRANT_PROTO*) ;;
12247 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12249 echo "Prototype: $try" ;;
12252 *) case "$usethreads" in
12253 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12255 d_endservent_r=undef
12256 endservent_r_proto=0
12260 *) endservent_r_proto=0
12264 : Locate the flags for 'open()'
12267 #include <sys/types.h>
12272 #include <sys/file.h>
12274 #$i_stdlib I_STDLIB
12276 #include <stdlib.h>
12287 : check sys/file.h first to get FREAD on Sun
12288 if $test `./findhdr sys/file.h` && \
12289 set try -DI_SYS_FILE && eval $compile; then
12291 echo "<sys/file.h> defines the O_* constants..." >&4
12292 if $run ./try; then
12293 echo "and you have the 3 argument form of open()." >&4
12296 echo "but not the 3 argument form of open(). Oh, well." >&4
12299 elif $test `./findhdr fcntl.h` && \
12300 set try -DI_FCNTL && eval $compile; then
12302 echo "<fcntl.h> defines the O_* constants..." >&4
12303 if $run ./try; then
12304 echo "and you have the 3 argument form of open()." >&4
12307 echo "but not the 3 argument form of open(). Oh, well." >&4
12312 echo "I can't find the O_* constant definitions! You got problems." >&4
12318 : script used to emit important warnings
12321 if test \$# -gt 0; then
12326 echo "*** WARNING:" >&4
12327 sed -e 's/^/*** /' <msg >&4
12329 cat msg >>config.msg
12330 echo " " >>config.msg
12336 : see which of string.h or strings.h is needed
12338 strings=`./findhdr string.h`
12339 if $test "$strings" && $test -r "$strings"; then
12340 echo "Using <string.h> instead of <strings.h>." >&4
12344 strings=`./findhdr strings.h`
12345 if $test "$strings" && $test -r "$strings"; then
12346 echo "Using <strings.h> instead of <string.h>." >&4
12348 ./warn "No string header found -- You'll surely have problems."
12353 case "$i_string" in
12354 "$undef") strings=`./findhdr strings.h`;;
12355 *) strings=`./findhdr string.h`;;
12358 : see if this is a sys/file.h system
12363 : do we need to include sys/file.h ?
12367 if $h_sysfile; then
12369 echo "We'll be including <sys/file.h>." >&4
12372 echo "We won't be including <sys/file.h>." >&4
12382 : see if fcntl.h is there
12387 : see if we can include fcntl.h
12393 echo "We'll be including <fcntl.h>." >&4
12396 if $h_sysfile; then
12397 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12399 echo "We won't be including <fcntl.h>." >&4
12411 : see if fork exists
12415 : see if pipe exists
12419 : check for non-blocking I/O stuff
12420 case "$h_sysfile" in
12421 true) echo "#include <sys/file.h>" > head.c;;
12424 true) echo "#include <fcntl.h>" > head.c;;
12425 *) echo "#include <sys/fcntl.h>" > head.c;;
12430 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12431 case "$o_nonblock" in
12433 $cat head.c > try.c
12434 $cat >>try.c <<EOCP
12436 #$i_stdlib I_STDLIB
12438 #include <stdlib.h>
12446 printf("O_NONBLOCK\n");
12450 printf("O_NDELAY\n");
12454 printf("FNDELAY\n");
12461 if eval $compile_ok; then
12462 o_nonblock=`$run ./try`
12463 case "$o_nonblock" in
12464 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12465 *) echo "Seems like we can use $o_nonblock.";;
12468 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12471 *) echo "Using $hint value $o_nonblock.";;
12476 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12479 case "$d_fork:$d_pipe" in
12481 $cat head.c > try.c
12482 $cat >>try.c <<EOCP
12484 #include <sys/types.h>
12485 #include <signal.h>
12487 #$i_stdlib I_STDLIB
12489 #include <stdlib.h>
12495 #define MY_O_NONBLOCK $o_nonblock
12496 #ifndef errno /* XXX need better Configure test */
12499 #$i_unistd I_UNISTD
12501 #include <unistd.h>
12503 #$i_string I_STRING
12505 #include <string.h>
12507 #include <strings.h>
12509 $signal_t blech(int x) { exit(3); }
12511 $cat >> try.c <<'EOCP'
12519 pipe(pd); /* Down: child -> parent */
12520 pipe(pu); /* Up: parent -> child */
12523 close(pd[1]); /* Parent reads from pd[0] */
12524 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12526 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12531 signal(SIGALRM, blech);
12533 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12535 sprintf(string, "%d\n", ret);
12536 write(2, string, strlen(string));
12539 if (errno == EAGAIN) {
12540 printf("EAGAIN\n");
12545 if (errno == EWOULDBLOCK)
12546 printf("EWOULDBLOCK\n");
12549 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12550 sleep(2); /* Give it time to close our pipe */
12552 ret = read(pd[0], buf, 1); /* Should read EOF */
12554 sprintf(string, "%d\n", ret);
12555 write(4, string, strlen(string));
12559 close(pd[0]); /* We write to pd[1] */
12560 close(pu[1]); /* We read from pu[0] */
12561 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12562 close(pd[1]); /* Pipe pd is now fully closed! */
12563 exit(0); /* Bye bye, thank you for playing! */
12567 if eval $compile_ok; then
12568 echo "$startsh" >mtry
12569 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12571 ./mtry >/dev/null 2>&1
12573 0) eagain=`$cat try.out`;;
12574 1) echo "Could not perform non-blocking setting!";;
12575 2) echo "I did a successful read() for something that was not there!";;
12576 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12577 4) echo "Could not find F_SETFL!";;
12578 *) echo "Something terribly wrong happened during testing.";;
12580 rd_nodata=`$cat try.ret`
12581 echo "A read() system call with no data present returns $rd_nodata."
12582 case "$rd_nodata" in
12585 echo "(That's peculiar, fixing that to be -1.)"
12591 echo "Forcing errno EAGAIN on read() with no data available."
12595 echo "Your read() sets errno to $eagain when no data is available."
12598 status=`$cat try.err`
12600 0) echo "And it correctly returns 0 to signal EOF.";;
12601 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12602 *) echo "However, your read() returns '$status' on EOF??";;
12605 if test "$status" = "$rd_nodata"; then
12606 echo "WARNING: you can't distinguish between EOF and no data!"
12610 echo "I can't compile the test program--assuming errno EAGAIN will do."
12614 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12623 echo "Using $hint value $eagain."
12624 echo "Your read() returns $rd_nodata when no data is present."
12625 case "$d_eofnblk" in
12626 "$define") echo "And you can see EOF because read() returns 0.";;
12627 "$undef") echo "But you can't see EOF status from read() returned value.";;
12629 echo "(Assuming you can't see EOF status from read anyway.)"
12635 $rm_try head.c mtry
12637 : see if _ptr and _cnt from stdio act std
12640 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12641 echo "(Looks like you have stdio.h from BSD.)"
12642 case "$stdio_ptr" in
12643 '') stdio_ptr='((fp)->_p)'
12646 *) ptr_lval=$d_stdio_ptr_lval;;
12648 case "$stdio_cnt" in
12649 '') stdio_cnt='((fp)->_r)'
12652 *) cnt_lval=$d_stdio_cnt_lval;;
12654 case "$stdio_base" in
12655 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12657 case "$stdio_bufsiz" in
12658 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12660 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12661 echo "(Looks like you have stdio.h from Linux.)"
12662 case "$stdio_ptr" in
12663 '') stdio_ptr='((fp)->_IO_read_ptr)'
12666 *) ptr_lval=$d_stdio_ptr_lval;;
12668 case "$stdio_cnt" in
12669 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12672 *) cnt_lval=$d_stdio_cnt_lval;;
12674 case "$stdio_base" in
12675 '') stdio_base='((fp)->_IO_read_base)';;
12677 case "$stdio_bufsiz" in
12678 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12681 case "$stdio_ptr" in
12682 '') stdio_ptr='((fp)->_ptr)'
12685 *) ptr_lval=$d_stdio_ptr_lval;;
12687 case "$stdio_cnt" in
12688 '') stdio_cnt='((fp)->_cnt)'
12691 *) cnt_lval=$d_stdio_cnt_lval;;
12693 case "$stdio_base" in
12694 '') stdio_base='((fp)->_base)';;
12696 case "$stdio_bufsiz" in
12697 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12701 : test whether _ptr and _cnt really work
12702 echo "Checking how std your stdio is..." >&4
12705 #$i_stdlib I_STDLIB
12707 #include <stdlib.h>
12709 #define FILE_ptr(fp) $stdio_ptr
12710 #define FILE_cnt(fp) $stdio_cnt
12712 FILE *fp = fopen("try.c", "r");
12715 18 <= FILE_cnt(fp) &&
12716 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12724 if eval $compile && $to try.c; then
12725 if $run ./try; then
12726 echo "Your stdio acts pretty std."
12729 echo "Your stdio isn't very std."
12732 echo "Your stdio doesn't appear very std."
12736 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12737 # direct buffer manipulation no longer works. The Configure tests
12738 # should be changed to correctly detect this, but until then,
12739 # the following check should at least let perl compile and run.
12740 # (This quick fix should be updated before 5.8.1.)
12741 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12742 # A. Dougherty, June 3, 2002.
12743 case "$d_gnulibc" in
12745 case "$gnulibc_version" in
12749 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12758 : Can _ptr be used as an lvalue?
12759 case "$d_stdstdio$ptr_lval" in
12760 $define$define) val=$define ;;
12763 set d_stdio_ptr_lval
12766 : Can _cnt be used as an lvalue?
12767 case "$d_stdstdio$cnt_lval" in
12768 $define$define) val=$define ;;
12771 set d_stdio_cnt_lval
12775 : test whether setting _ptr sets _cnt as a side effect
12776 d_stdio_ptr_lval_sets_cnt="$undef"
12777 d_stdio_ptr_lval_nochange_cnt="$undef"
12778 case "$d_stdio_ptr_lval$d_stdstdio" in
12780 echo "Checking to see what happens if we set the stdio ptr..." >&4
12783 /* Can we scream? */
12784 /* Eat dust sed :-) */
12785 /* In the buffer space, no one can hear you scream. */
12786 #$i_stdlib I_STDLIB
12788 #include <stdlib.h>
12790 #define FILE_ptr(fp) $stdio_ptr
12791 #define FILE_cnt(fp) $stdio_cnt
12792 #include <sys/types.h>
12794 FILE *fp = fopen("try.c", "r");
12799 puts("Fail even to read");
12802 c = getc(fp); /* Read away the first # */
12804 puts("Fail even to read");
12808 18 <= FILE_cnt(fp) &&
12809 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12811 puts("Fail even to read");
12814 ptr = (char*) FILE_ptr(fp);
12815 cnt = (size_t)FILE_cnt(fp);
12817 FILE_ptr(fp) += 42;
12819 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12820 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12823 if (FILE_cnt(fp) <= 20) {
12824 printf ("Fail (<20 chars to test)");
12827 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12828 puts("Fail compare");
12831 if (cnt == FILE_cnt(fp)) {
12832 puts("Pass_unchanged");
12835 if (FILE_cnt(fp) == (cnt - 42)) {
12836 puts("Pass_changed");
12839 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12845 if eval $compile && $to try.c; then
12846 case `$run ./try` in
12848 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12849 d_stdio_ptr_lval_sets_cnt="$define" ;;
12851 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12852 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12854 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12856 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12859 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12865 : see if _base is also standard
12867 case "$d_stdstdio" in
12871 #$i_stdlib I_STDLIB
12873 #include <stdlib.h>
12875 #define FILE_base(fp) $stdio_base
12876 #define FILE_bufsiz(fp) $stdio_bufsiz
12878 FILE *fp = fopen("try.c", "r");
12881 19 <= FILE_bufsiz(fp) &&
12882 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12889 if eval $compile && $to try.c; then
12890 if $run ./try; then
12891 echo "And its _base field acts std."
12894 echo "But its _base field isn't std."
12897 echo "However, it seems to be lacking the _base field."
12905 : see if fast_stdio exists
12907 case "$d_stdstdio:$d_stdio_ptr_lval" in
12909 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12911 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12922 : see if fchdir exists
12923 set fchdir d_fchdir
12926 : see if fchmod exists
12927 set fchmod d_fchmod
12930 : see if fchown exists
12931 set fchown d_fchown
12934 : see if this is an fcntl system
12938 : See if fcntl-based locking works.
12941 #$i_stdlib I_STDLIB
12943 #include <stdlib.h>
12945 #include <unistd.h>
12947 #include <signal.h>
12948 $signal_t blech(int x) { exit(3); }
12950 #if defined(F_SETLK) && defined(F_SETLKW)
12951 struct flock flock;
12953 fd = open("try.c", O_RDONLY);
12954 flock.l_type = F_RDLCK;
12955 flock.l_whence = SEEK_SET;
12956 flock.l_start = flock.l_len = 0;
12957 signal(SIGALRM, blech);
12959 retval = fcntl(fd, F_SETLK, &flock);
12961 (retval < 0 ? exit(2) : exit(0));
12967 echo "Checking if fcntl-based file locking works... "
12971 if eval $compile_ok; then
12972 if $run ./try; then
12973 echo "Yes, it seems to work."
12976 echo "Nope, it didn't work."
12981 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12982 *** This is (almost) impossible.
12983 *** If your NFS lock daemons are not feeling well, something like
12984 *** this may happen, please investigate. Cannot continue, aborting.
12992 echo "I'm unable to compile the test program, so I'll assume not."
12997 echo "Nope, since you don't even have fcntl()."
13000 set d_fcntl_can_lock
13004 : check for fd_set items
13007 Checking to see how well your C compiler handles fd_set and friends ...
13010 #$i_stdlib I_STDLIB
13012 #include <stdlib.h>
13014 #$i_systime I_SYS_TIME
13015 #$i_sysselct I_SYS_SELECT
13016 #$d_socket HAS_SOCKET
13017 #include <sys/types.h>
13019 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13022 #include <sys/time.h>
13024 #ifdef I_SYS_SELECT
13025 #include <sys/select.h>
13034 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13042 if eval $compile; then
13043 d_fds_bits="$define"
13045 echo "Well, your system knows about the normal fd_set typedef..." >&4
13046 if $run ./try; then
13047 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13048 d_fd_macros="$define"
13051 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13053 d_fd_macros="$undef"
13057 Hmm, your compiler has some difficulty with fd_set. Checking further...
13060 if eval $compile; then
13061 d_fds_bits="$undef"
13063 echo "Well, your system has some sort of fd_set available..." >&4
13064 if $run ./try; then
13065 echo "and you have the normal fd_set macros." >&4
13066 d_fd_macros="$define"
13069 but not the normal fd_set macros! Gross! More work for me...
13071 d_fd_macros="$undef"
13074 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13076 d_fds_bits="$undef"
13077 d_fd_macros="$undef"
13082 : see if fgetpos exists
13083 set fgetpos d_fgetpos
13086 : see if finite exists
13087 set finite d_finite
13090 : see if finitel exists
13091 set finitel d_finitel
13094 : see if flock exists
13098 : see if prototype for flock is available
13100 set d_flockproto flock $i_sysfile sys/file.h
13103 : see if fp_class exists
13104 set fp_class d_fp_class
13107 : see if pathconf exists
13108 set pathconf d_pathconf
13111 : see if fpathconf exists
13112 set fpathconf d_fpathconf
13115 : see if fpclass exists
13116 set fpclass d_fpclass
13119 : see if fpclassify exists
13120 set fpclassify d_fpclassify
13123 : see if fpclassl exists
13124 set fpclassl d_fpclassl
13127 : check for fpos64_t
13129 echo "Checking to see if you have fpos64_t..." >&4
13132 int main() { fpos64_t x = 7; }
13135 if eval $compile; then
13137 echo "You have fpos64_t."
13140 echo "You do not have fpos64_t."
13141 case "$fpossize" in
13142 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13149 : see if frexpl exists
13150 set frexpl d_frexpl
13153 : see if this is a sys/param system
13154 set sys/param.h i_sysparam
13157 : see if this is a sys/mount.h system
13158 set sys/mount.h i_sysmount
13161 : Check for fs_data_s
13163 echo "Checking to see if your system supports struct fs_data..." >&4
13164 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13166 case "$d_fs_data_s" in
13167 "$define") echo "Yes, it does." ;;
13168 *) echo "No, it doesn't." ;;
13171 : see if fseeko exists
13172 set fseeko d_fseeko
13174 case "$longsize" in
13175 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13178 : see if fsetpos exists
13179 set fsetpos d_fsetpos
13182 : see if fstatfs exists
13183 set fstatfs d_fstatfs
13186 : see if statvfs exists
13187 set statvfs d_statvfs
13190 : see if fstatvfs exists
13191 set fstatvfs d_fstatvfs
13195 : see if fsync exists
13199 : see if ftello exists
13200 set ftello d_ftello
13202 case "$longsize" in
13203 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13206 : check for a working futimes
13209 echo "Checking if you have a working futimes()" >&4
13212 #include <sys/time.h>
13219 fd = open ("try.c", O_RDWR);
13220 if (-1 == fd) exit (1);
13221 rv = futimes (fd, NULL);
13222 exit (rv == -1 ? errno : 0);
13226 if eval $compile; then
13230 0) echo "Yes, you have" >&4
13231 d_futimes="$define"
13233 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13237 echo "No, it does not (probably harmless)" >&4
13241 : see if getcwd exists
13242 set getcwd d_getcwd
13245 : see if getespwnam exists
13246 set getespwnam d_getespwnam
13249 : see if getfsstat exists
13250 set getfsstat d_getfsstat
13253 : see if getgrent exists
13254 set getgrent d_getgrent
13257 : see if getgrent_r exists
13258 set getgrent_r d_getgrent_r
13260 case "$d_getgrent_r" in
13262 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13263 case "$d_getgrent_r_proto:$usethreads" in
13264 ":define") d_getgrent_r_proto=define
13265 set d_getgrent_r_proto getgrent_r $hdrs
13269 case "$d_getgrent_r_proto" in
13271 case "$getgrent_r_proto" in
13272 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13273 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13275 case "$getgrent_r_proto" in
13276 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13277 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13279 case "$getgrent_r_proto" in
13280 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13281 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13283 case "$getgrent_r_proto" in
13284 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13285 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13287 case "$getgrent_r_proto" in
13288 ''|0) try='int getgrent_r(struct group*, char*, int);'
13289 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13291 case "$getgrent_r_proto" in
13292 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13293 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13295 case "$getgrent_r_proto" in
13296 ''|0) d_getgrent_r=undef
13298 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13299 * ) case "$getgrent_r_proto" in
13300 REENTRANT_PROTO*) ;;
13301 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13303 echo "Prototype: $try" ;;
13306 *) case "$usethreads" in
13307 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13314 *) getgrent_r_proto=0
13318 : see if getgrgid_r exists
13319 set getgrgid_r d_getgrgid_r
13321 case "$d_getgrgid_r" in
13323 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13324 case "$d_getgrgid_r_proto:$usethreads" in
13325 ":define") d_getgrgid_r_proto=define
13326 set d_getgrgid_r_proto getgrgid_r $hdrs
13330 case "$d_getgrgid_r_proto" in
13332 case "$getgrgid_r_proto" in
13333 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13334 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13336 case "$getgrgid_r_proto" in
13337 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13338 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13340 case "$getgrgid_r_proto" in
13341 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13342 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13344 case "$getgrgid_r_proto" in
13345 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13346 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13348 case "$getgrgid_r_proto" in
13349 ''|0) d_getgrgid_r=undef
13351 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13352 * ) case "$getgrgid_r_proto" in
13353 REENTRANT_PROTO*) ;;
13354 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13356 echo "Prototype: $try" ;;
13359 *) case "$usethreads" in
13360 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13367 *) getgrgid_r_proto=0
13371 : see if getgrnam_r exists
13372 set getgrnam_r d_getgrnam_r
13374 case "$d_getgrnam_r" in
13376 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13377 case "$d_getgrnam_r_proto:$usethreads" in
13378 ":define") d_getgrnam_r_proto=define
13379 set d_getgrnam_r_proto getgrnam_r $hdrs
13383 case "$d_getgrnam_r_proto" in
13385 case "$getgrnam_r_proto" in
13386 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13387 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13389 case "$getgrnam_r_proto" in
13390 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13391 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13393 case "$getgrnam_r_proto" in
13394 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13395 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13397 case "$getgrnam_r_proto" in
13398 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13399 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13401 case "$getgrnam_r_proto" in
13402 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13403 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13405 case "$getgrnam_r_proto" in
13406 ''|0) d_getgrnam_r=undef
13408 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13409 * ) case "$getgrnam_r_proto" in
13410 REENTRANT_PROTO*) ;;
13411 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13413 echo "Prototype: $try" ;;
13416 *) case "$usethreads" in
13417 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13424 *) getgrnam_r_proto=0
13428 : see if gethostbyaddr exists
13429 set gethostbyaddr d_gethbyaddr
13432 : see if gethostbyname exists
13433 set gethostbyname d_gethbyname
13436 : see if gethostent exists
13437 set gethostent d_gethent
13440 : see how we will look up host name
13443 if set gethostname val -f d_gethname; eval $csym; $val; then
13444 echo 'gethostname() found.' >&4
13445 d_gethname="$define"
13448 if set uname val -f d_uname; eval $csym; $val; then
13451 uname() was found, but you're running xenix, and older versions of xenix
13452 have a broken uname(). If you don't really know whether your xenix is old
13453 enough to have a broken system call, use the default answer.
13458 "$define") dflt=n;;
13460 rp='Is your uname() broken?'
13463 n*) d_uname="$define"; call=uname;;
13466 echo 'uname() found.' >&4
13473 case "$d_gethname" in
13474 '') d_gethname="$undef";;
13477 '') d_uname="$undef";;
13479 case "$d_uname$d_gethname" in
13484 Every now and then someone has a $call() that lies about the hostname
13485 but can't be fixed for political or economic reasons. If you wish, I can
13486 pretend $call() isn't there and maybe compute hostname at run-time
13487 thanks to the '$phostname' command.
13490 rp="Shall I ignore $call() from now on?"
13493 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13496 case "$phostname" in
13497 '') aphostname='';;
13498 *) case "$aphostname" in
13500 *) set X $phostname
13504 file=`./loc $file $file $pth`
13505 aphostname=`echo $file $*`
13510 case "$d_uname$d_gethname" in
13513 case "$phostname" in
13515 echo "There will be no way for $package to get your hostname." >&4;;
13517 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13521 case "$d_phostname" in
13522 '') d_phostname="$undef";;
13525 : see if gethostbyaddr_r exists
13526 set gethostbyaddr_r d_gethostbyaddr_r
13528 case "$d_gethostbyaddr_r" in
13530 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13531 case "$d_gethostbyaddr_r_proto:$usethreads" in
13532 ":define") d_gethostbyaddr_r_proto=define
13533 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13537 case "$d_gethostbyaddr_r_proto" in
13539 case "$gethostbyaddr_r_proto" in
13540 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13541 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13543 case "$gethostbyaddr_r_proto" in
13544 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13545 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13547 case "$gethostbyaddr_r_proto" in
13548 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13549 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13551 case "$gethostbyaddr_r_proto" in
13552 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13553 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13555 case "$gethostbyaddr_r_proto" in
13556 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13557 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13559 case "$gethostbyaddr_r_proto" in
13560 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13561 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13563 case "$gethostbyaddr_r_proto" in
13564 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13565 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13567 case "$gethostbyaddr_r_proto" in
13568 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13569 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13571 case "$gethostbyaddr_r_proto" in
13572 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13573 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13575 case "$gethostbyaddr_r_proto" in
13576 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13577 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13579 case "$gethostbyaddr_r_proto" in
13580 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13581 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13583 case "$gethostbyaddr_r_proto" in
13584 ''|0) d_gethostbyaddr_r=undef
13585 gethostbyaddr_r_proto=0
13586 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13587 * ) case "$gethostbyaddr_r_proto" in
13588 REENTRANT_PROTO*) ;;
13589 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13591 echo "Prototype: $try" ;;
13594 *) case "$usethreads" in
13595 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13597 d_gethostbyaddr_r=undef
13598 gethostbyaddr_r_proto=0
13602 *) gethostbyaddr_r_proto=0
13606 : see if gethostbyname_r exists
13607 set gethostbyname_r d_gethostbyname_r
13609 case "$d_gethostbyname_r" in
13611 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13612 case "$d_gethostbyname_r_proto:$usethreads" in
13613 ":define") d_gethostbyname_r_proto=define
13614 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13618 case "$d_gethostbyname_r_proto" in
13620 case "$gethostbyname_r_proto" in
13621 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13622 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13624 case "$gethostbyname_r_proto" in
13625 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13626 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13628 case "$gethostbyname_r_proto" in
13629 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13630 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13632 case "$gethostbyname_r_proto" in
13633 ''|0) d_gethostbyname_r=undef
13634 gethostbyname_r_proto=0
13635 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13636 * ) case "$gethostbyname_r_proto" in
13637 REENTRANT_PROTO*) ;;
13638 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13640 echo "Prototype: $try" ;;
13643 *) case "$usethreads" in
13644 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13646 d_gethostbyname_r=undef
13647 gethostbyname_r_proto=0
13651 *) gethostbyname_r_proto=0
13655 : see if gethostent_r exists
13656 set gethostent_r d_gethostent_r
13658 case "$d_gethostent_r" in
13660 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13661 case "$d_gethostent_r_proto:$usethreads" in
13662 ":define") d_gethostent_r_proto=define
13663 set d_gethostent_r_proto gethostent_r $hdrs
13667 case "$d_gethostent_r_proto" in
13669 case "$gethostent_r_proto" in
13670 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13671 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13673 case "$gethostent_r_proto" in
13674 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13675 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13677 case "$gethostent_r_proto" in
13678 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13679 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13681 case "$gethostent_r_proto" in
13682 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13683 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13685 case "$gethostent_r_proto" in
13686 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13687 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13689 case "$gethostent_r_proto" in
13690 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13691 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13693 case "$gethostent_r_proto" in
13694 ''|0) d_gethostent_r=undef
13695 gethostent_r_proto=0
13696 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13697 * ) case "$gethostent_r_proto" in
13698 REENTRANT_PROTO*) ;;
13699 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13701 echo "Prototype: $try" ;;
13704 *) case "$usethreads" in
13705 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13707 d_gethostent_r=undef
13708 gethostent_r_proto=0
13712 *) gethostent_r_proto=0
13716 : see if prototypes for various gethostxxx netdb.h functions are available
13718 set d_gethostprotos gethostent $i_netdb netdb.h
13721 : see if getitimer exists
13722 set getitimer d_getitimer
13725 : see if getlogin exists
13726 set getlogin d_getlogin
13729 : see if getlogin_r exists
13730 set getlogin_r d_getlogin_r
13732 case "$d_getlogin_r" in
13734 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13735 case "$d_getlogin_r_proto:$usethreads" in
13736 ":define") d_getlogin_r_proto=define
13737 set d_getlogin_r_proto getlogin_r $hdrs
13741 case "$d_getlogin_r_proto" in
13743 case "$getlogin_r_proto" in
13744 ''|0) try='int getlogin_r(char*, size_t);'
13745 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13747 case "$getlogin_r_proto" in
13748 ''|0) try='int getlogin_r(char*, int);'
13749 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13751 case "$getlogin_r_proto" in
13752 ''|0) try='char* getlogin_r(char*, size_t);'
13753 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13755 case "$getlogin_r_proto" in
13756 ''|0) try='char* getlogin_r(char*, int);'
13757 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13759 case "$getlogin_r_proto" in
13760 ''|0) d_getlogin_r=undef
13762 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13763 * ) case "$getlogin_r_proto" in
13764 REENTRANT_PROTO*) ;;
13765 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13767 echo "Prototype: $try" ;;
13770 *) case "$usethreads" in
13771 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13778 *) getlogin_r_proto=0
13782 : see if getmnt exists
13783 set getmnt d_getmnt
13786 : see if getmntent exists
13787 set getmntent d_getmntent
13790 : see if getnetbyaddr exists
13791 set getnetbyaddr d_getnbyaddr
13794 : see if getnetbyname exists
13795 set getnetbyname d_getnbyname
13798 : see if getnetent exists
13799 set getnetent d_getnent
13802 : see if getnetbyaddr_r exists
13803 set getnetbyaddr_r d_getnetbyaddr_r
13805 case "$d_getnetbyaddr_r" in
13807 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13808 case "$d_getnetbyaddr_r_proto:$usethreads" in
13809 ":define") d_getnetbyaddr_r_proto=define
13810 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13814 case "$d_getnetbyaddr_r_proto" in
13816 case "$getnetbyaddr_r_proto" in
13817 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13818 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13820 case "$getnetbyaddr_r_proto" in
13821 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13822 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13824 case "$getnetbyaddr_r_proto" in
13825 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13826 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13828 case "$getnetbyaddr_r_proto" in
13829 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13830 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13832 case "$getnetbyaddr_r_proto" in
13833 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13834 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13836 case "$getnetbyaddr_r_proto" in
13837 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13838 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13840 case "$getnetbyaddr_r_proto" in
13841 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13842 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13844 case "$getnetbyaddr_r_proto" in
13845 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13846 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13848 case "$getnetbyaddr_r_proto" in
13849 ''|0) d_getnetbyaddr_r=undef
13850 getnetbyaddr_r_proto=0
13851 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13852 * ) case "$getnetbyaddr_r_proto" in
13853 REENTRANT_PROTO*) ;;
13854 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13856 echo "Prototype: $try" ;;
13859 *) case "$usethreads" in
13860 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13862 d_getnetbyaddr_r=undef
13863 getnetbyaddr_r_proto=0
13867 *) getnetbyaddr_r_proto=0
13871 : see if getnetbyname_r exists
13872 set getnetbyname_r d_getnetbyname_r
13874 case "$d_getnetbyname_r" in
13876 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13877 case "$d_getnetbyname_r_proto:$usethreads" in
13878 ":define") d_getnetbyname_r_proto=define
13879 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13883 case "$d_getnetbyname_r_proto" in
13885 case "$getnetbyname_r_proto" in
13886 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13887 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13889 case "$getnetbyname_r_proto" in
13890 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13891 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13893 case "$getnetbyname_r_proto" in
13894 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13895 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13897 case "$getnetbyname_r_proto" in
13898 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13899 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13901 case "$getnetbyname_r_proto" in
13902 ''|0) d_getnetbyname_r=undef
13903 getnetbyname_r_proto=0
13904 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13905 * ) case "$getnetbyname_r_proto" in
13906 REENTRANT_PROTO*) ;;
13907 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13909 echo "Prototype: $try" ;;
13912 *) case "$usethreads" in
13913 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13915 d_getnetbyname_r=undef
13916 getnetbyname_r_proto=0
13920 *) getnetbyname_r_proto=0
13924 : see if getnetent_r exists
13925 set getnetent_r d_getnetent_r
13927 case "$d_getnetent_r" in
13929 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13930 case "$d_getnetent_r_proto:$usethreads" in
13931 ":define") d_getnetent_r_proto=define
13932 set d_getnetent_r_proto getnetent_r $hdrs
13936 case "$d_getnetent_r_proto" in
13938 case "$getnetent_r_proto" in
13939 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13940 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13942 case "$getnetent_r_proto" in
13943 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13944 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13946 case "$getnetent_r_proto" in
13947 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13948 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13950 case "$getnetent_r_proto" in
13951 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13952 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13954 case "$getnetent_r_proto" in
13955 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13956 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13958 case "$getnetent_r_proto" in
13959 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13960 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13962 case "$getnetent_r_proto" in
13963 ''|0) d_getnetent_r=undef
13964 getnetent_r_proto=0
13965 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13966 * ) case "$getnetent_r_proto" in
13967 REENTRANT_PROTO*) ;;
13968 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13970 echo "Prototype: $try" ;;
13973 *) case "$usethreads" in
13974 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13976 d_getnetent_r=undef
13977 getnetent_r_proto=0
13981 *) getnetent_r_proto=0
13985 : see if prototypes for various getnetxxx netdb.h functions are available
13987 set d_getnetprotos getnetent $i_netdb netdb.h
13990 : see if getpagesize exists
13991 set getpagesize d_getpagsz
13994 : Optional checks for getprotobyname and getprotobynumber
13996 : see if getprotobyname exists
13997 set getprotobyname d_getpbyname
14000 : see if getprotobynumber exists
14001 set getprotobynumber d_getpbynumber
14004 : see if getprotoent exists
14005 set getprotoent d_getpent
14008 : see if getpgid exists
14009 set getpgid d_getpgid
14012 : see if getpgrp2 exists
14013 set getpgrp2 d_getpgrp2
14016 : see if getppid exists
14017 set getppid d_getppid
14020 : see if getpriority exists
14021 set getpriority d_getprior
14024 : see if getprotobyname_r exists
14025 set getprotobyname_r d_getprotobyname_r
14027 case "$d_getprotobyname_r" in
14029 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14030 case "$d_getprotobyname_r_proto:$usethreads" in
14031 ":define") d_getprotobyname_r_proto=define
14032 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14036 case "$d_getprotobyname_r_proto" in
14038 case "$getprotobyname_r_proto" in
14039 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14040 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14042 case "$getprotobyname_r_proto" in
14043 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14044 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14046 case "$getprotobyname_r_proto" in
14047 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14048 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14050 case "$getprotobyname_r_proto" in
14051 ''|0) d_getprotobyname_r=undef
14052 getprotobyname_r_proto=0
14053 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14054 * ) case "$getprotobyname_r_proto" in
14055 REENTRANT_PROTO*) ;;
14056 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14058 echo "Prototype: $try" ;;
14061 *) case "$usethreads" in
14062 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14064 d_getprotobyname_r=undef
14065 getprotobyname_r_proto=0
14069 *) getprotobyname_r_proto=0
14073 : see if getprotobynumber_r exists
14074 set getprotobynumber_r d_getprotobynumber_r
14076 case "$d_getprotobynumber_r" in
14078 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14079 case "$d_getprotobynumber_r_proto:$usethreads" in
14080 ":define") d_getprotobynumber_r_proto=define
14081 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14085 case "$d_getprotobynumber_r_proto" in
14087 case "$getprotobynumber_r_proto" in
14088 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14089 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14091 case "$getprotobynumber_r_proto" in
14092 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14093 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14095 case "$getprotobynumber_r_proto" in
14096 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14097 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14099 case "$getprotobynumber_r_proto" in
14100 ''|0) d_getprotobynumber_r=undef
14101 getprotobynumber_r_proto=0
14102 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14103 * ) case "$getprotobynumber_r_proto" in
14104 REENTRANT_PROTO*) ;;
14105 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14107 echo "Prototype: $try" ;;
14110 *) case "$usethreads" in
14111 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14113 d_getprotobynumber_r=undef
14114 getprotobynumber_r_proto=0
14118 *) getprotobynumber_r_proto=0
14122 : see if getprotoent_r exists
14123 set getprotoent_r d_getprotoent_r
14125 case "$d_getprotoent_r" in
14127 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14128 case "$d_getprotoent_r_proto:$usethreads" in
14129 ":define") d_getprotoent_r_proto=define
14130 set d_getprotoent_r_proto getprotoent_r $hdrs
14134 case "$d_getprotoent_r_proto" in
14136 case "$getprotoent_r_proto" in
14137 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14138 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14140 case "$getprotoent_r_proto" in
14141 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14142 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14144 case "$getprotoent_r_proto" in
14145 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14146 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14148 case "$getprotoent_r_proto" in
14149 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14150 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14152 case "$getprotoent_r_proto" in
14153 ''|0) d_getprotoent_r=undef
14154 getprotoent_r_proto=0
14155 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14156 * ) case "$getprotoent_r_proto" in
14157 REENTRANT_PROTO*) ;;
14158 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14160 echo "Prototype: $try" ;;
14163 *) case "$usethreads" in
14164 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14166 d_getprotoent_r=undef
14167 getprotoent_r_proto=0
14171 *) getprotoent_r_proto=0
14175 : see if prototypes for various getprotoxxx netdb.h functions are available
14177 set d_getprotoprotos getprotoent $i_netdb netdb.h
14180 : see if getprpwnam exists
14181 set getprpwnam d_getprpwnam
14184 : see if getpwent exists
14185 set getpwent d_getpwent
14188 : see if getpwent_r exists
14189 set getpwent_r d_getpwent_r
14191 case "$d_getpwent_r" in
14193 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14194 case "$d_getpwent_r_proto:$usethreads" in
14195 ":define") d_getpwent_r_proto=define
14196 set d_getpwent_r_proto getpwent_r $hdrs
14200 case "$d_getpwent_r_proto" in
14202 case "$getpwent_r_proto" in
14203 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14204 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14206 case "$getpwent_r_proto" in
14207 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14208 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14210 case "$getpwent_r_proto" in
14211 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14212 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14214 case "$getpwent_r_proto" in
14215 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14216 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14218 case "$getpwent_r_proto" in
14219 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14220 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14222 case "$getpwent_r_proto" in
14223 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14224 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14226 case "$getpwent_r_proto" in
14227 ''|0) d_getpwent_r=undef
14229 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14230 * ) case "$getpwent_r_proto" in
14231 REENTRANT_PROTO*) ;;
14232 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14234 echo "Prototype: $try" ;;
14237 *) case "$usethreads" in
14238 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14245 *) getpwent_r_proto=0
14249 : see if getpwnam_r exists
14250 set getpwnam_r d_getpwnam_r
14252 case "$d_getpwnam_r" in
14254 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14255 case "$d_getpwnam_r_proto:$usethreads" in
14256 ":define") d_getpwnam_r_proto=define
14257 set d_getpwnam_r_proto getpwnam_r $hdrs
14261 case "$d_getpwnam_r_proto" in
14263 case "$getpwnam_r_proto" in
14264 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14265 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14267 case "$getpwnam_r_proto" in
14268 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14269 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14271 case "$getpwnam_r_proto" in
14272 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14273 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14275 case "$getpwnam_r_proto" in
14276 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14277 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14279 case "$getpwnam_r_proto" in
14280 ''|0) d_getpwnam_r=undef
14282 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14283 * ) case "$getpwnam_r_proto" in
14284 REENTRANT_PROTO*) ;;
14285 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14287 echo "Prototype: $try" ;;
14290 *) case "$usethreads" in
14291 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14298 *) getpwnam_r_proto=0
14302 : see if getpwuid_r exists
14303 set getpwuid_r d_getpwuid_r
14305 case "$d_getpwuid_r" in
14307 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14308 case "$d_getpwuid_r_proto:$usethreads" in
14309 ":define") d_getpwuid_r_proto=define
14310 set d_getpwuid_r_proto getpwuid_r $hdrs
14314 case "$d_getpwuid_r_proto" in
14316 case "$getpwuid_r_proto" in
14317 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14318 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14320 case "$getpwuid_r_proto" in
14321 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14322 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14324 case "$getpwuid_r_proto" in
14325 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14326 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14328 case "$getpwuid_r_proto" in
14329 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14330 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14332 case "$getpwuid_r_proto" in
14333 ''|0) d_getpwuid_r=undef
14335 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14336 * ) case "$getpwuid_r_proto" in
14337 REENTRANT_PROTO*) ;;
14338 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14340 echo "Prototype: $try" ;;
14343 *) case "$usethreads" in
14344 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14351 *) getpwuid_r_proto=0
14355 : Optional checks for getsbyname and getsbyport
14357 : see if getservbyname exists
14358 set getservbyname d_getsbyname
14361 : see if getservbyport exists
14362 set getservbyport d_getsbyport
14365 : see if getservent exists
14366 set getservent d_getsent
14369 : see if getservbyname_r exists
14370 set getservbyname_r d_getservbyname_r
14372 case "$d_getservbyname_r" in
14374 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14375 case "$d_getservbyname_r_proto:$usethreads" in
14376 ":define") d_getservbyname_r_proto=define
14377 set d_getservbyname_r_proto getservbyname_r $hdrs
14381 case "$d_getservbyname_r_proto" in
14383 case "$getservbyname_r_proto" in
14384 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14385 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14387 case "$getservbyname_r_proto" in
14388 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14389 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14391 case "$getservbyname_r_proto" in
14392 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14393 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14395 case "$getservbyname_r_proto" in
14396 ''|0) d_getservbyname_r=undef
14397 getservbyname_r_proto=0
14398 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14399 * ) case "$getservbyname_r_proto" in
14400 REENTRANT_PROTO*) ;;
14401 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14403 echo "Prototype: $try" ;;
14406 *) case "$usethreads" in
14407 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14409 d_getservbyname_r=undef
14410 getservbyname_r_proto=0
14414 *) getservbyname_r_proto=0
14418 : see if getservbyport_r exists
14419 set getservbyport_r d_getservbyport_r
14421 case "$d_getservbyport_r" in
14423 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14424 case "$d_getservbyport_r_proto:$usethreads" in
14425 ":define") d_getservbyport_r_proto=define
14426 set d_getservbyport_r_proto getservbyport_r $hdrs
14430 case "$d_getservbyport_r_proto" in
14432 case "$getservbyport_r_proto" in
14433 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14434 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14436 case "$getservbyport_r_proto" in
14437 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14438 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14440 case "$getservbyport_r_proto" in
14441 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14442 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14444 case "$getservbyport_r_proto" in
14445 ''|0) d_getservbyport_r=undef
14446 getservbyport_r_proto=0
14447 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14448 * ) case "$getservbyport_r_proto" in
14449 REENTRANT_PROTO*) ;;
14450 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14452 echo "Prototype: $try" ;;
14455 *) case "$usethreads" in
14456 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14458 d_getservbyport_r=undef
14459 getservbyport_r_proto=0
14463 *) getservbyport_r_proto=0
14467 : see if getservent_r exists
14468 set getservent_r d_getservent_r
14470 case "$d_getservent_r" in
14472 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14473 case "$d_getservent_r_proto:$usethreads" in
14474 ":define") d_getservent_r_proto=define
14475 set d_getservent_r_proto getservent_r $hdrs
14479 case "$d_getservent_r_proto" in
14481 case "$getservent_r_proto" in
14482 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14483 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14485 case "$getservent_r_proto" in
14486 ''|0) try='int getservent_r(struct servent*, char*, int);'
14487 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14489 case "$getservent_r_proto" in
14490 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14491 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14493 case "$getservent_r_proto" in
14494 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14495 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14497 case "$getservent_r_proto" in
14498 ''|0) d_getservent_r=undef
14499 getservent_r_proto=0
14500 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14501 * ) case "$getservent_r_proto" in
14502 REENTRANT_PROTO*) ;;
14503 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14505 echo "Prototype: $try" ;;
14508 *) case "$usethreads" in
14509 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14511 d_getservent_r=undef
14512 getservent_r_proto=0
14516 *) getservent_r_proto=0
14520 : see if prototypes for various getservxxx netdb.h functions are available
14522 set d_getservprotos getservent $i_netdb netdb.h
14525 : see if getspnam exists
14526 set getspnam d_getspnam
14529 : see if this is a shadow.h system
14530 set shadow.h i_shadow
14533 : see if getspnam_r exists
14534 set getspnam_r d_getspnam_r
14536 case "$d_getspnam_r" in
14538 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14539 case "$d_getspnam_r_proto:$usethreads" in
14540 ":define") d_getspnam_r_proto=define
14541 set d_getspnam_r_proto getspnam_r $hdrs
14545 case "$d_getspnam_r_proto" in
14547 case "$getspnam_r_proto" in
14548 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14549 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14551 case "$getspnam_r_proto" in
14552 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14553 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14555 case "$getspnam_r_proto" in
14556 ''|0) d_getspnam_r=undef
14558 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14559 * ) case "$getspnam_r_proto" in
14560 REENTRANT_PROTO*) ;;
14561 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14563 echo "Prototype: $try" ;;
14566 *) case "$usethreads" in
14567 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14574 *) getspnam_r_proto=0
14578 : see if gettimeofday or ftime exists
14579 set gettimeofday d_gettimeod
14581 case "$d_gettimeod" in
14587 val="$undef"; set d_ftime; eval $setvar
14590 case "$d_gettimeod$d_ftime" in
14593 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14597 : see if gmtime_r exists
14598 set gmtime_r d_gmtime_r
14600 case "$d_gmtime_r" in
14602 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14603 case "$d_gmtime_r_proto:$usethreads" in
14604 ":define") d_gmtime_r_proto=define
14605 set d_gmtime_r_proto gmtime_r $hdrs
14609 case "$d_gmtime_r_proto" in
14611 case "$gmtime_r_proto" in
14612 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14613 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14615 case "$gmtime_r_proto" in
14616 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14617 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14619 case "$gmtime_r_proto" in
14620 ''|0) d_gmtime_r=undef
14622 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14623 * ) case "$gmtime_r_proto" in
14624 REENTRANT_PROTO*) ;;
14625 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14627 echo "Prototype: $try" ;;
14630 *) case "$usethreads" in
14631 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14638 *) gmtime_r_proto=0
14642 : see if hasmntopt exists
14643 set hasmntopt d_hasmntopt
14646 : see if this is a netinet/in.h or sys/in.h system
14647 set netinet/in.h i_niin sys/in.h i_sysin
14650 : see if arpa/inet.h has to be included
14651 set arpa/inet.h i_arpainet
14654 : see if htonl --and friends-- exists
14659 : Maybe they are macros.
14662 $cat >htonl.c <<EOM
14664 #include <sys/types.h>
14665 #$i_niin I_NETINET_IN
14667 #$i_arpainet I_ARPA_INET
14668 #ifdef I_NETINET_IN
14669 #include <netinet/in.h>
14672 #include <sys/in.h>
14675 #include <arpa/inet.h>
14678 printf("Defined as a macro.");
14681 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14682 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14684 echo "But it seems to be defined as a macro." >&4
14692 : see if ilogbl exists
14693 set ilogbl d_ilogbl
14698 if set index val -f; eval $csym; $val; then
14699 if set strchr val -f d_strchr; eval $csym; $val; then
14700 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14703 echo "strchr() found." >&4
14707 echo "index() found." >&4
14712 echo "index() found." >&4
14715 if set strchr val -f d_strchr; eval $csym; $val; then
14718 echo "strchr() found." >&4
14720 echo "No index() or strchr() found!" >&4
14725 set d_strchr; eval $setvar
14727 set d_index; eval $setvar
14729 : check whether inet_aton exists
14730 set inet_aton d_inetaton
14735 $cat >isascii.c <<EOCP
14738 #$i_stdlib I_STDLIB
14740 #include <stdlib.h>
14751 if eval $compile; then
14752 echo "isascii() found." >&4
14755 echo "isascii() NOT found." >&4
14762 : see if isfinite exists
14763 set isfinite d_isfinite
14766 : see if isinf exists
14770 : see if isnan exists
14774 : see if isnanl exists
14775 set isnanl d_isnanl
14778 : see if killpg exists
14779 set killpg d_killpg
14782 : see if lchown exists
14784 $cat > try.c <<'EOCP'
14785 /* System header to define __stub macros and hopefully few prototypes,
14786 which can conflict with char lchown(); below. */
14787 #include <assert.h>
14788 /* Override any gcc2 internal prototype to avoid an error. */
14789 /* We use char because int might match the return type of a gcc2
14790 builtin and then its argument prototype would still apply. */
14793 /* The GNU C library defines this for functions which it implements
14794 to always fail with ENOSYS. Some functions are actually named
14795 something starting with __ and the normal name is an alias. */
14796 #if defined (__stub_lchown) || defined (__stub___lchown)
14804 if eval $compile; then
14805 $echo "lchown() found." >&4
14808 $echo "lchown() NOT found." >&4
14814 : See if number of significant digits in a double precision number is known
14816 $cat >ldbl_dig.c <<EOM
14817 #$i_limits I_LIMITS
14820 #include <limits.h>
14826 printf("Contains LDBL_DIG");
14829 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14830 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14831 echo "LDBL_DIG found." >&4
14834 echo "LDBL_DIG NOT found." >&4
14841 : see if this is a math.h system
14845 : check to see if math.h defines _LIB_VERSION
14846 d_libm_lib_version="$undef"
14850 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14852 #include <unistd.h>
14854 int main (int argc, char *argv[])
14856 printf ("%d\n", _LIB_VERSION);
14861 if eval $compile; then
14863 echo "Yes, it does ($foo)" >&4
14864 d_libm_lib_version="$define"
14866 echo "No, it does not (probably harmless)" >&4
14873 : see if link exists
14877 : see if localtime_r exists
14878 set localtime_r d_localtime_r
14880 case "$d_localtime_r" in
14882 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14883 case "$d_localtime_r_proto:$usethreads" in
14884 ":define") d_localtime_r_proto=define
14885 set d_localtime_r_proto localtime_r $hdrs
14889 case "$d_localtime_r_proto" in
14891 case "$localtime_r_proto" in
14892 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14893 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14895 case "$localtime_r_proto" in
14896 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14897 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14899 case "$localtime_r_proto" in
14900 ''|0) d_localtime_r=undef
14901 localtime_r_proto=0
14902 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14903 * ) case "$localtime_r_proto" in
14904 REENTRANT_PROTO*) ;;
14905 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14907 echo "Prototype: $try" ;;
14910 *) case "$usethreads" in
14911 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14913 d_localtime_r=undef
14914 localtime_r_proto=0
14918 *) localtime_r_proto=0
14922 : see if localtime_r calls tzset
14923 case "$localtime_r_proto" in
14926 /* Does our libc's localtime_r call tzset ?
14927 * return 0 if so, 1 otherwise.
14929 #include <sys/types.h>
14930 #include <unistd.h>
14932 #include <string.h>
14933 #include <malloc.h>
14936 time_t t = time(0L);
14937 char w_tz[]="TZ" "=GMT+5",
14938 e_tz[]="TZ" "=GMT-5",
14939 *tz_e = (char*)malloc(16),
14940 *tz_w = (char*)malloc(16);
14941 struct tm tm_e, tm_w;
14942 memset(&tm_e,'\0',sizeof(struct tm));
14943 memset(&tm_w,'\0',sizeof(struct tm));
14948 localtime_r(&t, &tm_e);
14951 localtime_r(&t, &tm_w);
14953 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14959 if eval $compile; then
14960 if $run ./try; then
14961 d_localtime_r_needs_tzset=undef;
14963 d_localtime_r_needs_tzset=define;
14966 d_localtime_r_needs_tzset=undef;
14970 d_localtime_r_needs_tzset=undef;
14975 : see if localeconv exists
14976 set localeconv d_locconv
14979 : see if lockf exists
14983 : see if prototype for lseek is available
14985 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14988 : see if lstat exists
14992 : see if madvise exists
14993 set madvise d_madvise
14996 : see if malloc_size exists
14997 set malloc_size d_malloc_size
15000 : see if malloc_size_good exists
15001 set malloc_good_size d_malloc_good_size
15004 : see if mblen exists
15008 : see if mbstowcs exists
15009 set mbstowcs d_mbstowcs
15012 : see if mbtowc exists
15013 set mbtowc d_mbtowc
15016 : see if memchr exists
15017 set memchr d_memchr
15020 : see if memcmp exists
15021 set memcmp d_memcmp
15024 : see if memcpy exists
15025 set memcpy d_memcpy
15028 : see if memmove exists
15029 set memmove d_memmove
15032 : see if memset exists
15033 set memset d_memset
15036 : see if mkdir exists
15040 : see if mkdtemp exists
15041 set mkdtemp d_mkdtemp
15044 : see if mkfifo exists
15045 set mkfifo d_mkfifo
15048 : see if mkstemp exists
15049 set mkstemp d_mkstemp
15052 : see if mkstemps exists
15053 set mkstemps d_mkstemps
15056 : see if mktime exists
15057 set mktime d_mktime
15060 : see if this is a sys/mman.h system
15061 set sys/mman.h i_sysmman
15064 : see if mmap exists
15067 : see what shmat returns
15068 : default to something harmless
15070 case "$i_sysmman$d_mmap" in
15072 $cat >mmap.c <<'END'
15073 #include <sys/mman.h>
15076 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15081 echo "and it returns ($mmaptype)." >&4
15087 : see if sqrtl exists
15091 : see if scalbnl exists
15092 set scalbnl d_scalbnl
15095 : see if modfl exists
15099 : see if prototype for modfl is available
15101 set d_modflproto modfl $i_math math.h
15104 d_modfl_pow32_bug="$undef"
15106 case "$d_longdbl$d_modfl" in
15109 Checking to see whether your modfl() is okay for large values...
15115 if $test "X$d_modflproto" != "X$define"; then
15116 $cat >>try.c <<EOCP
15117 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15118 long double modfl (long double, long double *);
15121 $cat >>try.c <<EOCP
15123 long double nv = 4294967303.15;
15129 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15133 case "$osname:$gccversion" in
15134 aix:) saveccflags="$ccflags"
15135 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15138 if eval $compile; then
15141 *" 4294967303.150000 1.150000 4294967302.000000")
15142 echo >&4 "Your modfl() is broken for large values."
15143 d_modfl_pow32_bug="$define"
15145 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15149 *" 4294967303.150000 0.150000 4294967303.000000")
15150 echo >&4 "Your modfl() seems okay for large values."
15152 *) echo >&4 "I don't understand your modfl() at all."
15158 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15161 case "$osname:$gccversion" in
15162 aix:) ccflags="$saveccflags" ;; # restore
15167 if $test "$uselongdouble" = "$define"; then
15169 if $test "$d_sqrtl" != "$define"; then
15170 message="$message sqrtl"
15172 if $test "$d_modfl" != "$define"; then
15173 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15174 echo "You have both aintl and copysignl, so I can emulate modfl."
15176 message="$message modfl"
15179 if $test "$d_frexpl" != "$define"; then
15180 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15181 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15183 message="$message frexpl"
15187 if $test "$message" != ""; then
15190 *** You requested the use of long doubles but you do not seem to have
15191 *** the following mathematical functions needed for long double support:
15193 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15194 *** Cannot continue, aborting.
15202 : see if mprotect exists
15203 set mprotect d_mprotect
15206 : see if msgctl exists
15207 set msgctl d_msgctl
15210 : see if msgget exists
15211 set msgget d_msgget
15214 : see if msgsnd exists
15215 set msgsnd d_msgsnd
15218 : see if msgrcv exists
15219 set msgrcv d_msgrcv
15222 : see how much of the 'msg*(2)' library is present.
15225 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15226 *"$undef"*) h_msg=false;;
15230 case "`ipcs 2>&1`" in
15231 "SVID messages"*"not configured"*)
15232 echo "Your $osname does not have the msg*(2) configured." >&4
15235 set msgctl d_msgctl
15237 set msgget d_msgget
15239 set msgsnd d_msgsnd
15241 set msgrcv d_msgrcv
15247 : we could also check for sys/ipc.h ...
15248 if $h_msg && $test `./findhdr sys/msg.h`; then
15249 echo "You have the full msg*(2) library." >&4
15252 echo "You don't have the full msg*(2) library." >&4
15258 : Check for msghdr_s
15260 echo "Checking to see if your system supports struct msghdr..." >&4
15261 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15263 case "$d_msghdr_s" in
15264 "$define") echo "Yes, it does." ;;
15265 *) echo "No, it doesn't." ;;
15269 : see if msync exists
15273 : see if munmap exists
15274 set munmap d_munmap
15277 : see if nice exists
15281 : see if this is a langinfo.h system
15282 set langinfo.h i_langinfo
15285 : see if nl_langinfo exists
15286 set nl_langinfo d_nl_langinfo
15289 : check for volatile keyword
15291 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15292 $cat >try.c <<'EOCP'
15295 typedef struct _goo_struct goo_struct;
15296 goo_struct * volatile goo = ((goo_struct *)0);
15297 struct _goo_struct {
15302 typedef unsigned short foo_t;
15303 char *volatile foo;
15305 volatile foo_t blech;
15309 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15311 echo "Yup, it does."
15314 echo "Nope, it doesn't."
15320 : Check basic sizes
15322 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15324 case "$use64bitint:$d_quad:$quadtype" in
15327 uvtype="$uquadtype"
15332 uvtype="unsigned long"
15338 case "$uselongdouble:$d_longdbl" in
15340 nvtype="long double"
15341 nvsize=$longdblsize
15348 $echo "(IV will be "$ivtype", $ivsize bytes)"
15349 $echo "(UV will be "$uvtype", $uvsize bytes)"
15350 $echo "(NV will be "$nvtype", $nvsize bytes)"
15353 #$i_inttypes I_INTTYPES
15355 #include <inttypes.h>
15360 int8_t i = INT8_MAX;
15361 uint8_t u = UINT8_MAX;
15362 printf("int8_t\n");
15365 int16_t i = INT16_MAX;
15366 uint16_t i = UINT16_MAX;
15367 printf("int16_t\n");
15370 int32_t i = INT32_MAX;
15371 uint32_t u = UINT32_MAX;
15372 printf("int32_t\n");
15377 i8type="signed char"
15378 u8type="unsigned char"
15383 '') case "$shortsize" in
15385 u16type="unsigned short"
15393 '') set try -DINT16
15394 if eval $compile; then
15395 case "`$run ./try`" in
15407 '') if $test $shortsize -ge 2; then
15409 u16type="unsigned short"
15417 '') case "$longsize" in
15419 u32type="unsigned long"
15423 *) case "$intsize" in
15425 u32type="unsigned int"
15435 '') set try -DINT32
15436 if eval $compile; then
15437 case "`$run ./try`" in
15449 '') if $test $intsize -ge 4; then
15451 u32type="unsigned int"
15459 '') case "$d_quad:$quadtype" in
15461 i64type="$quadtype"
15462 u64type="$uquadtype"
15470 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15471 : volatile so that the compiler has to store it out to memory.
15472 if test X"$d_volatile" = X"$define"; then
15477 #$i_stdlib I_STDLIB
15479 #include <stdlib.h>
15481 #include <sys/types.h>
15482 #include <signal.h>
15484 $volatile int bletched = 0;
15485 $signal_t blech(int s) { bletched = 1; }
15490 int n = 8 * $uvsize;
15493 signal(SIGFPE, blech);
15496 for (i = 0; i < n; i++) {
15497 u = u << 1 | ($uvtype)1;
15499 if (($uvtype)d != u)
15503 d = ($nvtype)(u - 1);
15504 if (($uvtype)d != (u - 1))
15511 printf("%d\n", ((i == n) ? -n : i));
15517 d_nv_preserves_uv="$undef"
15518 if eval $compile; then
15519 nv_preserves_uv_bits="`$run ./try`"
15521 case "$nv_preserves_uv_bits" in
15523 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15524 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15525 d_nv_preserves_uv="$define"
15527 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15528 d_nv_preserves_uv="$undef" ;;
15529 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15530 nv_preserves_uv_bits="0" ;;
15534 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15535 : volatile so that the compiler has to store it out to memory.
15536 if test X"$d_volatile" = X"$define"; then
15542 typedef $nvtype NV;
15549 while(count < 256) {
15550 $volatile NV up = value + 1.0;
15551 $volatile NV negated = -value;
15552 $volatile NV down = negated - 1.0;
15553 $volatile NV got_up = up - value;
15554 int up_good = got_up == 1.0;
15555 int got_down = down - negated;
15556 int down_good = got_down == -1.0;
15558 if (down_good != up_good) {
15560 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15561 up_good, (double) got_up, down_good, (double) got_down,
15562 count, (double) value);
15569 fputs("256.0", stdout);
15572 fputs("2.0", stdout);
15578 fputs("*", stdout);
15584 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15585 count, (double) value);
15591 nv_overflows_integers_at='0'
15592 if eval $compile; then
15598 The largest integer your NVs can preserve is equal to $xxx
15600 nv_overflows_integers_at="$xxx"
15603 Cannot determine the largest integer value your NVs can hold, unexpected output
15610 Cannot determine the largest integer value your NVs can hold
15617 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15618 : volatile so that the compiler has to store it out to memory.
15619 if test X"$d_volatile" = X"$define"; then
15624 #$i_stdlib I_STDLIB
15626 #include <stdlib.h>
15628 #$i_string I_STRING
15630 # include <string.h>
15632 # include <strings.h>
15634 #include <sys/types.h>
15635 #include <signal.h>
15637 $volatile int bletched = 0;
15638 $signal_t blech(int s) { bletched = 1; }
15641 int checkit($nvtype d, char *where) {
15642 unsigned char *p = (char *)&d;
15643 unsigned char *end = p + sizeof(d);
15653 printf("No - %s: 0x", where);
15655 printf ("%02X", *p++);
15660 int main(int argc, char **argv) {
15663 fail += checkit(d, "0.0");
15665 /* The compiler shouldn't be assuming that bletched is 0 */
15668 fail += checkit(d, "bleched");
15671 signal(SIGFPE, blech);
15674 /* Paranoia - the compiler should have no way of knowing that ANSI says
15675 that argv[argc] will always be NULL. Actually, if it did assume this it
15676 would be buggy, as this is C and main() can be called from elsewhere in
15678 d = argv[argc] ? 1 : 0;
15681 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15684 fail += checkit(d, "ternary");
15686 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15689 printf("No - memset doesn't give 0.0\n");
15690 /* This might just blow up: */
15691 printf("(gives %g)\n", d);
15697 printf("No - something bleched\n");
15702 printf("No - %d fail(s)\n", fail);
15711 d_nv_zero_is_allbits_zero="$undef"
15712 if eval $compile; then
15718 0.0 is represented as all bits zero in memory
15720 d_nv_zero_is_allbits_zero="$define"
15723 0.0 is not represented as all bits zero in memory
15725 d_nv_zero_is_allbits_zero="$undef"
15730 0.0 is not represented as all bits zero in memory
15732 d_nv_zero_is_allbits_zero="$undef"
15738 : check for off64_t
15740 echo "Checking to see if you have off64_t..." >&4
15742 #include <sys/types.h>
15743 #include <unistd.h>
15744 int main() { off64_t x = 7; }
15747 if eval $compile; then
15749 echo "You have off64_t."
15752 echo "You do not have off64_t."
15753 case "$lseeksize" in
15754 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15761 : how to create joinable pthreads
15762 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15764 echo "Checking what constant to use for creating joinable pthreads..." >&4
15765 $cat >try.c <<'EOCP'
15766 #include <pthread.h>
15768 int detachstate = JOINABLE;
15771 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15772 if eval $compile; then
15773 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15774 val="$undef" # Yes, undef.
15775 set d_old_pthread_create_joinable
15778 set old_pthread_create_joinable
15781 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15782 if eval $compile; then
15783 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15785 set d_old_pthread_create_joinable
15787 val=PTHREAD_CREATE_UNDETACHED
15788 set old_pthread_create_joinable
15791 set try -DJOINABLE=__UNDETACHED
15792 if eval $compile; then
15793 echo "You seem to use __UNDETACHED." >&4
15795 set d_old_pthread_create_joinable
15798 set old_pthread_create_joinable
15801 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15803 set d_old_pthread_create_joinable
15806 set old_pthread_create_joinable
15813 d_old_pthread_create_joinable="$undef"
15814 old_pthread_create_joinable=""
15817 : see if pause exists
15821 : see if poll exists
15825 : see if readlink exists
15826 set readlink d_readlink
15829 : Check if exe is symlink to abs path of executing program
15833 case "$d_readlink" in
15835 if $issymlink /proc/self/exe ; then
15836 $ls -l /proc/self/exe > reflect
15837 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15838 echo "You have Linux-like /proc/self/exe."
15839 procselfexe='"/proc/self/exe"'
15843 if $issymlink /proc/curproc/file ; then
15844 $ls -l /proc/curproc/file > reflect
15845 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15846 echo "You have BSD-like /proc/curproc/file."
15847 procselfexe='"/proc/curproc/file"'
15857 : backward compatibility for d_hvfork
15858 if test X$d_hvfork != X; then
15859 d_vfork="$d_hvfork"
15862 : see if there is a vfork
15867 d_pseudofork=$undef
15869 : Ok, but do we want to use it. vfork is reportedly unreliable in
15870 : perl on Solaris 2.x, and probably elsewhere.
15874 case "$usevfork" in
15880 Perl can only use a vfork() that doesn't suffer from strict
15881 restrictions on calling functions or modifying global data in
15882 the child. For example, glibc-2.1 contains such a vfork()
15883 that is unsuitable. If your system provides a proper fork()
15884 call, chances are that you do NOT want perl to use vfork().
15887 rp="Do you still want to use vfork()?"
15892 echo "Ok, we won't use vfork()."
15901 $define) usevfork='true';;
15902 *) usevfork='false';;
15905 : see whether the pthread_atfork exists
15907 #include <pthread.h>
15910 #ifdef PTHREAD_ATFORK
15911 pthread_atfork(NULL,NULL,NULL);
15916 : see if pthread_atfork exists
15917 set try -DPTHREAD_ATFORK
15918 if eval $compile; then
15923 case "$usethreads" in
15926 $define) echo 'pthread_atfork found.' >&4 ;;
15927 *) echo 'pthread_atfork NOT found.' >&4 ;;
15930 set d_pthread_atfork
15933 : see if pthread_attr_setscope exists
15934 set pthread_attr_setscope d_pthread_attr_setscope
15937 : see whether the various POSIXish _yields exist
15939 #include <pthread.h>
15945 #ifdef PTHREAD_YIELD
15948 #ifdef PTHREAD_YIELD_NULL
15949 pthread_yield(NULL);
15955 : see if sched_yield exists
15956 set try -DSCHED_YIELD
15957 if eval $compile; then
15959 sched_yield='sched_yield()'
15963 case "$usethreads" in
15966 $define) echo 'sched_yield() found.' >&4 ;;
15967 *) echo 'sched_yield() NOT found.' >&4 ;;
15973 : see if pthread_yield exists
15974 set try -DPTHREAD_YIELD
15975 if eval $compile; then
15977 case "$sched_yield" in
15978 '') sched_yield='pthread_yield()' ;;
15981 set try -DPTHREAD_YIELD_NULL
15982 if eval $compile; then
15984 case "$sched_yield" in
15985 '') sched_yield='pthread_yield(NULL)' ;;
15991 case "$usethreads" in
15994 $define) echo 'pthread_yield() found.' >&4 ;;
15995 *) echo 'pthread_yield() NOT found.' >&4 ;;
15999 set d_pthread_yield
16001 case "$sched_yield" in
16002 '') sched_yield=undef ;;
16006 : see if random_r exists
16007 set random_r d_random_r
16009 case "$d_random_r" in
16011 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16012 case "$d_random_r_proto:$usethreads" in
16013 ":define") d_random_r_proto=define
16014 set d_random_r_proto random_r $hdrs
16018 case "$d_random_r_proto" in
16020 case "$random_r_proto" in
16021 ''|0) try='int random_r(int*, struct random_data*);'
16022 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
16024 case "$random_r_proto" in
16025 ''|0) try='int random_r(long*, struct random_data*);'
16026 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
16028 case "$random_r_proto" in
16029 ''|0) try='int random_r(struct random_data*, int32_t*);'
16030 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
16032 case "$random_r_proto" in
16033 ''|0) d_random_r=undef
16035 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16036 * ) case "$random_r_proto" in
16037 REENTRANT_PROTO*) ;;
16038 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16040 echo "Prototype: $try" ;;
16043 *) case "$usethreads" in
16044 define) echo "random_r has no prototype, not using it." >&4 ;;
16051 *) random_r_proto=0
16055 : see if readdir and friends exist
16056 set readdir d_readdir
16058 set seekdir d_seekdir
16060 set telldir d_telldir
16062 set rewinddir d_rewinddir
16065 : see if readdir64_r exists
16066 set readdir64_r d_readdir64_r
16068 case "$d_readdir64_r" in
16070 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16071 case "$d_readdir64_r_proto:$usethreads" in
16072 ":define") d_readdir64_r_proto=define
16073 set d_readdir64_r_proto readdir64_r $hdrs
16077 case "$d_readdir64_r_proto" in
16079 case "$readdir64_r_proto" in
16080 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16081 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16083 case "$readdir64_r_proto" in
16084 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16085 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16087 case "$readdir64_r_proto" in
16088 ''|0) d_readdir64_r=undef
16089 readdir64_r_proto=0
16090 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16091 * ) case "$readdir64_r_proto" in
16092 REENTRANT_PROTO*) ;;
16093 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16095 echo "Prototype: $try" ;;
16098 *) case "$usethreads" in
16099 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16101 d_readdir64_r=undef
16102 readdir64_r_proto=0
16106 *) readdir64_r_proto=0
16110 : see if readdir_r exists
16111 set readdir_r d_readdir_r
16113 case "$d_readdir_r" in
16115 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16116 case "$d_readdir_r_proto:$usethreads" in
16117 ":define") d_readdir_r_proto=define
16118 set d_readdir_r_proto readdir_r $hdrs
16122 case "$d_readdir_r_proto" in
16124 case "$readdir_r_proto" in
16125 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16126 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16128 case "$readdir_r_proto" in
16129 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16130 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16132 case "$readdir_r_proto" in
16133 ''|0) d_readdir_r=undef
16135 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16136 * ) case "$readdir_r_proto" in
16137 REENTRANT_PROTO*) ;;
16138 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16140 echo "Prototype: $try" ;;
16143 *) case "$usethreads" in
16144 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16151 *) readdir_r_proto=0
16155 : see if readv exists
16159 : see if recvmsg exists
16160 set recvmsg d_recvmsg
16163 : see if rename exists
16164 set rename d_rename
16167 : see if rmdir exists
16171 : see if memory.h is available.
16176 : See if it conflicts with string.h
16182 $cppstdin $cppflags $cppminus < $strings > mem.h
16183 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16185 echo "We won't be including <memory.h>."
16195 : can bcopy handle overlapping blocks?
16198 case "$d_memmove" in
16199 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16200 *) case "$d_bcopy" in
16202 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16204 #$i_memory I_MEMORY
16205 #$i_stdlib I_STDLIB
16206 #$i_string I_STRING
16207 #$i_unistd I_UNISTD
16209 $cat >>try.c <<'EOCP'
16212 # include <memory.h>
16215 # include <stdlib.h>
16218 # include <string.h>
16220 # include <strings.h>
16223 # include <unistd.h> /* Needed for NetBSD */
16227 char buf[128], abc[128];
16233 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16234 try to store the string in read-only memory. */
16235 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16237 for (align = 7; align >= 0; align--) {
16238 for (len = 36; len; len--) {
16240 bcopy(abc, b, len);
16241 for (off = 1; off <= len; off++) {
16242 bcopy(b, b+off, len);
16243 bcopy(b+off, b, len);
16244 if (bcmp(b, abc, len))
16253 if eval $compile_ok; then
16254 if $run ./try 2>/dev/null; then
16255 echo "Yes, it can."
16258 echo "It can't, sorry."
16261 echo "(I can't compile the test program, so we'll assume not...)"
16271 : can memcpy handle overlapping blocks?
16274 case "$d_memmove" in
16275 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16276 *) case "$d_memcpy" in
16278 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16280 #$i_memory I_MEMORY
16281 #$i_stdlib I_STDLIB
16282 #$i_string I_STRING
16283 #$i_unistd I_UNISTD
16285 $cat >>try.c <<'EOCP'
16288 # include <memory.h>
16291 # include <stdlib.h>
16294 # include <string.h>
16296 # include <strings.h>
16299 # include <unistd.h> /* Needed for NetBSD */
16303 char buf[128], abc[128];
16309 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16310 try to store the string in read-only memory. */
16311 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16313 for (align = 7; align >= 0; align--) {
16314 for (len = 36; len; len--) {
16316 memcpy(b, abc, len);
16317 for (off = 1; off <= len; off++) {
16318 memcpy(b+off, b, len);
16319 memcpy(b, b+off, len);
16320 if (memcmp(b, abc, len))
16329 if eval $compile_ok; then
16330 if $run ./try 2>/dev/null; then
16331 echo "Yes, it can."
16334 echo "It can't, sorry."
16337 echo "(I can't compile the test program, so we'll assume not...)"
16347 : can memcmp be trusted to compare relative magnitude?
16349 case "$d_memcmp" in
16352 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16354 #$i_memory I_MEMORY
16355 #$i_stdlib I_STDLIB
16356 #$i_string I_STRING
16357 #$i_unistd I_UNISTD
16359 $cat >>try.c <<'EOCP'
16362 # include <memory.h>
16365 # include <stdlib.h>
16368 # include <string.h>
16370 # include <strings.h>
16373 # include <unistd.h> /* Needed for NetBSD */
16379 if ((a < b) && memcmp(&a, &b, 1) < 0)
16385 if eval $compile_ok; then
16386 if $run ./try 2>/dev/null; then
16387 echo "Yes, it can."
16390 echo "No, it can't (it uses signed chars)."
16393 echo "(I can't compile the test program, so we'll assume not...)"
16401 : see if prototype for sbrk is available
16403 set d_sbrkproto sbrk $i_unistd unistd.h
16406 : see if select exists
16407 set select d_select
16410 : see if semctl exists
16411 set semctl d_semctl
16414 : see if semget exists
16415 set semget d_semget
16418 : see if semop exists
16422 : see how much of the 'sem*(2)' library is present.
16425 case "$d_semctl$d_semget$d_semop" in
16426 *"$undef"*) h_sem=false;;
16430 case "`ipcs 2>&1`" in
16431 "SVID messages"*"not configured"*)
16432 echo "Your $osname does not have the sem*(2) configured." >&4
16435 set semctl d_semctl
16437 set semget d_semget
16445 : we could also check for sys/ipc.h ...
16446 if $h_sem && $test `./findhdr sys/sem.h`; then
16447 echo "You have the full sem*(2) library." >&4
16450 echo "You don't have the full sem*(2) library." >&4
16456 : see whether sys/sem.h defines union semun
16458 $cat > try.c <<'END'
16459 #include <sys/types.h>
16460 #include <sys/ipc.h>
16461 #include <sys/sem.h>
16462 int main () { union semun semun; semun.buf = 0; }
16465 if eval $compile; then
16466 echo "You have union semun in <sys/sem.h>." >&4
16469 echo "You do not have union semun in <sys/sem.h>." >&4
16476 : see how to do semctl IPC_STAT
16480 $cat > tryh.h <<END
16483 # define S_IRUSR S_IREAD
16484 # define S_IWUSR S_IWRITE
16485 # define S_IXUSR S_IEXEC
16487 # define S_IRUSR 0400
16488 # define S_IWUSR 0200
16489 # define S_IXUSR 0100
16491 # define S_IRGRP (S_IRUSR>>3)
16492 # define S_IWGRP (S_IWUSR>>3)
16493 # define S_IXGRP (S_IXUSR>>3)
16494 # define S_IROTH (S_IRUSR>>6)
16495 # define S_IWOTH (S_IWUSR>>6)
16496 # define S_IXOTH (S_IXUSR>>6)
16499 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16500 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16501 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16504 : see whether semctl IPC_STAT can use union semun
16505 case "$d_semctl_semun" in
16509 #include <sys/types.h>
16510 #include <sys/ipc.h>
16511 #include <sys/sem.h>
16512 #include <sys/stat.h>
16519 #$d_union_semun HAS_UNION_SEMUN
16522 #ifndef HAS_UNION_SEMUN
16525 struct semid_ds *buf;
16526 unsigned short *array;
16532 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16533 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16535 struct semid_ds argbuf;
16538 st = semctl(sem, 0, IPC_STAT, arg);
16542 # endif /* IPC_STAT */
16543 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16545 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16546 # endif /* IPC_RMID */
16547 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16549 #endif /* IPC_PRIVATE && ... */
16550 printf("semget failed: errno = %d\n", errno);
16555 if eval $compile; then
16558 semun) val="$define" ;;
16566 case "$d_semctl_semun" in
16568 echo "You can use union semun for semctl IPC_STAT." >&4
16571 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16576 : see whether semctl IPC_STAT can use struct semid_ds pointer
16577 case "$d_semctl_semid_ds" in
16580 $cat > try.c <<'END'
16581 #include <sys/types.h>
16582 #include <sys/ipc.h>
16583 #include <sys/sem.h>
16584 #include <sys/stat.h>
16592 struct semid_ds arg;
16595 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16596 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16599 st = semctl(sem, 0, IPC_STAT, &arg);
16601 printf("semid_ds\n");
16603 # endif /* IPC_STAT */
16604 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16606 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16607 # endif /* IPC_RMID */
16608 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16610 #endif /* IPC_PRIVATE && ... */
16611 printf("semget failed: errno = %d\n", errno);
16617 if eval $compile; then
16620 semid_ds) val="$define" ;;
16624 set d_semctl_semid_ds
16628 case "$d_semctl_semid_ds" in
16630 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16632 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16638 # We do not have the full sem*(2) library, so assume we can not
16644 set d_semctl_semid_ds
16650 : see if sendmsg exists
16651 set sendmsg d_sendmsg
16654 : see if setegid exists
16655 set setegid d_setegid
16658 : see if seteuid exists
16659 set seteuid d_seteuid
16662 : see if setgrent exists
16663 set setgrent d_setgrent
16666 : see if setgrent_r exists
16667 set setgrent_r d_setgrent_r
16669 case "$d_setgrent_r" in
16671 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16672 case "$d_setgrent_r_proto:$usethreads" in
16673 ":define") d_setgrent_r_proto=define
16674 set d_setgrent_r_proto setgrent_r $hdrs
16678 case "$d_setgrent_r_proto" in
16680 case "$setgrent_r_proto" in
16681 ''|0) try='int setgrent_r(FILE**);'
16682 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16684 case "$setgrent_r_proto" in
16685 ''|0) try='void setgrent_r(FILE**);'
16686 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16688 case "$setgrent_r_proto" in
16689 ''|0) d_setgrent_r=undef
16691 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16692 * ) case "$setgrent_r_proto" in
16693 REENTRANT_PROTO*) ;;
16694 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16696 echo "Prototype: $try" ;;
16699 *) case "$usethreads" in
16700 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16707 *) setgrent_r_proto=0
16711 : see if sethostent exists
16712 set sethostent d_sethent
16715 : see if sethostent_r exists
16716 set sethostent_r d_sethostent_r
16718 case "$d_sethostent_r" in
16720 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16721 case "$d_sethostent_r_proto:$usethreads" in
16722 ":define") d_sethostent_r_proto=define
16723 set d_sethostent_r_proto sethostent_r $hdrs
16727 case "$d_sethostent_r_proto" in
16729 case "$sethostent_r_proto" in
16730 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16731 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16733 case "$sethostent_r_proto" in
16734 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16735 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16737 case "$sethostent_r_proto" in
16738 ''|0) d_sethostent_r=undef
16739 sethostent_r_proto=0
16740 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16741 * ) case "$sethostent_r_proto" in
16742 REENTRANT_PROTO*) ;;
16743 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16745 echo "Prototype: $try" ;;
16748 *) case "$usethreads" in
16749 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16751 d_sethostent_r=undef
16752 sethostent_r_proto=0
16756 *) sethostent_r_proto=0
16760 : see if setitimer exists
16761 set setitimer d_setitimer
16764 : see if setlinebuf exists
16765 set setlinebuf d_setlinebuf
16768 : see if setlocale exists
16769 set setlocale d_setlocale
16772 : see if locale.h is available
16773 set locale.h i_locale
16776 : see if setlocale_r exists
16777 set setlocale_r d_setlocale_r
16779 case "$d_setlocale_r" in
16781 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16782 case "$d_setlocale_r_proto:$usethreads" in
16783 ":define") d_setlocale_r_proto=define
16784 set d_setlocale_r_proto setlocale_r $hdrs
16788 case "$d_setlocale_r_proto" in
16790 case "$setlocale_r_proto" in
16791 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16792 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16794 case "$setlocale_r_proto" in
16795 ''|0) d_setlocale_r=undef
16796 setlocale_r_proto=0
16797 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16798 * ) case "$setlocale_r_proto" in
16799 REENTRANT_PROTO*) ;;
16800 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16802 echo "Prototype: $try" ;;
16805 *) case "$usethreads" in
16806 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16808 d_setlocale_r=undef
16809 setlocale_r_proto=0
16813 *) setlocale_r_proto=0
16817 : see if setnetent exists
16818 set setnetent d_setnent
16821 : see if setnetent_r exists
16822 set setnetent_r d_setnetent_r
16824 case "$d_setnetent_r" in
16826 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16827 case "$d_setnetent_r_proto:$usethreads" in
16828 ":define") d_setnetent_r_proto=define
16829 set d_setnetent_r_proto setnetent_r $hdrs
16833 case "$d_setnetent_r_proto" in
16835 case "$setnetent_r_proto" in
16836 ''|0) try='int setnetent_r(int, struct netent_data*);'
16837 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16839 case "$setnetent_r_proto" in
16840 ''|0) try='void setnetent_r(int, struct netent_data*);'
16841 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16843 case "$setnetent_r_proto" in
16844 ''|0) d_setnetent_r=undef
16845 setnetent_r_proto=0
16846 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16847 * ) case "$setnetent_r_proto" in
16848 REENTRANT_PROTO*) ;;
16849 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16851 echo "Prototype: $try" ;;
16854 *) case "$usethreads" in
16855 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16857 d_setnetent_r=undef
16858 setnetent_r_proto=0
16862 *) setnetent_r_proto=0
16866 : see if setprotoent exists
16867 set setprotoent d_setpent
16870 : see if setpgid exists
16871 set setpgid d_setpgid
16874 : see if setpgrp2 exists
16875 set setpgrp2 d_setpgrp2
16878 : see if setpriority exists
16879 set setpriority d_setprior
16882 : see if setproctitle exists
16883 set setproctitle d_setproctitle
16886 : see if setprotoent_r exists
16887 set setprotoent_r d_setprotoent_r
16889 case "$d_setprotoent_r" in
16891 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16892 case "$d_setprotoent_r_proto:$usethreads" in
16893 ":define") d_setprotoent_r_proto=define
16894 set d_setprotoent_r_proto setprotoent_r $hdrs
16898 case "$d_setprotoent_r_proto" in
16900 case "$setprotoent_r_proto" in
16901 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16902 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16904 case "$setprotoent_r_proto" in
16905 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16906 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16908 case "$setprotoent_r_proto" in
16909 ''|0) d_setprotoent_r=undef
16910 setprotoent_r_proto=0
16911 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16912 * ) case "$setprotoent_r_proto" in
16913 REENTRANT_PROTO*) ;;
16914 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16916 echo "Prototype: $try" ;;
16919 *) case "$usethreads" in
16920 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16922 d_setprotoent_r=undef
16923 setprotoent_r_proto=0
16927 *) setprotoent_r_proto=0
16931 : see if setpwent exists
16932 set setpwent d_setpwent
16935 : see if setpwent_r exists
16936 set setpwent_r d_setpwent_r
16938 case "$d_setpwent_r" in
16940 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16941 case "$d_setpwent_r_proto:$usethreads" in
16942 ":define") d_setpwent_r_proto=define
16943 set d_setpwent_r_proto setpwent_r $hdrs
16947 case "$d_setpwent_r_proto" in
16949 case "$setpwent_r_proto" in
16950 ''|0) try='int setpwent_r(FILE**);'
16951 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16953 case "$setpwent_r_proto" in
16954 ''|0) try='void setpwent_r(FILE**);'
16955 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16957 case "$setpwent_r_proto" in
16958 ''|0) d_setpwent_r=undef
16960 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16961 * ) case "$setpwent_r_proto" in
16962 REENTRANT_PROTO*) ;;
16963 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16965 echo "Prototype: $try" ;;
16968 *) case "$usethreads" in
16969 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16976 *) setpwent_r_proto=0
16980 : see if setregid exists
16981 set setregid d_setregid
16983 set setresgid d_setresgid
16986 : see if setreuid exists
16987 set setreuid d_setreuid
16989 set setresuid d_setresuid
16992 : see if setrgid exists
16993 set setrgid d_setrgid
16996 : see if setruid exists
16997 set setruid d_setruid
17000 : see if setservent exists
17001 set setservent d_setsent
17004 : see if setservent_r exists
17005 set setservent_r d_setservent_r
17007 case "$d_setservent_r" in
17009 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17010 case "$d_setservent_r_proto:$usethreads" in
17011 ":define") d_setservent_r_proto=define
17012 set d_setservent_r_proto setservent_r $hdrs
17016 case "$d_setservent_r_proto" in
17018 case "$setservent_r_proto" in
17019 ''|0) try='int setservent_r(int, struct servent_data*);'
17020 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
17022 case "$setservent_r_proto" in
17023 ''|0) try='void setservent_r(int, struct servent_data*);'
17024 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
17026 case "$setservent_r_proto" in
17027 ''|0) d_setservent_r=undef
17028 setservent_r_proto=0
17029 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17030 * ) case "$setservent_r_proto" in
17031 REENTRANT_PROTO*) ;;
17032 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17034 echo "Prototype: $try" ;;
17037 *) case "$usethreads" in
17038 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17040 d_setservent_r=undef
17041 setservent_r_proto=0
17045 *) setservent_r_proto=0
17049 : see if setsid exists
17050 set setsid d_setsid
17053 : see if setvbuf exists
17054 set setvbuf d_setvbuf
17057 : see if sfio.h is available
17061 : see if sfio library is available
17072 : Ok, but do we want to use it.
17076 true|$define|[yY]*) dflt='y';;
17079 echo "$package can use the sfio library, but it is experimental."
17080 case "$useperlio" in
17082 echo "For sfio also the PerlIO abstraction layer is needed."
17083 echo "Earlier you said you wouldn't want that."
17086 rp="You seem to have sfio available, do you want to try using it?"
17089 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17090 useperlio="$define"
17093 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17098 *) case "$usesfio" in
17099 true|$define|[yY]*)
17100 echo "Sorry, cannot find sfio on this machine." >&4
17101 echo "Ignoring your setting of usesfio=$usesfio." >&4
17110 $define) usesfio='true';;
17111 *) usesfio='false';;
17115 *) : Remove sfio from list of libraries to use
17118 echo "Removing unneeded -lsfio from library list" >&4
17119 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17122 echo "libs = $libs" >&4
17129 : see if shmctl exists
17130 set shmctl d_shmctl
17133 : see if shmget exists
17134 set shmget d_shmget
17137 : see if shmat exists
17140 : see what shmat returns
17143 $cat >shmat.c <<'END'
17144 #include <sys/shm.h>
17147 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17152 echo "and it returns ($shmattype)." >&4
17153 : see if a prototype for shmat is available
17154 xxx=`./findhdr sys/shm.h`
17155 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17156 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17167 set d_shmatprototype
17170 : see if shmdt exists
17174 : see how much of the 'shm*(2)' library is present.
17177 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17178 *"$undef"*) h_shm=false;;
17182 case "`ipcs 2>&1`" in
17183 "SVID shared memory"*"not configured"*)
17184 echo "Your $osname does not have the shm*(2) configured." >&4
17187 set shmctl d_shmctl
17189 set shmget d_shmget
17199 : we could also check for sys/ipc.h ...
17200 if $h_shm && $test `./findhdr sys/shm.h`; then
17201 echo "You have the full shm*(2) library." >&4
17204 echo "You don't have the full shm*(2) library." >&4
17210 : see if we have sigaction
17212 if set sigaction val -f d_sigaction; eval $csym; $val; then
17213 echo 'sigaction() found.' >&4
17216 #include <sys/types.h>
17217 #include <signal.h>
17218 #$i_stdlib I_STDLIB
17220 #include <stdlib.h>
17224 struct sigaction act, oact;
17226 oact.sa_handler = 0;
17227 /* so that act and oact are used */
17228 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17232 if eval $compile_ok; then
17235 echo "But you don't seem to have a useable struct sigaction." >&4
17239 echo 'sigaction NOT found.' >&4
17242 set d_sigaction; eval $setvar
17245 : see if this is a sunmath.h system
17246 set sunmath.h i_sunmath
17249 : see if signbit exists
17250 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17253 #$i_sunmath I_SUNMATH
17257 #ifdef I_SUNMATH /* Solaris special math library */
17258 # include <sunmath.h>
17261 int main(int argc, char **argv)
17265 if ((signbit(x) == 0) && (signbit(y) != 0))
17273 if eval $compile; then
17274 if $run ./try; then
17278 $echo "Signbit seems to be available, but doesn't work as I expected."
17279 $echo "I won't use it." >&4
17290 : see if sigprocmask exists
17291 set sigprocmask d_sigprocmask
17294 : see if sigsetjmp exists
17296 case "$d_sigsetjmp" in
17299 #include <setjmp.h>
17300 #$i_stdlib I_STDLIB
17302 #include <stdlib.h>
17308 if (sigsetjmp(env,1))
17311 siglongjmp(env, 1);
17316 if eval $compile; then
17317 if $run ./try >/dev/null 2>&1; then
17318 echo "POSIX sigsetjmp found." >&4
17322 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17328 echo "sigsetjmp not found." >&4
17332 *) val="$d_sigsetjmp"
17333 case "$d_sigsetjmp" in
17334 $define) echo "POSIX sigsetjmp found." >&4;;
17335 $undef) echo "sigsetjmp not found." >&4;;
17343 : see if snprintf exists
17344 set snprintf d_snprintf
17347 : see if vsnprintf exists
17348 set vsnprintf d_vsnprintf
17351 case "$d_snprintf-$d_vsnprintf" in
17354 Checking whether your snprintf() and vsnprintf() work okay...
17356 $cat >try.c <<'EOCP'
17357 /* v?snprintf testing logic courtesy of Russ Allbery.
17358 * According to C99:
17359 * - if the buffer is too short it still must be \0-terminated
17360 * - if the buffer is too short the potentially required length
17361 * must be returned and not -1
17362 * - if the buffer is NULL the potentially required length
17363 * must be returned and not -1 or core dump
17366 #include <stdarg.h>
17370 int test (char *format, ...)
17375 va_start (args, format);
17376 count = vsnprintf (buf, sizeof buf, format, args);
17383 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17384 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17388 if eval $compile; then
17391 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17393 Your snprintf() and snprintf() don't seem to be working okay.
17395 d_snprintf="$undef"
17396 d_vsnprintf="$undef"
17400 echo "(I can't seem to compile the test program--assuming they don't)"
17401 d_snprintf="$undef"
17402 d_vsnprintf="$undef"
17408 : see if sockatmark exists
17409 set sockatmark d_sockatmark
17412 : see if prototype for sockatmark is available
17414 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17417 : see if socks5_init exists
17418 set socks5_init d_socks5_init
17421 : see if sprintf returns the length of the string in the buffer as per ANSI
17422 $echo "Checking whether sprintf returns the length of the string..." >&4
17425 #$i_stdlib I_STDLIB
17427 #include <stdlib.h>
17429 #$i_string I_STRING
17431 # include <string.h>
17433 # include <strings.h>
17442 int check (size_t expect, int test) {
17443 size_t got = strlen(buffer);
17447 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17452 int main(int argc, char **argv) {
17455 check(sprintf(buffer, ""), ++test);
17456 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17457 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17464 d_sprintf_returns_strlen="$undef"
17465 if eval $compile; then
17469 sprintf returns the length of the string (as ANSI says it should)
17471 d_sprintf_returns_strlen="$define"
17474 sprintf does not return the length of the string (how old is this system?)
17476 d_sprintf_returns_strlen="$undef"
17482 : see if srand48_r exists
17483 set srand48_r d_srand48_r
17485 case "$d_srand48_r" in
17487 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17488 case "$d_srand48_r_proto:$usethreads" in
17489 ":define") d_srand48_r_proto=define
17490 set d_srand48_r_proto srand48_r $hdrs
17494 case "$d_srand48_r_proto" in
17496 case "$srand48_r_proto" in
17497 ''|0) try='int srand48_r(long, struct drand48_data*);'
17498 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17500 case "$srand48_r_proto" in
17501 ''|0) d_srand48_r=undef
17503 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17504 * ) case "$srand48_r_proto" in
17505 REENTRANT_PROTO*) ;;
17506 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17508 echo "Prototype: $try" ;;
17511 *) case "$usethreads" in
17512 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17519 *) srand48_r_proto=0
17523 : see if srandom_r exists
17524 set srandom_r d_srandom_r
17526 case "$d_srandom_r" in
17528 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17529 case "$d_srandom_r_proto:$usethreads" in
17530 ":define") d_srandom_r_proto=define
17531 set d_srandom_r_proto srandom_r $hdrs
17535 case "$d_srandom_r_proto" in
17537 case "$srandom_r_proto" in
17538 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17539 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17541 case "$srandom_r_proto" in
17542 ''|0) d_srandom_r=undef
17544 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17545 * ) case "$srandom_r_proto" in
17546 REENTRANT_PROTO*) ;;
17547 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17549 echo "Prototype: $try" ;;
17552 *) case "$usethreads" in
17553 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17560 *) srandom_r_proto=0
17564 : see if prototype for setresgid is available
17566 set d_sresgproto setresgid $i_unistd unistd.h
17569 : see if prototype for setresuid is available
17571 set d_sresuproto setresuid $i_unistd unistd.h
17574 : see if sys/stat.h is available
17575 set sys/stat.h i_sysstat
17578 : see if stat knows about block sizes
17580 echo "Checking to see if your struct stat has st_blocks field..." >&4
17581 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17584 : see if this is a sys/vfs.h system
17585 set sys/vfs.h i_sysvfs
17588 : see if this is a sys/statfs.h system
17589 set sys/statfs.h i_sysstatfs
17592 : Check for statfs_s
17594 echo "Checking to see if your system supports struct statfs..." >&4
17595 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
17597 case "$d_statfs_s" in
17598 "$define") echo "Yes, it does." ;;
17599 *) echo "No, it doesn't." ;;
17603 : see if struct statfs knows about f_flags
17604 case "$d_statfs_s" in
17607 echo "Checking to see if your struct statfs has f_flags field..." >&4
17608 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
17612 set d_statfs_f_flags
17616 case "$d_statfs_f_flags" in
17617 "$define") echo "Yes, it does." ;;
17618 *) echo "No, it doesn't." ;;
17621 : Check stream access
17623 Checking how to access stdio streams by file descriptor number...
17625 case "$stdio_stream_array" in
17626 '') $cat >try.c <<EOCP
17629 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17633 for s in _iob __iob __sF
17635 set try -DSTDIO_STREAM_ARRAY=$s
17636 if eval $compile; then
17637 case "`$run ./try`" in
17638 yes) stdio_stream_array=$s; break ;;
17644 case "$stdio_stream_array" in
17646 I can't figure out how to access stdio streams by file descriptor number.
17648 d_stdio_stream_array="$undef"
17651 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17653 d_stdio_stream_array="$define"
17657 : see if strcoll exists
17658 set strcoll d_strcoll
17661 : check for structure copying
17663 echo "Checking to see if your C compiler can copy structs..." >&4
17664 $cat >try.c <<'EOCP'
17674 if $cc -c try.c >/dev/null 2>&1 ; then
17676 echo "Yup, it can."
17679 echo "Nope, it can't."
17685 : see if strerror and/or sys_errlist[] exist
17687 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17688 if set strerror val -f d_strerror; eval $csym; $val; then
17689 echo 'strerror() found.' >&4
17690 d_strerror="$define"
17691 d_strerrm='strerror(e)'
17692 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17693 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17694 d_syserrlst="$define"
17696 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17697 d_syserrlst="$undef"
17699 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17700 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17701 echo 'strerror() found in string header.' >&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 "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17706 d_syserrlst="$define"
17708 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17709 d_syserrlst="$undef"
17711 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17712 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17713 d_strerror="$undef"
17714 d_syserrlst="$define"
17715 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17717 echo 'strerror() and sys_errlist[] NOT found.' >&4
17718 d_strerror="$undef"
17719 d_syserrlst="$undef"
17720 d_strerrm='"unknown"'
17724 : see if strerror_r exists
17725 set strerror_r d_strerror_r
17727 case "$d_strerror_r" in
17729 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17730 case "$d_strerror_r_proto:$usethreads" in
17731 ":define") d_strerror_r_proto=define
17732 set d_strerror_r_proto strerror_r $hdrs
17736 case "$d_strerror_r_proto" in
17738 case "$strerror_r_proto" in
17739 ''|0) try='int strerror_r(int, char*, size_t);'
17740 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17742 case "$strerror_r_proto" in
17743 ''|0) try='int strerror_r(int, char*, int);'
17744 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17746 case "$strerror_r_proto" in
17747 ''|0) try='char* strerror_r(int, char*, size_t);'
17748 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17750 case "$strerror_r_proto" in
17751 ''|0) d_strerror_r=undef
17753 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17754 * ) case "$strerror_r_proto" in
17755 REENTRANT_PROTO*) ;;
17756 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17758 echo "Prototype: $try" ;;
17761 *) case "$usethreads" in
17762 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17769 *) strerror_r_proto=0
17773 : see if strftime exists
17774 set strftime d_strftime
17777 : see if strlcat exists
17778 set strlcat d_strlcat
17781 : see if strlcpy exists
17782 set strlcpy d_strlcpy
17785 : see if strtod exists
17786 set strtod d_strtod
17789 : see if strtol exists
17790 set strtol d_strtol
17793 : see if strtold exists
17794 set strtold d_strtold
17797 : see if strtoll exists
17798 set strtoll d_strtoll
17801 case "$d_longlong-$d_strtoll" in
17804 Checking whether your strtoll() works okay...
17806 $cat >try.c <<'EOCP'
17809 #define strtoll __strtoll
17812 #define strtoll _strtoll
17815 extern long long int strtoll(char *s, char **, int);
17816 static int bad = 0;
17817 int check(char *s, long long ell, int een) {
17820 gll = strtoll(s, 0, 10);
17821 if (!((gll == ell) && (errno == een)))
17825 check(" 1", 1LL, 0);
17826 check(" 0", 0LL, 0);
17827 check("-1", -1LL, 0);
17828 check("-9223372036854775808", -9223372036854775808LL, 0);
17829 check("-9223372036854775808", -9223372036854775808LL, 0);
17830 check(" 9223372036854775807", 9223372036854775807LL, 0);
17831 check("-9223372036854775808", -9223372036854775808LL, 0);
17832 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17833 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17839 if eval $compile; then
17842 ok) echo "Your strtoll() seems to be working okay." ;;
17844 Your strtoll() doesn't seem to be working okay.
17850 echo "(I can't seem to compile the test program--assuming it doesn't)"
17856 : see if strtoq exists
17857 set strtoq d_strtoq
17860 : see if strtoul exists
17861 set strtoul d_strtoul
17864 case "$d_strtoul" in
17867 Checking whether your strtoul() works okay...
17869 $cat >try.c <<'EOCP'
17872 extern unsigned long int strtoul(char *s, char **, int);
17873 static int bad = 0;
17874 void check(char *s, unsigned long eul, int een) {
17877 gul = strtoul(s, 0, 10);
17878 if (!((gul == eul) && (errno == een)))
17882 check(" 1", 1L, 0);
17883 check(" 0", 0L, 0);
17885 case "$longsize" in
17887 $cat >>try.c <<'EOCP'
17888 check("18446744073709551615", 18446744073709551615UL, 0);
17889 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17890 #if 0 /* strtoul() for /^-/ strings is undefined. */
17891 check("-1", 18446744073709551615UL, 0);
17892 check("-18446744073709551614", 2, 0);
17893 check("-18446744073709551615", 1, 0);
17894 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17895 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17900 $cat >>try.c <<'EOCP'
17901 check("4294967295", 4294967295UL, 0);
17902 check("4294967296", 4294967295UL, ERANGE);
17903 #if 0 /* strtoul() for /^-/ strings is undefined. */
17904 check("-1", 4294967295UL, 0);
17905 check("-4294967294", 2, 0);
17906 check("-4294967295", 1, 0);
17907 check("-4294967296", 4294967295UL, ERANGE);
17908 check("-4294967297", 4294967295UL, ERANGE);
17913 : Should we write these tests to be more portable by sprintf-ing
17914 : ~0 and then manipulating that char string as input for strtol?
17917 $cat >>try.c <<'EOCP'
17924 if eval $compile; then
17925 case "`$run ./try`" in
17926 ok) echo "Your strtoul() seems to be working okay." ;;
17928 Your strtoul() doesn't seem to be working okay.
17934 echo "(I can't seem to compile the test program--assuming it doesn't)"
17940 : see if strtoull exists
17941 set strtoull d_strtoull
17944 case "$d_longlong-$d_strtoull" in
17947 Checking whether your strtoull() works okay...
17949 $cat >try.c <<'EOCP'
17952 #define strtoull __strtoull
17955 extern unsigned long long int strtoull(char *s, char **, int);
17956 static int bad = 0;
17957 int check(char *s, long long eull, int een) {
17960 gull = strtoull(s, 0, 10);
17961 if (!((gull == eull) && (errno == een)))
17965 check(" 1", 1LL, 0);
17966 check(" 0", 0LL, 0);
17967 check("18446744073709551615", 18446744073709551615ULL, 0);
17968 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17969 #if 0 /* strtoull() for /^-/ strings is undefined. */
17970 check("-1", 18446744073709551615ULL, 0);
17971 check("-18446744073709551614", 2LL, 0);
17972 check("-18446744073709551615", 1LL, 0);
17973 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17974 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17981 if eval $compile; then
17982 case "`$run ./try`" in
17983 ok) echo "Your strtoull() seems to be working okay." ;;
17985 Your strtoull() doesn't seem to be working okay.
17987 d_strtoull="$undef"
17991 echo "(I can't seem to compile the test program--assuming it doesn't)"
17992 d_strtoull="$undef"
17997 : see if strtouq exists
17998 set strtouq d_strtouq
18001 case "$d_strtouq" in
18004 Checking whether your strtouq() works okay...
18006 $cat >try.c <<'EOCP'
18009 extern unsigned long long int strtouq(char *s, char **, int);
18010 static int bad = 0;
18011 void check(char *s, unsigned long long eull, int een) {
18012 unsigned long long gull;
18014 gull = strtouq(s, 0, 10);
18015 if (!((gull == eull) && (errno == een)))
18019 check(" 1", 1LL, 0);
18020 check(" 0", 0LL, 0);
18021 check("18446744073709551615", 18446744073709551615ULL, 0);
18022 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18023 #if 0 /* strtouq() for /^-/ strings is undefined. */
18024 check("-1", 18446744073709551615ULL, 0);
18025 check("-18446744073709551614", 2LL, 0);
18026 check("-18446744073709551615", 1LL, 0);
18027 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18028 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18036 if eval $compile; then
18037 case "`$run ./try`" in
18038 ok) echo "Your strtouq() seems to be working okay." ;;
18040 Your strtouq() doesn't seem to be working okay.
18046 echo "(I can't seem to compile the test program--assuming it doesn't)"
18052 : see if strxfrm exists
18053 set strxfrm d_strxfrm
18056 : see if symlink exists
18057 set symlink d_symlink
18060 : see if syscall exists
18061 set syscall d_syscall
18064 : see if prototype for syscall is available
18066 set d_syscallproto syscall $i_unistd unistd.h
18069 : see if sysconf exists
18070 set sysconf d_sysconf
18073 : see if system exists
18074 set system d_system
18077 : see if tcgetpgrp exists
18078 set tcgetpgrp d_tcgetpgrp
18081 : see if tcsetpgrp exists
18082 set tcsetpgrp d_tcsetpgrp
18085 : see if prototype for telldir is available
18087 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18090 : see if time exists
18092 if test "X$d_time" = X -o X"$timetype" = X; then
18093 if set time val -f d_time; eval $csym; $val; then
18094 echo 'time() found.' >&4
18096 rp="What is the type returned by time() on this system?"
18097 set time_t timetype long stdio.h sys/types.h
18100 echo 'time() not found, hope that will do.' >&4
18108 : see if this is a sys/times.h system
18109 set sys/times.h i_systimes
18112 : see if times exists
18114 if set times val -f d_times; eval $csym; $val; then
18115 echo 'times() found.' >&4
18118 case "$i_systimes" in
18119 "$define") inc='sys/times.h';;
18121 rp="What is the type returned by times() on this system?"
18122 set clock_t clocktype long stdio.h sys/types.h $inc
18125 echo 'times() NOT found, hope that will do.' >&4
18130 : see if tmpnam_r exists
18131 set tmpnam_r d_tmpnam_r
18133 case "$d_tmpnam_r" in
18135 hdrs="$i_systypes sys/types.h define stdio.h "
18136 case "$d_tmpnam_r_proto:$usethreads" in
18137 ":define") d_tmpnam_r_proto=define
18138 set d_tmpnam_r_proto tmpnam_r $hdrs
18142 case "$d_tmpnam_r_proto" in
18144 case "$tmpnam_r_proto" in
18145 ''|0) try='char* tmpnam_r(char*);'
18146 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18148 case "$tmpnam_r_proto" in
18149 ''|0) d_tmpnam_r=undef
18151 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18152 * ) case "$tmpnam_r_proto" in
18153 REENTRANT_PROTO*) ;;
18154 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18156 echo "Prototype: $try" ;;
18159 *) case "$usethreads" in
18160 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18167 *) tmpnam_r_proto=0
18171 : see if truncate exists
18172 set truncate d_truncate
18175 : see if ttyname_r exists
18176 set ttyname_r d_ttyname_r
18178 case "$d_ttyname_r" in
18180 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18181 case "$d_ttyname_r_proto:$usethreads" in
18182 ":define") d_ttyname_r_proto=define
18183 set d_ttyname_r_proto ttyname_r $hdrs
18187 case "$d_ttyname_r_proto" in
18189 case "$ttyname_r_proto" in
18190 ''|0) try='int ttyname_r(int, char*, size_t);'
18191 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18193 case "$ttyname_r_proto" in
18194 ''|0) try='int ttyname_r(int, char*, int);'
18195 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18197 case "$ttyname_r_proto" in
18198 ''|0) try='char* ttyname_r(int, char*, int);'
18199 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18201 case "$ttyname_r_proto" in
18202 ''|0) d_ttyname_r=undef
18204 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18205 * ) case "$ttyname_r_proto" in
18206 REENTRANT_PROTO*) ;;
18207 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18209 echo "Prototype: $try" ;;
18212 *) case "$usethreads" in
18213 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18220 *) ttyname_r_proto=0
18224 : see if tzname[] exists
18226 if set tzname val -a d_tzname; eval $csym; $val; then
18228 echo 'tzname[] found.' >&4
18231 echo 'tzname[] NOT found.' >&4
18236 : Check if is a multiplatform env
18238 next|rhapsody|darwin) multiarch="$define" ;;
18240 case "$multiarch" in
18241 ''|[nN]*) multiarch="$undef" ;;
18244 : check for ordering of bytes in a UV
18246 case "$usecrosscompile$multiarch" in
18249 You seem to be either cross-compiling or doing a multiarchitecture build,
18250 skipping the byteorder check.
18256 case "$byteorder" in
18259 In the following, larger digits indicate more significance. A big-endian
18260 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18261 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18262 machines may have weird orders like 3412. A Cray will report 87654321,
18263 an Alpha will report 12345678. If the test program works the default is
18265 I'm now running the test program...
18269 #$i_stdlib I_STDLIB
18271 #include <stdlib.h>
18273 #include <sys/types.h>
18274 typedef $uvtype UV;
18284 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18286 u.l = (UV)0x04030201;
18287 for (i = 0; i < $uvsize; i++)
18288 printf("%c", u.c[i]+'0');
18295 if eval $compile && $run ./try > /dev/null; then
18298 [1-4][1-4][1-4][1-4]|12345678|87654321)
18299 echo "(The test program ran ok.)"
18300 echo "byteorder=$dflt"
18303 ????|????????) echo "(The test program ran ok.)" ;;
18304 *) echo "(The test program didn't run right for some reason.)" ;;
18309 (I can't seem to compile the test program. Guessing big-endian...)
18312 case "$xxx_prompt" in
18314 rp="What is the order of bytes in $uvtype?"
18327 : Checking 32bit aligndness
18330 Checking to see whether you can access character data unalignedly...
18332 case "$d_u32align" in
18333 '') $cat >try.c <<EOCP
18335 #$i_stdlib I_STDLIB
18337 #include <stdlib.h>
18339 #define U32 $u32type
18340 #define BYTEORDER 0x$byteorder
18342 #include <signal.h>
18344 $signal_t bletch(int s) { exit(4); }
18347 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18352 if (sizeof(U32) != 4) {
18353 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18360 signal(SIGBUS, bletch);
18372 for (i = 0; i < 4; i++) {
18373 up = (U32*)(buf + i);
18374 if (! ((*up == 1 << (8*i)) || /* big-endian */
18375 (*up == 1 << (8*(3-i))) /* little-endian */
18379 printf("read failed (%x)\n", *up);
18385 for (i = 0; i < 4; i++) {
18386 up = (U32*)(buf + i);
18388 if (*up != 0xBeef) {
18389 printf("write failed (%x)\n", *up);
18403 if eval $compile_ok; then
18404 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18405 $run ./try 2>&1 >/dev/null
18408 You can access character data pretty unalignedly.
18410 d_u32align="$undef"
18413 It seems that you must access character data in an aligned manner.
18415 d_u32align="$define"
18419 rp='Can you access character data at unaligned addresses?'
18423 [yY]*) d_u32align="$undef" ;;
18424 *) d_u32align="$define" ;;
18431 : see if ualarm exists
18432 set ualarm d_ualarm
18435 : see if umask exists
18439 : see if unordered exists
18440 set unordered d_unordered
18443 : see if unsetenv exists
18444 set unsetenv d_unsetenv
18447 : see if usleep exists
18448 set usleep d_usleep
18451 : see if prototype for usleep is available
18453 set d_usleepproto usleep $i_unistd unistd.h
18456 : see if ustat exists
18460 : see if closedir exists
18461 set closedir d_closedir
18464 case "$d_closedir" in
18467 echo "Checking whether closedir() returns a status..." >&4
18469 #$i_dirent I_DIRENT /**/
18470 #$i_sysdir I_SYS_DIR /**/
18471 #$i_sysndir I_SYS_NDIR /**/
18472 #$i_systypes I_SYS_TYPES /**/
18474 #if defined(I_SYS_TYPES)
18475 #include <sys/types.h>
18477 #if defined(I_DIRENT)
18478 #include <dirent.h>
18479 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18480 #include <sys/dir.h>
18484 #include <sys/ndir.h>
18488 #include <ndir.h> /* may be wrong in the future */
18490 #include <sys/dir.h>
18495 int main() { return closedir(opendir(".")); }
18498 if eval $compile_ok; then
18499 if $run ./try > /dev/null 2>&1 ; then
18500 echo "Yes, it does."
18503 echo "No, it doesn't."
18507 echo "(I can't seem to compile the test program--assuming it doesn't)"
18515 set d_void_closedir
18519 : see if there is a wait4
18523 : see if waitpid exists
18524 set waitpid d_waitpid
18527 : see if wcstombs exists
18528 set wcstombs d_wcstombs
18531 : see if wctomb exists
18532 set wctomb d_wctomb
18535 : see if writev exists
18536 set writev d_writev
18539 : preserve RCS keywords in files with variable substitution, grrr
18544 Revision='$Revision'
18546 : check for alignment requirements
18548 case "$usecrosscompile$multiarch" in
18551 You seem to be either cross-compiling or doing a multiarchitecture build,
18552 skipping the memory alignment check.
18555 case "$alignbytes" in
18556 '') alignbytes=8 ;;
18560 case "$alignbytes" in
18561 '') echo "Checking alignment constraints..." >&4
18562 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18563 $cat >try.c <<'EOCP'
18564 typedef long double NV;
18567 $cat >try.c <<'EOCP'
18571 $cat >>try.c <<'EOCP'
18579 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18584 if eval $compile_ok; then
18588 echo "(I can't seem to compile the test program...)"
18591 *) dflt="$alignbytes"
18594 rp="Doubles must be aligned on a how-many-byte boundary?"
18602 : set the base revision
18605 : how do we concatenate cpp tokens here?
18607 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18608 $cat >cpp_stuff.c <<'EOCP'
18609 #define RCAT(a,b)a/**/b
18610 #define ACAT(a,b)a ## b
18614 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18615 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18616 echo "Oh! Smells like ANSI's been here." >&4
18617 echo "We can catify or stringify, separately or together!"
18619 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18620 echo "Ah, yes! The good old days!" >&4
18621 echo "However, in the good old days we don't know how to stringify and"
18622 echo "catify at the same time."
18626 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18627 You're going to have to edit the values of CAT[2-5] in config.h...
18629 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18633 : see if this is a db.h system
18639 : Check db version.
18641 echo "Checking Berkeley DB version ..." >&4
18647 #include <sys/types.h>
18649 #$i_stdlib I_STDLIB
18651 #include <stdlib.h>
18654 int main(int argc, char *argv[])
18656 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18657 int Major, Minor, Patch ;
18658 unsigned long Version ;
18659 (void)db_version(&Major, &Minor, &Patch) ;
18661 printf("%d %d %d %d %d %d\n",
18662 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18663 Major, Minor, Patch);
18666 printf("You have Berkeley DB Version 2 or greater.\n");
18668 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18669 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18670 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18671 Major, Minor, Patch) ;
18673 /* check that db.h & libdb are compatible */
18674 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18675 printf("db.h and libdb are incompatible.\n") ;
18679 printf("db.h and libdb are compatible.\n") ;
18681 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18682 + DB_VERSION_PATCH ;
18684 /* needs to be >= 2.3.4 */
18685 if (Version < 2003004) {
18686 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18687 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18693 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18698 printf("You have Berkeley DB Version 1.\n");
18699 exit(0); /* DB version < 2: the coast is clear. */
18701 exit(1); /* <db.h> not Berkeley DB? */
18707 if eval $compile_ok && $run ./try; then
18708 echo 'Looks OK.' >&4
18710 db_version_major=$1
18711 db_version_minor=$2
18712 db_version_patch=$3
18714 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18718 : Remove db from list of libraries to use
18719 echo "Removing unusable -ldb from library list" >&4
18720 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18723 echo "libs = $libs" >&4
18733 : Check the return type needed for hash
18735 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18741 #include <sys/types.h>
18744 #ifndef DB_VERSION_MAJOR
18745 u_int32_t hash_cb (ptr, size)
18753 info.hash = hash_cb;
18757 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18758 if $contains warning try.out >>/dev/null 2>&1 ; then
18761 db_hashtype='u_int32_t'
18764 : XXX Maybe we should just give up here.
18765 db_hashtype=u_int32_t
18767 echo "Help: I can't seem to compile the db test program." >&4
18768 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18771 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18773 *) db_hashtype=u_int32_t
18778 : Check the return type needed for prefix
18780 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18786 #include <sys/types.h>
18789 #ifndef DB_VERSION_MAJOR
18790 size_t prefix_cb (key1, key2)
18798 info.prefix = prefix_cb;
18802 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18803 if $contains warning try.out >>/dev/null 2>&1 ; then
18804 db_prefixtype='int'
18806 db_prefixtype='size_t'
18809 db_prefixtype='size_t'
18810 : XXX Maybe we should just give up here.
18812 echo "Help: I can't seem to compile the db test program." >&4
18813 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18816 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18818 *) db_prefixtype='size_t'
18822 : How can we generate normalized random numbers ?
18824 echo "Looking for a random number function..." >&4
18825 case "$randfunc" in
18827 if set drand48 val -f; eval $csym; $val; then
18829 echo "Good, found drand48()." >&4
18830 elif set random val -f; eval $csym; $val; then
18832 echo "OK, found random()." >&4
18835 echo "Yick, looks like I have to use rand()." >&4
18846 *-Dmy_rand=*|*-Dmy_srand=*)
18847 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18848 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18849 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18850 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18854 while $test "$cont"; do
18855 rp="Use which function to generate random numbers?"
18857 if $test "$ans" = "$dflt"; then
18863 if set $ans val -f; eval $csym; $val; then
18867 rp="I cannot find function $ans. Use that name anyway?"
18876 case "$randfunc" in
18878 drand01="drand48()"
18884 case "$randbits" in
18886 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18888 #$i_unistd I_UNISTD
18889 #$i_stdlib I_STDLIB
18892 # include <unistd.h>
18895 # include <stdlib.h>
18900 register unsigned long tmp;
18901 register unsigned long max = 0L;
18903 for (i = 1000; i; i--) {
18904 tmp = (unsigned long) $randfunc();
18905 if (tmp > max) max = tmp;
18907 for (i = 0; max; i++)
18913 if eval $compile_ok; then
18917 echo "(I can't seem to compile the test program...)"
18924 rp="How many bits does your $randfunc() function produce?"
18928 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18929 seedfunc="s$randfunc"
18930 randseedtype=unsigned
18934 rp="How many bits does your $randfunc() function produce?"
18937 seedfunc="s$randfunc"
18938 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18939 if set $seedfunc val -f; eval $csym; $val; then
18940 echo "(Using $seedfunc() to seed random generator)"
18942 echo "(Warning: no $seedfunc() to seed random generator)"
18945 randseedtype=unsigned
18952 : Determine if this is an EBCDIC system
18954 echo "Determining whether or not we are on an EBCDIC system..." >&4
18955 $cat >try.c <<'EOM'
18958 if ('M'==0xd4) return 0;
18965 if eval $compile_ok; then
18966 if $run ./try; then
18967 echo "You seem to speak EBCDIC." >&4
18970 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18973 echo "I'm unable to compile the test program." >&4
18974 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18980 : Check how to flush
18983 Checking how to flush all pending stdio output...
18985 # I only know how to find the first 32 possibly open files on SunOS.
18986 # See also hints/sunos_4_1.sh and util.c --AD
18988 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18990 $cat >>try.c <<EOCP
18992 #$i_stdlib I_STDLIB
18994 #include <stdlib.h>
18996 #$i_unistd I_UNISTD
18998 # include <unistd.h>
19000 #$d_sysconf HAS_SYSCONF
19001 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19002 #ifdef HAS_STDIO_STREAM_ARRAY
19003 # define STDIO_STREAM_ARRAY $stdio_stream_array
19008 p = fopen("try.out", "w");
19012 # ifdef TRY_FPRINTF
19016 #ifdef TRY_FFLUSH_NULL
19019 #ifdef TRY_FFLUSH_ALL
19021 long open_max = -1;
19022 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19023 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19025 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19026 open_max = sysconf(_SC_OPEN_MAX);
19029 open_max = FOPEN_MAX;
19032 open_max = OPEN_MAX;
19041 # ifdef HAS_STDIO_STREAM_ARRAY
19042 if (open_max > 0) {
19044 for (i = 0; i < open_max; i++)
19045 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19046 STDIO_STREAM_ARRAY[i]._file < open_max &&
19047 STDIO_STREAM_ARRAY[i]._flag)
19048 fflush(&STDIO_STREAM_ARRAY[i]);
19056 : first we have to find out how _not_ to flush
19058 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19060 set try -DTRY_FPUTC
19061 if eval $compile; then
19062 $run ./try 2>/dev/null
19065 if $test ! -s try.out -a "X$code" = X42; then
19071 set try -DTRY_FPRINTF
19072 if eval $compile; then
19073 $run ./try 2>/dev/null
19076 if $test ! -s try.out -a "X$code" = X42; then
19077 output=-DTRY_FPRINTF
19083 : check for fflush NULL behaviour
19084 case "$fflushNULL" in
19085 '') set try -DTRY_FFLUSH_NULL $output
19086 if eval $compile; then
19087 $run ./try 2>/dev/null
19090 if $test -s try.out -a "X$code" = X42; then
19091 fflushNULL="`$cat try.out`"
19093 if $test "X$code" != X42; then
19095 (If this test failed, don't worry, we'll try another method shortly.)
19100 $rm -f core try.core core.try.*
19101 case "$fflushNULL" in
19103 Your fflush(NULL) works okay for output streams.
19104 Let's see if it clobbers input pipes...
19106 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19107 # bug that improperly flushes the input end of pipes. So we avoid the
19108 # autoflush on fork/system/exec support for now. :-(
19109 $cat >tryp.c <<EOCP
19112 main(int argc, char **argv)
19118 while ((i = getc(stdin)) != -1
19119 && (*bp++ = i) != '\n'
19120 && bp < &buf[1024])
19123 fprintf(stdout, "%s", buf);
19131 fflushNULL="$define"
19133 if eval $compile; then
19135 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19136 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19138 fflush(NULL) seems to behave okay with input streams.
19140 fflushNULL="$define"
19143 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19145 fflushNULL="$undef"
19148 $rm -f core tryp.c tryp.core core.tryp.*
19151 Your fflush(NULL) isn't working (contrary to ANSI C).
19153 fflushNULL="$undef"
19156 Cannot figure out whether your fflush(NULL) works or not.
19157 I'm assuming it doesn't (contrary to ANSI C).
19159 fflushNULL="$undef"
19163 $define|true|[yY]*)
19164 fflushNULL="$define"
19167 fflushNULL="$undef"
19170 : check explicit looping only if NULL did not work, and if the pipe
19171 : bug does not show up on an explicit flush too
19172 case "$fflushNULL" in
19174 $cat >tryp.c <<EOCP
19177 main(int argc, char **argv)
19183 while ((i = getc(stdin)) != -1
19184 && (*bp++ = i) != '\n'
19185 && bp < &buf[1024])
19188 fprintf(stdout, "%s", buf);
19197 if eval $compile; then
19199 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19200 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19202 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19204 : now check for fflushall behaviour
19205 case "$fflushall" in
19206 '') set try -DTRY_FFLUSH_ALL $output
19207 if eval $compile; then
19209 (Now testing the other method--but note that this also may fail.)
19211 $run ./try 2>/dev/null
19214 if $test -s try.out -a "X$code" = X42; then
19215 fflushall="`$cat try.out`"
19219 case "$fflushall" in
19221 Whew. Flushing explicitly all the stdio streams works.
19223 fflushall="$define"
19226 Sigh. Flushing explicitly all the stdio streams doesn't work.
19231 Cannot figure out whether flushing stdio streams explicitly works or not.
19232 I'm assuming it doesn't.
19238 "$define"|true|[yY]*)
19239 fflushall="$define"
19247 All is futile. Even fflush(stdin) clobbers input pipes!
19254 $rm -f core tryp.c tryp.core core.tryp.*
19256 *) fflushall="$undef"
19260 case "$fflushNULL$fflushall" in
19263 OK, I give up. I cannot figure out how to flush pending stdio output.
19264 We won't be flushing handles at all before fork/exec/popen.
19270 : Store the full pathname to the ar program for use in the C program
19271 : Respect a hint or command line value for full_ar.
19276 : Store the full pathname to the sed program for use in the C program
19279 : see what type gids are declared as in the kernel
19281 echo "Looking for the type for group ids returned by getgid()."
19282 set gid_t gidtype xxx stdio.h sys/types.h
19286 xxx=`./findhdr sys/user.h`
19287 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19289 unsigned) dflt="$1 $2" ;;
19293 *) dflt="$gidtype";;
19296 gid_t) echo "gid_t found." ;;
19297 *) rp="What is the type for group ids returned by getgid()?"
19303 : Check the size of GID
19306 *_t) zzz="$gidtype" ;;
19309 echo "Checking the size of $zzz..." >&4
19311 #include <sys/types.h>
19313 #$i_stdlib I_STDLIB
19315 #include <stdlib.h>
19318 printf("%d\n", (int)sizeof($gidtype));
19323 if eval $compile_ok; then
19327 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19330 echo "Your $zzz is $gidsize bytes long."
19335 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19339 : Check if GID is signed
19342 *_t) zzz="$gidtype" ;;
19345 echo "Checking the sign of $zzz..." >&4
19347 #include <sys/types.h>
19358 if eval $compile; then
19362 echo "(I can't execute the test program--guessing unsigned.)" >&4
19366 1) echo "Your $zzz is unsigned." ;;
19367 -1) echo "Your $zzz is signed." ;;
19373 echo "(I can't compile the test program--guessing unsigned.)" >&4
19377 : Check 64bit sizes
19380 if $test X"$quadtype" != X; then
19382 echo "Checking how to print 64-bit integers..." >&4
19384 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19385 $cat >try.c <<'EOCP'
19386 #include <sys/types.h>
19389 int q = 12345678901;
19390 printf("%ld\n", q);
19394 if eval $compile; then
19398 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19399 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19400 echo "We will use %d."
19406 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19407 $cat >try.c <<'EOCP'
19408 #include <sys/types.h>
19411 long q = 12345678901;
19412 printf("%ld\n", q);
19416 if eval $compile; then
19420 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19421 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19422 echo "We will use %ld."
19428 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19429 $cat >try.c <<'EOCP'
19430 #include <sys/types.h>
19431 #include <inttypes.h>
19434 int64_t q = 12345678901;
19435 printf("%" PRId64 "\n", q);
19439 if eval $compile; then
19443 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19444 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19445 echo "We will use the C9X style."
19451 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19453 #include <sys/types.h>
19456 $quadtype q = 12345678901;
19457 printf("%Ld\n", q);
19461 if eval $compile; then
19465 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19466 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19467 echo "We will use %Ld."
19473 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19474 $cat >try.c <<'EOCP'
19475 #include <sys/types.h>
19478 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19479 printf("%lld\n", q);
19483 if eval $compile; then
19487 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19488 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19489 echo "We will use the %lld style."
19495 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19497 #include <sys/types.h>
19500 $quadtype q = 12345678901;
19501 printf("%qd\n", q);
19505 if eval $compile; then
19509 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19510 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19511 echo "We will use %qd."
19517 if $test X"$sPRId64" = X; then
19518 echo "Cannot figure out how to print 64-bit integers." >&4
19525 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19526 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19528 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19529 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19533 : Check format strings for internal types
19535 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19537 if $test X"$ivsize" = X8; then
19538 ivdformat="$sPRId64"
19539 uvuformat="$sPRIu64"
19540 uvoformat="$sPRIo64"
19541 uvxformat="$sPRIx64"
19542 uvXUformat="$sPRIXU64"
19544 if $test X"$ivsize" = X"$longsize"; then
19551 if $test X"$ivsize" = X"$intsize"; then
19559 if $test X"$ivsize" = X"$shortsize"; then
19570 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19571 nveformat="$sPRIeldbl"
19572 nvfformat="$sPRIfldbl"
19573 nvgformat="$sPRIgldbl"
19574 nvEUformat="$sPRIEUldbl"
19575 nvFUformat="$sPRIFUldbl"
19576 nvGUformat="$sPRIGUldbl"
19586 case "$ivdformat" in
19587 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19592 : Check format string for GID
19595 $echo "Checking the format string to be used for gids..." >&4
19598 -1) if $test X"$gidsize" = X"$ivsize"; then
19599 gidformat="$ivdformat"
19601 if $test X"$gidsize" = X"$longsize"; then
19604 if $test X"$gidsize" = X"$intsize"; then
19607 if $test X"$gidsize" = X"$shortsize"; then
19614 *) if $test X"$gidsize" = X"$uvsize"; then
19615 gidformat="$uvuformat"
19617 if $test X"$gidsize" = X"$longsize"; then
19620 if $test X"$gidsize" = X"$intsize"; then
19623 if $test X"$gidsize" = X"$shortsize"; then
19632 : see if getgroups exists
19633 set getgroups d_getgrps
19636 : see if setgroups exists
19637 set setgroups d_setgrps
19640 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19642 case "$d_getgrps$d_setgrps" in
19644 case "$groupstype" in
19645 '') dflt="$gidtype" ;;
19646 *) dflt="$groupstype" ;;
19649 What type of pointer is the second argument to getgroups() and setgroups()?
19650 Usually this is the same as group ids, $gidtype, but not always.
19653 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19657 *) groupstype="$gidtype";;
19660 : MAD = Misc Attribute Definition
19662 if $test $patchlevel -lt 9; then
19663 : MAD is not available in 5.8.x or earlier.
19667 $define|true|[yY]*) dflt='y' ;;
19672 Would you like to build with Misc Attribute Decoration? This is development
19673 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19674 overhead on the interpreter.
19676 If this doesn't make any sense to you, just accept the default '$dflt'.
19678 rp='Build Perl with MAD?'
19683 madlyh='madly.h madly.act madly.tab'
19685 madlyobj="madly$_o" ;;
19694 : check whether make sets MAKE
19696 echo "Checking if your $make program sets \$(MAKE)..." >&4
19697 case "$make_set_make" in
19699 $sed 's/^X //' > testmake.mak << 'EOF'
19701 X @echo 'maketemp="$(MAKE)"'
19703 case "`$make -f testmake.mak 2>/dev/null`" in
19704 *maketemp=*) make_set_make='#' ;;
19705 *) make_set_make="MAKE=$make" ;;
19707 $rm -f testmake.mak
19710 case "$make_set_make" in
19711 '#') echo "Yup, it does.";;
19712 *) echo "Nope, it doesn't.";;
19715 : see what type is used for mode_t
19716 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19717 set mode_t modetype int stdio.h sys/types.h
19720 : see if we need va_copy
19722 case "$i_stdarg" in
19725 #include <stdarg.h>
19727 #$i_stdlib I_STDLIB
19729 #include <stdlib.h>
19731 #include <signal.h>
19734 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19736 return vfprintf(f, fmt, *valp);
19740 myvfprintf(FILE *f, const char *fmt, va_list val)
19742 return ivfprintf(f, fmt, &val);
19746 myprintf(char *fmt, ...)
19749 va_start(val, fmt);
19750 return myvfprintf(stdout, fmt, val);
19754 main(int ac, char **av)
19756 signal(SIGSEGV, exit);
19758 myprintf("%s%cs all right, then\n", "that", '\'');
19763 if eval $compile && $run ./try 2>&1 >/dev/null; then
19764 case "`$run ./try`" in
19765 "that's all right, then")
19771 yes) echo "It seems that you don't need va_copy()." >&4
19772 need_va_copy="$undef"
19774 *) echo "It seems that va_copy() or similar will be needed." >&4
19775 need_va_copy="$define"
19780 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19784 : see what type is used for size_t
19785 rp="What is the type used for the length parameter for string functions?"
19786 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19789 : check for type of arguments to gethostbyaddr.
19790 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19791 case "$d_gethbyaddr" in
19795 Checking to see what type of arguments are accepted by gethostbyaddr().
19797 hdrs="$define sys/types.h
19798 $d_socket sys/socket.h
19799 $i_niin netinet/in.h
19801 $i_unistd unistd.h"
19802 : The first arg can 'char *' or 'void *'
19803 : The second arg is some of integral type
19804 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19805 for yyy in size_t long int; do
19806 case "$netdb_host_type" in
19807 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19808 if ./protochk "$try" $hdrs; then
19809 echo "Your system accepts $xxx for the first arg."
19810 echo "...and $yyy for the second arg."
19811 netdb_host_type="$xxx"
19812 netdb_hlen_type="$yyy"
19818 : In case none of those worked, prompt the user.
19819 case "$netdb_host_type" in
19820 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19823 netdb_host_type=$ans
19824 rp='What is the type for the 2nd argument to gethostbyaddr?'
19827 netdb_hlen_type=$ans
19831 *) : no gethostbyaddr, so pick harmless defaults
19832 netdb_host_type='char *'
19833 netdb_hlen_type="$sizetype"
19836 # Remove the "const" if needed. -- but then we'll have a
19838 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19841 : check for type of argument to gethostbyname.
19842 if test "X$netdb_name_type" = X ; then
19843 case "$d_gethbyname" in
19847 Checking to see what type of argument is accepted by gethostbyname().
19849 hdrs="$define sys/types.h
19850 $d_socket sys/socket.h
19851 $i_niin netinet/in.h
19853 $i_unistd unistd.h"
19854 for xxx in "const char *" "char *"; do
19855 case "$netdb_name_type" in
19856 '') try="extern struct hostent *gethostbyname($xxx);"
19857 if ./protochk "$try" $hdrs; then
19858 echo "Your system accepts $xxx."
19859 netdb_name_type="$xxx"
19864 : In case none of those worked, prompt the user.
19865 case "$netdb_name_type" in
19866 '') rp='What is the type for the 1st argument to gethostbyname?'
19869 netdb_name_type=$ans
19873 *) : no gethostbyname, so pick harmless default
19874 netdb_name_type='char *'
19879 : check for type of 1st argument to getnetbyaddr.
19880 if test "X$netdb_net_type" = X ; then
19881 case "$d_getnbyaddr" in
19885 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19887 hdrs="$define sys/types.h
19888 $d_socket sys/socket.h
19889 $i_niin netinet/in.h
19891 $i_unistd unistd.h"
19892 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19893 case "$netdb_net_type" in
19894 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19895 if ./protochk "$try" $hdrs; then
19896 echo "Your system accepts $xxx."
19897 netdb_net_type="$xxx"
19902 : In case none of those worked, prompt the user.
19903 case "$netdb_net_type" in
19904 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19907 netdb_net_type=$ans
19911 *) : no getnetbyaddr, so pick harmless default
19912 netdb_net_type='long'
19916 : locate the preferred pager for this system
19923 [a-zA-Z]:/*) dflt=$pg;;
19927 [a-zA-Z]:/*) dflt=$more;;
19931 [a-zA-Z]:/*) dflt=$less;;
19934 '') dflt=/usr/ucb/more;;
19942 rp='What pager is used on your system?'
19946 : see what type pids are declared as in the kernel
19947 rp="What is the type of process ids on this system?"
19948 set pid_t pidtype int stdio.h sys/types.h
19951 : see if ar generates random libraries by itself
19953 echo "Checking how to generate random libraries on your machine..." >&4
19954 echo 'int bar1() { return bar2(); }' > bar1.c
19955 echo 'int bar2() { return 2; }' > bar2.c
19957 #$i_stdlib I_STDLIB
19959 #include <stdlib.h>
19961 int main() { printf("%d\n", bar1()); exit(0); }
19963 $cc $ccflags -c bar1.c >/dev/null 2>&1
19964 $cc $ccflags -c bar2.c >/dev/null 2>&1
19965 $cc $ccflags -c foo.c >/dev/null 2>&1
19966 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19967 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19968 $run ./foobar >/dev/null 2>&1; then
19969 echo "$ar appears to generate random libraries itself."
19971 if [ "X$ranlib" = "X" ]; then
19974 elif $ar s bar$_a >/dev/null 2>&1 &&
19975 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19976 $run ./foobar >/dev/null 2>&1; then
19977 echo "a table of contents needs to be added with '$ar s'."
19980 elif $ar ts bar$_a >/dev/null 2>&1 &&
19981 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19982 $run ./foobar >/dev/null 2>&1; then
19983 echo "a table of contents needs to be added with '$ar ts'."
19990 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19991 $test -f $ranlib || ranlib=''
19994 if $test -n "$ranlib"; then
19995 echo "your system has '$ranlib'; we'll use that."
19998 echo "your system doesn't seem to support random libraries"
19999 echo "so we'll use lorder and tsort to order the libraries."
20006 : Check the max offset that gmtime accepts
20007 echo "Checking max offset that gmtime () accepts"
20009 $cat >try.c <<'EOCP'
20010 #include <sys/types.h>
20018 for (i = 0; i < 78; i++) {
20019 time_t t = (1 << i) - 1;
20021 if (tmp == NULL || tmp->tm_year < y) {
20023 printf ("%d\n", pt);
20030 printf ("%d\n", pt);
20035 if eval $compile; then
20036 sGMTIME_max=`$run ./try`
20038 echo "Cannot determine sGMTIME_max"
20042 echo "Checking min offset that gmtime () accepts"
20044 $cat >try.c <<'EOCP'
20045 #include <sys/types.h>
20053 for (i = 0; i < 78; i++) {
20054 time_t t = - (1 << i);
20056 if (tmp == NULL || tmp->tm_year > y) {
20058 printf ("%d\n", pt);
20065 printf ("%d\n", pt);
20070 if eval $compile; then
20071 sGMTIME_min=`$run ./try`
20073 echo "Cannot determine sGMTIME_min"
20077 : check for type of arguments to select.
20078 case "$selecttype" in
20079 '') case "$d_select" in
20083 Checking to see what type of arguments are accepted by select().
20085 hdrs="$define sys/types.h
20086 $i_systime sys/time.h
20087 $i_sysselct sys/select.h
20088 $d_socket sys/socket.h"
20089 : The first arg can be int, unsigned, or size_t
20090 : The last arg may or may not be 'const'
20092 : void pointer has been seen but using that
20093 : breaks the selectminbits test
20094 for xxx in 'fd_set *' 'int *'; do
20095 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20096 for tmo in 'struct timeval *' 'const struct timeval *'; do
20098 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20099 if ./protochk "$try" $hdrs; then
20100 echo "Your system accepts $xxx."
20109 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20110 case "$d_fd_set" in
20111 $define) dflt="fd_set *" ;;
20120 *) : no select, so pick a harmless default
20127 : check for the select 'width'
20128 case "$selectminbits" in
20129 '') safebits=`expr $ptrsize \* 8`
20130 case "$d_select" in
20134 Checking to see on how many bits at a time your select() operates...
20137 #include <sys/types.h>
20139 #$i_systime I_SYS_TIME
20140 #$i_systimek I_SYS_TIME_KERNEL
20145 # ifdef I_SYS_TIME_KERNEL
20148 # include <sys/time.h>
20149 # ifdef I_SYS_TIME_KERNEL
20153 #$i_sysselct I_SYS_SELECT
20154 #ifdef I_SYS_SELECT
20155 #include <sys/select.h>
20157 #$d_socket HAS_SOCKET
20159 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20162 #$i_stdlib I_STDLIB
20164 #include <stdlib.h>
20167 #define S sizeof(*(b))
20169 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20170 #define NBITS (NBYTES * 8)
20172 char *s = (char *)malloc(NBYTES);
20181 fp = fopen("try.c", "r");
20187 b = ($selecttype)s;
20188 for (i = 0; i < NBITS; i++)
20192 select(fd + 1, b, 0, 0, &t);
20193 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20195 printf("%d\n", i + 1);
20200 if eval $compile_ok; then
20201 selectminbits=`$run ./try`
20202 case "$selectminbits" in
20204 Cannot figure out on how many bits at a time your select() operates.
20205 I'll play safe and guess it is $safebits bits.
20207 selectminbits=$safebits
20208 bits="$safebits bits"
20211 *) bits="$selectminbits bits" ;;
20213 echo "Your select() operates on $bits at a time." >&4
20215 rp='What is the minimum number of bits your select() operates on?'
20216 case "$byteorder" in
20217 12345678) dflt=64 ;;
20223 selectminbits="$val"
20227 *) : no select, so pick a harmless default
20228 selectminbits=$safebits
20234 : Trace out the files included by signal.h, then look for SIGxxx names.
20235 if [ "X$fieldn" = X ]; then
20236 : Just make some guesses. We check them later.
20237 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20239 xxx=`echo '#include <signal.h>' |
20240 $cppstdin $cppminus $cppflags 2>/dev/null |
20241 $grep '^[ ]*#.*include' |
20242 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20243 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20246 for xx in $xxx /dev/null ; do
20247 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20249 case "$xxxfiles" in
20250 '') xxxfiles=`./findhdr signal.h` ;;
20253 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20254 print substr($2, 4, 20)
20256 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20257 print substr($3, 4, 20)
20259 : Append some common names just in case the awk scan failed.
20260 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20261 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20262 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20263 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20264 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20266 : generate a few handy files for later
20267 $cat > signal.c <<EOCP
20268 #include <sys/types.h>
20269 #include <signal.h>
20270 #$i_stdlib I_STDLIB
20272 #include <stdlib.h>
20277 /* Strange style to avoid deeply-nested #if/#else/#endif */
20280 # define NSIG (_NSIG)
20286 # define NSIG (SIGMAX+1)
20292 # define NSIG (SIG_MAX+1)
20298 # define NSIG (_SIG_MAX+1)
20304 # define NSIG (MAXSIG+1)
20310 # define NSIG (MAX_SIG+1)
20315 # ifdef SIGARRAYSIZE
20316 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20322 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20326 /* Default to some arbitrary number that's big enough to get most
20327 of the common signals.
20333 printf("NSIG %d\n", NSIG);
20339 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20341 printf "#ifdef SIG"; printf $1; printf "\n"
20342 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20343 printf $1; printf ");\n"
20347 printf "#endif /* JUST_NSIG */\n";
20348 printf "exit(0);\n}\n";
20351 $cat >signal.awk <<'EOP'
20352 BEGIN { ndups = 0 }
20353 $1 ~ /^NSIG$/ { nsig = $2 }
20354 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20355 if ($2 > maxsig) { maxsig = $2 }
20356 if (sig_name[$2]) {
20357 dup_name[ndups] = $1
20358 dup_num[ndups] = $2
20370 printf("NSIG %d\n", nsig);
20371 for (n = 1; n < nsig; n++) {
20373 printf("%s %d\n", sig_name[n], sig_num[n])
20376 printf("NUM%d %d\n", n, n)
20379 for (n = 0; n < ndups; n++) {
20380 printf("%s %d\n", dup_name[n], dup_num[n])
20384 $cat >signal_cmd <<EOS
20386 if $test -s signal.lst; then
20387 echo "Using your existing signal.lst file"
20392 $cat >>signal_cmd <<'EOS'
20395 if eval $compile_ok; then
20396 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20397 $uniq | $awk -f signal.awk >signal.lst
20399 echo "(I can't seem be able to compile the whole test program)" >&4
20400 echo "(I'll try it in little pieces.)" >&4
20401 set signal -DJUST_NSIG
20402 if eval $compile_ok; then
20403 $run ./signal$_exe > signal.nsg
20406 echo "I can't seem to figure out how many signals you have." >&4
20407 echo "Guessing 50." >&4
20408 echo 'NSIG 50' > signal.nsg
20410 : Now look at all the signal names, one at a time.
20411 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20412 $cat > signal.c <<EOCP
20413 #include <sys/types.h>
20414 #include <signal.h>
20417 printf("$xx %d\n", SIG${xx});
20422 if eval $compile; then
20423 echo "SIG${xx} found."
20424 $run ./signal$_exe >> signal.ls1
20426 echo "SIG${xx} NOT found."
20429 if $test -s signal.ls1; then
20430 $cat signal.nsg signal.ls1 |
20431 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20435 if $test -s signal.lst; then
20438 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20439 echo 'kill -l' >signal
20440 set X `csh -f <signal`
20444 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20446 echo $@ | $tr ' ' $trnl | \
20447 $awk '{ printf "%s %d\n", $1, ++s; }
20448 END { printf "NSIG %d\n", ++s }' >signal.lst
20450 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20452 chmod a+x signal_cmd
20453 $eunicefix signal_cmd
20455 : generate list of signal names
20457 case "$sig_name_init" in
20459 *) case "$sig_num_init" in
20460 ''|*,*) doinit=yes ;;
20465 echo "Generating a list of signal names and numbers..." >&4
20467 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20468 sig_name=`$awk 'BEGIN { printf "ZERO " }
20469 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20470 sig_num=`$awk 'BEGIN { printf "0 " }
20471 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20472 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20473 !/^NSIG/ { printf "\"%s\", ", $1 }
20474 END { printf "0\n" }' signal.lst`
20475 sig_num_init=`$awk 'BEGIN { printf "0, " }
20476 !/^NSIG/ { printf "%d, ", $2}
20477 END { printf "0\n"}' signal.lst`
20480 echo "The following $sig_count signals are available:"
20482 echo $sig_name | $awk \
20483 'BEGIN { linelen = 0 }
20485 for (i = 1; i <= NF; i++) {
20486 name = "SIG" $i " "
20487 linelen = linelen + length(name)
20488 if (linelen > 70) {
20490 linelen = length(name)
20496 sig_size=`echo $sig_name | awk '{print NF}'`
20497 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20499 : Check size of size
20501 case "$sizetype" in
20502 *_t) zzz="$sizetype" ;;
20503 *) zzz="filesize" ;;
20505 echo "Checking the size of $zzz..." >&4
20507 #include <sys/types.h>
20509 #$i_stdlib I_STDLIB
20511 #include <stdlib.h>
20514 printf("%d\n", (int)sizeof($sizetype));
20519 if eval $compile_ok; then
20523 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20526 echo "Your $zzz size is $sizesize bytes."
20531 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20535 : check for socklen_t
20537 echo "Checking to see if you have socklen_t..." >&4
20539 #include <sys/types.h>
20540 #$d_socket HAS_SOCKET
20542 #include <sys/socket.h>
20544 int main() { socklen_t x = 16; }
20547 if eval $compile; then
20549 echo "You have socklen_t."
20552 echo "You do not have socklen_t."
20553 case "$sizetype" in
20554 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20561 : see if this is a socks.h system
20562 set socks.h i_socks
20565 : check for type of the size argument to socket calls
20566 case "$d_socket" in
20570 Checking to see what type is the last argument of accept().
20573 case "$d_socklen_t" in
20574 "$define") yyy="$yyy socklen_t"
20576 yyy="$yyy $sizetype int long unsigned"
20577 for xxx in $yyy; do
20578 case "$socksizetype" in
20579 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20580 case "$usesocks" in
20582 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20583 echo "Your system accepts '$xxx *' for the last argument of accept()."
20584 socksizetype="$xxx"
20587 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20588 echo "Your system accepts '$xxx *' for the last argument of accept()."
20589 socksizetype="$xxx"
20596 : In case none of those worked, prompt the user.
20597 case "$socksizetype" in
20598 '') rp='What is the type for socket address structure sizes?'
20605 *) : no sockets, so pick relatively harmless default
20610 : see what type is used for signed size_t
20611 set ssize_t ssizetype int stdio.h sys/types.h
20616 #$i_stdlib I_STDLIB
20618 #include <stdlib.h>
20620 #include <sys/types.h>
20621 #define Size_t $sizetype
20622 #define SSize_t $dflt
20625 if (sizeof(Size_t) == sizeof(SSize_t))
20627 else if (sizeof(Size_t) == sizeof(int))
20636 if eval $compile_ok && $run ./try > /dev/null; then
20637 ssizetype=`$run ./try`
20638 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20641 Help! I can't compile and run the ssize_t test program: please enlighten me!
20642 (This is probably a misconfiguration in your system or libraries, and
20643 you really ought to fix it. Still, I'll try anyway.)
20645 I need a type that is the same size as $sizetype, but is guaranteed to
20646 be signed. Common values are ssize_t, int and long.
20649 rp="What signed type is the same size as $sizetype?"
20655 : see what type of char stdio uses.
20657 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20658 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20659 echo "Your stdio uses unsigned chars." >&4
20660 stdchar="unsigned char"
20662 echo "Your stdio uses signed chars." >&4
20667 : see what type uids are declared as in the kernel
20669 echo "Looking for the type for user ids returned by getuid()."
20670 set uid_t uidtype xxx stdio.h sys/types.h
20674 xxx=`./findhdr sys/user.h`
20675 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20677 unsigned) dflt="$1 $2" ;;
20681 *) dflt="$uidtype";;
20684 uid_t) echo "uid_t found." ;;
20685 *) rp="What is the type for user ids returned by getuid()?"
20691 : Check size of UID
20694 *_t) zzz="$uidtype" ;;
20697 echo "Checking the size of $zzz..." >&4
20699 #include <sys/types.h>
20701 #$i_stdlib I_STDLIB
20703 #include <stdlib.h>
20706 printf("%d\n", (int)sizeof($uidtype));
20711 if eval $compile_ok; then
20715 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20718 echo "Your $zzz is $uidsize bytes long."
20723 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20726 : Check if UID is signed
20729 *_t) zzz="$uidtype" ;;
20732 echo "Checking the sign of $zzz..." >&4
20734 #include <sys/types.h>
20745 if eval $compile; then
20749 echo "(I can't execute the test program--guessing unsigned.)" >&4
20753 1) echo "Your $zzz is unsigned." ;;
20754 -1) echo "Your $zzz is signed." ;;
20760 echo "(I can't compile the test program--guessing unsigned.)" >&4
20764 : Check format string for UID
20766 $echo "Checking the format string to be used for uids..." >&4
20769 -1) if $test X"$uidsize" = X"$ivsize"; then
20770 uidformat="$ivdformat"
20772 if $test X"$uidsize" = X"$longsize"; then
20775 if $test X"$uidsize" = X"$intsize"; then
20778 if $test X"$uidsize" = X"$shortsize"; then
20785 *) if $test X"$uidsize" = X"$uvsize"; then
20786 uidformat="$uvuformat"
20788 if $test X"$uidsize" = X"$longsize"; then
20791 if $test X"$uidsize" = X"$intsize"; then
20794 if $test X"$uidsize" = X"$shortsize"; then
20803 : Check if site customization support was requested
20804 case "$usesitecustomize" in
20805 $define|true|[Yy]*)
20806 usesitecustomize="$define"
20809 usesitecustomize="$undef"
20813 : determine compiler compiler
20822 if $test -f "$byacc$_exe"; then
20824 comp="byacc or $comp"
20826 if $test -f "$bison$_exe"; then
20827 comp="$comp or bison -y"
20829 rp="Which compiler compiler ($comp) shall I use?"
20838 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20844 : see if this is a assert.h system
20845 set assert.h i_assert
20848 : see if this is a fp.h system
20852 : see if this is a fp_class.h system
20853 set fp_class.h i_fp_class
20856 : see if gdbm.h is available
20861 : see if gdbm_open exists
20862 set gdbm_open d_gdbm_open
20864 case "$d_gdbm_open" in
20867 echo "We won't be including <gdbm.h>"
20876 : see if ndbm.h is available
20879 : Compatibility location for RedHat 7.1
20880 set gdbm/ndbm.h i_gdbmndbm
20882 : Compatibility location for Debian 4.0
20883 set gdbm-ndbm.h i_gdbm_ndbm
20886 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
20887 : see if dbm_open exists
20888 set dbm_open d_dbm_open
20890 case "$d_dbm_open" in
20893 i_gdbmndbm="$undef"
20894 i_gdbm_ndbm="$undef"
20895 echo "We won't be including <ndbm.h>"
20905 : see if this is a ieeefp.h system
20906 case "$i_ieeefp" in
20907 '' ) set ieeefp.h i_ieeefp
20912 : see if this is a libutil.h system
20913 set libutil.h i_libutil
20916 : see if mach cthreads are available
20917 if test "X$usethreads" = "X$define"; then
20918 set mach/cthreads.h i_machcthr
20921 i_machcthr="$undef"
20924 : see if this is a mntent.h system
20925 set mntent.h i_mntent
20928 : see if net/errno.h is available
20930 set net/errno.h val
20933 : Unfortunately, it causes problems on some systems. Arrgh.
20936 cat > try.c <<'EOM'
20939 #include <net/errno.h>
20945 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20946 echo "We'll be including <net/errno.h>." >&4
20948 echo "We won't be including <net/errno.h>." >&4
20957 : see if netinet/tcp.h is available
20958 set netinet/tcp.h i_netinettcp
20961 : see if this is a poll.h system
20965 : see if this is a prot.h system
20969 : Preprocessor symbols
20971 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20972 $cat <<'EOSH' > Cppsym.know
20973 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20974 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20975 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20976 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20977 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20978 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20979 bull c cadmus clipper CMU COFF COMPILER_VERSION
20980 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20981 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20982 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20983 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20985 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20986 H3050R H3050RX hbullx20 hcx host_mips
20987 hp200 hp300 hp700 HP700 hp800 hp9000
20988 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20989 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20990 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20991 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20992 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20993 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20994 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20995 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20996 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20997 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20998 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20999 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21000 MATH_HAS_NO_SIDE_EFFECTS
21001 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21002 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21003 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21004 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21005 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21006 NetBSD news1500 news1700 news1800 news1900 news3700
21007 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21008 ns32016 ns32332 ns32k nsc32000
21009 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21010 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21011 pc532 pdp11 PGC PIC plexus PORTAR posix
21012 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21013 POSIX_C_SOURCE POSIX_SOURCE POWER
21014 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21015 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21016 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21017 sony sony_news sonyrisc sparc sparclite spectrum
21018 stardent stdc STDC_EXT stratos sun sun3 sun386
21019 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21020 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21021 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21022 sysV68 sysV88 Tek4132 Tek4300 titan
21023 TM3200 TM5400 TM5600
21024 tower tower32 tower32_200 tower32_600 tower32_700
21025 tower32_800 tower32_850 tss
21026 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21027 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21028 unix UNIX95 UNIX99 unixpc unos
21029 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21030 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21031 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21033 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21034 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21035 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21038 # Maybe put other stuff here too.
21039 cat <<EOSH >>Cppsym.know
21042 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21043 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21044 $cat Cppsym.know > Cppsym.c
21045 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21046 $rm -f Cppsym.a Cppsym.b Cppsym.c
21047 cat <<EOSH > Cppsym
21049 if $test \$# -gt 0; then
21050 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21051 if $test -s Cppsym.got; then
21058 $tr " " "$trnl" | ./Cppsym.try
21064 cat <<EOSH > Cppsym.try
21066 cat <<'EOCP' > try.c
21069 #define STRINGIFY(a) "a"
21071 #if cpp_stuff == 42
21072 #define StGiFy(a) #a
21073 #define STRINGIFY(a) StGiFy(a)
21075 #if $cpp_stuff != 1 && $cpp_stuff != 42
21076 # include "Bletch: How does this C preprocessor stringify macros?"
21082 cat <<'EOSH' >> Cppsym.try
21084 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21085 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21086 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21087 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21089 echo 'return 0;}' >> try.c
21091 cat <<EOSH >> Cppsym.try
21093 case "$osname-$gccversion" in
21094 irix-) ccflags="\$ccflags -woff 1178" ;;
21095 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21097 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21099 chmod +x Cppsym.try
21100 $eunicefix Cppsym.try
21101 ./Cppsym < Cppsym.know > Cppsym.true
21102 : Add in any linux cpp "predefined macros":
21103 case "$osname::$gccversion" in
21106 rm -f $tHdrH'.h' $tHdrH
21108 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21109 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21110 if [ -s $tHdrH'_cppsym.real' ]; then
21111 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21114 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21117 : now check the C compiler for additional symbols
21118 postprocess_cc_v=''
21120 aix) postprocess_cc_v="|$tr , ' '" ;;
21127 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21130 -D*) echo "\$i" | $sed 's/^-D//';;
21131 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21136 postprocess_cc_v=''
21139 ./ccsym > ccsym1.raw
21140 if $test -s ccsym1.raw; then
21141 $sort ccsym1.raw | $uniq >ccsym.raw
21143 mv ccsym1.raw ccsym.raw
21146 $awk '/\=/ { print $0; next }
21147 { print $0"=1" }' ccsym.raw >ccsym.list
21148 $comm -13 Cppsym.true ccsym.list >ccsym.own
21149 $comm -12 Cppsym.true ccsym.list >ccsym.com
21150 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21152 if $test -z ccsym.raw; then
21153 echo "Your C compiler doesn't seem to define any symbols!" >&4
21155 echo "However, your C preprocessor defines the following symbols:"
21158 cppsymbols=`$cat Cppsym.true`
21159 cppsymbols=`echo $cppsymbols`
21160 cppccsymbols="$cppsymbols"
21162 if $test -s ccsym.com; then
21163 echo "Your C compiler and pre-processor define these symbols:"
21164 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21167 cppccsymbols=`$cat ccsym.com`
21168 cppccsymbols=`echo $cppccsymbols`
21169 $test "$silent" || sleep 1
21171 if $test -s ccsym.cpp; then
21172 $test "$also" && echo " "
21173 echo "Your C pre-processor ${also}defines the following symbols:"
21174 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21176 cppsymbols=`$cat ccsym.cpp`
21177 cppsymbols=`echo $cppsymbols`
21178 $test "$silent" || sleep 1
21180 if $test -s ccsym.own; then
21181 $test "$also" && echo " "
21182 echo "Your C compiler ${also}defines the following cpp symbols:"
21183 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21184 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21185 ccsymbols=`$cat ccsym.own`
21186 ccsymbols=`echo $ccsymbols`
21187 $test "$silent" || sleep 1
21191 : see if this is a termio system
21195 if $test `./findhdr termios.h`; then
21196 set tcsetattr i_termios
21202 "$define") echo "You have POSIX termios.h... good!" >&4;;
21203 *) if ./Cppsym pyr; then
21204 case "`/bin/universe`" in
21205 ucb) if $test `./findhdr sgtty.h`; then
21207 echo "<sgtty.h> found." >&4
21209 echo "System is pyramid with BSD universe."
21210 ./warn "<sgtty.h> not found--you could have problems."
21212 *) if $test `./findhdr termio.h`; then
21214 echo "<termio.h> found." >&4
21216 echo "System is pyramid with USG universe."
21217 ./warn "<termio.h> not found--you could have problems."
21221 if $test `./findhdr termio.h`; then
21222 echo "<termio.h> found." >&4
21224 elif $test `./findhdr sgtty.h`; then
21225 echo "<sgtty.h> found." >&4
21228 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21231 if $test `./findhdr sgtty.h`; then
21232 echo "<sgtty.h> found." >&4
21234 elif $test `./findhdr termio.h`; then
21235 echo "<termio.h> found." >&4
21238 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21242 set i_termio; eval $setvar
21243 val=$val2; set i_sgtty; eval $setvar
21244 val=$val3; set i_termios; eval $setvar
21246 : see if stddef is available
21247 set stddef.h i_stddef
21250 : see if sys/access.h is available
21251 set sys/access.h i_sysaccess
21254 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21255 set sys/filio.h i_sysfilio
21258 if $test `./findhdr sys/ioctl.h`; then
21260 echo '<sys/ioctl.h> found.' >&4
21263 if $test $i_sysfilio = "$define"; then
21264 echo '<sys/ioctl.h> NOT found.' >&4
21266 $test $i_sgtty = "$define" && xxx="sgtty.h"
21267 $test $i_termio = "$define" && xxx="termio.h"
21268 $test $i_termios = "$define" && xxx="termios.h"
21269 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21275 : see if socket ioctl defs are in sys/sockio.h
21277 xxx=`./findhdr sys/sockio.h`
21278 if $test "$xxx"; then
21279 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21281 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21284 echo "No socket ioctls found in <sys/sockio.h>." >&4
21289 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21295 : see if this is a syslog.h system
21296 set syslog.h i_syslog
21299 : see if this is a sys/mode.h system
21300 set sys/mode.h i_sysmode
21303 : see if there is a sys/poll.h file
21304 set sys/poll.h i_syspoll
21307 : see if sys/resource.h has to be included
21308 set sys/resource.h i_sysresrc
21311 : see if sys/security.h is available
21312 set sys/security.h i_syssecrt
21315 : see if this is a sys/statvfs.h system
21316 set sys/statvfs.h i_sysstatvfs
21319 : see if this is a sys/un.h system
21320 set sys/un.h i_sysun
21323 : see if this is a sys/utsname.h system
21324 set sys/utsname.h i_sysutsname
21327 : see if this is a syswait system
21328 set sys/wait.h i_syswait
21331 : see if this is a ustat.h system
21332 set ustat.h i_ustat
21335 : see if this is an utime system
21336 set utime.h i_utime
21339 : see if this is a values.h system
21340 set values.h i_values
21343 : see if this is a vfork system
21346 set vfork.h i_vfork
21356 echo "Looking for extensions..." >&4
21357 : If we are using the old config.sh, known_extensions may contain
21358 : old or inaccurate or duplicate values.
21359 known_extensions=''
21360 nonxs_extensions=''
21361 : We do not use find because it might not be available.
21362 : We do not just use MANIFEST because the user may have dropped
21363 : some additional extensions into the source tree and expect them
21366 : Function to recursively find available extensions, ignoring DynaLoader
21367 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21371 DynaLoader|dynaload) ;;
21373 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21374 known_extensions="$known_extensions $1$xxx";
21375 elif $test -f $xxx/Makefile.PL; then
21376 nonxs_extensions="$nonxs_extensions $1$xxx";
21378 if $test -d $xxx -a $# -lt 10; then
21381 eval $find_extensions;
21393 eval $find_extensions
21394 # Special case: Add in modules that nest beyond the first level.
21395 # Currently threads/shared and Hash/Util/FieldHash, since they are
21396 # not picked up by the recursive find above (and adding in general
21397 # recursive finding breaks SDBM_File/sdbm).
21398 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21399 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21400 set X $known_extensions
21402 known_extensions="$*"
21403 set X $nonxs_extensions
21405 nonxs_extensions="$*"
21408 : Now see which are supported on this system.
21410 for xxx in $known_extensions ; do
21414 $define) avail_ext="$avail_ext $xxx" ;;
21417 GDBM_File|gdbm_fil)
21419 $define) avail_ext="$avail_ext $xxx" ;;
21422 I18N/Langinfo|i18n_lan)
21423 case "$i_langinfo$d_nl_langinfo" in
21424 $define$define) avail_ext="$avail_ext $xxx" ;;
21428 : XXX Do we need a useipcsysv variable here
21429 case "${d_msg}${d_sem}${d_shm}" in
21430 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21433 NDBM_File|ndbm_fil)
21436 case "$osname-$use64bitint" in
21439 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21442 *) avail_ext="$avail_ext $xxx" ;;
21447 ODBM_File|odbm_fil)
21448 case "${i_dbm}${i_rpcsvcdbm}" in
21450 case "$d_cplusplus" in
21451 define) ;; # delete as a function name will not work
21452 *) case "$osname-$use64bitint" in
21455 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21458 *) avail_ext="$avail_ext $xxx" ;;
21466 case "$useopcode" in
21467 true|define|y) avail_ext="$avail_ext $xxx" ;;
21471 case "$useposix" in
21472 true|define|y) avail_ext="$avail_ext $xxx" ;;
21476 case "$d_socket" in
21479 beos) ;; # not unless BONE
21480 *) avail_ext="$avail_ext $xxx" ;;
21485 Sys/Syslog|sys/syslog)
21486 : XXX syslog requires socket
21487 case "$d_socket" in
21488 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21492 case "$usethreads" in
21494 case "$use5005threads" in
21495 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21499 threads|threads/shared)
21500 # threads and threads::shared are special cases.
21501 # To stop people from asking "Perl 5.8.0 was supposed
21502 # to have this new fancy threads implementation but my
21503 # perl doesn't have it" and from people trying to
21504 # (re)install the threads module using CPAN.pm and
21505 # CPAN.pm then offering to reinstall Perl 5.8.0,
21506 # the threads.pm and threads/shared.pm will always be
21507 # there, croaking informatively ("you need to rebuild
21508 # all of Perl with threads, sorry") when threads haven't
21509 # been compiled in.
21511 avail_ext="$avail_ext $xxx"
21515 cygwin) avail_ext="$avail_ext $xxx" ;;
21518 XS/APItest|xs/apitest)
21519 # This is just for testing. Skip it unless we have dynamic loading.
21522 $define) avail_ext="$avail_ext $xxx" ;;
21525 XS/Typemap|xs/typemap)
21526 # This is just for testing. Skip it unless we have dynamic loading.
21528 $define) avail_ext="$avail_ext $xxx" ;;
21531 *) avail_ext="$avail_ext $xxx"
21540 case "$onlyextensions" in
21542 *) keepextensions=''
21543 echo "You have requested that only certains extensions be included..." >&4
21544 for i in $onlyextensions; do
21545 case " $avail_ext " in
21547 echo "Keeping extension $i."
21548 keepextensions="$keepextensions $i"
21550 *) echo "Ignoring extension $i." ;;
21553 avail_ext="$keepextensions"
21557 case "$noextensions" in
21559 *) keepextensions=''
21560 echo "You have requested that certain extensions be ignored..." >&4
21561 for i in $avail_ext; do
21562 case " $noextensions " in
21563 *" $i "*) echo "Ignoring extension $i." ;;
21564 *) echo "Keeping extension $i.";
21565 keepextensions="$keepextensions $i"
21569 avail_ext="$keepextensions"
21573 : Now see which nonxs extensions are supported on this system.
21574 : For now assume all are.
21576 for xxx in $nonxs_extensions ; do
21578 *) nonxs_ext="$nonxs_ext $xxx"
21590 A number of extensions are supplied with $package. You may choose to
21591 compile these extensions for dynamic loading (the default), compile
21592 them into the $package executable (static loading), or not include
21593 them at all. Answer "none" to include no extensions.
21594 Note that DynaLoader is always built and need not be mentioned here.
21597 case "$dynamic_ext" in
21599 : Exclude those listed in static_ext
21601 for xxx in $avail_ext; do
21602 case " $static_ext " in
21604 *) dflt="$dflt $xxx" ;;
21611 *) dflt="$dynamic_ext"
21612 # Perhaps we are reusing an old out-of-date config.sh.
21615 if test X"$dynamic_ext" != X"$avail_ext"; then
21617 NOTICE: Your previous config.sh list may be incorrect.
21618 The extensions now available to you are
21620 but the default list from your previous config.sh is
21632 rp="What extensions do you wish to load dynamically?"
21635 none) dynamic_ext=' ' ;;
21636 *) dynamic_ext="$ans" ;;
21639 case "$static_ext" in
21641 : Exclude those already listed in dynamic linking
21643 for xxx in $avail_ext; do
21644 case " $dynamic_ext " in
21646 *) dflt="$dflt $xxx" ;;
21653 *) dflt="$static_ext"
21660 rp="What extensions do you wish to load statically?"
21663 none) static_ext=' ' ;;
21664 *) static_ext="$ans" ;;
21669 A number of extensions are supplied with $package. Answer "none"
21670 to include no extensions.
21671 Note that DynaLoader is always built and need not be mentioned here.
21674 case "$static_ext" in
21675 '') dflt="$avail_ext" ;;
21676 *) dflt="$static_ext"
21677 # Perhaps we are reusing an old out-of-date config.sh.
21680 if test X"$static_ext" != X"$avail_ext"; then
21682 NOTICE: Your previous config.sh list may be incorrect.
21683 The extensions now available to you are
21685 but the default list from your previous config.sh is
21694 : Exclude those that are not xs extensions
21698 rp="What extensions do you wish to include?"
21701 none) static_ext=' ' ;;
21702 *) static_ext="$ans" ;;
21707 # Encode is a special case. If we are building Encode as a static
21708 # extension, we need to explicitly list its subextensions as well.
21709 # For other nested extensions, this is handled automatically by
21710 # the appropriate Makefile.PL.
21711 case " $static_ext " in
21712 *" Encode "*) # Add the subextensions of Encode
21714 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21715 static_ext="$static_ext Encode/$xxx"
21721 set X $dynamic_ext $static_ext $nonxs_ext
21725 # Sanity check: We require an extension suitable for use with
21726 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21727 # should show up as failures in the test suite, but it's helpful to
21728 # catch them now.) The 'extensions' list is normally sorted
21729 # alphabetically, so we need to accept either
21730 # DB_File ... Fcntl ... IO ....
21731 # or something like
21732 # Fcntl ... NDBM_File ... IO ....
21733 case " $extensions" in
21734 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21735 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21736 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21737 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21738 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21742 : Remove libraries needed only for extensions
21743 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21744 : The exception is SunOS 4.x, which needs them.
21745 case "${osname}X${osvers}" in
21749 *) case "$usedl" in
21750 $define|true|[yY]*)
21751 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21755 *) perllibs="$libs"
21761 : Remove build directory name from cppstdin so it can be used from
21762 : either the present location or the final installed location.
21764 : Get out of the UU directory to get correct path name.
21766 case "$cppstdin" in
21768 echo "Stripping down cppstdin path name"
21774 : end of configuration questions
21776 echo "End of configuration questions."
21779 : back to where it started
21780 if test -d ../UU; then
21784 : configuration may be unconditionally patched via a 'config.arch' file
21785 if $test -f config.arch; then
21786 echo "I see a config.arch file, loading it." >&4
21790 : configuration may be patched via a 'config.over' file
21791 if $test -f config.over; then
21794 rp='I see a config.over file. Do you wish to load it?'
21797 n*) echo "OK, I'll ignore it.";;
21799 echo "Configuration override changes have been loaded."
21804 : in case they want portability, strip down executable paths
21805 case "$d_portable" in
21808 echo "Stripping down executable paths..." >&4
21809 for file in $loclist $trylist; do
21811 eval $file=`basename $temp`
21816 : create config.sh file
21818 echo "Creating config.sh..." >&4
21819 $spitshell <<EOT >config.sh
21822 # This file was produced by running the Configure script. It holds all the
21823 # definitions figured out by Configure. Should you modify one of these values,
21824 # do not forget to propagate your changes by running "Configure -der". You may
21825 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21828 # Package name : $package
21829 # Source directory : $src
21830 # Configuration time: $cf_time
21831 # Configured by : $cf_by
21832 # Target system : $myuname
21835 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21836 $spitshell <<EOT >>config.sh
21845 Revision='$Revision'
21853 alignbytes='$alignbytes'
21854 ansi2knr='$ansi2knr'
21855 aphostname='$aphostname'
21856 api_revision='$api_revision'
21857 api_subversion='$api_subversion'
21858 api_version='$api_version'
21859 api_versionstring='$api_versionstring'
21862 archlibexp='$archlibexp'
21863 archname64='$archname64'
21864 archname='$archname'
21865 archobjs='$archobjs'
21866 asctime_r_proto='$asctime_r_proto'
21874 byteorder='$byteorder'
21876 castflags='$castflags'
21879 cccdlflags='$cccdlflags'
21880 ccdlflags='$ccdlflags'
21882 ccflags_uselargefiles='$ccflags_uselargefiles'
21884 ccsymbols='$ccsymbols'
21885 ccversion='$ccversion'
21887 cf_email='$cf_email'
21892 clocktype='$clocktype'
21894 compress='$compress'
21895 contains='$contains'
21899 cpp_stuff='$cpp_stuff'
21900 cppccsymbols='$cppccsymbols'
21901 cppflags='$cppflags'
21903 cppminus='$cppminus'
21905 cppstdin='$cppstdin'
21906 cppsymbols='$cppsymbols'
21907 crypt_r_proto='$crypt_r_proto'
21908 cryptlib='$cryptlib'
21910 ctermid_r_proto='$ctermid_r_proto'
21911 ctime_r_proto='$ctime_r_proto'
21912 d_Gconvert='$d_Gconvert'
21913 d_PRIEUldbl='$d_PRIEUldbl'
21914 d_PRIFUldbl='$d_PRIFUldbl'
21915 d_PRIGUldbl='$d_PRIGUldbl'
21916 d_PRIXU64='$d_PRIXU64'
21917 d_PRId64='$d_PRId64'
21918 d_PRIeldbl='$d_PRIeldbl'
21919 d_PRIfldbl='$d_PRIfldbl'
21920 d_PRIgldbl='$d_PRIgldbl'
21921 d_PRIi64='$d_PRIi64'
21922 d_PRIo64='$d_PRIo64'
21923 d_PRIu64='$d_PRIu64'
21924 d_PRIx64='$d_PRIx64'
21925 d_SCNfldbl='$d_SCNfldbl'
21926 d__fwalk='$d__fwalk'
21927 d_access='$d_access'
21928 d_accessx='$d_accessx'
21931 d_archlib='$d_archlib'
21932 d_asctime_r='$d_asctime_r'
21935 d_attribute_format='$d_attribute_format'
21936 d_attribute_malloc='$d_attribute_malloc'
21937 d_attribute_nonnull='$d_attribute_nonnull'
21938 d_attribute_noreturn='$d_attribute_noreturn'
21939 d_attribute_pure='$d_attribute_pure'
21940 d_attribute_unused='$d_attribute_unused'
21941 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21945 d_bsdgetpgrp='$d_bsdgetpgrp'
21946 d_bsdsetpgrp='$d_bsdsetpgrp'
21947 d_builtin_choose_expr='$d_builtin_choose_expr'
21948 d_builtin_expect='$d_builtin_expect'
21950 d_c99_variadic_macros='$d_c99_variadic_macros'
21951 d_casti32='$d_casti32'
21952 d_castneg='$d_castneg'
21953 d_charvspr='$d_charvspr'
21955 d_chroot='$d_chroot'
21956 d_chsize='$d_chsize'
21958 d_clearenv='$d_clearenv'
21959 d_closedir='$d_closedir'
21960 d_cmsghdr_s='$d_cmsghdr_s'
21962 d_copysignl='$d_copysignl'
21963 d_cplusplus='$d_cplusplus'
21965 d_crypt_r='$d_crypt_r'
21967 d_ctermid='$d_ctermid'
21968 d_ctermid_r='$d_ctermid_r'
21969 d_ctime_r='$d_ctime_r'
21970 d_cuserid='$d_cuserid'
21971 d_dbl_dig='$d_dbl_dig'
21972 d_dbminitproto='$d_dbminitproto'
21973 d_difftime='$d_difftime'
21974 d_dir_dd_fd='$d_dir_dd_fd'
21976 d_dirnamlen='$d_dirnamlen'
21977 d_dlerror='$d_dlerror'
21978 d_dlopen='$d_dlopen'
21979 d_dlsymun='$d_dlsymun'
21980 d_dosuid='$d_dosuid'
21981 d_drand48_r='$d_drand48_r'
21982 d_drand48proto='$d_drand48proto'
21984 d_eaccess='$d_eaccess'
21985 d_endgrent='$d_endgrent'
21986 d_endgrent_r='$d_endgrent_r'
21987 d_endhent='$d_endhent'
21988 d_endhostent_r='$d_endhostent_r'
21989 d_endnent='$d_endnent'
21990 d_endnetent_r='$d_endnetent_r'
21991 d_endpent='$d_endpent'
21992 d_endprotoent_r='$d_endprotoent_r'
21993 d_endpwent='$d_endpwent'
21994 d_endpwent_r='$d_endpwent_r'
21995 d_endsent='$d_endsent'
21996 d_endservent_r='$d_endservent_r'
21997 d_eofnblk='$d_eofnblk'
21998 d_eunice='$d_eunice'
21999 d_faststdio='$d_faststdio'
22000 d_fchdir='$d_fchdir'
22001 d_fchmod='$d_fchmod'
22002 d_fchown='$d_fchown'
22004 d_fcntl_can_lock='$d_fcntl_can_lock'
22005 d_fd_macros='$d_fd_macros'
22006 d_fd_set='$d_fd_set'
22007 d_fds_bits='$d_fds_bits'
22008 d_fgetpos='$d_fgetpos'
22009 d_finite='$d_finite'
22010 d_finitel='$d_finitel'
22011 d_flexfnam='$d_flexfnam'
22013 d_flockproto='$d_flockproto'
22015 d_fp_class='$d_fp_class'
22016 d_fpathconf='$d_fpathconf'
22017 d_fpclass='$d_fpclass'
22018 d_fpclassify='$d_fpclassify'
22019 d_fpclassl='$d_fpclassl'
22020 d_fpos64_t='$d_fpos64_t'
22021 d_frexpl='$d_frexpl'
22022 d_fs_data_s='$d_fs_data_s'
22023 d_fseeko='$d_fseeko'
22024 d_fsetpos='$d_fsetpos'
22025 d_fstatfs='$d_fstatfs'
22026 d_fstatvfs='$d_fstatvfs'
22028 d_ftello='$d_ftello'
22030 d_futimes='$d_futimes'
22031 d_getcwd='$d_getcwd'
22032 d_getespwnam='$d_getespwnam'
22033 d_getfsstat='$d_getfsstat'
22034 d_getgrent='$d_getgrent'
22035 d_getgrent_r='$d_getgrent_r'
22036 d_getgrgid_r='$d_getgrgid_r'
22037 d_getgrnam_r='$d_getgrnam_r'
22038 d_getgrps='$d_getgrps'
22039 d_gethbyaddr='$d_gethbyaddr'
22040 d_gethbyname='$d_gethbyname'
22041 d_gethent='$d_gethent'
22042 d_gethname='$d_gethname'
22043 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22044 d_gethostbyname_r='$d_gethostbyname_r'
22045 d_gethostent_r='$d_gethostent_r'
22046 d_gethostprotos='$d_gethostprotos'
22047 d_getitimer='$d_getitimer'
22048 d_getlogin='$d_getlogin'
22049 d_getlogin_r='$d_getlogin_r'
22050 d_getmnt='$d_getmnt'
22051 d_getmntent='$d_getmntent'
22052 d_getnbyaddr='$d_getnbyaddr'
22053 d_getnbyname='$d_getnbyname'
22054 d_getnent='$d_getnent'
22055 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22056 d_getnetbyname_r='$d_getnetbyname_r'
22057 d_getnetent_r='$d_getnetent_r'
22058 d_getnetprotos='$d_getnetprotos'
22059 d_getpagsz='$d_getpagsz'
22060 d_getpbyname='$d_getpbyname'
22061 d_getpbynumber='$d_getpbynumber'
22062 d_getpent='$d_getpent'
22063 d_getpgid='$d_getpgid'
22064 d_getpgrp2='$d_getpgrp2'
22065 d_getpgrp='$d_getpgrp'
22066 d_getppid='$d_getppid'
22067 d_getprior='$d_getprior'
22068 d_getprotobyname_r='$d_getprotobyname_r'
22069 d_getprotobynumber_r='$d_getprotobynumber_r'
22070 d_getprotoent_r='$d_getprotoent_r'
22071 d_getprotoprotos='$d_getprotoprotos'
22072 d_getprpwnam='$d_getprpwnam'
22073 d_getpwent='$d_getpwent'
22074 d_getpwent_r='$d_getpwent_r'
22075 d_getpwnam_r='$d_getpwnam_r'
22076 d_getpwuid_r='$d_getpwuid_r'
22077 d_getsbyname='$d_getsbyname'
22078 d_getsbyport='$d_getsbyport'
22079 d_getsent='$d_getsent'
22080 d_getservbyname_r='$d_getservbyname_r'
22081 d_getservbyport_r='$d_getservbyport_r'
22082 d_getservent_r='$d_getservent_r'
22083 d_getservprotos='$d_getservprotos'
22084 d_getspnam='$d_getspnam'
22085 d_getspnam_r='$d_getspnam_r'
22086 d_gettimeod='$d_gettimeod'
22087 d_gmtime_r='$d_gmtime_r'
22088 d_gnulibc='$d_gnulibc'
22089 d_grpasswd='$d_grpasswd'
22090 d_hasmntopt='$d_hasmntopt'
22092 d_ilogbl='$d_ilogbl'
22093 d_inc_version_list='$d_inc_version_list'
22095 d_inetaton='$d_inetaton'
22096 d_int64_t='$d_int64_t'
22097 d_isascii='$d_isascii'
22098 d_isfinite='$d_isfinite'
22101 d_isnanl='$d_isnanl'
22102 d_killpg='$d_killpg'
22103 d_lchown='$d_lchown'
22104 d_ldbl_dig='$d_ldbl_dig'
22105 d_libm_lib_version='$d_libm_lib_version'
22107 d_localtime_r='$d_localtime_r'
22108 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22109 d_locconv='$d_locconv'
22111 d_longdbl='$d_longdbl'
22112 d_longlong='$d_longlong'
22113 d_lseekproto='$d_lseekproto'
22115 d_madvise='$d_madvise'
22116 d_malloc_good_size='$d_malloc_good_size'
22117 d_malloc_size='$d_malloc_size'
22119 d_mbstowcs='$d_mbstowcs'
22120 d_mbtowc='$d_mbtowc'
22121 d_memchr='$d_memchr'
22122 d_memcmp='$d_memcmp'
22123 d_memcpy='$d_memcpy'
22124 d_memmove='$d_memmove'
22125 d_memset='$d_memset'
22127 d_mkdtemp='$d_mkdtemp'
22128 d_mkfifo='$d_mkfifo'
22129 d_mkstemp='$d_mkstemp'
22130 d_mkstemps='$d_mkstemps'
22131 d_mktime='$d_mktime'
22134 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22135 d_modflproto='$d_modflproto'
22136 d_mprotect='$d_mprotect'
22138 d_msg_ctrunc='$d_msg_ctrunc'
22139 d_msg_dontroute='$d_msg_dontroute'
22140 d_msg_oob='$d_msg_oob'
22141 d_msg_peek='$d_msg_peek'
22142 d_msg_proxy='$d_msg_proxy'
22143 d_msgctl='$d_msgctl'
22144 d_msgget='$d_msgget'
22145 d_msghdr_s='$d_msghdr_s'
22146 d_msgrcv='$d_msgrcv'
22147 d_msgsnd='$d_msgsnd'
22149 d_munmap='$d_munmap'
22150 d_mymalloc='$d_mymalloc'
22153 d_nl_langinfo='$d_nl_langinfo'
22154 d_nv_preserves_uv='$d_nv_preserves_uv'
22155 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22156 d_off64_t='$d_off64_t'
22157 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22158 d_oldpthreads='$d_oldpthreads'
22159 d_oldsock='$d_oldsock'
22161 d_pathconf='$d_pathconf'
22163 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22164 d_phostname='$d_phostname'
22167 d_portable='$d_portable'
22168 d_printf_format_null='$d_printf_format_null'
22169 d_procselfexe='$d_procselfexe'
22170 d_pseudofork='$d_pseudofork'
22171 d_pthread_atfork='$d_pthread_atfork'
22172 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22173 d_pthread_yield='$d_pthread_yield'
22175 d_pwchange='$d_pwchange'
22176 d_pwclass='$d_pwclass'
22177 d_pwcomment='$d_pwcomment'
22178 d_pwexpire='$d_pwexpire'
22179 d_pwgecos='$d_pwgecos'
22180 d_pwpasswd='$d_pwpasswd'
22181 d_pwquota='$d_pwquota'
22184 d_random_r='$d_random_r'
22185 d_readdir64_r='$d_readdir64_r'
22186 d_readdir='$d_readdir'
22187 d_readdir_r='$d_readdir_r'
22188 d_readlink='$d_readlink'
22190 d_recvmsg='$d_recvmsg'
22191 d_rename='$d_rename'
22192 d_rewinddir='$d_rewinddir'
22194 d_safebcpy='$d_safebcpy'
22195 d_safemcpy='$d_safemcpy'
22196 d_sanemcmp='$d_sanemcmp'
22197 d_sbrkproto='$d_sbrkproto'
22198 d_scalbnl='$d_scalbnl'
22199 d_sched_yield='$d_sched_yield'
22200 d_scm_rights='$d_scm_rights'
22201 d_seekdir='$d_seekdir'
22202 d_select='$d_select'
22204 d_semctl='$d_semctl'
22205 d_semctl_semid_ds='$d_semctl_semid_ds'
22206 d_semctl_semun='$d_semctl_semun'
22207 d_semget='$d_semget'
22209 d_sendmsg='$d_sendmsg'
22210 d_setegid='$d_setegid'
22211 d_seteuid='$d_seteuid'
22212 d_setgrent='$d_setgrent'
22213 d_setgrent_r='$d_setgrent_r'
22214 d_setgrps='$d_setgrps'
22215 d_sethent='$d_sethent'
22216 d_sethostent_r='$d_sethostent_r'
22217 d_setitimer='$d_setitimer'
22218 d_setlinebuf='$d_setlinebuf'
22219 d_setlocale='$d_setlocale'
22220 d_setlocale_r='$d_setlocale_r'
22221 d_setnent='$d_setnent'
22222 d_setnetent_r='$d_setnetent_r'
22223 d_setpent='$d_setpent'
22224 d_setpgid='$d_setpgid'
22225 d_setpgrp2='$d_setpgrp2'
22226 d_setpgrp='$d_setpgrp'
22227 d_setprior='$d_setprior'
22228 d_setproctitle='$d_setproctitle'
22229 d_setprotoent_r='$d_setprotoent_r'
22230 d_setpwent='$d_setpwent'
22231 d_setpwent_r='$d_setpwent_r'
22232 d_setregid='$d_setregid'
22233 d_setresgid='$d_setresgid'
22234 d_setresuid='$d_setresuid'
22235 d_setreuid='$d_setreuid'
22236 d_setrgid='$d_setrgid'
22237 d_setruid='$d_setruid'
22238 d_setsent='$d_setsent'
22239 d_setservent_r='$d_setservent_r'
22240 d_setsid='$d_setsid'
22241 d_setvbuf='$d_setvbuf'
22245 d_shmatprototype='$d_shmatprototype'
22246 d_shmctl='$d_shmctl'
22248 d_shmget='$d_shmget'
22249 d_sigaction='$d_sigaction'
22250 d_signbit='$d_signbit'
22251 d_sigprocmask='$d_sigprocmask'
22252 d_sigsetjmp='$d_sigsetjmp'
22253 d_sitearch='$d_sitearch'
22254 d_snprintf='$d_snprintf'
22255 d_sockatmark='$d_sockatmark'
22256 d_sockatmarkproto='$d_sockatmarkproto'
22257 d_socket='$d_socket'
22258 d_socklen_t='$d_socklen_t'
22259 d_sockpair='$d_sockpair'
22260 d_socks5_init='$d_socks5_init'
22261 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22263 d_srand48_r='$d_srand48_r'
22264 d_srandom_r='$d_srandom_r'
22265 d_sresgproto='$d_sresgproto'
22266 d_sresuproto='$d_sresuproto'
22267 d_statblks='$d_statblks'
22268 d_statfs_f_flags='$d_statfs_f_flags'
22269 d_statfs_s='$d_statfs_s'
22270 d_statvfs='$d_statvfs'
22271 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22272 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22273 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22274 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22275 d_stdio_stream_array='$d_stdio_stream_array'
22276 d_stdiobase='$d_stdiobase'
22277 d_stdstdio='$d_stdstdio'
22278 d_strchr='$d_strchr'
22279 d_strcoll='$d_strcoll'
22280 d_strctcpy='$d_strctcpy'
22281 d_strerrm='$d_strerrm'
22282 d_strerror='$d_strerror'
22283 d_strerror_r='$d_strerror_r'
22284 d_strftime='$d_strftime'
22285 d_strlcat='$d_strlcat'
22286 d_strlcpy='$d_strlcpy'
22287 d_strtod='$d_strtod'
22288 d_strtol='$d_strtol'
22289 d_strtold='$d_strtold'
22290 d_strtoll='$d_strtoll'
22291 d_strtoq='$d_strtoq'
22292 d_strtoul='$d_strtoul'
22293 d_strtoull='$d_strtoull'
22294 d_strtouq='$d_strtouq'
22295 d_strxfrm='$d_strxfrm'
22296 d_suidsafe='$d_suidsafe'
22297 d_symlink='$d_symlink'
22298 d_syscall='$d_syscall'
22299 d_syscallproto='$d_syscallproto'
22300 d_sysconf='$d_sysconf'
22301 d_sysernlst='$d_sysernlst'
22302 d_syserrlst='$d_syserrlst'
22303 d_system='$d_system'
22304 d_tcgetpgrp='$d_tcgetpgrp'
22305 d_tcsetpgrp='$d_tcsetpgrp'
22306 d_telldir='$d_telldir'
22307 d_telldirproto='$d_telldirproto'
22310 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22311 d_tm_tm_zone='$d_tm_tm_zone'
22312 d_tmpnam_r='$d_tmpnam_r'
22313 d_truncate='$d_truncate'
22314 d_ttyname_r='$d_ttyname_r'
22315 d_tzname='$d_tzname'
22316 d_u32align='$d_u32align'
22317 d_ualarm='$d_ualarm'
22320 d_union_semun='$d_union_semun'
22321 d_unordered='$d_unordered'
22322 d_unsetenv='$d_unsetenv'
22323 d_usleep='$d_usleep'
22324 d_usleepproto='$d_usleepproto'
22326 d_vendorarch='$d_vendorarch'
22327 d_vendorbin='$d_vendorbin'
22328 d_vendorlib='$d_vendorlib'
22329 d_vendorscript='$d_vendorscript'
22331 d_void_closedir='$d_void_closedir'
22332 d_voidsig='$d_voidsig'
22333 d_voidtty='$d_voidtty'
22334 d_volatile='$d_volatile'
22335 d_vprintf='$d_vprintf'
22336 d_vsnprintf='$d_vsnprintf'
22338 d_waitpid='$d_waitpid'
22339 d_wcstombs='$d_wcstombs'
22340 d_wctomb='$d_wctomb'
22341 d_writev='$d_writev'
22344 db_hashtype='$db_hashtype'
22345 db_prefixtype='$db_prefixtype'
22346 db_version_major='$db_version_major'
22347 db_version_minor='$db_version_minor'
22348 db_version_patch='$db_version_patch'
22349 defvoidused='$defvoidused'
22350 direntrytype='$direntrytype'
22353 doublesize='$doublesize'
22355 drand48_r_proto='$drand48_r_proto'
22357 dynamic_ext='$dynamic_ext'
22363 endgrent_r_proto='$endgrent_r_proto'
22364 endhostent_r_proto='$endhostent_r_proto'
22365 endnetent_r_proto='$endnetent_r_proto'
22366 endprotoent_r_proto='$endprotoent_r_proto'
22367 endpwent_r_proto='$endpwent_r_proto'
22368 endservent_r_proto='$endservent_r_proto'
22369 eunicefix='$eunicefix'
22372 extensions='$extensions'
22374 fflushNULL='$fflushNULL'
22375 fflushall='$fflushall'
22377 firstmakefile='$firstmakefile'
22379 fpossize='$fpossize'
22380 fpostype='$fpostype'
22381 freetype='$freetype'
22384 full_csh='$full_csh'
22385 full_sed='$full_sed'
22386 gccansipedantic='$gccansipedantic'
22387 gccosandvers='$gccosandvers'
22388 gccversion='$gccversion'
22389 getgrent_r_proto='$getgrent_r_proto'
22390 getgrgid_r_proto='$getgrgid_r_proto'
22391 getgrnam_r_proto='$getgrnam_r_proto'
22392 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22393 gethostbyname_r_proto='$gethostbyname_r_proto'
22394 gethostent_r_proto='$gethostent_r_proto'
22395 getlogin_r_proto='$getlogin_r_proto'
22396 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22397 getnetbyname_r_proto='$getnetbyname_r_proto'
22398 getnetent_r_proto='$getnetent_r_proto'
22399 getprotobyname_r_proto='$getprotobyname_r_proto'
22400 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22401 getprotoent_r_proto='$getprotoent_r_proto'
22402 getpwent_r_proto='$getpwent_r_proto'
22403 getpwnam_r_proto='$getpwnam_r_proto'
22404 getpwuid_r_proto='$getpwuid_r_proto'
22405 getservbyname_r_proto='$getservbyname_r_proto'
22406 getservbyport_r_proto='$getservbyport_r_proto'
22407 getservent_r_proto='$getservent_r_proto'
22408 getspnam_r_proto='$getspnam_r_proto'
22409 gidformat='$gidformat'
22415 gmtime_r_proto='$gmtime_r_proto'
22416 gnulibc_version='$gnulibc_version'
22418 groupcat='$groupcat'
22419 groupstype='$groupstype'
22422 h_sysfile='$h_sysfile'
22425 html1dir='$html1dir'
22426 html1direxp='$html1direxp'
22427 html3dir='$html3dir'
22428 html3direxp='$html3direxp'
22437 i_arpainet='$i_arpainet'
22438 i_assert='$i_assert'
22439 i_bsdioctl='$i_bsdioctl'
22443 i_dirent='$i_dirent'
22449 i_fp_class='$i_fp_class'
22451 i_gdbm_ndbm='$i_gdbm_ndbm'
22452 i_gdbmndbm='$i_gdbmndbm'
22454 i_ieeefp='$i_ieeefp'
22455 i_inttypes='$i_inttypes'
22456 i_langinfo='$i_langinfo'
22457 i_libutil='$i_libutil'
22458 i_limits='$i_limits'
22459 i_locale='$i_locale'
22460 i_machcthr='$i_machcthr'
22461 i_malloc='$i_malloc'
22462 i_mallocmalloc='$i_mallocmalloc'
22464 i_memory='$i_memory'
22465 i_mntent='$i_mntent'
22468 i_neterrno='$i_neterrno'
22469 i_netinettcp='$i_netinettcp'
22473 i_pthread='$i_pthread'
22475 i_rpcsvcdbm='$i_rpcsvcdbm'
22478 i_shadow='$i_shadow'
22480 i_stdarg='$i_stdarg'
22481 i_stddef='$i_stddef'
22482 i_stdlib='$i_stdlib'
22483 i_string='$i_string'
22484 i_sunmath='$i_sunmath'
22485 i_sysaccess='$i_sysaccess'
22486 i_sysdir='$i_sysdir'
22487 i_sysfile='$i_sysfile'
22488 i_sysfilio='$i_sysfilio'
22490 i_sysioctl='$i_sysioctl'
22491 i_syslog='$i_syslog'
22492 i_sysmman='$i_sysmman'
22493 i_sysmode='$i_sysmode'
22494 i_sysmount='$i_sysmount'
22495 i_sysndir='$i_sysndir'
22496 i_sysparam='$i_sysparam'
22497 i_syspoll='$i_syspoll'
22498 i_sysresrc='$i_sysresrc'
22499 i_syssecrt='$i_syssecrt'
22500 i_sysselct='$i_sysselct'
22501 i_syssockio='$i_syssockio'
22502 i_sysstat='$i_sysstat'
22503 i_sysstatfs='$i_sysstatfs'
22504 i_sysstatvfs='$i_sysstatvfs'
22505 i_systime='$i_systime'
22506 i_systimek='$i_systimek'
22507 i_systimes='$i_systimes'
22508 i_systypes='$i_systypes'
22509 i_sysuio='$i_sysuio'
22511 i_sysutsname='$i_sysutsname'
22512 i_sysvfs='$i_sysvfs'
22513 i_syswait='$i_syswait'
22514 i_termio='$i_termio'
22515 i_termios='$i_termios'
22517 i_unistd='$i_unistd'
22520 i_values='$i_values'
22521 i_varargs='$i_varargs'
22522 i_varhdr='$i_varhdr'
22524 ignore_versioned_solibs='$ignore_versioned_solibs'
22525 inc_version_list='$inc_version_list'
22526 inc_version_list_init='$inc_version_list_init'
22529 initialinstalllocation='$initialinstalllocation'
22530 installarchlib='$installarchlib'
22531 installbin='$installbin'
22532 installhtml1dir='$installhtml1dir'
22533 installhtml3dir='$installhtml3dir'
22534 installman1dir='$installman1dir'
22535 installman3dir='$installman3dir'
22536 installprefix='$installprefix'
22537 installprefixexp='$installprefixexp'
22538 installprivlib='$installprivlib'
22539 installscript='$installscript'
22540 installsitearch='$installsitearch'
22541 installsitebin='$installsitebin'
22542 installsitehtml1dir='$installsitehtml1dir'
22543 installsitehtml3dir='$installsitehtml3dir'
22544 installsitelib='$installsitelib'
22545 installsiteman1dir='$installsiteman1dir'
22546 installsiteman3dir='$installsiteman3dir'
22547 installsitescript='$installsitescript'
22548 installstyle='$installstyle'
22549 installusrbinperl='$installusrbinperl'
22550 installvendorarch='$installvendorarch'
22551 installvendorbin='$installvendorbin'
22552 installvendorhtml1dir='$installvendorhtml1dir'
22553 installvendorhtml3dir='$installvendorhtml3dir'
22554 installvendorlib='$installvendorlib'
22555 installvendorman1dir='$installvendorman1dir'
22556 installvendorman3dir='$installvendorman3dir'
22557 installvendorscript='$installvendorscript'
22559 issymlink='$issymlink'
22560 ivdformat='$ivdformat'
22563 known_extensions='$known_extensions'
22566 lddlflags='$lddlflags'
22568 ldflags_uselargefiles='$ldflags_uselargefiles'
22569 ldlibpthname='$ldlibpthname'
22576 libsdirs='$libsdirs'
22577 libsfiles='$libsfiles'
22578 libsfound='$libsfound'
22579 libspath='$libspath'
22580 libswanted='$libswanted'
22581 libswanted_uselargefiles='$libswanted_uselargefiles'
22587 localtime_r_proto='$localtime_r_proto'
22588 locincpth='$locincpth'
22589 loclibpth='$loclibpth'
22590 longdblsize='$longdblsize'
22591 longlongsize='$longlongsize'
22592 longsize='$longsize'
22596 lseeksize='$lseeksize'
22597 lseektype='$lseektype'
22600 madlyobj='$madlyobj'
22601 madlysrc='$madlysrc'
22605 make_set_make='$make_set_make'
22606 mallocobj='$mallocobj'
22607 mallocsrc='$mallocsrc'
22608 malloctype='$malloctype'
22610 man1direxp='$man1direxp'
22613 man3direxp='$man3direxp'
22615 mips_type='$mips_type'
22616 mistrustnm='$mistrustnm'
22618 mmaptype='$mmaptype'
22619 modetype='$modetype'
22621 multiarch='$multiarch'
22623 myarchname='$myarchname'
22624 mydomain='$mydomain'
22625 myhostname='$myhostname'
22628 need_va_copy='$need_va_copy'
22629 netdb_hlen_type='$netdb_hlen_type'
22630 netdb_host_type='$netdb_host_type'
22631 netdb_name_type='$netdb_name_type'
22632 netdb_net_type='$netdb_net_type'
22635 nm_so_opt='$nm_so_opt'
22636 nonxs_ext='$nonxs_ext'
22638 nvEUformat='$nvEUformat'
22639 nvFUformat='$nvFUformat'
22640 nvGUformat='$nvGUformat'
22641 nv_overflows_integers_at='$nv_overflows_integers_at'
22642 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22643 nveformat='$nveformat'
22644 nvfformat='$nvfformat'
22645 nvgformat='$nvgformat'
22648 o_nonblock='$o_nonblock'
22650 old_pthread_create_joinable='$old_pthread_create_joinable'
22651 optimize='$optimize'
22652 orderlib='$orderlib'
22655 otherlibdirs='$otherlibdirs'
22659 patchlevel='$patchlevel'
22660 path_sep='$path_sep'
22663 perl_patchlevel='$perl_patchlevel'
22664 perladmin='$perladmin'
22665 perllibs='$perllibs'
22666 perlpath='$perlpath'
22668 phostname='$phostname'
22674 prefixexp='$prefixexp'
22676 privlibexp='$privlibexp'
22677 procselfexe='$procselfexe'
22678 prototype='$prototype'
22680 quadkind='$quadkind'
22681 quadtype='$quadtype'
22682 randbits='$randbits'
22683 randfunc='$randfunc'
22684 random_r_proto='$random_r_proto'
22685 randseedtype='$randseedtype'
22687 rd_nodata='$rd_nodata'
22688 readdir64_r_proto='$readdir64_r_proto'
22689 readdir_r_proto='$readdir_r_proto'
22690 revision='$revision'
22696 sGMTIME_max='$sGMTIME_max'
22697 sGMTIME_min='$sGMTIME_min'
22698 sPRIEUldbl='$sPRIEUldbl'
22699 sPRIFUldbl='$sPRIFUldbl'
22700 sPRIGUldbl='$sPRIGUldbl'
22701 sPRIXU64='$sPRIXU64'
22703 sPRIeldbl='$sPRIeldbl'
22704 sPRIfldbl='$sPRIfldbl'
22705 sPRIgldbl='$sPRIgldbl'
22710 sSCNfldbl='$sSCNfldbl'
22711 sched_yield='$sched_yield'
22712 scriptdir='$scriptdir'
22713 scriptdirexp='$scriptdirexp'
22715 seedfunc='$seedfunc'
22716 selectminbits='$selectminbits'
22717 selecttype='$selecttype'
22718 sendmail='$sendmail'
22719 setgrent_r_proto='$setgrent_r_proto'
22720 sethostent_r_proto='$sethostent_r_proto'
22721 setlocale_r_proto='$setlocale_r_proto'
22722 setnetent_r_proto='$setnetent_r_proto'
22723 setprotoent_r_proto='$setprotoent_r_proto'
22724 setpwent_r_proto='$setpwent_r_proto'
22725 setservent_r_proto='$setservent_r_proto'
22728 sharpbang='$sharpbang'
22729 shmattype='$shmattype'
22730 shortsize='$shortsize'
22733 sig_count='$sig_count'
22734 sig_name='$sig_name'
22735 sig_name_init='$sig_name_init'
22737 sig_num_init='$sig_num_init'
22738 sig_size='$sig_size'
22739 signal_t='$signal_t'
22740 sitearch='$sitearch'
22741 sitearchexp='$sitearchexp'
22743 sitebinexp='$sitebinexp'
22744 sitehtml1dir='$sitehtml1dir'
22745 sitehtml1direxp='$sitehtml1direxp'
22746 sitehtml3dir='$sitehtml3dir'
22747 sitehtml3direxp='$sitehtml3direxp'
22749 sitelib_stem='$sitelib_stem'
22750 sitelibexp='$sitelibexp'
22751 siteman1dir='$siteman1dir'
22752 siteman1direxp='$siteman1direxp'
22753 siteman3dir='$siteman3dir'
22754 siteman3direxp='$siteman3direxp'
22755 siteprefix='$siteprefix'
22756 siteprefixexp='$siteprefixexp'
22757 sitescript='$sitescript'
22758 sitescriptexp='$sitescriptexp'
22759 sizesize='$sizesize'
22760 sizetype='$sizetype'
22764 sockethdr='$sockethdr'
22765 socketlib='$socketlib'
22766 socksizetype='$socksizetype'
22768 spackage='$spackage'
22769 spitshell='$spitshell'
22770 srand48_r_proto='$srand48_r_proto'
22771 srandom_r_proto='$srandom_r_proto'
22773 ssizetype='$ssizetype'
22774 startperl='$startperl'
22776 static_ext='$static_ext'
22778 stdio_base='$stdio_base'
22779 stdio_bufsiz='$stdio_bufsiz'
22780 stdio_cnt='$stdio_cnt'
22781 stdio_filbuf='$stdio_filbuf'
22782 stdio_ptr='$stdio_ptr'
22783 stdio_stream_array='$stdio_stream_array'
22784 strerror_r_proto='$strerror_r_proto'
22787 subversion='$subversion'
22791 targetarch='$targetarch'
22795 timeincl='$timeincl'
22796 timetype='$timetype'
22797 tmpnam_r_proto='$tmpnam_r_proto'
22803 ttyname_r_proto='$ttyname_r_proto'
22812 uidformat='$uidformat'
22818 uquadtype='$uquadtype'
22819 use5005threads='$use5005threads'
22820 use64bitall='$use64bitall'
22821 use64bitint='$use64bitint'
22822 usecrosscompile='$usecrosscompile'
22824 usedtrace='$usedtrace'
22825 usefaststdio='$usefaststdio'
22826 useithreads='$useithreads'
22827 uselargefiles='$uselargefiles'
22828 uselongdouble='$uselongdouble'
22829 usemallocwrap='$usemallocwrap'
22830 usemorebits='$usemorebits'
22831 usemultiplicity='$usemultiplicity'
22832 usemymalloc='$usemymalloc'
22834 useopcode='$useopcode'
22835 useperlio='$useperlio'
22836 useposix='$useposix'
22837 usereentrant='$usereentrant'
22838 userelocatableinc='$userelocatableinc'
22840 useshrplib='$useshrplib'
22841 usesitecustomize='$usesitecustomize'
22842 usesocks='$usesocks'
22843 usethreads='$usethreads'
22844 usevendorprefix='$usevendorprefix'
22845 usevfork='$usevfork'
22848 uvXUformat='$uvXUformat'
22849 uvoformat='$uvoformat'
22852 uvuformat='$uvuformat'
22853 uvxformat='$uvxformat'
22854 vendorarch='$vendorarch'
22855 vendorarchexp='$vendorarchexp'
22856 vendorbin='$vendorbin'
22857 vendorbinexp='$vendorbinexp'
22858 vendorhtml1dir='$vendorhtml1dir'
22859 vendorhtml1direxp='$vendorhtml1direxp'
22860 vendorhtml3dir='$vendorhtml3dir'
22861 vendorhtml3direxp='$vendorhtml3direxp'
22862 vendorlib='$vendorlib'
22863 vendorlib_stem='$vendorlib_stem'
22864 vendorlibexp='$vendorlibexp'
22865 vendorman1dir='$vendorman1dir'
22866 vendorman1direxp='$vendorman1direxp'
22867 vendorman3dir='$vendorman3dir'
22868 vendorman3direxp='$vendorman3direxp'
22869 vendorprefix='$vendorprefix'
22870 vendorprefixexp='$vendorprefixexp'
22871 vendorscript='$vendorscript'
22872 vendorscriptexp='$vendorscriptexp'
22874 version_patchlevel_string='$version_patchlevel_string'
22875 versiononly='$versiononly'
22877 voidflags='$voidflags'
22880 yaccflags='$yaccflags'
22885 : Add in command line options if available
22886 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22888 : add special variables
22889 $test -f $src/patchlevel.h && \
22890 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22891 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22892 echo "PERL_CONFIG_SH=true" >>config.sh
22894 : propagate old symbols
22895 if $test -f UU/config.sh; then
22896 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22897 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
22898 config.sh config.sh UU/oldconfig.sh |\
22899 $sort | $uniq -u >UU/oldsyms
22900 set X `cat UU/oldsyms`
22906 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22908 echo ": Variables propagated from previous config.sh file." >>config.sh
22909 for sym in `cat UU/oldsyms`; do
22910 echo " Propagating $hint variable "'$'"$sym..."
22911 eval 'tmp="$'"${sym}"'"'
22913 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22919 : Finish up by extracting the .SH files
22923 echo "Extraction done."
22933 If you'd like to make any changes to the config.sh file before I begin
22934 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22937 rp="Press return or use a shell escape to edit config.sh:"
22942 *) : in case they cannot read
22943 sh 1>&4 -c "$ans";;
22948 : if this fails, just run all the .SH files by hand
22957 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22964 Now you need to generate make dependencies by running "$make depend".
22965 You might prefer to run it in background: "$make depend > makedepend.out &"
22966 It can take a while, so you might not want to run it right now.
22971 rp="Run $make depend now?"
22975 $make depend && echo "Now you must run '$make'."
22978 echo "You must run '$make depend' then '$make'."
22981 elif test -f [Mm]akefile; then
22983 echo "Now you must run a $make."
22985 echo "Configure done."
22988 if $test -f Policy.sh; then
22991 If you compile $package on a different machine or from a different object
22992 directory, copy the Policy.sh file from this object directory to the
22993 new one before you run Configure -- this will help you with most of
22994 the policy defaults.
22998 if $test -f config.msg; then
22999 echo "Hmm. I also noted the following information while running:"
23001 $cat config.msg >&4
23004 $rm -f kit*isdone ark*isdone