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 Sat Oct 18 17:13:43 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=''
957 d_inc_version_list=''
959 inc_version_list_init=''
978 ignore_versioned_solibs=''
1042 d_perl_otherlibdirs=''
1050 api_versionstring=''
1056 version_patchlevel_string=''
1060 d_nv_preserves_uv=''
1061 d_nv_zero_is_allbits_zero=''
1072 nv_overflows_integers_at=''
1073 nv_preserves_uv_bits=''
1145 installsitehtml1dir=''
1148 installsitehtml3dir=''
1155 installsiteman1dir=''
1158 installsiteman3dir=''
1163 installsitescript=''
1178 d_stdio_stream_array=''
1179 stdio_stream_array=''
1196 ccflags_uselargefiles=''
1197 ldflags_uselargefiles=''
1198 libswanted_uselargefiles=''
1218 installvendorarch=''
1225 installvendorhtml1dir=''
1227 vendorhtml1direxp=''
1228 installvendorhtml3dir=''
1230 vendorhtml3direxp=''
1236 installvendorman1dir=''
1239 installvendorman3dir=''
1246 installvendorscript=''
1259 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1262 : We must find out about Eunice early
1264 if test -f /etc/unixtovms; then
1265 eunicefix=/etc/unixtovms
1267 if test -f /etc/unixtovms.exe; then
1268 eunicefix=/etc/unixtovms.exe
1271 : Set executable suffix now -- needed before hints available
1272 if test -f "/libs/version.library"; then
1275 elif test -f "/system/gnu_library/bin/ar.pm"; then
1278 elif test -n "$DJGPP"; then
1281 elif test -d c:/. -o -n "$is_os2" ; then
1288 : Trailing extension. Override this in a hint file, if needed.
1289 : Extra object files, if any, needed on this platform.
1293 : change the next line if compiling for Xenix/286 on Xenix/386
1294 xlibpth='/usr/lib/386 /lib/386'
1295 : Possible local library directories to search.
1296 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1297 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1299 : general looking path for locating libraries
1300 glibpth="/lib /usr/lib $xlibpth"
1301 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1302 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1303 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1304 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1306 : Private path used by Configure to find libraries. Its value
1307 : is prepended to libpth. This variable takes care of special
1308 : machines, like the mips. Usually, it should be empty.
1311 : default library list
1313 : some systems want to use only the non-versioned libso:s
1314 ignore_versioned_solibs=''
1315 : set usethreads on the Configure command line to enable threads.
1316 usereentrant='undef'
1317 : full support for void wanted by default
1320 : Possible local include directories to search.
1321 : Set locincpth to "" in a hint file to defeat local include searches.
1322 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1323 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1325 : no include file wanted by default
1328 : Enable -DEBUGGING and -DDEBUGGING from the command line
1335 : set useposix=false in your hint file to disable the POSIX extension.
1337 : set useopcode=false in your hint file to disable the Opcode extension.
1340 ccflags_uselargefiles=''
1341 ldflags_uselargefiles=''
1342 libswanted_uselargefiles=''
1343 : set usemultiplicity on the Configure command line to enable multiplicity.
1344 : set usesocks on the Configure command line to enable socks.
1345 : List of libraries we want.
1346 : If anyone needs extra -lxxx, put those in a hint file.
1347 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1348 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1349 : We probably want to search /usr/shlib before most other libraries.
1350 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1351 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1352 glibpth="/usr/shlib $glibpth"
1353 : Do not use vfork unless overridden by a hint file.
1356 : Find the basic shell for Bourne shell scripts
1360 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1363 if test -f "$xxx"; then
1366 : Build up a list and do a single loop so we can 'break' out.
1367 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1368 for xxx in sh bash ksh pdksh ash; do
1370 try="$try ${p}/${xxx}"
1374 if test -f "$xxx"; then
1377 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1380 elif test -f "$xxx.exe"; then
1391 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1393 Usually it's in /bin/sh. How did you even get this far?
1394 Please contact me (Perl Maintainers) at perlbug@perl.org and
1395 we'll try to straighten this all out.
1401 : see if sh knows # comments
1402 if `$sh -c '#' >/dev/null 2>&1`; then
1406 test -f $xcat$_exe || xcat=/usr/bin/cat
1407 if test ! -f $xcat$_exe; then
1408 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1409 if test -f $p/cat$_exe; then
1414 if test ! -f $xcat$_exe; then
1415 echo "Can't find cat anywhere!"
1419 echo "#!$xcat" >sharp
1422 ./sharp > today 2>/dev/null
1423 if test -s today; then
1426 echo "#! $xcat" > sharp
1429 ./sharp > today 2>/dev/null
1430 if test -s today; then
1438 echo "Your $sh doesn't grok # comments--I will strip them later on."
1441 echo "exec grep -v '^[ ]*#'" >spitshell
1443 $eunicefix spitshell
1444 spitshell=`pwd`/spitshell
1446 echo "I presume that if # doesn't work, #! won't work either!"
1451 : figure out how to guarantee sh startup
1453 '') startsh=${sharpbang}${sh} ;;
1465 : echo "Yup, it does."
1467 echo "Hmm... '$startsh' does not guarantee sh startup..."
1468 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1472 : Save command line options in file UU/cmdline.opt for later use in
1473 : generating config.sh.
1474 cat > cmdline.opt <<EOSH
1475 : Configure command line arguments.
1484 cat >>cmdline.opt <<EOSH
1485 config_arg$argn='$arg'
1487 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1490 arg_exp=`cat cmdl.opt`
1491 args_exp="$args_exp$args_sep'$arg_exp'"
1492 argn=`expr $argn + 1`
1497 : produce awk script to parse command line options
1498 cat >options.awk <<'EOF'
1500 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1502 len = length(optstr);
1503 for (i = 1; i <= len; i++) {
1504 c = substr(optstr, i, 1);
1505 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1516 if (substr(str, 1, 1) != "-") {
1517 printf("'%s'\n", str);
1521 for (i = 2; i <= len; i++) {
1522 c = substr(str, i, 1);
1524 printf("-%s\n", substr(str, i));
1530 printf("'%s'\n", substr(str, i + 1));
1543 : process the command line options
1544 set X `for arg in "$@"; do echo "X$arg"; done |
1545 sed -e s/X// | awk -f options.awk`
1550 : set up default values
1560 rm -f optdef.sh posthint.sh
1561 cat >optdef.sh <<EOS
1567 while test $# -gt 0; do
1569 -d) shift; fastread=yes;;
1570 -e) shift; alldone=cont;;
1574 if test -r "$1"; then
1577 echo "$me: cannot read config file $1." >&2
1583 -h) shift; error=true;;
1584 -r) shift; reuseval=true;;
1585 -s) shift; silent=true; realsilent=true;;
1586 -E) shift; alldone=exit;;
1587 -K) shift; knowitall=true;;
1588 -O) shift; override=true;;
1589 -S) shift; silent=true; extractsh=true;;
1594 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1595 echo "$me: ignoring -D $1" >&2
1598 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1599 *) echo "$1='define'" >> optdef.sh;;
1606 *=) echo "$1" >> optdef.sh;;
1608 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1609 echo "$me: ignoring -U $1" >&2
1611 *) echo "$1='undef'" >> optdef.sh;;
1622 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1626 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1627 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1633 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1634 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1635 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1636 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1637 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1638 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1644 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1646 echo "$yyy=''" >> posthint.sh ;;
1651 echo "$yyy='$zzz'" >> posthint.sh ;;
1653 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1655 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1660 echo "$yyy=$zzz" >> posthint.sh ;;
1661 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1665 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1668 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1676 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1677 [-U symbol] [-U symbol=] [-A command:symbol...]
1678 -d : use defaults for all answers.
1679 -e : go on without questioning past the production of config.sh.
1680 -f : specify an alternate default configuration file.
1681 -h : print this help message and exit (with an error status).
1682 -r : reuse C symbols value if possible (skips costly nm extraction).
1683 -s : silent mode, only echoes questions and essential information.
1684 -D : define symbol to have some value:
1685 -D symbol symbol gets the value 'define'
1686 -D symbol=value symbol gets the value 'value'
1687 common used examples (see INSTALL for more info):
1688 -Duse64bitint use 64bit integers
1689 -Duse64bitall use 64bit integers and pointers
1690 -Dusethreads use thread support
1691 -Dinc_version_list=none do not include older perl trees in @INC
1692 -DEBUGGING=none DEBUGGING options
1693 -Dcc=gcc choose your compiler
1694 -Dprefix=/opt/perl5 choose your destination
1695 -E : stop at the end of questions, after having produced config.sh.
1696 -K : do not use unless you know what you are doing.
1697 -O : let -D and -U override definitions from loaded configuration file.
1698 -S : perform variable substitutions on all .SH files (can mix with -f)
1699 -U : undefine symbol:
1700 -U symbol symbol gets the value 'undef'
1701 -U symbol= symbol gets completely empty
1703 -A : manipulate symbol after the platform specific hints have been applied:
1704 -A append:symbol=value append value to symbol
1705 -A symbol=value like append:, but with a separating space
1706 -A define:symbol=value define symbol to have value
1707 -A clear:symbol define symbol to be ''
1708 -A define:symbol define symbol to be 'define'
1709 -A eval:symbol=value define symbol to be eval of value
1710 -A prepend:symbol=value prepend value to symbol
1711 -A undef:symbol define symbol to be 'undef'
1712 -A undef:symbol= define symbol to be ''
1713 e.g.: -A prepend:libswanted='cl pthread '
1714 -A ccflags=-DSOME_MACRO
1715 -V : print version number and exit (with a zero status).
1722 case "$fastread$alldone" in
1725 case "$extractsh" in
1728 if test ! -t 0; then
1729 echo "Say 'sh Configure', not 'sh <Configure'"
1739 true) exec 1>/dev/null;;
1742 : run the defines and the undefines, if any, but leave the file out there...
1745 : create the posthint manipulation script and leave the file out there...
1750 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1751 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1752 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1753 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1754 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1757 : Some greps do not return status, grrr.
1758 echo "grimblepritz" >grimble
1759 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1761 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1767 : the following should work in any shell
1771 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1772 cat >contains <<'EOSS'
1773 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1778 : Find the path to the source tree
1781 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1785 *) src=`cd ../$src && pwd` ;;
1798 if test -f $rsrc/Configure && \
1799 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1801 : found it, so we are ok.
1804 for src in . .. ../.. ../../.. ../../../..; do
1805 if test -f ../$src/Configure && \
1806 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1817 Sorry, I can't seem to locate the source dir for $package. Please start
1818 Configure with an explicit path -- i.e. /some/path/Configure.
1826 echo "Sources for $package found in \"$src\"." >&4
1830 : script used to extract .SH files with variable substitutions
1831 cat >extract <<'EOS'
1833 echo "Doing variable substitutions on .SH files..."
1834 if test -f MANIFEST; then
1835 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1837 echo "(Looking for .SH files under the source directory.)"
1838 set x `(cd "$src"; find . -name "*.SH" -print)`
1842 0) set x `(cd "$src"; echo *.SH)`; shift;;
1844 if test ! -f "$src/$1"; then
1850 while test $name; do
1851 if test ! -d "$name"; then
1852 create="$name $create";
1853 name=`echo $name | sed -e "s|^[^/]*$||"`;
1854 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1859 for file in $create; do
1868 dir=`expr X$file : 'X\(.*\)/'`
1869 file=`expr X$file : 'X.*/\(.*\)'`
1870 (cd "$dir" && . ./$file)
1880 dir=`expr X$file : 'X\(.*\)/'`
1881 file=`expr X$file : 'X.*/\(.*\)'`
1882 (set x $dir; shift; eval $mkdir_p)
1883 sh <"$src/$dir/$file"
1892 if test -f "$src/config_h.SH"; then
1893 if test ! -f config.h; then
1894 : oops, they left it out of MANIFEST, probably, so do it anyway.
1895 . "$src/config_h.SH"
1900 : extract files and exit if asked to do so
1901 case "$extractsh" in
1903 case "$realsilent" in
1907 case "$config_sh" in
1908 '') config_sh='config.sh';;
1911 echo "Fetching answers from $config_sh..."
1914 test "$override" && . ./optdef.sh
1918 echo "Extraction done."
1923 : Eunice requires " " instead of "", can you believe it
1926 echo "Beginning of configuration questions for $package."
1928 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1930 : first determine how to suppress newline on echo command
1932 echo "Checking echo to see how to suppress newlines..."
1933 (echo "hi there\c" ; echo " ") >.echotmp
1934 if $contains c .echotmp >/dev/null 2>&1 ; then
1945 echo $n "The star should be here-->$c"
1949 : Now test for existence of everything in MANIFEST
1951 if test -f "$rsrc/MANIFEST"; then
1952 echo "First let's make sure your kit is complete. Checking..." >&4
1953 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1954 (split -l 50 2>/dev/null || split -50)
1957 for filelist in x??; do
1958 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1959 >/dev/null 2>>"$tmppwd/missing")
1961 if test -s missing; then
1965 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1967 You have the option of continuing the configuration process, despite the
1968 distinct possibility that your kit is damaged, by typing 'y'es. If you
1969 do, don't blame me if something goes wrong. I advise you to type 'n'o
1970 and contact the author (perlbug@perl.org).
1973 echo $n "Continue? [n] $c" >&4
1977 echo "Continuing..." >&4
1981 echo "ABORTING..." >&4
1986 echo "Looks good..."
1989 echo "There is no MANIFEST file. I hope your kit is complete !"
1993 : Find the appropriate value for a newline for tr
1995 if test -n "$DJGPP"; then
1998 if test X"$trnl" = X; then
1999 case "`echo foo|tr '\n' x 2>/dev/null`" in
2003 if test X"$trnl" = X; then
2004 case "`echo foo|tr '\012' x 2>/dev/null`" in
2005 foox) trnl='\012' ;;
2008 if test X"$trnl" = X; then
2009 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2010 fooxy) trnl='\n\r' ;;
2013 if test X"$trnl" = X; then
2016 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2022 : compute the number of columns on the terminal for proper question formatting
2027 : set up the echo used in my read
2028 myecho="case \"\$xxxm\" in
2029 '') echo $n \"\$rp $c\" >&4;;
2031 '') echo $n \"[\$xxxm] $c\";;
2033 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2035 echo $n \"[\$xxxm] $c\" >&4
2037 echo $n \"\$rp [\$xxxm] $c\" >&4
2043 : now set up to do reads with possible shell escape and default assignment
2049 case "\$fastread" in
2050 yes) case "\$dflt" in
2053 case "\$silent-\$rp" in
2058 *) case "\$silent" in
2059 true) case "\$rp" in
2064 while expr "X\$ans" : "X!" >/dev/null; do
2068 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2076 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2085 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2090 echo "(OK, I'll run with -d after this question.)" >&4
2093 echo "*** Sorry, \$1 not supported yet." >&4
2103 echo "*** Substitution done -- please confirm."
2105 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2110 echo "*** Error -- try again."
2117 case "\$ans\$xxxm\$nostick" in
2129 : create .config dir to save info across Configure sessions
2130 test -d ../.config || mkdir ../.config
2131 cat >../.config/README <<EOF
2132 This directory created by Configure to save information that should
2133 persist across sessions for $package.
2135 You may safely delete it if you wish.
2138 : See if we are using a devel version and want that
2139 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2141 $define|true|[yY]*) ;;
2142 *) case "$xversion" in
2145 *** WHOA THERE!!! ***
2147 This is an UNSTABLE DEVELOPMENT release.
2148 The version of this $package distribution is $xversion, that is, odd,
2149 (as opposed to even) and that signifies a development release.
2150 If you want a maintenance release, you want an even-numbered version.
2152 Do ***NOT*** install this into production use.
2153 Data corruption and crashes are possible.
2155 It is most seriously suggested that you do not continue any further
2156 unless you want to help in developing and debugging Perl.
2158 If you *still* want to build perl, you can answer 'y' now,
2159 or pass -Dusedevel to Configure.
2162 rp='Do you really want to continue?'
2166 [yY]) echo >&4 "Okay, continuing."
2167 usedevel="$define" ;;
2168 *) echo >&4 "Okay, bye."
2178 case "$versiononly" in
2179 '') versiononly="$define" ;;
2181 case "$installusrbinperl" in
2182 '') installusrbinperl="$undef" ;;
2187 : general instructions
2190 user=`(logname) 2>/dev/null`
2192 '') user=`whoami 2>&1`;;
2194 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2197 rp='Would you like to see the instructions?'
2208 This installation shell script will examine your system and ask you questions
2209 to determine how the perl5 package should be installed. If you get
2210 stuck on a question, you may use a ! shell escape to start a subshell or
2211 execute a command. Many of the questions will have default answers in square
2212 brackets; typing carriage return will give you the default.
2214 On some of the questions which ask for file or directory names you are allowed
2215 to use the ~name construct to specify the login directory belonging to "name",
2216 even if you don't have a shell which knows about that. Questions where this is
2217 allowed will be marked "(~name ok)".
2221 dflt='Type carriage return to continue'
2225 The prompter used in this script allows you to use shell variables and
2226 backticks in your answers. You may use $1, $2, etc... to refer to the words
2227 in the default answer, as if the default line was a set of arguments given to a
2228 script shell. This means you may also use $* to repeat the whole default line,
2229 so you do not have to re-type everything to add something to the default.
2231 Everytime there is a substitution, you will have to confirm. If there is an
2232 error (e.g. an unmatched backtick), the default answer will remain unchanged
2233 and you will be prompted again.
2235 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2236 the questions and use the computed defaults (or the previous answers if there
2237 was already a config.sh file). Type 'Configure -h' for a list of options.
2238 You may also start interactively and then answer '& -d' at any prompt to turn
2239 on the non-interactive behaviour for the remainder of the execution.
2245 Much effort has been expended to ensure that this shell script will run on any
2246 Unix system. If despite that it blows up on yours, your best bet is to edit
2247 Configure and run it again. If you can't run Configure for some reason,
2248 you'll have to generate a config.sh file by hand. Whatever problems you
2249 have, let me (perlbug@perl.org) know how I blew it.
2251 This installation script affects things in two ways:
2253 1) it may do direct variable substitutions on some of the files included
2255 2) it builds a config.h file for inclusion in C programs. You may edit
2256 any of these files as the need arises after running this script.
2258 If you make a mistake on a question, there is no easy way to back up to it
2259 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2260 files. Configure will offer to let you do this before it runs the SH files.
2263 dflt='Type carriage return to continue'
2265 case "$firsttime" in
2266 true) echo $user >>../.config/instruct;;
2270 : find out where common programs are
2272 echo "Locating common programs..." >&4
2285 if test -d \$dir/\$thing; then
2291 for thisthing in \$dir/\$thing; do
2292 : just loop through to pick last item
2294 if test -f \$thisthing; then
2297 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2300 elif test -f \$dir/\$thing.exe; then
2301 if test -n "$DJGPP"; then
2302 echo \$dir/\$thing.exe
2303 elif test "$eunicefix" != ":"; then
2304 : on Eunice apparently
2356 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2357 pth="$pth /lib /usr/lib"
2358 for file in $loclist; do
2362 if test -f "$xxx"; then
2365 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2366 xxx=`./loc $file $file $pth`
2369 '') xxx=`./loc $file $file $pth`;;
2370 *) xxx=`./loc $xxx $xxx $pth`;;
2372 eval $file=$xxx$_exe
2376 echo $file is in $xxx.
2379 echo $file is in $xxx.
2382 echo "I don't know where '$file' is, and my life depends on it." >&4
2383 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2389 echo "Don't worry if any of the following aren't found..."
2391 for file in $trylist; do
2395 if test -f "$xxx"; then
2398 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2399 xxx=`./loc $file $file $pth`
2402 '') xxx=`./loc $file $file $pth`;;
2403 *) xxx=`./loc $xxx $xxx $pth`;;
2405 eval $file=$xxx$_exe
2409 echo $file is in $xxx.
2412 echo $file is in $xxx.
2415 echo "I don't see $file out there, $say."
2422 echo "Substituting grep for egrep."
2429 echo "Substituting cp for ln."
2438 echo "I can't find make or gmake, and my life depends on it." >&4
2439 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2447 *) # We can't have osname yet.
2448 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2449 # Assume that gmake, if found, is definitely GNU make
2450 # and prefer it over the system make.
2451 echo "Substituting gmake for make."
2459 echo "Hopefully test is built into your sh."
2462 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2463 echo "Using the test built into your sh."
2471 echo "Hopefully echo is built into your sh."
2476 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2477 $echo $n "hi there$c" >foo1
2478 echo $n "hi there$c" >foo2
2479 if cmp foo1 foo2 >/dev/null 2>&1; then
2480 echo "They are compatible. In fact, they may be identical."
2487 They are not compatible! You are probably running ksh on a non-USG system.
2488 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2489 have echo built in and we may have to run some Bourne shell scripts. That
2490 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2493 $echo $n "The star should be here-->$c"
2500 # This question was auctioned at YAPC::Europe-2007 in Vienna
2501 # I never promised you could answer it. I only auctioned the question.
2503 The following message is sponsored by
2505 Dresden.pm<--The stars should be here.
2507 Dear Perl user, system administrator or package
2508 maintainer, the Perl community sends greetings to
2509 you. Do you (emblematical) greet back [Y/n]? n
2513 : Check what type of C compiler we use
2517 cat <<'EOSC' >>trygcc
2522 int main(int argc, char *argv[]) {
2526 if $cc -o try $ccflags $ldflags try.c; then
2529 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2535 # Skip this test because it gives a false match on output like:
2536 # ./trygcc: line 23: cc: command not found
2537 # case "`$cc -v -c try.c 2>&1`" in
2538 # *gcc*) trygcc=no ;;
2540 if $test X"$trygcc" = Xyes; then
2541 if gcc -o try -c try.c; then
2543 echo "You seem to have a working gcc, though." >&4
2544 # Switching compilers may undo the work of hints files.
2545 # The most common problem is -D_REENTRANT for threads.
2546 # This heuristic catches that case, but gets false positives
2547 # if -Dusethreads was not actually specified. Better to
2548 # bail out here with a useful message than fail
2549 # mysteriously later. Should we perhaps just try to
2550 # re-invoke Configure -Dcc=gcc config_args ?
2551 if $test -f usethreads.cbu; then
2554 *** However, any setting of the C compiler flags (e.g. for thread support)
2555 *** will be lost. It may be necessary for you to restart Configure and
2556 *** add -Dcc=gcc to your Configure command line.
2559 rp="Would you like to go ahead and try gcc anyway?"
2562 rp="Would you like to use it?"
2565 if $test -f myread; then
2568 if $test -f UU/myread; then
2571 echo "Cannot find myread, sorry. Aborting." >&2
2576 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2589 cat <<'EOSC' >>checkcc
2594 int main(int argc, char *argv[]) {
2598 if $cc -o try $ccflags $ldflags try.c; then
2601 if $test X"$despair" = Xyes; then
2602 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2605 You need to find a working C compiler.
2606 Either (purchase and) install the C compiler supplied by your OS vendor,
2607 or for a free C compiler try http://gcc.gnu.org/
2608 I cannot continue any further, aborting.
2617 : determine whether symbolic links are supported
2620 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2621 echo "Symbolic links are supported." >&4
2624 echo "Symbolic links are NOT supported." >&4
2629 : determine whether symbolic links are supported
2633 echo "Checking how to test for symbolic links..." >&4
2635 if $test "X$issymlink" = X; then
2637 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2638 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2640 if test $? = 0; then
2643 echo "Your builtin 'test -h' may be broken." >&4
2646 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2649 if test -f "$p/$test"; then
2658 echo "Trying external '$test -h'." >&4
2659 issymlink="$test -h"
2660 if $test ! -h sym >/dev/null 2>&1; then
2661 echo "External '$test -h' is broken, too." >&4
2669 if $test "X$issymlink" = X; then
2670 if $test -L sym 2>/dev/null; then
2671 issymlink="$test -L"
2672 echo "The builtin '$test -L' worked." >&4
2675 if $test "X$issymlink" != X; then
2676 echo "You can test for symbolic links with '$issymlink'." >&4
2678 echo "I do not know how you can test for symbolic links." >&4
2682 *) echo "No symbolic links, so not testing for their testing..." >&4
2687 : Make symlinks util
2688 case "$mksymlinks" in
2691 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2694 *) case "$lns:$issymlink" in
2695 *"ln"*" -s:"*"test -"?)
2696 echo "Creating the symbolic links..." >&4
2697 echo "(First creating the subdirectories...)" >&4
2699 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2701 test -z "$directory" && break
2705 if test ! -d t/base; then
2706 echo "Failed to create the subdirectories. Aborting." >&4
2709 echo "(Then creating the symlinks...)" >&4
2710 awk '{print $1}' $src/MANIFEST | while true; do
2712 test -z "$filename" && break
2713 if test -f $filename; then
2714 if $issymlink $filename; then
2718 if test -f $filename; then
2719 echo "$filename already exists, not symlinking."
2721 ln -s $src/$filename $filename
2725 if test ! -f t/base/lex.t; then
2726 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2731 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2739 : Check for Cross-Compilation
2740 case "$usecrosscompile" in
2742 $echo "Cross-compiling..."
2745 *-*-gcc) # A cross-compiling gcc, probably.
2746 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2748 # leave out ld, choosing it is more complex
2750 ranlib=$targetarch-ranlib
2751 $echo 'extern int foo;' > try.c
2752 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2754 if $test $# -gt 0; then
2756 incpth="`$echo $incpth|$sed 's/^ //'`"
2757 echo "Guessing incpth '$incpth'." >&4
2759 j="`$echo $i|$sed 's,/include$,/lib,'`"
2760 if $test -d $j; then
2764 libpth="`$echo $libpth|$sed 's/^ //'`"
2765 echo "Guessing libpth '$libpth'." >&4
2770 case "$targetarch" in
2771 '') echo "Targetarch not defined." >&4; croak=y ;;
2772 *) echo "Using targetarch $targetarch." >&4 ;;
2775 '') echo "Incpth not defined." >&4; croak=y ;;
2776 *) echo "Using incpth '$incpth'." >&4 ;;
2779 '') echo "Libpth not defined." >&4; croak=y ;;
2780 *) echo "Using libpth '$libpth'." >&4 ;;
2783 '') for i in $incpth; do
2784 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2786 echo "Guessing usrinc $usrinc." >&4
2791 '') echo "Usrinc not defined." >&4; croak=y ;;
2794 *) echo "Using usrinc $usrinc." >&4 ;;
2796 case "$targethost" in
2797 '') echo "Targethost not defined." >&4; croak=y ;;
2798 *) echo "Using targethost $targethost." >&4
2803 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2806 /*) run=$src/Cross/run
2807 targetmkdir=$src/Cross/mkdir
2809 from=$src/Cross/from
2811 *) pwd=`$test -f ../Configure & cd ..; pwd`
2813 targetmkdir=$pwd/Cross/mkdir
2815 from=$pwd/Cross/from
2818 case "$targetrun" in
2819 '') targetrun=ssh ;;
2824 case "$targetfrom" in
2825 '') targetfrom=scp ;;
2829 from=$from-$targetfrom
2830 case "$targetdir" in
2832 echo "Guessing targetdir $targetdir." >&4
2835 case "$targetuser" in
2837 echo "Guessing targetuser $targetuser." >&4
2840 case "$targetfrom" in
2844 case "$targetrun" in
2856 '') cwd=$targetdir ;;
2860 if $test ! -f \$exe.xok; then
2864 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2867 *) echo "Unknown targetrun '$targetrun'" >&4
2871 case "$targetmkdir" in
2873 cat >$targetmkdir <<EOF
2875 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2877 $chmod a+rx $targetmkdir
2879 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2891 $targetmkdir \`dirname \$f\`
2892 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2895 $targetmkdir $targetdir/\`dirname \$f\`
2896 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2909 $mkdir -p $targetdir/\`dirname \$f\`
2910 $cp \$f $targetdir/\$f || exit 1
2913 $targetmkdir $targetdir/\`dirname \$f\`
2914 $cp \$f $targetdir/\$f || exit 1
2921 *) echo "Unknown targetto '$targetto'" >&4
2925 case "$targetfrom" in
2932 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2937 cp) cat >$from <<EOF
2942 cp $targetdir/\$f . || exit 1
2947 *) echo "Unknown targetfrom '$targetfrom'" >&4
2951 if $test ! -f $run; then
2952 echo "Target 'run' script '$run' not found." >&4
2956 if $test ! -f $to; then
2957 echo "Target 'to' script '$to' not found." >&4
2961 if $test ! -f $from; then
2962 echo "Target 'from' script '$from' not found." >&4
2966 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2970 Using '$run' for remote execution,
2971 and '$from' and '$to'
2972 for remote file transfer.
2978 usecrosscompile='undef'
2983 : see whether [:lower:] and [:upper:] are supported character classes
2985 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2987 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2991 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2992 # (0xd9 and 0xe2), therefore that is a nice testing point.
2993 if test "X$up" = X -o "X$low" = X; then
2994 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3000 if test "X$up" = X -o "X$low" = X; then
3001 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3007 if test "X$up" = X -o "X$low" = X; then
3008 case "`echo RS | od -x 2>/dev/null`" in
3010 echo "Hey, this might be EBCDIC." >&4
3011 if test "X$up" = X -o "X$low" = X; then
3012 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3013 rs) up='[A-IJ-RS-Z]'
3018 if test "X$up" = X -o "X$low" = X; then
3019 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3029 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3031 echo "Using $up and $low to convert case." >&4
3034 echo "I don't know how to translate letters from upper to lower case." >&4
3035 echo "Your tr is not acting any way I know of." >&4
3039 : set up the translation script tr, must be called with ./tr of course
3043 '[A-Z][a-z]') exec $tr '$up' '$low';;
3044 '[a-z][A-Z]') exec $tr '$low' '$up';;
3051 : Try to determine whether config.sh was made on this system
3052 case "$config_sh" in
3054 myuname=`$uname -a 2>/dev/null`
3055 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3056 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3057 # because the A-Z/a-z are not consecutive.
3058 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3059 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3060 newmyuname="$myuname"
3062 case "$knowitall" in
3064 if test -f ../config.sh; then
3065 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3066 eval "`grep myuname= ../config.sh`"
3068 if test "X$myuname" = "X$newmyuname"; then
3076 : Get old answers from old config file if Configure was run on the
3077 : same system, otherwise use the hints.
3080 if test -f config.sh; then
3082 rp="I see a config.sh file. Shall I use it to set the defaults?"
3085 n*|N*) echo "OK, I'll ignore it."
3086 mv config.sh config.sh.old
3087 myuname="$newmyuname"
3089 *) echo "Fetching default answers from your old config.sh file..." >&4
3097 : Older versions did not always set $sh. Catch re-use of such
3107 if test ! -f config.sh; then
3110 First time through, eh? I have some defaults handy for some systems
3111 that need some extra help getting the Configure answers right:
3114 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3116 : Half the following guesses are probably wrong... If you have better
3117 : tests or hints, please send them to perlbug@perl.org
3118 : The metaconfig authors would also appreciate a copy...
3119 $test -f /irix && osname=irix
3120 $test -f /xenix && osname=sco_xenix
3121 $test -f /dynix && osname=dynix
3122 $test -f /dnix && osname=dnix
3123 $test -f /lynx.os && osname=lynxos
3124 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3125 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3126 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3127 $test -f /bin/mips && /bin/mips && osname=mips
3128 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3129 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3130 $test -d /usr/apollo/bin && osname=apollo
3131 $test -f /etc/saf/_sactab && osname=svr4
3132 $test -d /usr/include/minix && osname=minix
3133 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3134 if $test -d /MachTen -o -d /MachTen_Folder; then
3136 if $test -x /sbin/version; then
3137 osvers=`/sbin/version | $awk '{print $2}' |
3138 $sed -e 's/[A-Za-z]$//'`
3139 elif $test -x /usr/etc/version; then
3140 osvers=`/usr/etc/version | $awk '{print $2}' |
3141 $sed -e 's/[A-Za-z]$//'`
3147 $test -f /sys/posix.dll &&
3148 $test -f /usr/bin/what &&
3149 set X `/usr/bin/what /sys/posix.dll` &&
3150 $test "$3" = UWIN &&
3154 if $test -f $uname; then
3162 umips) osname=umips ;;
3165 [23]100) osname=mips ;;
3166 next*) osname=next ;;
3168 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3169 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3172 elif $test -f /etc/kconfig; then
3174 if test "$lns" = "$ln -s"; then
3176 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3178 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3185 if test -n "$DJGPP"; then
3194 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3196 # oslevel can fail with:
3197 # oslevel: Unable to acquire lock.
3198 *not\ found) osvers="$4"."$3" ;;
3199 '<3240'|'<>3240') osvers=3.2.0 ;;
3200 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3201 '=3250'|'>3250') osvers=3.2.5 ;;
3205 bsd386) osname=bsd386
3208 cygwin*) osname=cygwin
3211 *dc.osx) osname=dcosx
3217 domainos) osname=apollo
3223 dragonfly) osname=dragonfly
3226 dynixptx*) osname=dynixptx
3227 osvers=`echo "$4"|sed 's/^v//'`
3229 freebsd) osname=freebsd
3231 genix) osname=genix ;;
3235 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3251 netbsd*) osname=netbsd
3254 news-os) osvers="$3"
3256 4*) osname=newsos4 ;;
3260 next*) osname=next ;;
3261 nonstop-ux) osname=nonstopux ;;
3262 openbsd) osname=openbsd
3268 POSIX-BC | posix-bc ) osname=posix-bc
3271 powerux | power_ux | powermax_os | powermaxos | \
3272 powerunix | power_unix) osname=powerux
3278 solaris) osname=solaris
3280 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3287 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3291 titanos) osname=titanos
3300 ultrix) osname=ultrix
3303 osf1|mls+) case "$5" in
3306 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3309 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3312 hp*) osname=hp_osf1 ;;
3313 mips) osname=mips_osf1 ;;
3316 # UnixWare 7.1.2 is known as Open UNIX 8
3317 openunix|unixware) osname=svr5
3325 $2) case "$osname" in
3329 : svr4.x or possibly later
3339 if test -f /stand/boot ; then
3340 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3341 if test -n "$INITPROG" -a -f "$INITPROG"; then
3342 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3343 if test -n "$isesix"; then
3351 *) if test -f /etc/systemid; then
3353 set `echo $3 | $sed 's/\./ /g'` $4
3354 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3356 elif $test -f $src/hints/sco_$1_$2.sh; then
3358 elif $test -f $src/hints/sco_$1.sh; then
3363 '') : Still unknown. Probably a generic Sys V.
3372 *) case "$osname" in
3373 '') : Still unknown. Probably a generic BSD.
3381 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3382 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3383 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3386 $rm -f UU/kernel.what
3387 elif test -d c:/. -o -n "$is_os2" ; then
3394 case "$targetarch" in
3397 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3402 : Now look for a hint file osname_osvers, unless one has been
3403 : specified already.
3406 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3407 : Also try without trailing minor version numbers.
3408 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3409 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3410 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3411 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3414 *) case "$osvers" in
3417 *) if $test -f $src/hints/$file.sh ; then
3419 elif $test -f $src/hints/$xfile.sh ; then
3421 elif $test -f $src/hints/$xxfile.sh ; then
3423 elif $test -f $src/hints/$xxxfile.sh ; then
3425 elif $test -f $src/hints/$xxxxfile.sh ; then
3427 elif $test -f "$src/hints/${osname}.sh" ; then
3436 if $test -f Policy.sh ; then
3439 none) dflt="Policy" ;;
3440 *) dflt="Policy $dflt" ;;
3445 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3449 if $test -f Policy.sh ; then
3452 There's also a Policy hint file available, which should make the
3453 site-specific (policy) questions easier to answer.
3460 You may give one or more space-separated answers, or "none" if appropriate.
3461 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3462 previous run of Configure, you may specify it as well as or instead of
3463 OS-specific hints. If hints are provided for your OS, you should use them:
3464 although Perl can probably be built without hints on many platforms, using
3465 hints often improve performance and may enable features that Configure can't
3466 set up on its own. If there are no hints that match your OS, specify "none";
3467 DO NOT give a wrong version or a wrong OS.
3471 rp="Which of these apply, if any?"
3474 for file in $tans; do
3475 if $test X$file = XPolicy -a -f Policy.sh; then
3477 $cat Policy.sh >> UU/config.sh
3478 elif $test -f $src/hints/$file.sh; then
3479 . $src/hints/$file.sh
3480 $cat $src/hints/$file.sh >> UU/config.sh
3481 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3484 : Give one chance to correct a possible typo.
3485 echo "$file.sh does not exist"
3487 rp="hint to use instead?"
3489 for file in $ans; do
3490 if $test -f "$src/hints/$file.sh"; then
3491 . $src/hints/$file.sh
3492 $cat $src/hints/$file.sh >> UU/config.sh
3493 elif $test X$ans = X -o X$ans = Xnone ; then
3496 echo "$file.sh does not exist -- ignored."
3503 : Remember our hint file for later.
3504 if $test -f "$src/hints/$file.sh" ; then
3514 echo "Fetching default answers from $config_sh..." >&4
3518 cp $config_sh config.sh 2>/dev/null
3528 test "$override" && . ./optdef.sh
3530 : Restore computed paths
3531 for file in $loclist $trylist; do
3532 eval $file="\$_$file"
3537 Configure uses the operating system name and version to set some defaults.
3538 The default value is probably right if the name rings a bell. Otherwise,
3539 since spelling matters for me, either accept the default or answer "none"
3546 ''|' '|none) dflt=none ;;
3547 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3550 *) dflt="$osname" ;;
3552 rp="Operating system name?"
3556 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3562 ''|' '|none) dflt=none ;;
3563 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3564 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3566 ''|' ') dflt=none ;;
3571 *) dflt="$osvers" ;;
3573 rp="Operating system version?"
3583 : who configured the system
3584 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3587 cf_by=`(logname) 2>/dev/null`
3590 cf_by=`(whoami) 2>/dev/null`
3592 "") cf_by=unknown ;;
3597 : decide how portable to be. Allow command line overrides.
3598 case "$d_portable" in
3600 *) d_portable="$define" ;;
3603 : set up shell script to do ~ expansion
3609 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3612 if $test -f /bin/csh; then
3613 /bin/csh -f -c "glob \$1"
3618 name=\`$expr x\$1 : '..\([^/]*\)'\`
3619 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3620 if $test ! -d "\$dir"; then
3622 echo "\$me: can't locate home directory for: \$name" >&2
3627 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3643 : now set up to get a file name
3647 cat <<'EOSC' >>getfile
3663 : getfile will accept an answer from the comma-separated list
3664 : enclosed in parentheses even if it does not meet other criteria.
3665 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3666 fn=`echo $fn | sed 's/(.*)//'`
3672 loc_file=`expr $fn : '.*:\(.*\)'`
3673 fn=`expr $fn : '\(.*\):.*'`
3681 */*) fullpath=true;;
3690 *e*) exp_file=true;;
3693 *p*) nopath_ok=true;;
3698 *d*) type='Directory';;
3699 *l*) type='Locate';;
3704 Locate) what='File';;
3709 case "$d_portable" in
3717 while test "$type"; do
3722 true) rp="$rp (~name ok)";;
3725 if test -f UU/getfile.ok && \
3726 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3745 value=`UU/filexp $ans`
3748 if test "$ans" != "$value"; then
3749 echo "(That expands to $value on this system.)"
3763 /*) value="$ansexp" ;;
3764 [a-zA-Z]:/*) value="$ansexp" ;;
3769 echo "I shall only accept a full path name, as in /bin/ls." >&4
3770 echo "Use a ! shell escape if you wish to check pathnames." >&4
3773 echo "Please give a full path name, starting with slash." >&4
3776 echo "Note that using ~name is ok provided it expands well." >&4
3789 for fp in $gfpth; do
3790 if test "X$fp" = X.; then
3795 if test -f "$pf"; then
3797 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3799 echo "($value is not a plain file, but that's ok.)"
3802 if test X"$type" = X; then
3809 for fp in $gfpth; do
3810 if test "X$fp" = X.; then
3815 direxp="$fp/$ansexp"
3817 if test -d "$direxp"; then
3825 if test -d "$ansexp"; then
3826 echo "(Looking for $loc_file in directory $value.)"
3827 value="$value/$loc_file"
3828 ansexp="$ansexp/$loc_file"
3830 if test -f "$ansexp"; then
3833 case "$nopath_ok" in
3834 true) case "$value" in
3836 *) echo "Assuming $value will be in people's path."
3852 if test "$fastread" = yes; then
3857 rp="$what $value doesn't exist. Use that name anyway?"
3876 test "X$gfpthkeep" != Xy && gfpth=""
3879 : determine root of directory hierarchy where package will be installed.
3882 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3885 dflt=`echo "$prefix" | sed 's/.$//'`
3893 By default, $package will be installed in $dflt/bin, manual pages
3894 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3895 installation directories. Typically this is something like /usr/local.
3896 If you wish to have binaries under /usr/bin but other parts of the
3897 installation under /usr/local, that's ok: you will be prompted
3898 separately for each of the installation directories, the prefix being
3899 only used to set the defaults.
3903 rp='Installation prefix to use?'
3911 *) oldprefix="$prefix";;
3918 : allow them to override the AFS root
3921 *) afsroot=$afsroot ;;
3927 $define|true) afs=true ;;
3928 $undef|false) afs=false ;;
3929 *) if $test -d $afsroot; then
3937 echo "AFS may be running... I'll be extra cautious then..." >&4
3939 echo "AFS does not seem to be running..." >&4
3942 : determine installation prefix for where package is to be installed.
3946 Since you are running AFS, I need to distinguish the directory in which
3947 files will reside from the directory in which they are installed (and from
3948 which they are presumably copied to the former directory by occult means).
3951 case "$installprefix" in
3952 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3953 *) dflt="$installprefix";;
3958 In some special cases, particularly when building $package for distribution,
3959 it is convenient to distinguish the directory in which files should be
3960 installed from the directory ($prefix) in which they will
3961 eventually reside. For most users, these two directories are the same.
3964 case "$installprefix" in
3966 *) dflt=$installprefix;;
3970 rp='What installation prefix should I use for installing files?'
3972 installprefix="$ans"
3973 installprefixexp="$ansexp"
3975 : Perform the prefixexp/installprefixexp correction if necessary
3976 cat <<EOS >installprefix
3979 cat <<'EOSC' >>installprefix
3980 : Change installation prefix, if necessary.
3981 if $test X"$prefix" != X"$installprefix"; then
3982 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3984 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3987 chmod +x installprefix
3988 $eunicefix installprefix
3990 : Set variables such as privlib and privlibexp from the output of ./getfile
3991 : performing the prefixexp/installprefixexp correction if necessary.
3992 cat <<EOS >setprefixvar
3995 cat <<'EOSC' >>setprefixvar
3996 eval "${prefixvar}=\"\$ans\""
3997 eval "${prefixvar}exp=\"\$ansexp\""
4000 chmod +x setprefixvar
4001 $eunicefix setprefixvar
4003 : set up the script used to warn in case of inconsistency
4012 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4014 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4015 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4020 echo "*** WHOA THERE!!! ***" >&4
4021 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4024 rp=" Keep the $hint value?"
4027 y) td=$was; tu=$was;;
4031 : function used to set '$1' to '$val'
4032 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4034 $define$undef) . ./whoa; eval "$var=\$td";;
4035 $undef$define) . ./whoa; eval "$var=\$tu";;
4036 *) eval "$var=$val";;
4039 : Check is we will use socks
4041 $define|true|[yY]*) dflt='y';;
4046 Perl can be built to use the SOCKS proxy protocol library. To do so,
4047 Configure must be run with -Dusesocks. If you use SOCKS you also need
4048 to use the PerlIO abstraction layer, this will be implicitly selected.
4050 If this doesn't make any sense to you, just accept the default '$dflt'.
4052 rp='Build Perl for SOCKS?'
4055 y|Y) val="$define" ;;
4062 $define|true|[yY]*) useperlio="$define";;
4065 : Check if we want perlio
4066 case "$useperlio" in
4067 $define|true|[yY]*|'') dflt='y';;
4072 Previous version of $package used the standard IO mechanisms as
4073 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4074 alternate IO mechanisms via the PerlIO abstraction layer, but the
4075 stdio mechanism is still available if needed. The abstraction layer
4076 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4077 Using PerlIO with sfio may cause problems with some extension modules.
4079 If this doesn't make any sense to you, just accept the default '$dflt'.
4081 rp='Use the PerlIO abstraction layer?'
4088 echo "Ok, doing things the stdio way."
4097 case "$useperlio" in
4098 $define|true|[yY]*) ;;
4101 You are using the SOCKS proxy protocol library which means that you
4102 should also use the PerlIO layer. You may be headed for trouble.
4110 : get the patchlevel
4112 echo "Getting the current patchlevel..." >&4
4113 if $test -r $rsrc/patchlevel.h;then
4114 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4115 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4116 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4117 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4118 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4119 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4120 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4129 $echo "(You do not have patchlevel.h. Eek.)"
4131 if $test -r $rsrc/.patch ; then
4132 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4133 perl_patchlevel=`cat $rsrc/.patch`
4136 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4137 version_patchlevel_string="version $patchlevel subversion $subversion"
4138 case "$perl_patchlevel" in
4140 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4143 $echo "(You have $package $version_patchlevel_string.)"
4147 : XXX Should be a Configure test for double-dots in filenames.
4148 version=`echo $revision $patchlevel $subversion | \
4149 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4150 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4151 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4154 version=`echo $revision $patchlevel $subversion | \
4155 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4156 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4157 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4160 : Special case the 5.005_xx maintenance series, which used 5.005
4161 : without any subversion label as a subdirectory in $sitelib
4162 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4163 api_versionstring='5.005'
4166 : Do we want threads support and if so, what type
4167 case "$usethreads" in
4168 $define|true|[yY]*) dflt='y';;
4169 *) # Catch case where user specified ithreads or 5005threads but
4170 # forgot -Dusethreads (A.D. 4/2002)
4171 case "$useithreads$use5005threads" in
4173 case "$useperlio" in
4174 "$define") dflt='y' ;;
4184 Perl can be built to take advantage of threads on some systems.
4185 To do so, Configure can be run with -Dusethreads.
4187 Note that Perl built with threading support runs slightly slower
4188 and uses more memory than plain Perl. The current implementation
4189 is believed to be stable, but it is fairly new, and so should be
4190 treated with caution.
4192 If this doesn't make any sense to you, just accept the default '$dflt'.
4194 rp='Build a threading Perl?'
4197 y|Y) val="$define" ;;
4203 if $test $patchlevel -lt 9; then
4204 case "$usethreads" in
4208 Since release 5.6, Perl has had two different threading implementations,
4209 the newer interpreter-based version (ithreads) with one interpreter per
4210 thread, and the older 5.005 version (5005threads).
4211 The 5005threads version is effectively unmaintained and will probably be
4212 removed in Perl 5.10, so there should be no need to build a Perl using it
4213 unless needed for backwards compatibility with some existing 5.005threads
4217 : Default to ithreads unless overridden on command line or with
4220 case "$use5005threads" in
4221 $define|true|[yY]*) dflt='n';;
4223 case "$useithreads" in
4224 $undef|false|[nN]*) dflt='n';;
4226 rp='Use the newer interpreter-based ithreads?'
4229 y|Y) val="$define" ;;
4234 : Now set use5005threads to the opposite value.
4235 case "$useithreads" in
4236 $define) val="$undef" ;;
4243 useithreads="$undef"
4244 use5005threads="$undef"
4248 case "$useithreads$use5005threads" in
4252 You cannot have both the ithreads and the 5.005 threads enabled
4253 at the same time. Disabling the 5.005 threads since they are
4254 much less stable than the ithreads.
4257 use5005threads="$undef"
4262 : perl-5.9.x and later
4264 if test X"$usethreads" = "X$define"; then
4265 case "$use5005threads" in
4269 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4276 use5005threads="$undef"
4277 useithreads="$usethreads"
4280 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4283 *** To build with ithreads you must also use the PerlIO layer.
4284 *** Cannot continue, aborting.
4290 case "$d_oldpthreads" in
4291 '') : Configure tests would be welcome here. For now, assume undef.
4293 *) val="$d_oldpthreads" ;;
4299 : Look for a hint-file generated 'call-back-unit'. If the
4300 : user has specified that a threading perl is to be built,
4301 : we may need to set or change some other defaults.
4302 if $test -f usethreads.cbu; then
4303 echo "Your platform has some specific hints regarding threaded builds, using them..."
4306 case "$usethreads" in
4307 "$define"|true|[yY]*)
4309 (Your platform does not have any specific hints for threaded builds.
4310 Assuming POSIX threads, then.)
4316 : Check if multiplicity is required
4319 Perl can be built so that multiple Perl interpreters can coexist
4320 within the same Perl executable.
4323 case "$useithreads" in
4326 This multiple interpreter support is required for interpreter-based threads.
4330 *) case "$usemultiplicity" in
4331 $define|true|[yY]*) dflt='y';;
4335 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4336 rp='Build Perl for multiplicity?'
4339 y|Y) val="$define" ;;
4347 : Check if morebits is requested
4348 case "$usemorebits" in
4349 "$define"|true|[yY]*)
4350 use64bitint="$define"
4351 uselongdouble="$define"
4352 usemorebits="$define"
4354 *) usemorebits="$undef"
4358 : Determine the C compiler to be used
4364 rp="Use which C compiler?"
4368 : See whether they have no cc but they do have gcc
4370 if $test -f cc.cbu; then
4375 : make some quick guesses about what we are up against
4377 $echo $n "Hmm... $c"
4387 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4388 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4390 echo "Looks kind of like an OSF/1 system, but we'll see..."
4392 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4393 xxx=`./loc addbib blurfl $pth`
4394 if $test -f $xxx; then
4395 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4399 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4400 echo "Looks kind of like an extended USG system, but we'll see..."
4402 echo "Looks kind of like a USG system, but we'll see..."
4406 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4407 echo "Looks kind of like a BSD system, but we'll see..."
4411 echo "Looks kind of like a Version 7 system, but we'll see..."
4414 case "$eunicefix" in
4417 There is, however, a strange, musty smell in the air that reminds me of
4418 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4422 : it so happens the Eunice I know will not run shell scripts in Unix format
4426 echo "Congratulations. You aren't running Eunice."
4430 : Detect OS2. The p_ variable is set above in the Head.U unit.
4431 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4432 : semicolon as a patch separator
4437 I have the feeling something is not exactly right, however...don't tell me...
4438 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4439 (Or you may be running DOS with DJGPP.)
4444 if test -f /xenix; then
4445 echo "Actually, this looks more like a XENIX system..."
4450 echo "It's not Xenix..."
4455 if test -f /venix; then
4456 echo "Actually, this looks more like a VENIX system..."
4463 echo "Nor is it Venix..."
4466 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4467 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4470 : Check if we are using GNU gcc and what its version is
4472 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4476 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4478 printf("%s\n", __VERSION__);
4480 printf("%s\n", "1");
4486 if $cc -o try $ccflags $ldflags try.c; then
4487 gccversion=`$run ./try`
4488 case "$gccversion" in
4489 '') echo "You are not using GNU cc." ;;
4490 *) echo "You are using GNU cc $gccversion."
4496 echo "*** WHOA THERE!!! ***" >&4
4497 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4498 case "$knowitall" in
4500 echo " You'd better start hunting for one and let me know about it." >&4
4506 case "$gccversion" in
4507 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4509 case "$gccversion" in
4510 '') gccosandvers='' ;;
4511 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4512 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4514 case "$gccosandvers" in
4515 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4516 $osname$osvers) ;; # looking good
4517 $osname*) cat <<EOM >&4
4519 *** WHOA THERE!!! ***
4521 Your gcc has not been compiled for the exact release of
4522 your operating system ($gccosandvers versus $osname$osvers).
4524 In general it is a good idea to keep gcc synchronized with
4525 the operating system because otherwise serious problems
4526 may ensue when trying to compile software, like Perl.
4528 I'm trying to be optimistic here, though, and will continue.
4529 If later during the configuration and build icky compilation
4530 problems appear (headerfile conflicts being the most common
4531 manifestation), I suggest reinstalling the gcc to match
4532 your operating system release.
4536 *) gccosandvers='' ;; # failed to parse, better be silent
4544 # gcc 3.* complain about adding -Idirectories that they already know about,
4545 # so we will take those off from locincpth.
4546 case "$gccversion" in
4548 echo "main(){}">try.c
4549 for incdir in $locincpth; do
4550 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4551 grep '^c[cp]p*[01]: warning: changing search order '`
4552 if test "X$warn" != X; then
4553 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4559 : What should the include directory be ?
4561 $echo $n "Hmm... $c"
4565 if $test -f /bin/mips && /bin/mips; then
4566 echo "Looks like a MIPS system..."
4567 $cat >usr.c <<'EOCP'
4568 #ifdef SYSTYPE_BSD43
4572 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4573 dflt='/bsd43/usr/include'
4577 mips_type='System V'
4579 $rm -f usr.c usr.out
4580 echo "and you're compiling with the $mips_type compiler and libraries."
4584 echo "Doesn't look like a MIPS system."
4594 case "$xxx_prompt" in
4597 rp='Where are the include files you want to use?'
4605 : see how we invoke the C preprocessor
4607 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4608 cat <<'EOT' >testcpp.c
4614 if test ! -f cppstdin; then
4615 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4616 # AIX cc -E doesn't show the absolute headerfile
4617 # locations but we'll cheat by using the -M flag.
4618 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
4620 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4623 echo "Keeping your $hint cppstdin wrapper."
4626 wrapper=`pwd`/cppstdin
4630 if $test "X$cppstdin" != "X" && \
4631 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4632 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4634 echo "You used to use $cppstdin $cppminus so we'll use that again."
4636 '') echo "But let's see if we can live without a wrapper..." ;;
4638 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4639 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4641 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4644 echo "(However, $cpprun $cpplast does not work, let's see...)"
4652 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4659 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4660 $cc -E <testcpp.c >testcpp.out 2>&1; \
4661 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4662 echo "Yup, it does."
4665 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4666 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4667 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4668 echo "Yup, it does."
4671 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4672 $cc -P <testcpp.c >testcpp.out 2>&1; \
4673 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4674 echo "Yipee, that works!"
4677 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4678 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4679 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4680 echo "At long last!"
4683 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4684 $cpp <testcpp.c >testcpp.out 2>&1; \
4685 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4689 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4690 $cpp - <testcpp.c >testcpp.out 2>&1; \
4691 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4692 echo "Hooray, it works! I was beginning to wonder."
4695 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4696 $wrapper <testcpp.c >testcpp.out 2>&1; \
4697 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4703 rp="No dice. I can't find a C preprocessor. Name one:"
4707 $x_cpp <testcpp.c >testcpp.out 2>&1
4708 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4709 echo "OK, that will do." >&4
4711 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4726 echo "Perhaps can we force $cc -E using a wrapper..."
4727 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4728 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4734 echo "Nope, we'll have to live without it..."
4748 "$wrapper"|'cppstdin') ;;
4749 *) $rm -f $wrapper;;
4751 $rm -f testcpp.c testcpp.out
4753 : Set private lib path
4756 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4761 '') dlist="$loclibpth $plibpth $glibpth";;
4762 *) dlist="$libpth";;
4765 : Now check and see which directories actually exist, avoiding duplicates
4769 if $test -d $xxx; then
4772 *) libpth="$libpth $xxx";;
4778 Some systems have incompatible or broken versions of libraries. Among
4779 the directories listed in the question below, please remove any you
4780 know not to be holding relevant libraries, and add any that are needed.
4781 Say "none" for none.
4792 rp="Directories to use for library searches?"
4799 : compute shared library extension
4802 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4812 On some systems, shared libraries may be available. Answer 'none' if
4813 you want to suppress searching of shared libraries for the remainder
4814 of this configuration.
4817 rp='What is the file extension used for shared libraries?'
4821 : Define several unixisms.
4822 : Hints files or command line option can be used to override them.
4823 : The convoluted testing is in case hints files set either the old
4826 '') case "$exe_ext" in
4828 *) _exe="$exe_ext" ;;
4833 '') case "$lib_ext" in
4840 '') case "$obj_ext" in
4847 '') case "$path_sep" in
4858 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4860 : Which makefile gets called first. This is used by make depend.
4861 case "$firstmakefile" in
4862 '') firstmakefile='makefile';;
4865 : Check for uselongdouble support
4867 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4870 case "$uselongdouble" in
4871 $define|true|[yY]*) dflt='y';;
4876 Perl can be built to take advantage of long doubles which
4877 (if available) may give more accuracy and range for floating point numbers.
4879 If this doesn't make any sense to you, just accept the default '$dflt'.
4881 rp='Try to use long doubles if available?'
4884 y|Y) val="$define" ;;
4890 case "$uselongdouble" in
4891 true|[yY]*) uselongdouble="$define" ;;
4894 : Look for a hint-file generated 'call-back-unit'. If the
4895 : user has specified that long doubles should be used,
4896 : we may need to set or change some other defaults.
4897 if $test -f uselongdouble.cbu; then
4898 echo "Your platform has some specific hints regarding long doubles, using them..."
4899 . ./uselongdouble.cbu
4901 case "$uselongdouble" in
4904 (Your platform does not have any specific hints for long doubles.)
4910 : Looking for optional libraries
4912 echo "Checking for optional libraries..." >&4
4917 case "$libswanted" in
4918 '') libswanted='c_s';;
4921 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4927 for thisdir in $libpth $xlibpth; do
4928 test -d $thisdir && libspath="$libspath $thisdir"
4930 for thislib in $libswanted; do
4931 for thisdir in $libspath; do
4933 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4934 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4935 $test -f "$xxx" && eval $libscheck
4936 $test -f "$xxx" && libstyle=shared
4938 if test ! -f "$xxx"; then
4939 xxx=$thisdir/lib$thislib.$so
4940 $test -f "$xxx" && eval $libscheck
4941 $test -f "$xxx" && libstyle=shared
4943 if test ! -f "$xxx"; then
4944 xxx=$thisdir/lib$thislib$_a
4945 $test -f "$xxx" && eval $libscheck
4946 $test -f "$xxx" && libstyle=static
4948 if test ! -f "$xxx"; then
4949 xxx=$thisdir/$thislib$_a
4950 $test -f "$xxx" && eval $libscheck
4951 $test -f "$xxx" && libstyle=static
4953 if test ! -f "$xxx"; then
4954 xxx=$thisdir/lib${thislib}_s$_a
4955 $test -f "$xxx" && eval $libscheck
4956 $test -f "$xxx" && libstyle=static
4957 $test -f "$xxx" && thislib=${thislib}_s
4959 if test ! -f "$xxx"; then
4960 xxx=$thisdir/Slib$thislib$_a
4961 $test -f "$xxx" && eval $libscheck
4962 $test -f "$xxx" && libstyle=static
4964 if $test -f "$xxx"; then
4966 shared) echo "Found -l$thislib (shared)." ;;
4967 static) echo "Found -l$thislib." ;;
4968 *) echo "Found -l$thislib ($libstyle)." ;;
4972 *) dflt="$dflt -l$thislib"
4973 libsfound="$libsfound $xxx"
4975 libsfiles="$libsfiles $yyy"
4976 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4977 case " $libsdirs " in
4979 *) libsdirs="$libsdirs $yyy" ;;
4986 if $test ! -f "$xxx"; then
4987 echo "No -l$thislib."
4998 ' '|'') dflt='none';;
5003 In order to compile $package on your machine, a number of libraries
5004 are usually needed. Include any other special libraries here as well.
5005 Say "none" for none. The default list is almost always right.
5009 rp="What libraries to use?"
5016 : determine optimization, if desired, or use for debug flag also
5018 ' '|$undef) dflt='none';;
5020 *) dflt="$optimize";;
5024 By default, $package compiles with the -O flag to use the optimizer.
5025 Alternately, you might want to use the symbolic debugger, which uses
5026 the -g flag (on traditional Unix systems). Either flag can be
5027 specified here. To use neither flag, specify the word "none".
5030 rp="What optimizer/debugger flag should be used?"
5034 'none') optimize=" ";;
5037 : Check what DEBUGGING is required from the command line
5038 : -DEBUGGING or -DDEBUGGING or
5039 : -DEBUGGING=both = -g + -DDEBUGGING
5040 : -DEBUGGING=-g or -Doptimize=-g = -g
5041 : -DEBUGGING=none or -UDEBUGGING =
5042 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5045 *) DEBUGGING=$EBUGGING ;;
5048 case "$DEBUGGING" in
5052 *) optimize="$optimize -g" ;;
5056 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5064 case "$DEBUGGING" in
5065 both|$define) dflt='-DDEBUGGING'
5068 : argument order is deliberate, as the flag will start with - which set could
5069 : think is an option
5070 checkccflag='check=$1; flag=$2; callback=$3;
5072 echo "Checking if your compiler accepts $flag" 2>&1;
5073 echo "int main(void) { return 0; }" > gcctest.c;
5074 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5075 echo "Yes, it does." 2>&1;
5076 if $test -s gcctest.out ; then
5077 echo "But your platform does not like it:";
5082 echo "Leaving current flags $ccflags alone." 2>&1
5084 *) dflt="$dflt $flag";
5090 echo "Nope, it does not, but that is ok." 2>&1;
5094 : We will not override a previous value, but we might want to
5095 : augment a hint file
5097 default|recommended)
5098 case "$gccversion" in
5099 1*) dflt="$dflt -fpcc-struct-return" ;;
5101 case "$optimize:$DEBUGGING" in
5102 *-g*:old) dflt="$dflt -DDEBUGGING";;
5104 case "$gccversion" in
5105 2*) if $test -d /etc/conf/kconfig.d &&
5106 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5108 # Interactive Systems (ISC) POSIX mode.
5113 case "$gccversion" in
5116 ?*) set strict-aliasing -fno-strict-aliasing
5120 # For gcc, adding -pipe speeds up compilations for some, but apparently
5121 # some assemblers can't read from stdin. (It also slows down compilations
5122 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5123 case "$gccversion" in
5129 # on x86_64 (at least) we require an extra library (libssp) in the
5130 # link command line. This library is not named, so I infer that it is
5131 # an implementation detail that may change. Hence the safest approach
5132 # is to add the flag to the flags passed to the compiler at link time,
5133 # as that way the compiler can do the right implementation dependant
5135 case "$gccversion" in
5136 ?*) set stack-protector -fstack-protector
5143 case "$mips_type" in
5144 *BSD*|'') inclwanted="$locincpth $usrinc";;
5145 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5147 for thisincl in $inclwanted; do
5148 if $test -d $thisincl; then
5149 if $test x$thisincl != x$usrinc; then
5151 *" -I$thisincl "*);;
5152 *) dflt="$dflt -I$thisincl ";;
5158 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5160 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5168 *) dflt="$dflt -D$2";;
5172 set signal.h LANGUAGE_C; eval $inctest
5176 ccflags="$ccflags -DSOCKS"
5181 default|recommended) dflt="$ccflags $dflt" ;;
5182 *) dflt="$ccflags";;
5191 Your C compiler may want other flags. For this question you should include
5192 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5193 but you should NOT include libraries or ld flags like -lwhatever. If you
5194 want $package to honor its debug switch, you should include -DDEBUGGING here.
5195 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5197 To use no flags, specify the word "none".
5203 rp="Any additional cc flags?"
5210 : the following weeds options from ccflags that are of no interest to cpp
5212 '') cppflags="$ccflags" ;;
5213 *) cppflags="$cppflags $ccflags" ;;
5215 case "$gccversion" in
5216 1*) cppflags="$cppflags -D__GNUC__"
5218 case "$mips_type" in
5220 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5226 echo "Let me guess what the preprocessor flags are..." >&4
5240 *) ftry="$previous $flag";;
5242 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5243 >cpp1.out 2>/dev/null && \
5244 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5245 >cpp2.out 2>/dev/null && \
5246 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5247 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5249 cppflags="$cppflags $ftry"
5259 *-*) echo "They appear to be: $cppflags";;
5261 $rm -f cpp.c cpp?.out
5265 : flags used in final linking phase
5267 '') if ./venix; then
5273 *-posix*) dflt="$dflt -posix" ;;
5276 *) dflt="$ldflags";;
5278 # See note above about -fstack-protector
5280 *-fstack-protector*)
5282 *-fstack-protector*) ;; # Don't add it again
5283 *) dflt="$dflt -fstack-protector" ;;
5288 : Try to guess additional flags to pick up local libraries.
5289 for thislibdir in $libpth; do
5290 case " $loclibpth " in
5293 *"-L$thislibdir "*) ;;
5294 *) dflt="$dflt -L$thislibdir" ;;
5306 Your C linker may need flags. For this question you should
5307 include -L/whatever and any other flags used by the C linker, but you
5308 should NOT include libraries like -lwhatever.
5310 Make sure you include the appropriate -L/path flags if your C linker
5311 does not normally search all of the directories you specified above,
5314 To use no flags, specify the word "none".
5318 rp="Any additional ld flags (NOT including libraries)?"
5324 rmlist="$rmlist pdp11"
5328 echo "Checking your choice of C compiler and flags for coherency..." >&4
5329 $cat > try.c <<'EOF'
5331 int main() { printf("Ok\n"); return(0); }
5333 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5335 $cat >try.msg <<'EOM'
5336 I've tried to compile and run the following simple program:
5339 $cat try.c >> try.msg
5341 $cat >> try.msg <<EOM
5348 and I got the following output:
5352 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5353 if $sh -c "$run ./try " >>try.msg 2>&1; then
5357 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5360 cat >> try.msg <<'EOQS'
5361 If $libs contains -lsfio, and sfio is mis-configured, then it
5362 sometimes (apparently) runs and exits with a 0 status, but with no
5363 output! It may have to do with sfio's use of _exit vs. exit.
5366 rp="You have a big problem. Shall I abort Configure"
5373 echo "The program compiled OK, but exited with status $?." >>try.msg
5374 rp="You have a problem. Shall I abort Configure"
5378 echo "I can't compile the test program." >>try.msg
5379 rp="You have a BIG problem. Shall I abort Configure"
5385 case "$knowitall" in
5387 echo "(The supplied flags or libraries might be incorrect.)"
5395 *) echo "Ok. Stopping Configure." >&4
5400 n) echo "OK, that should do.";;
5402 $rm_try gcctest gcctest.out
5404 : define a shorthand compile call
5408 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5409 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5413 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5414 : define a shorthand compile call for compilations that should be ok.
5418 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5420 : determine filename position in cpp output
5422 echo "Computing filename position in cpp output for #include directives..." >&4
5424 vos) testaccess=-e ;;
5427 echo '#include <stdio.h>' > foo.c
5430 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5431 $grep '^[ ]*#.*stdio\.h' | \
5432 while read cline; do
5435 while $test \$# -gt 0; do
5436 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5441 pos=\`expr \$pos + 1\`
5453 *) pos="${fieldn}th";;
5455 echo "Your cpp writes the filename in the $pos field of the line."
5458 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5459 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5462 : locate header file
5467 for usrincdir in $usrinc
5469 if test -f \$usrincdir/\$wanted; then
5470 echo "\$usrincdir/\$wanted"
5474 awkprg='{ print \$$fieldn }'
5475 echo "#include <\$wanted>" > foo\$\$.c
5476 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5477 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5478 while read cline; do
5479 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5481 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5482 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5487 # status = 0: grep returned 0 lines, case statement not executed
5488 # status = 1: headerfile found
5489 # status = 2: while loop executed, no headerfile found
5493 if test \$status -eq 1; then
5500 : define an alternate in-header-list? function
5501 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5502 cont=true; xxf="echo \"<\$1> found.\" >&4";
5503 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5504 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5506 case $# in 4) instead=instead;; *) instead="at last";; esac;
5507 while $test "$cont"; do
5509 var=$2; eval "was=\$$2";
5510 if $test "$xxx" && $test -r "$xxx";
5512 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5515 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5516 set $yyy; shift; shift; yyy=$@;
5517 case $# in 0) cont="";;
5518 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5519 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5520 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5521 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5525 do set $yyy; var=$2; eval "was=\$$2";
5526 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5527 set $yyy; shift; shift; yyy=$@;
5530 : see if stdlib is available
5531 set stdlib.h i_stdlib
5534 : check for lengths of integral types
5538 echo "Checking to see how big your integers are..." >&4
5547 printf("intsize=%d;\n", (int)sizeof(int));
5548 printf("longsize=%d;\n", (int)sizeof(long));
5549 printf("shortsize=%d;\n", (int)sizeof(short));
5554 if eval $compile_ok && $run ./try > /dev/null; then
5556 echo "Your integers are $intsize bytes long."
5557 echo "Your long integers are $longsize bytes long."
5558 echo "Your short integers are $shortsize bytes long."
5562 Help! I can't compile and run the intsize test program: please enlighten me!
5563 (This is probably a misconfiguration in your system or libraries, and
5564 you really ought to fix it. Still, I'll try anyway.)
5568 rp="What is the size of an integer (in bytes)?"
5572 rp="What is the size of a long integer (in bytes)?"
5576 rp="What is the size of a short integer (in bytes)?"
5584 : check for long long
5586 echo "Checking to see if you have long long..." >&4
5587 echo 'int main() { long long x = 7; return 0; }' > try.c
5589 if eval $compile; then
5591 echo "You have long long."
5594 echo "You do not have long long."
5600 : check for length of long long
5601 case "${d_longlong}${longlongsize}" in
5604 echo "Checking to see how big your long longs are..." >&4
5605 $cat >try.c <<'EOCP'
5609 printf("%d\n", (int)sizeof(long long));
5614 if eval $compile_ok; then
5615 longlongsize=`$run ./try`
5616 echo "Your long longs are $longlongsize bytes long."
5620 echo "(I can't seem to compile the test program. Guessing...)"
5621 rp="What is the size of a long long (in bytes)?"
5625 if $test "X$longsize" = "X$longlongsize"; then
5626 echo "(That isn't any different from an ordinary long.)"
5632 : see if inttypes.h is available
5633 : we want a real compile instead of Inhdr because some systems
5634 : have an inttypes.h which includes non-existent headers
5637 #include <inttypes.h>
5639 static int32_t foo32 = 0x12345678;
5643 if eval $compile; then
5644 echo "<inttypes.h> found." >&4
5647 echo "<inttypes.h> NOT found." >&4
5656 echo "Checking to see if you have int64_t..." >&4
5658 #include <sys/types.h>
5659 #$i_inttypes I_INTTYPES
5661 #include <inttypes.h>
5663 int main() { int64_t x = 7; }
5666 if eval $compile; then
5668 echo "You have int64_t."
5671 echo "You do not have int64_t."
5677 : Check if 64bit ints have a quad type
5679 echo "Checking which 64-bit integer type we could use..." >&4
5685 val='"unsigned int"'
5690 *) case "$longsize" in
5694 val='"unsigned long"'
5699 *) case "$d_longlong:$longlongsize" in
5704 val='"unsigned long long"'
5709 *) case "$d_int64_t" in
5728 '') echo "Alas, no 64-bit integer types in sight." >&4
5731 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5736 : Do we want 64bit support
5737 case "$uselonglong" in
5738 "$define"|true|[yY]*)
5741 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5743 use64bitint="$define"
5746 case "$use64bits" in
5747 "$define"|true|[yY]*)
5750 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5752 use64bitint="$define"
5755 case "$use64bitints" in
5756 "$define"|true|[yY]*)
5759 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5761 use64bitint="$define"
5764 case "$use64bitsint" in
5765 "$define"|true|[yY]*)
5768 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5770 use64bitint="$define"
5773 case "$uselonglongs" in
5774 "$define"|true|[yY]*)
5777 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5779 use64bitint="$define"
5782 case "$use64bitsall" in
5783 "$define"|true|[yY]*)
5786 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5788 use64bitall="$define"
5793 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5795 case "$use64bitall" in
5796 "$define"|true|[yY]*) use64bitint="$define" ;;
5802 You have natively 64-bit long integers.
5806 *) case "$use64bitint" in
5807 "$define"|true|[yY]*) dflt='y';;
5816 Perl can be built to take advantage of 64-bit integer types
5817 on some systems. To do so, Configure can be run with -Duse64bitint.
5818 Choosing this option will most probably introduce binary incompatibilities.
5820 If this doesn't make any sense to you, just accept the default '$dflt'.
5821 (The default has been chosen based on your configuration.)
5823 rp='Try to use 64-bit integers, if available?'
5826 [yY]*) val="$define" ;;
5834 case "$use64bitall" in
5835 "$define"|true|[yY]*) dflt='y' ;;
5836 *) case "$longsize" in
5844 You may also choose to try maximal 64-bitness. It means using as much
5845 64-bitness as possible on the platform. This in turn means even more
5846 binary incompatibilities. On the other hand, your platform may not
5847 have any more 64-bitness available than what you already have chosen.
5849 If this doesn't make any sense to you, just accept the default '$dflt'.
5850 (The default has been chosen based on your configuration.)
5852 rp='Try to use maximal 64-bit support, if available?'
5855 [yY]*) val="$define" ;;
5860 case "$use64bitall" in
5862 case "$use64bitint" in
5866 Since you have chosen a maximally 64-bit build, I'm also turning on
5867 the use of 64-bit integers.
5869 use64bitint="$define" ;;
5874 : Look for a hint-file generated 'call-back-unit'. If the
5875 : user has specified that a 64-bit perl is to be built,
5876 : we may need to set or change some other defaults.
5877 if $test -f use64bitint.cbu; then
5878 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5881 case "$use64bitint" in
5882 "$define"|true|[yY]*)
5884 4) case "$archname64" in
5885 '') archname64=64int ;;
5892 : Look for a hint-file generated 'call-back-unit'. If the
5893 : user has specified that a maximally 64-bit perl is to be built,
5894 : we may need to set or change some other defaults.
5895 if $test -f use64bitall.cbu; then
5896 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5899 case "$use64bitall" in
5900 "$define"|true|[yY]*)
5902 4) case "$archname64" in
5903 ''|64int) archname64=64all ;;
5910 case "$d_quad:$use64bitint" in
5914 *** You have chosen to use 64-bit integers,
5915 *** but none can be found.
5916 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5917 *** Cannot continue, aborting.
5924 : check for length of double
5926 case "$doublesize" in
5928 echo "Checking to see how big your double precision numbers are..." >&4
5937 printf("%d\n", (int)sizeof(double));
5942 if eval $compile_ok; then
5943 doublesize=`$run ./try`
5944 echo "Your double is $doublesize bytes long."
5947 echo "(I can't seem to compile the test program. Guessing...)"
5948 rp="What is the size of a double precision number (in bytes)?"
5956 : check for long doubles
5958 echo "Checking to see if you have long double..." >&4
5959 echo 'int main() { long double x = 7.0; }' > try.c
5961 if eval $compile; then
5963 echo "You have long double."
5966 echo "You do not have long double."
5972 : check for length of long double
5973 case "${d_longdbl}${longdblsize}" in
5976 echo "Checking to see how big your long doubles are..." >&4
5977 $cat >try.c <<'EOCP'
5981 printf("%d\n", sizeof(long double));
5986 if eval $compile; then
5987 longdblsize=`$run ./try`
5988 echo "Your long doubles are $longdblsize bytes long."
5992 echo "(I can't seem to compile the test program. Guessing...)" >&4
5993 rp="What is the size of a long double (in bytes)?"
5997 if $test "X$doublesize" = "X$longdblsize"; then
5998 echo "That isn't any different from an ordinary double."
5999 echo "I'll keep your setting anyway, but you may see some"
6000 echo "harmless compilation warnings."
6006 : determine the architecture name
6008 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6009 tarch=`arch`"-$osname"
6010 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6011 if uname -m > tmparch 2>&1 ; then
6012 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6013 -e 's/$/'"-$osname/" tmparch`
6021 case "$myarchname" in
6024 echo "(Your architecture name used to be $myarchname.)"
6028 case "$targetarch" in
6030 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6035 *) dflt="$archname";;
6037 rp='What is your architecture name'
6040 case "$usethreads" in
6042 echo "Threads selected." >&4
6044 *-thread*) echo "...and architecture name already has -thread." >&4
6046 *) archname="$archname-thread"
6047 echo "...setting architecture name to $archname." >&4
6052 case "$usemultiplicity" in
6054 echo "Multiplicity selected." >&4
6056 *-multi*) echo "...and architecture name already has -multi." >&4
6058 *) archname="$archname-multi"
6059 echo "...setting architecture name to $archname." >&4
6064 case "$use64bitint$use64bitall" in
6066 case "$archname64" in
6068 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6071 case "$use64bitint" in
6072 "$define") echo "64 bit integers selected." >&4 ;;
6074 case "$use64bitall" in
6075 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6078 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6080 *) archname="$archname-$archname64"
6081 echo "...setting architecture name to $archname." >&4
6087 case "$uselongdouble" in
6089 echo "Long doubles selected." >&4
6090 case "$longdblsize" in
6092 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6096 *-ld*) echo "...and architecture name already has -ld." >&4
6098 *) archname="$archname-ld"
6099 echo "...setting architecture name to $archname." >&4
6106 case "$useperlio" in
6108 echo "Perlio selected." >&4
6111 echo "Perlio not selected, using stdio." >&4
6113 *-stdio*) echo "...and architecture name already has -stdio." >&4
6115 *) archname="$archname-stdio"
6116 echo "...setting architecture name to $archname." >&4
6121 if $test -f archname.cbu; then
6122 echo "Your platform has some specific hints for architecture name, using them..."
6126 : set the prefixit variable, to compute a suitable default value
6127 prefixit='case "$3" in
6129 case "$oldprefix" in
6130 "") eval "$1=\"\$$2\"";;
6137 ""|" ") eval "$1=\"\$$2\"";;
6143 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6145 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6146 /*-$oldprefix/*|\~*-$oldprefix/*)
6147 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6148 *) eval "$1=\"\$$2\"";;
6152 : determine installation style
6153 : For now, try to deduce it from prefix unless it is already set.
6154 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6155 case "$installstyle" in
6156 '') case "$prefix" in
6157 *perl*) dflt='lib';;
6158 *) dflt='lib/perl5' ;;
6161 *) dflt="$installstyle" ;;
6163 : Probably not worth prompting for this since we prompt for all
6164 : the directories individually, and the prompt would be too long and
6168 : determine where public executables go
6173 rp='Pathname where the public executables will reside?'
6175 if $test "X$ansexp" != "X$binexp"; then
6179 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6180 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6181 : this via initialinstalllocation
6184 case "$userelocatableinc" in
6185 $define|true|[yY]*) dflt='y' ;;
6190 Would you like to build Perl so that the installation is relocatable, so that
6191 library paths in @INC are determined relative to the path of the perl binary?
6192 This is not advised for system Perl installs, or if you need to run setid
6193 scripts or scripts under taint mode.
6195 If this doesn't make any sense to you, just accept the default '$dflt'.
6197 rp='Use relocatable @INC?'
6200 y|Y) val="$define" ;;
6203 set userelocatableinc
6206 initialinstalllocation="$binexp"
6207 : Default prefix is now "up one level from where the binaries are"
6208 case "$userelocatableinc" in
6214 installprefixexp=".../.."
6218 : determine where private library files go
6219 : Usual default is /usr/local/lib/perl5/$version.
6220 : Also allow things like /opt/perl/lib/$version, since
6221 : /opt/perl/lib/perl5... would be redundant.
6222 : The default "style" setting is made in installstyle.U
6223 case "$installstyle" in
6224 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6225 *) set dflt privlib lib/$version ;;
6230 There are some auxiliary files for $package that need to be put into a
6231 private library directory that is accessible by everyone.
6236 rp='Pathname where the private library files will reside?'
6241 : set the prefixup variable, to restore leading tilda escape
6242 prefixup='case "$prefixexp" in
6244 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6247 : determine where public architecture dependent libraries go
6250 : privlib default is /usr/local/lib/$package/$version
6251 : archlib default is /usr/local/lib/$package/$version/$archname
6252 : privlib may have an optional trailing /share.
6253 tdflt=`echo $privlib | $sed 's,/share$,,'`
6254 tdflt=$tdflt/$archname
6263 $spackage contains architecture-dependent library files. If you are
6264 sharing libraries in a heterogeneous environment, you might store
6265 these files in a separate location. Otherwise, you can just include
6266 them with the rest of the public library files.
6271 rp='Where do you want to put the public architecture-dependent libraries?'
6275 if $test X"$archlib" = X"$privlib"; then
6281 : see if setuid scripts can be secure
6284 Some kernels have a bug that prevents setuid #! scripts from being
6285 secure. Some sites have disabled setuid #! scripts because of this.
6287 First let's decide if your kernel supports secure setuid #! scripts.
6288 (If setuid #! scripts would be secure but have been disabled anyway,
6289 don't say that they are secure if asked.)
6294 if $test -d /dev/fd; then
6295 echo "#!$ls" >reflect
6296 chmod +x,u+s reflect
6297 ./reflect >flect 2>&1
6298 if $contains "/dev/fd" flect >/dev/null; then
6299 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6303 If you are not sure if they are secure, I can check but I'll need a
6304 username and password different from the one you are using right now.
6305 If you don't have such a username or don't want me to test, simply
6309 rp='Other username to test security of setuid scripts with?'
6314 case "$d_suidsafe" in
6315 '') echo "I'll assume setuid scripts are *not* secure." >&4
6318 echo "Well, the $hint value is *not* secure." >&4
6320 *) echo "Well, the $hint value *is* secure." >&4
6325 $rm -f reflect flect
6326 echo "#!$ls" >reflect
6327 chmod +x,u+s reflect
6330 echo '"su" will (probably) prompt you for '"$ans's password."
6331 su $ans -c './reflect >flect'
6332 if $contains "/dev/fd" flect >/dev/null; then
6333 echo "Okay, it looks like setuid scripts are secure." >&4
6336 echo "I don't think setuid scripts are secure." >&4
6341 rp='Does your kernel have *secure* setuid scripts?'
6344 [yY]*) val="$define";;
6349 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6350 echo "(That's for file descriptors, not floppy disks.)"
6356 $rm -f reflect flect
6358 : now see if they want to do setuid emulation
6361 case "$d_suidsafe" in
6364 echo "No need to emulate SUID scripts since they are secure here." >&4
6368 Some systems have disabled setuid scripts, especially systems where
6369 setuid scripts cannot be secure. On systems where setuid scripts have
6370 been disabled, the setuid/setgid bits on scripts are currently
6371 useless. It is possible for $package to detect those bits and emulate
6372 setuid/setgid in a secure fashion. This emulation will only work if
6373 setuid scripts have been disabled in your kernel.
6377 "$define") dflt=y ;;
6380 rp="Do you want to do setuid/setgid emulation?"
6383 [yY]*) val="$define";;
6391 : Find perl5.005 or later.
6392 echo "Looking for a previously installed perl5.005 or later... "
6394 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6395 : Check if this perl is recent and can load a simple module
6396 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6399 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6409 '') echo "None found. That's ok.";;
6410 *) echo "Using $perl5." ;;
6413 : Set the siteprefix variables
6416 After $package is installed, you may wish to install various
6417 add-on modules and utilities. Typically, these add-ons will
6418 be installed under $prefix with the rest
6419 of this package. However, you may wish to install such add-ons
6420 elsewhere under a different prefix.
6422 If you do not wish to put everything under a single prefix, that's
6423 ok. You will be prompted for the individual locations; this siteprefix
6424 is only used to suggest the defaults.
6426 The default should be fine for most people.
6430 rp='Installation prefix to use for add-on modules and utilities?'
6431 : XXX Here might be another good place for an installstyle setting.
6432 case "$siteprefix" in
6434 *) dflt=$siteprefix ;;
6437 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6439 case "$siteprefix" in
6443 *) oldsiteprefix="$prefix";;
6448 siteprefixexp="$ansexp"
6450 : determine where site specific libraries go.
6451 : Usual default is /usr/local/lib/perl5/site_perl/$version
6452 : The default "style" setting is made in installstyle.U
6453 : XXX No longer works with Prefixit stuff.
6454 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6456 '') case "$installstyle" in
6457 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6458 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6466 The installation process will create a directory for
6467 site-specific extensions and modules. Most users find it convenient
6468 to place all site-specific files in this directory rather than in the
6469 main distribution directory.
6473 rp='Pathname for the site-specific library files?'
6477 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6479 : Determine list of previous versions to include in @INC
6480 $cat > getverlist <<EOPL
6483 \$api_versionstring = "$api_versionstring";
6484 \$version = "$version";
6485 \$stem = "$sitelib_stem";
6486 \$archname = "$archname";
6488 $cat >> getverlist <<'EOPL'
6489 # The list found is store twice for each entry: the original name, and
6490 # the binary broken down version as pack "sss", so sorting is easy and
6491 # unambiguous. This will work for all versions that have a maximum of
6492 # three digit groups, separate by '.'s or '_'s. Names are extended with
6493 # ".0.0" to ensure at least three elements for the pack.
6494 # -- H.Merijn Brand (m)'06 23-10-2006
6496 # Can't have leading @ because metaconfig interprets it as a command!
6497 ;@inc_version_list=();
6498 # XXX Redo to do opendir/readdir?
6501 ;@candidates = map {
6502 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6508 ($pversion, $aversion, $vsn5005) = map {
6509 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6510 foreach $d (@candidates) {
6511 if ($d->[1] lt $pversion) {
6512 if ($d->[1] ge $aversion) {
6513 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6515 elsif ($d->[1] ge $vsn5005) {
6516 unshift(@inc_version_list, grep { -d } $d->[0]);
6520 # Skip newer version. I.e. don't look in
6521 # 5.7.0 if we're installing 5.6.1.
6525 if (@inc_version_list) {
6526 print join(' ', @inc_version_list);
6529 # Blank space to preserve value for next Configure run.
6534 case "$inc_version_list" in
6535 '') if test -x "$perl5$exe_ext"; then
6536 dflt=`$perl5 getverlist`
6541 $undef) dflt='none' ;;
6542 *) eval dflt=\"$inc_version_list\" ;;
6545 ''|' ') dflt=none ;;
6552 In order to ease the process of upgrading, this version of perl
6553 can be configured to use modules built and installed with earlier
6554 versions of perl that were installed under $prefix. Specify here
6555 the list of earlier versions that this version of perl should check.
6556 If Configure detected no earlier versions of perl installed under
6557 $prefix, then the list will be empty. Answer 'none' to tell perl
6558 to not search earlier versions.
6560 The default should almost always be sensible, so if you're not sure,
6561 just accept the default.
6564 rp='List of earlier versions to include in @INC?'
6567 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6568 *) inc_version_list="$ans" ;;
6570 case "$inc_version_list" in
6572 inc_version_list_init='0'
6573 d_inc_version_list="$undef"
6575 *) inc_version_list_init=`echo $inc_version_list |
6576 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6577 d_inc_version_list="$define"
6582 : see if malloc/malloc.h has to be included
6583 set malloc/malloc.h i_mallocmalloc
6586 : see if this is a malloc.h system
6587 : we want a real compile instead of Inhdr because some systems have a
6588 : malloc.h that just gives a compile error saying to use stdlib.h instead
6593 #$i_mallocmalloc I_MALLOCMALLOC
6594 #ifdef I_MALLOCMALLOC
6595 # include <malloc/malloc.h>
6598 int main () { return 0; }
6601 if eval $compile; then
6602 echo "<malloc.h> found." >&4
6605 echo "<malloc.h> NOT found." >&4
6612 : check for void type
6614 echo "Checking to see how well your C compiler groks the void type..." >&4
6615 case "$voidflags" in
6627 extern void moo(); /* function returning void */
6628 void (*goo)(); /* ptr to func returning void */
6630 void *hue; /* generic ptr */
6643 int main() { sub(); }
6645 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6646 voidflags=$defvoidused
6647 echo "Good. It appears to support void to the level $package wants.">&4
6648 if $contains warning .out >/dev/null 2>&1; then
6649 echo "However, you might get some warnings that look like this:"
6653 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6654 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6655 echo "It supports 1..."
6656 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6657 echo "It also supports 2..."
6658 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6660 echo "And it supports 4 but not 8 definitely."
6662 echo "It doesn't support 4..."
6663 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6665 echo "But it supports 8."
6668 echo "Neither does it support 8."
6672 echo "It does not support 2..."
6673 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6675 echo "But it supports 4 and 8."
6677 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6679 echo "And it supports 4 but has not heard about 8."
6681 echo "However it supports 8 but not 4."
6686 echo "There is no support at all for void."
6691 case "$voidflags" in
6694 Support flag bits are:
6695 1: basic void declarations.
6696 2: arrays of pointers to functions returning void.
6697 4: operations between pointers to and addresses of void functions.
6698 8: generic void pointers.
6701 rp="Your void support flags add up to what?"
6708 : check for length of pointer
6712 echo "Checking to see how big your pointers are..." >&4
6713 if test "$voidflags" -gt 7; then
6714 echo '#define VOID_PTR char *' > try.c
6716 echo '#define VOID_PTR void *' > try.c
6726 printf("%d\n", (int)sizeof(VOID_PTR));
6731 if eval $compile_ok; then
6732 ptrsize=`$run ./try`
6733 echo "Your pointers are $ptrsize bytes long."
6736 echo "(I can't seem to compile the test program. Guessing...)" >&4
6737 rp="What is the size of a pointer (in bytes)?"
6744 case "$use64bitall" in
6745 "$define"|true|[yY]*)
6749 *** You have chosen a maximally 64-bit build,
6750 *** but your pointers are only 4 bytes wide.
6751 *** Please rerun Configure without -Duse64bitall.
6756 *** Since you have quads, you could possibly try with -Duse64bitint.
6761 *** Cannot continue, aborting.
6772 : determine whether to use malloc wrapping
6774 case "$usemallocwrap" in
6775 [yY]*|true|$define) dflt='y' ;;
6776 [nN]*|false|$undef) dflt='n' ;;
6777 *) case "$usedevel" in
6778 [yY]*|true|$define) dflt='y' ;;
6783 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6785 usemallocwrap="$ans"
6788 usemallocwrap="$define" ;;
6790 usemallocwrap="$undef" ;;
6793 : determine which malloc to compile in
6795 case "$usemymalloc" in
6796 [yY]*|true|$define) dflt='y' ;;
6797 [nN]*|false|$undef) dflt='n' ;;
6798 *) case "$ptrsize" in
6804 rp="Do you wish to attempt to use the malloc that comes with $package?"
6810 mallocsrc='malloc.c'
6811 mallocobj="malloc$_o"
6812 d_mymalloc="$define"
6815 : Remove malloc from list of libraries to use
6816 echo "Removing unneeded -lmalloc from library list" >&4
6817 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6820 echo "libs = $libs" >&4
6832 : compute the return types of malloc and free
6834 $cat >malloc.c <<END
6838 #include <sys/types.h>
6852 case "$malloctype" in
6854 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6861 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6865 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6872 echo "Your system uses $freetype free(), it would seem." >&4
6874 : determine where site specific architecture-dependent libraries go.
6875 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6876 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6877 : sitelib may have an optional trailing /share.
6879 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6880 dflt="$dflt/$archname"
6885 set sitearch sitearch none
6889 The installation process will also create a directory for
6890 architecture-dependent site-specific extensions and modules.
6894 rp='Pathname for the site-specific architecture-dependent library files?'
6898 if $test X"$sitearch" = X"$sitelib"; then
6901 d_sitearch="$define"
6904 : Set the vendorprefix variables
6907 The installation process will also create a directory for
6908 vendor-supplied add-ons. Vendors who supply perl with their system
6909 may find it convenient to place all vendor-supplied files in this
6910 directory rather than in the main distribution directory. This will
6911 ease upgrades between binary-compatible maintenance versions of perl.
6913 Of course you may also use these directories in whatever way you see
6914 fit. For example, you might use them to access modules shared over a
6915 company-wide network.
6917 The default answer should be fine for most people.
6918 This causes further questions about vendor add-ons to be skipped
6919 and no vendor-specific directories will be configured for perl.
6922 rp='Do you want to configure vendor-specific add-on directories?'
6923 case "$usevendorprefix" in
6924 define|true|[yY]*) dflt=y ;;
6925 *) : User may have set vendorprefix directly on Configure command line.
6926 case "$vendorprefix" in
6935 rp='Installation prefix to use for vendor-supplied add-ons?'
6936 case "$vendorprefix" in
6938 *) dflt=$vendorprefix ;;
6941 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6943 case "$vendorprefix" in
6947 *) oldvendorprefix="$prefix";;
6951 usevendorprefix="$define"
6953 vendorprefixexp="$ansexp"
6955 *) usevendorprefix="$undef"
6961 : Set the vendorlib variables
6962 case "$vendorprefix" in
6963 '') d_vendorlib="$undef"
6967 *) d_vendorlib="$define"
6968 : determine where vendor-supplied modules go.
6969 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6970 case "$vendorlib" in
6972 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6973 case "$installstyle" in
6974 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6975 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6978 *) dflt="$vendorlib"
6982 rp='Pathname for the vendor-supplied library files?'
6985 vendorlibexp="$ansexp"
6988 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6992 : Set the vendorarch variables
6993 case "$vendorprefix" in
6994 '') d_vendorarch="$undef"
6998 *) d_vendorarch="$define"
6999 : determine where vendor-supplied architecture-dependent libraries go.
7000 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7001 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7002 : vendorlib may have an optional trailing /share.
7003 case "$vendorarch" in
7004 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7005 dflt="$dflt/$archname"
7007 *) dflt="$vendorarch" ;;
7010 rp='Pathname for vendor-supplied architecture-dependent files?'
7013 vendorarchexp="$ansexp"
7016 prefixvar=vendorarch
7019 : Final catch-all directories to search
7022 Lastly, you can have perl look in other directories for extensions and
7023 modules in addition to those already specified.
7024 These directories will be searched after
7028 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7029 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7031 case "$otherlibdirs" in
7032 ''|' ') dflt='none' ;;
7033 *) dflt="$otherlibdirs" ;;
7036 Enter a colon-separated set of extra paths to include in perl's @INC
7037 search path, or enter 'none' for no extra paths.
7041 rp='Colon-separated list of additional directories for perl to search?'
7044 ' '|''|none) otherlibdirs=' ' ;;
7045 *) otherlibdirs="$ans" ;;
7047 case "$otherlibdirs" in
7051 set d_perl_otherlibdirs
7054 : Cruising for prototypes
7056 echo "Checking out function prototypes..." >&4
7057 $cat >prototype.c <<EOCP
7062 int main(int argc, char *argv[]) {
7065 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7066 echo "Your C compiler appears to support function prototypes."
7069 echo "Your C compiler doesn't seem to understand function prototypes."
7076 : Check if ansi2knr is required
7077 case "$prototype" in
7079 *) ansi2knr='ansi2knr'
7084 This version of $package can only be compiled by a compiler that
7085 understands function prototypes. Unfortunately, your C compiler
7087 doesn't seem to understand them. Sorry about that.
7089 If GNU cc is available for your system, perhaps you could try that instead.
7091 Eventually, we hope to support building Perl with pre-ANSI compilers.
7092 If you would like to help in that effort, please contact <perlbug@perl.org>.
7094 Aborting Configure now.
7101 dflt_dtrace='/usr/sbin/dtrace'
7104 Perl can be built to support DTrace on platforms that support it.
7105 DTrace is a diagnosis and performance analysis tool from Sun.
7107 If this doesn't make any sense to you, just accept the default '$dflt'.
7111 case "$usedtrace" in
7117 dflt_dtrace=$usedtrace
7124 rp='Support DTrace if available?'
7127 y|Y) val="$define" ;;
7133 test "X$usedtrace" != "X$define" && break
7136 rp='Where is the dtrace executable?'
7145 if $dtrace -h -s ../perldtrace.d \
7146 -o perldtrace.tmp >/dev/null 2>&1 \
7147 && rm -f perldtrace.tmp
7150 echo "Good: your $dtrace knows about the -h flag."
7154 *** $me: Fatal Error: $dtrace doesn't support -h flag
7156 *** Your installed dtrace doesn't support the -h switch to compile a D
7157 *** program into a C header. Can't continue.
7169 *** $me: Fatal Error: $dtrace not found.
7176 echo "*** $dtrace was not found."
7182 : See if we want extra modules installed
7189 Perl can be built with extra modules or bundles of modules which
7190 will be fetched from the CPAN and installed alongside Perl.
7192 Notice that you will need access to the CPAN; either via the Internet,
7193 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7194 be asked later to configure the CPAN.pm module which will in turn do
7195 the installation of the rest of the extra modules or bundles.)
7197 Notice also that if the modules require any external software such as
7198 libraries and headers (the libz library and the zlib.h header for the
7199 Compress::Zlib module, for example) you MUST have any such software
7200 already installed, this configuration process will NOT install such
7203 If this doesn't make any sense to you, just accept the default '$dflt'.
7205 rp='Install any extra modules (y or n)?'
7211 Please list any extra modules or bundles to be installed from CPAN,
7212 with spaces between the names. The names can be in any format the
7213 'install' command of CPAN.pm will understand. (Answer 'none',
7214 without the quotes, to install no extra modules or bundles.)
7224 $rm -f ../extras.lst
7226 *) echo "(Saving the list of extras for later...)"
7227 echo "$extras" > ../extras.lst
7235 : determine where html pages for programs go
7236 set html1dir html1dir none
7240 If you wish to install html files for programs in $spackage, indicate
7241 the appropriate directory here. To skip installing html files,
7245 ''|none|$undef|' ') dflt=none ;;
7246 *) dflt=$html1dir ;;
7249 rp="Directory for the main $spackage html pages?"
7253 : Use ' ' for none so value is preserved next time through Configure
7254 $test X"$html1dir" = "X" && html1dir=' '
7256 : determine where html pages for libraries and modules go
7257 set html3dir html3dir none
7261 If you wish to install html files for modules associated with $spackage,
7262 indicate the appropriate directory here. To skip installing html files,
7265 : There is no obvious default. If they have specified html1dir, then
7266 : try to key off that, possibly changing .../html1 into .../html3.
7268 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7269 *) dflt=$html3dir ;;
7272 rp="Directory for the $spackage module html pages?"
7276 : Use ' ' for none so value is preserved next time through Configure
7277 $test X"$html3dir" = "X" && html3dir=' '
7279 : determine whether to install perl also as /usr/bin/perl
7282 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7284 Many scripts expect perl to be installed as /usr/bin/perl.
7286 If you want to, I can install the perl you are about to compile
7287 as /usr/bin/perl (in addition to $bin/perl).
7289 if test -f /usr/bin/perl; then
7292 However, please note that because you already have a /usr/bin/perl,
7293 overwriting that with a new Perl would very probably cause problems.
7294 Therefore I'm assuming you don't want to do that (unless you insist).
7297 case "$installusrbinperl" in
7298 "$define"|[yY]*) dflt='y';;
7304 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7307 case "$installusrbinperl" in
7308 "$undef"|[nN]*) dflt='n';;
7312 rp="Do you want to install perl as /usr/bin/perl?"
7315 [yY]*) val="$define";;
7321 set installusrbinperl
7324 : Check if we are using the GNU C library
7326 echo "Checking for GNU C Library..." >&4
7328 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7329 alone are insufficient to distinguish different versions, such as
7330 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7331 libc version 2.1.0. A. Dougherty, June 3, 2002.
7337 # ifdef __GLIBC_MINOR__
7338 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7339 # include <gnu/libc-version.h>
7340 printf("%s\n", gnu_get_libc_version());
7342 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7345 printf("%d\n", __GLIBC__);
7354 if eval $compile_ok && $run ./try > glibc.ver; then
7356 gnulibc_version=`$cat glibc.ver`
7357 echo "You are using the GNU C Library version $gnulibc_version"
7361 echo "You are not using the GNU C Library"
7367 : see if nm is to be used to determine whether a symbol is defined or not
7371 case "$d_gnulibc" in
7374 echo "nm probably won't work on the GNU C Library." >&4
7380 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7382 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7383 echo "'nm' won't be sufficient on this sytem." >&4
7389 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7390 if $test $dflt -gt 20; then
7400 true|$define) dflt=y;;
7407 I can use $nm to extract the symbols from your C libraries. This
7408 is a time consuming task which may generate huge output on the disk (up
7409 to 3 megabytes) but that should make the symbols extraction faster. The
7410 alternative is to skip the 'nm' extraction part and to compile a small
7411 test program instead to determine whether each symbol is present. If
7412 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7413 this may be the best solution.
7415 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7418 rp="Shall I use $nm to extract C symbols from the libraries?"
7421 [Nn]*) usenm=false;;
7430 : nm options which may be necessary
7432 '') if $test -f /mach_boot; then
7434 elif $test -d /usr/ccs/lib; then
7435 nm_opt='-p' # Solaris (and SunOS?)
7436 elif $test -f /dgux; then
7438 elif $test -f /lib64/rld; then
7439 nm_opt='-p' # 64-bit Irix
7445 : nm options which may be necessary for shared libraries but illegal
7446 : for archive libraries. Thank you, Linux.
7447 case "$nm_so_opt" in
7448 '') case "$myuname" in
7450 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7451 nm_so_opt='--dynamic'
7458 : Figure out where the libc is located
7461 : get list of predefined functions in a handy place
7466 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7472 *) for thislib in $libs; do
7475 : Handle C library specially below.
7478 thislib=`echo $thislib | $sed -e 's/^-l//'`
7479 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7481 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7483 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7485 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7487 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7489 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7491 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7496 libnames="$libnames $try"
7498 *) libnames="$libnames $thislib" ;;
7507 for xxx in $libpth; do
7508 $test -r $1 || set $xxx/libc.$so
7509 : The messy sed command sorts on library version numbers.
7511 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7512 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7514 s/[0-9][0-9]*/0000&/g
7515 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7518 $sort | $sed -e 's/^.* //'`
7521 $test -r $1 || set /usr/ccs/lib/libc.$so
7522 $test -r $1 || set /lib/libsys_s$_a
7528 if $test -r "$1"; then
7529 echo "Your (shared) C library seems to be in $1."
7531 elif $test -r /lib/libc && $test -r /lib/clib; then
7532 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7534 libc='/lib/clib /lib/libc'
7535 if $test -r /lib/syslib; then
7536 echo "(Your math library is in /lib/syslib.)"
7537 libc="$libc /lib/syslib"
7539 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7540 echo "Your C library seems to be in $libc, as you said before."
7541 elif $test -r $incpath/usr/lib/libc$_a; then
7542 libc=$incpath/usr/lib/libc$_a;
7543 echo "Your C library seems to be in $libc. That's fine."
7544 elif $test -r /lib/libc$_a; then
7546 echo "Your C library seems to be in $libc. You're normal."
7548 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7550 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7551 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7552 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7554 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7556 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7559 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7561 if $test -r "$tans"; then
7562 echo "Your C library seems to be in $tans, of all places."
7568 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7572 If the guess above is wrong (which it might be if you're using a strange
7573 compiler, or your machine supports multiple models), you can override it here.
7578 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7580 I can't seem to find your C library. I've looked in the following places:
7583 $sed 's/^/ /' libpath
7586 None of these seems to contain your C library. I need to get its name...
7591 rp='Where is your C library?'
7596 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7597 set X `cat libnames`
7600 case $# in 1) xxx=file; esac
7601 echo "Extracting names from the following $xxx for later perusal:" >&4
7603 $sed 's/^/ /' libnames >&4
7605 $echo $n "This may take a while...$c" >&4
7609 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7610 *) $nm $nm_opt $file 2>/dev/null;;
7615 $grep fprintf libc.tmp > libc.ptf
7616 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7617 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7619 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7623 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7627 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7631 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7635 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7637 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7639 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7641 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7643 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7644 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7648 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7652 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7656 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7660 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7668 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7670 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7672 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7674 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7677 $nm -p $* 2>/dev/null >libc.tmp
7678 $grep fprintf libc.tmp > libc.ptf
7679 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7680 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7686 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7688 if $ar t $libc > libc.tmp && \
7689 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7691 for thisname in $libnames $libc; do
7692 $ar t $thisname >>libc.tmp
7694 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7696 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7697 for thisname in $libnames $libc; do
7698 $ar tv $thisname >>libc.tmp
7699 emximp -o tmp.imp $thisname \
7701 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7702 < tmp.imp >>libc.tmp
7705 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7708 echo "$ar didn't seem to work right." >&4
7709 echo "Maybe this is a Cray...trying bld instead..." >&4
7711 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7714 for thisname in $libnames; do
7716 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7717 $ar t $thisname >>libc.tmp
7721 echo "That didn't work either. Giving up." >&4
7731 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7732 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7734 *) if $test -f /lib/syscalls.exp; then
7736 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7737 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7738 /lib/syscalls.exp >>libc.list
7744 $rm -f libnames libpath
7746 : see if dld is available
7750 : Check if we are using C++
7752 echo "Checking for C++..." >&4
7753 $cat >try.c <<'EOCP'
7765 if eval $compile_ok && $run ./try; then
7767 echo "You are using a C++ compiler."
7770 echo "You are not using a C++ compiler."
7776 : is a C symbol defined?
7779 -v) tf=libc.tmp; tdc="";;
7780 -a) tf=libc.tmp; tdc="[]";;
7781 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7784 case "$reuseval-$4" in
7786 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7791 case "$d_cplusplus" in
7792 $define) extern_C=\"C\";;
7794 if $test "$runnm" = true; then
7795 if $contains $tlook $tf >/dev/null 2>&1; then
7797 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7798 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7799 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7800 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7804 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7805 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7811 $define) tval=true;;
7818 : define an is-in-libc? function
7819 inlibc='echo " "; td=$define; tu=$undef;
7820 sym=$1; var=$2; eval "was=\$$2";
7822 case "$reuseval$was" in
7832 echo "$sym() found." >&4;
7833 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7835 echo "$sym() NOT found." >&4;
7836 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7840 $define) echo "$sym() found." >&4;;
7841 *) echo "$sym() NOT found." >&4;;
7845 : see if dlopen exists
7847 xxx_ccflags="$ccflags"
7849 : with g++ one needs -shared to get is-in-libc to work for dlopen
7850 case "$gccversion" in
7852 *) case "$d_cplusplus" in
7853 "$define") ccflags="$ccflags -shared" ;;
7860 ccflags="$xxx_ccflags"
7862 : see if this is a unistd.h system
7863 set unistd.h i_unistd
7866 : determine which dynamic loading, if any, to compile in
7868 dldir="ext/DynaLoader"
7881 $define) dflt='y' ;;
7884 $define) dflt='y' ;;
7886 : Does a dl_xxx.xs file exist for this operating system
7887 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7890 rp="Do you wish to use dynamic loading?"
7897 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7898 dflt="$dldir/dl_${osname}.xs"
7899 elif $test "$d_dlopen" = "$define" ; then
7900 dflt="$dldir/dl_dlopen.xs"
7901 elif $test "$i_dld" = "$define" ; then
7902 dflt="$dldir/dl_dld.xs"
7907 *) dflt="$dldir/$dlsrc"
7910 echo "The following dynamic loading files are available:"
7911 : Can not go over to $dldir because getfile has path hard-coded in.
7912 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7913 rp="Source file to use for dynamic loading"
7919 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7923 Some systems may require passing special flags to $cc -c to
7924 compile modules that will be used to create a shared library.
7925 To use no flags, say "none".
7928 case "$cccdlflags" in
7929 '') case "$gccversion" in
7930 '') case "$osname" in
7932 next) dflt='none' ;;
7933 irix*) dflt='-KPIC' ;;
7934 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7935 sunos) dflt='-pic' ;;
7939 *) case "$osname" in
7940 darwin) dflt='none' ;;
7941 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7946 *) dflt="$cccdlflags" ;;
7948 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7951 none) cccdlflags=' ' ;;
7952 *) cccdlflags="$ans" ;;
7957 Some systems use ld to create libraries that can be dynamically loaded,
7958 while other systems (such as those using ELF) use $cc.
7962 '') $cat >try.c <<EOM
7963 /* Test for whether ELF binaries are produced */
7975 int i = open("a.out",O_RDONLY);
7978 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7979 exit(0); /* succeed (yes, it's ELF) */
7984 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7986 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7990 echo "I'll use ld to build dynamic libraries."
7999 rp="What command should be used to create dynamic libraries?"
8005 Some systems may require passing special flags to $ld to create a
8006 library that can be dynamically loaded. If your ld flags include
8007 -L/other/path options to locate libraries outside your loader's normal
8008 search path, you may need to specify those -L options here as well. To
8009 use no flags, say "none".
8012 case "$lddlflags" in
8013 '') case "$osname" in
8014 beos) dflt='-nostart' ;;
8016 case "$gccversion" in
8017 '') dflt="$dflt +vnocompatwarnings" ;;
8020 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8021 next) dflt='none' ;;
8022 solaris) dflt='-G' ;;
8023 sunos) dflt='-assert nodefinitions' ;;
8024 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8028 *) dflt="$lddlflags" ;;
8031 : Try to guess additional flags to pick up local libraries.
8032 : Be careful not to append to a plain 'none'
8036 for thisflag in $ldflags; do
8041 *) dflt="$dflt $thisflag" ;;
8048 ''|' ') dflt='none' ;;
8052 *-fstack-protector*)
8054 *-fstack-protector*) ;; # Don't add it again
8055 *) dflt="$dflt -fstack-protector" ;;
8061 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8064 none) lddlflags=' ' ;;
8065 *) lddlflags="$ans" ;;
8070 Some systems may require passing special flags to $cc to indicate that
8071 the resulting executable will use dynamic linking. To use no flags,
8075 case "$ccdlflags" in
8076 '') case "$osname" in
8077 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8078 next|sunos) dflt='none' ;;
8082 *) dflt="$ccdlflags" ;;
8084 rp="Any special flags to pass to $cc to use dynamic linking?"
8087 none) ccdlflags=' ' ;;
8088 *) ccdlflags="$ans" ;;
8099 : Do we want a shared libperl?
8103 # No dynamic loading being used, so don't bother even to prompt.
8106 *) case "$useshrplib" in
8107 '') case "$osname" in
8108 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8110 also='Building a shared libperl is required for dynamic loading to work on your system.'
8115 also='Building a shared libperl is needed for MAB support.'
8133 The perl executable is normally obtained by linking perlmain.c with
8134 libperl${_a}, any static extensions (usually just DynaLoader), and
8135 any other libraries needed on this system (such as -lm, etc.). Since
8136 your system supports dynamic loading, it is probably possible to build
8137 a shared libperl.$so. If you will have more than one executable linked
8138 to libperl.$so, this will significantly reduce the size of each
8139 executable, but it may have a noticeable effect on performance. The
8140 default is probably sensible for your system.
8144 rp="Build a shared libperl.$so (y/n)"
8148 useshrplib='true' ;;
8149 *) useshrplib='false' ;;
8154 case "$useshrplib" in
8158 # Figure out a good name for libperl.so. Since it gets stored in
8159 # a version-specific architecture-dependent library, the version
8160 # number isn't really that important, except for making cc/ld happy.
8162 # A name such as libperl.so.10.1
8163 majmin="libperl.$so.$patchlevel.$subversion"
8164 # A name such as libperl.so.100
8165 majonly=`echo $patchlevel $subversion |
8166 $awk '{printf "%d%02d", $1, $2}'`
8167 majonly=libperl.$so.$majonly
8168 # I'd prefer to keep the os-specific stuff here to a minimum, and
8169 # rely on figuring it out from the naming of libc.
8170 case "${osname}${osvers}" in
8173 # XXX How handle the --version stuff for MAB?
8175 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8178 cygwin*) # ld links now against the dll directly
8179 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8180 majonly=`echo $patchlevel $subversion |
8181 $awk '{printf "%03d%03d", $1, $2}'`
8182 majonly=cygperl5.$majonly.$so
8185 *) # Try to guess based on whether libc has major.minor.
8187 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8188 *libc.$so.[0-9]*) dflt=$majonly ;;
8189 *) dflt=libperl.$so ;;
8199 I need to select a good name for the shared libperl. If your system uses
8200 library names with major and minor numbers, then you might want something
8201 like $majmin. Alternatively, if your system uses a single version
8202 number for shared libraries, then you might want to use $majonly.
8203 Or, your system might be quite happy with a simple libperl.$so.
8205 Since the shared libperl will get installed into a version-specific
8206 architecture-dependent directory, the version number of the shared perl
8207 library probably isn't important, so the default should be o.k.
8210 rp='What name do you want to give to the shared libperl?'
8213 echo "Ok, I'll use $libperl"
8216 libperl="libperl${_a}"
8220 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8224 WARNING: Use of the shrpdir variable for the installation location of
8225 the shared $libperl is not supported. It was never documented and
8226 will not work in this version. Let me (perlbug@perl.org)
8227 know of any problems this may cause.
8233 But your current setting of $shrpdir is
8234 the default anyway, so it's harmless.
8239 Further, your current attempted setting of $shrpdir
8240 conflicts with the value of $archlibexp/CORE
8241 that installperl will use.
8248 # How will the perl executable find the installed shared $libperl?
8249 # Add $xxx to ccdlflags.
8250 # If we can't figure out a command-line option, use $shrpenv to
8251 # set env LD_RUN_PATH. The main perl makefile uses this.
8252 shrpdir=$archlibexp/CORE
8255 if "$useshrplib"; then
8258 # We'll set it in Makefile.SH...
8263 freebsd|netbsd|openbsd|interix|dragonfly)
8264 xxx="-Wl,-R$shrpdir"
8266 bsdos|linux|irix*|dec_osf|gnu*)
8267 xxx="-Wl,-rpath,$shrpdir"
8270 # next doesn't like the default...
8273 # beos doesn't like the default, either.
8276 # hpux doesn't like the default, either.
8277 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8280 # cygwin needs only ldlibpth
8283 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8289 # Only add $xxx if it isn't already in ccdlflags.
8290 case " $ccdlflags " in
8292 *) ccdlflags="$ccdlflags $xxx"
8295 Adding $xxx to the flags
8296 passed to $ld so that the perl executable will find the
8297 installed shared $libperl.
8305 # Fix ccdlflags in AIX for building external extensions.
8306 # (For building Perl itself bare -bE:perl.exp is needed,
8307 # Makefile.SH takes care of this.)
8309 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8311 # Respect a hint or command-line value.
8313 '') shrpenv="$tmp_shrpenv" ;;
8315 case "$ldlibpthname" in
8316 '') ldlibpthname=LD_LIBRARY_PATH ;;
8317 none) ldlibpthname='' ;;
8320 : determine where manual pages are on this system
8324 syspath='/usr/share/man/man1 /usr/man/man1'
8325 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8326 syspath="$syspath /usr/man/u_man/man1"
8327 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8328 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8329 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8330 sysman=`./loc . /usr/man/man1 $syspath`
8333 if $test -d "$sysman"; then
8334 echo "System manual is in $sysman." >&4
8336 echo "Could not find manual pages in source form." >&4
8339 : determine where manual pages go
8340 set man1dir man1dir none
8344 $spackage has manual pages available in source form.
8348 echo "However, you don't have nroff, so they're probably useless to you."
8350 '') man1dir="none";;
8353 echo "If you don't want the manual sources installed, answer 'none'."
8358 lookpath="$prefixexp/share/man/man1"
8359 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8360 lookpath="$lookpath $prefixexp/man/p_man/man1"
8361 lookpath="$lookpath $prefixexp/man/u_man/man1"
8362 lookpath="$lookpath $prefixexp/man/man.1"
8364 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8365 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8375 rp="Where do the main $spackage manual pages (source) go?"
8377 if $test "X$man1direxp" != "X$ansexp"; then
8388 : What suffix to use on installed man pages
8395 rp="What suffix should be used for the main $spackage man pages?"
8397 '') case "$man1dir" in
8411 *) dflt="$man1ext";;
8418 : see if we can have long filenames
8420 first=123456789abcdef
8422 if (echo hi >$first) 2>/dev/null; then
8423 if $test -f 123456789abcde; then
8424 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8427 echo 'You can have filenames longer than 14 characters.'>&4
8432 You can't have filenames longer than 14 chars.
8433 You can't even think about them!
8439 $rm -rf 123456789abcde*
8441 : determine where library module manual pages go
8442 set man3dir man3dir none
8446 $spackage has manual pages for many of the library modules.
8452 However, you don't have nroff, so they're probably useless to you.
8455 '') man3dir="none";;
8459 case "$d_flexfnam" in
8462 However, your system can't handle the long file names like File::Basename.3.
8465 '') man3dir="none";;
8469 echo "If you don't want the manual sources installed, answer 'none'."
8470 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8472 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8473 if $test -d "$privlib/man/man3"; then
8476 WARNING: Previous versions of perl installed man3 pages into
8477 $privlib/man/man3. This version will suggest a
8478 new default of $dflt.
8482 rp='Do you wish to preserve the old behavior?(y/n)'
8485 y*) dflt="$privlib/man/man3" ;;
8490 *) dflt="$man3dir" ;;
8497 rp="Where do the $package library man pages (source) go?"
8507 : What suffix to use on installed man pages
8513 rp="What suffix should be used for the $package library man pages?"
8515 '') case "$man3dir" in
8529 *) dflt="$man3ext";;
8536 : see if we have to deal with yellow pages, now NIS.
8537 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8538 if $test -f /usr/etc/nibindd; then
8540 echo "I'm fairly confident you're on a NeXT."
8542 rp='Do you get the hosts file via NetInfo?'
8551 y*) hostcat='nidump hosts .';;
8552 *) case "$hostcat" in
8553 nidump*) hostcat='';;
8563 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8571 rp='Are you getting the hosts file via yellow pages?'
8574 y*) hostcat='ypcat hosts';;
8575 *) hostcat='cat /etc/hosts';;
8581 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8584 '') test -f /etc/group && groupcat='cat /etc/group';;
8587 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8590 : now get the host name
8592 echo "Figuring out host name..." >&4
8593 case "$myhostname" in
8595 echo 'Maybe "hostname" will work...'
8596 if tans=`sh -c hostname 2>&1` ; then
8604 if $test "$cont"; then
8606 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8607 if tans=`cat /etc/systemid 2>&1` ; then
8609 phostname='cat /etc/systemid'
8610 echo "Whadyaknow. Xenix always was a bit strange..."
8613 elif $test -r /etc/systemid; then
8614 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8617 if $test "$cont"; then
8618 echo 'No, maybe "uuname -l" will work...'
8619 if tans=`sh -c 'uuname -l' 2>&1` ; then
8621 phostname='uuname -l'
8623 echo 'Strange. Maybe "uname -n" will work...'
8624 if tans=`sh -c 'uname -n' 2>&1` ; then
8626 phostname='uname -n'
8628 echo 'Oh well, maybe I can mine it out of whoami.h...'
8629 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8630 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8631 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8633 case "$myhostname" in
8634 '') echo "Does this machine have an identity crisis or something?"
8637 echo "Well, you said $myhostname before..."
8638 phostname='echo $myhostname';;
8644 case "$myhostname" in
8645 '') myhostname=noname ;;
8647 : you do not want to know about this
8652 if $test "$myhostname" ; then
8654 rp='Your host name appears to be "'$myhostname'".'" Right?"
8662 : bad guess or no guess
8663 while $test "X$myhostname" = X ; do
8665 rp="Please type the (one word) name of your host:"
8670 : translate upper to lower if necessary
8671 case "$myhostname" in
8673 echo "(Normalizing case in your host name)"
8674 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8678 case "$myhostname" in
8680 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8681 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8682 echo "(Trimming domain name from host name--host name is now $myhostname)"
8684 *) case "$mydomain" in
8687 test "X$hostcat" = "Xypcat hosts" &&
8688 ypmatch "$myhostname" hosts 2>/dev/null |\
8689 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8692 test "X$hostcat" != "X" &&
8693 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8694 /[ ]$myhostname[ . ]/p" > hosts
8697 if $test -f hosts; then
8698 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8699 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8700 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8701 hosts | $sort | $uniq | \
8702 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8703 case `$echo X$dflt` in
8704 X*\ *) echo "(Several hosts in the database matched hostname)"
8707 X.) echo "(You do not have fully-qualified names in the hosts database)"
8711 echo "(I cannot locate a hosts database anywhere)"
8716 tans=`./loc resolv.conf X /etc /usr/etc`
8717 if $test -f "$tans"; then
8718 echo "(Attempting domain name extraction from $tans)"
8719 dflt=.`$sed -n -e 's/ / /g' \
8720 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8723 .) dflt=.`$sed -n -e 's/ / /g' \
8724 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8732 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8733 dflt=.`sh -c domainname 2>/dev/null`
8736 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8740 case "$dflt$osname" in
8741 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8742 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8746 .) echo "(Lost all hope -- silly guess then)"
8752 *) dflt="$mydomain";;
8756 rp="What is your domain name?"
8766 : translate upper to lower if necessary
8769 echo "(Normalizing case in your domain name)"
8770 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8774 : a little sanity check here
8775 case "$phostname" in
8778 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8779 $myhostname$mydomain|$myhostname) ;;
8781 case "$phostname" in
8783 echo "(That doesn't agree with your whoami.h file, by the way.)"
8786 echo "(That doesn't agree with your $phostname command, by the way.)"
8794 : determine the e-mail address of the user who is running us
8797 I need to get your e-mail address in Internet format if possible, i.e.
8798 something like user@host.domain. Please answer accurately since I have
8799 no easy means to double check it. The default value provided below
8800 is most probably close to reality but may not be valid from outside
8801 your organization...
8805 while test "$cont"; do
8807 '') dflt="$cf_by@$myhostname$mydomain";;
8808 *) dflt="$cf_email";;
8810 rp='What is your e-mail address?'
8816 rp='Address does not look like an Internet one. Use it anyway?'
8830 : Ask e-mail of administrator
8833 If you or somebody else will be maintaining perl at your site, please
8834 fill in the correct e-mail address here so that they may be contacted
8835 if necessary. Currently, the "perlbug" program included with perl
8836 will send mail to this address in addition to perlbug@perl.org. You may
8837 enter "none" for no administrator.
8840 case "$perladmin" in
8841 '') dflt="$cf_email";;
8842 *) dflt="$perladmin";;
8844 rp='Perl administrator e-mail address'
8848 : determine whether to only install version-specific parts.
8851 Do you want to install only the version-specific parts of the perl
8852 distribution? Usually you do *not* want to do this.
8854 case "$versiononly" in
8855 "$define"|[Yy]*|true) dflt='y' ;;
8858 rp="Do you want to install only the version-specific parts of perl?"
8861 [yY]*) val="$define";;
8867 case "$versiononly" in
8868 "$define") inc_version_list=''
8869 inc_version_list_init=0
8873 : figure out how to guarantee perl startup
8874 : XXX Note that this currently takes advantage of the bug that binexp ignores
8875 : the Configure -Dinstallprefix setting, which in turn means that under
8876 : relocatable @INC, initialinstalllocation is what binexp started as.
8877 case "$startperl" in
8879 case "$sharpbang" in
8883 I can use the #! construct to start perl on your system. This will
8884 make startup of perl scripts faster, but may cause problems if you
8885 want to share those scripts and perl is not in a standard place
8886 ($initialinstalllocation/perl) on all your platforms. The alternative
8887 is to force a shell by starting the script with a single ':' character.
8890 case "$versiononly" in
8891 "$define") dflt="$initialinstalllocation/perl$version";;
8892 *) dflt="$initialinstalllocation/perl";;
8894 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8897 none) startperl=": # use perl";;
8898 *) startperl="#!$ans"
8899 if $test 30 -lt `echo "$ans" | wc -c`; then
8902 WARNING: Some systems limit the #! command to 32 characters.
8903 If you experience difficulty running Perl scripts with #!, try
8904 installing Perl in a directory with a shorter pathname.
8910 *) startperl=": # use perl"
8915 echo "I'll use $startperl to start perl scripts."
8917 : figure best path for perl in scripts
8920 case "$versiononly" in
8921 "$define") perlpath="$initialinstalllocation/perl$version";;
8922 *) perlpath="$initialinstalllocation/perl";;
8924 case "$startperl" in
8929 I will use the "eval 'exec'" idiom to start Perl on your system.
8930 I can use the full path of your Perl binary for this purpose, but
8931 doing so may cause problems if you want to share those scripts and
8932 Perl is not always in a standard place ($initialinstalllocation/perl).
8935 dflt="$initialinstalllocation/perl"
8936 rp="What path shall I use in \"eval 'exec'\"?"
8943 case "$startperl" in
8945 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8948 : determine where public executable scripts go
8949 set scriptdir scriptdir
8951 case "$scriptdir" in
8954 : guess some guesses
8955 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8956 $test -d /usr/share/bin && dflt=/usr/share/bin
8957 $test -d /usr/local/script && dflt=/usr/local/script
8958 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8959 $test -d $prefixexp/script && dflt=$prefixexp/script
8963 *) dflt="$scriptdir"
8968 Some installations have a separate directory just for executable scripts so
8969 that they can mount it across multiple architectures but keep the scripts in
8970 one spot. You might, for example, have a subdirectory of /usr/share for this.
8971 Or you might just lump your scripts in with all your other executables.
8975 rp='Where do you keep publicly executable scripts?'
8977 if $test "X$ansexp" != "X$scriptdirexp"; then
8983 : A little fix up for an irregularly named variable.
8984 installscript="$installscriptdir"
8986 : determine where add-on public executables go
8988 '') dflt=$siteprefix/bin ;;
8992 rp='Pathname where the add-on public executables should be installed?'
8997 : determine where add-on 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 "$sitehtml1dir" in
9001 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9002 *) dflt=$sitehtml1dir ;;
9005 ''|' ') dflt=none ;;
9008 rp='Pathname where the site-specific html pages should be installed?'
9010 prefixvar=sitehtml1dir
9013 : determine where add-on library html pages go
9014 : There is no standard location, so try to copy the previously-selected
9015 : directory structure for the core html pages.
9016 case "$sitehtml3dir" in
9017 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9018 *) dflt=$sitehtml3dir ;;
9021 ''|' ') dflt=none ;;
9024 rp='Pathname where the site-specific library html pages should be installed?'
9026 prefixvar=sitehtml3dir
9029 : determine where add-on manual pages go
9030 case "$siteman1dir" in
9031 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9032 *) dflt=$siteman1dir ;;
9035 ''|' ') dflt=none ;;
9038 rp='Pathname where the site-specific manual pages should be installed?'
9040 prefixvar=siteman1dir
9043 : determine where add-on library man pages go
9044 case "$siteman3dir" in
9045 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9046 *) dflt=$siteman3dir ;;
9049 ''|' ') dflt=none ;;
9052 rp='Pathname where the site-specific library manual pages should be installed?'
9054 prefixvar=siteman3dir
9057 : determine where add-on public executable scripts go
9058 case "$sitescript" in
9059 '') dflt=$siteprefix/script
9060 $test -d $dflt || dflt=$sitebin ;;
9061 *) dflt="$sitescript" ;;
9064 rp='Pathname where add-on public executable scripts should be installed?'
9066 prefixvar=sitescript
9069 : Check if faststdio is requested and available
9070 case "$usefaststdio" in
9071 $define|true|[yY]*|'')
9072 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9082 Perl can be built to use 'fast stdio', which means using the stdio
9083 library but also directly manipulating the stdio buffers to enable
9084 faster I/O. Using stdio is better for backward compatibility (especially
9085 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9086 interface has been preferred instead of stdio.
9088 If this doesn't make any sense to you, just accept the default '$dflt'.
9090 rp='Use the "fast stdio" if available?'
9093 y|Y) val="$define" ;;
9100 : define an is-a-typedef? function
9101 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9103 "") inclist="sys/types.h";;
9105 eval "varval=\$$var";
9109 for inc in $inclist; do
9110 echo "#include <$inc>" >>temp.c;
9112 echo "#ifdef $type" >> temp.c;
9113 echo "printf(\"We have $type\");" >> temp.c;
9114 echo "#endif" >> temp.c;
9115 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9116 if $contains $type temp.E >/dev/null 2>&1; then
9122 *) eval "$var=\$varval";;
9125 : define an is-a-typedef? function that prompts if the type is not available.
9126 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9128 "") inclist="sys/types.h";;
9130 eval "varval=\$$var";
9134 for inc in $inclist; do
9135 echo "#include <$inc>" >>temp.c;
9137 echo "#ifdef $type" >> temp.c;
9138 echo "printf(\"We have $type\");" >> temp.c;
9139 echo "#endif" >> temp.c;
9140 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9142 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9143 if $contains $type temp.E >/dev/null 2>&1; then
9144 echo "$type found." >&4;
9147 echo "$type NOT found." >&4;
9153 *) eval "$var=\$varval";;
9156 : see what type lseek is declared as in the kernel
9157 rp="What is the type used for lseek's offset on this system?"
9158 set off_t lseektype long stdio.h sys/types.h
9162 echo "Checking to see how big your file offsets are..." >&4
9164 #include <sys/types.h>
9168 printf("%d\n", (int)sizeof($lseektype));
9173 if eval $compile_ok; then
9174 lseeksize=`$run ./try`
9175 echo "Your file offsets are $lseeksize bytes long."
9179 echo "(I can't seem to compile the test program. Guessing...)"
9180 rp="What is the size of your file offsets (in bytes)?"
9186 : see what type file positions are declared as in the library
9187 rp="What is the type for file position used by fsetpos()?"
9188 set fpos_t fpostype long stdio.h sys/types.h
9191 : Check size for Fpos_t
9194 *_t) zzz="$fpostype" ;;
9197 echo "Checking the size of $zzz..." >&4
9199 #include <sys/types.h>
9206 printf("%d\n", (int)sizeof($fpostype));
9211 if eval $compile_ok; then
9215 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9218 echo "Your $zzz is $fpossize bytes long."
9224 echo "(I can't compile the test program. Guessing...)" >&4
9225 rp="What is the size of your file positions (in bytes)?"
9230 : Check for large file support
9231 # Backward compatibility (uselfs is deprecated).
9233 "$define"|true|[yY]*)
9236 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9238 uselargefiles="$define"
9242 case "$lseeksize:$fpossize" in
9245 You can have files larger than 2 gigabytes.
9248 *) case "$uselargefiles" in
9249 "$undef"|false|[nN]*) dflt='n' ;;
9254 Perl can be built to understand large files (files larger than 2 gigabytes)
9255 on some systems. To do so, Configure can be run with -Duselargefiles.
9257 If this doesn't make any sense to you, just accept the default '$dflt'.
9259 rp='Try to understand large files, if available?'
9262 y|Y) val="$define" ;;
9269 : Look for a hint-file generated 'call-back-unit'. If the
9270 : user has specified that a large files perl is to be built,
9271 : we may need to set or change some other defaults.
9272 if $test -f uselargefiles.cbu; then
9273 echo "Your platform has some specific hints regarding large file builds, using them..."
9274 . ./uselargefiles.cbu
9276 case "$uselargefiles" in
9278 if $test -f uselargefiles.cbu; then
9280 echo "Rechecking to see how big your file offsets are..." >&4
9282 #include <sys/types.h>
9286 printf("%d\n", (int)sizeof($lseektype));
9291 if eval $compile_ok; then
9292 lseeksize=`$run ./try`
9293 $echo "Your file offsets are now $lseeksize bytes long."
9297 echo "(I can't seem to compile the test program. Guessing...)"
9298 rp="What is the size of your file offsets (in bytes)?"
9303 *_t) zzz="$fpostype" ;;
9306 $echo $n "Rechecking the size of $zzz...$c" >&4
9308 #include <sys/types.h>
9315 printf("%d\n", (int)sizeof($fpostype));
9320 if eval $compile_ok; then
9325 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9328 echo " $fpossize bytes." >&4
9334 echo "(I can't compile the test program. Guessing...)" >&4
9335 rp="What is the size of your file positions (in bytes)?"
9344 : Set the vendorbin variables
9345 case "$vendorprefix" in
9346 '') d_vendorbin="$undef"
9350 *) d_vendorbin="$define"
9351 : determine where vendor-supplied executables go.
9352 case "$vendorbin" in
9353 '') dflt=$vendorprefix/bin ;;
9354 *) dflt="$vendorbin" ;;
9357 rp='Pathname for the vendor-supplied executables directory?'
9360 vendorbinexp="$ansexp"
9366 : Set the vendorhtml1dir variables
9367 case "$vendorprefix" in
9368 '') vendorhtml1dir=''
9369 vendorhtml1direxp=''
9371 *) : determine where vendor-supplied html pages go.
9372 : There is no standard location, so try to copy the previously-selected
9373 : directory structure for the core html pages.
9374 : XXX Better default suggestions would be welcome.
9375 case "$vendorhtml1dir" in
9376 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9377 *) dflt=$vendorhtml1dir ;;
9380 ''|' ') dflt=none ;;
9383 rp='Pathname for the vendor-supplied html pages?'
9385 vendorhtml1dir="$ans"
9386 vendorhtml1direxp="$ansexp"
9389 : Use ' ' for none so value is preserved next time through Configure
9390 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9391 prefixvar=vendorhtml1dir
9394 : Set the vendorhtml3dir variables
9395 case "$vendorprefix" in
9396 '') vendorhtml3dir=''
9397 vendorhtml3direxp=''
9399 *) : determine where vendor-supplied module html pages go.
9400 : There is no standard location, so try to copy the previously-selected
9401 : directory structure for the core html pages.
9402 : XXX Better default suggestions would be welcome.
9403 case "$vendorhtml3dir" in
9404 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9405 *) dflt=$vendorhtml3dir ;;
9408 ''|' ') dflt=none ;;
9411 rp='Pathname for the vendor-supplied html pages?'
9413 vendorhtml3dir="$ans"
9414 vendorhtml3direxp="$ansexp"
9417 : Use ' ' for none so value is preserved next time through Configure
9418 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9419 prefixvar=vendorhtml3dir
9422 : Set the vendorman1dir variables
9423 case "$vendorprefix" in
9424 '') vendorman1dir=''
9427 *) : determine where vendor-supplied manual pages go.
9428 case "$vendorman1dir" in
9429 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9430 *) dflt=$vendorman1dir ;;
9433 ''|' ') dflt=none ;;
9436 rp='Pathname for the vendor-supplied manual section 1 pages?'
9438 vendorman1dir="$ans"
9439 vendorman1direxp="$ansexp"
9442 : Use ' ' for none so value is preserved next time through Configure
9443 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9444 prefixvar=vendorman1dir
9447 : Set the vendorman3dir variables
9448 case "$vendorprefix" in
9449 '') vendorman3dir=''
9452 *) : determine where vendor-supplied module manual pages go.
9453 case "$vendorman3dir" in
9454 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9455 *) dflt=$vendorman3dir ;;
9458 ''|' ') dflt=none ;;
9461 rp='Pathname for the vendor-supplied manual section 3 pages?'
9463 vendorman3dir="$ans"
9464 vendorman3direxp="$ansexp"
9467 : Use ' ' for none so value is preserved next time through Configure
9468 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9469 prefixvar=vendorman3dir
9472 : Set the vendorscript variables
9473 case "$vendorprefix" in
9474 '') d_vendorscript="$undef"
9478 *) d_vendorscript="$define"
9479 : determine where vendor-supplied scripts go.
9480 case "$vendorscript" in
9481 '') dflt=$vendorprefix/script
9482 $test -d $dflt || dflt=$vendorbin ;;
9483 *) dflt="$vendorscript" ;;
9487 The installation process will create a directory for
9488 vendor-supplied scripts.
9492 rp='Pathname for the vendor-supplied scripts directory?'
9495 vendorscriptexp="$ansexp"
9498 prefixvar=vendorscript
9501 : see if qgcvt exists
9505 : Check print/scan long double stuff
9508 if $test X"$d_longdbl" = X"$define"; then
9510 echo "Checking how to print long doubles..." >&4
9512 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9513 $cat >try.c <<'EOCP'
9514 #include <sys/types.h>
9518 printf("%.3f\n", d);
9522 if eval $compile; then
9526 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9527 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9528 echo "We will use %f."
9534 if $test X"$sPRIfldbl" = X; then
9535 $cat >try.c <<'EOCP'
9536 #include <sys/types.h>
9539 long double d = 123.456;
9540 printf("%.3Lf\n", d);
9544 if eval $compile; then
9548 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9549 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9550 echo "We will use %Lf."
9556 if $test X"$sPRIfldbl" = X; then
9557 $cat >try.c <<'EOCP'
9558 #include <sys/types.h>
9561 long double d = 123.456;
9562 printf("%.3llf\n", d);
9566 if eval $compile; then
9570 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9571 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9572 echo "We will use %llf."
9578 if $test X"$sPRIfldbl" = X; then
9579 $cat >try.c <<'EOCP'
9580 #include <sys/types.h>
9583 long double d = 123.456;
9584 printf("%.3lf\n", d);
9588 if eval $compile; then
9592 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9593 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9594 echo "We will use %lf."
9600 if $test X"$sPRIfldbl" = X; then
9601 echo "Cannot figure out how to print long doubles." >&4
9603 sSCNfldbl=$sPRIfldbl # expect consistency
9610 case "$sPRIfldbl" in
9611 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9612 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9613 d_SCNfldbl="$undef";
9615 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9616 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9617 d_SCNfldbl="$define";
9621 : Check how to convert floats to strings.
9623 if test "X$d_Gconvert" = X; then
9626 echo "Checking for an efficient way to convert floats to strings."
9628 case "$uselongdouble" in
9629 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9631 case "$d_longdbl" in
9632 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9634 case "$d_PRIgldbl" in
9635 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9639 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9640 char *myname = "gconvert";
9643 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9644 char *myname = "gcvt";
9647 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9648 char *myname = "qgcvt";
9649 #define DOUBLETYPE long double
9652 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9654 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9656 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9659 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9661 char *myname = "sprintf";
9665 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9666 #define DOUBLETYPE long double
9668 #define DOUBLETYPE double
9674 #define I_STDLIB $i_stdlib
9680 checkit(expect, got)
9684 if (strcmp(expect, got)) {
9685 printf("%s oddity: Expected %s, got %s\n",
9686 myname, expect, got);
9696 /* This must be 1st test on (which?) platform */
9697 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9698 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9699 checkit("0.1", buf);
9701 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9702 checkit("0.01", buf);
9704 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9705 checkit("0.001", buf);
9707 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9708 checkit("0.0001", buf);
9710 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9711 if (strlen(buf) > 5)
9712 checkit("9e-005", buf); /* for Microsoft ?? */
9714 checkit("9e-05", buf);
9716 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9719 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9720 checkit("1.1", buf);
9722 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9723 checkit("1.01", buf);
9725 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9726 checkit("1.001", buf);
9728 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9729 checkit("1.0001", buf);
9731 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9732 checkit("1.00001", buf);
9734 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9735 checkit("1.000001", buf);
9737 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9740 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9743 /* Some Linux gcvt's give 1.e+5 here. */
9744 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9745 checkit("100000", buf);
9747 /* Some Linux gcvt's give -1.e+5 here. */
9748 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9749 checkit("-100000", buf);
9751 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9752 checkit("123.456", buf);
9754 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9755 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9756 /* 34 should be enough to scare even long double
9757 * places into using the e notation. */
9758 if (strlen(buf) > 5)
9759 checkit("1e+034", buf); /* for Microsoft */
9761 checkit("1e+34", buf);
9763 /* For Perl, if you add additional tests here, also add them to
9764 * t/base/num.t for benefit of platforms not using Configure or
9765 * overriding d_Gconvert */
9770 : first add preferred functions to our list
9772 for xxx_convert in $gconvert_preference; do
9773 case $xxx_convert in
9774 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9775 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9778 : then add any others
9779 for xxx_convert in gconvert gcvt sprintf; do
9782 *) xxx_list="$xxx_list $xxx_convert" ;;
9786 case "$d_longdbl$uselongdouble" in
9788 : again, add prefered functions to our list first
9790 for xxx_convert in $gconvert_ld_preference; do
9791 case $xxx_convert in
9792 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9793 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9796 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9797 for xxx_convert in qgcvt sprintf $xxx_list; do
9798 case "$xxx_ld_list" in
9799 $xxx_convert*|*" $xxx_convert"*) ;;
9800 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9803 : if sprintf cannot do long doubles, move it to the end
9804 if test "$d_PRIgldbl" != "$define"; then
9805 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9807 : if no qgcvt, remove it
9808 if test "$d_qgcvt" != "$define"; then
9809 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9812 xxx_list="$xxx_ld_list"
9816 for xxx_convert in $xxx_list; do
9817 echo "Trying $xxx_convert..."
9818 $rm -f try try$_o core
9819 set try -DTRY_$xxx_convert
9820 if eval $compile; then
9821 echo "$xxx_convert() found." >&4
9823 echo "I'll use $xxx_convert to convert floats into a string." >&4
9826 echo "...But $xxx_convert didn't work as I expected."
9830 echo "$xxx_convert NOT found." >&4
9834 if test X$xxx_convert = X; then
9835 echo "*** WHOA THERE!!! ***" >&4
9836 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9840 case "$xxx_convert" in
9841 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9842 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9843 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9844 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9845 "$define$define$define")
9846 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9847 "$define$define$undef")
9848 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9849 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9857 : see if _fwalk exists
9861 : Initialize h_fcntl
9864 : Initialize h_sysfile
9867 : access call always available on UNIX
9871 : locate the flags for 'access()'
9875 $cat >access.c <<EOCP
9876 #include <sys/types.h>
9881 #include <sys/file.h>
9894 : check sys/file.h first, no particular reason here
9895 if $test `./findhdr sys/file.h` && \
9896 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9898 echo "<sys/file.h> defines the *_OK access constants." >&4
9899 elif $test `./findhdr fcntl.h` && \
9900 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9902 echo "<fcntl.h> defines the *_OK access constants." >&4
9903 elif $test `./findhdr unistd.h` && \
9904 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9905 echo "<unistd.h> defines the *_OK access constants." >&4
9907 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9913 : see if accessx exists
9914 set accessx d_accessx
9917 : see if aintl exists
9921 : see if alarm exists
9925 : see if 64bit time functions exists
9927 set ctime64 d_ctime64
9930 set localtime64 d_localtime64
9933 set gmtime64 d_gmtime64
9936 set mktime64 d_mktime64
9939 set difftime64 d_difftime64
9942 set asctime64 d_asctime64
9945 : see if POSIX threads are available
9946 set pthread.h i_pthread
9949 : define a fucntion to check prototypes
9950 $cat > protochk <<EOSH
9953 optimize="$optimize"
9955 prototype="$prototype"
9958 usethreads=$usethreads
9959 i_pthread=$i_pthread
9960 pthread_h_first=$pthread_h_first
9963 $cat >> protochk <<'EOSH'
9968 while test $# -ge 2; do
9970 $define) echo "#include <$2>" >> try.c ;;
9971 literal) echo "$2" >> try.c ;;
9973 # Extra magic for the benefit of systems that need pthread.h
9974 # to be included early to correctly detect threadsafe functions.
9975 # Such functions must guarantee themselves, though, that the usethreads
9976 # and i_pthread have been defined, before calling protochk.
9977 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9978 echo "#include <pthread.h>" >> try.c
9983 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9984 cat >> try.c <<'EOCP'
9985 #ifdef CAN_PROTOTYPE
9986 #define _(args) args
9991 echo "$foo" >> try.c
9992 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9993 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10001 : Define hasproto macro for Configure internal use
10002 hasproto='varname=$1; func=$2; shift; shift;
10003 while $test $# -ge 2; do
10005 $define) echo "#include <$2>";;
10009 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10010 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10011 echo "$func() prototype found.";
10014 echo "$func() prototype NOT found.";
10021 : see if sys/types.h has to be included
10022 set sys/types.h i_systypes
10025 : see if sys/select.h has to be included
10026 set sys/select.h i_sysselct
10029 : Define hasfield macro for Configure internal use
10030 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10031 while $test $# -ge 2; do
10033 $define) echo "#include <$2>";;
10037 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10039 if eval $compile; then
10048 : see if we should include time.h, sys/time.h, or both
10050 if test "X$timeincl" = X; then
10051 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10052 $echo $n "I'm now running the test program...$c"
10054 #include <sys/types.h>
10059 #ifdef SYSTIMEKERNEL
10062 #include <sys/time.h>
10065 #include <sys/select.h>
10067 #$i_stdlib I_STDLIB
10069 #include <stdlib.h>
10075 struct timeval bar;
10078 struct timezone tzp;
10080 if (foo.tm_sec == foo.tm_sec)
10083 if (bar.tv_sec == bar.tv_sec)
10090 for s_timezone in '-DS_TIMEZONE' ''; do
10092 for s_timeval in '-DS_TIMEVAL' ''; do
10093 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10094 for i_time in '' '-DI_TIME'; do
10095 for i_systime in '-DI_SYSTIME' ''; do
10098 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10099 if eval $compile; then
10100 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10104 $echo $n "Succeeded with $flags$c"
10116 *SYSTIMEKERNEL*) i_systimek="$define"
10117 timeincl=`./findhdr sys/time.h`
10118 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10119 *) i_systimek="$undef";;
10122 *I_TIME*) i_time="$define"
10123 timeincl=`./findhdr time.h`" $timeincl"
10124 echo "We'll include <time.h>." >&4;;
10125 *) i_time="$undef";;
10128 *I_SYSTIME*) i_systime="$define"
10129 timeincl=`./findhdr sys/time.h`" $timeincl"
10130 echo "We'll include <sys/time.h>." >&4;;
10131 *) i_systime="$undef";;
10135 : see if struct tm knows about tm_zone
10136 case "$i_systime$i_time" in
10139 echo "Checking to see if your struct tm has tm_zone field..." >&4
10140 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10148 case "$d_tm_tm_zone" in
10149 "$define") echo "Yes, it does." ;;
10150 *) echo "No, it doesn't." ;;
10152 : see if struct tm knows about tm_gmtoff
10153 case "$i_systime$i_time" in
10156 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10157 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10165 case "$d_tm_tm_gmtoff" in
10166 "$define") echo "Yes, it does." ;;
10167 *) echo "No, it doesn't." ;;
10170 : see if asctime_r exists
10171 set asctime_r d_asctime_r
10173 case "$d_asctime_r" in
10175 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10176 case "$d_asctime_r_proto:$usethreads" in
10177 ":define") d_asctime_r_proto=define
10178 set d_asctime_r_proto asctime_r $hdrs
10182 case "$d_asctime_r_proto" in
10184 case "$asctime_r_proto" in
10185 ''|0) try='char* asctime_r(const struct tm*, char*);'
10186 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10188 case "$asctime_r_proto" in
10189 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10190 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10192 case "$asctime_r_proto" in
10193 ''|0) try='int asctime_r(const struct tm*, char*);'
10194 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10196 case "$asctime_r_proto" in
10197 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10198 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10200 case "$asctime_r_proto" in
10201 ''|0) d_asctime_r=undef
10203 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10204 * ) case "$asctime_r_proto" in
10205 REENTRANT_PROTO*) ;;
10206 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10208 echo "Prototype: $try" ;;
10211 *) case "$usethreads" in
10212 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10219 *) asctime_r_proto=0
10223 : see if atolf exists
10227 : see if atoll exists
10231 : Look for GCC-style attribute format
10232 case "$d_attribute_format" in
10235 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10236 $cat >attrib.c <<'EOCP'
10238 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10240 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10241 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10242 echo "Your C compiler doesn't support __attribute__((format))."
10245 echo "Your C compiler supports __attribute__((format))."
10249 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10253 *) val="$d_attribute_format" ;;
10255 set d_attribute_format
10259 : Look for GCC-style attribute format with null format allowed
10260 case "$d_printf_format_null" in
10261 '') case "$d_attribute_format" in
10264 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10265 $cat >attrib.c <<EOCP
10267 #$i_stdlib I_STDLIB
10269 #include <stdlib.h>
10271 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10272 int null_printf (char* pat,...) { return (int)pat; }
10273 int main () { exit(null_printf(NULL)); }
10275 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10276 : run the executable in case it produces a run-time warning
10277 if $run ./attrib >>attrib.out 2>&1; then
10278 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10279 echo "Your C compiler doesn't allow __printf__ format to be null."
10282 echo "Your C compiler allows __printf__ format to be null."
10286 echo "Your C compiler executable failed with __printf__ format null."
10290 echo "Your C compiler fails with __printf__ format null."
10297 *) val="$d_printf_format_null" ;;
10299 set d_printf_format_null
10303 : Look for GCC-style attribute malloc
10304 case "$d_attribute_malloc" in
10307 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10308 $cat >attrib.c <<'EOCP'
10310 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10312 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10313 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10314 echo "Your C compiler doesn't support __attribute__((malloc))."
10317 echo "Your C compiler supports __attribute__((malloc))."
10321 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10325 *) val="$d_attribute_malloc" ;;
10327 set d_attribute_malloc
10331 : Look for GCC-style attribute nonnull
10332 case "$d_attribute_nonnull" in
10335 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10336 $cat >attrib.c <<'EOCP'
10338 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10340 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10341 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10342 echo "Your C compiler doesn't support __attribute__((nonnull))."
10345 echo "Your C compiler supports __attribute__((nonnull))."
10349 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10353 *) val="$d_attribute_nonnull" ;;
10355 set d_attribute_nonnull
10359 : Look for GCC-style attribute noreturn
10360 case "$d_attribute_noreturn" in
10363 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10364 $cat >attrib.c <<'EOCP'
10366 void fall_over_dead( void ) __attribute__((noreturn));
10368 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10369 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10370 echo "Your C compiler doesn't support __attribute__((noreturn))."
10373 echo "Your C compiler supports __attribute__((noreturn))."
10377 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10381 *) val="$d_attribute_noreturn" ;;
10383 set d_attribute_noreturn
10387 : Look for GCC-style attribute pure
10388 case "$d_attribute_pure" in
10391 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10392 $cat >attrib.c <<'EOCP'
10394 int square( int n ) __attribute__((pure));
10396 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10397 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10398 echo "Your C compiler doesn't support __attribute__((pure))."
10401 echo "Your C compiler supports __attribute__((pure))."
10405 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10409 *) val="$d_attribute_pure" ;;
10411 set d_attribute_pure
10415 : Look for GCC-style attribute unused
10416 case "$d_attribute_unused" in
10419 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10420 $cat >attrib.c <<'EOCP'
10422 int do_something( int dummy __attribute__((unused)), int n );
10424 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10425 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10426 echo "Your C compiler doesn't support __attribute__((unused))."
10429 echo "Your C compiler supports __attribute__((unused))."
10433 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10437 *) val="$d_attribute_unused" ;;
10439 set d_attribute_unused
10443 : Look for GCC-style attribute warn_unused_result
10444 case "$d_attribute_warn_unused_result" in
10447 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10448 $cat >attrib.c <<'EOCP'
10450 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10452 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10453 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10454 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10457 echo "Your C compiler supports __attribute__((warn_unused_result))."
10461 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10465 *) val="$d_attribute_warn_unused_result" ;;
10467 set d_attribute_warn_unused_result
10471 : see if bcmp exists
10475 : see if bcopy exists
10479 : see if getpgrp exists
10480 set getpgrp d_getpgrp
10483 case "$d_getpgrp" in
10486 echo "Checking to see which flavor of getpgrp is in use..."
10488 #$i_unistd I_UNISTD
10489 #include <sys/types.h>
10491 # include <unistd.h>
10493 #$i_stdlib I_STDLIB
10495 #include <stdlib.h>
10499 if (getuid() == 0) {
10500 printf("(I see you are running Configure as super-user...)\n");
10503 #ifdef TRY_BSD_PGRP
10504 if (getpgrp(1) == 0)
10513 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10514 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10516 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10517 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10520 echo "I can't seem to compile and run the test program."
10522 xxx="a USG one, i.e. you use getpgrp()."
10524 # SVR4 systems can appear rather BSD-ish.
10525 case "$i_unistd" in
10527 xxx="a BSD one, i.e. you use getpgrp(pid)."
10531 xxx="probably a USG one, i.e. you use getpgrp()."
10536 echo "Assuming your getpgrp is $xxx" >&4
10545 : see if setpgrp exists
10546 set setpgrp d_setpgrp
10549 case "$d_setpgrp" in
10552 echo "Checking to see which flavor of setpgrp is in use..."
10554 #$i_unistd I_UNISTD
10555 #include <sys/types.h>
10557 # include <unistd.h>
10559 #$i_stdlib I_STDLIB
10561 #include <stdlib.h>
10565 if (getuid() == 0) {
10566 printf("(I see you are running Configure as super-user...)\n");
10569 #ifdef TRY_BSD_PGRP
10570 if (-1 == setpgrp(1, 1))
10573 if (setpgrp() != -1)
10579 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10580 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10582 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10583 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10586 echo "(I can't seem to compile and run the test program.)"
10588 xxx="a USG one, i.e. you use setpgrp()."
10590 # SVR4 systems can appear rather BSD-ish.
10591 case "$i_unistd" in
10593 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10597 xxx="probably a USG one, i.e. you use setpgrp()."
10602 echo "Assuming your setpgrp is $xxx" >&4
10611 : Look for GCC-style __builtin_choose_expr
10612 case "$d_builtin_choose_expr" in
10615 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10616 $cat >try.c <<'EOCP'
10617 #include <assert.h>
10618 #include <stdlib.h>
10621 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10624 assert( SYRINX(1) == 2112 );
10625 assert( SYRINX(1) != 5150 );
10626 assert( SYRINX(0) == 5150 );
10627 assert( SYRINX(0) != 2112 );
10628 puts( "All good!" );
10634 if eval $compile && $run ./try; then
10635 echo "Your C compiler supports __builtin_choose_expr."
10638 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10642 *) val="$d_builtin_choose_expr" ;;
10645 set d_builtin_choose_expr
10649 : Look for GCC-style __builtin_expect
10650 case "$d_builtin_expect" in
10653 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10654 $cat >try.c <<'EOCP'
10657 if ( __builtin_expect(n, 0) ) n = 1;
10658 /* Remember shell exit code truth is 0, C truth is non-zero */
10663 if eval $compile && $run ./try; then
10664 echo "Your C compiler supports __builtin_expect."
10667 echo "Your C compiler doesn't seem to understand __builtin_expect."
10671 *) val="$d_builtin_expect" ;;
10674 set d_builtin_expect
10678 : see if bzero exists
10682 : see if stdarg is available
10684 if $test `./findhdr stdarg.h`; then
10685 echo "<stdarg.h> found." >&4
10688 echo "<stdarg.h> NOT found." >&4
10692 : see if varags is available
10694 if $test `./findhdr varargs.h`; then
10695 echo "<varargs.h> found." >&4
10697 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10700 : set up the varargs testing programs
10701 $cat > varargs.c <<EOP
10703 #include <stdarg.h>
10706 #include <varargs.h>
10710 int f(char *p, ...)
10724 p = va_arg(ap, char *);
10730 $cat > varargs <<EOP
10732 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10741 : now check which varargs header should be included
10746 if `./varargs I_STDARG`; then
10748 elif `./varargs I_VARARGS`; then
10753 if `./varargs I_VARARGS`; then
10760 echo "I could not find the definition for va_dcl... You have problems..." >&4
10761 val="$undef"; set i_stdarg; eval $setvar
10762 val="$undef"; set i_varargs; eval $setvar
10767 case "$i_varhdr" in
10769 val="$define"; set i_stdarg; eval $setvar
10770 val="$undef"; set i_varargs; eval $setvar
10773 val="$undef"; set i_stdarg; eval $setvar
10774 val="$define"; set i_varargs; eval $setvar
10777 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10781 : see if the Compiler supports C99 variadic macros
10782 case "$i_stdarg$i_stdlib" in
10784 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10787 #include <stdarg.h>
10789 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10793 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10799 if eval $compile && $run ./try 2>&1 >/dev/null; then
10800 case "`$run ./try`" in
10802 echo "You have C99 variadic macros." >&4
10803 d_c99_variadic_macros="$define"
10806 echo "You don't have functional C99 variadic macros." >&4
10807 d_c99_variadic_macros="$undef"
10811 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10812 d_c99_variadic_macros="$undef"
10817 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10818 d_c99_variadic_macros="$undef"
10822 : see if signal is declared as pointer to function returning int or void
10824 xxx=`./findhdr signal.h`
10825 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10826 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10827 echo "You have int (*signal())() instead of void." >&4
10829 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10830 echo "You have void (*signal())()." >&4
10832 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10833 echo "You have int (*signal())() instead of void." >&4
10835 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10836 echo "You have void (*signal())()." >&4
10839 case "$d_voidsig" in
10841 echo "I can't determine whether signal handler returns void or int..." >&4
10843 rp="What type does your signal handler return?"
10846 v*) val="$define";;
10850 echo "As you already told me, signal handler returns void." >&4
10853 *) echo "As you already told me, signal handler returns int." >&4
10860 case "$d_voidsig" in
10861 "$define") signal_t="void";;
10862 *) signal_t="int";;
10866 : check for ability to cast large floats to 32-bit ints.
10868 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10869 if $test "$intsize" -ge 4; then
10876 #$i_stdlib I_STDLIB
10878 #include <stdlib.h>
10880 #include <sys/types.h>
10881 #include <signal.h>
10882 $signal_t blech(int s) { exit(3); }
10889 signal(SIGFPE, blech);
10891 /* Don't let compiler optimize the test away. Store the number
10892 in a writable string for gcc to pass to sscanf under HP/UX.
10894 sprintf(str, "2147483647");
10895 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10899 /* x86 processors will probably give 0x8000 0000, which is a
10900 sign change. We don't want that. We want to mimic SPARC
10901 behavior here, which is to preserve the sign and give
10904 if (i32 != ($xxx) f)
10910 if eval $compile_ok; then
10914 echo "(I can't seem to compile the test program--assuming it can't)"
10919 echo "Yup, it can."
10922 echo "Nope, it can't."
10929 : check for ability to cast negative floats to unsigned
10931 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10934 #$i_stdlib I_STDLIB
10936 #include <stdlib.h>
10938 #include <sys/types.h>
10939 #include <signal.h>
10940 $signal_t blech(int s) { exit(7); }
10941 $signal_t blech_in_list(int s) { exit(4); }
10942 unsigned long dummy_long(unsigned long p) { return p; }
10943 unsigned int dummy_int(unsigned int p) { return p; }
10944 unsigned short dummy_short(unsigned short p) { return p; }
10948 unsigned long along;
10950 unsigned short ashort;
10954 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10955 a direct f = -123. assignment. gcc-2.8.0 reportedly
10956 optimized the whole file away
10958 /* Store the number in a writable string for gcc to pass to
10959 sscanf under HP/UX.
10961 sprintf(str, "-123");
10962 sscanf(str, "%lf", &f); /* f = -123.; */
10964 signal(SIGFPE, blech);
10965 along = (unsigned long)f;
10966 aint = (unsigned int)f;
10967 ashort = (unsigned short)f;
10968 if (along != (unsigned long)-123)
10970 if (aint != (unsigned int)-123)
10972 if (ashort != (unsigned short)-123)
10974 sprintf(str, "1073741824.");
10975 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10978 along = (unsigned long)f;
10979 if (along != 0x80000000)
10983 along = (unsigned long)f;
10984 if (along != 0x7fffffff)
10988 along = (unsigned long)f;
10989 if (along != 0x80000001)
10993 signal(SIGFPE, blech_in_list);
10994 sprintf(str, "123.");
10995 sscanf(str, "%lf", &f); /* f = 123.; */
10996 along = dummy_long((unsigned long)f);
10997 aint = dummy_int((unsigned int)f);
10998 ashort = dummy_short((unsigned short)f);
10999 if (along != (unsigned long)123)
11001 if (aint != (unsigned int)123)
11003 if (ashort != (unsigned short)123)
11010 if eval $compile_ok; then
11014 echo "(I can't seem to compile the test program--assuming it can't)"
11017 case "$castflags" in
11019 echo "Yup, it can."
11022 echo "Nope, it can't."
11029 : see if vprintf exists
11031 if set vprintf val -f d_vprintf; eval $csym; $val; then
11032 echo 'vprintf() found.' >&4
11035 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11036 #$i_varargs I_VARARGS
11038 #$i_stdlib I_STDLIB
11039 #$i_unistd I_UNISTD
11042 # include <stdarg.h>
11043 #else /* I_VARARGS */
11044 # include <varargs.h>
11048 # include <unistd.h>
11052 # include <stdlib.h>
11055 #include <stdio.h> /* vsprintf prototype */
11058 void xxx(int n, ...)
11063 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11065 int main() { xxx(1, "foo"); }
11067 #else /* I_VARARGS */
11075 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11077 int main() { xxx("foo"); }
11083 if eval $compile_ok; then
11084 if $run ./try; then
11085 echo "Your vsprintf() returns (int)." >&4
11088 echo "Your vsprintf() returns (char*)." >&4
11092 echo 'I am unable to compile the vsprintf() test program.' >&4
11093 # We shouldn't get here. If we do, assume the standard signature,
11094 # not the old BSD one.
11095 echo 'Guessing that vsprintf() returns (int).' >&4
11099 echo 'vprintf() NOT found.' >&4
11110 : see if chown exists
11114 : see if chroot exists
11115 set chroot d_chroot
11118 : see if chsize exists
11119 set chsize d_chsize
11122 : see if class exists
11126 : see if clearenv exists
11127 set clearenv d_clearenv
11130 : Define hasstruct macro for Configure internal use
11131 hasstruct='varname=$1; struct=$2; shift; shift;
11132 while $test $# -ge 2; do
11134 $define) echo "#include <$2>";;
11138 echo "int main () { struct $struct foo; }" >> try.c;
11140 if eval $compile; then
11149 : see whether socket exists
11153 $echo $n "Hmm... $c" >&4
11154 if set socket val -f d_socket; eval $csym; $val; then
11155 echo "Looks like you have Berkeley networking support." >&4
11157 if set setsockopt val -f; eval $csym; $val; then
11160 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11161 d_oldsock="$define"
11164 if $contains socklib libc.list >/dev/null 2>&1; then
11165 echo "Looks like you have Berkeley networking support." >&4
11167 : we will have to assume that it supports the 4.2 BSD interface
11170 echo "You don't have Berkeley networking in libc$_a..." >&4
11171 if test "X$d_socket" = "X$define"; then
11172 echo "...but you seem to believe that you have sockets." >&4
11174 for net in net socket
11176 if test -f /usr/lib/lib$net$_a; then
11177 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11178 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11179 if $contains socket libc.list >/dev/null 2>&1; then
11184 echo "...but the Wollongong group seems to have hacked it in." >&4
11185 sockethdr="-I/usr/netinclude"
11188 echo "Found Berkeley sockets interface in lib$net." >&4
11189 if $contains setsockopt libc.list >/dev/null 2>&1; then
11192 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11193 d_oldsock="$define"
11199 if test "X$d_socket" != "X$define"; then
11200 echo "or anywhere else I see." >&4
11208 : see if socketpair exists
11209 set socketpair d_sockpair
11214 echo "Checking the availability of certain socket constants..." >&4
11215 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11216 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11218 #include <sys/types.h>
11219 #include <sys/socket.h>
11225 set try; if eval $compile; then
11228 set d_${enum}; eval $setvar
11232 : see if this is a sys/uio.h system
11233 set sys/uio.h i_sysuio
11236 : Check for cmsghdr support
11238 echo "Checking to see if your system supports struct cmsghdr..." >&4
11239 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11241 case "$d_cmsghdr_s" in
11242 "$define") echo "Yes, it does." ;;
11243 *) echo "No, it doesn't." ;;
11247 : check for const keyword
11249 echo 'Checking to see if your C compiler knows about "const"...' >&4
11250 $cat >const.c <<'EOCP'
11251 typedef struct spug { int drokk; } spug;
11255 const spug y = { 0 };
11258 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11260 echo "Yup, it does."
11263 echo "Nope, it doesn't."
11268 : see if copysignl exists
11269 set copysignl d_copysignl
11272 : see if crypt exists
11277 $define) cryptlib='' ;;
11278 *) if set crypt val -f d_crypt; eval $csym; $val; then
11279 echo 'crypt() found.' >&4
11283 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11284 if $test -z "$cryptlib"; then
11285 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11289 if $test -z "$cryptlib"; then
11290 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11294 if $test -z "$cryptlib"; then
11295 cryptlib=`./loc libcrypt$_a "" $libpth`
11299 if $test -z "$cryptlib"; then
11300 echo 'crypt() NOT found.' >&4
11311 : see if this is a crypt.h system
11312 set crypt.h i_crypt
11315 : see if crypt_r exists
11316 set crypt_r d_crypt_r
11318 case "$d_crypt_r" in
11320 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11321 case "$d_crypt_r_proto:$usethreads" in
11322 ":define") d_crypt_r_proto=define
11323 set d_crypt_r_proto crypt_r $hdrs
11327 case "$d_crypt_r_proto" in
11329 case "$crypt_r_proto" in
11330 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11331 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11333 case "$crypt_r_proto" in
11334 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11335 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11337 case "$crypt_r_proto" in
11338 ''|0) d_crypt_r=undef
11340 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11341 * ) case "$crypt_r_proto" in
11342 REENTRANT_PROTO*) ;;
11343 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11345 echo "Prototype: $try" ;;
11348 *) case "$usethreads" in
11349 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11360 : get csh whereabouts
11362 'csh') val="$undef" ;;
11363 *) val="$define" ;;
11367 : Respect a hint or command line value for full_csh.
11368 case "$full_csh" in
11369 '') full_csh=$csh ;;
11372 : see if ctermid exists
11373 set ctermid d_ctermid
11376 : see if ctermid_r exists
11377 set ctermid_r d_ctermid_r
11379 case "$d_ctermid_r" in
11381 hdrs="$i_systypes sys/types.h define stdio.h "
11382 case "$d_ctermid_r_proto:$usethreads" in
11383 ":define") d_ctermid_r_proto=define
11384 set d_ctermid_r_proto ctermid_r $hdrs
11388 case "$d_ctermid_r_proto" in
11390 case "$ctermid_r_proto" in
11391 ''|0) try='char* ctermid_r(char*);'
11392 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11394 case "$ctermid_r_proto" in
11395 ''|0) d_ctermid_r=undef
11397 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11398 * ) case "$ctermid_r_proto" in
11399 REENTRANT_PROTO*) ;;
11400 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11402 echo "Prototype: $try" ;;
11405 *) case "$usethreads" in
11406 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11413 *) ctermid_r_proto=0
11417 : see if ctime_r exists
11418 set ctime_r d_ctime_r
11420 case "$d_ctime_r" in
11422 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11423 case "$d_ctime_r_proto:$usethreads" in
11424 ":define") d_ctime_r_proto=define
11425 set d_ctime_r_proto ctime_r $hdrs
11429 case "$d_ctime_r_proto" in
11431 case "$ctime_r_proto" in
11432 ''|0) try='char* ctime_r(const time_t*, char*);'
11433 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11435 case "$ctime_r_proto" in
11436 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11437 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11439 case "$ctime_r_proto" in
11440 ''|0) try='int ctime_r(const time_t*, char*);'
11441 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11443 case "$ctime_r_proto" in
11444 ''|0) try='int ctime_r(const time_t*, char*, int);'
11445 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11447 case "$ctime_r_proto" in
11448 ''|0) d_ctime_r=undef
11450 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11451 * ) case "$ctime_r_proto" in
11452 REENTRANT_PROTO*) ;;
11453 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11455 echo "Prototype: $try" ;;
11458 *) case "$usethreads" in
11459 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11470 : see if cuserid exists
11471 set cuserid d_cuserid
11474 : see if this is a limits.h system
11475 set limits.h i_limits
11478 : see if this is a float.h system
11479 set float.h i_float
11482 : See if number of significant digits in a double precision number is known
11484 $cat >dbl_dig.c <<EOM
11485 #$i_limits I_LIMITS
11488 #include <limits.h>
11494 printf("Contains DBL_DIG");
11497 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11498 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11499 echo "DBL_DIG found." >&4
11502 echo "DBL_DIG NOT found." >&4
11509 : see if dbm.h is available
11510 : see if dbmclose exists
11511 set dbmclose d_dbmclose
11514 case "$d_dbmclose" in
11524 *) set rpcsvc/dbm.h i_rpcsvcdbm
11529 *) echo "We won't be including <dbm.h>"
11539 : see if prototype for dbminit is available
11541 set d_dbminitproto dbminit $i_dbm dbm.h
11544 : see if difftime exists
11545 set difftime d_difftime
11548 : see if this is a dirent system
11550 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11552 echo "<dirent.h> found." >&4
11555 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11556 echo "<sys/dir.h> found." >&4
11559 xinc=`./findhdr sys/ndir.h`
11561 echo "<dirent.h> NOT found." >&4
11566 : Look for type of directory structure.
11568 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11570 case "$direntrytype" in
11572 case "$i_dirent" in
11573 $define) guess1='struct dirent' ;;
11574 *) guess1='struct direct' ;;
11577 *) guess1="$direntrytype"
11582 'struct dirent') guess2='struct direct' ;;
11583 *) guess2='struct dirent' ;;
11586 if $contains "$guess1" try.c >/dev/null 2>&1; then
11587 direntrytype="$guess1"
11588 echo "Your directory entries are $direntrytype." >&4
11589 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11590 direntrytype="$guess2"
11591 echo "Your directory entries seem to be $direntrytype." >&4
11593 echo "I don't recognize your system's directory entries." >&4
11594 rp="What type is used for directory entries on this system?"
11597 direntrytype="$ans"
11601 : see if the directory entry stores field length
11603 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11604 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11605 echo "Good, your directory entry keeps length information in d_namlen." >&4
11608 echo "Your directory entry does not know about the d_namlen field." >&4
11615 : Look for DIR.dd_fd
11616 case "$i_dirent" in
11618 echo "Checking to see if DIR has a dd_fd member variable" >&4
11620 #$i_stdlib I_STDLIB
11622 #include <stdlib.h>
11624 #include <dirent.h>
11634 if eval $compile; then
11635 echo "Yes, it does."
11638 echo "No, it does not."
11643 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11651 : see if this is an sysdir system
11652 set sys/dir.h i_sysdir
11655 : see if this is an sysndir system
11656 set sys/ndir.h i_sysndir
11661 $cat >dirfd.c <<EOM
11663 #$i_stdlib I_STDLIB
11665 #include <stdlib.h>
11667 #$i_dirent I_DIRENT /**/
11668 #$i_sysdir I_SYS_DIR /**/
11669 #$i_sysndir I_SYS_NDIR /**/
11670 #$i_systypes I_SYS_TYPES /**/
11671 #if defined(I_SYS_TYPES)
11672 #include <sys/types.h>
11674 #if defined(I_DIRENT)
11675 #include <dirent.h>
11676 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11677 #include <sys/dir.h>
11681 #include <sys/ndir.h>
11685 #include <ndir.h> /* may be wrong in the future */
11687 #include <sys/dir.h>
11693 DIR *dirp = opendir(".");
11694 if (dirfd(dirp) >= 0)
11702 if eval $compile; then
11706 $define) echo "dirfd() found." >&4 ;;
11707 *) echo "dirfd() NOT found." >&4 ;;
11713 : see if dlerror exists
11716 set dlerror d_dlerror
11720 : see if dlfcn is available
11721 set dlfcn.h i_dlfcn
11724 : Check what extension to use for shared libs
11729 On a few systems, the dynamically loaded modules that perl generates and uses
11730 will need a different extension than shared libs. The default will probably
11736 *) dflt="$dlext" ;;
11738 rp='What is the extension of dynamically loaded modules'
11747 : Check if dlsym need a leading underscore
11753 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11754 $cat >dyna.c <<'EOM'
11761 #$i_stdlib I_STDLIB
11763 #include <stdlib.h>
11767 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11769 #include <sys/types.h>
11774 extern int fred() ;
11783 int mode = RTLD_LAZY ;
11785 handle = dlopen("./dyna.$dlext", mode) ;
11786 if (handle == NULL) {
11791 symbol = dlsym(handle, "fred") ;
11792 if (symbol == NULL) {
11793 /* try putting a leading underscore */
11794 symbol = dlsym(handle, "_fred") ;
11795 if (symbol == NULL) {
11808 : Call the object file tmp-dyna.o in case dlext=o.
11809 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11810 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11811 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11812 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11815 1) echo "Test program failed using dlopen." >&4
11816 echo "Perhaps you should not use dynamic loading." >&4;;
11817 2) echo "Test program failed using dlsym." >&4
11818 echo "Perhaps you should not use dynamic loading." >&4;;
11819 3) echo "dlsym needs a leading underscore" >&4
11821 4) echo "dlsym doesn't need a leading underscore." >&4;;
11824 echo "I can't compile and run the test program." >&4
11825 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11830 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11835 : see if drand48_r exists
11836 set drand48_r d_drand48_r
11838 case "$d_drand48_r" in
11840 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11841 case "$d_drand48_r_proto:$usethreads" in
11842 ":define") d_drand48_r_proto=define
11843 set d_drand48_r_proto drand48_r $hdrs
11847 case "$d_drand48_r_proto" in
11849 case "$drand48_r_proto" in
11850 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11851 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11853 case "$drand48_r_proto" in
11854 ''|0) d_drand48_r=undef
11856 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11857 * ) case "$drand48_r_proto" in
11858 REENTRANT_PROTO*) ;;
11859 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11861 echo "Prototype: $try" ;;
11864 *) case "$usethreads" in
11865 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11872 *) drand48_r_proto=0
11876 : see if prototype for drand48 is available
11878 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11881 : see if dup2 exists
11885 : see if eaccess exists
11886 set eaccess d_eaccess
11889 : see if endgrent exists
11890 set endgrent d_endgrent
11893 : see if this is an grp system
11899 xxx=`./findhdr grp.h`
11900 $cppstdin $cppflags $cppminus < $xxx >$$.h
11902 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11914 set d_grpasswd; eval $setvar
11918 : see if endgrent_r exists
11919 set endgrent_r d_endgrent_r
11921 case "$d_endgrent_r" in
11923 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11924 case "$d_endgrent_r_proto:$usethreads" in
11925 ":define") d_endgrent_r_proto=define
11926 set d_endgrent_r_proto endgrent_r $hdrs
11930 case "$d_endgrent_r_proto" in
11932 case "$endgrent_r_proto" in
11933 ''|0) try='int endgrent_r(FILE**);'
11934 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11936 case "$endgrent_r_proto" in
11937 ''|0) try='void endgrent_r(FILE**);'
11938 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11940 case "$endgrent_r_proto" in
11941 ''|0) d_endgrent_r=undef
11943 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11944 * ) case "$endgrent_r_proto" in
11945 REENTRANT_PROTO*) ;;
11946 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11948 echo "Prototype: $try" ;;
11951 *) case "$usethreads" in
11952 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11959 *) endgrent_r_proto=0
11963 : see if endhostent exists
11964 set endhostent d_endhent
11967 : see if this is a netdb.h system
11968 set netdb.h i_netdb
11971 : see if endhostent_r exists
11972 set endhostent_r d_endhostent_r
11974 case "$d_endhostent_r" in
11976 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11977 case "$d_endhostent_r_proto:$usethreads" in
11978 ":define") d_endhostent_r_proto=define
11979 set d_endhostent_r_proto endhostent_r $hdrs
11983 case "$d_endhostent_r_proto" in
11985 case "$endhostent_r_proto" in
11986 ''|0) try='int endhostent_r(struct hostent_data*);'
11987 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11989 case "$endhostent_r_proto" in
11990 ''|0) try='void endhostent_r(struct hostent_data*);'
11991 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11993 case "$endhostent_r_proto" in
11994 ''|0) d_endhostent_r=undef
11995 endhostent_r_proto=0
11996 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11997 * ) case "$endhostent_r_proto" in
11998 REENTRANT_PROTO*) ;;
11999 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12001 echo "Prototype: $try" ;;
12004 *) case "$usethreads" in
12005 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12007 d_endhostent_r=undef
12008 endhostent_r_proto=0
12012 *) endhostent_r_proto=0
12016 : see if endnetent exists
12017 set endnetent d_endnent
12020 : see if endnetent_r exists
12021 set endnetent_r d_endnetent_r
12023 case "$d_endnetent_r" in
12025 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12026 case "$d_endnetent_r_proto:$usethreads" in
12027 ":define") d_endnetent_r_proto=define
12028 set d_endnetent_r_proto endnetent_r $hdrs
12032 case "$d_endnetent_r_proto" in
12034 case "$endnetent_r_proto" in
12035 ''|0) try='int endnetent_r(struct netent_data*);'
12036 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
12038 case "$endnetent_r_proto" in
12039 ''|0) try='void endnetent_r(struct netent_data*);'
12040 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
12042 case "$endnetent_r_proto" in
12043 ''|0) d_endnetent_r=undef
12044 endnetent_r_proto=0
12045 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12046 * ) case "$endnetent_r_proto" in
12047 REENTRANT_PROTO*) ;;
12048 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12050 echo "Prototype: $try" ;;
12053 *) case "$usethreads" in
12054 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12056 d_endnetent_r=undef
12057 endnetent_r_proto=0
12061 *) endnetent_r_proto=0
12065 : see if endprotoent exists
12066 set endprotoent d_endpent
12069 : see if endprotoent_r exists
12070 set endprotoent_r d_endprotoent_r
12072 case "$d_endprotoent_r" in
12074 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12075 case "$d_endprotoent_r_proto:$usethreads" in
12076 ":define") d_endprotoent_r_proto=define
12077 set d_endprotoent_r_proto endprotoent_r $hdrs
12081 case "$d_endprotoent_r_proto" in
12083 case "$endprotoent_r_proto" in
12084 ''|0) try='int endprotoent_r(struct protoent_data*);'
12085 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12087 case "$endprotoent_r_proto" in
12088 ''|0) try='void endprotoent_r(struct protoent_data*);'
12089 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12091 case "$endprotoent_r_proto" in
12092 ''|0) d_endprotoent_r=undef
12093 endprotoent_r_proto=0
12094 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12095 * ) case "$endprotoent_r_proto" in
12096 REENTRANT_PROTO*) ;;
12097 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12099 echo "Prototype: $try" ;;
12102 *) case "$usethreads" in
12103 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12105 d_endprotoent_r=undef
12106 endprotoent_r_proto=0
12110 *) endprotoent_r_proto=0
12114 : see if endpwent exists
12115 set endpwent d_endpwent
12118 : see if this is a pwd.h system
12124 xxx=`./findhdr pwd.h`
12125 $cppstdin $cppflags $cppminus < $xxx >$$.h
12127 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12135 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12143 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12151 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12159 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12167 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12175 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12183 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12195 set d_pwquota; eval $setvar
12196 set d_pwage; eval $setvar
12197 set d_pwchange; eval $setvar
12198 set d_pwclass; eval $setvar
12199 set d_pwexpire; eval $setvar
12200 set d_pwcomment; eval $setvar
12201 set d_pwgecos; eval $setvar
12202 set d_pwpasswd; eval $setvar
12206 : see if endpwent_r exists
12207 set endpwent_r d_endpwent_r
12209 case "$d_endpwent_r" in
12211 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12212 case "$d_endpwent_r_proto:$usethreads" in
12213 ":define") d_endpwent_r_proto=define
12214 set d_endpwent_r_proto endpwent_r $hdrs
12218 case "$d_endpwent_r_proto" in
12220 case "$endpwent_r_proto" in
12221 ''|0) try='int endpwent_r(FILE**);'
12222 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12224 case "$endpwent_r_proto" in
12225 ''|0) try='void endpwent_r(FILE**);'
12226 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12228 case "$endpwent_r_proto" in
12229 ''|0) d_endpwent_r=undef
12231 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12232 * ) case "$endpwent_r_proto" in
12233 REENTRANT_PROTO*) ;;
12234 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12236 echo "Prototype: $try" ;;
12239 *) case "$usethreads" in
12240 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12247 *) endpwent_r_proto=0
12251 : see if endservent exists
12252 set endservent d_endsent
12255 : see if endservent_r exists
12256 set endservent_r d_endservent_r
12258 case "$d_endservent_r" in
12260 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12261 case "$d_endservent_r_proto:$usethreads" in
12262 ":define") d_endservent_r_proto=define
12263 set d_endservent_r_proto endservent_r $hdrs
12267 case "$d_endservent_r_proto" in
12269 case "$endservent_r_proto" in
12270 ''|0) try='int endservent_r(struct servent_data*);'
12271 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12273 case "$endservent_r_proto" in
12274 ''|0) try='void endservent_r(struct servent_data*);'
12275 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12277 case "$endservent_r_proto" in
12278 ''|0) d_endservent_r=undef
12279 endservent_r_proto=0
12280 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12281 * ) case "$endservent_r_proto" in
12282 REENTRANT_PROTO*) ;;
12283 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12285 echo "Prototype: $try" ;;
12288 *) case "$usethreads" in
12289 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12291 d_endservent_r=undef
12292 endservent_r_proto=0
12296 *) endservent_r_proto=0
12300 : Locate the flags for 'open()'
12303 #include <sys/types.h>
12308 #include <sys/file.h>
12310 #$i_stdlib I_STDLIB
12312 #include <stdlib.h>
12323 : check sys/file.h first to get FREAD on Sun
12324 if $test `./findhdr sys/file.h` && \
12325 set try -DI_SYS_FILE && eval $compile; then
12327 echo "<sys/file.h> defines the O_* constants..." >&4
12328 if $run ./try; then
12329 echo "and you have the 3 argument form of open()." >&4
12332 echo "but not the 3 argument form of open(). Oh, well." >&4
12335 elif $test `./findhdr fcntl.h` && \
12336 set try -DI_FCNTL && eval $compile; then
12338 echo "<fcntl.h> defines the O_* constants..." >&4
12339 if $run ./try; then
12340 echo "and you have the 3 argument form of open()." >&4
12343 echo "but not the 3 argument form of open(). Oh, well." >&4
12348 echo "I can't find the O_* constant definitions! You got problems." >&4
12354 : script used to emit important warnings
12357 if test \$# -gt 0; then
12362 echo "*** WARNING:" >&4
12363 sed -e 's/^/*** /' <msg >&4
12365 cat msg >>config.msg
12366 echo " " >>config.msg
12372 : see which of string.h or strings.h is needed
12374 strings=`./findhdr string.h`
12375 if $test "$strings" && $test -r "$strings"; then
12376 echo "Using <string.h> instead of <strings.h>." >&4
12380 strings=`./findhdr strings.h`
12381 if $test "$strings" && $test -r "$strings"; then
12382 echo "Using <strings.h> instead of <string.h>." >&4
12384 ./warn "No string header found -- You'll surely have problems."
12389 case "$i_string" in
12390 "$undef") strings=`./findhdr strings.h`;;
12391 *) strings=`./findhdr string.h`;;
12394 : see if this is a sys/file.h system
12399 : do we need to include sys/file.h ?
12403 if $h_sysfile; then
12405 echo "We'll be including <sys/file.h>." >&4
12408 echo "We won't be including <sys/file.h>." >&4
12418 : see if fcntl.h is there
12423 : see if we can include fcntl.h
12429 echo "We'll be including <fcntl.h>." >&4
12432 if $h_sysfile; then
12433 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12435 echo "We won't be including <fcntl.h>." >&4
12447 : see if fork exists
12451 : see if pipe exists
12455 : check for non-blocking I/O stuff
12456 case "$h_sysfile" in
12457 true) echo "#include <sys/file.h>" > head.c;;
12460 true) echo "#include <fcntl.h>" > head.c;;
12461 *) echo "#include <sys/fcntl.h>" > head.c;;
12466 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12467 case "$o_nonblock" in
12469 $cat head.c > try.c
12470 $cat >>try.c <<EOCP
12472 #$i_stdlib I_STDLIB
12474 #include <stdlib.h>
12482 printf("O_NONBLOCK\n");
12486 printf("O_NDELAY\n");
12490 printf("FNDELAY\n");
12497 if eval $compile_ok; then
12498 o_nonblock=`$run ./try`
12499 case "$o_nonblock" in
12500 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12501 *) echo "Seems like we can use $o_nonblock.";;
12504 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12507 *) echo "Using $hint value $o_nonblock.";;
12512 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12515 case "$d_fork:$d_pipe" in
12517 $cat head.c > try.c
12518 $cat >>try.c <<EOCP
12520 #include <sys/types.h>
12521 #include <signal.h>
12523 #$i_stdlib I_STDLIB
12525 #include <stdlib.h>
12531 #define MY_O_NONBLOCK $o_nonblock
12532 #ifndef errno /* XXX need better Configure test */
12535 #$i_unistd I_UNISTD
12537 #include <unistd.h>
12539 #$i_string I_STRING
12541 #include <string.h>
12543 #include <strings.h>
12545 $signal_t blech(int x) { exit(3); }
12547 $cat >> try.c <<'EOCP'
12555 pipe(pd); /* Down: child -> parent */
12556 pipe(pu); /* Up: parent -> child */
12559 close(pd[1]); /* Parent reads from pd[0] */
12560 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12562 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12567 signal(SIGALRM, blech);
12569 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12571 sprintf(string, "%d\n", ret);
12572 write(2, string, strlen(string));
12575 if (errno == EAGAIN) {
12576 printf("EAGAIN\n");
12581 if (errno == EWOULDBLOCK)
12582 printf("EWOULDBLOCK\n");
12585 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12586 sleep(2); /* Give it time to close our pipe */
12588 ret = read(pd[0], buf, 1); /* Should read EOF */
12590 sprintf(string, "%d\n", ret);
12591 write(4, string, strlen(string));
12595 close(pd[0]); /* We write to pd[1] */
12596 close(pu[1]); /* We read from pu[0] */
12597 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12598 close(pd[1]); /* Pipe pd is now fully closed! */
12599 exit(0); /* Bye bye, thank you for playing! */
12603 if eval $compile_ok; then
12604 echo "$startsh" >mtry
12605 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12607 ./mtry >/dev/null 2>&1
12609 0) eagain=`$cat try.out`;;
12610 1) echo "Could not perform non-blocking setting!";;
12611 2) echo "I did a successful read() for something that was not there!";;
12612 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12613 4) echo "Could not find F_SETFL!";;
12614 *) echo "Something terribly wrong happened during testing.";;
12616 rd_nodata=`$cat try.ret`
12617 echo "A read() system call with no data present returns $rd_nodata."
12618 case "$rd_nodata" in
12621 echo "(That's peculiar, fixing that to be -1.)"
12627 echo "Forcing errno EAGAIN on read() with no data available."
12631 echo "Your read() sets errno to $eagain when no data is available."
12634 status=`$cat try.err`
12636 0) echo "And it correctly returns 0 to signal EOF.";;
12637 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12638 *) echo "However, your read() returns '$status' on EOF??";;
12641 if test "$status" = "$rd_nodata"; then
12642 echo "WARNING: you can't distinguish between EOF and no data!"
12646 echo "I can't compile the test program--assuming errno EAGAIN will do."
12650 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12659 echo "Using $hint value $eagain."
12660 echo "Your read() returns $rd_nodata when no data is present."
12661 case "$d_eofnblk" in
12662 "$define") echo "And you can see EOF because read() returns 0.";;
12663 "$undef") echo "But you can't see EOF status from read() returned value.";;
12665 echo "(Assuming you can't see EOF status from read anyway.)"
12671 $rm_try head.c mtry
12673 : see if _ptr and _cnt from stdio act std
12676 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12677 echo "(Looks like you have stdio.h from BSD.)"
12678 case "$stdio_ptr" in
12679 '') stdio_ptr='((fp)->_p)'
12682 *) ptr_lval=$d_stdio_ptr_lval;;
12684 case "$stdio_cnt" in
12685 '') stdio_cnt='((fp)->_r)'
12688 *) cnt_lval=$d_stdio_cnt_lval;;
12690 case "$stdio_base" in
12691 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12693 case "$stdio_bufsiz" in
12694 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12696 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12697 echo "(Looks like you have stdio.h from Linux.)"
12698 case "$stdio_ptr" in
12699 '') stdio_ptr='((fp)->_IO_read_ptr)'
12702 *) ptr_lval=$d_stdio_ptr_lval;;
12704 case "$stdio_cnt" in
12705 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12708 *) cnt_lval=$d_stdio_cnt_lval;;
12710 case "$stdio_base" in
12711 '') stdio_base='((fp)->_IO_read_base)';;
12713 case "$stdio_bufsiz" in
12714 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12717 case "$stdio_ptr" in
12718 '') stdio_ptr='((fp)->_ptr)'
12721 *) ptr_lval=$d_stdio_ptr_lval;;
12723 case "$stdio_cnt" in
12724 '') stdio_cnt='((fp)->_cnt)'
12727 *) cnt_lval=$d_stdio_cnt_lval;;
12729 case "$stdio_base" in
12730 '') stdio_base='((fp)->_base)';;
12732 case "$stdio_bufsiz" in
12733 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12737 : test whether _ptr and _cnt really work
12738 echo "Checking how std your stdio is..." >&4
12741 #$i_stdlib I_STDLIB
12743 #include <stdlib.h>
12745 #define FILE_ptr(fp) $stdio_ptr
12746 #define FILE_cnt(fp) $stdio_cnt
12748 FILE *fp = fopen("try.c", "r");
12751 18 <= FILE_cnt(fp) &&
12752 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12760 if eval $compile && $to try.c; then
12761 if $run ./try; then
12762 echo "Your stdio acts pretty std."
12765 echo "Your stdio isn't very std."
12768 echo "Your stdio doesn't appear very std."
12772 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12773 # direct buffer manipulation no longer works. The Configure tests
12774 # should be changed to correctly detect this, but until then,
12775 # the following check should at least let perl compile and run.
12776 # (This quick fix should be updated before 5.8.1.)
12777 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12778 # A. Dougherty, June 3, 2002.
12779 case "$d_gnulibc" in
12781 case "$gnulibc_version" in
12785 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12794 : Can _ptr be used as an lvalue?
12795 case "$d_stdstdio$ptr_lval" in
12796 $define$define) val=$define ;;
12799 set d_stdio_ptr_lval
12802 : Can _cnt be used as an lvalue?
12803 case "$d_stdstdio$cnt_lval" in
12804 $define$define) val=$define ;;
12807 set d_stdio_cnt_lval
12811 : test whether setting _ptr sets _cnt as a side effect
12812 d_stdio_ptr_lval_sets_cnt="$undef"
12813 d_stdio_ptr_lval_nochange_cnt="$undef"
12814 case "$d_stdio_ptr_lval$d_stdstdio" in
12816 echo "Checking to see what happens if we set the stdio ptr..." >&4
12819 /* Can we scream? */
12820 /* Eat dust sed :-) */
12821 /* In the buffer space, no one can hear you scream. */
12822 #$i_stdlib I_STDLIB
12824 #include <stdlib.h>
12826 #define FILE_ptr(fp) $stdio_ptr
12827 #define FILE_cnt(fp) $stdio_cnt
12828 #include <sys/types.h>
12830 FILE *fp = fopen("try.c", "r");
12835 puts("Fail even to read");
12838 c = getc(fp); /* Read away the first # */
12840 puts("Fail even to read");
12844 18 <= FILE_cnt(fp) &&
12845 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12847 puts("Fail even to read");
12850 ptr = (char*) FILE_ptr(fp);
12851 cnt = (size_t)FILE_cnt(fp);
12853 FILE_ptr(fp) += 42;
12855 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12856 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12859 if (FILE_cnt(fp) <= 20) {
12860 printf ("Fail (<20 chars to test)");
12863 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12864 puts("Fail compare");
12867 if (cnt == FILE_cnt(fp)) {
12868 puts("Pass_unchanged");
12871 if (FILE_cnt(fp) == (cnt - 42)) {
12872 puts("Pass_changed");
12875 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12881 if eval $compile && $to try.c; then
12882 case `$run ./try` in
12884 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12885 d_stdio_ptr_lval_sets_cnt="$define" ;;
12887 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12888 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12890 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12892 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12895 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12901 : see if _base is also standard
12903 case "$d_stdstdio" in
12907 #$i_stdlib I_STDLIB
12909 #include <stdlib.h>
12911 #define FILE_base(fp) $stdio_base
12912 #define FILE_bufsiz(fp) $stdio_bufsiz
12914 FILE *fp = fopen("try.c", "r");
12917 19 <= FILE_bufsiz(fp) &&
12918 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12925 if eval $compile && $to try.c; then
12926 if $run ./try; then
12927 echo "And its _base field acts std."
12930 echo "But its _base field isn't std."
12933 echo "However, it seems to be lacking the _base field."
12941 : see if fast_stdio exists
12943 case "$d_stdstdio:$d_stdio_ptr_lval" in
12945 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12947 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12958 : see if fchdir exists
12959 set fchdir d_fchdir
12962 : see if fchmod exists
12963 set fchmod d_fchmod
12966 : see if fchown exists
12967 set fchown d_fchown
12970 : see if this is an fcntl system
12974 : See if fcntl-based locking works.
12977 #$i_stdlib I_STDLIB
12979 #include <stdlib.h>
12981 #include <unistd.h>
12983 #include <signal.h>
12984 $signal_t blech(int x) { exit(3); }
12986 #if defined(F_SETLK) && defined(F_SETLKW)
12987 struct flock flock;
12989 fd = open("try.c", O_RDONLY);
12990 flock.l_type = F_RDLCK;
12991 flock.l_whence = SEEK_SET;
12992 flock.l_start = flock.l_len = 0;
12993 signal(SIGALRM, blech);
12995 retval = fcntl(fd, F_SETLK, &flock);
12997 (retval < 0 ? exit(2) : exit(0));
13003 echo "Checking if fcntl-based file locking works... "
13007 if eval $compile_ok; then
13008 if $run ./try; then
13009 echo "Yes, it seems to work."
13012 echo "Nope, it didn't work."
13017 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13018 *** This is (almost) impossible.
13019 *** If your NFS lock daemons are not feeling well, something like
13020 *** this may happen, please investigate. Cannot continue, aborting.
13028 echo "I'm unable to compile the test program, so I'll assume not."
13033 echo "Nope, since you don't even have fcntl()."
13036 set d_fcntl_can_lock
13040 : check for fd_set items
13043 Checking to see how well your C compiler handles fd_set and friends ...
13046 #$i_stdlib I_STDLIB
13048 #include <stdlib.h>
13050 #$i_systime I_SYS_TIME
13051 #$i_sysselct I_SYS_SELECT
13052 #$d_socket HAS_SOCKET
13053 #include <sys/types.h>
13055 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13058 #include <sys/time.h>
13060 #ifdef I_SYS_SELECT
13061 #include <sys/select.h>
13070 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13078 if eval $compile; then
13079 d_fds_bits="$define"
13081 echo "Well, your system knows about the normal fd_set typedef..." >&4
13082 if $run ./try; then
13083 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13084 d_fd_macros="$define"
13087 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13089 d_fd_macros="$undef"
13093 Hmm, your compiler has some difficulty with fd_set. Checking further...
13096 if eval $compile; then
13097 d_fds_bits="$undef"
13099 echo "Well, your system has some sort of fd_set available..." >&4
13100 if $run ./try; then
13101 echo "and you have the normal fd_set macros." >&4
13102 d_fd_macros="$define"
13105 but not the normal fd_set macros! Gross! More work for me...
13107 d_fd_macros="$undef"
13110 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13112 d_fds_bits="$undef"
13113 d_fd_macros="$undef"
13118 : see if fgetpos exists
13119 set fgetpos d_fgetpos
13122 : see if finite exists
13123 set finite d_finite
13126 : see if finitel exists
13127 set finitel d_finitel
13130 : see if flock exists
13134 : see if prototype for flock is available
13136 set d_flockproto flock $i_sysfile sys/file.h
13139 : see if fp_class exists
13140 set fp_class d_fp_class
13143 : see if pathconf exists
13144 set pathconf d_pathconf
13147 : see if fpathconf exists
13148 set fpathconf d_fpathconf
13151 : see if fpclass exists
13152 set fpclass d_fpclass
13155 : see if fpclassify exists
13156 set fpclassify d_fpclassify
13159 : see if fpclassl exists
13160 set fpclassl d_fpclassl
13163 : check for fpos64_t
13165 echo "Checking to see if you have fpos64_t..." >&4
13168 int main() { fpos64_t x = 7; }
13171 if eval $compile; then
13173 echo "You have fpos64_t."
13176 echo "You do not have fpos64_t."
13177 case "$fpossize" in
13178 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13185 : see if frexpl exists
13186 set frexpl d_frexpl
13189 : see if this is a sys/param system
13190 set sys/param.h i_sysparam
13193 : see if this is a sys/mount.h system
13194 set sys/mount.h i_sysmount
13197 : Check for fs_data_s
13199 echo "Checking to see if your system supports struct fs_data..." >&4
13200 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13202 case "$d_fs_data_s" in
13203 "$define") echo "Yes, it does." ;;
13204 *) echo "No, it doesn't." ;;
13207 : see if fseeko exists
13208 set fseeko d_fseeko
13210 case "$longsize" in
13211 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13214 : see if fsetpos exists
13215 set fsetpos d_fsetpos
13218 : see if fstatfs exists
13219 set fstatfs d_fstatfs
13222 : see if statvfs exists
13223 set statvfs d_statvfs
13226 : see if fstatvfs exists
13227 set fstatvfs d_fstatvfs
13231 : see if fsync exists
13235 : see if ftello exists
13236 set ftello d_ftello
13238 case "$longsize" in
13239 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13242 : check for a working futimes
13245 echo "Checking if you have a working futimes()" >&4
13248 #include <sys/time.h>
13255 fd = open ("try.c", O_RDWR);
13256 if (-1 == fd) exit (1);
13257 rv = futimes (fd, NULL);
13258 exit (rv == -1 ? errno : 0);
13262 if eval $compile; then
13266 0) echo "Yes, you have" >&4
13267 d_futimes="$define"
13269 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13273 echo "No, it does not (probably harmless)" >&4
13277 : see if getcwd exists
13278 set getcwd d_getcwd
13281 : see if getespwnam exists
13282 set getespwnam d_getespwnam
13285 : see if getfsstat exists
13286 set getfsstat d_getfsstat
13289 : see if getgrent exists
13290 set getgrent d_getgrent
13293 : see if getgrent_r exists
13294 set getgrent_r d_getgrent_r
13296 case "$d_getgrent_r" in
13298 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13299 case "$d_getgrent_r_proto:$usethreads" in
13300 ":define") d_getgrent_r_proto=define
13301 set d_getgrent_r_proto getgrent_r $hdrs
13305 case "$d_getgrent_r_proto" in
13307 case "$getgrent_r_proto" in
13308 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13309 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13311 case "$getgrent_r_proto" in
13312 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13313 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13315 case "$getgrent_r_proto" in
13316 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13317 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13319 case "$getgrent_r_proto" in
13320 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13321 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13323 case "$getgrent_r_proto" in
13324 ''|0) try='int getgrent_r(struct group*, char*, int);'
13325 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13327 case "$getgrent_r_proto" in
13328 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13329 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13331 case "$getgrent_r_proto" in
13332 ''|0) d_getgrent_r=undef
13334 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13335 * ) case "$getgrent_r_proto" in
13336 REENTRANT_PROTO*) ;;
13337 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13339 echo "Prototype: $try" ;;
13342 *) case "$usethreads" in
13343 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13350 *) getgrent_r_proto=0
13354 : see if getgrgid_r exists
13355 set getgrgid_r d_getgrgid_r
13357 case "$d_getgrgid_r" in
13359 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13360 case "$d_getgrgid_r_proto:$usethreads" in
13361 ":define") d_getgrgid_r_proto=define
13362 set d_getgrgid_r_proto getgrgid_r $hdrs
13366 case "$d_getgrgid_r_proto" in
13368 case "$getgrgid_r_proto" in
13369 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13370 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13372 case "$getgrgid_r_proto" in
13373 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13374 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13376 case "$getgrgid_r_proto" in
13377 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13378 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13380 case "$getgrgid_r_proto" in
13381 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13382 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13384 case "$getgrgid_r_proto" in
13385 ''|0) d_getgrgid_r=undef
13387 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13388 * ) case "$getgrgid_r_proto" in
13389 REENTRANT_PROTO*) ;;
13390 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13392 echo "Prototype: $try" ;;
13395 *) case "$usethreads" in
13396 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13403 *) getgrgid_r_proto=0
13407 : see if getgrnam_r exists
13408 set getgrnam_r d_getgrnam_r
13410 case "$d_getgrnam_r" in
13412 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13413 case "$d_getgrnam_r_proto:$usethreads" in
13414 ":define") d_getgrnam_r_proto=define
13415 set d_getgrnam_r_proto getgrnam_r $hdrs
13419 case "$d_getgrnam_r_proto" in
13421 case "$getgrnam_r_proto" in
13422 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13423 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13425 case "$getgrnam_r_proto" in
13426 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13427 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13429 case "$getgrnam_r_proto" in
13430 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13431 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13433 case "$getgrnam_r_proto" in
13434 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13435 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13437 case "$getgrnam_r_proto" in
13438 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13439 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13441 case "$getgrnam_r_proto" in
13442 ''|0) d_getgrnam_r=undef
13444 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13445 * ) case "$getgrnam_r_proto" in
13446 REENTRANT_PROTO*) ;;
13447 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13449 echo "Prototype: $try" ;;
13452 *) case "$usethreads" in
13453 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13460 *) getgrnam_r_proto=0
13464 : see if gethostbyaddr exists
13465 set gethostbyaddr d_gethbyaddr
13468 : see if gethostbyname exists
13469 set gethostbyname d_gethbyname
13472 : see if gethostent exists
13473 set gethostent d_gethent
13476 : see how we will look up host name
13479 if set gethostname val -f d_gethname; eval $csym; $val; then
13480 echo 'gethostname() found.' >&4
13481 d_gethname="$define"
13484 if set uname val -f d_uname; eval $csym; $val; then
13487 uname() was found, but you're running xenix, and older versions of xenix
13488 have a broken uname(). If you don't really know whether your xenix is old
13489 enough to have a broken system call, use the default answer.
13494 "$define") dflt=n;;
13496 rp='Is your uname() broken?'
13499 n*) d_uname="$define"; call=uname;;
13502 echo 'uname() found.' >&4
13509 case "$d_gethname" in
13510 '') d_gethname="$undef";;
13513 '') d_uname="$undef";;
13515 case "$d_uname$d_gethname" in
13520 Every now and then someone has a $call() that lies about the hostname
13521 but can't be fixed for political or economic reasons. If you wish, I can
13522 pretend $call() isn't there and maybe compute hostname at run-time
13523 thanks to the '$phostname' command.
13526 rp="Shall I ignore $call() from now on?"
13529 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13532 case "$phostname" in
13533 '') aphostname='';;
13534 *) case "$aphostname" in
13536 *) set X $phostname
13540 file=`./loc $file $file $pth`
13541 aphostname=`echo $file $*`
13546 case "$d_uname$d_gethname" in
13549 case "$phostname" in
13551 echo "There will be no way for $package to get your hostname." >&4;;
13553 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13557 case "$d_phostname" in
13558 '') d_phostname="$undef";;
13561 : see if gethostbyaddr_r exists
13562 set gethostbyaddr_r d_gethostbyaddr_r
13564 case "$d_gethostbyaddr_r" in
13566 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13567 case "$d_gethostbyaddr_r_proto:$usethreads" in
13568 ":define") d_gethostbyaddr_r_proto=define
13569 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13573 case "$d_gethostbyaddr_r_proto" in
13575 case "$gethostbyaddr_r_proto" in
13576 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13577 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13579 case "$gethostbyaddr_r_proto" in
13580 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13581 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13583 case "$gethostbyaddr_r_proto" in
13584 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13585 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13587 case "$gethostbyaddr_r_proto" in
13588 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13589 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13591 case "$gethostbyaddr_r_proto" in
13592 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13593 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13595 case "$gethostbyaddr_r_proto" in
13596 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13597 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13599 case "$gethostbyaddr_r_proto" in
13600 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13601 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13603 case "$gethostbyaddr_r_proto" in
13604 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13605 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13607 case "$gethostbyaddr_r_proto" in
13608 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13609 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13611 case "$gethostbyaddr_r_proto" in
13612 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13613 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13615 case "$gethostbyaddr_r_proto" in
13616 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13617 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13619 case "$gethostbyaddr_r_proto" in
13620 ''|0) d_gethostbyaddr_r=undef
13621 gethostbyaddr_r_proto=0
13622 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13623 * ) case "$gethostbyaddr_r_proto" in
13624 REENTRANT_PROTO*) ;;
13625 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13627 echo "Prototype: $try" ;;
13630 *) case "$usethreads" in
13631 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13633 d_gethostbyaddr_r=undef
13634 gethostbyaddr_r_proto=0
13638 *) gethostbyaddr_r_proto=0
13642 : see if gethostbyname_r exists
13643 set gethostbyname_r d_gethostbyname_r
13645 case "$d_gethostbyname_r" in
13647 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13648 case "$d_gethostbyname_r_proto:$usethreads" in
13649 ":define") d_gethostbyname_r_proto=define
13650 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13654 case "$d_gethostbyname_r_proto" in
13656 case "$gethostbyname_r_proto" in
13657 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13658 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13660 case "$gethostbyname_r_proto" in
13661 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13662 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13664 case "$gethostbyname_r_proto" in
13665 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13666 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13668 case "$gethostbyname_r_proto" in
13669 ''|0) d_gethostbyname_r=undef
13670 gethostbyname_r_proto=0
13671 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13672 * ) case "$gethostbyname_r_proto" in
13673 REENTRANT_PROTO*) ;;
13674 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13676 echo "Prototype: $try" ;;
13679 *) case "$usethreads" in
13680 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13682 d_gethostbyname_r=undef
13683 gethostbyname_r_proto=0
13687 *) gethostbyname_r_proto=0
13691 : see if gethostent_r exists
13692 set gethostent_r d_gethostent_r
13694 case "$d_gethostent_r" in
13696 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13697 case "$d_gethostent_r_proto:$usethreads" in
13698 ":define") d_gethostent_r_proto=define
13699 set d_gethostent_r_proto gethostent_r $hdrs
13703 case "$d_gethostent_r_proto" in
13705 case "$gethostent_r_proto" in
13706 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13707 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13709 case "$gethostent_r_proto" in
13710 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13711 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13713 case "$gethostent_r_proto" in
13714 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13715 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13717 case "$gethostent_r_proto" in
13718 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13719 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13721 case "$gethostent_r_proto" in
13722 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13723 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13725 case "$gethostent_r_proto" in
13726 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13727 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13729 case "$gethostent_r_proto" in
13730 ''|0) d_gethostent_r=undef
13731 gethostent_r_proto=0
13732 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13733 * ) case "$gethostent_r_proto" in
13734 REENTRANT_PROTO*) ;;
13735 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13737 echo "Prototype: $try" ;;
13740 *) case "$usethreads" in
13741 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13743 d_gethostent_r=undef
13744 gethostent_r_proto=0
13748 *) gethostent_r_proto=0
13752 : see if prototypes for various gethostxxx netdb.h functions are available
13754 set d_gethostprotos gethostent $i_netdb netdb.h
13757 : see if getitimer exists
13758 set getitimer d_getitimer
13761 : see if getlogin exists
13762 set getlogin d_getlogin
13765 : see if getlogin_r exists
13766 set getlogin_r d_getlogin_r
13768 case "$d_getlogin_r" in
13770 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13771 case "$d_getlogin_r_proto:$usethreads" in
13772 ":define") d_getlogin_r_proto=define
13773 set d_getlogin_r_proto getlogin_r $hdrs
13777 case "$d_getlogin_r_proto" in
13779 case "$getlogin_r_proto" in
13780 ''|0) try='int getlogin_r(char*, size_t);'
13781 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13783 case "$getlogin_r_proto" in
13784 ''|0) try='int getlogin_r(char*, int);'
13785 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13787 case "$getlogin_r_proto" in
13788 ''|0) try='char* getlogin_r(char*, size_t);'
13789 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13791 case "$getlogin_r_proto" in
13792 ''|0) try='char* getlogin_r(char*, int);'
13793 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13795 case "$getlogin_r_proto" in
13796 ''|0) d_getlogin_r=undef
13798 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13799 * ) case "$getlogin_r_proto" in
13800 REENTRANT_PROTO*) ;;
13801 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13803 echo "Prototype: $try" ;;
13806 *) case "$usethreads" in
13807 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13814 *) getlogin_r_proto=0
13818 : see if getmnt exists
13819 set getmnt d_getmnt
13822 : see if getmntent exists
13823 set getmntent d_getmntent
13826 : see if getnetbyaddr exists
13827 set getnetbyaddr d_getnbyaddr
13830 : see if getnetbyname exists
13831 set getnetbyname d_getnbyname
13834 : see if getnetent exists
13835 set getnetent d_getnent
13838 : see if getnetbyaddr_r exists
13839 set getnetbyaddr_r d_getnetbyaddr_r
13841 case "$d_getnetbyaddr_r" in
13843 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13844 case "$d_getnetbyaddr_r_proto:$usethreads" in
13845 ":define") d_getnetbyaddr_r_proto=define
13846 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13850 case "$d_getnetbyaddr_r_proto" in
13852 case "$getnetbyaddr_r_proto" in
13853 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13854 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13856 case "$getnetbyaddr_r_proto" in
13857 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13858 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13860 case "$getnetbyaddr_r_proto" in
13861 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13862 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13864 case "$getnetbyaddr_r_proto" in
13865 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13866 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13868 case "$getnetbyaddr_r_proto" in
13869 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13870 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13872 case "$getnetbyaddr_r_proto" in
13873 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13874 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13876 case "$getnetbyaddr_r_proto" in
13877 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13878 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13880 case "$getnetbyaddr_r_proto" in
13881 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13882 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13884 case "$getnetbyaddr_r_proto" in
13885 ''|0) d_getnetbyaddr_r=undef
13886 getnetbyaddr_r_proto=0
13887 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13888 * ) case "$getnetbyaddr_r_proto" in
13889 REENTRANT_PROTO*) ;;
13890 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13892 echo "Prototype: $try" ;;
13895 *) case "$usethreads" in
13896 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13898 d_getnetbyaddr_r=undef
13899 getnetbyaddr_r_proto=0
13903 *) getnetbyaddr_r_proto=0
13907 : see if getnetbyname_r exists
13908 set getnetbyname_r d_getnetbyname_r
13910 case "$d_getnetbyname_r" in
13912 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13913 case "$d_getnetbyname_r_proto:$usethreads" in
13914 ":define") d_getnetbyname_r_proto=define
13915 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13919 case "$d_getnetbyname_r_proto" in
13921 case "$getnetbyname_r_proto" in
13922 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13923 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13925 case "$getnetbyname_r_proto" in
13926 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13927 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13929 case "$getnetbyname_r_proto" in
13930 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13931 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13933 case "$getnetbyname_r_proto" in
13934 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13935 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13937 case "$getnetbyname_r_proto" in
13938 ''|0) d_getnetbyname_r=undef
13939 getnetbyname_r_proto=0
13940 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13941 * ) case "$getnetbyname_r_proto" in
13942 REENTRANT_PROTO*) ;;
13943 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13945 echo "Prototype: $try" ;;
13948 *) case "$usethreads" in
13949 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13951 d_getnetbyname_r=undef
13952 getnetbyname_r_proto=0
13956 *) getnetbyname_r_proto=0
13960 : see if getnetent_r exists
13961 set getnetent_r d_getnetent_r
13963 case "$d_getnetent_r" in
13965 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13966 case "$d_getnetent_r_proto:$usethreads" in
13967 ":define") d_getnetent_r_proto=define
13968 set d_getnetent_r_proto getnetent_r $hdrs
13972 case "$d_getnetent_r_proto" in
13974 case "$getnetent_r_proto" in
13975 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13976 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13978 case "$getnetent_r_proto" in
13979 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13980 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13982 case "$getnetent_r_proto" in
13983 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13984 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13986 case "$getnetent_r_proto" in
13987 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13988 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13990 case "$getnetent_r_proto" in
13991 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13992 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13994 case "$getnetent_r_proto" in
13995 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13996 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13998 case "$getnetent_r_proto" in
13999 ''|0) d_getnetent_r=undef
14000 getnetent_r_proto=0
14001 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14002 * ) case "$getnetent_r_proto" in
14003 REENTRANT_PROTO*) ;;
14004 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14006 echo "Prototype: $try" ;;
14009 *) case "$usethreads" in
14010 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14012 d_getnetent_r=undef
14013 getnetent_r_proto=0
14017 *) getnetent_r_proto=0
14021 : see if prototypes for various getnetxxx netdb.h functions are available
14023 set d_getnetprotos getnetent $i_netdb netdb.h
14026 : see if getpagesize exists
14027 set getpagesize d_getpagsz
14030 : Optional checks for getprotobyname and getprotobynumber
14032 : see if getprotobyname exists
14033 set getprotobyname d_getpbyname
14036 : see if getprotobynumber exists
14037 set getprotobynumber d_getpbynumber
14040 : see if getprotoent exists
14041 set getprotoent d_getpent
14044 : see if getpgid exists
14045 set getpgid d_getpgid
14048 : see if getpgrp2 exists
14049 set getpgrp2 d_getpgrp2
14052 : see if getppid exists
14053 set getppid d_getppid
14056 : see if getpriority exists
14057 set getpriority d_getprior
14060 : see if getprotobyname_r exists
14061 set getprotobyname_r d_getprotobyname_r
14063 case "$d_getprotobyname_r" in
14065 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14066 case "$d_getprotobyname_r_proto:$usethreads" in
14067 ":define") d_getprotobyname_r_proto=define
14068 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14072 case "$d_getprotobyname_r_proto" in
14074 case "$getprotobyname_r_proto" in
14075 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14076 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14078 case "$getprotobyname_r_proto" in
14079 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14080 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14082 case "$getprotobyname_r_proto" in
14083 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14084 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14086 case "$getprotobyname_r_proto" in
14087 ''|0) d_getprotobyname_r=undef
14088 getprotobyname_r_proto=0
14089 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14090 * ) case "$getprotobyname_r_proto" in
14091 REENTRANT_PROTO*) ;;
14092 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14094 echo "Prototype: $try" ;;
14097 *) case "$usethreads" in
14098 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14100 d_getprotobyname_r=undef
14101 getprotobyname_r_proto=0
14105 *) getprotobyname_r_proto=0
14109 : see if getprotobynumber_r exists
14110 set getprotobynumber_r d_getprotobynumber_r
14112 case "$d_getprotobynumber_r" in
14114 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14115 case "$d_getprotobynumber_r_proto:$usethreads" in
14116 ":define") d_getprotobynumber_r_proto=define
14117 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14121 case "$d_getprotobynumber_r_proto" in
14123 case "$getprotobynumber_r_proto" in
14124 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14125 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14127 case "$getprotobynumber_r_proto" in
14128 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14129 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14131 case "$getprotobynumber_r_proto" in
14132 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14133 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14135 case "$getprotobynumber_r_proto" in
14136 ''|0) d_getprotobynumber_r=undef
14137 getprotobynumber_r_proto=0
14138 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14139 * ) case "$getprotobynumber_r_proto" in
14140 REENTRANT_PROTO*) ;;
14141 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14143 echo "Prototype: $try" ;;
14146 *) case "$usethreads" in
14147 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14149 d_getprotobynumber_r=undef
14150 getprotobynumber_r_proto=0
14154 *) getprotobynumber_r_proto=0
14158 : see if getprotoent_r exists
14159 set getprotoent_r d_getprotoent_r
14161 case "$d_getprotoent_r" in
14163 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14164 case "$d_getprotoent_r_proto:$usethreads" in
14165 ":define") d_getprotoent_r_proto=define
14166 set d_getprotoent_r_proto getprotoent_r $hdrs
14170 case "$d_getprotoent_r_proto" in
14172 case "$getprotoent_r_proto" in
14173 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14174 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14176 case "$getprotoent_r_proto" in
14177 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14178 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14180 case "$getprotoent_r_proto" in
14181 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14182 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14184 case "$getprotoent_r_proto" in
14185 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14186 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14188 case "$getprotoent_r_proto" in
14189 ''|0) d_getprotoent_r=undef
14190 getprotoent_r_proto=0
14191 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14192 * ) case "$getprotoent_r_proto" in
14193 REENTRANT_PROTO*) ;;
14194 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14196 echo "Prototype: $try" ;;
14199 *) case "$usethreads" in
14200 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14202 d_getprotoent_r=undef
14203 getprotoent_r_proto=0
14207 *) getprotoent_r_proto=0
14211 : see if prototypes for various getprotoxxx netdb.h functions are available
14213 set d_getprotoprotos getprotoent $i_netdb netdb.h
14216 : see if getprpwnam exists
14217 set getprpwnam d_getprpwnam
14220 : see if getpwent exists
14221 set getpwent d_getpwent
14224 : see if getpwent_r exists
14225 set getpwent_r d_getpwent_r
14227 case "$d_getpwent_r" in
14229 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14230 case "$d_getpwent_r_proto:$usethreads" in
14231 ":define") d_getpwent_r_proto=define
14232 set d_getpwent_r_proto getpwent_r $hdrs
14236 case "$d_getpwent_r_proto" in
14238 case "$getpwent_r_proto" in
14239 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14240 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14242 case "$getpwent_r_proto" in
14243 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14244 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14246 case "$getpwent_r_proto" in
14247 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14248 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14250 case "$getpwent_r_proto" in
14251 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14252 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14254 case "$getpwent_r_proto" in
14255 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14256 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14258 case "$getpwent_r_proto" in
14259 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14260 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14262 case "$getpwent_r_proto" in
14263 ''|0) d_getpwent_r=undef
14265 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14266 * ) case "$getpwent_r_proto" in
14267 REENTRANT_PROTO*) ;;
14268 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14270 echo "Prototype: $try" ;;
14273 *) case "$usethreads" in
14274 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14281 *) getpwent_r_proto=0
14285 : see if getpwnam_r exists
14286 set getpwnam_r d_getpwnam_r
14288 case "$d_getpwnam_r" in
14290 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14291 case "$d_getpwnam_r_proto:$usethreads" in
14292 ":define") d_getpwnam_r_proto=define
14293 set d_getpwnam_r_proto getpwnam_r $hdrs
14297 case "$d_getpwnam_r_proto" in
14299 case "$getpwnam_r_proto" in
14300 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14301 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14303 case "$getpwnam_r_proto" in
14304 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14305 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14307 case "$getpwnam_r_proto" in
14308 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14309 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14311 case "$getpwnam_r_proto" in
14312 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14313 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14315 case "$getpwnam_r_proto" in
14316 ''|0) d_getpwnam_r=undef
14318 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14319 * ) case "$getpwnam_r_proto" in
14320 REENTRANT_PROTO*) ;;
14321 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14323 echo "Prototype: $try" ;;
14326 *) case "$usethreads" in
14327 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14334 *) getpwnam_r_proto=0
14338 : see if getpwuid_r exists
14339 set getpwuid_r d_getpwuid_r
14341 case "$d_getpwuid_r" in
14343 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14344 case "$d_getpwuid_r_proto:$usethreads" in
14345 ":define") d_getpwuid_r_proto=define
14346 set d_getpwuid_r_proto getpwuid_r $hdrs
14350 case "$d_getpwuid_r_proto" in
14352 case "$getpwuid_r_proto" in
14353 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14354 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14356 case "$getpwuid_r_proto" in
14357 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14358 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14360 case "$getpwuid_r_proto" in
14361 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14362 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14364 case "$getpwuid_r_proto" in
14365 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14366 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14368 case "$getpwuid_r_proto" in
14369 ''|0) d_getpwuid_r=undef
14371 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14372 * ) case "$getpwuid_r_proto" in
14373 REENTRANT_PROTO*) ;;
14374 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14376 echo "Prototype: $try" ;;
14379 *) case "$usethreads" in
14380 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14387 *) getpwuid_r_proto=0
14391 : Optional checks for getsbyname and getsbyport
14393 : see if getservbyname exists
14394 set getservbyname d_getsbyname
14397 : see if getservbyport exists
14398 set getservbyport d_getsbyport
14401 : see if getservent exists
14402 set getservent d_getsent
14405 : see if getservbyname_r exists
14406 set getservbyname_r d_getservbyname_r
14408 case "$d_getservbyname_r" in
14410 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14411 case "$d_getservbyname_r_proto:$usethreads" in
14412 ":define") d_getservbyname_r_proto=define
14413 set d_getservbyname_r_proto getservbyname_r $hdrs
14417 case "$d_getservbyname_r_proto" in
14419 case "$getservbyname_r_proto" in
14420 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14421 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14423 case "$getservbyname_r_proto" in
14424 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14425 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14427 case "$getservbyname_r_proto" in
14428 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14429 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14431 case "$getservbyname_r_proto" in
14432 ''|0) d_getservbyname_r=undef
14433 getservbyname_r_proto=0
14434 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14435 * ) case "$getservbyname_r_proto" in
14436 REENTRANT_PROTO*) ;;
14437 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14439 echo "Prototype: $try" ;;
14442 *) case "$usethreads" in
14443 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14445 d_getservbyname_r=undef
14446 getservbyname_r_proto=0
14450 *) getservbyname_r_proto=0
14454 : see if getservbyport_r exists
14455 set getservbyport_r d_getservbyport_r
14457 case "$d_getservbyport_r" in
14459 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14460 case "$d_getservbyport_r_proto:$usethreads" in
14461 ":define") d_getservbyport_r_proto=define
14462 set d_getservbyport_r_proto getservbyport_r $hdrs
14466 case "$d_getservbyport_r_proto" in
14468 case "$getservbyport_r_proto" in
14469 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14470 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14472 case "$getservbyport_r_proto" in
14473 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14474 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14476 case "$getservbyport_r_proto" in
14477 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14478 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14480 case "$getservbyport_r_proto" in
14481 ''|0) d_getservbyport_r=undef
14482 getservbyport_r_proto=0
14483 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14484 * ) case "$getservbyport_r_proto" in
14485 REENTRANT_PROTO*) ;;
14486 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14488 echo "Prototype: $try" ;;
14491 *) case "$usethreads" in
14492 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14494 d_getservbyport_r=undef
14495 getservbyport_r_proto=0
14499 *) getservbyport_r_proto=0
14503 : see if getservent_r exists
14504 set getservent_r d_getservent_r
14506 case "$d_getservent_r" in
14508 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14509 case "$d_getservent_r_proto:$usethreads" in
14510 ":define") d_getservent_r_proto=define
14511 set d_getservent_r_proto getservent_r $hdrs
14515 case "$d_getservent_r_proto" in
14517 case "$getservent_r_proto" in
14518 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14519 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14521 case "$getservent_r_proto" in
14522 ''|0) try='int getservent_r(struct servent*, char*, int);'
14523 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14525 case "$getservent_r_proto" in
14526 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14527 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14529 case "$getservent_r_proto" in
14530 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14531 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14533 case "$getservent_r_proto" in
14534 ''|0) d_getservent_r=undef
14535 getservent_r_proto=0
14536 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14537 * ) case "$getservent_r_proto" in
14538 REENTRANT_PROTO*) ;;
14539 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14541 echo "Prototype: $try" ;;
14544 *) case "$usethreads" in
14545 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14547 d_getservent_r=undef
14548 getservent_r_proto=0
14552 *) getservent_r_proto=0
14556 : see if prototypes for various getservxxx netdb.h functions are available
14558 set d_getservprotos getservent $i_netdb netdb.h
14561 : see if getspnam exists
14562 set getspnam d_getspnam
14565 : see if this is a shadow.h system
14566 set shadow.h i_shadow
14569 : see if getspnam_r exists
14570 set getspnam_r d_getspnam_r
14572 case "$d_getspnam_r" in
14574 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14575 case "$d_getspnam_r_proto:$usethreads" in
14576 ":define") d_getspnam_r_proto=define
14577 set d_getspnam_r_proto getspnam_r $hdrs
14581 case "$d_getspnam_r_proto" in
14583 case "$getspnam_r_proto" in
14584 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14585 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14587 case "$getspnam_r_proto" in
14588 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14589 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14591 case "$getspnam_r_proto" in
14592 ''|0) d_getspnam_r=undef
14594 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14595 * ) case "$getspnam_r_proto" in
14596 REENTRANT_PROTO*) ;;
14597 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14599 echo "Prototype: $try" ;;
14602 *) case "$usethreads" in
14603 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14610 *) getspnam_r_proto=0
14614 : see if gettimeofday or ftime exists
14615 set gettimeofday d_gettimeod
14617 case "$d_gettimeod" in
14623 val="$undef"; set d_ftime; eval $setvar
14626 case "$d_gettimeod$d_ftime" in
14629 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14633 : see if gmtime_r exists
14634 set gmtime_r d_gmtime_r
14636 case "$d_gmtime_r" in
14638 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14639 case "$d_gmtime_r_proto:$usethreads" in
14640 ":define") d_gmtime_r_proto=define
14641 set d_gmtime_r_proto gmtime_r $hdrs
14645 case "$d_gmtime_r_proto" in
14647 case "$gmtime_r_proto" in
14648 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14649 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14651 case "$gmtime_r_proto" in
14652 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14653 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14655 case "$gmtime_r_proto" in
14656 ''|0) d_gmtime_r=undef
14658 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14659 * ) case "$gmtime_r_proto" in
14660 REENTRANT_PROTO*) ;;
14661 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14663 echo "Prototype: $try" ;;
14666 *) case "$usethreads" in
14667 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14674 *) gmtime_r_proto=0
14678 : see if hasmntopt exists
14679 set hasmntopt d_hasmntopt
14682 : see if this is a netinet/in.h or sys/in.h system
14683 set netinet/in.h i_niin sys/in.h i_sysin
14686 : see if arpa/inet.h has to be included
14687 set arpa/inet.h i_arpainet
14690 : see if htonl --and friends-- exists
14695 : Maybe they are macros.
14698 $cat >htonl.c <<EOM
14700 #include <sys/types.h>
14701 #$i_niin I_NETINET_IN
14703 #$i_arpainet I_ARPA_INET
14704 #ifdef I_NETINET_IN
14705 #include <netinet/in.h>
14708 #include <sys/in.h>
14711 #include <arpa/inet.h>
14714 printf("Defined as a macro.");
14717 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14718 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14720 echo "But it seems to be defined as a macro." >&4
14728 : see if ilogbl exists
14729 set ilogbl d_ilogbl
14734 if set index val -f; eval $csym; $val; then
14735 if set strchr val -f d_strchr; eval $csym; $val; then
14736 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14739 echo "strchr() found." >&4
14743 echo "index() found." >&4
14748 echo "index() found." >&4
14751 if set strchr val -f d_strchr; eval $csym; $val; then
14754 echo "strchr() found." >&4
14756 echo "No index() or strchr() found!" >&4
14761 set d_strchr; eval $setvar
14763 set d_index; eval $setvar
14765 : check whether inet_aton exists
14766 set inet_aton d_inetaton
14771 $cat >isascii.c <<EOCP
14774 #$i_stdlib I_STDLIB
14776 #include <stdlib.h>
14787 if eval $compile; then
14788 echo "isascii() found." >&4
14791 echo "isascii() NOT found." >&4
14798 : see if isfinite exists
14799 set isfinite d_isfinite
14802 : see if isinf exists
14806 : see if isnan exists
14810 : see if isnanl exists
14811 set isnanl d_isnanl
14814 : see if killpg exists
14815 set killpg d_killpg
14818 : see if lchown exists
14820 $cat > try.c <<'EOCP'
14821 /* System header to define __stub macros and hopefully few prototypes,
14822 which can conflict with char lchown(); below. */
14823 #include <assert.h>
14824 /* Override any gcc2 internal prototype to avoid an error. */
14825 /* We use char because int might match the return type of a gcc2
14826 builtin and then its argument prototype would still apply. */
14829 /* The GNU C library defines this for functions which it implements
14830 to always fail with ENOSYS. Some functions are actually named
14831 something starting with __ and the normal name is an alias. */
14832 #if defined (__stub_lchown) || defined (__stub___lchown)
14840 if eval $compile; then
14841 $echo "lchown() found." >&4
14844 $echo "lchown() NOT found." >&4
14850 : See if number of significant digits in a double precision number is known
14852 $cat >ldbl_dig.c <<EOM
14853 #$i_limits I_LIMITS
14856 #include <limits.h>
14862 printf("Contains LDBL_DIG");
14865 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14866 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14867 echo "LDBL_DIG found." >&4
14870 echo "LDBL_DIG NOT found." >&4
14877 : see if this is a math.h system
14881 : check to see if math.h defines _LIB_VERSION
14882 d_libm_lib_version="$undef"
14886 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14888 #include <unistd.h>
14890 int main (int argc, char *argv[])
14892 printf ("%d\n", _LIB_VERSION);
14897 if eval $compile; then
14899 echo "Yes, it does ($foo)" >&4
14900 d_libm_lib_version="$define"
14902 echo "No, it does not (probably harmless)" >&4
14909 : see if link exists
14913 : see if localtime_r exists
14914 set localtime_r d_localtime_r
14916 case "$d_localtime_r" in
14918 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14919 case "$d_localtime_r_proto:$usethreads" in
14920 ":define") d_localtime_r_proto=define
14921 set d_localtime_r_proto localtime_r $hdrs
14925 case "$d_localtime_r_proto" in
14927 case "$localtime_r_proto" in
14928 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14929 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14931 case "$localtime_r_proto" in
14932 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14933 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14935 case "$localtime_r_proto" in
14936 ''|0) d_localtime_r=undef
14937 localtime_r_proto=0
14938 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14939 * ) case "$localtime_r_proto" in
14940 REENTRANT_PROTO*) ;;
14941 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14943 echo "Prototype: $try" ;;
14946 *) case "$usethreads" in
14947 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14949 d_localtime_r=undef
14950 localtime_r_proto=0
14954 *) localtime_r_proto=0
14958 : see if localtime_r calls tzset
14959 case "$localtime_r_proto" in
14962 /* Does our libc's localtime_r call tzset ?
14963 * return 0 if so, 1 otherwise.
14965 #include <sys/types.h>
14966 #include <unistd.h>
14968 #include <string.h>
14969 #include <malloc.h>
14972 time_t t = time(0L);
14973 char w_tz[]="TZ" "=GMT+5",
14974 e_tz[]="TZ" "=GMT-5",
14975 *tz_e = (char*)malloc(16),
14976 *tz_w = (char*)malloc(16);
14977 struct tm tm_e, tm_w;
14978 memset(&tm_e,'\0',sizeof(struct tm));
14979 memset(&tm_w,'\0',sizeof(struct tm));
14984 localtime_r(&t, &tm_e);
14987 localtime_r(&t, &tm_w);
14989 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14995 if eval $compile; then
14996 if $run ./try; then
14997 d_localtime_r_needs_tzset=undef;
14999 d_localtime_r_needs_tzset=define;
15002 d_localtime_r_needs_tzset=undef;
15006 d_localtime_r_needs_tzset=undef;
15011 : see if localeconv exists
15012 set localeconv d_locconv
15015 : see if lockf exists
15019 : see if prototype for lseek is available
15021 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15024 : see if lstat exists
15028 : see if madvise exists
15029 set madvise d_madvise
15032 : see if malloc_size exists
15033 set malloc_size d_malloc_size
15036 : see if malloc_size_good exists
15037 set malloc_good_size d_malloc_good_size
15040 : see if mblen exists
15044 : see if mbstowcs exists
15045 set mbstowcs d_mbstowcs
15048 : see if mbtowc exists
15049 set mbtowc d_mbtowc
15052 : see if memchr exists
15053 set memchr d_memchr
15056 : see if memcmp exists
15057 set memcmp d_memcmp
15060 : see if memcpy exists
15061 set memcpy d_memcpy
15064 : see if memmove exists
15065 set memmove d_memmove
15068 : see if memset exists
15069 set memset d_memset
15072 : see if mkdir exists
15076 : see if mkdtemp exists
15077 set mkdtemp d_mkdtemp
15080 : see if mkfifo exists
15081 set mkfifo d_mkfifo
15084 : see if mkstemp exists
15085 set mkstemp d_mkstemp
15088 : see if mkstemps exists
15089 set mkstemps d_mkstemps
15092 : see if mktime exists
15093 set mktime d_mktime
15096 : see if this is a sys/mman.h system
15097 set sys/mman.h i_sysmman
15100 : see if mmap exists
15103 : see what shmat returns
15104 : default to something harmless
15106 case "$i_sysmman$d_mmap" in
15108 $cat >mmap.c <<'END'
15109 #include <sys/mman.h>
15112 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15117 echo "and it returns ($mmaptype)." >&4
15123 : see if sqrtl exists
15127 : see if scalbnl exists
15128 set scalbnl d_scalbnl
15131 : see if modfl exists
15135 : see if prototype for modfl is available
15137 set d_modflproto modfl $i_math math.h
15140 d_modfl_pow32_bug="$undef"
15142 case "$d_longdbl$d_modfl" in
15145 Checking to see whether your modfl() is okay for large values...
15151 if $test "X$d_modflproto" != "X$define"; then
15152 $cat >>try.c <<EOCP
15153 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15154 long double modfl (long double, long double *);
15157 $cat >>try.c <<EOCP
15159 long double nv = 4294967303.15;
15165 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15169 case "$osname:$gccversion" in
15170 aix:) saveccflags="$ccflags"
15171 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15174 if eval $compile; then
15177 *" 4294967303.150000 1.150000 4294967302.000000")
15178 echo >&4 "Your modfl() is broken for large values."
15179 d_modfl_pow32_bug="$define"
15181 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15185 *" 4294967303.150000 0.150000 4294967303.000000")
15186 echo >&4 "Your modfl() seems okay for large values."
15188 *) echo >&4 "I don't understand your modfl() at all."
15194 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15197 case "$osname:$gccversion" in
15198 aix:) ccflags="$saveccflags" ;; # restore
15203 if $test "$uselongdouble" = "$define"; then
15205 if $test "$d_sqrtl" != "$define"; then
15206 message="$message sqrtl"
15208 if $test "$d_modfl" != "$define"; then
15209 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15210 echo "You have both aintl and copysignl, so I can emulate modfl."
15212 message="$message modfl"
15215 if $test "$d_frexpl" != "$define"; then
15216 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15217 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15219 message="$message frexpl"
15223 if $test "$message" != ""; then
15226 *** You requested the use of long doubles but you do not seem to have
15227 *** the following mathematical functions needed for long double support:
15229 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15230 *** Cannot continue, aborting.
15238 : see if mprotect exists
15239 set mprotect d_mprotect
15242 : see if msgctl exists
15243 set msgctl d_msgctl
15246 : see if msgget exists
15247 set msgget d_msgget
15250 : see if msgsnd exists
15251 set msgsnd d_msgsnd
15254 : see if msgrcv exists
15255 set msgrcv d_msgrcv
15258 : see how much of the 'msg*(2)' library is present.
15261 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15262 *"$undef"*) h_msg=false;;
15266 case "`ipcs 2>&1`" in
15267 "SVID messages"*"not configured"*)
15268 echo "Your $osname does not have the msg*(2) configured." >&4
15271 set msgctl d_msgctl
15273 set msgget d_msgget
15275 set msgsnd d_msgsnd
15277 set msgrcv d_msgrcv
15283 : we could also check for sys/ipc.h ...
15284 if $h_msg && $test `./findhdr sys/msg.h`; then
15285 echo "You have the full msg*(2) library." >&4
15288 echo "You don't have the full msg*(2) library." >&4
15294 : Check for msghdr_s
15296 echo "Checking to see if your system supports struct msghdr..." >&4
15297 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15299 case "$d_msghdr_s" in
15300 "$define") echo "Yes, it does." ;;
15301 *) echo "No, it doesn't." ;;
15305 : see if msync exists
15309 : see if munmap exists
15310 set munmap d_munmap
15313 : see if nice exists
15317 : see if this is a langinfo.h system
15318 set langinfo.h i_langinfo
15321 : see if nl_langinfo exists
15322 set nl_langinfo d_nl_langinfo
15325 : check for volatile keyword
15327 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15328 $cat >try.c <<'EOCP'
15331 typedef struct _goo_struct goo_struct;
15332 goo_struct * volatile goo = ((goo_struct *)0);
15333 struct _goo_struct {
15338 typedef unsigned short foo_t;
15339 char *volatile foo;
15341 volatile foo_t blech;
15345 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15347 echo "Yup, it does."
15350 echo "Nope, it doesn't."
15356 : Check basic sizes
15358 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15360 case "$use64bitint:$d_quad:$quadtype" in
15363 uvtype="$uquadtype"
15368 uvtype="unsigned long"
15374 case "$uselongdouble:$d_longdbl" in
15376 nvtype="long double"
15377 nvsize=$longdblsize
15384 $echo "(IV will be "$ivtype", $ivsize bytes)"
15385 $echo "(UV will be "$uvtype", $uvsize bytes)"
15386 $echo "(NV will be "$nvtype", $nvsize bytes)"
15389 #$i_inttypes I_INTTYPES
15391 #include <inttypes.h>
15396 int8_t i = INT8_MAX;
15397 uint8_t u = UINT8_MAX;
15398 printf("int8_t\n");
15401 int16_t i = INT16_MAX;
15402 uint16_t i = UINT16_MAX;
15403 printf("int16_t\n");
15406 int32_t i = INT32_MAX;
15407 uint32_t u = UINT32_MAX;
15408 printf("int32_t\n");
15413 i8type="signed char"
15414 u8type="unsigned char"
15419 '') case "$shortsize" in
15421 u16type="unsigned short"
15429 '') set try -DINT16
15430 if eval $compile; then
15431 case "`$run ./try`" in
15443 '') if $test $shortsize -ge 2; then
15445 u16type="unsigned short"
15453 '') case "$longsize" in
15455 u32type="unsigned long"
15459 *) case "$intsize" in
15461 u32type="unsigned int"
15471 '') set try -DINT32
15472 if eval $compile; then
15473 case "`$run ./try`" in
15485 '') if $test $intsize -ge 4; then
15487 u32type="unsigned int"
15495 '') case "$d_quad:$quadtype" in
15497 i64type="$quadtype"
15498 u64type="$uquadtype"
15506 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15507 : volatile so that the compiler has to store it out to memory.
15508 if test X"$d_volatile" = X"$define"; then
15513 #$i_stdlib I_STDLIB
15515 #include <stdlib.h>
15517 #include <sys/types.h>
15518 #include <signal.h>
15520 $volatile int bletched = 0;
15521 $signal_t blech(int s) { bletched = 1; }
15526 int n = 8 * $uvsize;
15529 signal(SIGFPE, blech);
15532 for (i = 0; i < n; i++) {
15533 u = u << 1 | ($uvtype)1;
15535 if (($uvtype)d != u)
15539 d = ($nvtype)(u - 1);
15540 if (($uvtype)d != (u - 1))
15547 printf("%d\n", ((i == n) ? -n : i));
15553 d_nv_preserves_uv="$undef"
15554 if eval $compile; then
15555 nv_preserves_uv_bits="`$run ./try`"
15557 case "$nv_preserves_uv_bits" in
15559 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15560 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15561 d_nv_preserves_uv="$define"
15563 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15564 d_nv_preserves_uv="$undef" ;;
15565 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15566 nv_preserves_uv_bits="0" ;;
15570 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15571 : volatile so that the compiler has to store it out to memory.
15572 if test X"$d_volatile" = X"$define"; then
15578 typedef $nvtype NV;
15585 while(count < 256) {
15586 $volatile NV up = value + 1.0;
15587 $volatile NV negated = -value;
15588 $volatile NV down = negated - 1.0;
15589 $volatile NV got_up = up - value;
15590 int up_good = got_up == 1.0;
15591 int got_down = down - negated;
15592 int down_good = got_down == -1.0;
15594 if (down_good != up_good) {
15596 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15597 up_good, (double) got_up, down_good, (double) got_down,
15598 count, (double) value);
15605 fputs("256.0", stdout);
15608 fputs("2.0", stdout);
15614 fputs("*", stdout);
15620 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15621 count, (double) value);
15627 nv_overflows_integers_at='0'
15628 if eval $compile; then
15634 The largest integer your NVs can preserve is equal to $xxx
15636 nv_overflows_integers_at="$xxx"
15639 Cannot determine the largest integer value your NVs can hold, unexpected output
15646 Cannot determine the largest integer value your NVs can hold
15653 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15654 : volatile so that the compiler has to store it out to memory.
15655 if test X"$d_volatile" = X"$define"; then
15660 #$i_stdlib I_STDLIB
15662 #include <stdlib.h>
15664 #$i_string I_STRING
15666 # include <string.h>
15668 # include <strings.h>
15670 #include <sys/types.h>
15671 #include <signal.h>
15673 $volatile int bletched = 0;
15674 $signal_t blech(int s) { bletched = 1; }
15677 int checkit($nvtype d, char *where) {
15678 unsigned char *p = (char *)&d;
15679 unsigned char *end = p + sizeof(d);
15689 printf("No - %s: 0x", where);
15691 printf ("%02X", *p++);
15696 int main(int argc, char **argv) {
15699 fail += checkit(d, "0.0");
15701 /* The compiler shouldn't be assuming that bletched is 0 */
15704 fail += checkit(d, "bleched");
15707 signal(SIGFPE, blech);
15710 /* Paranoia - the compiler should have no way of knowing that ANSI says
15711 that argv[argc] will always be NULL. Actually, if it did assume this it
15712 would be buggy, as this is C and main() can be called from elsewhere in
15714 d = argv[argc] ? 1 : 0;
15717 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15720 fail += checkit(d, "ternary");
15722 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15725 printf("No - memset doesn't give 0.0\n");
15726 /* This might just blow up: */
15727 printf("(gives %g)\n", d);
15733 printf("No - something bleched\n");
15738 printf("No - %d fail(s)\n", fail);
15747 d_nv_zero_is_allbits_zero="$undef"
15748 if eval $compile; then
15754 0.0 is represented as all bits zero in memory
15756 d_nv_zero_is_allbits_zero="$define"
15759 0.0 is not represented as all bits zero in memory
15761 d_nv_zero_is_allbits_zero="$undef"
15766 0.0 is not represented as all bits zero in memory
15768 d_nv_zero_is_allbits_zero="$undef"
15774 : check for off64_t
15776 echo "Checking to see if you have off64_t..." >&4
15778 #include <sys/types.h>
15779 #include <unistd.h>
15780 int main() { off64_t x = 7; }
15783 if eval $compile; then
15785 echo "You have off64_t."
15788 echo "You do not have off64_t."
15789 case "$lseeksize" in
15790 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15797 : how to create joinable pthreads
15798 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15800 echo "Checking what constant to use for creating joinable pthreads..." >&4
15801 $cat >try.c <<'EOCP'
15802 #include <pthread.h>
15804 int detachstate = JOINABLE;
15807 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15808 if eval $compile; then
15809 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15810 val="$undef" # Yes, undef.
15811 set d_old_pthread_create_joinable
15814 set old_pthread_create_joinable
15817 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15818 if eval $compile; then
15819 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15821 set d_old_pthread_create_joinable
15823 val=PTHREAD_CREATE_UNDETACHED
15824 set old_pthread_create_joinable
15827 set try -DJOINABLE=__UNDETACHED
15828 if eval $compile; then
15829 echo "You seem to use __UNDETACHED." >&4
15831 set d_old_pthread_create_joinable
15834 set old_pthread_create_joinable
15837 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15839 set d_old_pthread_create_joinable
15842 set old_pthread_create_joinable
15849 d_old_pthread_create_joinable="$undef"
15850 old_pthread_create_joinable=""
15853 : see if pause exists
15857 : see if poll exists
15861 : see if readlink exists
15862 set readlink d_readlink
15865 : Check if exe is symlink to abs path of executing program
15869 case "$d_readlink" in
15871 if $issymlink /proc/self/exe ; then
15872 $ls -l /proc/self/exe > reflect
15873 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15874 echo "You have Linux-like /proc/self/exe."
15875 procselfexe='"/proc/self/exe"'
15879 if $issymlink /proc/curproc/file ; then
15880 $ls -l /proc/curproc/file > reflect
15881 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15882 echo "You have BSD-like /proc/curproc/file."
15883 procselfexe='"/proc/curproc/file"'
15893 : backward compatibility for d_hvfork
15894 if test X$d_hvfork != X; then
15895 d_vfork="$d_hvfork"
15898 : see if there is a vfork
15903 d_pseudofork=$undef
15905 : Ok, but do we want to use it. vfork is reportedly unreliable in
15906 : perl on Solaris 2.x, and probably elsewhere.
15910 case "$usevfork" in
15916 Perl can only use a vfork() that doesn't suffer from strict
15917 restrictions on calling functions or modifying global data in
15918 the child. For example, glibc-2.1 contains such a vfork()
15919 that is unsuitable. If your system provides a proper fork()
15920 call, chances are that you do NOT want perl to use vfork().
15923 rp="Do you still want to use vfork()?"
15928 echo "Ok, we won't use vfork()."
15937 $define) usevfork='true';;
15938 *) usevfork='false';;
15941 : see whether the pthread_atfork exists
15943 #include <pthread.h>
15946 #ifdef PTHREAD_ATFORK
15947 pthread_atfork(NULL,NULL,NULL);
15952 : see if pthread_atfork exists
15953 set try -DPTHREAD_ATFORK
15954 if eval $compile; then
15959 case "$usethreads" in
15962 $define) echo 'pthread_atfork found.' >&4 ;;
15963 *) echo 'pthread_atfork NOT found.' >&4 ;;
15966 set d_pthread_atfork
15969 : see if pthread_attr_setscope exists
15970 set pthread_attr_setscope d_pthread_attr_setscope
15973 : see whether the various POSIXish _yields exist
15975 #include <pthread.h>
15981 #ifdef PTHREAD_YIELD
15984 #ifdef PTHREAD_YIELD_NULL
15985 pthread_yield(NULL);
15991 : see if sched_yield exists
15992 set try -DSCHED_YIELD
15993 if eval $compile; then
15995 sched_yield='sched_yield()'
15999 case "$usethreads" in
16002 $define) echo 'sched_yield() found.' >&4 ;;
16003 *) echo 'sched_yield() NOT found.' >&4 ;;
16009 : see if pthread_yield exists
16010 set try -DPTHREAD_YIELD
16011 if eval $compile; then
16013 case "$sched_yield" in
16014 '') sched_yield='pthread_yield()' ;;
16017 set try -DPTHREAD_YIELD_NULL
16018 if eval $compile; then
16020 case "$sched_yield" in
16021 '') sched_yield='pthread_yield(NULL)' ;;
16027 case "$usethreads" in
16030 $define) echo 'pthread_yield() found.' >&4 ;;
16031 *) echo 'pthread_yield() NOT found.' >&4 ;;
16035 set d_pthread_yield
16037 case "$sched_yield" in
16038 '') sched_yield=undef ;;
16042 : see if random_r exists
16043 set random_r d_random_r
16045 case "$d_random_r" in
16047 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16048 case "$d_random_r_proto:$usethreads" in
16049 ":define") d_random_r_proto=define
16050 set d_random_r_proto random_r $hdrs
16054 case "$d_random_r_proto" in
16056 case "$random_r_proto" in
16057 ''|0) try='int random_r(int*, struct random_data*);'
16058 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
16060 case "$random_r_proto" in
16061 ''|0) try='int random_r(long*, struct random_data*);'
16062 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
16064 case "$random_r_proto" in
16065 ''|0) try='int random_r(struct random_data*, int32_t*);'
16066 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
16068 case "$random_r_proto" in
16069 ''|0) d_random_r=undef
16071 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16072 * ) case "$random_r_proto" in
16073 REENTRANT_PROTO*) ;;
16074 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16076 echo "Prototype: $try" ;;
16079 *) case "$usethreads" in
16080 define) echo "random_r has no prototype, not using it." >&4 ;;
16087 *) random_r_proto=0
16091 : see if readdir and friends exist
16092 set readdir d_readdir
16094 set seekdir d_seekdir
16096 set telldir d_telldir
16098 set rewinddir d_rewinddir
16101 : see if readdir64_r exists
16102 set readdir64_r d_readdir64_r
16104 case "$d_readdir64_r" in
16106 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16107 case "$d_readdir64_r_proto:$usethreads" in
16108 ":define") d_readdir64_r_proto=define
16109 set d_readdir64_r_proto readdir64_r $hdrs
16113 case "$d_readdir64_r_proto" in
16115 case "$readdir64_r_proto" in
16116 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16117 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16119 case "$readdir64_r_proto" in
16120 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16121 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16123 case "$readdir64_r_proto" in
16124 ''|0) d_readdir64_r=undef
16125 readdir64_r_proto=0
16126 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16127 * ) case "$readdir64_r_proto" in
16128 REENTRANT_PROTO*) ;;
16129 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16131 echo "Prototype: $try" ;;
16134 *) case "$usethreads" in
16135 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16137 d_readdir64_r=undef
16138 readdir64_r_proto=0
16142 *) readdir64_r_proto=0
16146 : see if readdir_r exists
16147 set readdir_r d_readdir_r
16149 case "$d_readdir_r" in
16151 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16152 case "$d_readdir_r_proto:$usethreads" in
16153 ":define") d_readdir_r_proto=define
16154 set d_readdir_r_proto readdir_r $hdrs
16158 case "$d_readdir_r_proto" in
16160 case "$readdir_r_proto" in
16161 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16162 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16164 case "$readdir_r_proto" in
16165 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16166 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16168 case "$readdir_r_proto" in
16169 ''|0) d_readdir_r=undef
16171 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16172 * ) case "$readdir_r_proto" in
16173 REENTRANT_PROTO*) ;;
16174 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16176 echo "Prototype: $try" ;;
16179 *) case "$usethreads" in
16180 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16187 *) readdir_r_proto=0
16191 : see if readv exists
16195 : see if recvmsg exists
16196 set recvmsg d_recvmsg
16199 : see if rename exists
16200 set rename d_rename
16203 : see if rmdir exists
16207 : see if memory.h is available.
16212 : See if it conflicts with string.h
16218 $cppstdin $cppflags $cppminus < $strings > mem.h
16219 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16221 echo "We won't be including <memory.h>."
16231 : can bcopy handle overlapping blocks?
16234 case "$d_memmove" in
16235 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16236 *) case "$d_bcopy" in
16238 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16240 #$i_memory I_MEMORY
16241 #$i_stdlib I_STDLIB
16242 #$i_string I_STRING
16243 #$i_unistd I_UNISTD
16245 $cat >>try.c <<'EOCP'
16248 # include <memory.h>
16251 # include <stdlib.h>
16254 # include <string.h>
16256 # include <strings.h>
16259 # include <unistd.h> /* Needed for NetBSD */
16263 char buf[128], abc[128];
16269 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16270 try to store the string in read-only memory. */
16271 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16273 for (align = 7; align >= 0; align--) {
16274 for (len = 36; len; len--) {
16276 bcopy(abc, b, len);
16277 for (off = 1; off <= len; off++) {
16278 bcopy(b, b+off, len);
16279 bcopy(b+off, b, len);
16280 if (bcmp(b, abc, len))
16289 if eval $compile_ok; then
16290 if $run ./try 2>/dev/null; then
16291 echo "Yes, it can."
16294 echo "It can't, sorry."
16297 echo "(I can't compile the test program, so we'll assume not...)"
16307 : can memcpy handle overlapping blocks?
16310 case "$d_memmove" in
16311 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16312 *) case "$d_memcpy" in
16314 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16316 #$i_memory I_MEMORY
16317 #$i_stdlib I_STDLIB
16318 #$i_string I_STRING
16319 #$i_unistd I_UNISTD
16321 $cat >>try.c <<'EOCP'
16324 # include <memory.h>
16327 # include <stdlib.h>
16330 # include <string.h>
16332 # include <strings.h>
16335 # include <unistd.h> /* Needed for NetBSD */
16339 char buf[128], abc[128];
16345 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16346 try to store the string in read-only memory. */
16347 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16349 for (align = 7; align >= 0; align--) {
16350 for (len = 36; len; len--) {
16352 memcpy(b, abc, len);
16353 for (off = 1; off <= len; off++) {
16354 memcpy(b+off, b, len);
16355 memcpy(b, b+off, len);
16356 if (memcmp(b, abc, len))
16365 if eval $compile_ok; then
16366 if $run ./try 2>/dev/null; then
16367 echo "Yes, it can."
16370 echo "It can't, sorry."
16373 echo "(I can't compile the test program, so we'll assume not...)"
16383 : can memcmp be trusted to compare relative magnitude?
16385 case "$d_memcmp" in
16388 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16390 #$i_memory I_MEMORY
16391 #$i_stdlib I_STDLIB
16392 #$i_string I_STRING
16393 #$i_unistd I_UNISTD
16395 $cat >>try.c <<'EOCP'
16398 # include <memory.h>
16401 # include <stdlib.h>
16404 # include <string.h>
16406 # include <strings.h>
16409 # include <unistd.h> /* Needed for NetBSD */
16415 if ((a < b) && memcmp(&a, &b, 1) < 0)
16421 if eval $compile_ok; then
16422 if $run ./try 2>/dev/null; then
16423 echo "Yes, it can."
16426 echo "No, it can't (it uses signed chars)."
16429 echo "(I can't compile the test program, so we'll assume not...)"
16437 : see if prototype for sbrk is available
16439 set d_sbrkproto sbrk $i_unistd unistd.h
16442 : see if select exists
16443 set select d_select
16446 : see if semctl exists
16447 set semctl d_semctl
16450 : see if semget exists
16451 set semget d_semget
16454 : see if semop exists
16458 : see how much of the 'sem*(2)' library is present.
16461 case "$d_semctl$d_semget$d_semop" in
16462 *"$undef"*) h_sem=false;;
16466 case "`ipcs 2>&1`" in
16467 "SVID messages"*"not configured"*)
16468 echo "Your $osname does not have the sem*(2) configured." >&4
16471 set semctl d_semctl
16473 set semget d_semget
16481 : we could also check for sys/ipc.h ...
16482 if $h_sem && $test `./findhdr sys/sem.h`; then
16483 echo "You have the full sem*(2) library." >&4
16486 echo "You don't have the full sem*(2) library." >&4
16492 : see whether sys/sem.h defines union semun
16494 $cat > try.c <<'END'
16495 #include <sys/types.h>
16496 #include <sys/ipc.h>
16497 #include <sys/sem.h>
16498 int main () { union semun semun; semun.buf = 0; }
16501 if eval $compile; then
16502 echo "You have union semun in <sys/sem.h>." >&4
16505 echo "You do not have union semun in <sys/sem.h>." >&4
16512 : see how to do semctl IPC_STAT
16516 $cat > tryh.h <<END
16519 # define S_IRUSR S_IREAD
16520 # define S_IWUSR S_IWRITE
16521 # define S_IXUSR S_IEXEC
16523 # define S_IRUSR 0400
16524 # define S_IWUSR 0200
16525 # define S_IXUSR 0100
16527 # define S_IRGRP (S_IRUSR>>3)
16528 # define S_IWGRP (S_IWUSR>>3)
16529 # define S_IXGRP (S_IXUSR>>3)
16530 # define S_IROTH (S_IRUSR>>6)
16531 # define S_IWOTH (S_IWUSR>>6)
16532 # define S_IXOTH (S_IXUSR>>6)
16535 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16536 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16537 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16540 : see whether semctl IPC_STAT can use union semun
16541 case "$d_semctl_semun" in
16545 #include <sys/types.h>
16546 #include <sys/ipc.h>
16547 #include <sys/sem.h>
16548 #include <sys/stat.h>
16555 #$d_union_semun HAS_UNION_SEMUN
16558 #ifndef HAS_UNION_SEMUN
16561 struct semid_ds *buf;
16562 unsigned short *array;
16568 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16569 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16571 struct semid_ds argbuf;
16574 st = semctl(sem, 0, IPC_STAT, arg);
16578 # endif /* IPC_STAT */
16579 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16581 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16582 # endif /* IPC_RMID */
16583 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16585 #endif /* IPC_PRIVATE && ... */
16586 printf("semget failed: errno = %d\n", errno);
16591 if eval $compile; then
16594 semun) val="$define" ;;
16602 case "$d_semctl_semun" in
16604 echo "You can use union semun for semctl IPC_STAT." >&4
16607 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16612 : see whether semctl IPC_STAT can use struct semid_ds pointer
16613 case "$d_semctl_semid_ds" in
16616 $cat > try.c <<'END'
16617 #include <sys/types.h>
16618 #include <sys/ipc.h>
16619 #include <sys/sem.h>
16620 #include <sys/stat.h>
16628 struct semid_ds arg;
16631 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16632 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16635 st = semctl(sem, 0, IPC_STAT, &arg);
16637 printf("semid_ds\n");
16639 # endif /* IPC_STAT */
16640 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16642 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16643 # endif /* IPC_RMID */
16644 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16646 #endif /* IPC_PRIVATE && ... */
16647 printf("semget failed: errno = %d\n", errno);
16653 if eval $compile; then
16656 semid_ds) val="$define" ;;
16660 set d_semctl_semid_ds
16664 case "$d_semctl_semid_ds" in
16666 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16668 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16674 # We do not have the full sem*(2) library, so assume we can not
16680 set d_semctl_semid_ds
16686 : see if sendmsg exists
16687 set sendmsg d_sendmsg
16690 : see if setegid exists
16691 set setegid d_setegid
16694 : see if seteuid exists
16695 set seteuid d_seteuid
16698 : see if setgrent exists
16699 set setgrent d_setgrent
16702 : see if setgrent_r exists
16703 set setgrent_r d_setgrent_r
16705 case "$d_setgrent_r" in
16707 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16708 case "$d_setgrent_r_proto:$usethreads" in
16709 ":define") d_setgrent_r_proto=define
16710 set d_setgrent_r_proto setgrent_r $hdrs
16714 case "$d_setgrent_r_proto" in
16716 case "$setgrent_r_proto" in
16717 ''|0) try='int setgrent_r(FILE**);'
16718 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16720 case "$setgrent_r_proto" in
16721 ''|0) try='void setgrent_r(FILE**);'
16722 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16724 case "$setgrent_r_proto" in
16725 ''|0) d_setgrent_r=undef
16727 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16728 * ) case "$setgrent_r_proto" in
16729 REENTRANT_PROTO*) ;;
16730 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16732 echo "Prototype: $try" ;;
16735 *) case "$usethreads" in
16736 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16743 *) setgrent_r_proto=0
16747 : see if sethostent exists
16748 set sethostent d_sethent
16751 : see if sethostent_r exists
16752 set sethostent_r d_sethostent_r
16754 case "$d_sethostent_r" in
16756 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16757 case "$d_sethostent_r_proto:$usethreads" in
16758 ":define") d_sethostent_r_proto=define
16759 set d_sethostent_r_proto sethostent_r $hdrs
16763 case "$d_sethostent_r_proto" in
16765 case "$sethostent_r_proto" in
16766 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16767 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16769 case "$sethostent_r_proto" in
16770 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16771 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16773 case "$sethostent_r_proto" in
16774 ''|0) d_sethostent_r=undef
16775 sethostent_r_proto=0
16776 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16777 * ) case "$sethostent_r_proto" in
16778 REENTRANT_PROTO*) ;;
16779 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16781 echo "Prototype: $try" ;;
16784 *) case "$usethreads" in
16785 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16787 d_sethostent_r=undef
16788 sethostent_r_proto=0
16792 *) sethostent_r_proto=0
16796 : see if setitimer exists
16797 set setitimer d_setitimer
16800 : see if setlinebuf exists
16801 set setlinebuf d_setlinebuf
16804 : see if setlocale exists
16805 set setlocale d_setlocale
16808 : see if locale.h is available
16809 set locale.h i_locale
16812 : see if setlocale_r exists
16813 set setlocale_r d_setlocale_r
16815 case "$d_setlocale_r" in
16817 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16818 case "$d_setlocale_r_proto:$usethreads" in
16819 ":define") d_setlocale_r_proto=define
16820 set d_setlocale_r_proto setlocale_r $hdrs
16824 case "$d_setlocale_r_proto" in
16826 case "$setlocale_r_proto" in
16827 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16828 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16830 case "$setlocale_r_proto" in
16831 ''|0) d_setlocale_r=undef
16832 setlocale_r_proto=0
16833 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16834 * ) case "$setlocale_r_proto" in
16835 REENTRANT_PROTO*) ;;
16836 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16838 echo "Prototype: $try" ;;
16841 *) case "$usethreads" in
16842 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16844 d_setlocale_r=undef
16845 setlocale_r_proto=0
16849 *) setlocale_r_proto=0
16853 : see if setnetent exists
16854 set setnetent d_setnent
16857 : see if setnetent_r exists
16858 set setnetent_r d_setnetent_r
16860 case "$d_setnetent_r" in
16862 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16863 case "$d_setnetent_r_proto:$usethreads" in
16864 ":define") d_setnetent_r_proto=define
16865 set d_setnetent_r_proto setnetent_r $hdrs
16869 case "$d_setnetent_r_proto" in
16871 case "$setnetent_r_proto" in
16872 ''|0) try='int setnetent_r(int, struct netent_data*);'
16873 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16875 case "$setnetent_r_proto" in
16876 ''|0) try='void setnetent_r(int, struct netent_data*);'
16877 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16879 case "$setnetent_r_proto" in
16880 ''|0) d_setnetent_r=undef
16881 setnetent_r_proto=0
16882 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16883 * ) case "$setnetent_r_proto" in
16884 REENTRANT_PROTO*) ;;
16885 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16887 echo "Prototype: $try" ;;
16890 *) case "$usethreads" in
16891 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16893 d_setnetent_r=undef
16894 setnetent_r_proto=0
16898 *) setnetent_r_proto=0
16902 : see if setprotoent exists
16903 set setprotoent d_setpent
16906 : see if setpgid exists
16907 set setpgid d_setpgid
16910 : see if setpgrp2 exists
16911 set setpgrp2 d_setpgrp2
16914 : see if setpriority exists
16915 set setpriority d_setprior
16918 : see if setproctitle exists
16919 set setproctitle d_setproctitle
16922 : see if setprotoent_r exists
16923 set setprotoent_r d_setprotoent_r
16925 case "$d_setprotoent_r" in
16927 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16928 case "$d_setprotoent_r_proto:$usethreads" in
16929 ":define") d_setprotoent_r_proto=define
16930 set d_setprotoent_r_proto setprotoent_r $hdrs
16934 case "$d_setprotoent_r_proto" in
16936 case "$setprotoent_r_proto" in
16937 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16938 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16940 case "$setprotoent_r_proto" in
16941 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16942 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16944 case "$setprotoent_r_proto" in
16945 ''|0) d_setprotoent_r=undef
16946 setprotoent_r_proto=0
16947 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16948 * ) case "$setprotoent_r_proto" in
16949 REENTRANT_PROTO*) ;;
16950 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16952 echo "Prototype: $try" ;;
16955 *) case "$usethreads" in
16956 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16958 d_setprotoent_r=undef
16959 setprotoent_r_proto=0
16963 *) setprotoent_r_proto=0
16967 : see if setpwent exists
16968 set setpwent d_setpwent
16971 : see if setpwent_r exists
16972 set setpwent_r d_setpwent_r
16974 case "$d_setpwent_r" in
16976 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16977 case "$d_setpwent_r_proto:$usethreads" in
16978 ":define") d_setpwent_r_proto=define
16979 set d_setpwent_r_proto setpwent_r $hdrs
16983 case "$d_setpwent_r_proto" in
16985 case "$setpwent_r_proto" in
16986 ''|0) try='int setpwent_r(FILE**);'
16987 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16989 case "$setpwent_r_proto" in
16990 ''|0) try='void setpwent_r(FILE**);'
16991 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16993 case "$setpwent_r_proto" in
16994 ''|0) d_setpwent_r=undef
16996 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16997 * ) case "$setpwent_r_proto" in
16998 REENTRANT_PROTO*) ;;
16999 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17001 echo "Prototype: $try" ;;
17004 *) case "$usethreads" in
17005 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17012 *) setpwent_r_proto=0
17016 : see if setregid exists
17017 set setregid d_setregid
17019 set setresgid d_setresgid
17022 : see if setreuid exists
17023 set setreuid d_setreuid
17025 set setresuid d_setresuid
17028 : see if setrgid exists
17029 set setrgid d_setrgid
17032 : see if setruid exists
17033 set setruid d_setruid
17036 : see if setservent exists
17037 set setservent d_setsent
17040 : see if setservent_r exists
17041 set setservent_r d_setservent_r
17043 case "$d_setservent_r" in
17045 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17046 case "$d_setservent_r_proto:$usethreads" in
17047 ":define") d_setservent_r_proto=define
17048 set d_setservent_r_proto setservent_r $hdrs
17052 case "$d_setservent_r_proto" in
17054 case "$setservent_r_proto" in
17055 ''|0) try='int setservent_r(int, struct servent_data*);'
17056 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
17058 case "$setservent_r_proto" in
17059 ''|0) try='void setservent_r(int, struct servent_data*);'
17060 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
17062 case "$setservent_r_proto" in
17063 ''|0) d_setservent_r=undef
17064 setservent_r_proto=0
17065 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17066 * ) case "$setservent_r_proto" in
17067 REENTRANT_PROTO*) ;;
17068 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17070 echo "Prototype: $try" ;;
17073 *) case "$usethreads" in
17074 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17076 d_setservent_r=undef
17077 setservent_r_proto=0
17081 *) setservent_r_proto=0
17085 : see if setsid exists
17086 set setsid d_setsid
17089 : see if setvbuf exists
17090 set setvbuf d_setvbuf
17093 : see if sfio.h is available
17097 : see if sfio library is available
17108 : Ok, but do we want to use it.
17112 true|$define|[yY]*) dflt='y';;
17115 echo "$package can use the sfio library, but it is experimental."
17116 case "$useperlio" in
17118 echo "For sfio also the PerlIO abstraction layer is needed."
17119 echo "Earlier you said you wouldn't want that."
17122 rp="You seem to have sfio available, do you want to try using it?"
17125 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17126 useperlio="$define"
17129 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17134 *) case "$usesfio" in
17135 true|$define|[yY]*)
17136 echo "Sorry, cannot find sfio on this machine." >&4
17137 echo "Ignoring your setting of usesfio=$usesfio." >&4
17146 $define) usesfio='true';;
17147 *) usesfio='false';;
17151 *) : Remove sfio from list of libraries to use
17154 echo "Removing unneeded -lsfio from library list" >&4
17155 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17158 echo "libs = $libs" >&4
17165 : see if shmctl exists
17166 set shmctl d_shmctl
17169 : see if shmget exists
17170 set shmget d_shmget
17173 : see if shmat exists
17176 : see what shmat returns
17179 $cat >shmat.c <<'END'
17180 #include <sys/shm.h>
17183 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17188 echo "and it returns ($shmattype)." >&4
17189 : see if a prototype for shmat is available
17190 xxx=`./findhdr sys/shm.h`
17191 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17192 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17203 set d_shmatprototype
17206 : see if shmdt exists
17210 : see how much of the 'shm*(2)' library is present.
17213 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17214 *"$undef"*) h_shm=false;;
17218 case "`ipcs 2>&1`" in
17219 "SVID shared memory"*"not configured"*)
17220 echo "Your $osname does not have the shm*(2) configured." >&4
17223 set shmctl d_shmctl
17225 set shmget d_shmget
17235 : we could also check for sys/ipc.h ...
17236 if $h_shm && $test `./findhdr sys/shm.h`; then
17237 echo "You have the full shm*(2) library." >&4
17240 echo "You don't have the full shm*(2) library." >&4
17246 : see if we have sigaction
17248 if set sigaction val -f d_sigaction; eval $csym; $val; then
17249 echo 'sigaction() found.' >&4
17252 #include <sys/types.h>
17253 #include <signal.h>
17254 #$i_stdlib I_STDLIB
17256 #include <stdlib.h>
17260 struct sigaction act, oact;
17262 oact.sa_handler = 0;
17263 /* so that act and oact are used */
17264 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17268 if eval $compile_ok; then
17271 echo "But you don't seem to have a useable struct sigaction." >&4
17275 echo 'sigaction NOT found.' >&4
17278 set d_sigaction; eval $setvar
17281 : see if this is a sunmath.h system
17282 set sunmath.h i_sunmath
17285 : see if signbit exists
17286 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17289 #$i_sunmath I_SUNMATH
17293 #ifdef I_SUNMATH /* Solaris special math library */
17294 # include <sunmath.h>
17297 int main(int argc, char **argv)
17301 if ((signbit(x) == 0) && (signbit(y) != 0))
17309 if eval $compile; then
17310 if $run ./try; then
17314 $echo "Signbit seems to be available, but doesn't work as I expected."
17315 $echo "I won't use it." >&4
17326 : see if sigprocmask exists
17327 set sigprocmask d_sigprocmask
17330 : see if sigsetjmp exists
17332 case "$d_sigsetjmp" in
17335 #include <setjmp.h>
17336 #$i_stdlib I_STDLIB
17338 #include <stdlib.h>
17344 if (sigsetjmp(env,1))
17347 siglongjmp(env, 1);
17352 if eval $compile; then
17353 if $run ./try >/dev/null 2>&1; then
17354 echo "POSIX sigsetjmp found." >&4
17358 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17364 echo "sigsetjmp not found." >&4
17368 *) val="$d_sigsetjmp"
17369 case "$d_sigsetjmp" in
17370 $define) echo "POSIX sigsetjmp found." >&4;;
17371 $undef) echo "sigsetjmp not found." >&4;;
17379 : see if snprintf exists
17380 set snprintf d_snprintf
17383 : see if vsnprintf exists
17384 set vsnprintf d_vsnprintf
17387 case "$d_snprintf-$d_vsnprintf" in
17390 Checking whether your snprintf() and vsnprintf() work okay...
17392 $cat >try.c <<'EOCP'
17393 /* v?snprintf testing logic courtesy of Russ Allbery.
17394 * According to C99:
17395 * - if the buffer is too short it still must be \0-terminated
17396 * - if the buffer is too short the potentially required length
17397 * must be returned and not -1
17398 * - if the buffer is NULL the potentially required length
17399 * must be returned and not -1 or core dump
17402 #include <stdarg.h>
17406 int test (char *format, ...)
17411 va_start (args, format);
17412 count = vsnprintf (buf, sizeof buf, format, args);
17419 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17420 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17424 if eval $compile; then
17427 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17429 Your snprintf() and snprintf() don't seem to be working okay.
17431 d_snprintf="$undef"
17432 d_vsnprintf="$undef"
17436 echo "(I can't seem to compile the test program--assuming they don't)"
17437 d_snprintf="$undef"
17438 d_vsnprintf="$undef"
17444 : see if sockatmark exists
17445 set sockatmark d_sockatmark
17448 : see if prototype for sockatmark is available
17450 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17453 : see if socks5_init exists
17454 set socks5_init d_socks5_init
17457 : see if sprintf returns the length of the string in the buffer as per ANSI
17458 $echo "Checking whether sprintf returns the length of the string..." >&4
17461 #$i_stdlib I_STDLIB
17463 #include <stdlib.h>
17465 #$i_string I_STRING
17467 # include <string.h>
17469 # include <strings.h>
17478 int check (size_t expect, int test) {
17479 size_t got = strlen(buffer);
17483 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17488 int main(int argc, char **argv) {
17491 check(sprintf(buffer, ""), ++test);
17492 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17493 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17500 if eval $compile; then
17504 sprintf returns the length of the string (as ANSI says it should)
17506 d_sprintf_returns_strlen="$define"
17509 sprintf does not return the length of the string (how old is this system?)
17511 d_sprintf_returns_strlen="$undef"
17515 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17516 d_sprintf_returns_strlen="$undef"
17520 : see if srand48_r exists
17521 set srand48_r d_srand48_r
17523 case "$d_srand48_r" in
17525 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17526 case "$d_srand48_r_proto:$usethreads" in
17527 ":define") d_srand48_r_proto=define
17528 set d_srand48_r_proto srand48_r $hdrs
17532 case "$d_srand48_r_proto" in
17534 case "$srand48_r_proto" in
17535 ''|0) try='int srand48_r(long, struct drand48_data*);'
17536 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17538 case "$srand48_r_proto" in
17539 ''|0) d_srand48_r=undef
17541 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17542 * ) case "$srand48_r_proto" in
17543 REENTRANT_PROTO*) ;;
17544 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17546 echo "Prototype: $try" ;;
17549 *) case "$usethreads" in
17550 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17557 *) srand48_r_proto=0
17561 : see if srandom_r exists
17562 set srandom_r d_srandom_r
17564 case "$d_srandom_r" in
17566 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17567 case "$d_srandom_r_proto:$usethreads" in
17568 ":define") d_srandom_r_proto=define
17569 set d_srandom_r_proto srandom_r $hdrs
17573 case "$d_srandom_r_proto" in
17575 case "$srandom_r_proto" in
17576 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17577 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17579 case "$srandom_r_proto" in
17580 ''|0) d_srandom_r=undef
17582 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17583 * ) case "$srandom_r_proto" in
17584 REENTRANT_PROTO*) ;;
17585 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17587 echo "Prototype: $try" ;;
17590 *) case "$usethreads" in
17591 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17598 *) srandom_r_proto=0
17602 : see if prototype for setresgid is available
17604 set d_sresgproto setresgid $i_unistd unistd.h
17607 : see if prototype for setresuid is available
17609 set d_sresuproto setresuid $i_unistd unistd.h
17612 : see if sys/stat.h is available
17613 set sys/stat.h i_sysstat
17616 : see if stat knows about block sizes
17618 echo "Checking to see if your struct stat has st_blocks field..." >&4
17619 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17622 : see if this is a sys/vfs.h system
17623 set sys/vfs.h i_sysvfs
17626 : see if this is a sys/statfs.h system
17627 set sys/statfs.h i_sysstatfs
17630 : Check for statfs_s
17632 echo "Checking to see if your system supports struct statfs..." >&4
17633 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
17635 case "$d_statfs_s" in
17636 "$define") echo "Yes, it does." ;;
17637 *) echo "No, it doesn't." ;;
17641 : see if struct statfs knows about f_flags
17642 case "$d_statfs_s" in
17645 echo "Checking to see if your struct statfs has f_flags field..." >&4
17646 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
17650 set d_statfs_f_flags
17654 case "$d_statfs_f_flags" in
17655 "$define") echo "Yes, it does." ;;
17656 *) echo "No, it doesn't." ;;
17659 : Check stream access
17661 Checking how to access stdio streams by file descriptor number...
17663 case "$stdio_stream_array" in
17664 '') $cat >try.c <<EOCP
17667 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17671 for s in _iob __iob __sF
17673 set try -DSTDIO_STREAM_ARRAY=$s
17674 if eval $compile; then
17675 case "`$run ./try`" in
17676 yes) stdio_stream_array=$s; break ;;
17682 case "$stdio_stream_array" in
17684 I can't figure out how to access stdio streams by file descriptor number.
17686 d_stdio_stream_array="$undef"
17689 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17691 d_stdio_stream_array="$define"
17695 : see if strcoll exists
17696 set strcoll d_strcoll
17699 : check for structure copying
17701 echo "Checking to see if your C compiler can copy structs..." >&4
17702 $cat >try.c <<'EOCP'
17712 if $cc -c try.c >/dev/null 2>&1 ; then
17714 echo "Yup, it can."
17717 echo "Nope, it can't."
17723 : see if strerror and/or sys_errlist[] exist
17725 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17726 if set strerror val -f d_strerror; eval $csym; $val; then
17727 echo 'strerror() found.' >&4
17728 d_strerror="$define"
17729 d_strerrm='strerror(e)'
17730 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17731 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17732 d_syserrlst="$define"
17734 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17735 d_syserrlst="$undef"
17737 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17738 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17739 echo 'strerror() found in string header.' >&4
17740 d_strerror="$define"
17741 d_strerrm='strerror(e)'
17742 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17743 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17744 d_syserrlst="$define"
17746 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17747 d_syserrlst="$undef"
17749 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17750 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17751 d_strerror="$undef"
17752 d_syserrlst="$define"
17753 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17755 echo 'strerror() and sys_errlist[] NOT found.' >&4
17756 d_strerror="$undef"
17757 d_syserrlst="$undef"
17758 d_strerrm='"unknown"'
17762 : see if strerror_r exists
17763 set strerror_r d_strerror_r
17765 case "$d_strerror_r" in
17767 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17768 case "$d_strerror_r_proto:$usethreads" in
17769 ":define") d_strerror_r_proto=define
17770 set d_strerror_r_proto strerror_r $hdrs
17774 case "$d_strerror_r_proto" in
17776 case "$strerror_r_proto" in
17777 ''|0) try='int strerror_r(int, char*, size_t);'
17778 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17780 case "$strerror_r_proto" in
17781 ''|0) try='int strerror_r(int, char*, int);'
17782 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17784 case "$strerror_r_proto" in
17785 ''|0) try='char* strerror_r(int, char*, size_t);'
17786 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17788 case "$strerror_r_proto" in
17789 ''|0) d_strerror_r=undef
17791 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17792 * ) case "$strerror_r_proto" in
17793 REENTRANT_PROTO*) ;;
17794 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17796 echo "Prototype: $try" ;;
17799 *) case "$usethreads" in
17800 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17807 *) strerror_r_proto=0
17811 : see if strftime exists
17812 set strftime d_strftime
17815 : see if strlcat exists
17816 set strlcat d_strlcat
17819 : see if strlcpy exists
17820 set strlcpy d_strlcpy
17823 : see if strtod exists
17824 set strtod d_strtod
17827 : see if strtol exists
17828 set strtol d_strtol
17831 : see if strtold exists
17832 set strtold d_strtold
17835 : see if strtoll exists
17836 set strtoll d_strtoll
17839 case "$d_longlong-$d_strtoll" in
17842 Checking whether your strtoll() works okay...
17844 $cat >try.c <<'EOCP'
17847 #define strtoll __strtoll
17850 #define strtoll _strtoll
17853 extern long long int strtoll(char *s, char **, int);
17854 static int bad = 0;
17855 int check(char *s, long long ell, int een) {
17858 gll = strtoll(s, 0, 10);
17859 if (!((gll == ell) && (errno == een)))
17863 check(" 1", 1LL, 0);
17864 check(" 0", 0LL, 0);
17865 check("-1", -1LL, 0);
17866 check("-9223372036854775808", -9223372036854775808LL, 0);
17867 check("-9223372036854775808", -9223372036854775808LL, 0);
17868 check(" 9223372036854775807", 9223372036854775807LL, 0);
17869 check("-9223372036854775808", -9223372036854775808LL, 0);
17870 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17871 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17877 if eval $compile; then
17880 ok) echo "Your strtoll() seems to be working okay." ;;
17882 Your strtoll() doesn't seem to be working okay.
17888 echo "(I can't seem to compile the test program--assuming it doesn't)"
17894 : see if strtoq exists
17895 set strtoq d_strtoq
17898 : see if strtoul exists
17899 set strtoul d_strtoul
17902 case "$d_strtoul" in
17905 Checking whether your strtoul() works okay...
17907 $cat >try.c <<'EOCP'
17910 extern unsigned long int strtoul(char *s, char **, int);
17911 static int bad = 0;
17912 void check(char *s, unsigned long eul, int een) {
17915 gul = strtoul(s, 0, 10);
17916 if (!((gul == eul) && (errno == een)))
17920 check(" 1", 1L, 0);
17921 check(" 0", 0L, 0);
17923 case "$longsize" in
17925 $cat >>try.c <<'EOCP'
17926 check("18446744073709551615", 18446744073709551615UL, 0);
17927 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17928 #if 0 /* strtoul() for /^-/ strings is undefined. */
17929 check("-1", 18446744073709551615UL, 0);
17930 check("-18446744073709551614", 2, 0);
17931 check("-18446744073709551615", 1, 0);
17932 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17933 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17938 $cat >>try.c <<'EOCP'
17939 check("4294967295", 4294967295UL, 0);
17940 check("4294967296", 4294967295UL, ERANGE);
17941 #if 0 /* strtoul() for /^-/ strings is undefined. */
17942 check("-1", 4294967295UL, 0);
17943 check("-4294967294", 2, 0);
17944 check("-4294967295", 1, 0);
17945 check("-4294967296", 4294967295UL, ERANGE);
17946 check("-4294967297", 4294967295UL, ERANGE);
17951 : Should we write these tests to be more portable by sprintf-ing
17952 : ~0 and then manipulating that char string as input for strtol?
17955 $cat >>try.c <<'EOCP'
17962 if eval $compile; then
17963 case "`$run ./try`" in
17964 ok) echo "Your strtoul() seems to be working okay." ;;
17966 Your strtoul() doesn't seem to be working okay.
17972 echo "(I can't seem to compile the test program--assuming it doesn't)"
17978 : see if strtoull exists
17979 set strtoull d_strtoull
17982 case "$d_longlong-$d_strtoull" in
17985 Checking whether your strtoull() works okay...
17987 $cat >try.c <<'EOCP'
17990 #define strtoull __strtoull
17993 extern unsigned long long int strtoull(char *s, char **, int);
17994 static int bad = 0;
17995 int check(char *s, long long eull, int een) {
17998 gull = strtoull(s, 0, 10);
17999 if (!((gull == eull) && (errno == een)))
18003 check(" 1", 1LL, 0);
18004 check(" 0", 0LL, 0);
18005 check("18446744073709551615", 18446744073709551615ULL, 0);
18006 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18007 #if 0 /* strtoull() for /^-/ strings is undefined. */
18008 check("-1", 18446744073709551615ULL, 0);
18009 check("-18446744073709551614", 2LL, 0);
18010 check("-18446744073709551615", 1LL, 0);
18011 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18012 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18019 if eval $compile; then
18020 case "`$run ./try`" in
18021 ok) echo "Your strtoull() seems to be working okay." ;;
18023 Your strtoull() doesn't seem to be working okay.
18025 d_strtoull="$undef"
18029 echo "(I can't seem to compile the test program--assuming it doesn't)"
18030 d_strtoull="$undef"
18035 : see if strtouq exists
18036 set strtouq d_strtouq
18039 case "$d_strtouq" in
18042 Checking whether your strtouq() works okay...
18044 $cat >try.c <<'EOCP'
18047 extern unsigned long long int strtouq(char *s, char **, int);
18048 static int bad = 0;
18049 void check(char *s, unsigned long long eull, int een) {
18050 unsigned long long gull;
18052 gull = strtouq(s, 0, 10);
18053 if (!((gull == eull) && (errno == een)))
18057 check(" 1", 1LL, 0);
18058 check(" 0", 0LL, 0);
18059 check("18446744073709551615", 18446744073709551615ULL, 0);
18060 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18061 #if 0 /* strtouq() for /^-/ strings is undefined. */
18062 check("-1", 18446744073709551615ULL, 0);
18063 check("-18446744073709551614", 2LL, 0);
18064 check("-18446744073709551615", 1LL, 0);
18065 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18066 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18074 if eval $compile; then
18075 case "`$run ./try`" in
18076 ok) echo "Your strtouq() seems to be working okay." ;;
18078 Your strtouq() doesn't seem to be working okay.
18084 echo "(I can't seem to compile the test program--assuming it doesn't)"
18090 : see if strxfrm exists
18091 set strxfrm d_strxfrm
18094 : see if symlink exists
18095 set symlink d_symlink
18098 : see if syscall exists
18099 set syscall d_syscall
18102 : see if prototype for syscall is available
18104 set d_syscallproto syscall $i_unistd unistd.h
18107 : see if sysconf exists
18108 set sysconf d_sysconf
18111 : see if system exists
18112 set system d_system
18115 : see if tcgetpgrp exists
18116 set tcgetpgrp d_tcgetpgrp
18119 : see if tcsetpgrp exists
18120 set tcsetpgrp d_tcsetpgrp
18123 : see if prototype for telldir is available
18125 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18128 : see if time exists
18130 if test "X$d_time" = X -o X"$timetype" = X; then
18131 if set time val -f d_time; eval $csym; $val; then
18132 echo 'time() found.' >&4
18134 rp="What is the type returned by time() on this system?"
18135 set time_t timetype long stdio.h sys/types.h
18138 echo 'time() not found, hope that will do.' >&4
18146 : see if timegm exists
18147 set timegm d_timegm
18150 : see if this is a sys/times.h system
18151 set sys/times.h i_systimes
18154 : see if times exists
18156 if set times val -f d_times; eval $csym; $val; then
18157 echo 'times() found.' >&4
18160 case "$i_systimes" in
18161 "$define") inc='sys/times.h';;
18163 rp="What is the type returned by times() on this system?"
18164 set clock_t clocktype long stdio.h sys/types.h $inc
18167 echo 'times() NOT found, hope that will do.' >&4
18172 : see if tmpnam_r exists
18173 set tmpnam_r d_tmpnam_r
18175 case "$d_tmpnam_r" in
18177 hdrs="$i_systypes sys/types.h define stdio.h "
18178 case "$d_tmpnam_r_proto:$usethreads" in
18179 ":define") d_tmpnam_r_proto=define
18180 set d_tmpnam_r_proto tmpnam_r $hdrs
18184 case "$d_tmpnam_r_proto" in
18186 case "$tmpnam_r_proto" in
18187 ''|0) try='char* tmpnam_r(char*);'
18188 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18190 case "$tmpnam_r_proto" in
18191 ''|0) d_tmpnam_r=undef
18193 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18194 * ) case "$tmpnam_r_proto" in
18195 REENTRANT_PROTO*) ;;
18196 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18198 echo "Prototype: $try" ;;
18201 *) case "$usethreads" in
18202 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18209 *) tmpnam_r_proto=0
18213 : see if truncate exists
18214 set truncate d_truncate
18217 : see if ttyname_r exists
18218 set ttyname_r d_ttyname_r
18220 case "$d_ttyname_r" in
18222 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18223 case "$d_ttyname_r_proto:$usethreads" in
18224 ":define") d_ttyname_r_proto=define
18225 set d_ttyname_r_proto ttyname_r $hdrs
18229 case "$d_ttyname_r_proto" in
18231 case "$ttyname_r_proto" in
18232 ''|0) try='int ttyname_r(int, char*, size_t);'
18233 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18235 case "$ttyname_r_proto" in
18236 ''|0) try='int ttyname_r(int, char*, int);'
18237 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18239 case "$ttyname_r_proto" in
18240 ''|0) try='char* ttyname_r(int, char*, int);'
18241 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18243 case "$ttyname_r_proto" in
18244 ''|0) d_ttyname_r=undef
18246 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18247 * ) case "$ttyname_r_proto" in
18248 REENTRANT_PROTO*) ;;
18249 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18251 echo "Prototype: $try" ;;
18254 *) case "$usethreads" in
18255 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18262 *) ttyname_r_proto=0
18266 : see if tzname[] exists
18268 if set tzname val -a d_tzname; eval $csym; $val; then
18270 echo 'tzname[] found.' >&4
18273 echo 'tzname[] NOT found.' >&4
18278 : Check if is a multiplatform env
18280 next|rhapsody|darwin) multiarch="$define" ;;
18282 case "$multiarch" in
18283 ''|[nN]*) multiarch="$undef" ;;
18286 : check for ordering of bytes in a UV
18288 case "$usecrosscompile$multiarch" in
18291 You seem to be either cross-compiling or doing a multiarchitecture build,
18292 skipping the byteorder check.
18298 case "$byteorder" in
18301 In the following, larger digits indicate more significance. A big-endian
18302 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18303 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18304 machines may have weird orders like 3412. A Cray will report 87654321,
18305 an Alpha will report 12345678. If the test program works the default is
18307 I'm now running the test program...
18311 #$i_stdlib I_STDLIB
18313 #include <stdlib.h>
18315 #include <sys/types.h>
18316 typedef $uvtype UV;
18326 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18328 u.l = (UV)0x04030201;
18329 for (i = 0; i < $uvsize; i++)
18330 printf("%c", u.c[i]+'0');
18337 if eval $compile && $run ./try > /dev/null; then
18340 [1-4][1-4][1-4][1-4]|12345678|87654321)
18341 echo "(The test program ran ok.)"
18342 echo "byteorder=$dflt"
18345 ????|????????) echo "(The test program ran ok.)" ;;
18346 *) echo "(The test program didn't run right for some reason.)" ;;
18351 (I can't seem to compile the test program. Guessing big-endian...)
18354 case "$xxx_prompt" in
18356 rp="What is the order of bytes in $uvtype?"
18369 : Checking 32bit aligndness
18372 Checking to see whether you can access character data unalignedly...
18374 case "$d_u32align" in
18375 '') $cat >try.c <<EOCP
18377 #$i_stdlib I_STDLIB
18379 #include <stdlib.h>
18381 #define U32 $u32type
18382 #define BYTEORDER 0x$byteorder
18384 #include <signal.h>
18386 $signal_t bletch(int s) { exit(4); }
18389 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18394 if (sizeof(U32) != 4) {
18395 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18402 signal(SIGBUS, bletch);
18414 for (i = 0; i < 4; i++) {
18415 up = (U32*)(buf + i);
18416 if (! ((*up == 1 << (8*i)) || /* big-endian */
18417 (*up == 1 << (8*(3-i))) /* little-endian */
18421 printf("read failed (%x)\n", *up);
18427 for (i = 0; i < 4; i++) {
18428 up = (U32*)(buf + i);
18430 if (*up != 0xBeef) {
18431 printf("write failed (%x)\n", *up);
18445 if eval $compile_ok; then
18446 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18447 $run ./try 2>&1 >/dev/null
18450 You can access character data pretty unalignedly.
18452 d_u32align="$undef"
18455 It seems that you must access character data in an aligned manner.
18457 d_u32align="$define"
18461 rp='Can you access character data at unaligned addresses?'
18465 [yY]*) d_u32align="$undef" ;;
18466 *) d_u32align="$define" ;;
18473 : see if ualarm exists
18474 set ualarm d_ualarm
18477 : see if umask exists
18481 : see if unordered exists
18482 set unordered d_unordered
18485 : see if unsetenv exists
18486 set unsetenv d_unsetenv
18489 : see if usleep exists
18490 set usleep d_usleep
18493 : see if prototype for usleep is available
18495 set d_usleepproto usleep $i_unistd unistd.h
18498 : see if ustat exists
18502 : see if closedir exists
18503 set closedir d_closedir
18506 case "$d_closedir" in
18509 echo "Checking whether closedir() returns a status..." >&4
18511 #$i_dirent I_DIRENT /**/
18512 #$i_sysdir I_SYS_DIR /**/
18513 #$i_sysndir I_SYS_NDIR /**/
18514 #$i_systypes I_SYS_TYPES /**/
18516 #if defined(I_SYS_TYPES)
18517 #include <sys/types.h>
18519 #if defined(I_DIRENT)
18520 #include <dirent.h>
18521 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18522 #include <sys/dir.h>
18526 #include <sys/ndir.h>
18530 #include <ndir.h> /* may be wrong in the future */
18532 #include <sys/dir.h>
18537 int main() { return closedir(opendir(".")); }
18540 if eval $compile_ok; then
18541 if $run ./try > /dev/null 2>&1 ; then
18542 echo "Yes, it does."
18545 echo "No, it doesn't."
18549 echo "(I can't seem to compile the test program--assuming it doesn't)"
18557 set d_void_closedir
18561 : see if there is a wait4
18565 : see if waitpid exists
18566 set waitpid d_waitpid
18569 : see if wcstombs exists
18570 set wcstombs d_wcstombs
18573 : see if wctomb exists
18574 set wctomb d_wctomb
18577 : see if writev exists
18578 set writev d_writev
18581 : preserve RCS keywords in files with variable substitution, grrr
18586 Revision='$Revision'
18588 : check for alignment requirements
18590 case "$usecrosscompile$multiarch" in
18593 You seem to be either cross-compiling or doing a multiarchitecture build,
18594 skipping the memory alignment check.
18597 case "$alignbytes" in
18598 '') alignbytes=8 ;;
18602 case "$alignbytes" in
18603 '') echo "Checking alignment constraints..." >&4
18604 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18605 $cat >try.c <<'EOCP'
18606 typedef long double NV;
18609 $cat >try.c <<'EOCP'
18613 $cat >>try.c <<'EOCP'
18621 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18626 if eval $compile_ok; then
18630 echo "(I can't seem to compile the test program...)"
18633 *) dflt="$alignbytes"
18636 rp="Doubles must be aligned on a how-many-byte boundary?"
18644 : set the base revision
18647 : how do we concatenate cpp tokens here?
18649 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18650 $cat >cpp_stuff.c <<'EOCP'
18651 #define RCAT(a,b)a/**/b
18652 #define ACAT(a,b)a ## b
18656 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18657 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18658 echo "Oh! Smells like ANSI's been here." >&4
18659 echo "We can catify or stringify, separately or together!"
18661 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18662 echo "Ah, yes! The good old days!" >&4
18663 echo "However, in the good old days we don't know how to stringify and"
18664 echo "catify at the same time."
18668 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18669 You're going to have to edit the values of CAT[2-5] in config.h...
18671 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18675 : see if this is a db.h system
18681 : Check db version.
18683 echo "Checking Berkeley DB version ..." >&4
18689 #include <sys/types.h>
18691 #$i_stdlib I_STDLIB
18693 #include <stdlib.h>
18696 int main(int argc, char *argv[])
18698 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18699 int Major, Minor, Patch ;
18700 unsigned long Version ;
18701 (void)db_version(&Major, &Minor, &Patch) ;
18703 printf("%d %d %d %d %d %d\n",
18704 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18705 Major, Minor, Patch);
18708 printf("You have Berkeley DB Version 2 or greater.\n");
18710 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18711 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18712 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18713 Major, Minor, Patch) ;
18715 /* check that db.h & libdb are compatible */
18716 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18717 printf("db.h and libdb are incompatible.\n") ;
18721 printf("db.h and libdb are compatible.\n") ;
18723 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18724 + DB_VERSION_PATCH ;
18726 /* needs to be >= 2.3.4 */
18727 if (Version < 2003004) {
18728 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18729 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18735 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18740 printf("You have Berkeley DB Version 1.\n");
18741 exit(0); /* DB version < 2: the coast is clear. */
18743 exit(1); /* <db.h> not Berkeley DB? */
18749 if eval $compile_ok && $run ./try; then
18750 echo 'Looks OK.' >&4
18752 db_version_major=$1
18753 db_version_minor=$2
18754 db_version_patch=$3
18756 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18760 : Remove db from list of libraries to use
18761 echo "Removing unusable -ldb from library list" >&4
18762 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18765 echo "libs = $libs" >&4
18775 : Check the return type needed for hash
18777 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18783 #include <sys/types.h>
18786 #ifndef DB_VERSION_MAJOR
18787 u_int32_t hash_cb (ptr, size)
18795 info.hash = hash_cb;
18799 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18800 if $contains warning try.out >>/dev/null 2>&1 ; then
18803 db_hashtype='u_int32_t'
18806 : XXX Maybe we should just give up here.
18807 db_hashtype=u_int32_t
18809 echo "Help: I can't seem to compile the db test program." >&4
18810 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18813 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18815 *) db_hashtype=u_int32_t
18820 : Check the return type needed for prefix
18822 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18828 #include <sys/types.h>
18831 #ifndef DB_VERSION_MAJOR
18832 size_t prefix_cb (key1, key2)
18840 info.prefix = prefix_cb;
18844 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18845 if $contains warning try.out >>/dev/null 2>&1 ; then
18846 db_prefixtype='int'
18848 db_prefixtype='size_t'
18851 db_prefixtype='size_t'
18852 : XXX Maybe we should just give up here.
18854 echo "Help: I can't seem to compile the db test program." >&4
18855 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18858 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18860 *) db_prefixtype='size_t'
18864 : How can we generate normalized random numbers ?
18866 echo "Looking for a random number function..." >&4
18867 case "$randfunc" in
18869 if set drand48 val -f; eval $csym; $val; then
18871 echo "Good, found drand48()." >&4
18872 elif set random val -f; eval $csym; $val; then
18874 echo "OK, found random()." >&4
18877 echo "Yick, looks like I have to use rand()." >&4
18888 *-Dmy_rand=*|*-Dmy_srand=*)
18889 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18890 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18891 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18892 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18896 while $test "$cont"; do
18897 rp="Use which function to generate random numbers?"
18899 if $test "$ans" = "$dflt"; then
18905 if set $ans val -f; eval $csym; $val; then
18909 rp="I cannot find function $ans. Use that name anyway?"
18918 case "$randfunc" in
18920 drand01="drand48()"
18926 case "$randbits" in
18928 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18930 #$i_unistd I_UNISTD
18931 #$i_stdlib I_STDLIB
18934 # include <unistd.h>
18937 # include <stdlib.h>
18942 register unsigned long tmp;
18943 register unsigned long max = 0L;
18945 for (i = 1000; i; i--) {
18946 tmp = (unsigned long) $randfunc();
18947 if (tmp > max) max = tmp;
18949 for (i = 0; max; i++)
18955 if eval $compile_ok; then
18959 echo "(I can't seem to compile the test program...)"
18966 rp="How many bits does your $randfunc() function produce?"
18970 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18971 seedfunc="s$randfunc"
18972 randseedtype=unsigned
18976 rp="How many bits does your $randfunc() function produce?"
18979 seedfunc="s$randfunc"
18980 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18981 if set $seedfunc val -f; eval $csym; $val; then
18982 echo "(Using $seedfunc() to seed random generator)"
18984 echo "(Warning: no $seedfunc() to seed random generator)"
18987 randseedtype=unsigned
18994 : Determine if this is an EBCDIC system
18996 echo "Determining whether or not we are on an EBCDIC system..." >&4
18997 $cat >try.c <<'EOM'
19000 if ('M'==0xd4) return 0;
19007 if eval $compile_ok; then
19008 if $run ./try; then
19009 echo "You seem to speak EBCDIC." >&4
19012 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19015 echo "I'm unable to compile the test program." >&4
19016 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19022 : Check how to flush
19025 Checking how to flush all pending stdio output...
19027 # I only know how to find the first 32 possibly open files on SunOS.
19028 # See also hints/sunos_4_1.sh and util.c --AD
19030 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19032 $cat >>try.c <<EOCP
19034 #$i_stdlib I_STDLIB
19036 #include <stdlib.h>
19038 #$i_unistd I_UNISTD
19040 # include <unistd.h>
19042 #$d_sysconf HAS_SYSCONF
19043 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19044 #ifdef HAS_STDIO_STREAM_ARRAY
19045 # define STDIO_STREAM_ARRAY $stdio_stream_array
19050 p = fopen("try.out", "w");
19054 # ifdef TRY_FPRINTF
19058 #ifdef TRY_FFLUSH_NULL
19061 #ifdef TRY_FFLUSH_ALL
19063 long open_max = -1;
19064 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19065 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19067 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19068 open_max = sysconf(_SC_OPEN_MAX);
19071 open_max = FOPEN_MAX;
19074 open_max = OPEN_MAX;
19083 # ifdef HAS_STDIO_STREAM_ARRAY
19084 if (open_max > 0) {
19086 for (i = 0; i < open_max; i++)
19087 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19088 STDIO_STREAM_ARRAY[i]._file < open_max &&
19089 STDIO_STREAM_ARRAY[i]._flag)
19090 fflush(&STDIO_STREAM_ARRAY[i]);
19098 : first we have to find out how _not_ to flush
19100 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19102 set try -DTRY_FPUTC
19103 if eval $compile; then
19104 $run ./try 2>/dev/null
19107 if $test ! -s try.out -a "X$code" = X42; then
19113 set try -DTRY_FPRINTF
19114 if eval $compile; then
19115 $run ./try 2>/dev/null
19118 if $test ! -s try.out -a "X$code" = X42; then
19119 output=-DTRY_FPRINTF
19125 : check for fflush NULL behaviour
19126 case "$fflushNULL" in
19127 '') set try -DTRY_FFLUSH_NULL $output
19128 if eval $compile; then
19129 $run ./try 2>/dev/null
19132 if $test -s try.out -a "X$code" = X42; then
19133 fflushNULL="`$cat try.out`"
19135 if $test "X$code" != X42; then
19137 (If this test failed, don't worry, we'll try another method shortly.)
19142 $rm -f core try.core core.try.*
19143 case "$fflushNULL" in
19145 Your fflush(NULL) works okay for output streams.
19146 Let's see if it clobbers input pipes...
19148 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19149 # bug that improperly flushes the input end of pipes. So we avoid the
19150 # autoflush on fork/system/exec support for now. :-(
19151 $cat >tryp.c <<EOCP
19154 main(int argc, char **argv)
19160 while ((i = getc(stdin)) != -1
19161 && (*bp++ = i) != '\n'
19162 && bp < &buf[1024])
19165 fprintf(stdout, "%s", buf);
19173 fflushNULL="$define"
19175 if eval $compile; then
19177 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19178 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19180 fflush(NULL) seems to behave okay with input streams.
19182 fflushNULL="$define"
19185 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19187 fflushNULL="$undef"
19190 $rm -f core tryp.c tryp.core core.tryp.*
19193 Your fflush(NULL) isn't working (contrary to ANSI C).
19195 fflushNULL="$undef"
19198 Cannot figure out whether your fflush(NULL) works or not.
19199 I'm assuming it doesn't (contrary to ANSI C).
19201 fflushNULL="$undef"
19205 $define|true|[yY]*)
19206 fflushNULL="$define"
19209 fflushNULL="$undef"
19212 : check explicit looping only if NULL did not work, and if the pipe
19213 : bug does not show up on an explicit flush too
19214 case "$fflushNULL" in
19216 $cat >tryp.c <<EOCP
19219 main(int argc, char **argv)
19225 while ((i = getc(stdin)) != -1
19226 && (*bp++ = i) != '\n'
19227 && bp < &buf[1024])
19230 fprintf(stdout, "%s", buf);
19239 if eval $compile; then
19241 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19242 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19244 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19246 : now check for fflushall behaviour
19247 case "$fflushall" in
19248 '') set try -DTRY_FFLUSH_ALL $output
19249 if eval $compile; then
19251 (Now testing the other method--but note that this also may fail.)
19253 $run ./try 2>/dev/null
19256 if $test -s try.out -a "X$code" = X42; then
19257 fflushall="`$cat try.out`"
19261 case "$fflushall" in
19263 Whew. Flushing explicitly all the stdio streams works.
19265 fflushall="$define"
19268 Sigh. Flushing explicitly all the stdio streams doesn't work.
19273 Cannot figure out whether flushing stdio streams explicitly works or not.
19274 I'm assuming it doesn't.
19280 "$define"|true|[yY]*)
19281 fflushall="$define"
19289 All is futile. Even fflush(stdin) clobbers input pipes!
19296 $rm -f core tryp.c tryp.core core.tryp.*
19298 *) fflushall="$undef"
19302 case "$fflushNULL$fflushall" in
19305 OK, I give up. I cannot figure out how to flush pending stdio output.
19306 We won't be flushing handles at all before fork/exec/popen.
19312 : Store the full pathname to the ar program for use in the C program
19313 : Respect a hint or command line value for full_ar.
19318 : Store the full pathname to the sed program for use in the C program
19321 : see what type gids are declared as in the kernel
19323 echo "Looking for the type for group ids returned by getgid()."
19324 set gid_t gidtype xxx stdio.h sys/types.h
19328 xxx=`./findhdr sys/user.h`
19329 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19331 unsigned) dflt="$1 $2" ;;
19335 *) dflt="$gidtype";;
19338 gid_t) echo "gid_t found." ;;
19339 *) rp="What is the type for group ids returned by getgid()?"
19345 : Check the size of GID
19348 *_t) zzz="$gidtype" ;;
19351 echo "Checking the size of $zzz..." >&4
19353 #include <sys/types.h>
19355 #$i_stdlib I_STDLIB
19357 #include <stdlib.h>
19360 printf("%d\n", (int)sizeof($gidtype));
19365 if eval $compile_ok; then
19369 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19372 echo "Your $zzz is $gidsize bytes long."
19377 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19381 : Check if GID is signed
19384 *_t) zzz="$gidtype" ;;
19387 echo "Checking the sign of $zzz..." >&4
19389 #include <sys/types.h>
19400 if eval $compile; then
19404 echo "(I can't execute the test program--guessing unsigned.)" >&4
19408 1) echo "Your $zzz is unsigned." ;;
19409 -1) echo "Your $zzz is signed." ;;
19415 echo "(I can't compile the test program--guessing unsigned.)" >&4
19419 : Check 64bit sizes
19422 if $test X"$quadtype" != X; then
19424 echo "Checking how to print 64-bit integers..." >&4
19426 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19427 $cat >try.c <<'EOCP'
19428 #include <sys/types.h>
19431 int q = 12345678901;
19432 printf("%ld\n", q);
19436 if eval $compile; then
19440 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19441 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19442 echo "We will use %d."
19448 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19449 $cat >try.c <<'EOCP'
19450 #include <sys/types.h>
19453 long q = 12345678901;
19454 printf("%ld\n", q);
19458 if eval $compile; then
19462 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19463 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19464 echo "We will use %ld."
19470 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19471 $cat >try.c <<'EOCP'
19472 #include <sys/types.h>
19473 #include <inttypes.h>
19476 int64_t q = 12345678901;
19477 printf("%" PRId64 "\n", q);
19481 if eval $compile; then
19485 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19486 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19487 echo "We will use the C9X style."
19493 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19495 #include <sys/types.h>
19498 $quadtype q = 12345678901;
19499 printf("%Ld\n", q);
19503 if eval $compile; then
19507 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19508 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19509 echo "We will use %Ld."
19515 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19516 $cat >try.c <<'EOCP'
19517 #include <sys/types.h>
19520 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19521 printf("%lld\n", q);
19525 if eval $compile; then
19529 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19530 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19531 echo "We will use the %lld style."
19537 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19539 #include <sys/types.h>
19542 $quadtype q = 12345678901;
19543 printf("%qd\n", q);
19547 if eval $compile; then
19551 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19552 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19553 echo "We will use %qd."
19559 if $test X"$sPRId64" = X; then
19560 echo "Cannot figure out how to print 64-bit integers." >&4
19567 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19568 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19570 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19571 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19575 : Check format strings for internal types
19577 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19579 if $test X"$ivsize" = X8; then
19580 ivdformat="$sPRId64"
19581 uvuformat="$sPRIu64"
19582 uvoformat="$sPRIo64"
19583 uvxformat="$sPRIx64"
19584 uvXUformat="$sPRIXU64"
19586 if $test X"$ivsize" = X"$longsize"; then
19593 if $test X"$ivsize" = X"$intsize"; then
19601 if $test X"$ivsize" = X"$shortsize"; then
19612 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19613 nveformat="$sPRIeldbl"
19614 nvfformat="$sPRIfldbl"
19615 nvgformat="$sPRIgldbl"
19616 nvEUformat="$sPRIEUldbl"
19617 nvFUformat="$sPRIFUldbl"
19618 nvGUformat="$sPRIGUldbl"
19628 case "$ivdformat" in
19629 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19634 : Check format string for GID
19637 $echo "Checking the format string to be used for gids..." >&4
19640 -1) if $test X"$gidsize" = X"$ivsize"; then
19641 gidformat="$ivdformat"
19643 if $test X"$gidsize" = X"$longsize"; then
19646 if $test X"$gidsize" = X"$intsize"; then
19649 if $test X"$gidsize" = X"$shortsize"; then
19656 *) if $test X"$gidsize" = X"$uvsize"; then
19657 gidformat="$uvuformat"
19659 if $test X"$gidsize" = X"$longsize"; then
19662 if $test X"$gidsize" = X"$intsize"; then
19665 if $test X"$gidsize" = X"$shortsize"; then
19674 : see if getgroups exists
19675 set getgroups d_getgrps
19678 : see if setgroups exists
19679 set setgroups d_setgrps
19682 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19684 case "$d_getgrps$d_setgrps" in
19686 case "$groupstype" in
19687 '') dflt="$gidtype" ;;
19688 *) dflt="$groupstype" ;;
19691 What type of pointer is the second argument to getgroups() and setgroups()?
19692 Usually this is the same as group ids, $gidtype, but not always.
19695 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19699 *) groupstype="$gidtype";;
19702 : MAD = Misc Attribute Definition
19704 if $test $patchlevel -lt 9; then
19705 : MAD is not available in 5.8.x or earlier.
19709 $define|true|[yY]*) dflt='y' ;;
19714 Would you like to build with Misc Attribute Decoration? This is development
19715 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19716 overhead on the interpreter.
19718 If this doesn't make any sense to you, just accept the default '$dflt'.
19720 rp='Build Perl with MAD?'
19725 madlyh='madly.h madly.act madly.tab'
19727 madlyobj="madly$_o" ;;
19736 : check whether make sets MAKE
19738 echo "Checking if your $make program sets \$(MAKE)..." >&4
19739 case "$make_set_make" in
19741 $sed 's/^X //' > testmake.mak << 'EOF'
19743 X @echo 'maketemp="$(MAKE)"'
19745 case "`$make -f testmake.mak 2>/dev/null`" in
19746 *maketemp=*) make_set_make='#' ;;
19747 *) make_set_make="MAKE=$make" ;;
19749 $rm -f testmake.mak
19752 case "$make_set_make" in
19753 '#') echo "Yup, it does.";;
19754 *) echo "Nope, it doesn't.";;
19757 : see what type is used for mode_t
19758 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19759 set mode_t modetype int stdio.h sys/types.h
19762 : see if we need va_copy
19764 case "$i_stdarg" in
19767 #include <stdarg.h>
19769 #$i_stdlib I_STDLIB
19771 #include <stdlib.h>
19773 #include <signal.h>
19776 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19778 return vfprintf(f, fmt, *valp);
19782 myvfprintf(FILE *f, const char *fmt, va_list val)
19784 return ivfprintf(f, fmt, &val);
19788 myprintf(char *fmt, ...)
19791 va_start(val, fmt);
19792 return myvfprintf(stdout, fmt, val);
19796 main(int ac, char **av)
19798 signal(SIGSEGV, exit);
19800 myprintf("%s%cs all right, then\n", "that", '\'');
19805 if eval $compile && $run ./try 2>&1 >/dev/null; then
19806 case "`$run ./try`" in
19807 "that's all right, then")
19813 yes) echo "It seems that you don't need va_copy()." >&4
19814 need_va_copy="$undef"
19816 *) echo "It seems that va_copy() or similar will be needed." >&4
19817 need_va_copy="$define"
19822 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19826 : see what type is used for size_t
19827 rp="What is the type used for the length parameter for string functions?"
19828 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19831 : check for type of arguments to gethostbyaddr.
19832 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19833 case "$d_gethbyaddr" in
19837 Checking to see what type of arguments are accepted by gethostbyaddr().
19839 hdrs="$define sys/types.h
19840 $d_socket sys/socket.h
19841 $i_niin netinet/in.h
19843 $i_unistd unistd.h"
19844 : The first arg can 'char *' or 'void *'
19845 : The second arg is some of integral type
19846 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19847 for yyy in size_t long int; do
19848 case "$netdb_host_type" in
19849 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19850 if ./protochk "$try" $hdrs; then
19851 echo "Your system accepts $xxx for the first arg."
19852 echo "...and $yyy for the second arg."
19853 netdb_host_type="$xxx"
19854 netdb_hlen_type="$yyy"
19860 : In case none of those worked, prompt the user.
19861 case "$netdb_host_type" in
19862 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19865 netdb_host_type=$ans
19866 rp='What is the type for the 2nd argument to gethostbyaddr?'
19869 netdb_hlen_type=$ans
19873 *) : no gethostbyaddr, so pick harmless defaults
19874 netdb_host_type='char *'
19875 netdb_hlen_type="$sizetype"
19878 # Remove the "const" if needed. -- but then we'll have a
19880 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19883 : check for type of argument to gethostbyname.
19884 if test "X$netdb_name_type" = X ; then
19885 case "$d_gethbyname" in
19889 Checking to see what type of argument is accepted by gethostbyname().
19891 hdrs="$define sys/types.h
19892 $d_socket sys/socket.h
19893 $i_niin netinet/in.h
19895 $i_unistd unistd.h"
19896 for xxx in "const char *" "char *"; do
19897 case "$netdb_name_type" in
19898 '') try="extern struct hostent *gethostbyname($xxx);"
19899 if ./protochk "$try" $hdrs; then
19900 echo "Your system accepts $xxx."
19901 netdb_name_type="$xxx"
19906 : In case none of those worked, prompt the user.
19907 case "$netdb_name_type" in
19908 '') rp='What is the type for the 1st argument to gethostbyname?'
19911 netdb_name_type=$ans
19915 *) : no gethostbyname, so pick harmless default
19916 netdb_name_type='char *'
19921 : check for type of 1st argument to getnetbyaddr.
19922 if test "X$netdb_net_type" = X ; then
19923 case "$d_getnbyaddr" in
19927 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19929 hdrs="$define sys/types.h
19930 $d_socket sys/socket.h
19931 $i_niin netinet/in.h
19933 $i_unistd unistd.h"
19934 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19935 case "$netdb_net_type" in
19936 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19937 if ./protochk "$try" $hdrs; then
19938 echo "Your system accepts $xxx."
19939 netdb_net_type="$xxx"
19944 : In case none of those worked, prompt the user.
19945 case "$netdb_net_type" in
19946 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19949 netdb_net_type=$ans
19953 *) : no getnetbyaddr, so pick harmless default
19954 netdb_net_type='long'
19958 : locate the preferred pager for this system
19965 [a-zA-Z]:/*) dflt=$pg;;
19969 [a-zA-Z]:/*) dflt=$more;;
19973 [a-zA-Z]:/*) dflt=$less;;
19976 '') dflt=/usr/ucb/more;;
19984 rp='What pager is used on your system?'
19988 : see what type pids are declared as in the kernel
19989 rp="What is the type of process ids on this system?"
19990 set pid_t pidtype int stdio.h sys/types.h
19993 : see if ar generates random libraries by itself
19995 echo "Checking how to generate random libraries on your machine..." >&4
19996 echo 'int bar1() { return bar2(); }' > bar1.c
19997 echo 'int bar2() { return 2; }' > bar2.c
19999 #$i_stdlib I_STDLIB
20001 #include <stdlib.h>
20003 int main() { printf("%d\n", bar1()); exit(0); }
20005 $cc $ccflags -c bar1.c >/dev/null 2>&1
20006 $cc $ccflags -c bar2.c >/dev/null 2>&1
20007 $cc $ccflags -c foo.c >/dev/null 2>&1
20008 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20009 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20010 $run ./foobar >/dev/null 2>&1; then
20011 echo "$ar appears to generate random libraries itself."
20013 if [ "X$ranlib" = "X" ]; then
20016 elif $ar s bar$_a >/dev/null 2>&1 &&
20017 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20018 $run ./foobar >/dev/null 2>&1; then
20019 echo "a table of contents needs to be added with '$ar s'."
20022 elif $ar ts bar$_a >/dev/null 2>&1 &&
20023 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20024 $run ./foobar >/dev/null 2>&1; then
20025 echo "a table of contents needs to be added with '$ar ts'."
20032 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20033 $test -f $ranlib || ranlib=''
20036 if $test -n "$ranlib"; then
20037 echo "your system has '$ranlib'; we'll use that."
20040 echo "your system doesn't seem to support random libraries"
20041 echo "so we'll use lorder and tsort to order the libraries."
20048 : see if this is a values.h system
20049 set values.h i_values
20052 : Check the max offset that gmtime and localtime accept
20053 echo "Checking max offsets that gmtime () accepts"
20056 define) yyy="#include <values.h>" ;;
20060 case "$sGMTIME_min/$sGMTIME_max" in
20063 #include <sys/types.h>
20072 void gm_check (time_t t, int min_year, int max_year)
20075 if ( tmp == NULL ||
20076 /* Check tm_year overflow */
20077 tmp->tm_year < min_year || tmp->tm_year > max_year)
20088 gm_check (MAXLONG, 69, 0x7fffffff);
20090 if (tmp == NULL || tmp->tm_year < 0) {
20091 for (i = 63; i >= 0; i--) {
20092 time_t x = pt | ((time_t)1 << i);
20093 if (x < 0 || x < pt) continue;
20094 gm_check (x, 69, 0x7fffffff);
20097 printf ("sGMTIME_max=%ld\n", pt);
20106 gm_check (MINLONG, -1900, 70);
20109 for (i = 36; i >= 0; i--) {
20110 time_t x = pt - ((time_t)1 << i);
20111 if (x > 0) continue;
20112 gm_check (x, -1900, 70);
20115 printf ("sGMTIME_min=%ld\n", pt);
20119 int main (int argc, char *argv[])
20121 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20128 if eval $compile; then
20131 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20137 echo "Checking max offsets that localtime () accepts"
20139 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20142 #include <sys/types.h>
20151 void local_check (time_t t, int min_year, int max_year)
20153 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20156 tmp = localtime (&t);
20157 if ( tmp == NULL ||
20158 /* Check tm_year overflow */
20159 tmp->tm_year < min_year || tmp->tm_year > max_year)
20163 } /* local_check */
20170 local_check (MAXLONG, 69, 0x7fffffff);
20172 if (tmp == NULL || tmp->tm_year < 0) {
20173 for (i = 63; i >= 0; i--) {
20174 time_t x = pt | ((time_t)1 << i);
20175 if (x < 0 || x < pt) continue;
20176 local_check (x, 69, 0x7fffffff);
20179 printf ("sLOCALTIME_max=%ld\n", pt);
20188 local_check (MINLONG, -1900, 70);
20191 for (i = 36; i >= 0; i--) {
20192 time_t x = pt - ((time_t)1 << i);
20193 if (x > 0) continue;
20194 local_check (x, -1900, 70);
20197 printf ("sLOCALTIME_min=%ld\n", pt);
20201 int main (int argc, char *argv[])
20209 if eval $compile; then
20212 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20218 : check for type of arguments to select.
20219 case "$selecttype" in
20220 '') case "$d_select" in
20224 Checking to see what type of arguments are accepted by select().
20226 hdrs="$define sys/types.h
20227 $i_systime sys/time.h
20228 $i_sysselct sys/select.h
20229 $d_socket sys/socket.h"
20230 : The first arg can be int, unsigned, or size_t
20231 : The last arg may or may not be 'const'
20233 : void pointer has been seen but using that
20234 : breaks the selectminbits test
20235 for xxx in 'fd_set *' 'int *'; do
20236 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20237 for tmo in 'struct timeval *' 'const struct timeval *'; do
20239 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20240 if ./protochk "$try" $hdrs; then
20241 echo "Your system accepts $xxx."
20250 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20251 case "$d_fd_set" in
20252 $define) dflt="fd_set *" ;;
20261 *) : no select, so pick a harmless default
20268 : check for the select 'width'
20269 case "$selectminbits" in
20270 '') safebits=`expr $ptrsize \* 8`
20271 case "$d_select" in
20275 Checking to see on how many bits at a time your select() operates...
20278 #include <sys/types.h>
20280 #$i_systime I_SYS_TIME
20281 #$i_systimek I_SYS_TIME_KERNEL
20286 # ifdef I_SYS_TIME_KERNEL
20289 # include <sys/time.h>
20290 # ifdef I_SYS_TIME_KERNEL
20294 #$i_sysselct I_SYS_SELECT
20295 #ifdef I_SYS_SELECT
20296 #include <sys/select.h>
20298 #$d_socket HAS_SOCKET
20300 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20303 #$i_stdlib I_STDLIB
20305 #include <stdlib.h>
20308 #define S sizeof(*(b))
20310 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20311 #define NBITS (NBYTES * 8)
20313 char *s = (char *)malloc(NBYTES);
20322 fp = fopen("try.c", "r");
20328 b = ($selecttype)s;
20329 for (i = 0; i < NBITS; i++)
20333 select(fd + 1, b, 0, 0, &t);
20334 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20336 printf("%d\n", i + 1);
20341 if eval $compile_ok; then
20342 selectminbits=`$run ./try`
20343 case "$selectminbits" in
20345 Cannot figure out on how many bits at a time your select() operates.
20346 I'll play safe and guess it is $safebits bits.
20348 selectminbits=$safebits
20349 bits="$safebits bits"
20352 *) bits="$selectminbits bits" ;;
20354 echo "Your select() operates on $bits at a time." >&4
20356 rp='What is the minimum number of bits your select() operates on?'
20357 case "$byteorder" in
20358 12345678) dflt=64 ;;
20364 selectminbits="$val"
20368 *) : no select, so pick a harmless default
20369 selectminbits=$safebits
20375 : Trace out the files included by signal.h, then look for SIGxxx names.
20376 if [ "X$fieldn" = X ]; then
20377 : Just make some guesses. We check them later.
20378 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20380 xxx=`echo '#include <signal.h>' |
20381 $cppstdin $cppminus $cppflags 2>/dev/null |
20382 $grep '^[ ]*#.*include' |
20383 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20384 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20387 for xx in $xxx /dev/null ; do
20388 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20390 case "$xxxfiles" in
20391 '') xxxfiles=`./findhdr signal.h` ;;
20394 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20395 print substr($2, 4, 20)
20397 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20398 print substr($3, 4, 20)
20400 : Append some common names just in case the awk scan failed.
20401 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20402 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20403 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20404 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20405 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20407 : generate a few handy files for later
20408 $cat > signal.c <<EOCP
20409 #include <sys/types.h>
20410 #include <signal.h>
20411 #$i_stdlib I_STDLIB
20413 #include <stdlib.h>
20418 /* Strange style to avoid deeply-nested #if/#else/#endif */
20421 # define NSIG (_NSIG)
20427 # define NSIG (SIGMAX+1)
20433 # define NSIG (SIG_MAX+1)
20439 # define NSIG (_SIG_MAX+1)
20445 # define NSIG (MAXSIG+1)
20451 # define NSIG (MAX_SIG+1)
20456 # ifdef SIGARRAYSIZE
20457 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20463 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20467 /* Default to some arbitrary number that's big enough to get most
20468 of the common signals.
20474 printf("NSIG %d\n", NSIG);
20480 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20482 printf "#ifdef SIG"; printf $1; printf "\n"
20483 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20484 printf $1; printf ");\n"
20488 printf "#endif /* JUST_NSIG */\n";
20489 printf "exit(0);\n}\n";
20492 $cat >signal.awk <<'EOP'
20493 BEGIN { ndups = 0 }
20494 $1 ~ /^NSIG$/ { nsig = $2 }
20495 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20496 if ($2 > maxsig) { maxsig = $2 }
20497 if (sig_name[$2]) {
20498 dup_name[ndups] = $1
20499 dup_num[ndups] = $2
20511 printf("NSIG %d\n", nsig);
20512 for (n = 1; n < nsig; n++) {
20514 printf("%s %d\n", sig_name[n], sig_num[n])
20517 printf("NUM%d %d\n", n, n)
20520 for (n = 0; n < ndups; n++) {
20521 printf("%s %d\n", dup_name[n], dup_num[n])
20525 $cat >signal_cmd <<EOS
20527 if $test -s signal.lst; then
20528 echo "Using your existing signal.lst file"
20533 $cat >>signal_cmd <<'EOS'
20536 if eval $compile_ok; then
20537 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20538 $uniq | $awk -f signal.awk >signal.lst
20540 echo "(I can't seem be able to compile the whole test program)" >&4
20541 echo "(I'll try it in little pieces.)" >&4
20542 set signal -DJUST_NSIG
20543 if eval $compile_ok; then
20544 $run ./signal$_exe > signal.nsg
20547 echo "I can't seem to figure out how many signals you have." >&4
20548 echo "Guessing 50." >&4
20549 echo 'NSIG 50' > signal.nsg
20551 : Now look at all the signal names, one at a time.
20552 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20553 $cat > signal.c <<EOCP
20554 #include <sys/types.h>
20555 #include <signal.h>
20558 printf("$xx %d\n", SIG${xx});
20563 if eval $compile; then
20564 echo "SIG${xx} found."
20565 $run ./signal$_exe >> signal.ls1
20567 echo "SIG${xx} NOT found."
20570 if $test -s signal.ls1; then
20571 $cat signal.nsg signal.ls1 |
20572 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20576 if $test -s signal.lst; then
20579 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20580 echo 'kill -l' >signal
20581 set X `csh -f <signal`
20585 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20587 echo $@ | $tr ' ' $trnl | \
20588 $awk '{ printf "%s %d\n", $1, ++s; }
20589 END { printf "NSIG %d\n", ++s }' >signal.lst
20591 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20593 chmod a+x signal_cmd
20594 $eunicefix signal_cmd
20596 : generate list of signal names
20598 case "$sig_name_init" in
20600 *) case "$sig_num_init" in
20601 ''|*,*) doinit=yes ;;
20606 echo "Generating a list of signal names and numbers..." >&4
20608 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20609 sig_name=`$awk 'BEGIN { printf "ZERO " }
20610 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20611 sig_num=`$awk 'BEGIN { printf "0 " }
20612 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20613 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20614 !/^NSIG/ { printf "\"%s\", ", $1 }
20615 END { printf "0\n" }' signal.lst`
20616 sig_num_init=`$awk 'BEGIN { printf "0, " }
20617 !/^NSIG/ { printf "%d, ", $2}
20618 END { printf "0\n"}' signal.lst`
20621 echo "The following $sig_count signals are available:"
20623 echo $sig_name | $awk \
20624 'BEGIN { linelen = 0 }
20626 for (i = 1; i <= NF; i++) {
20627 name = "SIG" $i " "
20628 linelen = linelen + length(name)
20629 if (linelen > 70) {
20631 linelen = length(name)
20637 sig_size=`echo $sig_name | awk '{print NF}'`
20638 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20640 : Check size of size
20642 case "$sizetype" in
20643 *_t) zzz="$sizetype" ;;
20644 *) zzz="filesize" ;;
20646 echo "Checking the size of $zzz..." >&4
20648 #include <sys/types.h>
20650 #$i_stdlib I_STDLIB
20652 #include <stdlib.h>
20655 printf("%d\n", (int)sizeof($sizetype));
20660 if eval $compile_ok; then
20664 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20667 echo "Your $zzz size is $sizesize bytes."
20672 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20676 : check for socklen_t
20678 echo "Checking to see if you have socklen_t..." >&4
20680 #include <sys/types.h>
20681 #$d_socket HAS_SOCKET
20683 #include <sys/socket.h>
20685 int main() { socklen_t x = 16; }
20688 if eval $compile; then
20690 echo "You have socklen_t."
20693 echo "You do not have socklen_t."
20694 case "$sizetype" in
20695 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20702 : see if this is a socks.h system
20703 set socks.h i_socks
20706 : check for type of the size argument to socket calls
20707 case "$d_socket" in
20711 Checking to see what type is the last argument of accept().
20714 case "$d_socklen_t" in
20715 "$define") yyy="$yyy socklen_t"
20717 yyy="$yyy $sizetype int long unsigned"
20718 for xxx in $yyy; do
20719 case "$socksizetype" in
20720 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20721 case "$usesocks" in
20723 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20724 echo "Your system accepts '$xxx *' for the last argument of accept()."
20725 socksizetype="$xxx"
20728 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20729 echo "Your system accepts '$xxx *' for the last argument of accept()."
20730 socksizetype="$xxx"
20737 : In case none of those worked, prompt the user.
20738 case "$socksizetype" in
20739 '') rp='What is the type for socket address structure sizes?'
20746 *) : no sockets, so pick relatively harmless default
20751 : see what type is used for signed size_t
20752 set ssize_t ssizetype int stdio.h sys/types.h
20757 #$i_stdlib I_STDLIB
20759 #include <stdlib.h>
20761 #include <sys/types.h>
20762 #define Size_t $sizetype
20763 #define SSize_t $dflt
20766 if (sizeof(Size_t) == sizeof(SSize_t))
20768 else if (sizeof(Size_t) == sizeof(int))
20777 if eval $compile_ok && $run ./try > /dev/null; then
20778 ssizetype=`$run ./try`
20779 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20782 Help! I can't compile and run the ssize_t test program: please enlighten me!
20783 (This is probably a misconfiguration in your system or libraries, and
20784 you really ought to fix it. Still, I'll try anyway.)
20786 I need a type that is the same size as $sizetype, but is guaranteed to
20787 be signed. Common values are ssize_t, int and long.
20790 rp="What signed type is the same size as $sizetype?"
20796 : see what type of char stdio uses.
20798 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20799 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20800 echo "Your stdio uses unsigned chars." >&4
20801 stdchar="unsigned char"
20803 echo "Your stdio uses signed chars." >&4
20808 : see what type uids are declared as in the kernel
20810 echo "Looking for the type for user ids returned by getuid()."
20811 set uid_t uidtype xxx stdio.h sys/types.h
20815 xxx=`./findhdr sys/user.h`
20816 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20818 unsigned) dflt="$1 $2" ;;
20822 *) dflt="$uidtype";;
20825 uid_t) echo "uid_t found." ;;
20826 *) rp="What is the type for user ids returned by getuid()?"
20832 : Check size of UID
20835 *_t) zzz="$uidtype" ;;
20838 echo "Checking the size of $zzz..." >&4
20840 #include <sys/types.h>
20842 #$i_stdlib I_STDLIB
20844 #include <stdlib.h>
20847 printf("%d\n", (int)sizeof($uidtype));
20852 if eval $compile_ok; then
20856 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20859 echo "Your $zzz is $uidsize bytes long."
20864 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20867 : Check if UID is signed
20870 *_t) zzz="$uidtype" ;;
20873 echo "Checking the sign of $zzz..." >&4
20875 #include <sys/types.h>
20886 if eval $compile; then
20890 echo "(I can't execute the test program--guessing unsigned.)" >&4
20894 1) echo "Your $zzz is unsigned." ;;
20895 -1) echo "Your $zzz is signed." ;;
20901 echo "(I can't compile the test program--guessing unsigned.)" >&4
20905 : Check format string for UID
20907 $echo "Checking the format string to be used for uids..." >&4
20910 -1) if $test X"$uidsize" = X"$ivsize"; then
20911 uidformat="$ivdformat"
20913 if $test X"$uidsize" = X"$longsize"; then
20916 if $test X"$uidsize" = X"$intsize"; then
20919 if $test X"$uidsize" = X"$shortsize"; then
20926 *) if $test X"$uidsize" = X"$uvsize"; then
20927 uidformat="$uvuformat"
20929 if $test X"$uidsize" = X"$longsize"; then
20932 if $test X"$uidsize" = X"$intsize"; then
20935 if $test X"$uidsize" = X"$shortsize"; then
20944 : Check if site customization support was requested
20945 case "$usesitecustomize" in
20946 $define|true|[Yy]*)
20947 usesitecustomize="$define"
20950 usesitecustomize="$undef"
20954 : determine compiler compiler
20963 if $test -f "$byacc$_exe"; then
20965 comp="byacc or $comp"
20967 if $test -f "$bison$_exe"; then
20968 comp="$comp or bison -y"
20970 rp="Which compiler compiler ($comp) shall I use?"
20979 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20985 : see if this is a assert.h system
20986 set assert.h i_assert
20989 : see if this is a fp.h system
20993 : see if this is a fp_class.h system
20994 set fp_class.h i_fp_class
20997 : see if gdbm.h is available
21002 : see if gdbm_open exists
21003 set gdbm_open d_gdbm_open
21005 case "$d_gdbm_open" in
21008 echo "We won't be including <gdbm.h>"
21017 : see if ndbm.h is available
21020 : Compatibility location for RedHat 7.1
21021 set gdbm/ndbm.h i_gdbmndbm
21023 : Compatibility location for Debian 4.0
21024 set gdbm-ndbm.h i_gdbm_ndbm
21027 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
21028 : see if dbm_open exists
21029 set dbm_open d_dbm_open
21031 case "$d_dbm_open" in
21034 i_gdbmndbm="$undef"
21035 i_gdbm_ndbm="$undef"
21036 echo "We won't be including <ndbm.h>"
21046 : see if this is a ieeefp.h system
21047 case "$i_ieeefp" in
21048 '' ) set ieeefp.h i_ieeefp
21053 : see if this is a libutil.h system
21054 set libutil.h i_libutil
21057 : see if mach cthreads are available
21058 if test "X$usethreads" = "X$define"; then
21059 set mach/cthreads.h i_machcthr
21062 i_machcthr="$undef"
21065 : see if this is a mntent.h system
21066 set mntent.h i_mntent
21069 : see if net/errno.h is available
21071 set net/errno.h val
21074 : Unfortunately, it causes problems on some systems. Arrgh.
21077 cat > try.c <<'EOM'
21080 #include <net/errno.h>
21086 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21087 echo "We'll be including <net/errno.h>." >&4
21089 echo "We won't be including <net/errno.h>." >&4
21098 : see if netinet/tcp.h is available
21099 set netinet/tcp.h i_netinettcp
21102 : see if this is a poll.h system
21106 : see if this is a prot.h system
21110 : Preprocessor symbols
21112 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21113 $cat <<'EOSH' > Cppsym.know
21114 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21115 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21116 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21117 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21118 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21119 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21120 bull c cadmus clipper CMU COFF COMPILER_VERSION
21121 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21122 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21123 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21124 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21126 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21127 H3050R H3050RX hbullx20 hcx host_mips
21128 hp200 hp300 hp700 HP700 hp800 hp9000
21129 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21130 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21131 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21132 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21133 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21134 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21135 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21136 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21137 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21138 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21139 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21140 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21141 MATH_HAS_NO_SIDE_EFFECTS
21142 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21143 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21144 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21145 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21146 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21147 NetBSD news1500 news1700 news1800 news1900 news3700
21148 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21149 ns32016 ns32332 ns32k nsc32000
21150 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21151 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21152 pc532 pdp11 PGC PIC plexus PORTAR posix
21153 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21154 POSIX_C_SOURCE POSIX_SOURCE POWER
21155 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21156 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21157 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21158 sony sony_news sonyrisc sparc sparclite spectrum
21159 stardent stdc STDC_EXT stratos sun sun3 sun386
21160 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21161 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21162 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21163 sysV68 sysV88 Tek4132 Tek4300 titan
21164 TM3200 TM5400 TM5600
21165 tower tower32 tower32_200 tower32_600 tower32_700
21166 tower32_800 tower32_850 tss
21167 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21168 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21169 unix UNIX95 UNIX99 unixpc unos
21170 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21171 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21172 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21174 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21175 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21176 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21179 # Maybe put other stuff here too.
21180 cat <<EOSH >>Cppsym.know
21183 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21184 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21185 $cat Cppsym.know > Cppsym.c
21186 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21187 $rm -f Cppsym.a Cppsym.b Cppsym.c
21188 cat <<EOSH > Cppsym
21190 if $test \$# -gt 0; then
21191 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21192 if $test -s Cppsym.got; then
21199 $tr " " "$trnl" | ./Cppsym.try
21205 cat <<EOSH > Cppsym.try
21207 cat <<'EOCP' > try.c
21210 #define STRINGIFY(a) "a"
21212 #if cpp_stuff == 42
21213 #define StGiFy(a) #a
21214 #define STRINGIFY(a) StGiFy(a)
21216 #if $cpp_stuff != 1 && $cpp_stuff != 42
21217 # include "Bletch: How does this C preprocessor stringify macros?"
21223 cat <<'EOSH' >> Cppsym.try
21225 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21226 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21227 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21228 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21230 echo 'return 0;}' >> try.c
21232 cat <<EOSH >> Cppsym.try
21234 case "$osname-$gccversion" in
21235 irix-) ccflags="\$ccflags -woff 1178" ;;
21236 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21238 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21240 chmod +x Cppsym.try
21241 $eunicefix Cppsym.try
21242 ./Cppsym < Cppsym.know > Cppsym.true
21243 : Add in any linux cpp "predefined macros":
21244 case "$osname::$gccversion" in
21247 rm -f $tHdrH'.h' $tHdrH
21249 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21250 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21251 if [ -s $tHdrH'_cppsym.real' ]; then
21252 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21255 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21258 : now check the C compiler for additional symbols
21259 postprocess_cc_v=''
21261 aix) postprocess_cc_v="|$tr , ' '" ;;
21268 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21271 -D*) echo "\$i" | $sed 's/^-D//';;
21272 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21277 postprocess_cc_v=''
21280 ./ccsym > ccsym1.raw
21281 if $test -s ccsym1.raw; then
21282 $sort ccsym1.raw | $uniq >ccsym.raw
21284 mv ccsym1.raw ccsym.raw
21287 $awk '/\=/ { print $0; next }
21288 { print $0"=1" }' ccsym.raw >ccsym.list
21289 $comm -13 Cppsym.true ccsym.list >ccsym.own
21290 $comm -12 Cppsym.true ccsym.list >ccsym.com
21291 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21293 if $test -z ccsym.raw; then
21294 echo "Your C compiler doesn't seem to define any symbols!" >&4
21296 echo "However, your C preprocessor defines the following symbols:"
21299 cppsymbols=`$cat Cppsym.true`
21300 cppsymbols=`echo $cppsymbols`
21301 cppccsymbols="$cppsymbols"
21303 if $test -s ccsym.com; then
21304 echo "Your C compiler and pre-processor define these symbols:"
21305 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21308 cppccsymbols=`$cat ccsym.com`
21309 cppccsymbols=`echo $cppccsymbols`
21310 $test "$silent" || sleep 1
21312 if $test -s ccsym.cpp; then
21313 $test "$also" && echo " "
21314 echo "Your C pre-processor ${also}defines the following symbols:"
21315 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21317 cppsymbols=`$cat ccsym.cpp`
21318 cppsymbols=`echo $cppsymbols`
21319 $test "$silent" || sleep 1
21321 if $test -s ccsym.own; then
21322 $test "$also" && echo " "
21323 echo "Your C compiler ${also}defines the following cpp symbols:"
21324 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21325 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21326 ccsymbols=`$cat ccsym.own`
21327 ccsymbols=`echo $ccsymbols`
21328 $test "$silent" || sleep 1
21332 : see if this is a termio system
21336 if $test `./findhdr termios.h`; then
21337 set tcsetattr i_termios
21343 "$define") echo "You have POSIX termios.h... good!" >&4;;
21344 *) if ./Cppsym pyr; then
21345 case "`/bin/universe`" in
21346 ucb) if $test `./findhdr sgtty.h`; then
21348 echo "<sgtty.h> found." >&4
21350 echo "System is pyramid with BSD universe."
21351 ./warn "<sgtty.h> not found--you could have problems."
21353 *) if $test `./findhdr termio.h`; then
21355 echo "<termio.h> found." >&4
21357 echo "System is pyramid with USG universe."
21358 ./warn "<termio.h> not found--you could have problems."
21362 if $test `./findhdr termio.h`; then
21363 echo "<termio.h> found." >&4
21365 elif $test `./findhdr sgtty.h`; then
21366 echo "<sgtty.h> found." >&4
21369 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21372 if $test `./findhdr sgtty.h`; then
21373 echo "<sgtty.h> found." >&4
21375 elif $test `./findhdr termio.h`; then
21376 echo "<termio.h> found." >&4
21379 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21383 set i_termio; eval $setvar
21384 val=$val2; set i_sgtty; eval $setvar
21385 val=$val3; set i_termios; eval $setvar
21387 : see if stddef is available
21388 set stddef.h i_stddef
21391 : see if sys/access.h is available
21392 set sys/access.h i_sysaccess
21395 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21396 set sys/filio.h i_sysfilio
21399 if $test `./findhdr sys/ioctl.h`; then
21401 echo '<sys/ioctl.h> found.' >&4
21404 if $test $i_sysfilio = "$define"; then
21405 echo '<sys/ioctl.h> NOT found.' >&4
21407 $test $i_sgtty = "$define" && xxx="sgtty.h"
21408 $test $i_termio = "$define" && xxx="termio.h"
21409 $test $i_termios = "$define" && xxx="termios.h"
21410 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21416 : see if socket ioctl defs are in sys/sockio.h
21418 xxx=`./findhdr sys/sockio.h`
21419 if $test "$xxx"; then
21420 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21422 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21425 echo "No socket ioctls found in <sys/sockio.h>." >&4
21430 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21436 : see if this is a syslog.h system
21437 set syslog.h i_syslog
21440 : see if this is a sys/mode.h system
21441 set sys/mode.h i_sysmode
21444 : see if there is a sys/poll.h file
21445 set sys/poll.h i_syspoll
21448 : see if sys/resource.h has to be included
21449 set sys/resource.h i_sysresrc
21452 : see if sys/security.h is available
21453 set sys/security.h i_syssecrt
21456 : see if this is a sys/statvfs.h system
21457 set sys/statvfs.h i_sysstatvfs
21460 : see if this is a sys/un.h system
21461 set sys/un.h i_sysun
21464 : see if this is a sys/utsname.h system
21465 set sys/utsname.h i_sysutsname
21468 : see if this is a syswait system
21469 set sys/wait.h i_syswait
21472 : see if this is a ustat.h system
21473 set ustat.h i_ustat
21476 : see if this is an utime system
21477 set utime.h i_utime
21480 : see if this is a vfork system
21483 set vfork.h i_vfork
21493 echo "Looking for extensions..." >&4
21494 : If we are using the old config.sh, known_extensions may contain
21495 : old or inaccurate or duplicate values.
21496 known_extensions=''
21497 nonxs_extensions=''
21498 : We do not use find because it might not be available.
21499 : We do not just use MANIFEST because the user may have dropped
21500 : some additional extensions into the source tree and expect them
21503 : Function to recursively find available extensions, ignoring DynaLoader
21504 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21508 DynaLoader|dynaload) ;;
21510 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21511 known_extensions="$known_extensions $1$xxx";
21512 elif $test -f $xxx/Makefile.PL; then
21513 nonxs_extensions="$nonxs_extensions $1$xxx";
21515 if $test -d $xxx -a $# -lt 10; then
21518 eval $find_extensions;
21530 eval $find_extensions
21531 # Special case: Add in modules that nest beyond the first level.
21532 # Currently threads/shared and Hash/Util/FieldHash, since they are
21533 # not picked up by the recursive find above (and adding in general
21534 # recursive finding breaks SDBM_File/sdbm).
21535 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21536 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21537 set X $known_extensions
21539 known_extensions="$*"
21540 set X $nonxs_extensions
21542 nonxs_extensions="$*"
21545 : Now see which are supported on this system.
21547 for xxx in $known_extensions ; do
21551 $define) avail_ext="$avail_ext $xxx" ;;
21554 GDBM_File|gdbm_fil)
21556 $define) avail_ext="$avail_ext $xxx" ;;
21559 I18N/Langinfo|i18n_lan)
21560 case "$i_langinfo$d_nl_langinfo" in
21561 $define$define) avail_ext="$avail_ext $xxx" ;;
21565 : XXX Do we need a useipcsysv variable here
21566 case "${d_msg}${d_sem}${d_shm}" in
21567 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21570 NDBM_File|ndbm_fil)
21573 case "$osname-$use64bitint" in
21576 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21579 *) avail_ext="$avail_ext $xxx" ;;
21584 ODBM_File|odbm_fil)
21585 case "${i_dbm}${i_rpcsvcdbm}" in
21587 case "$d_cplusplus" in
21588 define) ;; # delete as a function name will not work
21589 *) case "$osname-$use64bitint" in
21592 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21595 *) avail_ext="$avail_ext $xxx" ;;
21603 case "$useopcode" in
21604 true|define|y) avail_ext="$avail_ext $xxx" ;;
21608 case "$useposix" in
21609 true|define|y) avail_ext="$avail_ext $xxx" ;;
21613 case "$d_socket" in
21616 beos) ;; # not unless BONE
21617 *) avail_ext="$avail_ext $xxx" ;;
21622 Sys/Syslog|sys/syslog)
21623 : XXX syslog requires socket
21624 case "$d_socket" in
21625 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21629 case "$usethreads" in
21631 case "$use5005threads" in
21632 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21636 threads|threads/shared)
21637 # threads and threads::shared are special cases.
21638 # To stop people from asking "Perl 5.8.0 was supposed
21639 # to have this new fancy threads implementation but my
21640 # perl doesn't have it" and from people trying to
21641 # (re)install the threads module using CPAN.pm and
21642 # CPAN.pm then offering to reinstall Perl 5.8.0,
21643 # the threads.pm and threads/shared.pm will always be
21644 # there, croaking informatively ("you need to rebuild
21645 # all of Perl with threads, sorry") when threads haven't
21646 # been compiled in.
21648 avail_ext="$avail_ext $xxx"
21652 cygwin) avail_ext="$avail_ext $xxx" ;;
21655 XS/APItest|xs/apitest)
21656 # This is just for testing. Skip it unless we have dynamic loading.
21659 $define) avail_ext="$avail_ext $xxx" ;;
21662 XS/Typemap|xs/typemap)
21663 # This is just for testing. Skip it unless we have dynamic loading.
21665 $define) avail_ext="$avail_ext $xxx" ;;
21668 *) avail_ext="$avail_ext $xxx"
21677 case "$onlyextensions" in
21679 *) keepextensions=''
21680 echo "You have requested that only certains extensions be included..." >&4
21681 for i in $onlyextensions; do
21682 case " $avail_ext " in
21684 echo "Keeping extension $i."
21685 keepextensions="$keepextensions $i"
21687 *) echo "Ignoring extension $i." ;;
21690 avail_ext="$keepextensions"
21694 case "$noextensions" in
21696 *) keepextensions=''
21697 echo "You have requested that certain extensions be ignored..." >&4
21698 for i in $avail_ext; do
21699 case " $noextensions " in
21700 *" $i "*) echo "Ignoring extension $i." ;;
21701 *) echo "Keeping extension $i.";
21702 keepextensions="$keepextensions $i"
21706 avail_ext="$keepextensions"
21710 : Now see which nonxs extensions are supported on this system.
21711 : For now assume all are.
21713 for xxx in $nonxs_extensions ; do
21715 *) nonxs_ext="$nonxs_ext $xxx"
21727 A number of extensions are supplied with $package. You may choose to
21728 compile these extensions for dynamic loading (the default), compile
21729 them into the $package executable (static loading), or not include
21730 them at all. Answer "none" to include no extensions.
21731 Note that DynaLoader is always built and need not be mentioned here.
21734 case "$dynamic_ext" in
21736 : Exclude those listed in static_ext
21738 for xxx in $avail_ext; do
21739 case " $static_ext " in
21741 *) dflt="$dflt $xxx" ;;
21748 *) dflt="$dynamic_ext"
21749 # Perhaps we are reusing an old out-of-date config.sh.
21752 if test X"$dynamic_ext" != X"$avail_ext"; then
21754 NOTICE: Your previous config.sh list may be incorrect.
21755 The extensions now available to you are
21757 but the default list from your previous config.sh is
21769 rp="What extensions do you wish to load dynamically?"
21772 none) dynamic_ext=' ' ;;
21773 *) dynamic_ext="$ans" ;;
21776 case "$static_ext" in
21778 : Exclude those already listed in dynamic linking
21780 for xxx in $avail_ext; do
21781 case " $dynamic_ext " in
21783 *) dflt="$dflt $xxx" ;;
21790 *) dflt="$static_ext"
21797 rp="What extensions do you wish to load statically?"
21800 none) static_ext=' ' ;;
21801 *) static_ext="$ans" ;;
21806 A number of extensions are supplied with $package. Answer "none"
21807 to include no extensions.
21808 Note that DynaLoader is always built and need not be mentioned here.
21811 case "$static_ext" in
21812 '') dflt="$avail_ext" ;;
21813 *) dflt="$static_ext"
21814 # Perhaps we are reusing an old out-of-date config.sh.
21817 if test X"$static_ext" != X"$avail_ext"; then
21819 NOTICE: Your previous config.sh list may be incorrect.
21820 The extensions now available to you are
21822 but the default list from your previous config.sh is
21831 : Exclude those that are not xs extensions
21835 rp="What extensions do you wish to include?"
21838 none) static_ext=' ' ;;
21839 *) static_ext="$ans" ;;
21844 # Encode is a special case. If we are building Encode as a static
21845 # extension, we need to explicitly list its subextensions as well.
21846 # For other nested extensions, this is handled automatically by
21847 # the appropriate Makefile.PL.
21848 case " $static_ext " in
21849 *" Encode "*) # Add the subextensions of Encode
21851 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21852 static_ext="$static_ext Encode/$xxx"
21858 set X $dynamic_ext $static_ext $nonxs_ext
21862 # Sanity check: We require an extension suitable for use with
21863 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21864 # should show up as failures in the test suite, but it's helpful to
21865 # catch them now.) The 'extensions' list is normally sorted
21866 # alphabetically, so we need to accept either
21867 # DB_File ... Fcntl ... IO ....
21868 # or something like
21869 # Fcntl ... NDBM_File ... IO ....
21870 case " $extensions" in
21871 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21872 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21873 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21874 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21875 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21879 : Remove libraries needed only for extensions
21880 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21881 : The exception is SunOS 4.x, which needs them.
21882 case "${osname}X${osvers}" in
21886 *) case "$usedl" in
21887 $define|true|[yY]*)
21888 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21892 *) perllibs="$libs"
21898 : Remove build directory name from cppstdin so it can be used from
21899 : either the present location or the final installed location.
21901 : Get out of the UU directory to get correct path name.
21903 case "$cppstdin" in
21905 echo "Stripping down cppstdin path name"
21911 : end of configuration questions
21913 echo "End of configuration questions."
21916 : back to where it started
21917 if test -d ../UU; then
21921 : configuration may be unconditionally patched via a 'config.arch' file
21922 if $test -f config.arch; then
21923 echo "I see a config.arch file, loading it." >&4
21927 : configuration may be patched via a 'config.over' file
21928 if $test -f config.over; then
21931 rp='I see a config.over file. Do you wish to load it?'
21934 n*) echo "OK, I'll ignore it.";;
21936 echo "Configuration override changes have been loaded."
21941 : in case they want portability, strip down executable paths
21942 case "$d_portable" in
21945 echo "Stripping down executable paths..." >&4
21946 for file in $loclist $trylist; do
21948 eval $file=`basename $temp`
21953 : create config.sh file
21955 echo "Creating config.sh..." >&4
21956 $spitshell <<EOT >config.sh
21959 # This file was produced by running the Configure script. It holds all the
21960 # definitions figured out by Configure. Should you modify one of these values,
21961 # do not forget to propagate your changes by running "Configure -der". You may
21962 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21965 # Package name : $package
21966 # Source directory : $src
21967 # Configuration time: $cf_time
21968 # Configured by : $cf_by
21969 # Target system : $myuname
21972 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21973 $spitshell <<EOT >>config.sh
21982 Revision='$Revision'
21990 alignbytes='$alignbytes'
21991 ansi2knr='$ansi2knr'
21992 aphostname='$aphostname'
21993 api_revision='$api_revision'
21994 api_subversion='$api_subversion'
21995 api_version='$api_version'
21996 api_versionstring='$api_versionstring'
21999 archlibexp='$archlibexp'
22000 archname64='$archname64'
22001 archname='$archname'
22002 archobjs='$archobjs'
22003 asctime_r_proto='$asctime_r_proto'
22011 byteorder='$byteorder'
22013 castflags='$castflags'
22016 cccdlflags='$cccdlflags'
22017 ccdlflags='$ccdlflags'
22019 ccflags_uselargefiles='$ccflags_uselargefiles'
22021 ccsymbols='$ccsymbols'
22022 ccversion='$ccversion'
22024 cf_email='$cf_email'
22029 clocktype='$clocktype'
22031 compress='$compress'
22032 contains='$contains'
22036 cpp_stuff='$cpp_stuff'
22037 cppccsymbols='$cppccsymbols'
22038 cppflags='$cppflags'
22040 cppminus='$cppminus'
22042 cppstdin='$cppstdin'
22043 cppsymbols='$cppsymbols'
22044 crypt_r_proto='$crypt_r_proto'
22045 cryptlib='$cryptlib'
22047 ctermid_r_proto='$ctermid_r_proto'
22048 ctime_r_proto='$ctime_r_proto'
22049 d_Gconvert='$d_Gconvert'
22050 d_PRIEUldbl='$d_PRIEUldbl'
22051 d_PRIFUldbl='$d_PRIFUldbl'
22052 d_PRIGUldbl='$d_PRIGUldbl'
22053 d_PRIXU64='$d_PRIXU64'
22054 d_PRId64='$d_PRId64'
22055 d_PRIeldbl='$d_PRIeldbl'
22056 d_PRIfldbl='$d_PRIfldbl'
22057 d_PRIgldbl='$d_PRIgldbl'
22058 d_PRIi64='$d_PRIi64'
22059 d_PRIo64='$d_PRIo64'
22060 d_PRIu64='$d_PRIu64'
22061 d_PRIx64='$d_PRIx64'
22062 d_SCNfldbl='$d_SCNfldbl'
22063 d__fwalk='$d__fwalk'
22064 d_access='$d_access'
22065 d_accessx='$d_accessx'
22068 d_archlib='$d_archlib'
22069 d_asctime64='$d_asctime64'
22070 d_asctime_r='$d_asctime_r'
22073 d_attribute_format='$d_attribute_format'
22074 d_attribute_malloc='$d_attribute_malloc'
22075 d_attribute_nonnull='$d_attribute_nonnull'
22076 d_attribute_noreturn='$d_attribute_noreturn'
22077 d_attribute_pure='$d_attribute_pure'
22078 d_attribute_unused='$d_attribute_unused'
22079 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22083 d_bsdgetpgrp='$d_bsdgetpgrp'
22084 d_bsdsetpgrp='$d_bsdsetpgrp'
22085 d_builtin_choose_expr='$d_builtin_choose_expr'
22086 d_builtin_expect='$d_builtin_expect'
22088 d_c99_variadic_macros='$d_c99_variadic_macros'
22089 d_casti32='$d_casti32'
22090 d_castneg='$d_castneg'
22091 d_charvspr='$d_charvspr'
22093 d_chroot='$d_chroot'
22094 d_chsize='$d_chsize'
22096 d_clearenv='$d_clearenv'
22097 d_closedir='$d_closedir'
22098 d_cmsghdr_s='$d_cmsghdr_s'
22100 d_copysignl='$d_copysignl'
22101 d_cplusplus='$d_cplusplus'
22103 d_crypt_r='$d_crypt_r'
22105 d_ctermid='$d_ctermid'
22106 d_ctermid_r='$d_ctermid_r'
22107 d_ctime64='$d_ctime64'
22108 d_ctime_r='$d_ctime_r'
22109 d_cuserid='$d_cuserid'
22110 d_dbl_dig='$d_dbl_dig'
22111 d_dbminitproto='$d_dbminitproto'
22112 d_difftime64='$d_difftime64'
22113 d_difftime='$d_difftime'
22114 d_dir_dd_fd='$d_dir_dd_fd'
22116 d_dirnamlen='$d_dirnamlen'
22117 d_dlerror='$d_dlerror'
22118 d_dlopen='$d_dlopen'
22119 d_dlsymun='$d_dlsymun'
22120 d_dosuid='$d_dosuid'
22121 d_drand48_r='$d_drand48_r'
22122 d_drand48proto='$d_drand48proto'
22124 d_eaccess='$d_eaccess'
22125 d_endgrent='$d_endgrent'
22126 d_endgrent_r='$d_endgrent_r'
22127 d_endhent='$d_endhent'
22128 d_endhostent_r='$d_endhostent_r'
22129 d_endnent='$d_endnent'
22130 d_endnetent_r='$d_endnetent_r'
22131 d_endpent='$d_endpent'
22132 d_endprotoent_r='$d_endprotoent_r'
22133 d_endpwent='$d_endpwent'
22134 d_endpwent_r='$d_endpwent_r'
22135 d_endsent='$d_endsent'
22136 d_endservent_r='$d_endservent_r'
22137 d_eofnblk='$d_eofnblk'
22138 d_eunice='$d_eunice'
22139 d_faststdio='$d_faststdio'
22140 d_fchdir='$d_fchdir'
22141 d_fchmod='$d_fchmod'
22142 d_fchown='$d_fchown'
22144 d_fcntl_can_lock='$d_fcntl_can_lock'
22145 d_fd_macros='$d_fd_macros'
22146 d_fd_set='$d_fd_set'
22147 d_fds_bits='$d_fds_bits'
22148 d_fgetpos='$d_fgetpos'
22149 d_finite='$d_finite'
22150 d_finitel='$d_finitel'
22151 d_flexfnam='$d_flexfnam'
22153 d_flockproto='$d_flockproto'
22155 d_fp_class='$d_fp_class'
22156 d_fpathconf='$d_fpathconf'
22157 d_fpclass='$d_fpclass'
22158 d_fpclassify='$d_fpclassify'
22159 d_fpclassl='$d_fpclassl'
22160 d_fpos64_t='$d_fpos64_t'
22161 d_frexpl='$d_frexpl'
22162 d_fs_data_s='$d_fs_data_s'
22163 d_fseeko='$d_fseeko'
22164 d_fsetpos='$d_fsetpos'
22165 d_fstatfs='$d_fstatfs'
22166 d_fstatvfs='$d_fstatvfs'
22168 d_ftello='$d_ftello'
22170 d_futimes='$d_futimes'
22171 d_getcwd='$d_getcwd'
22172 d_getespwnam='$d_getespwnam'
22173 d_getfsstat='$d_getfsstat'
22174 d_getgrent='$d_getgrent'
22175 d_getgrent_r='$d_getgrent_r'
22176 d_getgrgid_r='$d_getgrgid_r'
22177 d_getgrnam_r='$d_getgrnam_r'
22178 d_getgrps='$d_getgrps'
22179 d_gethbyaddr='$d_gethbyaddr'
22180 d_gethbyname='$d_gethbyname'
22181 d_gethent='$d_gethent'
22182 d_gethname='$d_gethname'
22183 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22184 d_gethostbyname_r='$d_gethostbyname_r'
22185 d_gethostent_r='$d_gethostent_r'
22186 d_gethostprotos='$d_gethostprotos'
22187 d_getitimer='$d_getitimer'
22188 d_getlogin='$d_getlogin'
22189 d_getlogin_r='$d_getlogin_r'
22190 d_getmnt='$d_getmnt'
22191 d_getmntent='$d_getmntent'
22192 d_getnbyaddr='$d_getnbyaddr'
22193 d_getnbyname='$d_getnbyname'
22194 d_getnent='$d_getnent'
22195 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22196 d_getnetbyname_r='$d_getnetbyname_r'
22197 d_getnetent_r='$d_getnetent_r'
22198 d_getnetprotos='$d_getnetprotos'
22199 d_getpagsz='$d_getpagsz'
22200 d_getpbyname='$d_getpbyname'
22201 d_getpbynumber='$d_getpbynumber'
22202 d_getpent='$d_getpent'
22203 d_getpgid='$d_getpgid'
22204 d_getpgrp2='$d_getpgrp2'
22205 d_getpgrp='$d_getpgrp'
22206 d_getppid='$d_getppid'
22207 d_getprior='$d_getprior'
22208 d_getprotobyname_r='$d_getprotobyname_r'
22209 d_getprotobynumber_r='$d_getprotobynumber_r'
22210 d_getprotoent_r='$d_getprotoent_r'
22211 d_getprotoprotos='$d_getprotoprotos'
22212 d_getprpwnam='$d_getprpwnam'
22213 d_getpwent='$d_getpwent'
22214 d_getpwent_r='$d_getpwent_r'
22215 d_getpwnam_r='$d_getpwnam_r'
22216 d_getpwuid_r='$d_getpwuid_r'
22217 d_getsbyname='$d_getsbyname'
22218 d_getsbyport='$d_getsbyport'
22219 d_getsent='$d_getsent'
22220 d_getservbyname_r='$d_getservbyname_r'
22221 d_getservbyport_r='$d_getservbyport_r'
22222 d_getservent_r='$d_getservent_r'
22223 d_getservprotos='$d_getservprotos'
22224 d_getspnam='$d_getspnam'
22225 d_getspnam_r='$d_getspnam_r'
22226 d_gettimeod='$d_gettimeod'
22227 d_gmtime64='$d_gmtime64'
22228 d_gmtime_r='$d_gmtime_r'
22229 d_gnulibc='$d_gnulibc'
22230 d_grpasswd='$d_grpasswd'
22231 d_hasmntopt='$d_hasmntopt'
22233 d_ilogbl='$d_ilogbl'
22234 d_inc_version_list='$d_inc_version_list'
22236 d_inetaton='$d_inetaton'
22237 d_int64_t='$d_int64_t'
22238 d_isascii='$d_isascii'
22239 d_isfinite='$d_isfinite'
22242 d_isnanl='$d_isnanl'
22243 d_killpg='$d_killpg'
22244 d_lchown='$d_lchown'
22245 d_ldbl_dig='$d_ldbl_dig'
22246 d_libm_lib_version='$d_libm_lib_version'
22248 d_localtime64='$d_localtime64'
22249 d_localtime_r='$d_localtime_r'
22250 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22251 d_locconv='$d_locconv'
22253 d_longdbl='$d_longdbl'
22254 d_longlong='$d_longlong'
22255 d_lseekproto='$d_lseekproto'
22257 d_madvise='$d_madvise'
22258 d_malloc_good_size='$d_malloc_good_size'
22259 d_malloc_size='$d_malloc_size'
22261 d_mbstowcs='$d_mbstowcs'
22262 d_mbtowc='$d_mbtowc'
22263 d_memchr='$d_memchr'
22264 d_memcmp='$d_memcmp'
22265 d_memcpy='$d_memcpy'
22266 d_memmove='$d_memmove'
22267 d_memset='$d_memset'
22269 d_mkdtemp='$d_mkdtemp'
22270 d_mkfifo='$d_mkfifo'
22271 d_mkstemp='$d_mkstemp'
22272 d_mkstemps='$d_mkstemps'
22273 d_mktime64='$d_mktime64'
22274 d_mktime='$d_mktime'
22277 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22278 d_modflproto='$d_modflproto'
22279 d_mprotect='$d_mprotect'
22281 d_msg_ctrunc='$d_msg_ctrunc'
22282 d_msg_dontroute='$d_msg_dontroute'
22283 d_msg_oob='$d_msg_oob'
22284 d_msg_peek='$d_msg_peek'
22285 d_msg_proxy='$d_msg_proxy'
22286 d_msgctl='$d_msgctl'
22287 d_msgget='$d_msgget'
22288 d_msghdr_s='$d_msghdr_s'
22289 d_msgrcv='$d_msgrcv'
22290 d_msgsnd='$d_msgsnd'
22292 d_munmap='$d_munmap'
22293 d_mymalloc='$d_mymalloc'
22296 d_nl_langinfo='$d_nl_langinfo'
22297 d_nv_preserves_uv='$d_nv_preserves_uv'
22298 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22299 d_off64_t='$d_off64_t'
22300 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22301 d_oldpthreads='$d_oldpthreads'
22302 d_oldsock='$d_oldsock'
22304 d_pathconf='$d_pathconf'
22306 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22307 d_phostname='$d_phostname'
22310 d_portable='$d_portable'
22311 d_printf_format_null='$d_printf_format_null'
22312 d_procselfexe='$d_procselfexe'
22313 d_pseudofork='$d_pseudofork'
22314 d_pthread_atfork='$d_pthread_atfork'
22315 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22316 d_pthread_yield='$d_pthread_yield'
22318 d_pwchange='$d_pwchange'
22319 d_pwclass='$d_pwclass'
22320 d_pwcomment='$d_pwcomment'
22321 d_pwexpire='$d_pwexpire'
22322 d_pwgecos='$d_pwgecos'
22323 d_pwpasswd='$d_pwpasswd'
22324 d_pwquota='$d_pwquota'
22327 d_random_r='$d_random_r'
22328 d_readdir64_r='$d_readdir64_r'
22329 d_readdir='$d_readdir'
22330 d_readdir_r='$d_readdir_r'
22331 d_readlink='$d_readlink'
22333 d_recvmsg='$d_recvmsg'
22334 d_rename='$d_rename'
22335 d_rewinddir='$d_rewinddir'
22337 d_safebcpy='$d_safebcpy'
22338 d_safemcpy='$d_safemcpy'
22339 d_sanemcmp='$d_sanemcmp'
22340 d_sbrkproto='$d_sbrkproto'
22341 d_scalbnl='$d_scalbnl'
22342 d_sched_yield='$d_sched_yield'
22343 d_scm_rights='$d_scm_rights'
22344 d_seekdir='$d_seekdir'
22345 d_select='$d_select'
22347 d_semctl='$d_semctl'
22348 d_semctl_semid_ds='$d_semctl_semid_ds'
22349 d_semctl_semun='$d_semctl_semun'
22350 d_semget='$d_semget'
22352 d_sendmsg='$d_sendmsg'
22353 d_setegid='$d_setegid'
22354 d_seteuid='$d_seteuid'
22355 d_setgrent='$d_setgrent'
22356 d_setgrent_r='$d_setgrent_r'
22357 d_setgrps='$d_setgrps'
22358 d_sethent='$d_sethent'
22359 d_sethostent_r='$d_sethostent_r'
22360 d_setitimer='$d_setitimer'
22361 d_setlinebuf='$d_setlinebuf'
22362 d_setlocale='$d_setlocale'
22363 d_setlocale_r='$d_setlocale_r'
22364 d_setnent='$d_setnent'
22365 d_setnetent_r='$d_setnetent_r'
22366 d_setpent='$d_setpent'
22367 d_setpgid='$d_setpgid'
22368 d_setpgrp2='$d_setpgrp2'
22369 d_setpgrp='$d_setpgrp'
22370 d_setprior='$d_setprior'
22371 d_setproctitle='$d_setproctitle'
22372 d_setprotoent_r='$d_setprotoent_r'
22373 d_setpwent='$d_setpwent'
22374 d_setpwent_r='$d_setpwent_r'
22375 d_setregid='$d_setregid'
22376 d_setresgid='$d_setresgid'
22377 d_setresuid='$d_setresuid'
22378 d_setreuid='$d_setreuid'
22379 d_setrgid='$d_setrgid'
22380 d_setruid='$d_setruid'
22381 d_setsent='$d_setsent'
22382 d_setservent_r='$d_setservent_r'
22383 d_setsid='$d_setsid'
22384 d_setvbuf='$d_setvbuf'
22388 d_shmatprototype='$d_shmatprototype'
22389 d_shmctl='$d_shmctl'
22391 d_shmget='$d_shmget'
22392 d_sigaction='$d_sigaction'
22393 d_signbit='$d_signbit'
22394 d_sigprocmask='$d_sigprocmask'
22395 d_sigsetjmp='$d_sigsetjmp'
22396 d_sitearch='$d_sitearch'
22397 d_snprintf='$d_snprintf'
22398 d_sockatmark='$d_sockatmark'
22399 d_sockatmarkproto='$d_sockatmarkproto'
22400 d_socket='$d_socket'
22401 d_socklen_t='$d_socklen_t'
22402 d_sockpair='$d_sockpair'
22403 d_socks5_init='$d_socks5_init'
22404 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22406 d_srand48_r='$d_srand48_r'
22407 d_srandom_r='$d_srandom_r'
22408 d_sresgproto='$d_sresgproto'
22409 d_sresuproto='$d_sresuproto'
22410 d_statblks='$d_statblks'
22411 d_statfs_f_flags='$d_statfs_f_flags'
22412 d_statfs_s='$d_statfs_s'
22413 d_statvfs='$d_statvfs'
22414 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22415 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22416 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22417 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22418 d_stdio_stream_array='$d_stdio_stream_array'
22419 d_stdiobase='$d_stdiobase'
22420 d_stdstdio='$d_stdstdio'
22421 d_strchr='$d_strchr'
22422 d_strcoll='$d_strcoll'
22423 d_strctcpy='$d_strctcpy'
22424 d_strerrm='$d_strerrm'
22425 d_strerror='$d_strerror'
22426 d_strerror_r='$d_strerror_r'
22427 d_strftime='$d_strftime'
22428 d_strlcat='$d_strlcat'
22429 d_strlcpy='$d_strlcpy'
22430 d_strtod='$d_strtod'
22431 d_strtol='$d_strtol'
22432 d_strtold='$d_strtold'
22433 d_strtoll='$d_strtoll'
22434 d_strtoq='$d_strtoq'
22435 d_strtoul='$d_strtoul'
22436 d_strtoull='$d_strtoull'
22437 d_strtouq='$d_strtouq'
22438 d_strxfrm='$d_strxfrm'
22439 d_suidsafe='$d_suidsafe'
22440 d_symlink='$d_symlink'
22441 d_syscall='$d_syscall'
22442 d_syscallproto='$d_syscallproto'
22443 d_sysconf='$d_sysconf'
22444 d_sysernlst='$d_sysernlst'
22445 d_syserrlst='$d_syserrlst'
22446 d_system='$d_system'
22447 d_tcgetpgrp='$d_tcgetpgrp'
22448 d_tcsetpgrp='$d_tcsetpgrp'
22449 d_telldir='$d_telldir'
22450 d_telldirproto='$d_telldirproto'
22452 d_timegm='$d_timegm'
22454 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22455 d_tm_tm_zone='$d_tm_tm_zone'
22456 d_tmpnam_r='$d_tmpnam_r'
22457 d_truncate='$d_truncate'
22458 d_ttyname_r='$d_ttyname_r'
22459 d_tzname='$d_tzname'
22460 d_u32align='$d_u32align'
22461 d_ualarm='$d_ualarm'
22464 d_union_semun='$d_union_semun'
22465 d_unordered='$d_unordered'
22466 d_unsetenv='$d_unsetenv'
22467 d_usleep='$d_usleep'
22468 d_usleepproto='$d_usleepproto'
22470 d_vendorarch='$d_vendorarch'
22471 d_vendorbin='$d_vendorbin'
22472 d_vendorlib='$d_vendorlib'
22473 d_vendorscript='$d_vendorscript'
22475 d_void_closedir='$d_void_closedir'
22476 d_voidsig='$d_voidsig'
22477 d_voidtty='$d_voidtty'
22478 d_volatile='$d_volatile'
22479 d_vprintf='$d_vprintf'
22480 d_vsnprintf='$d_vsnprintf'
22482 d_waitpid='$d_waitpid'
22483 d_wcstombs='$d_wcstombs'
22484 d_wctomb='$d_wctomb'
22485 d_writev='$d_writev'
22488 db_hashtype='$db_hashtype'
22489 db_prefixtype='$db_prefixtype'
22490 db_version_major='$db_version_major'
22491 db_version_minor='$db_version_minor'
22492 db_version_patch='$db_version_patch'
22493 defvoidused='$defvoidused'
22494 direntrytype='$direntrytype'
22497 doublesize='$doublesize'
22499 drand48_r_proto='$drand48_r_proto'
22501 dynamic_ext='$dynamic_ext'
22507 endgrent_r_proto='$endgrent_r_proto'
22508 endhostent_r_proto='$endhostent_r_proto'
22509 endnetent_r_proto='$endnetent_r_proto'
22510 endprotoent_r_proto='$endprotoent_r_proto'
22511 endpwent_r_proto='$endpwent_r_proto'
22512 endservent_r_proto='$endservent_r_proto'
22513 eunicefix='$eunicefix'
22516 extensions='$extensions'
22518 fflushNULL='$fflushNULL'
22519 fflushall='$fflushall'
22521 firstmakefile='$firstmakefile'
22523 fpossize='$fpossize'
22524 fpostype='$fpostype'
22525 freetype='$freetype'
22528 full_csh='$full_csh'
22529 full_sed='$full_sed'
22530 gccansipedantic='$gccansipedantic'
22531 gccosandvers='$gccosandvers'
22532 gccversion='$gccversion'
22533 getgrent_r_proto='$getgrent_r_proto'
22534 getgrgid_r_proto='$getgrgid_r_proto'
22535 getgrnam_r_proto='$getgrnam_r_proto'
22536 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22537 gethostbyname_r_proto='$gethostbyname_r_proto'
22538 gethostent_r_proto='$gethostent_r_proto'
22539 getlogin_r_proto='$getlogin_r_proto'
22540 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22541 getnetbyname_r_proto='$getnetbyname_r_proto'
22542 getnetent_r_proto='$getnetent_r_proto'
22543 getprotobyname_r_proto='$getprotobyname_r_proto'
22544 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22545 getprotoent_r_proto='$getprotoent_r_proto'
22546 getpwent_r_proto='$getpwent_r_proto'
22547 getpwnam_r_proto='$getpwnam_r_proto'
22548 getpwuid_r_proto='$getpwuid_r_proto'
22549 getservbyname_r_proto='$getservbyname_r_proto'
22550 getservbyport_r_proto='$getservbyport_r_proto'
22551 getservent_r_proto='$getservent_r_proto'
22552 getspnam_r_proto='$getspnam_r_proto'
22553 gidformat='$gidformat'
22559 gmtime_r_proto='$gmtime_r_proto'
22560 gnulibc_version='$gnulibc_version'
22562 groupcat='$groupcat'
22563 groupstype='$groupstype'
22566 h_sysfile='$h_sysfile'
22569 html1dir='$html1dir'
22570 html1direxp='$html1direxp'
22571 html3dir='$html3dir'
22572 html3direxp='$html3direxp'
22581 i_arpainet='$i_arpainet'
22582 i_assert='$i_assert'
22583 i_bsdioctl='$i_bsdioctl'
22587 i_dirent='$i_dirent'
22593 i_fp_class='$i_fp_class'
22595 i_gdbm_ndbm='$i_gdbm_ndbm'
22596 i_gdbmndbm='$i_gdbmndbm'
22598 i_ieeefp='$i_ieeefp'
22599 i_inttypes='$i_inttypes'
22600 i_langinfo='$i_langinfo'
22601 i_libutil='$i_libutil'
22602 i_limits='$i_limits'
22603 i_locale='$i_locale'
22604 i_machcthr='$i_machcthr'
22605 i_malloc='$i_malloc'
22606 i_mallocmalloc='$i_mallocmalloc'
22608 i_memory='$i_memory'
22609 i_mntent='$i_mntent'
22612 i_neterrno='$i_neterrno'
22613 i_netinettcp='$i_netinettcp'
22617 i_pthread='$i_pthread'
22619 i_rpcsvcdbm='$i_rpcsvcdbm'
22622 i_shadow='$i_shadow'
22624 i_stdarg='$i_stdarg'
22625 i_stddef='$i_stddef'
22626 i_stdlib='$i_stdlib'
22627 i_string='$i_string'
22628 i_sunmath='$i_sunmath'
22629 i_sysaccess='$i_sysaccess'
22630 i_sysdir='$i_sysdir'
22631 i_sysfile='$i_sysfile'
22632 i_sysfilio='$i_sysfilio'
22634 i_sysioctl='$i_sysioctl'
22635 i_syslog='$i_syslog'
22636 i_sysmman='$i_sysmman'
22637 i_sysmode='$i_sysmode'
22638 i_sysmount='$i_sysmount'
22639 i_sysndir='$i_sysndir'
22640 i_sysparam='$i_sysparam'
22641 i_syspoll='$i_syspoll'
22642 i_sysresrc='$i_sysresrc'
22643 i_syssecrt='$i_syssecrt'
22644 i_sysselct='$i_sysselct'
22645 i_syssockio='$i_syssockio'
22646 i_sysstat='$i_sysstat'
22647 i_sysstatfs='$i_sysstatfs'
22648 i_sysstatvfs='$i_sysstatvfs'
22649 i_systime='$i_systime'
22650 i_systimek='$i_systimek'
22651 i_systimes='$i_systimes'
22652 i_systypes='$i_systypes'
22653 i_sysuio='$i_sysuio'
22655 i_sysutsname='$i_sysutsname'
22656 i_sysvfs='$i_sysvfs'
22657 i_syswait='$i_syswait'
22658 i_termio='$i_termio'
22659 i_termios='$i_termios'
22661 i_unistd='$i_unistd'
22664 i_values='$i_values'
22665 i_varargs='$i_varargs'
22666 i_varhdr='$i_varhdr'
22668 ignore_versioned_solibs='$ignore_versioned_solibs'
22669 inc_version_list='$inc_version_list'
22670 inc_version_list_init='$inc_version_list_init'
22673 initialinstalllocation='$initialinstalllocation'
22674 installarchlib='$installarchlib'
22675 installbin='$installbin'
22676 installhtml1dir='$installhtml1dir'
22677 installhtml3dir='$installhtml3dir'
22678 installman1dir='$installman1dir'
22679 installman3dir='$installman3dir'
22680 installprefix='$installprefix'
22681 installprefixexp='$installprefixexp'
22682 installprivlib='$installprivlib'
22683 installscript='$installscript'
22684 installsitearch='$installsitearch'
22685 installsitebin='$installsitebin'
22686 installsitehtml1dir='$installsitehtml1dir'
22687 installsitehtml3dir='$installsitehtml3dir'
22688 installsitelib='$installsitelib'
22689 installsiteman1dir='$installsiteman1dir'
22690 installsiteman3dir='$installsiteman3dir'
22691 installsitescript='$installsitescript'
22692 installstyle='$installstyle'
22693 installusrbinperl='$installusrbinperl'
22694 installvendorarch='$installvendorarch'
22695 installvendorbin='$installvendorbin'
22696 installvendorhtml1dir='$installvendorhtml1dir'
22697 installvendorhtml3dir='$installvendorhtml3dir'
22698 installvendorlib='$installvendorlib'
22699 installvendorman1dir='$installvendorman1dir'
22700 installvendorman3dir='$installvendorman3dir'
22701 installvendorscript='$installvendorscript'
22703 issymlink='$issymlink'
22704 ivdformat='$ivdformat'
22707 known_extensions='$known_extensions'
22710 lddlflags='$lddlflags'
22712 ldflags_uselargefiles='$ldflags_uselargefiles'
22713 ldlibpthname='$ldlibpthname'
22720 libsdirs='$libsdirs'
22721 libsfiles='$libsfiles'
22722 libsfound='$libsfound'
22723 libspath='$libspath'
22724 libswanted='$libswanted'
22725 libswanted_uselargefiles='$libswanted_uselargefiles'
22731 localtime_r_proto='$localtime_r_proto'
22732 locincpth='$locincpth'
22733 loclibpth='$loclibpth'
22734 longdblsize='$longdblsize'
22735 longlongsize='$longlongsize'
22736 longsize='$longsize'
22740 lseeksize='$lseeksize'
22741 lseektype='$lseektype'
22744 madlyobj='$madlyobj'
22745 madlysrc='$madlysrc'
22749 make_set_make='$make_set_make'
22750 mallocobj='$mallocobj'
22751 mallocsrc='$mallocsrc'
22752 malloctype='$malloctype'
22754 man1direxp='$man1direxp'
22757 man3direxp='$man3direxp'
22759 mips_type='$mips_type'
22760 mistrustnm='$mistrustnm'
22762 mmaptype='$mmaptype'
22763 modetype='$modetype'
22765 multiarch='$multiarch'
22767 myarchname='$myarchname'
22768 mydomain='$mydomain'
22769 myhostname='$myhostname'
22772 need_va_copy='$need_va_copy'
22773 netdb_hlen_type='$netdb_hlen_type'
22774 netdb_host_type='$netdb_host_type'
22775 netdb_name_type='$netdb_name_type'
22776 netdb_net_type='$netdb_net_type'
22779 nm_so_opt='$nm_so_opt'
22780 nonxs_ext='$nonxs_ext'
22782 nvEUformat='$nvEUformat'
22783 nvFUformat='$nvFUformat'
22784 nvGUformat='$nvGUformat'
22785 nv_overflows_integers_at='$nv_overflows_integers_at'
22786 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22787 nveformat='$nveformat'
22788 nvfformat='$nvfformat'
22789 nvgformat='$nvgformat'
22792 o_nonblock='$o_nonblock'
22794 old_pthread_create_joinable='$old_pthread_create_joinable'
22795 optimize='$optimize'
22796 orderlib='$orderlib'
22799 otherlibdirs='$otherlibdirs'
22803 patchlevel='$patchlevel'
22804 path_sep='$path_sep'
22807 perl_patchlevel='$perl_patchlevel'
22808 perladmin='$perladmin'
22809 perllibs='$perllibs'
22810 perlpath='$perlpath'
22812 phostname='$phostname'
22818 prefixexp='$prefixexp'
22820 privlibexp='$privlibexp'
22821 procselfexe='$procselfexe'
22822 prototype='$prototype'
22824 quadkind='$quadkind'
22825 quadtype='$quadtype'
22826 randbits='$randbits'
22827 randfunc='$randfunc'
22828 random_r_proto='$random_r_proto'
22829 randseedtype='$randseedtype'
22831 rd_nodata='$rd_nodata'
22832 readdir64_r_proto='$readdir64_r_proto'
22833 readdir_r_proto='$readdir_r_proto'
22834 revision='$revision'
22840 sGMTIME_max='$sGMTIME_max'
22841 sGMTIME_min='$sGMTIME_min'
22842 sLOCALTIME_max='$sLOCALTIME_max'
22843 sLOCALTIME_min='$sLOCALTIME_min'
22844 sPRIEUldbl='$sPRIEUldbl'
22845 sPRIFUldbl='$sPRIFUldbl'
22846 sPRIGUldbl='$sPRIGUldbl'
22847 sPRIXU64='$sPRIXU64'
22849 sPRIeldbl='$sPRIeldbl'
22850 sPRIfldbl='$sPRIfldbl'
22851 sPRIgldbl='$sPRIgldbl'
22856 sSCNfldbl='$sSCNfldbl'
22857 sched_yield='$sched_yield'
22858 scriptdir='$scriptdir'
22859 scriptdirexp='$scriptdirexp'
22861 seedfunc='$seedfunc'
22862 selectminbits='$selectminbits'
22863 selecttype='$selecttype'
22864 sendmail='$sendmail'
22865 setgrent_r_proto='$setgrent_r_proto'
22866 sethostent_r_proto='$sethostent_r_proto'
22867 setlocale_r_proto='$setlocale_r_proto'
22868 setnetent_r_proto='$setnetent_r_proto'
22869 setprotoent_r_proto='$setprotoent_r_proto'
22870 setpwent_r_proto='$setpwent_r_proto'
22871 setservent_r_proto='$setservent_r_proto'
22874 sharpbang='$sharpbang'
22875 shmattype='$shmattype'
22876 shortsize='$shortsize'
22879 sig_count='$sig_count'
22880 sig_name='$sig_name'
22881 sig_name_init='$sig_name_init'
22883 sig_num_init='$sig_num_init'
22884 sig_size='$sig_size'
22885 signal_t='$signal_t'
22886 sitearch='$sitearch'
22887 sitearchexp='$sitearchexp'
22889 sitebinexp='$sitebinexp'
22890 sitehtml1dir='$sitehtml1dir'
22891 sitehtml1direxp='$sitehtml1direxp'
22892 sitehtml3dir='$sitehtml3dir'
22893 sitehtml3direxp='$sitehtml3direxp'
22895 sitelib_stem='$sitelib_stem'
22896 sitelibexp='$sitelibexp'
22897 siteman1dir='$siteman1dir'
22898 siteman1direxp='$siteman1direxp'
22899 siteman3dir='$siteman3dir'
22900 siteman3direxp='$siteman3direxp'
22901 siteprefix='$siteprefix'
22902 siteprefixexp='$siteprefixexp'
22903 sitescript='$sitescript'
22904 sitescriptexp='$sitescriptexp'
22905 sizesize='$sizesize'
22906 sizetype='$sizetype'
22910 sockethdr='$sockethdr'
22911 socketlib='$socketlib'
22912 socksizetype='$socksizetype'
22914 spackage='$spackage'
22915 spitshell='$spitshell'
22916 srand48_r_proto='$srand48_r_proto'
22917 srandom_r_proto='$srandom_r_proto'
22919 ssizetype='$ssizetype'
22920 startperl='$startperl'
22922 static_ext='$static_ext'
22924 stdio_base='$stdio_base'
22925 stdio_bufsiz='$stdio_bufsiz'
22926 stdio_cnt='$stdio_cnt'
22927 stdio_filbuf='$stdio_filbuf'
22928 stdio_ptr='$stdio_ptr'
22929 stdio_stream_array='$stdio_stream_array'
22930 strerror_r_proto='$strerror_r_proto'
22933 subversion='$subversion'
22937 targetarch='$targetarch'
22941 timeincl='$timeincl'
22942 timetype='$timetype'
22943 tmpnam_r_proto='$tmpnam_r_proto'
22949 ttyname_r_proto='$ttyname_r_proto'
22958 uidformat='$uidformat'
22964 uquadtype='$uquadtype'
22965 use5005threads='$use5005threads'
22966 use64bitall='$use64bitall'
22967 use64bitint='$use64bitint'
22968 usecrosscompile='$usecrosscompile'
22970 usedtrace='$usedtrace'
22971 usefaststdio='$usefaststdio'
22972 useithreads='$useithreads'
22973 uselargefiles='$uselargefiles'
22974 uselongdouble='$uselongdouble'
22975 usemallocwrap='$usemallocwrap'
22976 usemorebits='$usemorebits'
22977 usemultiplicity='$usemultiplicity'
22978 usemymalloc='$usemymalloc'
22980 useopcode='$useopcode'
22981 useperlio='$useperlio'
22982 useposix='$useposix'
22983 usereentrant='$usereentrant'
22984 userelocatableinc='$userelocatableinc'
22986 useshrplib='$useshrplib'
22987 usesitecustomize='$usesitecustomize'
22988 usesocks='$usesocks'
22989 usethreads='$usethreads'
22990 usevendorprefix='$usevendorprefix'
22991 usevfork='$usevfork'
22994 uvXUformat='$uvXUformat'
22995 uvoformat='$uvoformat'
22998 uvuformat='$uvuformat'
22999 uvxformat='$uvxformat'
23000 vendorarch='$vendorarch'
23001 vendorarchexp='$vendorarchexp'
23002 vendorbin='$vendorbin'
23003 vendorbinexp='$vendorbinexp'
23004 vendorhtml1dir='$vendorhtml1dir'
23005 vendorhtml1direxp='$vendorhtml1direxp'
23006 vendorhtml3dir='$vendorhtml3dir'
23007 vendorhtml3direxp='$vendorhtml3direxp'
23008 vendorlib='$vendorlib'
23009 vendorlib_stem='$vendorlib_stem'
23010 vendorlibexp='$vendorlibexp'
23011 vendorman1dir='$vendorman1dir'
23012 vendorman1direxp='$vendorman1direxp'
23013 vendorman3dir='$vendorman3dir'
23014 vendorman3direxp='$vendorman3direxp'
23015 vendorprefix='$vendorprefix'
23016 vendorprefixexp='$vendorprefixexp'
23017 vendorscript='$vendorscript'
23018 vendorscriptexp='$vendorscriptexp'
23020 version_patchlevel_string='$version_patchlevel_string'
23021 versiononly='$versiononly'
23023 voidflags='$voidflags'
23026 yaccflags='$yaccflags'
23031 : Add in command line options if available
23032 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23034 : add special variables
23035 $test -f $src/patchlevel.h && \
23036 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23037 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
23038 echo "PERL_CONFIG_SH=true" >>config.sh
23040 : propagate old symbols
23041 if $test -f UU/config.sh; then
23042 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23043 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23044 config.sh config.sh UU/oldconfig.sh |\
23045 $sort | $uniq -u >UU/oldsyms
23046 set X `cat UU/oldsyms`
23052 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23054 echo ": Variables propagated from previous config.sh file." >>config.sh
23055 for sym in `cat UU/oldsyms`; do
23056 echo " Propagating $hint variable "'$'"$sym..."
23057 eval 'tmp="$'"${sym}"'"'
23059 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23065 : Finish up by extracting the .SH files
23069 echo "Extraction done."
23079 If you'd like to make any changes to the config.sh file before I begin
23080 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23083 rp="Press return or use a shell escape to edit config.sh:"
23088 *) : in case they cannot read
23089 sh 1>&4 -c "$ans";;
23094 : if this fails, just run all the .SH files by hand
23103 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23110 Now you need to generate make dependencies by running "$make depend".
23111 You might prefer to run it in background: "$make depend > makedepend.out &"
23112 It can take a while, so you might not want to run it right now.
23117 rp="Run $make depend now?"
23121 $make depend && echo "Now you must run '$make'."
23124 echo "You must run '$make depend' then '$make'."
23127 elif test -f [Mm]akefile; then
23129 echo "Now you must run a $make."
23131 echo "Configure done."
23134 if $test -f Policy.sh; then
23137 If you compile $package on a different machine or from a different object
23138 directory, copy the Policy.sh file from this object directory to the
23139 new one before you run Configure -- this will help you with most of
23140 the policy defaults.
23144 if $test -f config.msg; then
23145 echo "Hmm. I also noted the following information while running:"
23147 $cat config.msg >&4
23150 $rm -f kit*isdone ark*isdone