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 Tue Jan 22 17:46:32 CET 2008 [metaconfig 3.0 PL70]
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=''
945 d_inc_version_list=''
947 inc_version_list_init=''
966 ignore_versioned_solibs=''
1030 d_perl_otherlibdirs=''
1038 api_versionstring=''
1044 version_patchlevel_string=''
1048 d_nv_preserves_uv=''
1049 d_nv_zero_is_allbits_zero=''
1060 nv_preserves_uv_bits=''
1132 installsitehtml1dir=''
1135 installsitehtml3dir=''
1142 installsiteman1dir=''
1145 installsiteman3dir=''
1150 installsitescript=''
1165 d_stdio_stream_array=''
1166 stdio_stream_array=''
1179 ccflags_uselargefiles=''
1180 ldflags_uselargefiles=''
1181 libswanted_uselargefiles=''
1201 installvendorarch=''
1208 installvendorhtml1dir=''
1210 vendorhtml1direxp=''
1211 installvendorhtml3dir=''
1213 vendorhtml3direxp=''
1219 installvendorman1dir=''
1222 installvendorman3dir=''
1229 installvendorscript=''
1242 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1245 : We must find out about Eunice early
1247 if test -f /etc/unixtovms; then
1248 eunicefix=/etc/unixtovms
1250 if test -f /etc/unixtovms.exe; then
1251 eunicefix=/etc/unixtovms.exe
1254 : Set executable suffix now -- needed before hints available
1255 if test -f "/libs/version.library"; then
1258 elif test -f "/system/gnu_library/bin/ar.pm"; then
1261 elif test -n "$DJGPP"; then
1264 elif test -d c:/. -o -n "$is_os2" ; then
1270 : Trailing extension. Override this in a hint file, if needed.
1271 : Extra object files, if any, needed on this platform.
1276 : change the next line if compiling for Xenix/286 on Xenix/386
1277 xlibpth='/usr/lib/386 /lib/386'
1278 : Possible local library directories to search.
1279 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1280 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1282 : general looking path for locating libraries
1283 glibpth="/lib /usr/lib $xlibpth"
1284 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1285 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1286 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1287 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1289 : Private path used by Configure to find libraries. Its value
1290 : is prepended to libpth. This variable takes care of special
1291 : machines, like the mips. Usually, it should be empty.
1294 : default library list
1296 : some systems want to use only the non-versioned libso:s
1297 ignore_versioned_solibs=''
1298 : set usethreads on the Configure command line to enable threads.
1299 usereentrant='undef'
1300 : full support for void wanted by default
1303 : Possible local include directories to search.
1304 : Set locincpth to "" in a hint file to defeat local include searches.
1305 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1306 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1308 : no include file wanted by default
1311 : Enable -DEBUGGING and -DDEBUGGING from the command line
1318 : set useposix=false in your hint file to disable the POSIX extension.
1320 : set useopcode=false in your hint file to disable the Opcode extension.
1323 ccflags_uselargefiles=''
1324 ldflags_uselargefiles=''
1325 libswanted_uselargefiles=''
1326 : set usemultiplicity on the Configure command line to enable multiplicity.
1327 : set usesocks on the Configure command line to enable socks.
1328 : List of libraries we want.
1329 : If anyone needs extra -lxxx, put those in a hint file.
1330 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1331 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1332 : We probably want to search /usr/shlib before most other libraries.
1333 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1334 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1335 glibpth="/usr/shlib $glibpth"
1336 : Do not use vfork unless overridden by a hint file.
1339 : Find the basic shell for Bourne shell scripts
1343 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1346 if test -f "$xxx"; then
1349 : Build up a list and do a single loop so we can 'break' out.
1350 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1351 for xxx in sh bash ksh pdksh ash; do
1353 try="$try ${p}/${xxx}"
1357 if test -f "$xxx"; then
1360 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1363 elif test -f "$xxx.exe"; then
1374 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1376 Usually it's in /bin/sh. How did you even get this far?
1377 Please contact me (Perl Maintainers) at perlbug@perl.org and
1378 we'll try to straighten this all out.
1384 : see if sh knows # comments
1385 if `$sh -c '#' >/dev/null 2>&1`; then
1389 test -f $xcat$_exe || xcat=/usr/bin/cat
1390 if test ! -f $xcat$_exe; then
1391 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1392 if test -f $p/cat$_exe; then
1397 if test ! -f $xcat$_exe; then
1398 echo "Can't find cat anywhere!"
1402 echo "#!$xcat" >sharp
1406 if test -s today; then
1409 echo "#! $xcat" > sharp
1413 if test -s today; then
1421 echo "Your $sh doesn't grok # comments--I will strip them later on."
1424 echo "exec grep -v '^[ ]*#'" >spitshell
1426 $eunicefix spitshell
1427 spitshell=`pwd`/spitshell
1429 echo "I presume that if # doesn't work, #! won't work either!"
1434 : figure out how to guarantee sh startup
1436 '') startsh=${sharpbang}${sh} ;;
1448 : echo "Yup, it does."
1450 echo "Hmm... '$startsh' does not guarantee sh startup..."
1451 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1455 : Save command line options in file UU/cmdline.opt for later use in
1456 : generating config.sh.
1457 cat > cmdline.opt <<EOSH
1458 : Configure command line arguments.
1467 cat >>cmdline.opt <<EOSH
1468 config_arg$argn='$arg'
1470 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1473 arg_exp=`cat cmdl.opt`
1474 args_exp="$args_exp$args_sep'$arg_exp'"
1475 argn=`expr $argn + 1`
1480 : produce awk script to parse command line options
1481 cat >options.awk <<'EOF'
1483 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1485 len = length(optstr);
1486 for (i = 1; i <= len; i++) {
1487 c = substr(optstr, i, 1);
1488 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1499 if (substr(str, 1, 1) != "-") {
1500 printf("'%s'\n", str);
1504 for (i = 2; i <= len; i++) {
1505 c = substr(str, i, 1);
1507 printf("-%s\n", substr(str, i));
1513 printf("'%s'\n", substr(str, i + 1));
1526 : process the command line options
1527 set X `for arg in "$@"; do echo "X$arg"; done |
1528 sed -e s/X// | awk -f options.awk`
1533 : set up default values
1543 rm -f optdef.sh posthint.sh
1544 cat >optdef.sh <<EOS
1550 while test $# -gt 0; do
1552 -d) shift; fastread=yes;;
1553 -e) shift; alldone=cont;;
1557 if test -r "$1"; then
1560 echo "$me: cannot read config file $1." >&2
1566 -h) shift; error=true;;
1567 -r) shift; reuseval=true;;
1568 -s) shift; silent=true; realsilent=true;;
1569 -E) shift; alldone=exit;;
1570 -K) shift; knowitall=true;;
1571 -O) shift; override=true;;
1572 -S) shift; silent=true; extractsh=true;;
1577 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1578 echo "$me: ignoring -D $1" >&2
1581 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1582 *) echo "$1='define'" >> optdef.sh;;
1589 *=) echo "$1" >> optdef.sh;;
1591 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1592 echo "$me: ignoring -U $1" >&2
1594 *) echo "$1='undef'" >> optdef.sh;;
1605 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1609 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1610 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1616 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1617 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1618 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1619 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1620 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1621 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1627 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1629 echo "$yyy=''" >> posthint.sh ;;
1634 echo "$yyy='$zzz'" >> posthint.sh ;;
1636 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1638 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1643 echo "$yyy=$zzz" >> posthint.sh ;;
1644 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1648 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1651 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1659 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1660 [-U symbol] [-U symbol=] [-A command:symbol...]
1661 -d : use defaults for all answers.
1662 -e : go on without questioning past the production of config.sh.
1663 -f : specify an alternate default configuration file.
1664 -h : print this help message and exit (with an error status).
1665 -r : reuse C symbols value if possible (skips costly nm extraction).
1666 -s : silent mode, only echoes questions and essential information.
1667 -D : define symbol to have some value:
1668 -D symbol symbol gets the value 'define'
1669 -D symbol=value symbol gets the value 'value'
1670 common used examples (see INSTALL for more info):
1671 -Duse64bitint use 64bit integers
1672 -Duse64bitall use 64bit integers and pointers
1673 -Dusethreads use thread support
1674 -Dinc_version_list=none do not include older perl trees in @INC
1675 -DEBUGGING=none DEBUGGING options
1676 -Dcc=gcc choose your compiler
1677 -Dprefix=/opt/perl5 choose your destination
1678 -E : stop at the end of questions, after having produced config.sh.
1679 -K : do not use unless you know what you are doing.
1680 -O : let -D and -U override definitions from loaded configuration file.
1681 -S : perform variable substitutions on all .SH files (can mix with -f)
1682 -U : undefine symbol:
1683 -U symbol symbol gets the value 'undef'
1684 -U symbol= symbol gets completely empty
1686 -A : manipulate symbol after the platform specific hints have been applied:
1687 -A append:symbol=value append value to symbol
1688 -A symbol=value like append:, but with a separating space
1689 -A define:symbol=value define symbol to have value
1690 -A clear:symbol define symbol to be ''
1691 -A define:symbol define symbol to be 'define'
1692 -A eval:symbol=value define symbol to be eval of value
1693 -A prepend:symbol=value prepend value to symbol
1694 -A undef:symbol define symbol to be 'undef'
1695 -A undef:symbol= define symbol to be ''
1696 e.g.: -A prepend:libswanted='cl pthread '
1697 -A ccflags=-DSOME_MACRO
1698 -V : print version number and exit (with a zero status).
1705 case "$fastread$alldone" in
1708 case "$extractsh" in
1711 if test ! -t 0; then
1712 echo "Say 'sh Configure', not 'sh <Configure'"
1722 true) exec 1>/dev/null;;
1725 : run the defines and the undefines, if any, but leave the file out there...
1728 : create the posthint manipulation script and leave the file out there...
1733 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1734 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1735 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1736 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1737 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1740 : Some greps do not return status, grrr.
1741 echo "grimblepritz" >grimble
1742 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1744 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1750 : the following should work in any shell
1754 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1755 cat >contains <<'EOSS'
1756 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1761 : Find the path to the source tree
1764 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1768 *) src=`cd ../$src && pwd` ;;
1781 if test -f $rsrc/Configure && \
1782 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1784 : found it, so we are ok.
1787 for src in . .. ../.. ../../.. ../../../..; do
1788 if test -f ../$src/Configure && \
1789 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1800 Sorry, I can't seem to locate the source dir for $package. Please start
1801 Configure with an explicit path -- i.e. /some/path/Configure.
1809 echo "Sources for $package found in \"$src\"." >&4
1813 : script used to extract .SH files with variable substitutions
1814 cat >extract <<'EOS'
1816 echo "Doing variable substitutions on .SH files..."
1817 if test -f MANIFEST; then
1818 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1820 echo "(Looking for .SH files under the source directory.)"
1821 set x `(cd "$src"; find . -name "*.SH" -print)`
1825 0) set x `(cd "$src"; echo *.SH)`; shift;;
1827 if test ! -f "$src/$1"; then
1833 while test $name; do
1834 if test ! -d "$name"; then
1835 create="$name $create";
1836 name=`echo $name | sed -e "s|^[^/]*$||"`;
1837 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1842 for file in $create; do
1851 dir=`expr X$file : 'X\(.*\)/'`
1852 file=`expr X$file : 'X.*/\(.*\)'`
1853 (cd "$dir" && . ./$file)
1863 dir=`expr X$file : 'X\(.*\)/'`
1864 file=`expr X$file : 'X.*/\(.*\)'`
1865 (set x $dir; shift; eval $mkdir_p)
1866 sh <"$src/$dir/$file"
1875 if test -f "$src/config_h.SH"; then
1876 if test ! -f config.h; then
1877 : oops, they left it out of MANIFEST, probably, so do it anyway.
1878 . "$src/config_h.SH"
1883 : extract files and exit if asked to do so
1884 case "$extractsh" in
1886 case "$realsilent" in
1890 case "$config_sh" in
1891 '') config_sh='config.sh';;
1894 echo "Fetching answers from $config_sh..."
1897 test "$override" && . ./optdef.sh
1901 echo "Extraction done."
1906 : Eunice requires " " instead of "", can you believe it
1909 echo "Beginning of configuration questions for $package."
1911 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1913 : first determine how to suppress newline on echo command
1915 echo "Checking echo to see how to suppress newlines..."
1916 (echo "hi there\c" ; echo " ") >.echotmp
1917 if $contains c .echotmp >/dev/null 2>&1 ; then
1928 echo $n "The star should be here-->$c"
1932 : Now test for existence of everything in MANIFEST
1934 if test -f "$rsrc/MANIFEST"; then
1935 echo "First let's make sure your kit is complete. Checking..." >&4
1936 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" |\
1937 (split -l 50 2>/dev/null || split -50)
1940 for filelist in x??; do
1941 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1942 >/dev/null 2>>"$tmppwd/missing")
1944 if test -s missing; then
1948 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1950 You have the option of continuing the configuration process, despite the
1951 distinct possibility that your kit is damaged, by typing 'y'es. If you
1952 do, don't blame me if something goes wrong. I advise you to type 'n'o
1953 and contact the author (perlbug@perl.org).
1956 echo $n "Continue? [n] $c" >&4
1960 echo "Continuing..." >&4
1964 echo "ABORTING..." >&4
1969 echo "Looks good..."
1972 echo "There is no MANIFEST file. I hope your kit is complete !"
1976 : Find the appropriate value for a newline for tr
1978 if test -n "$DJGPP"; then
1981 if test X"$trnl" = X; then
1982 case "`echo foo|tr '\n' x 2>/dev/null`" in
1986 if test X"$trnl" = X; then
1987 case "`echo foo|tr '\012' x 2>/dev/null`" in
1988 foox) trnl='\012' ;;
1991 if test X"$trnl" = X; then
1992 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1993 fooxy) trnl='\n\r' ;;
1996 if test X"$trnl" = X; then
1999 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2005 : compute the number of columns on the terminal for proper question formatting
2010 : set up the echo used in my read
2011 myecho="case \"\$xxxm\" in
2012 '') echo $n \"\$rp $c\" >&4;;
2014 '') echo $n \"[\$xxxm] $c\";;
2016 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2018 echo $n \"[\$xxxm] $c\" >&4
2020 echo $n \"\$rp [\$xxxm] $c\" >&4
2026 : now set up to do reads with possible shell escape and default assignment
2032 case "\$fastread" in
2033 yes) case "\$dflt" in
2036 case "\$silent-\$rp" in
2041 *) case "\$silent" in
2042 true) case "\$rp" in
2047 while expr "X\$ans" : "X!" >/dev/null; do
2051 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2059 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2068 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2073 echo "(OK, I'll run with -d after this question.)" >&4
2076 echo "*** Sorry, \$1 not supported yet." >&4
2086 echo "*** Substitution done -- please confirm."
2088 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2093 echo "*** Error -- try again."
2100 case "\$ans\$xxxm\$nostick" in
2112 : create .config dir to save info across Configure sessions
2113 test -d ../.config || mkdir ../.config
2114 cat >../.config/README <<EOF
2115 This directory created by Configure to save information that should
2116 persist across sessions for $package.
2118 You may safely delete it if you wish.
2121 : See if we are using a devel version and want that
2122 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2124 $define|true|[yY]*) ;;
2125 *) case "$xversion" in
2128 *** WHOA THERE!!! ***
2130 This is an UNSTABLE DEVELOPMENT release.
2131 The version of this $package distribution is $xversion, that is, odd,
2132 (as opposed to even) and that signifies a development release.
2133 If you want a maintenance release, you want an even-numbered version.
2135 Do ***NOT*** install this into production use.
2136 Data corruption and crashes are possible.
2138 It is most seriously suggested that you do not continue any further
2139 unless you want to help in developing and debugging Perl.
2141 If you *still* want to build perl, you can answer 'y' now,
2142 or pass -Dusedevel to Configure.
2145 rp='Do you really want to continue?'
2149 [yY]) echo >&4 "Okay, continuing."
2150 usedevel="$define" ;;
2151 *) echo >&4 "Okay, bye."
2161 case "$versiononly" in
2162 '') versiononly="$define" ;;
2164 case "$installusrbinperl" in
2165 '') installusrbinperl="$undef" ;;
2170 : general instructions
2173 user=`(logname) 2>/dev/null`
2175 '') user=`whoami 2>&1`;;
2177 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2180 rp='Would you like to see the instructions?'
2191 This installation shell script will examine your system and ask you questions
2192 to determine how the perl5 package should be installed. If you get
2193 stuck on a question, you may use a ! shell escape to start a subshell or
2194 execute a command. Many of the questions will have default answers in square
2195 brackets; typing carriage return will give you the default.
2197 On some of the questions which ask for file or directory names you are allowed
2198 to use the ~name construct to specify the login directory belonging to "name",
2199 even if you don't have a shell which knows about that. Questions where this is
2200 allowed will be marked "(~name ok)".
2204 dflt='Type carriage return to continue'
2208 The prompter used in this script allows you to use shell variables and
2209 backticks in your answers. You may use $1, $2, etc... to refer to the words
2210 in the default answer, as if the default line was a set of arguments given to a
2211 script shell. This means you may also use $* to repeat the whole default line,
2212 so you do not have to re-type everything to add something to the default.
2214 Everytime there is a substitution, you will have to confirm. If there is an
2215 error (e.g. an unmatched backtick), the default answer will remain unchanged
2216 and you will be prompted again.
2218 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2219 the questions and use the computed defaults (or the previous answers if there
2220 was already a config.sh file). Type 'Configure -h' for a list of options.
2221 You may also start interactively and then answer '& -d' at any prompt to turn
2222 on the non-interactive behaviour for the remainder of the execution.
2228 Much effort has been expended to ensure that this shell script will run on any
2229 Unix system. If despite that it blows up on yours, your best bet is to edit
2230 Configure and run it again. If you can't run Configure for some reason,
2231 you'll have to generate a config.sh file by hand. Whatever problems you
2232 have, let me (perlbug@perl.org) know how I blew it.
2234 This installation script affects things in two ways:
2236 1) it may do direct variable substitutions on some of the files included
2238 2) it builds a config.h file for inclusion in C programs. You may edit
2239 any of these files as the need arises after running this script.
2241 If you make a mistake on a question, there is no easy way to back up to it
2242 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2243 files. Configure will offer to let you do this before it runs the SH files.
2246 dflt='Type carriage return to continue'
2248 case "$firsttime" in
2249 true) echo $user >>../.config/instruct;;
2253 : find out where common programs are
2255 echo "Locating common programs..." >&4
2268 if test -d \$dir/\$thing; then
2274 for thisthing in \$dir/\$thing; do
2275 : just loop through to pick last item
2277 if test -f \$thisthing; then
2280 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2283 elif test -f \$dir/\$thing.exe; then
2284 if test -n "$DJGPP"; then
2285 echo \$dir/\$thing.exe
2286 elif test "$eunicefix" != ":"; then
2287 : on Eunice apparently
2339 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2340 pth="$pth /lib /usr/lib"
2341 for file in $loclist; do
2345 if test -f "$xxx"; then
2348 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2349 xxx=`./loc $file $file $pth`
2352 '') xxx=`./loc $file $file $pth`;;
2353 *) xxx=`./loc $xxx $xxx $pth`;;
2355 eval $file=$xxx$_exe
2359 echo $file is in $xxx.
2362 echo $file is in $xxx.
2365 echo "I don't know where '$file' is, and my life depends on it." >&4
2366 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2372 echo "Don't worry if any of the following aren't found..."
2374 for file in $trylist; do
2378 if test -f "$xxx"; then
2381 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2382 xxx=`./loc $file $file $pth`
2385 '') xxx=`./loc $file $file $pth`;;
2386 *) xxx=`./loc $xxx $xxx $pth`;;
2388 eval $file=$xxx$_exe
2392 echo $file is in $xxx.
2395 echo $file is in $xxx.
2398 echo "I don't see $file out there, $say."
2405 echo "Substituting grep for egrep."
2412 echo "Substituting cp for ln."
2421 echo "I can't find make or gmake, and my life depends on it." >&4
2422 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2430 *) # We can't have osname yet.
2431 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2432 # Assume that gmake, if found, is definitely GNU make
2433 # and prefer it over the system make.
2434 echo "Substituting gmake for make."
2442 echo "Hopefully test is built into your sh."
2445 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2446 echo "Using the test built into your sh."
2454 echo "Hopefully echo is built into your sh."
2459 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2460 $echo $n "hi there$c" >foo1
2461 echo $n "hi there$c" >foo2
2462 if cmp foo1 foo2 >/dev/null 2>&1; then
2463 echo "They are compatible. In fact, they may be identical."
2470 They are not compatible! You are probably running ksh on a non-USG system.
2471 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2472 have echo built in and we may have to run some Bourne shell scripts. That
2473 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2476 $echo $n "The star should be here-->$c"
2483 # This question was auctioned at YAPC::Europe-2007 in Vienna
2484 # I never promised you could answer it. I only auctioned the question.
2486 The following message is sponsored by
2488 Dresden.pm<--The stars should be here.
2490 Dear Perl user, system administrator or package
2491 maintainer, the Perl community sends greetings to
2492 you. Do you (emblematical) greet back [Y/n]? n
2496 : Check what type of C compiler we use
2500 cat <<'EOSC' >>trygcc
2505 int main(int argc, char *argv[]) {
2509 if $cc -o try $ccflags $ldflags try.c; then
2512 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2518 # Skip this test because it gives a false match on output like:
2519 # ./trygcc: line 23: cc: command not found
2520 # case "`$cc -v -c try.c 2>&1`" in
2521 # *gcc*) trygcc=no ;;
2523 if $test X"$trygcc" = Xyes; then
2524 if gcc -o try -c try.c; then
2526 echo "You seem to have a working gcc, though." >&4
2527 # Switching compilers may undo the work of hints files.
2528 # The most common problem is -D_REENTRANT for threads.
2529 # This heuristic catches that case, but gets false positives
2530 # if -Dusethreads was not actually specified. Better to
2531 # bail out here with a useful message than fail
2532 # mysteriously later. Should we perhaps just try to
2533 # re-invoke Configure -Dcc=gcc config_args ?
2534 if $test -f usethreads.cbu; then
2537 *** However, any setting of the C compiler flags (e.g. for thread support)
2538 *** will be lost. It may be necessary for you to restart Configure and
2539 *** add -Dcc=gcc to your Configure command line.
2542 rp="Would you like to go ahead and try gcc anyway?"
2545 rp="Would you like to use it?"
2548 if $test -f myread; then
2551 if $test -f UU/myread; then
2554 echo "Cannot find myread, sorry. Aborting." >&2
2559 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2572 cat <<'EOSC' >>checkcc
2577 int main(int argc, char *argv[]) {
2581 if $cc -o try $ccflags $ldflags try.c; then
2584 if $test X"$despair" = Xyes; then
2585 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2588 You need to find a working C compiler.
2589 Either (purchase and) install the C compiler supplied by your OS vendor,
2590 or for a free C compiler try http://gcc.gnu.org/
2591 I cannot continue any further, aborting.
2600 : determine whether symbolic links are supported
2603 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2604 echo "Symbolic links are supported." >&4
2607 echo "Symbolic links are NOT supported." >&4
2612 : determine whether symbolic links are supported
2616 echo "Checking how to test for symbolic links..." >&4
2618 if $test "X$issymlink" = X; then
2620 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2621 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2623 if test $? = 0; then
2626 echo "Your builtin 'test -h' may be broken." >&4
2629 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2632 if test -f "$p/$test"; then
2641 echo "Trying external '$test -h'." >&4
2642 issymlink="$test -h"
2643 if $test ! -h sym >/dev/null 2>&1; then
2644 echo "External '$test -h' is broken, too." >&4
2652 if $test "X$issymlink" = X; then
2653 if $test -L sym 2>/dev/null; then
2654 issymlink="$test -L"
2655 echo "The builtin '$test -L' worked." >&4
2658 if $test "X$issymlink" != X; then
2659 echo "You can test for symbolic links with '$issymlink'." >&4
2661 echo "I do not know how you can test for symbolic links." >&4
2665 *) echo "No symbolic links, so not testing for their testing..." >&4
2670 : Make symlinks util
2671 case "$mksymlinks" in
2674 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2677 *) case "$lns:$issymlink" in
2678 *"ln"*" -s:"*"test -"?)
2679 echo "Creating the symbolic links..." >&4
2680 echo "(First creating the subdirectories...)" >&4
2682 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2684 test -z "$directory" && break
2688 if test ! -d t/base; then
2689 echo "Failed to create the subdirectories. Aborting." >&4
2692 echo "(Then creating the symlinks...)" >&4
2693 awk '{print $1}' $src/MANIFEST | while true; do
2695 test -z "$filename" && break
2696 if test -f $filename; then
2697 if $issymlink $filename; then
2701 if test -f $filename; then
2702 echo "$filename already exists, not symlinking."
2704 ln -s $src/$filename $filename
2708 if test ! -f t/base/lex.t; then
2709 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2714 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2722 : Check for Cross-Compilation
2723 case "$usecrosscompile" in
2725 $echo "Cross-compiling..."
2728 *-*-gcc) # A cross-compiling gcc, probably.
2729 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2731 # leave out ld, choosing it is more complex
2733 ranlib=$targetarch-ranlib
2734 $echo 'extern int foo;' > try.c
2735 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2737 if $test $# -gt 0; then
2739 incpth="`$echo $incpth|$sed 's/^ //'`"
2740 echo "Guessing incpth '$incpth'." >&4
2742 j="`$echo $i|$sed 's,/include$,/lib,'`"
2743 if $test -d $j; then
2747 libpth="`$echo $libpth|$sed 's/^ //'`"
2748 echo "Guessing libpth '$libpth'." >&4
2753 case "$targetarch" in
2754 '') echo "Targetarch not defined." >&4; croak=y ;;
2755 *) echo "Using targetarch $targetarch." >&4 ;;
2758 '') echo "Incpth not defined." >&4; croak=y ;;
2759 *) echo "Using incpth '$incpth'." >&4 ;;
2762 '') echo "Libpth not defined." >&4; croak=y ;;
2763 *) echo "Using libpth '$libpth'." >&4 ;;
2766 '') for i in $incpth; do
2767 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2769 echo "Guessing usrinc $usrinc." >&4
2774 '') echo "Usrinc not defined." >&4; croak=y ;;
2777 *) echo "Using usrinc $usrinc." >&4 ;;
2779 case "$targethost" in
2780 '') echo "Targethost not defined." >&4; croak=y ;;
2781 *) echo "Using targethost $targethost." >&4
2786 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2789 /*) run=$src/Cross/run
2790 targetmkdir=$src/Cross/mkdir
2792 from=$src/Cross/from
2794 *) pwd=`$test -f ../Configure & cd ..; pwd`
2796 targetmkdir=$pwd/Cross/mkdir
2798 from=$pwd/Cross/from
2801 case "$targetrun" in
2802 '') targetrun=ssh ;;
2807 case "$targetfrom" in
2808 '') targetfrom=scp ;;
2812 from=$from-$targetfrom
2813 case "$targetdir" in
2815 echo "Guessing targetdir $targetdir." >&4
2818 case "$targetuser" in
2820 echo "Guessing targetuser $targetuser." >&4
2823 case "$targetfrom" in
2827 case "$targetrun" in
2839 '') cwd=$targetdir ;;
2843 if $test ! -f \$exe.xok; then
2847 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2850 *) echo "Unknown targetrun '$targetrun'" >&4
2854 case "$targetmkdir" in
2856 cat >$targetmkdir <<EOF
2858 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2860 $chmod a+rx $targetmkdir
2862 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2874 $targetmkdir \`dirname \$f\`
2875 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2878 $targetmkdir $targetdir/\`dirname \$f\`
2879 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2892 $mkdir -p $targetdir/\`dirname \$f\`
2893 $cp \$f $targetdir/\$f || exit 1
2896 $targetmkdir $targetdir/\`dirname \$f\`
2897 $cp \$f $targetdir/\$f || exit 1
2904 *) echo "Unknown targetto '$targetto'" >&4
2908 case "$targetfrom" in
2915 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2920 cp) cat >$from <<EOF
2925 cp $targetdir/\$f . || exit 1
2930 *) echo "Unknown targetfrom '$targetfrom'" >&4
2934 if $test ! -f $run; then
2935 echo "Target 'run' script '$run' not found." >&4
2939 if $test ! -f $to; then
2940 echo "Target 'to' script '$to' not found." >&4
2944 if $test ! -f $from; then
2945 echo "Target 'from' script '$from' not found." >&4
2949 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2953 Using '$run' for remote execution,
2954 and '$from' and '$to'
2955 for remote file transfer.
2961 usecrosscompile='undef'
2966 : see whether [:lower:] and [:upper:] are supported character classes
2968 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2970 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2974 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2975 # (0xd9 and 0xe2), therefore that is a nice testing point.
2976 if test "X$up" = X -o "X$low" = X; then
2977 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2983 if test "X$up" = X -o "X$low" = X; then
2984 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2990 if test "X$up" = X -o "X$low" = X; then
2991 case "`echo RS | od -x 2>/dev/null`" in
2993 echo "Hey, this might be EBCDIC." >&4
2994 if test "X$up" = X -o "X$low" = X; then
2995 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2996 rs) up='[A-IJ-RS-Z]'
3001 if test "X$up" = X -o "X$low" = X; then
3002 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3012 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3014 echo "Using $up and $low to convert case." >&4
3017 echo "I don't know how to translate letters from upper to lower case." >&4
3018 echo "Your tr is not acting any way I know of." >&4
3022 : set up the translation script tr, must be called with ./tr of course
3026 '[A-Z][a-z]') exec $tr '$up' '$low';;
3027 '[a-z][A-Z]') exec $tr '$low' '$up';;
3034 : Try to determine whether config.sh was made on this system
3035 case "$config_sh" in
3037 myuname=`$uname -a 2>/dev/null`
3038 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3039 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3040 # because the A-Z/a-z are not consecutive.
3041 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3042 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3043 newmyuname="$myuname"
3045 case "$knowitall" in
3047 if test -f ../config.sh; then
3048 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3049 eval "`grep myuname= ../config.sh`"
3051 if test "X$myuname" = "X$newmyuname"; then
3059 : Get old answers from old config file if Configure was run on the
3060 : same system, otherwise use the hints.
3063 if test -f config.sh; then
3065 rp="I see a config.sh file. Shall I use it to set the defaults?"
3068 n*|N*) echo "OK, I'll ignore it."
3069 mv config.sh config.sh.old
3070 myuname="$newmyuname"
3072 *) echo "Fetching default answers from your old config.sh file..." >&4
3080 : Older versions did not always set $sh. Catch re-use of such
3090 if test ! -f config.sh; then
3093 First time through, eh? I have some defaults handy for some systems
3094 that need some extra help getting the Configure answers right:
3097 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3099 : Half the following guesses are probably wrong... If you have better
3100 : tests or hints, please send them to perlbug@perl.org
3101 : The metaconfig authors would also appreciate a copy...
3102 $test -f /irix && osname=irix
3103 $test -f /xenix && osname=sco_xenix
3104 $test -f /dynix && osname=dynix
3105 $test -f /dnix && osname=dnix
3106 $test -f /lynx.os && osname=lynxos
3107 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3108 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3109 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3110 $test -f /bin/mips && /bin/mips && osname=mips
3111 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3112 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3113 $test -d /usr/apollo/bin && osname=apollo
3114 $test -f /etc/saf/_sactab && osname=svr4
3115 $test -d /usr/include/minix && osname=minix
3116 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3117 if $test -d /MachTen -o -d /MachTen_Folder; then
3119 if $test -x /sbin/version; then
3120 osvers=`/sbin/version | $awk '{print $2}' |
3121 $sed -e 's/[A-Za-z]$//'`
3122 elif $test -x /usr/etc/version; then
3123 osvers=`/usr/etc/version | $awk '{print $2}' |
3124 $sed -e 's/[A-Za-z]$//'`
3130 $test -f /sys/posix.dll &&
3131 $test -f /usr/bin/what &&
3132 set X `/usr/bin/what /sys/posix.dll` &&
3133 $test "$3" = UWIN &&
3137 if $test -f $uname; then
3145 umips) osname=umips ;;
3148 [23]100) osname=mips ;;
3149 next*) osname=next ;;
3151 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3152 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3155 elif $test -f /etc/kconfig; then
3157 if test "$lns" = "$ln -s"; then
3159 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3161 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3168 if test -n "$DJGPP"; then
3177 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3179 # oslevel can fail with:
3180 # oslevel: Unable to acquire lock.
3181 *not\ found) osvers="$4"."$3" ;;
3182 '<3240'|'<>3240') osvers=3.2.0 ;;
3183 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3184 '=3250'|'>3250') osvers=3.2.5 ;;
3188 bsd386) osname=bsd386
3191 cygwin*) osname=cygwin
3194 *dc.osx) osname=dcosx
3200 domainos) osname=apollo
3206 dragonfly) osname=dragonfly
3209 dynixptx*) osname=dynixptx
3210 osvers=`echo "$4"|sed 's/^v//'`
3212 freebsd) osname=freebsd
3214 genix) osname=genix ;;
3218 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3234 netbsd*) osname=netbsd
3237 news-os) osvers="$3"
3239 4*) osname=newsos4 ;;
3243 next*) osname=next ;;
3244 nonstop-ux) osname=nonstopux ;;
3245 openbsd) osname=openbsd
3251 POSIX-BC | posix-bc ) osname=posix-bc
3254 powerux | power_ux | powermax_os | powermaxos | \
3255 powerunix | power_unix) osname=powerux
3261 solaris) osname=solaris
3263 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3270 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3274 titanos) osname=titanos
3283 ultrix) osname=ultrix
3286 osf1|mls+) case "$5" in
3289 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3292 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3295 hp*) osname=hp_osf1 ;;
3296 mips) osname=mips_osf1 ;;
3299 # UnixWare 7.1.2 is known as Open UNIX 8
3300 openunix|unixware) osname=svr5
3308 $2) case "$osname" in
3312 : svr4.x or possibly later
3322 if test -f /stand/boot ; then
3323 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3324 if test -n "$INITPROG" -a -f "$INITPROG"; then
3325 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3326 if test -n "$isesix"; then
3334 *) if test -f /etc/systemid; then
3336 set `echo $3 | $sed 's/\./ /g'` $4
3337 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3339 elif $test -f $src/hints/sco_$1_$2.sh; then
3341 elif $test -f $src/hints/sco_$1.sh; then
3346 '') : Still unknown. Probably a generic Sys V.
3355 *) case "$osname" in
3356 '') : Still unknown. Probably a generic BSD.
3364 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3365 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3366 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3369 $rm -f UU/kernel.what
3370 elif test -d c:/. -o -n "$is_os2" ; then
3377 case "$targetarch" in
3380 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3385 : Now look for a hint file osname_osvers, unless one has been
3386 : specified already.
3389 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3390 : Also try without trailing minor version numbers.
3391 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3392 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3393 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3394 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3397 *) case "$osvers" in
3400 *) if $test -f $src/hints/$file.sh ; then
3402 elif $test -f $src/hints/$xfile.sh ; then
3404 elif $test -f $src/hints/$xxfile.sh ; then
3406 elif $test -f $src/hints/$xxxfile.sh ; then
3408 elif $test -f $src/hints/$xxxxfile.sh ; then
3410 elif $test -f "$src/hints/${osname}.sh" ; then
3419 if $test -f Policy.sh ; then
3422 none) dflt="Policy" ;;
3423 *) dflt="Policy $dflt" ;;
3428 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3432 if $test -f Policy.sh ; then
3435 There's also a Policy hint file available, which should make the
3436 site-specific (policy) questions easier to answer.
3443 You may give one or more space-separated answers, or "none" if appropriate.
3444 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3445 previous run of Configure, you may specify it as well as or instead of
3446 OS-specific hints. If hints are provided for your OS, you should use them:
3447 although Perl can probably be built without hints on many platforms, using
3448 hints often improve performance and may enable features that Configure can't
3449 set up on its own. If there are no hints that match your OS, specify "none";
3450 DO NOT give a wrong version or a wrong OS.
3454 rp="Which of these apply, if any?"
3457 for file in $tans; do
3458 if $test X$file = XPolicy -a -f Policy.sh; then
3460 $cat Policy.sh >> UU/config.sh
3461 elif $test -f $src/hints/$file.sh; then
3462 . $src/hints/$file.sh
3463 $cat $src/hints/$file.sh >> UU/config.sh
3464 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3467 : Give one chance to correct a possible typo.
3468 echo "$file.sh does not exist"
3470 rp="hint to use instead?"
3472 for file in $ans; do
3473 if $test -f "$src/hints/$file.sh"; then
3474 . $src/hints/$file.sh
3475 $cat $src/hints/$file.sh >> UU/config.sh
3476 elif $test X$ans = X -o X$ans = Xnone ; then
3479 echo "$file.sh does not exist -- ignored."
3486 : Remember our hint file for later.
3487 if $test -f "$src/hints/$file.sh" ; then
3497 echo "Fetching default answers from $config_sh..." >&4
3501 cp $config_sh config.sh 2>/dev/null
3511 test "$override" && . ./optdef.sh
3513 : Restore computed paths
3514 for file in $loclist $trylist; do
3515 eval $file="\$_$file"
3520 Configure uses the operating system name and version to set some defaults.
3521 The default value is probably right if the name rings a bell. Otherwise,
3522 since spelling matters for me, either accept the default or answer "none"
3529 ''|' '|none) dflt=none ;;
3530 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3533 *) dflt="$osname" ;;
3535 rp="Operating system name?"
3539 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3545 ''|' '|none) dflt=none ;;
3546 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3547 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3549 ''|' ') dflt=none ;;
3554 *) dflt="$osvers" ;;
3556 rp="Operating system version?"
3566 : who configured the system
3567 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3570 cf_by=`(logname) 2>/dev/null`
3573 cf_by=`(whoami) 2>/dev/null`
3575 "") cf_by=unknown ;;
3580 : decide how portable to be. Allow command line overrides.
3581 case "$d_portable" in
3583 *) d_portable="$define" ;;
3586 : set up shell script to do ~ expansion
3592 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3595 if $test -f /bin/csh; then
3596 /bin/csh -f -c "glob \$1"
3601 name=\`$expr x\$1 : '..\([^/]*\)'\`
3602 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3603 if $test ! -d "\$dir"; then
3605 echo "\$me: can't locate home directory for: \$name" >&2
3610 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3626 : now set up to get a file name
3630 cat <<'EOSC' >>getfile
3646 : getfile will accept an answer from the comma-separated list
3647 : enclosed in parentheses even if it does not meet other criteria.
3648 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3649 fn=`echo $fn | sed 's/(.*)//'`
3655 loc_file=`expr $fn : '.*:\(.*\)'`
3656 fn=`expr $fn : '\(.*\):.*'`
3664 */*) fullpath=true;;
3673 *e*) exp_file=true;;
3676 *p*) nopath_ok=true;;
3681 *d*) type='Directory';;
3682 *l*) type='Locate';;
3687 Locate) what='File';;
3692 case "$d_portable" in
3700 while test "$type"; do
3705 true) rp="$rp (~name ok)";;
3708 if test -f UU/getfile.ok && \
3709 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3728 value=`UU/filexp $ans`
3731 if test "$ans" != "$value"; then
3732 echo "(That expands to $value on this system.)"
3746 /*) value="$ansexp" ;;
3747 [a-zA-Z]:/*) value="$ansexp" ;;
3752 echo "I shall only accept a full path name, as in /bin/ls." >&4
3753 echo "Use a ! shell escape if you wish to check pathnames." >&4
3756 echo "Please give a full path name, starting with slash." >&4
3759 echo "Note that using ~name is ok provided it expands well." >&4
3772 for fp in $gfpth; do
3773 if test "X$fp" = X.; then
3778 if test -f "$pf"; then
3780 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3782 echo "($value is not a plain file, but that's ok.)"
3785 if test X"$type" = X; then
3792 for fp in $gfpth; do
3793 if test "X$fp" = X.; then
3798 direxp="$fp/$ansexp"
3800 if test -d "$direxp"; then
3808 if test -d "$ansexp"; then
3809 echo "(Looking for $loc_file in directory $value.)"
3810 value="$value/$loc_file"
3811 ansexp="$ansexp/$loc_file"
3813 if test -f "$ansexp"; then
3816 case "$nopath_ok" in
3817 true) case "$value" in
3819 *) echo "Assuming $value will be in people's path."
3835 if test "$fastread" = yes; then
3840 rp="$what $value doesn't exist. Use that name anyway?"
3859 test "X$gfpthkeep" != Xy && gfpth=""
3862 : determine root of directory hierarchy where package will be installed.
3865 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3868 dflt=`echo "$prefix" | sed 's/.$//'`
3876 By default, $package will be installed in $dflt/bin, manual pages
3877 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3878 installation directories. Typically this is something like /usr/local.
3879 If you wish to have binaries under /usr/bin but other parts of the
3880 installation under /usr/local, that's ok: you will be prompted
3881 separately for each of the installation directories, the prefix being
3882 only used to set the defaults.
3886 rp='Installation prefix to use?'
3894 *) oldprefix="$prefix";;
3901 : allow them to override the AFS root
3904 *) afsroot=$afsroot ;;
3910 $define|true) afs=true ;;
3911 $undef|false) afs=false ;;
3912 *) if $test -d $afsroot; then
3920 echo "AFS may be running... I'll be extra cautious then..." >&4
3922 echo "AFS does not seem to be running..." >&4
3925 : determine installation prefix for where package is to be installed.
3929 Since you are running AFS, I need to distinguish the directory in which
3930 files will reside from the directory in which they are installed (and from
3931 which they are presumably copied to the former directory by occult means).
3934 case "$installprefix" in
3935 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3936 *) dflt="$installprefix";;
3941 In some special cases, particularly when building $package for distribution,
3942 it is convenient to distinguish the directory in which files should be
3943 installed from the directory ($prefix) in which they will
3944 eventually reside. For most users, these two directories are the same.
3947 case "$installprefix" in
3949 *) dflt=$installprefix;;
3953 rp='What installation prefix should I use for installing files?'
3955 installprefix="$ans"
3956 installprefixexp="$ansexp"
3958 : Perform the prefixexp/installprefixexp correction if necessary
3959 cat <<EOS >installprefix
3962 cat <<'EOSC' >>installprefix
3963 : Change installation prefix, if necessary.
3964 if $test X"$prefix" != X"$installprefix"; then
3965 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3967 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3970 chmod +x installprefix
3971 $eunicefix installprefix
3973 : Set variables such as privlib and privlibexp from the output of ./getfile
3974 : performing the prefixexp/installprefixexp correction if necessary.
3975 cat <<EOS >setprefixvar
3978 cat <<'EOSC' >>setprefixvar
3979 eval "${prefixvar}=\"\$ans\""
3980 eval "${prefixvar}exp=\"\$ansexp\""
3983 chmod +x setprefixvar
3984 $eunicefix setprefixvar
3986 : set up the script used to warn in case of inconsistency
3995 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3997 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3998 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4003 echo "*** WHOA THERE!!! ***" >&4
4004 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4007 rp=" Keep the $hint value?"
4010 y) td=$was; tu=$was;;
4014 : function used to set $1 to $val
4015 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4017 $define$undef) . ./whoa; eval "$var=\$td";;
4018 $undef$define) . ./whoa; eval "$var=\$tu";;
4019 *) eval "$var=$val";;
4022 : Check is we will use socks
4024 $define|true|[yY]*) dflt='y';;
4029 Perl can be built to use the SOCKS proxy protocol library. To do so,
4030 Configure must be run with -Dusesocks. If you use SOCKS you also need
4031 to use the PerlIO abstraction layer, this will be implicitly selected.
4033 If this doesn't make any sense to you, just accept the default '$dflt'.
4035 rp='Build Perl for SOCKS?'
4038 y|Y) val="$define" ;;
4045 $define|true|[yY]*) useperlio="$define";;
4048 : Check if we want perlio
4049 case "$useperlio" in
4050 $define|true|[yY]*|'') dflt='y';;
4055 Previous version of $package used the standard IO mechanisms as
4056 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4057 alternate IO mechanisms via the PerlIO abstraction layer, but the
4058 stdio mechanism is still available if needed. The abstraction layer
4059 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4060 Using PerlIO with sfio may cause problems with some extension modules.
4062 If this doesn't make any sense to you, just accept the default '$dflt'.
4064 rp='Use the PerlIO abstraction layer?'
4071 echo "Ok, doing things the stdio way."
4080 case "$useperlio" in
4081 $define|true|[yY]*) ;;
4084 You are using the SOCKS proxy protocol library which means that you
4085 should also use the PerlIO layer. You may be headed for trouble.
4093 : get the patchlevel
4095 echo "Getting the current patchlevel..." >&4
4096 if $test -r $rsrc/patchlevel.h;then
4097 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4098 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4099 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4100 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4101 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4102 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4103 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4112 $echo "(You do not have patchlevel.h. Eek.)"
4114 if $test -r $rsrc/.patch ; then
4115 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4116 perl_patchlevel=`cat $rsrc/.patch`
4119 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4120 version_patchlevel_string="version $patchlevel subversion $subversion"
4121 case "$perl_patchlevel" in
4123 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4126 $echo "(You have $package $version_patchlevel_string.)"
4130 : XXX Should be a Configure test for double-dots in filenames.
4131 version=`echo $revision $patchlevel $subversion | \
4132 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4133 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4134 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4137 version=`echo $revision $patchlevel $subversion | \
4138 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4139 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4140 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4143 : Special case the 5.005_xx maintenance series, which used 5.005
4144 : without any subversion label as a subdirectory in $sitelib
4145 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4146 api_versionstring='5.005'
4149 : Do we want threads support and if so, what type
4150 case "$usethreads" in
4151 $define|true|[yY]*) dflt='y';;
4152 *) # Catch case where user specified ithreads or 5005threads but
4153 # forgot -Dusethreads (A.D. 4/2002)
4154 case "$useithreads$use5005threads" in
4156 case "$useperlio" in
4157 "$define") dflt='y' ;;
4167 Perl can be built to take advantage of threads on some systems.
4168 To do so, Configure can be run with -Dusethreads.
4170 Note that Perl built with threading support runs slightly slower
4171 and uses more memory than plain Perl. The current implementation
4172 is believed to be stable, but it is fairly new, and so should be
4173 treated with caution.
4175 If this doesn't make any sense to you, just accept the default '$dflt'.
4177 rp='Build a threading Perl?'
4180 y|Y) val="$define" ;;
4186 if $test $patchlevel -lt 9; then
4187 case "$usethreads" in
4191 Since release 5.6, Perl has had two different threading implementations,
4192 the newer interpreter-based version (ithreads) with one interpreter per
4193 thread, and the older 5.005 version (5005threads).
4194 The 5005threads version is effectively unmaintained and will probably be
4195 removed in Perl 5.10, so there should be no need to build a Perl using it
4196 unless needed for backwards compatibility with some existing 5.005threads
4200 : Default to ithreads unless overridden on command line or with
4203 case "$use5005threads" in
4204 $define|true|[yY]*) dflt='n';;
4206 case "$useithreads" in
4207 $undef|false|[nN]*) dflt='n';;
4209 rp='Use the newer interpreter-based ithreads?'
4212 y|Y) val="$define" ;;
4217 : Now set use5005threads to the opposite value.
4218 case "$useithreads" in
4219 $define) val="$undef" ;;
4226 useithreads="$undef"
4227 use5005threads="$undef"
4231 case "$useithreads$use5005threads" in
4235 You cannot have both the ithreads and the 5.005 threads enabled
4236 at the same time. Disabling the 5.005 threads since they are
4237 much less stable than the ithreads.
4240 use5005threads="$undef"
4245 : perl-5.9.x and later
4247 if test X"$usethreads" = "X$define"; then
4248 case "$use5005threads" in
4252 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4259 use5005threads="$undef"
4260 useithreads="$usethreads"
4263 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4266 *** To build with ithreads you must also use the PerlIO layer.
4267 *** Cannot continue, aborting.
4273 case "$d_oldpthreads" in
4274 '') : Configure tests would be welcome here. For now, assume undef.
4276 *) val="$d_oldpthreads" ;;
4282 : Look for a hint-file generated 'call-back-unit'. If the
4283 : user has specified that a threading perl is to be built,
4284 : we may need to set or change some other defaults.
4285 if $test -f usethreads.cbu; then
4286 echo "Your platform has some specific hints regarding threaded builds, using them..."
4289 case "$usethreads" in
4290 "$define"|true|[yY]*)
4292 (Your platform does not have any specific hints for threaded builds.
4293 Assuming POSIX threads, then.)
4299 : Check if multiplicity is required
4302 Perl can be built so that multiple Perl interpreters can coexist
4303 within the same Perl executable.
4306 case "$useithreads" in
4309 This multiple interpreter support is required for interpreter-based threads.
4313 *) case "$usemultiplicity" in
4314 $define|true|[yY]*) dflt='y';;
4318 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4319 rp='Build Perl for multiplicity?'
4322 y|Y) val="$define" ;;
4330 : Check if morebits is requested
4331 case "$usemorebits" in
4332 "$define"|true|[yY]*)
4333 use64bitint="$define"
4334 uselongdouble="$define"
4335 usemorebits="$define"
4337 *) usemorebits="$undef"
4341 : Determine the C compiler to be used
4347 rp="Use which C compiler?"
4351 : See whether they have no cc but they do have gcc
4353 if $test -f cc.cbu; then
4358 : make some quick guesses about what we are up against
4360 $echo $n "Hmm... $c"
4370 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4371 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4373 echo "Looks kind of like an OSF/1 system, but we'll see..."
4375 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4376 xxx=`./loc addbib blurfl $pth`
4377 if $test -f $xxx; then
4378 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4382 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4383 echo "Looks kind of like an extended USG system, but we'll see..."
4385 echo "Looks kind of like a USG system, but we'll see..."
4389 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4390 echo "Looks kind of like a BSD system, but we'll see..."
4394 echo "Looks kind of like a Version 7 system, but we'll see..."
4397 case "$eunicefix" in
4400 There is, however, a strange, musty smell in the air that reminds me of
4401 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4405 : it so happens the Eunice I know will not run shell scripts in Unix format
4409 echo "Congratulations. You aren't running Eunice."
4413 : Detect OS2. The p_ variable is set above in the Head.U unit.
4414 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4415 : semicolon as a patch separator
4420 I have the feeling something is not exactly right, however...don't tell me...
4421 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4422 (Or you may be running DOS with DJGPP.)
4427 if test -f /xenix; then
4428 echo "Actually, this looks more like a XENIX system..."
4433 echo "It's not Xenix..."
4438 if test -f /venix; then
4439 echo "Actually, this looks more like a VENIX system..."
4446 echo "Nor is it Venix..."
4449 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4450 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4453 : Check if we are using GNU gcc and what its version is
4455 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4459 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4461 printf("%s\n", __VERSION__);
4463 printf("%s\n", "1");
4469 if $cc -o try $ccflags $ldflags try.c; then
4470 gccversion=`$run ./try`
4471 case "$gccversion" in
4472 '') echo "You are not using GNU cc." ;;
4473 *) echo "You are using GNU cc $gccversion."
4479 echo "*** WHOA THERE!!! ***" >&4
4480 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4481 case "$knowitall" in
4483 echo " You'd better start hunting for one and let me know about it." >&4
4489 case "$gccversion" in
4490 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4492 case "$gccversion" in
4493 '') gccosandvers='' ;;
4494 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4495 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4497 case "$gccosandvers" in
4498 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4499 $osname$osvers) ;; # looking good
4500 $osname*) cat <<EOM >&4
4502 *** WHOA THERE!!! ***
4504 Your gcc has not been compiled for the exact release of
4505 your operating system ($gccosandvers versus $osname$osvers).
4507 In general it is a good idea to keep gcc synchronized with
4508 the operating system because otherwise serious problems
4509 may ensue when trying to compile software, like Perl.
4511 I'm trying to be optimistic here, though, and will continue.
4512 If later during the configuration and build icky compilation
4513 problems appear (headerfile conflicts being the most common
4514 manifestation), I suggest reinstalling the gcc to match
4515 your operating system release.
4519 *) gccosandvers='' ;; # failed to parse, better be silent
4527 # gcc 3.* complain about adding -Idirectories that they already know about,
4528 # so we will take those off from locincpth.
4529 case "$gccversion" in
4531 echo "main(){}">try.c
4532 for incdir in $locincpth; do
4533 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4534 grep '^c[cp]p*[01]: warning: changing search order '`
4535 if test "X$warn" != X; then
4536 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4542 : What should the include directory be ?
4544 $echo $n "Hmm... $c"
4548 if $test -f /bin/mips && /bin/mips; then
4549 echo "Looks like a MIPS system..."
4550 $cat >usr.c <<'EOCP'
4551 #ifdef SYSTYPE_BSD43
4555 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4556 dflt='/bsd43/usr/include'
4560 mips_type='System V'
4562 $rm -f usr.c usr.out
4563 echo "and you're compiling with the $mips_type compiler and libraries."
4567 echo "Doesn't look like a MIPS system."
4577 case "$xxx_prompt" in
4580 rp='Where are the include files you want to use?'
4588 : see how we invoke the C preprocessor
4590 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4591 cat <<'EOT' >testcpp.c
4597 if test ! -f cppstdin; then
4598 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4599 # AIX cc -E doesn't show the absolute headerfile
4600 # locations but we'll cheat by using the -M flag.
4601 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
4603 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4606 echo "Keeping your $hint cppstdin wrapper."
4609 wrapper=`pwd`/cppstdin
4613 if $test "X$cppstdin" != "X" && \
4614 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4615 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4617 echo "You used to use $cppstdin $cppminus so we'll use that again."
4619 '') echo "But let's see if we can live without a wrapper..." ;;
4621 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4622 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4624 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4627 echo "(However, $cpprun $cpplast does not work, let's see...)"
4635 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4642 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4643 $cc -E <testcpp.c >testcpp.out 2>&1; \
4644 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4645 echo "Yup, it does."
4648 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4649 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4650 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4651 echo "Yup, it does."
4654 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4655 $cc -P <testcpp.c >testcpp.out 2>&1; \
4656 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4657 echo "Yipee, that works!"
4660 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4661 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4662 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4663 echo "At long last!"
4666 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4667 $cpp <testcpp.c >testcpp.out 2>&1; \
4668 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4672 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4673 $cpp - <testcpp.c >testcpp.out 2>&1; \
4674 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4675 echo "Hooray, it works! I was beginning to wonder."
4678 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4679 $wrapper <testcpp.c >testcpp.out 2>&1; \
4680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4686 rp="No dice. I can't find a C preprocessor. Name one:"
4690 $x_cpp <testcpp.c >testcpp.out 2>&1
4691 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4692 echo "OK, that will do." >&4
4694 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4709 echo "Perhaps can we force $cc -E using a wrapper..."
4710 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4711 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4717 echo "Nope, we'll have to live without it..."
4731 "$wrapper"|'cppstdin') ;;
4732 *) $rm -f $wrapper;;
4734 $rm -f testcpp.c testcpp.out
4736 : Set private lib path
4739 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4744 '') dlist="$loclibpth $plibpth $glibpth";;
4745 *) dlist="$libpth";;
4748 : Now check and see which directories actually exist, avoiding duplicates
4752 if $test -d $xxx; then
4755 *) libpth="$libpth $xxx";;
4761 Some systems have incompatible or broken versions of libraries. Among
4762 the directories listed in the question below, please remove any you
4763 know not to be holding relevant libraries, and add any that are needed.
4764 Say "none" for none.
4775 rp="Directories to use for library searches?"
4782 : compute shared library extension
4785 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4795 On some systems, shared libraries may be available. Answer 'none' if
4796 you want to suppress searching of shared libraries for the remainder
4797 of this configuration.
4800 rp='What is the file extension used for shared libraries?'
4804 : Define several unixisms.
4805 : Hints files or command line option can be used to override them.
4806 : The convoluted testing is in case hints files set either the old
4809 '') case "$exe_ext" in
4811 *) _exe="$exe_ext" ;;
4816 '') case "$lib_ext" in
4823 '') case "$obj_ext" in
4830 '') case "$path_sep" in
4841 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4843 : Which makefile gets called first. This is used by make depend.
4844 case "$firstmakefile" in
4845 '') firstmakefile='makefile';;
4848 : Check for uselongdouble support
4850 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4853 case "$uselongdouble" in
4854 $define|true|[yY]*) dflt='y';;
4859 Perl can be built to take advantage of long doubles which
4860 (if available) may give more accuracy and range for floating point numbers.
4862 If this doesn't make any sense to you, just accept the default '$dflt'.
4864 rp='Try to use long doubles if available?'
4867 y|Y) val="$define" ;;
4873 case "$uselongdouble" in
4874 true|[yY]*) uselongdouble="$define" ;;
4877 : Look for a hint-file generated 'call-back-unit'. If the
4878 : user has specified that long doubles should be used,
4879 : we may need to set or change some other defaults.
4880 if $test -f uselongdouble.cbu; then
4881 echo "Your platform has some specific hints regarding long doubles, using them..."
4882 . ./uselongdouble.cbu
4884 case "$uselongdouble" in
4887 (Your platform does not have any specific hints for long doubles.)
4893 : Looking for optional libraries
4895 echo "Checking for optional libraries..." >&4
4900 case "$libswanted" in
4901 '') libswanted='c_s';;
4904 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4910 for thisdir in $libpth $xlibpth; do
4911 test -d $thisdir && libspath="$libspath $thisdir"
4913 for thislib in $libswanted; do
4914 for thisdir in $libspath; do
4916 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4917 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4918 $test -f "$xxx" && eval $libscheck
4919 $test -f "$xxx" && libstyle=shared
4921 if test ! -f "$xxx"; then
4922 xxx=$thisdir/lib$thislib.$so
4923 $test -f "$xxx" && eval $libscheck
4924 $test -f "$xxx" && libstyle=shared
4926 if test ! -f "$xxx"; then
4927 xxx=$thisdir/lib$thislib$_a
4928 $test -f "$xxx" && eval $libscheck
4929 $test -f "$xxx" && libstyle=static
4931 if test ! -f "$xxx"; then
4932 xxx=$thisdir/$thislib$_a
4933 $test -f "$xxx" && eval $libscheck
4934 $test -f "$xxx" && libstyle=static
4936 if test ! -f "$xxx"; then
4937 xxx=$thisdir/lib${thislib}_s$_a
4938 $test -f "$xxx" && eval $libscheck
4939 $test -f "$xxx" && libstyle=static
4940 $test -f "$xxx" && thislib=${thislib}_s
4942 if test ! -f "$xxx"; then
4943 xxx=$thisdir/Slib$thislib$_a
4944 $test -f "$xxx" && eval $libscheck
4945 $test -f "$xxx" && libstyle=static
4947 if $test -f "$xxx"; then
4949 shared) echo "Found -l$thislib (shared)." ;;
4950 static) echo "Found -l$thislib." ;;
4951 *) echo "Found -l$thislib ($libstyle)." ;;
4955 *) dflt="$dflt -l$thislib"
4956 libsfound="$libsfound $xxx"
4958 libsfiles="$libsfiles $yyy"
4959 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4960 case " $libsdirs " in
4962 *) libsdirs="$libsdirs $yyy" ;;
4969 if $test ! -f "$xxx"; then
4970 echo "No -l$thislib."
4981 ' '|'') dflt='none';;
4986 In order to compile $package on your machine, a number of libraries
4987 are usually needed. Include any other special libraries here as well.
4988 Say "none" for none. The default list is almost always right.
4992 rp="What libraries to use?"
4999 : determine optimization, if desired, or use for debug flag also
5001 ' '|$undef) dflt='none';;
5003 *) dflt="$optimize";;
5007 By default, $package compiles with the -O flag to use the optimizer.
5008 Alternately, you might want to use the symbolic debugger, which uses
5009 the -g flag (on traditional Unix systems). Either flag can be
5010 specified here. To use neither flag, specify the word "none".
5013 rp="What optimizer/debugger flag should be used?"
5017 'none') optimize=" ";;
5020 : Check what DEBUGGING is required from the command line
5021 : -DEBUGGING or -DDEBUGGING or
5022 : -DEBUGGING=both = -g + -DDEBUGGING
5023 : -DEBUGGING=-g or -Doptimize=-g = -g
5024 : -DEBUGGING=none or -UDEBUGGING =
5025 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5028 *) DEBUGGING=$EBUGGING ;;
5031 case "$DEBUGGING" in
5035 *) optimize="$optimize -g" ;;
5039 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5047 case "$DEBUGGING" in
5048 both|$define) dflt='-DDEBUGGING'
5051 : argument order is deliberate, as the flag will start with - which set could
5052 : think is an option
5053 checkccflag='check=$1; flag=$2; callback=$3;
5055 echo "Checking if your compiler accepts $flag" 2>&1;
5056 echo "int main(void) { return 0; }" > gcctest.c;
5057 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5058 echo "Yes, it does." 2>&1;
5059 if $test -s gcctest.out ; then
5060 echo "But your platform does not like it:";
5065 echo "Leaving current flags $ccflags alone." 2>&1
5067 *) dflt="$dflt $flag";
5073 echo "Nope, it does not, but that is ok." 2>&1;
5077 : We will not override a previous value, but we might want to
5078 : augment a hint file
5080 default|recommended)
5081 case "$gccversion" in
5082 1*) dflt="$dflt -fpcc-struct-return" ;;
5084 case "$optimize:$DEBUGGING" in
5085 *-g*:old) dflt="$dflt -DDEBUGGING";;
5087 case "$gccversion" in
5088 2*) if $test -d /etc/conf/kconfig.d &&
5089 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5091 # Interactive Systems (ISC) POSIX mode.
5096 case "$gccversion" in
5099 ?*) set strict-aliasing -fno-strict-aliasing
5103 # For gcc, adding -pipe speeds up compilations for some, but apparently
5104 # some assemblers can't read from stdin. (It also slows down compilations
5105 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5106 case "$gccversion" in
5112 # on x86_64 (at least) we require an extra library (libssp) in the
5113 # link command line. This library is not named, so I infer that it is
5114 # an implementation detail that may change. Hence the safest approach
5115 # is to add the flag to the flags passed to the compiler at link time,
5116 # as that way the compiler can do the right implementation dependant
5118 case "$gccversion" in
5119 ?*) set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"'
5126 case "$mips_type" in
5127 *BSD*|'') inclwanted="$locincpth $usrinc";;
5128 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5130 for thisincl in $inclwanted; do
5131 if $test -d $thisincl; then
5132 if $test x$thisincl != x$usrinc; then
5134 *" -I$thisincl "*);;
5135 *) dflt="$dflt -I$thisincl ";;
5141 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5143 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5151 *) dflt="$dflt -D$2";;
5155 set signal.h LANGUAGE_C; eval $inctest
5159 ccflags="$ccflags -DSOCKS"
5164 default|recommended) dflt="$ccflags $dflt" ;;
5165 *) dflt="$ccflags";;
5174 Your C compiler may want other flags. For this question you should include
5175 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5176 but you should NOT include libraries or ld flags like -lwhatever. If you
5177 want $package to honor its debug switch, you should include -DDEBUGGING here.
5178 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5180 To use no flags, specify the word "none".
5186 rp="Any additional cc flags?"
5193 : the following weeds options from ccflags that are of no interest to cpp
5195 '') cppflags="$ccflags" ;;
5196 *) cppflags="$cppflags $ccflags" ;;
5198 case "$gccversion" in
5199 1*) cppflags="$cppflags -D__GNUC__"
5201 case "$mips_type" in
5203 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5209 echo "Let me guess what the preprocessor flags are..." >&4
5223 *) ftry="$previous $flag";;
5225 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5226 >cpp1.out 2>/dev/null && \
5227 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5228 >cpp2.out 2>/dev/null && \
5229 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5230 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5232 cppflags="$cppflags $ftry"
5242 *-*) echo "They appear to be: $cppflags";;
5244 $rm -f cpp.c cpp?.out
5248 : flags used in final linking phase
5250 '') if ./venix; then
5256 *-posix*) dflt="$dflt -posix" ;;
5259 *) dflt="$ldflags";;
5262 : Try to guess additional flags to pick up local libraries.
5263 for thislibdir in $libpth; do
5264 case " $loclibpth " in
5267 *"-L$thislibdir "*) ;;
5268 *) dflt="$dflt -L$thislibdir" ;;
5280 Your C linker may need flags. For this question you should
5281 include -L/whatever and any other flags used by the C linker, but you
5282 should NOT include libraries like -lwhatever.
5284 Make sure you include the appropriate -L/path flags if your C linker
5285 does not normally search all of the directories you specified above,
5288 To use no flags, specify the word "none".
5292 rp="Any additional ld flags (NOT including libraries)?"
5298 rmlist="$rmlist pdp11"
5302 echo "Checking your choice of C compiler and flags for coherency..." >&4
5303 $cat > try.c <<'EOF'
5305 int main() { printf("Ok\n"); return(0); }
5307 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5309 $cat >try.msg <<'EOM'
5310 I've tried to compile and run the following simple program:
5313 $cat try.c >> try.msg
5315 $cat >> try.msg <<EOM
5322 and I got the following output:
5326 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5327 if $sh -c "$run ./try " >>try.msg 2>&1; then
5331 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5334 cat >> try.msg <<'EOQS'
5335 If $libs contains -lsfio, and sfio is mis-configured, then it
5336 sometimes (apparently) runs and exits with a 0 status, but with no
5337 output! It may have to do with sfio's use of _exit vs. exit.
5340 rp="You have a big problem. Shall I abort Configure"
5347 echo "The program compiled OK, but exited with status $?." >>try.msg
5348 rp="You have a problem. Shall I abort Configure"
5352 echo "I can't compile the test program." >>try.msg
5353 rp="You have a BIG problem. Shall I abort Configure"
5359 case "$knowitall" in
5361 echo "(The supplied flags or libraries might be incorrect.)"
5369 *) echo "Ok. Stopping Configure." >&4
5374 n) echo "OK, that should do.";;
5376 $rm_try gcctest gcctest.out
5378 : define a shorthand compile call
5382 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5383 : define a shorthand compile call for compilations that should be ok.
5387 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5389 : determine filename position in cpp output
5391 echo "Computing filename position in cpp output for #include directives..." >&4
5393 vos) testaccess=-e ;;
5396 echo '#include <stdio.h>' > foo.c
5399 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5400 $grep '^[ ]*#.*stdio\.h' | \
5401 while read cline; do
5404 while $test \$# -gt 0; do
5405 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5410 pos=\`expr \$pos + 1\`
5422 *) pos="${fieldn}th";;
5424 echo "Your cpp writes the filename in the $pos field of the line."
5427 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5428 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5431 : locate header file
5436 for usrincdir in $usrinc
5438 if test -f \$usrincdir/\$wanted; then
5439 echo "\$usrincdir/\$wanted"
5443 awkprg='{ print \$$fieldn }'
5444 echo "#include <\$wanted>" > foo\$\$.c
5445 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5446 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5447 while read cline; do
5448 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5450 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5451 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5456 # status = 0: grep returned 0 lines, case statement not executed
5457 # status = 1: headerfile found
5458 # status = 2: while loop executed, no headerfile found
5462 if test \$status -eq 1; then
5469 : define an alternate in-header-list? function
5470 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5471 cont=true; xxf="echo \"<\$1> found.\" >&4";
5472 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5473 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5475 case $# in 4) instead=instead;; *) instead="at last";; esac;
5476 while $test "$cont"; do
5478 var=$2; eval "was=\$$2";
5479 if $test "$xxx" && $test -r "$xxx";
5481 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5484 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5485 set $yyy; shift; shift; yyy=$@;
5486 case $# in 0) cont="";;
5487 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5488 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5489 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5490 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5494 do set $yyy; var=$2; eval "was=\$$2";
5495 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5496 set $yyy; shift; shift; yyy=$@;
5499 : see if stdlib is available
5500 set stdlib.h i_stdlib
5503 : check for lengths of integral types
5507 echo "Checking to see how big your integers are..." >&4
5516 printf("intsize=%d;\n", (int)sizeof(int));
5517 printf("longsize=%d;\n", (int)sizeof(long));
5518 printf("shortsize=%d;\n", (int)sizeof(short));
5523 if eval $compile_ok && $run ./try > /dev/null; then
5525 echo "Your integers are $intsize bytes long."
5526 echo "Your long integers are $longsize bytes long."
5527 echo "Your short integers are $shortsize bytes long."
5531 Help! I can't compile and run the intsize test program: please enlighten me!
5532 (This is probably a misconfiguration in your system or libraries, and
5533 you really ought to fix it. Still, I'll try anyway.)
5537 rp="What is the size of an integer (in bytes)?"
5541 rp="What is the size of a long integer (in bytes)?"
5545 rp="What is the size of a short integer (in bytes)?"
5553 : check for long long
5555 echo "Checking to see if you have long long..." >&4
5556 echo 'int main() { long long x = 7; return 0; }' > try.c
5558 if eval $compile; then
5560 echo "You have long long."
5563 echo "You do not have long long."
5569 : check for length of long long
5570 case "${d_longlong}${longlongsize}" in
5573 echo "Checking to see how big your long longs are..." >&4
5574 $cat >try.c <<'EOCP'
5578 printf("%d\n", (int)sizeof(long long));
5583 if eval $compile_ok; then
5584 longlongsize=`$run ./try`
5585 echo "Your long longs are $longlongsize bytes long."
5589 echo "(I can't seem to compile the test program. Guessing...)"
5590 rp="What is the size of a long long (in bytes)?"
5594 if $test "X$longsize" = "X$longlongsize"; then
5595 echo "(That isn't any different from an ordinary long.)"
5601 : see if inttypes.h is available
5602 : we want a real compile instead of Inhdr because some systems
5603 : have an inttypes.h which includes non-existent headers
5606 #include <inttypes.h>
5608 static int32_t foo32 = 0x12345678;
5612 if eval $compile; then
5613 echo "<inttypes.h> found." >&4
5616 echo "<inttypes.h> NOT found." >&4
5625 echo "Checking to see if you have int64_t..." >&4
5627 #include <sys/types.h>
5628 #$i_inttypes I_INTTYPES
5630 #include <inttypes.h>
5632 int main() { int64_t x = 7; }
5635 if eval $compile; then
5637 echo "You have int64_t."
5640 echo "You do not have int64_t."
5646 : Check if 64bit ints have a quad type
5648 echo "Checking which 64-bit integer type we could use..." >&4
5654 val='"unsigned int"'
5659 *) case "$longsize" in
5663 val='"unsigned long"'
5668 *) case "$d_longlong:$longlongsize" in
5673 val='"unsigned long long"'
5678 *) case "$d_int64_t" in
5697 '') echo "Alas, no 64-bit integer types in sight." >&4
5700 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5705 : Do we want 64bit support
5706 case "$uselonglong" in
5707 "$define"|true|[yY]*)
5710 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5712 use64bitint="$define"
5715 case "$use64bits" in
5716 "$define"|true|[yY]*)
5719 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5721 use64bitint="$define"
5724 case "$use64bitints" in
5725 "$define"|true|[yY]*)
5728 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5730 use64bitint="$define"
5733 case "$use64bitsint" in
5734 "$define"|true|[yY]*)
5737 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5739 use64bitint="$define"
5742 case "$uselonglongs" in
5743 "$define"|true|[yY]*)
5746 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5748 use64bitint="$define"
5751 case "$use64bitsall" in
5752 "$define"|true|[yY]*)
5755 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5757 use64bitall="$define"
5762 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5764 case "$use64bitall" in
5765 "$define"|true|[yY]*) use64bitint="$define" ;;
5771 You have natively 64-bit long integers.
5775 *) case "$use64bitint" in
5776 "$define"|true|[yY]*) dflt='y';;
5785 Perl can be built to take advantage of 64-bit integer types
5786 on some systems. To do so, Configure can be run with -Duse64bitint.
5787 Choosing this option will most probably introduce binary incompatibilities.
5789 If this doesn't make any sense to you, just accept the default '$dflt'.
5790 (The default has been chosen based on your configuration.)
5792 rp='Try to use 64-bit integers, if available?'
5795 [yY]*) val="$define" ;;
5803 case "$use64bitall" in
5804 "$define"|true|[yY]*) dflt='y' ;;
5805 *) case "$longsize" in
5813 You may also choose to try maximal 64-bitness. It means using as much
5814 64-bitness as possible on the platform. This in turn means even more
5815 binary incompatibilities. On the other hand, your platform may not
5816 have any more 64-bitness available than what you already have chosen.
5818 If this doesn't make any sense to you, just accept the default '$dflt'.
5819 (The default has been chosen based on your configuration.)
5821 rp='Try to use maximal 64-bit support, if available?'
5824 [yY]*) val="$define" ;;
5829 case "$use64bitall" in
5831 case "$use64bitint" in
5835 Since you have chosen a maximally 64-bit build, I'm also turning on
5836 the use of 64-bit integers.
5838 use64bitint="$define" ;;
5843 : Look for a hint-file generated 'call-back-unit'. If the
5844 : user has specified that a 64-bit perl is to be built,
5845 : we may need to set or change some other defaults.
5846 if $test -f use64bitint.cbu; then
5847 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5850 case "$use64bitint" in
5851 "$define"|true|[yY]*)
5853 4) case "$archname64" in
5854 '') archname64=64int ;;
5861 : Look for a hint-file generated 'call-back-unit'. If the
5862 : user has specified that a maximally 64-bit perl is to be built,
5863 : we may need to set or change some other defaults.
5864 if $test -f use64bitall.cbu; then
5865 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5868 case "$use64bitall" in
5869 "$define"|true|[yY]*)
5871 4) case "$archname64" in
5872 ''|64int) archname64=64all ;;
5879 case "$d_quad:$use64bitint" in
5883 *** You have chosen to use 64-bit integers,
5884 *** but none can be found.
5885 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5886 *** Cannot continue, aborting.
5893 : check for length of double
5895 case "$doublesize" in
5897 echo "Checking to see how big your double precision numbers are..." >&4
5906 printf("%d\n", (int)sizeof(double));
5911 if eval $compile_ok; then
5912 doublesize=`$run ./try`
5913 echo "Your double is $doublesize bytes long."
5916 echo "(I can't seem to compile the test program. Guessing...)"
5917 rp="What is the size of a double precision number (in bytes)?"
5925 : check for long doubles
5927 echo "Checking to see if you have long double..." >&4
5928 echo 'int main() { long double x = 7.0; }' > try.c
5930 if eval $compile; then
5932 echo "You have long double."
5935 echo "You do not have long double."
5941 : check for length of long double
5942 case "${d_longdbl}${longdblsize}" in
5945 echo "Checking to see how big your long doubles are..." >&4
5946 $cat >try.c <<'EOCP'
5950 printf("%d\n", sizeof(long double));
5955 if eval $compile; then
5956 longdblsize=`$run ./try`
5957 echo "Your long doubles are $longdblsize bytes long."
5961 echo "(I can't seem to compile the test program. Guessing...)" >&4
5962 rp="What is the size of a long double (in bytes)?"
5966 if $test "X$doublesize" = "X$longdblsize"; then
5967 echo "That isn't any different from an ordinary double."
5968 echo "I'll keep your setting anyway, but you may see some"
5969 echo "harmless compilation warnings."
5975 : determine the architecture name
5977 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5978 tarch=`arch`"-$osname"
5979 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5980 if uname -m > tmparch 2>&1 ; then
5981 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5982 -e 's/$/'"-$osname/" tmparch`
5990 case "$myarchname" in
5993 echo "(Your architecture name used to be $myarchname.)"
5997 case "$targetarch" in
5999 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6004 *) dflt="$archname";;
6006 rp='What is your architecture name'
6009 case "$usethreads" in
6011 echo "Threads selected." >&4
6013 *-thread*) echo "...and architecture name already has -thread." >&4
6015 *) archname="$archname-thread"
6016 echo "...setting architecture name to $archname." >&4
6021 case "$usemultiplicity" in
6023 echo "Multiplicity selected." >&4
6025 *-multi*) echo "...and architecture name already has -multi." >&4
6027 *) archname="$archname-multi"
6028 echo "...setting architecture name to $archname." >&4
6033 case "$use64bitint$use64bitall" in
6035 case "$archname64" in
6037 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6040 case "$use64bitint" in
6041 "$define") echo "64 bit integers selected." >&4 ;;
6043 case "$use64bitall" in
6044 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6047 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6049 *) archname="$archname-$archname64"
6050 echo "...setting architecture name to $archname." >&4
6056 case "$uselongdouble" in
6058 echo "Long doubles selected." >&4
6059 case "$longdblsize" in
6061 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6065 *-ld*) echo "...and architecture name already has -ld." >&4
6067 *) archname="$archname-ld"
6068 echo "...setting architecture name to $archname." >&4
6075 case "$useperlio" in
6077 echo "Perlio selected." >&4
6080 echo "Perlio not selected, using stdio." >&4
6082 *-stdio*) echo "...and architecture name already has -stdio." >&4
6084 *) archname="$archname-stdio"
6085 echo "...setting architecture name to $archname." >&4
6090 if $test -f archname.cbu; then
6091 echo "Your platform has some specific hints for architecture name, using them..."
6095 : set the prefixit variable, to compute a suitable default value
6096 prefixit='case "$3" in
6098 case "$oldprefix" in
6099 "") eval "$1=\"\$$2\"";;
6106 ""|" ") eval "$1=\"\$$2\"";;
6112 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6114 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6115 /*-$oldprefix/*|\~*-$oldprefix/*)
6116 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6117 *) eval "$1=\"\$$2\"";;
6121 : determine installation style
6122 : For now, try to deduce it from prefix unless it is already set.
6123 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6124 case "$installstyle" in
6125 '') case "$prefix" in
6126 *perl*) dflt='lib';;
6127 *) dflt='lib/perl5' ;;
6130 *) dflt="$installstyle" ;;
6132 : Probably not worth prompting for this since we prompt for all
6133 : the directories individually, and the prompt would be too long and
6137 : determine where public executables go
6142 rp='Pathname where the public executables will reside?'
6144 if $test "X$ansexp" != "X$binexp"; then
6148 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6149 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6150 : this via initialinstalllocation
6153 case "$userelocatableinc" in
6154 $define|true|[yY]*) dflt='y' ;;
6159 Would you like to build Perl so that the installation is relocatable, so that
6160 library paths in @INC are determined relative to the path of the perl binary?
6161 This is not advised for system Perl installs, or if you need to run setid
6162 scripts or scripts under taint mode.
6164 If this doesn't make any sense to you, just accept the default '$dflt'.
6166 rp='Use relocatable @INC?'
6169 y|Y) val="$define" ;;
6172 set userelocatableinc
6175 initialinstalllocation="$binexp"
6176 : Default prefix is now "up one level from where the binaries are"
6177 case "$userelocatableinc" in
6183 installprefixexp=".../.."
6187 : determine where private library files go
6188 : Usual default is /usr/local/lib/perl5/$version.
6189 : Also allow things like /opt/perl/lib/$version, since
6190 : /opt/perl/lib/perl5... would be redundant.
6191 : The default "style" setting is made in installstyle.U
6192 case "$installstyle" in
6193 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6194 *) set dflt privlib lib/$version ;;
6199 There are some auxiliary files for $package that need to be put into a
6200 private library directory that is accessible by everyone.
6205 rp='Pathname where the private library files will reside?'
6210 : set the prefixup variable, to restore leading tilda escape
6211 prefixup='case "$prefixexp" in
6213 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6216 : determine where public architecture dependent libraries go
6219 : privlib default is /usr/local/lib/$package/$version
6220 : archlib default is /usr/local/lib/$package/$version/$archname
6221 : privlib may have an optional trailing /share.
6222 tdflt=`echo $privlib | $sed 's,/share$,,'`
6223 tdflt=$tdflt/$archname
6232 $spackage contains architecture-dependent library files. If you are
6233 sharing libraries in a heterogeneous environment, you might store
6234 these files in a separate location. Otherwise, you can just include
6235 them with the rest of the public library files.
6240 rp='Where do you want to put the public architecture-dependent libraries?'
6244 if $test X"$archlib" = X"$privlib"; then
6250 : see if setuid scripts can be secure
6253 Some kernels have a bug that prevents setuid #! scripts from being
6254 secure. Some sites have disabled setuid #! scripts because of this.
6256 First let's decide if your kernel supports secure setuid #! scripts.
6257 (If setuid #! scripts would be secure but have been disabled anyway,
6258 don't say that they are secure if asked.)
6263 if $test -d /dev/fd; then
6264 echo "#!$ls" >reflect
6265 chmod +x,u+s reflect
6266 ./reflect >flect 2>&1
6267 if $contains "/dev/fd" flect >/dev/null; then
6268 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6272 If you are not sure if they are secure, I can check but I'll need a
6273 username and password different from the one you are using right now.
6274 If you don't have such a username or don't want me to test, simply
6278 rp='Other username to test security of setuid scripts with?'
6283 case "$d_suidsafe" in
6284 '') echo "I'll assume setuid scripts are *not* secure." >&4
6287 echo "Well, the $hint value is *not* secure." >&4
6289 *) echo "Well, the $hint value *is* secure." >&4
6294 $rm -f reflect flect
6295 echo "#!$ls" >reflect
6296 chmod +x,u+s reflect
6299 echo '"su" will (probably) prompt you for '"$ans's password."
6300 su $ans -c './reflect >flect'
6301 if $contains "/dev/fd" flect >/dev/null; then
6302 echo "Okay, it looks like setuid scripts are secure." >&4
6305 echo "I don't think setuid scripts are secure." >&4
6310 rp='Does your kernel have *secure* setuid scripts?'
6313 [yY]*) val="$define";;
6318 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6319 echo "(That's for file descriptors, not floppy disks.)"
6325 $rm -f reflect flect
6327 : now see if they want to do setuid emulation
6330 case "$d_suidsafe" in
6333 echo "No need to emulate SUID scripts since they are secure here." >&4
6337 Some systems have disabled setuid scripts, especially systems where
6338 setuid scripts cannot be secure. On systems where setuid scripts have
6339 been disabled, the setuid/setgid bits on scripts are currently
6340 useless. It is possible for $package to detect those bits and emulate
6341 setuid/setgid in a secure fashion. This emulation will only work if
6342 setuid scripts have been disabled in your kernel.
6346 "$define") dflt=y ;;
6349 rp="Do you want to do setuid/setgid emulation?"
6352 [yY]*) val="$define";;
6360 : Find perl5.005 or later.
6361 echo "Looking for a previously installed perl5.005 or later... "
6363 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6364 : Check if this perl is recent and can load a simple module
6365 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6368 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6378 '') echo "None found. That's ok.";;
6379 *) echo "Using $perl5." ;;
6382 : Set the siteprefix variables
6385 After $package is installed, you may wish to install various
6386 add-on modules and utilities. Typically, these add-ons will
6387 be installed under $prefix with the rest
6388 of this package. However, you may wish to install such add-ons
6389 elsewhere under a different prefix.
6391 If you do not wish to put everything under a single prefix, that's
6392 ok. You will be prompted for the individual locations; this siteprefix
6393 is only used to suggest the defaults.
6395 The default should be fine for most people.
6399 rp='Installation prefix to use for add-on modules and utilities?'
6400 : XXX Here might be another good place for an installstyle setting.
6401 case "$siteprefix" in
6403 *) dflt=$siteprefix ;;
6406 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6408 case "$siteprefix" in
6412 *) oldsiteprefix="$prefix";;
6417 siteprefixexp="$ansexp"
6419 : determine where site specific libraries go.
6420 : Usual default is /usr/local/lib/perl5/site_perl/$version
6421 : The default "style" setting is made in installstyle.U
6422 : XXX No longer works with Prefixit stuff.
6423 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6425 '') case "$installstyle" in
6426 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6427 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6435 The installation process will create a directory for
6436 site-specific extensions and modules. Most users find it convenient
6437 to place all site-specific files in this directory rather than in the
6438 main distribution directory.
6442 rp='Pathname for the site-specific library files?'
6446 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6448 : Determine list of previous versions to include in @INC
6449 $cat > getverlist <<EOPL
6452 \$api_versionstring = "$api_versionstring";
6453 \$version = "$version";
6454 \$stem = "$sitelib_stem";
6455 \$archname = "$archname";
6457 $cat >> getverlist <<'EOPL'
6458 # The list found is store twice for each entry: the original name, and
6459 # the binary broken down version as pack "sss", so sorting is easy and
6460 # unambiguous. This will work for all versions that have a maximum of
6461 # three digit groups, separate by '.'s or '_'s. Names are extended with
6462 # ".0.0" to ensure at least three elements for the pack.
6463 # -- H.Merijn Brand (m)'06 23-10-2006
6465 # Can't have leading @ because metaconfig interprets it as a command!
6466 ;@inc_version_list=();
6467 # XXX Redo to do opendir/readdir?
6470 ;@candidates = map {
6471 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6477 ($pversion, $aversion, $vsn5005) = map {
6478 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6479 foreach $d (@candidates) {
6480 if ($d->[1] lt $pversion) {
6481 if ($d->[1] ge $aversion) {
6482 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6484 elsif ($d->[1] ge $vsn5005) {
6485 unshift(@inc_version_list, grep { -d } $d->[0]);
6489 # Skip newer version. I.e. don't look in
6490 # 5.7.0 if we're installing 5.6.1.
6494 if (@inc_version_list) {
6495 print join(' ', @inc_version_list);
6498 # Blank space to preserve value for next Configure run.
6503 case "$inc_version_list" in
6504 '') if test -x "$perl5$exe_ext"; then
6505 dflt=`$perl5 getverlist`
6510 $undef) dflt='none' ;;
6511 *) eval dflt=\"$inc_version_list\" ;;
6514 ''|' ') dflt=none ;;
6521 In order to ease the process of upgrading, this version of perl
6522 can be configured to use modules built and installed with earlier
6523 versions of perl that were installed under $prefix. Specify here
6524 the list of earlier versions that this version of perl should check.
6525 If Configure detected no earlier versions of perl installed under
6526 $prefix, then the list will be empty. Answer 'none' to tell perl
6527 to not search earlier versions.
6529 The default should almost always be sensible, so if you're not sure,
6530 just accept the default.
6533 rp='List of earlier versions to include in @INC?'
6536 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6537 *) inc_version_list="$ans" ;;
6539 case "$inc_version_list" in
6541 inc_version_list_init='0'
6542 d_inc_version_list="$undef"
6544 *) inc_version_list_init=`echo $inc_version_list |
6545 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6546 d_inc_version_list="$define"
6551 : see if this is a malloc.h system
6552 : we want a real compile instead of Inhdr because some systems have a
6553 : malloc.h that just gives a compile error saying to use stdlib.h instead
6558 int main () { return 0; }
6561 if eval $compile; then
6562 echo "<malloc.h> found." >&4
6565 echo "<malloc.h> NOT found." >&4
6572 : check for void type
6574 echo "Checking to see how well your C compiler groks the void type..." >&4
6575 case "$voidflags" in
6587 extern void moo(); /* function returning void */
6588 void (*goo)(); /* ptr to func returning void */
6590 void *hue; /* generic ptr */
6603 int main() { sub(); }
6605 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6606 voidflags=$defvoidused
6607 echo "Good. It appears to support void to the level $package wants.">&4
6608 if $contains warning .out >/dev/null 2>&1; then
6609 echo "However, you might get some warnings that look like this:"
6613 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6614 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6615 echo "It supports 1..."
6616 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6617 echo "It also supports 2..."
6618 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6620 echo "And it supports 4 but not 8 definitely."
6622 echo "It doesn't support 4..."
6623 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6625 echo "But it supports 8."
6628 echo "Neither does it support 8."
6632 echo "It does not support 2..."
6633 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6635 echo "But it supports 4 and 8."
6637 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6639 echo "And it supports 4 but has not heard about 8."
6641 echo "However it supports 8 but not 4."
6646 echo "There is no support at all for void."
6651 case "$voidflags" in
6654 Support flag bits are:
6655 1: basic void declarations.
6656 2: arrays of pointers to functions returning void.
6657 4: operations between pointers to and addresses of void functions.
6658 8: generic void pointers.
6661 rp="Your void support flags add up to what?"
6668 : check for length of pointer
6672 echo "Checking to see how big your pointers are..." >&4
6673 if test "$voidflags" -gt 7; then
6674 echo '#define VOID_PTR char *' > try.c
6676 echo '#define VOID_PTR void *' > try.c
6686 printf("%d\n", (int)sizeof(VOID_PTR));
6691 if eval $compile_ok; then
6692 ptrsize=`$run ./try`
6693 echo "Your pointers are $ptrsize bytes long."
6696 echo "(I can't seem to compile the test program. Guessing...)" >&4
6697 rp="What is the size of a pointer (in bytes)?"
6704 case "$use64bitall" in
6705 "$define"|true|[yY]*)
6709 *** You have chosen a maximally 64-bit build,
6710 *** but your pointers are only 4 bytes wide.
6711 *** Please rerun Configure without -Duse64bitall.
6716 *** Since you have quads, you could possibly try with -Duse64bitint.
6721 *** Cannot continue, aborting.
6732 : determine whether to use malloc wrapping
6734 case "$usemallocwrap" in
6735 [yY]*|true|$define) dflt='y' ;;
6736 [nN]*|false|$undef) dflt='n' ;;
6737 *) case "$usedevel" in
6738 [yY]*|true|$define) dflt='y' ;;
6743 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6745 usemallocwrap="$ans"
6748 usemallocwrap="$define" ;;
6750 usemallocwrap="$undef" ;;
6753 : determine which malloc to compile in
6755 case "$usemymalloc" in
6756 [yY]*|true|$define) dflt='y' ;;
6757 [nN]*|false|$undef) dflt='n' ;;
6758 *) case "$ptrsize" in
6764 rp="Do you wish to attempt to use the malloc that comes with $package?"
6770 mallocsrc='malloc.c'
6771 mallocobj="malloc$_o"
6772 d_mymalloc="$define"
6775 : Remove malloc from list of libraries to use
6776 echo "Removing unneeded -lmalloc from library list" >&4
6777 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6780 echo "libs = $libs" >&4
6792 : compute the return types of malloc and free
6794 $cat >malloc.c <<END
6798 #include <sys/types.h>
6812 case "$malloctype" in
6814 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6821 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6825 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6832 echo "Your system uses $freetype free(), it would seem." >&4
6834 : determine where site specific architecture-dependent libraries go.
6835 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6836 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6837 : sitelib may have an optional trailing /share.
6839 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6840 dflt="$dflt/$archname"
6845 set sitearch sitearch none
6849 The installation process will also create a directory for
6850 architecture-dependent site-specific extensions and modules.
6854 rp='Pathname for the site-specific architecture-dependent library files?'
6858 if $test X"$sitearch" = X"$sitelib"; then
6861 d_sitearch="$define"
6864 : Set the vendorprefix variables
6867 The installation process will also create a directory for
6868 vendor-supplied add-ons. Vendors who supply perl with their system
6869 may find it convenient to place all vendor-supplied files in this
6870 directory rather than in the main distribution directory. This will
6871 ease upgrades between binary-compatible maintenance versions of perl.
6873 Of course you may also use these directories in whatever way you see
6874 fit. For example, you might use them to access modules shared over a
6875 company-wide network.
6877 The default answer should be fine for most people.
6878 This causes further questions about vendor add-ons to be skipped
6879 and no vendor-specific directories will be configured for perl.
6882 rp='Do you want to configure vendor-specific add-on directories?'
6883 case "$usevendorprefix" in
6884 define|true|[yY]*) dflt=y ;;
6885 *) : User may have set vendorprefix directly on Configure command line.
6886 case "$vendorprefix" in
6895 rp='Installation prefix to use for vendor-supplied add-ons?'
6896 case "$vendorprefix" in
6898 *) dflt=$vendorprefix ;;
6901 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6903 case "$vendorprefix" in
6907 *) oldvendorprefix="$prefix";;
6911 usevendorprefix="$define"
6913 vendorprefixexp="$ansexp"
6915 *) usevendorprefix="$undef"
6921 : Set the vendorlib variables
6922 case "$vendorprefix" in
6923 '') d_vendorlib="$undef"
6927 *) d_vendorlib="$define"
6928 : determine where vendor-supplied modules go.
6929 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6930 case "$vendorlib" in
6932 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6933 case "$installstyle" in
6934 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6935 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6938 *) dflt="$vendorlib"
6942 rp='Pathname for the vendor-supplied library files?'
6945 vendorlibexp="$ansexp"
6948 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6952 : Set the vendorarch variables
6953 case "$vendorprefix" in
6954 '') d_vendorarch="$undef"
6958 *) d_vendorarch="$define"
6959 : determine where vendor-supplied architecture-dependent libraries go.
6960 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6961 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6962 : vendorlib may have an optional trailing /share.
6963 case "$vendorarch" in
6964 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6965 dflt="$dflt/$archname"
6967 *) dflt="$vendorarch" ;;
6970 rp='Pathname for vendor-supplied architecture-dependent files?'
6973 vendorarchexp="$ansexp"
6976 prefixvar=vendorarch
6979 : Final catch-all directories to search
6982 Lastly, you can have perl look in other directories for extensions and
6983 modules in addition to those already specified.
6984 These directories will be searched after
6988 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6989 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6991 case "$otherlibdirs" in
6992 ''|' ') dflt='none' ;;
6993 *) dflt="$otherlibdirs" ;;
6996 Enter a colon-separated set of extra paths to include in perl's @INC
6997 search path, or enter 'none' for no extra paths.
7001 rp='Colon-separated list of additional directories for perl to search?'
7004 ' '|''|none) otherlibdirs=' ' ;;
7005 *) otherlibdirs="$ans" ;;
7007 case "$otherlibdirs" in
7011 set d_perl_otherlibdirs
7014 : Cruising for prototypes
7016 echo "Checking out function prototypes..." >&4
7017 $cat >prototype.c <<EOCP
7022 int main(int argc, char *argv[]) {
7025 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7026 echo "Your C compiler appears to support function prototypes."
7029 echo "Your C compiler doesn't seem to understand function prototypes."
7036 : Check if ansi2knr is required
7037 case "$prototype" in
7039 *) ansi2knr='ansi2knr'
7044 This version of $package can only be compiled by a compiler that
7045 understands function prototypes. Unfortunately, your C compiler
7047 doesn't seem to understand them. Sorry about that.
7049 If GNU cc is available for your system, perhaps you could try that instead.
7051 Eventually, we hope to support building Perl with pre-ANSI compilers.
7052 If you would like to help in that effort, please contact <perlbug@perl.org>.
7054 Aborting Configure now.
7061 dflt_dtrace='/usr/sbin/dtrace'
7064 Perl can be built to support DTrace on platforms that support it.
7065 DTrace is a diagnosis and performance analysis tool from Sun.
7067 If this doesn't make any sense to you, just accept the default '$dflt'.
7071 case "$usedtrace" in
7077 dflt_dtrace=$usedtrace
7084 rp='Support DTrace if available?'
7087 y|Y) val="$define" ;;
7093 test "X$usedtrace" != "X$define" && break
7096 rp='Where is the dtrace executable?'
7105 if $dtrace -h -s ../perldtrace.d \
7106 -o perldtrace.tmp >/dev/null 2>&1 \
7107 && rm -f perldtrace.tmp
7110 echo "Good: your $dtrace knows about the -h flag."
7114 *** $me: Fatal Error: $dtrace doesn't support -h flag
7116 *** Your installed dtrace doesn't support the -h switch to compile a D
7117 *** program into a C header. Can't continue.
7129 *** $me: Fatal Error: $dtrace not found.
7136 echo "*** $dtrace was not found."
7142 : See if we want extra modules installed
7149 Perl can be built with extra modules or bundles of modules which
7150 will be fetched from the CPAN and installed alongside Perl.
7152 Notice that you will need access to the CPAN; either via the Internet,
7153 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7154 be asked later to configure the CPAN.pm module which will in turn do
7155 the installation of the rest of the extra modules or bundles.)
7157 Notice also that if the modules require any external software such as
7158 libraries and headers (the libz library and the zlib.h header for the
7159 Compress::Zlib module, for example) you MUST have any such software
7160 already installed, this configuration process will NOT install such
7163 If this doesn't make any sense to you, just accept the default '$dflt'.
7165 rp='Install any extra modules (y or n)?'
7171 Please list any extra modules or bundles to be installed from CPAN,
7172 with spaces between the names. The names can be in any format the
7173 'install' command of CPAN.pm will understand. (Answer 'none',
7174 without the quotes, to install no extra modules or bundles.)
7184 $rm -f ../extras.lst
7186 *) echo "(Saving the list of extras for later...)"
7187 echo "$extras" > ../extras.lst
7195 : determine where html pages for programs go
7196 set html1dir html1dir none
7200 If you wish to install html files for programs in $spackage, indicate
7201 the appropriate directory here. To skip installing html files,
7205 ''|none|$undef|' ') dflt=none ;;
7206 *) dflt=$html1dir ;;
7209 rp="Directory for the main $spackage html pages?"
7213 : Use ' ' for none so value is preserved next time through Configure
7214 $test X"$html1dir" = "X" && html1dir=' '
7216 : determine where html pages for libraries and modules go
7217 set html3dir html3dir none
7221 If you wish to install html files for modules associated with $spackage,
7222 indicate the appropriate directory here. To skip installing html files,
7225 : There is no obvious default. If they have specified html1dir, then
7226 : try to key off that, possibly changing .../html1 into .../html3.
7228 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7229 *) dflt=$html3dir ;;
7232 rp="Directory for the $spackage module html pages?"
7236 : Use ' ' for none so value is preserved next time through Configure
7237 $test X"$html3dir" = "X" && html3dir=' '
7239 : determine whether to install perl also as /usr/bin/perl
7242 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7244 Many scripts expect perl to be installed as /usr/bin/perl.
7246 If you want to, I can install the perl you are about to compile
7247 as /usr/bin/perl (in addition to $bin/perl).
7249 if test -f /usr/bin/perl; then
7252 However, please note that because you already have a /usr/bin/perl,
7253 overwriting that with a new Perl would very probably cause problems.
7254 Therefore I'm assuming you don't want to do that (unless you insist).
7257 case "$installusrbinperl" in
7258 "$define"|[yY]*) dflt='y';;
7264 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7267 case "$installusrbinperl" in
7268 "$undef"|[nN]*) dflt='n';;
7272 rp="Do you want to install perl as /usr/bin/perl?"
7275 [yY]*) val="$define";;
7281 set installusrbinperl
7284 : Check if we are using the GNU C library
7286 echo "Checking for GNU C Library..." >&4
7288 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7289 alone are insufficient to distinguish different versions, such as
7290 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7291 libc version 2.1.0. A. Dougherty, June 3, 2002.
7297 # ifdef __GLIBC_MINOR__
7298 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7299 # include <gnu/libc-version.h>
7300 printf("%s\n", gnu_get_libc_version());
7302 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7305 printf("%d\n", __GLIBC__);
7314 if eval $compile_ok && $run ./try > glibc.ver; then
7316 gnulibc_version=`$cat glibc.ver`
7317 echo "You are using the GNU C Library version $gnulibc_version"
7321 echo "You are not using the GNU C Library"
7327 : see if nm is to be used to determine whether a symbol is defined or not
7331 case "$d_gnulibc" in
7334 echo "nm probably won't work on the GNU C Library." >&4
7340 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7342 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7343 echo "'nm' won't be sufficient on this sytem." >&4
7349 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7350 if $test $dflt -gt 20; then
7360 true|$define) dflt=y;;
7367 I can use $nm to extract the symbols from your C libraries. This
7368 is a time consuming task which may generate huge output on the disk (up
7369 to 3 megabytes) but that should make the symbols extraction faster. The
7370 alternative is to skip the 'nm' extraction part and to compile a small
7371 test program instead to determine whether each symbol is present. If
7372 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7373 this may be the best solution.
7375 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7378 rp="Shall I use $nm to extract C symbols from the libraries?"
7381 [Nn]*) usenm=false;;
7390 : nm options which may be necessary
7392 '') if $test -f /mach_boot; then
7394 elif $test -d /usr/ccs/lib; then
7395 nm_opt='-p' # Solaris (and SunOS?)
7396 elif $test -f /dgux; then
7398 elif $test -f /lib64/rld; then
7399 nm_opt='-p' # 64-bit Irix
7405 : nm options which may be necessary for shared libraries but illegal
7406 : for archive libraries. Thank you, Linux.
7407 case "$nm_so_opt" in
7408 '') case "$myuname" in
7410 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7411 nm_so_opt='--dynamic'
7418 : get list of predefined functions in a handy place
7425 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7431 *) for thislib in $libs; do
7434 : Handle C library specially below.
7437 thislib=`echo $thislib | $sed -e 's/^-l//'`
7438 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7440 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7442 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7444 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7446 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7448 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7450 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7455 libnames="$libnames $try"
7457 *) libnames="$libnames $thislib" ;;
7466 for xxx in $libpth; do
7467 $test -r $1 || set $xxx/libc.$so
7468 : The messy sed command sorts on library version numbers.
7470 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7471 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7473 s/[0-9][0-9]*/0000&/g
7474 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7477 $sort | $sed -e 's/^.* //'`
7480 $test -r $1 || set /usr/ccs/lib/libc.$so
7481 $test -r $1 || set /lib/libsys_s$_a
7487 if $test -r "$1"; then
7488 echo "Your (shared) C library seems to be in $1."
7490 elif $test -r /lib/libc && $test -r /lib/clib; then
7491 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7493 libc='/lib/clib /lib/libc'
7494 if $test -r /lib/syslib; then
7495 echo "(Your math library is in /lib/syslib.)"
7496 libc="$libc /lib/syslib"
7498 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7499 echo "Your C library seems to be in $libc, as you said before."
7500 elif $test -r $incpath/usr/lib/libc$_a; then
7501 libc=$incpath/usr/lib/libc$_a;
7502 echo "Your C library seems to be in $libc. That's fine."
7503 elif $test -r /lib/libc$_a; then
7505 echo "Your C library seems to be in $libc. You're normal."
7507 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7509 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7510 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7511 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7513 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7515 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7518 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7520 if $test -r "$tans"; then
7521 echo "Your C library seems to be in $tans, of all places."
7527 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7531 If the guess above is wrong (which it might be if you're using a strange
7532 compiler, or your machine supports multiple models), you can override it here.
7537 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7539 I can't seem to find your C library. I've looked in the following places:
7542 $sed 's/^/ /' libpath
7545 None of these seems to contain your C library. I need to get its name...
7550 rp='Where is your C library?'
7555 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7556 set X `cat libnames`
7559 case $# in 1) xxx=file; esac
7560 echo "Extracting names from the following $xxx for later perusal:" >&4
7562 $sed 's/^/ /' libnames >&4
7564 $echo $n "This may take a while...$c" >&4
7568 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7569 *) $nm $nm_opt $file 2>/dev/null;;
7574 $grep fprintf libc.tmp > libc.ptf
7575 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7576 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7578 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7580 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7582 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7584 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7586 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7588 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7590 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7592 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7594 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7596 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7598 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7600 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7602 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7603 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7605 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7607 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7611 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7615 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7619 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7623 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7627 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7631 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7636 $nm -p $* 2>/dev/null >libc.tmp
7637 $grep fprintf libc.tmp > libc.ptf
7638 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7639 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7645 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7647 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7648 for thisname in $libnames $libc; do
7649 $ar t $thisname >>libc.tmp
7651 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7653 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7654 # Repeat libc to extract forwarders to DLL entries too
7655 for thisname in $libnames $libc; do
7656 $ar tv $thisname >>libc.tmp
7657 # Revision 50 of EMX has bug in $ar.
7658 # it will not extract forwarders to DLL entries
7659 # Use emximp which will extract exactly them.
7660 emximp -o tmp.imp $thisname \
7662 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7663 < tmp.imp >>libc.tmp
7666 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7669 echo "$ar didn't seem to work right." >&4
7670 echo "Maybe this is a Cray...trying bld instead..." >&4
7671 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7673 for thisname in $libnames; do
7675 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7676 $ar t $thisname >>libc.tmp
7680 echo "That didn't work either. Giving up." >&4
7690 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7691 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7693 *) if $test -f /lib/syscalls.exp; then
7695 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7696 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7702 $rm -f libnames libpath
7704 : see if dld is available
7708 : Check if we are using C++
7710 echo "Checking for C++..." >&4
7711 $cat >try.c <<'EOCP'
7723 if eval $compile_ok && $run ./try; then
7725 echo "You are using a C++ compiler."
7728 echo "You are not using a C++ compiler."
7734 : is a C symbol defined?
7737 -v) tf=libc.tmp; tdc="";;
7738 -a) tf=libc.tmp; tdc="[]";;
7739 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7742 case "$reuseval-$4" in
7744 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7749 case "$d_cplusplus" in
7750 $define) extern_C=\"C\";;
7752 if $test "$runnm" = true; then
7753 if $contains $tlook $tf >/dev/null 2>&1; then
7755 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7756 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7757 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7758 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7762 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7763 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7769 $define) tval=true;;
7776 : define an is-in-libc? function
7777 inlibc='echo " "; td=$define; tu=$undef;
7778 sym=$1; var=$2; eval "was=\$$2";
7780 case "$reuseval$was" in
7790 echo "$sym() found." >&4;
7791 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7793 echo "$sym() NOT found." >&4;
7794 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7798 $define) echo "$sym() found." >&4;;
7799 *) echo "$sym() NOT found." >&4;;
7803 : see if dlopen exists
7805 xxx_ccflags="$ccflags"
7807 : with g++ one needs -shared to get is-in-libc to work for dlopen
7808 case "$gccversion" in
7810 *) case "$d_cplusplus" in
7811 "$define") ccflags="$ccflags -shared" ;;
7818 ccflags="$xxx_ccflags"
7820 : see if this is a unistd.h system
7821 set unistd.h i_unistd
7824 : determine which dynamic loading, if any, to compile in
7826 dldir="ext/DynaLoader"
7839 $define) dflt='y' ;;
7842 $define) dflt='y' ;;
7844 : Does a dl_xxx.xs file exist for this operating system
7845 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7848 rp="Do you wish to use dynamic loading?"
7855 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7856 dflt="$dldir/dl_${osname}.xs"
7857 elif $test "$d_dlopen" = "$define" ; then
7858 dflt="$dldir/dl_dlopen.xs"
7859 elif $test "$i_dld" = "$define" ; then
7860 dflt="$dldir/dl_dld.xs"
7865 *) dflt="$dldir/$dlsrc"
7868 echo "The following dynamic loading files are available:"
7869 : Can not go over to $dldir because getfile has path hard-coded in.
7870 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7871 rp="Source file to use for dynamic loading"
7877 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7881 Some systems may require passing special flags to $cc -c to
7882 compile modules that will be used to create a shared library.
7883 To use no flags, say "none".
7886 case "$cccdlflags" in
7887 '') case "$gccversion" in
7888 '') case "$osname" in
7890 next) dflt='none' ;;
7891 irix*) dflt='-KPIC' ;;
7892 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7893 sunos) dflt='-pic' ;;
7897 *) case "$osname" in
7898 darwin) dflt='none' ;;
7899 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7904 *) dflt="$cccdlflags" ;;
7906 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7909 none) cccdlflags=' ' ;;
7910 *) cccdlflags="$ans" ;;
7915 Some systems use ld to create libraries that can be dynamically loaded,
7916 while other systems (such as those using ELF) use $cc.
7920 '') $cat >try.c <<EOM
7921 /* Test for whether ELF binaries are produced */
7933 int i = open("a.out",O_RDONLY);
7936 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7937 exit(0); /* succeed (yes, it's ELF) */
7942 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7944 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7948 echo "I'll use ld to build dynamic libraries."
7957 rp="What command should be used to create dynamic libraries?"
7963 Some systems may require passing special flags to $ld to create a
7964 library that can be dynamically loaded. If your ld flags include
7965 -L/other/path options to locate libraries outside your loader's normal
7966 search path, you may need to specify those -L options here as well. To
7967 use no flags, say "none".
7970 case "$lddlflags" in
7971 '') case "$osname" in
7972 beos) dflt='-nostart' ;;
7974 case "$gccversion" in
7975 '') dflt="$dflt +vnocompatwarnings" ;;
7978 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7979 next) dflt='none' ;;
7980 solaris) dflt='-G' ;;
7981 sunos) dflt='-assert nodefinitions' ;;
7982 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7986 *) dflt="$lddlflags" ;;
7989 : Try to guess additional flags to pick up local libraries.
7990 : Be careful not to append to a plain 'none'
7994 for thisflag in $ldflags; do
7999 *) dflt="$dflt $thisflag" ;;
8006 ''|' ') dflt='none' ;;
8009 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8012 none) lddlflags=' ' ;;
8013 *) lddlflags="$ans" ;;
8018 Some systems may require passing special flags to $cc to indicate that
8019 the resulting executable will use dynamic linking. To use no flags,
8023 case "$ccdlflags" in
8024 '') case "$osname" in
8025 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8026 next|sunos) dflt='none' ;;
8030 *) dflt="$ccdlflags" ;;
8032 rp="Any special flags to pass to $cc to use dynamic linking?"
8035 none) ccdlflags=' ' ;;
8036 *) ccdlflags="$ans" ;;
8047 : Do we want a shared libperl?
8051 # No dynamic loading being used, so don't bother even to prompt.
8054 *) case "$useshrplib" in
8055 '') case "$osname" in
8056 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8058 also='Building a shared libperl is required for dynamic loading to work on your system.'
8063 also='Building a shared libperl is needed for MAB support.'
8081 The perl executable is normally obtained by linking perlmain.c with
8082 libperl${_a}, any static extensions (usually just DynaLoader), and
8083 any other libraries needed on this system (such as -lm, etc.). Since
8084 your system supports dynamic loading, it is probably possible to build
8085 a shared libperl.$so. If you will have more than one executable linked
8086 to libperl.$so, this will significantly reduce the size of each
8087 executable, but it may have a noticeable effect on performance. The
8088 default is probably sensible for your system.
8092 rp="Build a shared libperl.$so (y/n)"
8096 useshrplib='true' ;;
8097 *) useshrplib='false' ;;
8102 case "$useshrplib" in
8106 # Figure out a good name for libperl.so. Since it gets stored in
8107 # a version-specific architecture-dependent library, the version
8108 # number isn't really that important, except for making cc/ld happy.
8110 # A name such as libperl.so.3.1
8111 majmin="libperl.$so.$patchlevel.$subversion"
8112 # A name such as libperl.so.301
8113 majonly=`echo $patchlevel $subversion |
8114 $awk '{printf "%d%02d", $1, $2}'`
8115 majonly=libperl.$so.$majonly
8116 # I'd prefer to keep the os-specific stuff here to a minimum, and
8117 # rely on figuring it out from the naming of libc.
8118 case "${osname}${osvers}" in
8121 # XXX How handle the --version stuff for MAB?
8123 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8126 cygwin*) # ld links against an importlib
8127 dflt=libperl$lib_ext
8129 *) # Try to guess based on whether libc has major.minor.
8131 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8132 *libc.$so.[0-9]*) dflt=$majonly ;;
8133 *) dflt=libperl.$so ;;
8143 I need to select a good name for the shared libperl. If your system uses
8144 library names with major and minor numbers, then you might want something
8145 like $majmin. Alternatively, if your system uses a single version
8146 number for shared libraries, then you might want to use $majonly.
8147 Or, your system might be quite happy with a simple libperl.$so.
8149 Since the shared libperl will get installed into a version-specific
8150 architecture-dependent directory, the version number of the shared perl
8151 library probably isn't important, so the default should be o.k.
8154 rp='What name do you want to give to the shared libperl?'
8157 echo "Ok, I'll use $libperl"
8160 libperl="libperl${_a}"
8164 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8168 WARNING: Use of the shrpdir variable for the installation location of
8169 the shared $libperl is not supported. It was never documented and
8170 will not work in this version. Let me (perlbug@perl.org)
8171 know of any problems this may cause.
8177 But your current setting of $shrpdir is
8178 the default anyway, so it's harmless.
8183 Further, your current attempted setting of $shrpdir
8184 conflicts with the value of $archlibexp/CORE
8185 that installperl will use.
8192 # How will the perl executable find the installed shared $libperl?
8193 # Add $xxx to ccdlflags.
8194 # If we can't figure out a command-line option, use $shrpenv to
8195 # set env LD_RUN_PATH. The main perl makefile uses this.
8196 shrpdir=$archlibexp/CORE
8199 if "$useshrplib"; then
8202 # We'll set it in Makefile.SH...
8207 freebsd|netbsd|openbsd|interix|dragonfly)
8208 xxx="-Wl,-R$shrpdir"
8210 bsdos|linux|irix*|dec_osf|gnu*)
8211 xxx="-Wl,-rpath,$shrpdir"
8214 # next doesn't like the default...
8217 # beos doesn't like the default, either.
8220 # hpux doesn't like the default, either.
8221 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8224 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8230 # Only add $xxx if it isn't already in ccdlflags.
8231 case " $ccdlflags " in
8233 *) ccdlflags="$ccdlflags $xxx"
8236 Adding $xxx to the flags
8237 passed to $ld so that the perl executable will find the
8238 installed shared $libperl.
8246 # Fix ccdlflags in AIX for building external extensions.
8247 # (For building Perl itself bare -bE:perl.exp is needed,
8248 # Makefile.SH takes care of this.)
8250 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8252 # Respect a hint or command-line value.
8254 '') shrpenv="$tmp_shrpenv" ;;
8256 case "$ldlibpthname" in
8257 '') ldlibpthname=LD_LIBRARY_PATH ;;
8258 none) ldlibpthname='' ;;
8261 : determine where manual pages are on this system
8265 syspath='/usr/share/man/man1 /usr/man/man1'
8266 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8267 syspath="$syspath /usr/man/u_man/man1"
8268 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8269 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8270 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8271 sysman=`./loc . /usr/man/man1 $syspath`
8274 if $test -d "$sysman"; then
8275 echo "System manual is in $sysman." >&4
8277 echo "Could not find manual pages in source form." >&4
8280 : determine where manual pages go
8281 set man1dir man1dir none
8285 $spackage has manual pages available in source form.
8289 echo "However, you don't have nroff, so they're probably useless to you."
8291 '') man1dir="none";;
8294 echo "If you don't want the manual sources installed, answer 'none'."
8299 lookpath="$prefixexp/share/man/man1"
8300 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8301 lookpath="$lookpath $prefixexp/man/p_man/man1"
8302 lookpath="$lookpath $prefixexp/man/u_man/man1"
8303 lookpath="$lookpath $prefixexp/man/man.1"
8305 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8306 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8316 rp="Where do the main $spackage manual pages (source) go?"
8318 if $test "X$man1direxp" != "X$ansexp"; then
8329 : What suffix to use on installed man pages
8336 rp="What suffix should be used for the main $spackage man pages?"
8338 '') case "$man1dir" in
8352 *) dflt="$man1ext";;
8359 : see if we can have long filenames
8361 first=123456789abcdef
8363 if (echo hi >$first) 2>/dev/null; then
8364 if $test -f 123456789abcde; then
8365 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8368 echo 'You can have filenames longer than 14 characters.'>&4
8373 You can't have filenames longer than 14 chars.
8374 You can't even think about them!
8380 $rm -rf 123456789abcde*
8382 : determine where library module manual pages go
8383 set man3dir man3dir none
8387 $spackage has manual pages for many of the library modules.
8393 However, you don't have nroff, so they're probably useless to you.
8396 '') man3dir="none";;
8400 case "$d_flexfnam" in
8403 However, your system can't handle the long file names like File::Basename.3.
8406 '') man3dir="none";;
8410 echo "If you don't want the manual sources installed, answer 'none'."
8411 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8413 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8414 if $test -d "$privlib/man/man3"; then
8417 WARNING: Previous versions of perl installed man3 pages into
8418 $privlib/man/man3. This version will suggest a
8419 new default of $dflt.
8423 rp='Do you wish to preserve the old behavior?(y/n)'
8426 y*) dflt="$privlib/man/man3" ;;
8431 *) dflt="$man3dir" ;;
8438 rp="Where do the $package library man pages (source) go?"
8448 : What suffix to use on installed man pages
8454 rp="What suffix should be used for the $package library man pages?"
8456 '') case "$man3dir" in
8470 *) dflt="$man3ext";;
8477 : see if we have to deal with yellow pages, now NIS.
8478 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8479 if $test -f /usr/etc/nibindd; then
8481 echo "I'm fairly confident you're on a NeXT."
8483 rp='Do you get the hosts file via NetInfo?'
8492 y*) hostcat='nidump hosts .';;
8493 *) case "$hostcat" in
8494 nidump*) hostcat='';;
8504 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8512 rp='Are you getting the hosts file via yellow pages?'
8515 y*) hostcat='ypcat hosts';;
8516 *) hostcat='cat /etc/hosts';;
8522 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8525 '') test -f /etc/group && groupcat='cat /etc/group';;
8528 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8531 : now get the host name
8533 echo "Figuring out host name..." >&4
8534 case "$myhostname" in
8536 echo 'Maybe "hostname" will work...'
8537 if tans=`sh -c hostname 2>&1` ; then
8545 if $test "$cont"; then
8547 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8548 if tans=`cat /etc/systemid 2>&1` ; then
8550 phostname='cat /etc/systemid'
8551 echo "Whadyaknow. Xenix always was a bit strange..."
8554 elif $test -r /etc/systemid; then
8555 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8558 if $test "$cont"; then
8559 echo 'No, maybe "uuname -l" will work...'
8560 if tans=`sh -c 'uuname -l' 2>&1` ; then
8562 phostname='uuname -l'
8564 echo 'Strange. Maybe "uname -n" will work...'
8565 if tans=`sh -c 'uname -n' 2>&1` ; then
8567 phostname='uname -n'
8569 echo 'Oh well, maybe I can mine it out of whoami.h...'
8570 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8571 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8572 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8574 case "$myhostname" in
8575 '') echo "Does this machine have an identity crisis or something?"
8578 echo "Well, you said $myhostname before..."
8579 phostname='echo $myhostname';;
8585 case "$myhostname" in
8586 '') myhostname=noname ;;
8588 : you do not want to know about this
8593 if $test "$myhostname" ; then
8595 rp='Your host name appears to be "'$myhostname'".'" Right?"
8603 : bad guess or no guess
8604 while $test "X$myhostname" = X ; do
8606 rp="Please type the (one word) name of your host:"
8611 : translate upper to lower if necessary
8612 case "$myhostname" in
8614 echo "(Normalizing case in your host name)"
8615 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8619 case "$myhostname" in
8621 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8622 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8623 echo "(Trimming domain name from host name--host name is now $myhostname)"
8625 *) case "$mydomain" in
8628 test "X$hostcat" = "Xypcat hosts" &&
8629 ypmatch "$myhostname" hosts 2>/dev/null |\
8630 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8633 test "X$hostcat" != "X" &&
8634 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8635 /[ ]$myhostname[ . ]/p" > hosts
8638 if $test -f hosts; then
8639 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8640 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8641 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8642 hosts | $sort | $uniq | \
8643 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8644 case `$echo X$dflt` in
8645 X*\ *) echo "(Several hosts in the database matched hostname)"
8648 X.) echo "(You do not have fully-qualified names in the hosts database)"
8652 echo "(I cannot locate a hosts database anywhere)"
8657 tans=`./loc resolv.conf X /etc /usr/etc`
8658 if $test -f "$tans"; then
8659 echo "(Attempting domain name extraction from $tans)"
8660 dflt=.`$sed -n -e 's/ / /g' \
8661 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8662 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8664 .) dflt=.`$sed -n -e 's/ / /g' \
8665 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8666 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8673 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8674 dflt=.`sh -c domainname 2>/dev/null`
8677 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8681 case "$dflt$osname" in
8682 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8683 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8687 .) echo "(Lost all hope -- silly guess then)"
8693 *) dflt="$mydomain";;
8697 rp="What is your domain name?"
8707 : translate upper to lower if necessary
8710 echo "(Normalizing case in your domain name)"
8711 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8715 : a little sanity check here
8716 case "$phostname" in
8719 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8720 $myhostname$mydomain|$myhostname) ;;
8722 case "$phostname" in
8724 echo "(That doesn't agree with your whoami.h file, by the way.)"
8727 echo "(That doesn't agree with your $phostname command, by the way.)"
8735 : determine the e-mail address of the user who is running us
8738 I need to get your e-mail address in Internet format if possible, i.e.
8739 something like user@host.domain. Please answer accurately since I have
8740 no easy means to double check it. The default value provided below
8741 is most probably close to reality but may not be valid from outside
8742 your organization...
8746 while test "$cont"; do
8748 '') dflt="$cf_by@$myhostname$mydomain";;
8749 *) dflt="$cf_email";;
8751 rp='What is your e-mail address?'
8757 rp='Address does not look like an Internet one. Use it anyway?'
8771 : Ask e-mail of administrator
8774 If you or somebody else will be maintaining perl at your site, please
8775 fill in the correct e-mail address here so that they may be contacted
8776 if necessary. Currently, the "perlbug" program included with perl
8777 will send mail to this address in addition to perlbug@perl.org. You may
8778 enter "none" for no administrator.
8781 case "$perladmin" in
8782 '') dflt="$cf_email";;
8783 *) dflt="$perladmin";;
8785 rp='Perl administrator e-mail address'
8789 : determine whether to only install version-specific parts.
8792 Do you want to install only the version-specific parts of the perl
8793 distribution? Usually you do *not* want to do this.
8795 case "$versiononly" in
8796 "$define"|[Yy]*|true) dflt='y' ;;
8799 rp="Do you want to install only the version-specific parts of perl?"
8802 [yY]*) val="$define";;
8808 case "$versiononly" in
8809 "$define") inc_version_list=''
8810 inc_version_list_init=0
8814 : figure out how to guarantee perl startup
8815 : XXX Note that this currently takes advantage of the bug that binexp ignores
8816 : the Configure -Dinstallprefix setting, which in turn means that under
8817 : relocatable @INC, initialinstalllocation is what binexp started as.
8818 case "$startperl" in
8820 case "$sharpbang" in
8824 I can use the #! construct to start perl on your system. This will
8825 make startup of perl scripts faster, but may cause problems if you
8826 want to share those scripts and perl is not in a standard place
8827 ($initialinstalllocation/perl) on all your platforms. The alternative
8828 is to force a shell by starting the script with a single ':' character.
8831 case "$versiononly" in
8832 "$define") dflt="$initialinstalllocation/perl$version";;
8833 *) dflt="$initialinstalllocation/perl";;
8835 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8838 none) startperl=": # use perl";;
8839 *) startperl="#!$ans"
8840 if $test 30 -lt `echo "$ans" | wc -c`; then
8843 WARNING: Some systems limit the #! command to 32 characters.
8844 If you experience difficulty running Perl scripts with #!, try
8845 installing Perl in a directory with a shorter pathname.
8851 *) startperl=": # use perl"
8856 echo "I'll use $startperl to start perl scripts."
8858 : figure best path for perl in scripts
8861 case "$versiononly" in
8862 "$define") perlpath="$initialinstalllocation/perl$version";;
8863 *) perlpath="$initialinstalllocation/perl";;
8865 case "$startperl" in
8870 I will use the "eval 'exec'" idiom to start Perl on your system.
8871 I can use the full path of your Perl binary for this purpose, but
8872 doing so may cause problems if you want to share those scripts and
8873 Perl is not always in a standard place ($initialinstalllocation/perl).
8876 dflt="$initialinstalllocation/perl"
8877 rp="What path shall I use in \"eval 'exec'\"?"
8884 case "$startperl" in
8886 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8889 : determine where public executable scripts go
8890 set scriptdir scriptdir
8892 case "$scriptdir" in
8895 : guess some guesses
8896 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8897 $test -d /usr/share/bin && dflt=/usr/share/bin
8898 $test -d /usr/local/script && dflt=/usr/local/script
8899 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8900 $test -d $prefixexp/script && dflt=$prefixexp/script
8904 *) dflt="$scriptdir"
8909 Some installations have a separate directory just for executable scripts so
8910 that they can mount it across multiple architectures but keep the scripts in
8911 one spot. You might, for example, have a subdirectory of /usr/share for this.
8912 Or you might just lump your scripts in with all your other executables.
8916 rp='Where do you keep publicly executable scripts?'
8918 if $test "X$ansexp" != "X$scriptdirexp"; then
8924 : A little fix up for an irregularly named variable.
8925 installscript="$installscriptdir"
8927 : determine where add-on public executables go
8929 '') dflt=$siteprefix/bin ;;
8933 rp='Pathname where the add-on public executables should be installed?'
8938 : determine where add-on html pages go
8939 : There is no standard location, so try to copy the previously-selected
8940 : directory structure for the core html pages.
8941 case "$sitehtml1dir" in
8942 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8943 *) dflt=$sitehtml1dir ;;
8946 ''|' ') dflt=none ;;
8949 rp='Pathname where the site-specific html pages should be installed?'
8951 prefixvar=sitehtml1dir
8954 : determine where add-on library html pages go
8955 : There is no standard location, so try to copy the previously-selected
8956 : directory structure for the core html pages.
8957 case "$sitehtml3dir" in
8958 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8959 *) dflt=$sitehtml3dir ;;
8962 ''|' ') dflt=none ;;
8965 rp='Pathname where the site-specific library html pages should be installed?'
8967 prefixvar=sitehtml3dir
8970 : determine where add-on manual pages go
8971 case "$siteman1dir" in
8972 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8973 *) dflt=$siteman1dir ;;
8976 ''|' ') dflt=none ;;
8979 rp='Pathname where the site-specific manual pages should be installed?'
8981 prefixvar=siteman1dir
8984 : determine where add-on library man pages go
8985 case "$siteman3dir" in
8986 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8987 *) dflt=$siteman3dir ;;
8990 ''|' ') dflt=none ;;
8993 rp='Pathname where the site-specific library manual pages should be installed?'
8995 prefixvar=siteman3dir
8998 : determine where add-on public executable scripts go
8999 case "$sitescript" in
9000 '') dflt=$siteprefix/script
9001 $test -d $dflt || dflt=$sitebin ;;
9002 *) dflt="$sitescript" ;;
9005 rp='Pathname where add-on public executable scripts should be installed?'
9007 prefixvar=sitescript
9010 : Check if faststdio is requested and available
9011 case "$usefaststdio" in
9012 $define|true|[yY]*|'')
9013 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9023 Perl can be built to use 'fast stdio', which means using the stdio
9024 library but also directly manipulating the stdio buffers to enable
9025 faster I/O. Using stdio is better for backward compatibility (especially
9026 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9027 interface has been preferred instead of stdio.
9029 If this doesn't make any sense to you, just accept the default '$dflt'.
9031 rp='Use the "fast stdio" if available?'
9034 y|Y) val="$define" ;;
9041 : define an is-a-typedef? function
9042 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9044 "") inclist="sys/types.h";;
9046 eval "varval=\$$var";
9050 for inc in $inclist; do
9051 echo "#include <$inc>" >>temp.c;
9053 echo "#ifdef $type" >> temp.c;
9054 echo "printf(\"We have $type\");" >> temp.c;
9055 echo "#endif" >> temp.c;
9056 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9057 if $contains $type temp.E >/dev/null 2>&1; then
9063 *) eval "$var=\$varval";;
9066 : define an is-a-typedef? function that prompts if the type is not available.
9067 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9069 "") inclist="sys/types.h";;
9071 eval "varval=\$$var";
9075 for inc in $inclist; do
9076 echo "#include <$inc>" >>temp.c;
9078 echo "#ifdef $type" >> temp.c;
9079 echo "printf(\"We have $type\");" >> temp.c;
9080 echo "#endif" >> temp.c;
9081 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9083 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9084 if $contains $type temp.E >/dev/null 2>&1; then
9085 echo "$type found." >&4;
9088 echo "$type NOT found." >&4;
9094 *) eval "$var=\$varval";;
9097 : see what type lseek is declared as in the kernel
9098 rp="What is the type used for lseek's offset on this system?"
9099 set off_t lseektype long stdio.h sys/types.h
9103 echo "Checking to see how big your file offsets are..." >&4
9105 #include <sys/types.h>
9109 printf("%d\n", (int)sizeof($lseektype));
9114 if eval $compile_ok; then
9115 lseeksize=`$run ./try`
9116 echo "Your file offsets are $lseeksize bytes long."
9120 echo "(I can't seem to compile the test program. Guessing...)"
9121 rp="What is the size of your file offsets (in bytes)?"
9127 : see what type file positions are declared as in the library
9128 rp="What is the type for file position used by fsetpos()?"
9129 set fpos_t fpostype long stdio.h sys/types.h
9132 : Check size for Fpos_t
9135 *_t) zzz="$fpostype" ;;
9138 echo "Checking the size of $zzz..." >&4
9140 #include <sys/types.h>
9147 printf("%d\n", (int)sizeof($fpostype));
9152 if eval $compile_ok; then
9156 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9159 echo "Your $zzz is $fpossize bytes long."
9165 echo "(I can't compile the test program. Guessing...)" >&4
9166 rp="What is the size of your file positions (in bytes)?"
9171 : Check for large file support
9172 # Backward compatibility (uselfs is deprecated).
9174 "$define"|true|[yY]*)
9177 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9179 uselargefiles="$define"
9183 case "$lseeksize:$fpossize" in
9186 You can have files larger than 2 gigabytes.
9189 *) case "$uselargefiles" in
9190 "$undef"|false|[nN]*) dflt='n' ;;
9195 Perl can be built to understand large files (files larger than 2 gigabytes)
9196 on some systems. To do so, Configure can be run with -Duselargefiles.
9198 If this doesn't make any sense to you, just accept the default '$dflt'.
9200 rp='Try to understand large files, if available?'
9203 y|Y) val="$define" ;;
9210 : Look for a hint-file generated 'call-back-unit'. If the
9211 : user has specified that a large files perl is to be built,
9212 : we may need to set or change some other defaults.
9213 if $test -f uselargefiles.cbu; then
9214 echo "Your platform has some specific hints regarding large file builds, using them..."
9215 . ./uselargefiles.cbu
9217 case "$uselargefiles" in
9219 if $test -f uselargefiles.cbu; then
9221 echo "Rechecking to see how big your file offsets are..." >&4
9223 #include <sys/types.h>
9227 printf("%d\n", (int)sizeof($lseektype));
9232 if eval $compile_ok; then
9233 lseeksize=`$run ./try`
9234 $echo "Your file offsets are now $lseeksize bytes long."
9238 echo "(I can't seem to compile the test program. Guessing...)"
9239 rp="What is the size of your file offsets (in bytes)?"
9244 *_t) zzz="$fpostype" ;;
9247 $echo $n "Rechecking the size of $zzz...$c" >&4
9249 #include <sys/types.h>
9256 printf("%d\n", (int)sizeof($fpostype));
9261 if eval $compile_ok; then
9266 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9269 echo " $fpossize bytes." >&4
9275 echo "(I can't compile the test program. Guessing...)" >&4
9276 rp="What is the size of your file positions (in bytes)?"
9285 : Set the vendorbin variables
9286 case "$vendorprefix" in
9287 '') d_vendorbin="$undef"
9291 *) d_vendorbin="$define"
9292 : determine where vendor-supplied executables go.
9293 case "$vendorbin" in
9294 '') dflt=$vendorprefix/bin ;;
9295 *) dflt="$vendorbin" ;;
9298 rp='Pathname for the vendor-supplied executables directory?'
9301 vendorbinexp="$ansexp"
9307 : Set the vendorhtml1dir variables
9308 case "$vendorprefix" in
9309 '') vendorhtml1dir=''
9310 vendorhtml1direxp=''
9312 *) : determine where vendor-supplied html pages go.
9313 : There is no standard location, so try to copy the previously-selected
9314 : directory structure for the core html pages.
9315 : XXX Better default suggestions would be welcome.
9316 case "$vendorhtml1dir" in
9317 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9318 *) dflt=$vendorhtml1dir ;;
9321 ''|' ') dflt=none ;;
9324 rp='Pathname for the vendor-supplied html pages?'
9326 vendorhtml1dir="$ans"
9327 vendorhtml1direxp="$ansexp"
9330 : Use ' ' for none so value is preserved next time through Configure
9331 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9332 prefixvar=vendorhtml1dir
9335 : Set the vendorhtml3dir variables
9336 case "$vendorprefix" in
9337 '') vendorhtml3dir=''
9338 vendorhtml3direxp=''
9340 *) : determine where vendor-supplied module html pages go.
9341 : There is no standard location, so try to copy the previously-selected
9342 : directory structure for the core html pages.
9343 : XXX Better default suggestions would be welcome.
9344 case "$vendorhtml3dir" in
9345 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9346 *) dflt=$vendorhtml3dir ;;
9349 ''|' ') dflt=none ;;
9352 rp='Pathname for the vendor-supplied html pages?'
9354 vendorhtml3dir="$ans"
9355 vendorhtml3direxp="$ansexp"
9358 : Use ' ' for none so value is preserved next time through Configure
9359 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9360 prefixvar=vendorhtml3dir
9363 : Set the vendorman1dir variables
9364 case "$vendorprefix" in
9365 '') vendorman1dir=''
9368 *) : determine where vendor-supplied manual pages go.
9369 case "$vendorman1dir" in
9370 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9371 *) dflt=$vendorman1dir ;;
9374 ''|' ') dflt=none ;;
9377 rp='Pathname for the vendor-supplied manual section 1 pages?'
9379 vendorman1dir="$ans"
9380 vendorman1direxp="$ansexp"
9383 : Use ' ' for none so value is preserved next time through Configure
9384 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9385 prefixvar=vendorman1dir
9388 : Set the vendorman3dir variables
9389 case "$vendorprefix" in
9390 '') vendorman3dir=''
9393 *) : determine where vendor-supplied module manual pages go.
9394 case "$vendorman3dir" in
9395 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9396 *) dflt=$vendorman3dir ;;
9399 ''|' ') dflt=none ;;
9402 rp='Pathname for the vendor-supplied manual section 3 pages?'
9404 vendorman3dir="$ans"
9405 vendorman3direxp="$ansexp"
9408 : Use ' ' for none so value is preserved next time through Configure
9409 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9410 prefixvar=vendorman3dir
9413 : Set the vendorscript variables
9414 case "$vendorprefix" in
9415 '') d_vendorscript="$undef"
9419 *) d_vendorscript="$define"
9420 : determine where vendor-supplied scripts go.
9421 case "$vendorscript" in
9422 '') dflt=$vendorprefix/script
9423 $test -d $dflt || dflt=$vendorbin ;;
9424 *) dflt="$vendorscript" ;;
9428 The installation process will create a directory for
9429 vendor-supplied scripts.
9433 rp='Pathname for the vendor-supplied scripts directory?'
9436 vendorscriptexp="$ansexp"
9439 prefixvar=vendorscript
9442 : see if qgcvt exists
9446 : Check print/scan long double stuff
9449 if $test X"$d_longdbl" = X"$define"; then
9451 echo "Checking how to print long doubles..." >&4
9453 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9454 $cat >try.c <<'EOCP'
9455 #include <sys/types.h>
9459 printf("%.3f\n", d);
9463 if eval $compile; then
9467 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9468 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9469 echo "We will use %f."
9475 if $test X"$sPRIfldbl" = X; then
9476 $cat >try.c <<'EOCP'
9477 #include <sys/types.h>
9480 long double d = 123.456;
9481 printf("%.3Lf\n", d);
9485 if eval $compile; then
9489 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9490 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9491 echo "We will use %Lf."
9497 if $test X"$sPRIfldbl" = X; then
9498 $cat >try.c <<'EOCP'
9499 #include <sys/types.h>
9502 long double d = 123.456;
9503 printf("%.3llf\n", d);
9507 if eval $compile; then
9511 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9512 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9513 echo "We will use %llf."
9519 if $test X"$sPRIfldbl" = X; then
9520 $cat >try.c <<'EOCP'
9521 #include <sys/types.h>
9524 long double d = 123.456;
9525 printf("%.3lf\n", d);
9529 if eval $compile; then
9533 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9534 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9535 echo "We will use %lf."
9541 if $test X"$sPRIfldbl" = X; then
9542 echo "Cannot figure out how to print long doubles." >&4
9544 sSCNfldbl=$sPRIfldbl # expect consistency
9551 case "$sPRIfldbl" in
9552 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9553 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9554 d_SCNfldbl="$undef";
9556 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9557 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9558 d_SCNfldbl="$define";
9562 : Check how to convert floats to strings.
9564 if test "X$d_Gconvert" = X; then
9567 echo "Checking for an efficient way to convert floats to strings."
9569 case "$uselongdouble" in
9570 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9572 case "$d_longdbl" in
9573 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9575 case "$d_PRIgldbl" in
9576 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9580 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9581 char *myname = "gconvert";
9584 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9585 char *myname = "gcvt";
9588 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9589 char *myname = "qgcvt";
9590 #define DOUBLETYPE long double
9593 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9595 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9597 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9600 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9602 char *myname = "sprintf";
9606 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9607 #define DOUBLETYPE long double
9609 #define DOUBLETYPE double
9615 #define I_STDLIB $i_stdlib
9621 checkit(expect, got)
9625 if (strcmp(expect, got)) {
9626 printf("%s oddity: Expected %s, got %s\n",
9627 myname, expect, got);
9637 /* This must be 1st test on (which?) platform */
9638 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9639 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9640 checkit("0.1", buf);
9642 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9643 checkit("0.01", buf);
9645 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9646 checkit("0.001", buf);
9648 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9649 checkit("0.0001", buf);
9651 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9652 if (strlen(buf) > 5)
9653 checkit("9e-005", buf); /* for Microsoft ?? */
9655 checkit("9e-05", buf);
9657 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9660 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9661 checkit("1.1", buf);
9663 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9664 checkit("1.01", buf);
9666 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9667 checkit("1.001", buf);
9669 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9670 checkit("1.0001", buf);
9672 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9673 checkit("1.00001", buf);
9675 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9676 checkit("1.000001", buf);
9678 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9681 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9684 /* Some Linux gcvt's give 1.e+5 here. */
9685 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9686 checkit("100000", buf);
9688 /* Some Linux gcvt's give -1.e+5 here. */
9689 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9690 checkit("-100000", buf);
9692 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9693 checkit("123.456", buf);
9695 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9696 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9697 /* 34 should be enough to scare even long double
9698 * places into using the e notation. */
9699 if (strlen(buf) > 5)
9700 checkit("1e+034", buf); /* for Microsoft */
9702 checkit("1e+34", buf);
9704 /* For Perl, if you add additional tests here, also add them to
9705 * t/base/num.t for benefit of platforms not using Configure or
9706 * overriding d_Gconvert */
9711 : first add preferred functions to our list
9713 for xxx_convert in $gconvert_preference; do
9714 case $xxx_convert in
9715 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9716 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9719 : then add any others
9720 for xxx_convert in gconvert gcvt sprintf; do
9723 *) xxx_list="$xxx_list $xxx_convert" ;;
9727 case "$d_longdbl$uselongdouble" in
9729 : again, add prefered functions to our list first
9731 for xxx_convert in $gconvert_ld_preference; do
9732 case $xxx_convert in
9733 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9734 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9737 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9738 for xxx_convert in qgcvt sprintf $xxx_list; do
9739 case "$xxx_ld_list" in
9740 $xxx_convert*|*" $xxx_convert"*) ;;
9741 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9744 : if sprintf cannot do long doubles, move it to the end
9745 if test "$d_PRIgldbl" != "$define"; then
9746 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9748 : if no qgcvt, remove it
9749 if test "$d_qgcvt" != "$define"; then
9750 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9753 xxx_list="$xxx_ld_list"
9757 for xxx_convert in $xxx_list; do
9758 echo "Trying $xxx_convert..."
9759 $rm -f try try$_o core
9760 set try -DTRY_$xxx_convert
9761 if eval $compile; then
9762 echo "$xxx_convert() found." >&4
9764 echo "I'll use $xxx_convert to convert floats into a string." >&4
9767 echo "...But $xxx_convert didn't work as I expected."
9771 echo "$xxx_convert NOT found." >&4
9775 if test X$xxx_convert = X; then
9776 echo "*** WHOA THERE!!! ***" >&4
9777 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9781 case "$xxx_convert" in
9782 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9783 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9784 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9785 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9786 "$define$define$define")
9787 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9788 "$define$define$undef")
9789 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9790 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9798 : see if _fwalk exists
9802 : Initialize h_fcntl
9805 : Initialize h_sysfile
9808 : access call always available on UNIX
9812 : locate the flags for 'access()'
9816 $cat >access.c <<EOCP
9817 #include <sys/types.h>
9822 #include <sys/file.h>
9835 : check sys/file.h first, no particular reason here
9836 if $test `./findhdr sys/file.h` && \
9837 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9839 echo "<sys/file.h> defines the *_OK access constants." >&4
9840 elif $test `./findhdr fcntl.h` && \
9841 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9843 echo "<fcntl.h> defines the *_OK access constants." >&4
9844 elif $test `./findhdr unistd.h` && \
9845 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9846 echo "<unistd.h> defines the *_OK access constants." >&4
9848 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9854 : see if accessx exists
9855 set accessx d_accessx
9858 : see if aintl exists
9862 : see if alarm exists
9866 : see if POSIX threads are available
9867 set pthread.h i_pthread
9870 : define a fucntion to check prototypes
9871 $cat > protochk <<EOSH
9874 optimize="$optimize"
9876 prototype="$prototype"
9879 usethreads=$usethreads
9880 i_pthread=$i_pthread
9881 pthread_h_first=$pthread_h_first
9884 $cat >> protochk <<'EOSH'
9889 while test $# -ge 2; do
9891 $define) echo "#include <$2>" >> try.c ;;
9892 literal) echo "$2" >> try.c ;;
9894 # Extra magic for the benefit of systems that need pthread.h
9895 # to be included early to correctly detect threadsafe functions.
9896 # Such functions must guarantee themselves, though, that the usethreads
9897 # and i_pthread have been defined, before calling protochk.
9898 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9899 echo "#include <pthread.h>" >> try.c
9904 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9905 cat >> try.c <<'EOCP'
9906 #ifdef CAN_PROTOTYPE
9907 #define _(args) args
9912 echo "$foo" >> try.c
9913 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9914 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9922 : Define hasproto macro for Configure internal use
9923 hasproto='varname=$1; func=$2; shift; shift;
9924 while $test $# -ge 2; do
9926 $define) echo "#include <$2>";;
9930 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9931 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9932 echo "$func() prototype found.";
9935 echo "$func() prototype NOT found.";
9942 : see if sys/types.h has to be included
9943 set sys/types.h i_systypes
9946 : see if sys/select.h has to be included
9947 set sys/select.h i_sysselct
9950 : Define hasfield macro for Configure internal use
9951 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9952 while $test $# -ge 2; do
9954 $define) echo "#include <$2>";;
9958 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9960 if eval $compile; then
9969 : see if we should include time.h, sys/time.h, or both
9971 if test "X$timeincl" = X; then
9972 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9973 $echo $n "I'm now running the test program...$c"
9975 #include <sys/types.h>
9980 #ifdef SYSTIMEKERNEL
9983 #include <sys/time.h>
9986 #include <sys/select.h>
9999 struct timezone tzp;
10001 if (foo.tm_sec == foo.tm_sec)
10004 if (bar.tv_sec == bar.tv_sec)
10011 for s_timezone in '-DS_TIMEZONE' ''; do
10013 for s_timeval in '-DS_TIMEVAL' ''; do
10014 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10015 for i_time in '' '-DI_TIME'; do
10016 for i_systime in '-DI_SYSTIME' ''; do
10019 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10020 if eval $compile; then
10021 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10025 $echo $n "Succeeded with $flags$c"
10037 *SYSTIMEKERNEL*) i_systimek="$define"
10038 timeincl=`./findhdr sys/time.h`
10039 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10040 *) i_systimek="$undef";;
10043 *I_TIME*) i_time="$define"
10044 timeincl=`./findhdr time.h`" $timeincl"
10045 echo "We'll include <time.h>." >&4;;
10046 *) i_time="$undef";;
10049 *I_SYSTIME*) i_systime="$define"
10050 timeincl=`./findhdr sys/time.h`" $timeincl"
10051 echo "We'll include <sys/time.h>." >&4;;
10052 *) i_systime="$undef";;
10056 : see if struct tm knows about tm_zone
10057 case "$i_systime$i_time" in
10060 echo "Checking to see if your struct tm has tm_zone field..." >&4
10061 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10069 case "$d_tm_tm_zone" in
10070 "$define") echo "Yes, it does." ;;
10071 *) echo "No, it doesn't." ;;
10073 : see if struct tm knows about tm_gmtoff
10074 case "$i_systime$i_time" in
10077 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10078 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10086 case "$d_tm_tm_gmtoff" in
10087 "$define") echo "Yes, it does." ;;
10088 *) echo "No, it doesn't." ;;
10091 : see if asctime_r exists
10092 set asctime_r d_asctime_r
10094 case "$d_asctime_r" in
10096 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10097 case "$d_asctime_r_proto:$usethreads" in
10098 ":define") d_asctime_r_proto=define
10099 set d_asctime_r_proto asctime_r $hdrs
10103 case "$d_asctime_r_proto" in
10105 case "$asctime_r_proto" in
10106 ''|0) try='char* asctime_r(const struct tm*, char*);'
10107 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10109 case "$asctime_r_proto" in
10110 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10111 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10113 case "$asctime_r_proto" in
10114 ''|0) try='int asctime_r(const struct tm*, char*);'
10115 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10117 case "$asctime_r_proto" in
10118 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10119 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10121 case "$asctime_r_proto" in
10122 ''|0) d_asctime_r=undef
10124 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10125 * ) case "$asctime_r_proto" in
10126 REENTRANT_PROTO*) ;;
10127 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10129 echo "Prototype: $try" ;;
10132 *) case "$usethreads" in
10133 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10140 *) asctime_r_proto=0
10144 : see if atolf exists
10148 : see if atoll exists
10152 : Look for GCC-style attribute format
10153 case "$d_attribute_format" in
10156 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10157 $cat >attrib.c <<'EOCP'
10159 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10161 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10162 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10163 echo "Your C compiler doesn't support __attribute__((format))."
10166 echo "Your C compiler supports __attribute__((format))."
10170 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10174 *) val="$d_attribute_format" ;;
10176 set d_attribute_format
10180 : Look for GCC-style attribute format with null format allowed
10181 case "$d_printf_format_null" in
10182 '') case "$d_attribute_format" in
10185 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10186 $cat >attrib.c <<EOCP
10188 #$i_stdlib I_STDLIB
10190 #include <stdlib.h>
10192 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10193 int null_printf (char* pat,...) { return (int)pat; }
10194 int main () { exit(null_printf(NULL)); }
10196 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10197 : run the executable in case it produces a run-time warning
10198 if $run ./attrib >>attrib.out 2>&1; then
10199 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10200 echo "Your C compiler doesn't allow __printf__ format to be null."
10203 echo "Your C compiler allows __printf__ format to be null."
10207 echo "Your C compiler executable failed with __printf__ format null."
10211 echo "Your C compiler fails with __printf__ format null."
10218 *) val="$d_printf_format_null" ;;
10220 set d_printf_format_null
10224 : Look for GCC-style attribute malloc
10225 case "$d_attribute_malloc" in
10228 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10229 $cat >attrib.c <<'EOCP'
10231 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10233 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10234 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10235 echo "Your C compiler doesn't support __attribute__((malloc))."
10238 echo "Your C compiler supports __attribute__((malloc))."
10242 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10246 *) val="$d_attribute_malloc" ;;
10248 set d_attribute_malloc
10252 : Look for GCC-style attribute nonnull
10253 case "$d_attribute_nonnull" in
10256 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10257 $cat >attrib.c <<'EOCP'
10259 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10261 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10262 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10263 echo "Your C compiler doesn't support __attribute__((nonnull))."
10266 echo "Your C compiler supports __attribute__((nonnull))."
10270 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10274 *) val="$d_attribute_nonnull" ;;
10276 set d_attribute_nonnull
10280 : Look for GCC-style attribute noreturn
10281 case "$d_attribute_noreturn" in
10284 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10285 $cat >attrib.c <<'EOCP'
10287 void fall_over_dead( void ) __attribute__((noreturn));
10289 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10290 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10291 echo "Your C compiler doesn't support __attribute__((noreturn))."
10294 echo "Your C compiler supports __attribute__((noreturn))."
10298 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10302 *) val="$d_attribute_noreturn" ;;
10304 set d_attribute_noreturn
10308 : Look for GCC-style attribute pure
10309 case "$d_attribute_pure" in
10312 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10313 $cat >attrib.c <<'EOCP'
10315 int square( int n ) __attribute__((pure));
10317 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10318 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10319 echo "Your C compiler doesn't support __attribute__((pure))."
10322 echo "Your C compiler supports __attribute__((pure))."
10326 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10330 *) val="$d_attribute_pure" ;;
10332 set d_attribute_pure
10336 : Look for GCC-style attribute unused
10337 case "$d_attribute_unused" in
10340 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10341 $cat >attrib.c <<'EOCP'
10343 int do_something( int dummy __attribute__((unused)), int n );
10345 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10346 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10347 echo "Your C compiler doesn't support __attribute__((unused))."
10350 echo "Your C compiler supports __attribute__((unused))."
10354 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10358 *) val="$d_attribute_unused" ;;
10360 set d_attribute_unused
10364 : Look for GCC-style attribute warn_unused_result
10365 case "$d_attribute_warn_unused_result" in
10368 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10369 $cat >attrib.c <<'EOCP'
10371 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10373 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10374 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10375 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10378 echo "Your C compiler supports __attribute__((warn_unused_result))."
10382 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10386 *) val="$d_attribute_warn_unused_result" ;;
10388 set d_attribute_warn_unused_result
10392 : see if bcmp exists
10396 : see if bcopy exists
10400 : see if getpgrp exists
10401 set getpgrp d_getpgrp
10404 case "$d_getpgrp" in
10407 echo "Checking to see which flavor of getpgrp is in use..."
10409 #$i_unistd I_UNISTD
10410 #include <sys/types.h>
10412 # include <unistd.h>
10414 #$i_stdlib I_STDLIB
10416 #include <stdlib.h>
10420 if (getuid() == 0) {
10421 printf("(I see you are running Configure as super-user...)\n");
10424 #ifdef TRY_BSD_PGRP
10425 if (getpgrp(1) == 0)
10434 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10435 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10437 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10438 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10441 echo "I can't seem to compile and run the test program."
10443 xxx="a USG one, i.e. you use getpgrp()."
10445 # SVR4 systems can appear rather BSD-ish.
10446 case "$i_unistd" in
10448 xxx="a BSD one, i.e. you use getpgrp(pid)."
10452 xxx="probably a USG one, i.e. you use getpgrp()."
10457 echo "Assuming your getpgrp is $xxx" >&4
10466 : see if setpgrp exists
10467 set setpgrp d_setpgrp
10470 case "$d_setpgrp" in
10473 echo "Checking to see which flavor of setpgrp is in use..."
10475 #$i_unistd I_UNISTD
10476 #include <sys/types.h>
10478 # include <unistd.h>
10480 #$i_stdlib I_STDLIB
10482 #include <stdlib.h>
10486 if (getuid() == 0) {
10487 printf("(I see you are running Configure as super-user...)\n");
10490 #ifdef TRY_BSD_PGRP
10491 if (-1 == setpgrp(1, 1))
10494 if (setpgrp() != -1)
10500 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10501 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10503 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10504 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10507 echo "(I can't seem to compile and run the test program.)"
10509 xxx="a USG one, i.e. you use setpgrp()."
10511 # SVR4 systems can appear rather BSD-ish.
10512 case "$i_unistd" in
10514 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10518 xxx="probably a USG one, i.e. you use setpgrp()."
10523 echo "Assuming your setpgrp is $xxx" >&4
10532 : Look for GCC-style __builtin_choose_expr
10533 case "$d_builtin_choose_expr" in
10536 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10537 $cat >try.c <<'EOCP'
10538 #include <assert.h>
10539 #include <stdlib.h>
10542 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10545 assert( SYRINX(1) == 2112 );
10546 assert( SYRINX(1) != 5150 );
10547 assert( SYRINX(0) == 5150 );
10548 assert( SYRINX(0) != 2112 );
10549 puts( "All good!" );
10555 if eval $compile; then
10556 echo "Your C compiler supports __builtin_choose_expr."
10559 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10563 *) val="$d_builtin_choose_expr" ;;
10566 set d_builtin_choose_expr
10570 : Look for GCC-style __builtin_expect
10571 case "$d_builtin_expect" in
10574 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10575 $cat >builtin.c <<'EOCP'
10578 if ( __builtin_expect(n, 0) ) n = 1;
10582 if eval $compile; then
10583 echo "Your C compiler supports __builtin_choose_expr."
10586 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10590 *) val="$d_builtin_expect" ;;
10593 set d_builtin_expect
10597 : see if bzero exists
10601 : see if stdarg is available
10603 if $test `./findhdr stdarg.h`; then
10604 echo "<stdarg.h> found." >&4
10607 echo "<stdarg.h> NOT found." >&4
10611 : see if varags is available
10613 if $test `./findhdr varargs.h`; then
10614 echo "<varargs.h> found." >&4
10616 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10619 : set up the varargs testing programs
10620 $cat > varargs.c <<EOP
10622 #include <stdarg.h>
10625 #include <varargs.h>
10629 int f(char *p, ...)
10643 p = va_arg(ap, char *);
10649 $cat > varargs <<EOP
10651 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10660 : now check which varargs header should be included
10665 if `./varargs I_STDARG`; then
10667 elif `./varargs I_VARARGS`; then
10672 if `./varargs I_VARARGS`; then
10679 echo "I could not find the definition for va_dcl... You have problems..." >&4
10680 val="$undef"; set i_stdarg; eval $setvar
10681 val="$undef"; set i_varargs; eval $setvar
10686 case "$i_varhdr" in
10688 val="$define"; set i_stdarg; eval $setvar
10689 val="$undef"; set i_varargs; eval $setvar
10692 val="$undef"; set i_stdarg; eval $setvar
10693 val="$define"; set i_varargs; eval $setvar
10696 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10700 : see if the Compiler supports C99 variadic macros
10701 case "$i_stdarg$i_stdlib" in
10703 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10706 #include <stdarg.h>
10708 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10712 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10718 if eval $compile && $run ./try 2>&1 >/dev/null; then
10719 case "`$run ./try`" in
10721 echo "You have C99 variadic macros." >&4
10722 d_c99_variadic_macros="$define"
10725 echo "You don't have functional C99 variadic macros." >&4
10726 d_c99_variadic_macros="$undef"
10730 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10731 d_c99_variadic_macros="$undef"
10736 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10737 d_c99_variadic_macros="$undef"
10741 : see if signal is declared as pointer to function returning int or void
10743 xxx=`./findhdr signal.h`
10744 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10745 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10746 echo "You have int (*signal())() instead of void." >&4
10748 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10749 echo "You have void (*signal())()." >&4
10751 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10752 echo "You have int (*signal())() instead of void." >&4
10754 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10755 echo "You have void (*signal())()." >&4
10758 case "$d_voidsig" in
10760 echo "I can't determine whether signal handler returns void or int..." >&4
10762 rp="What type does your signal handler return?"
10765 v*) val="$define";;
10769 echo "As you already told me, signal handler returns void." >&4
10772 *) echo "As you already told me, signal handler returns int." >&4
10779 case "$d_voidsig" in
10780 "$define") signal_t="void";;
10781 *) signal_t="int";;
10785 : check for ability to cast large floats to 32-bit ints.
10787 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10788 if $test "$intsize" -ge 4; then
10795 #$i_stdlib I_STDLIB
10797 #include <stdlib.h>
10799 #include <sys/types.h>
10800 #include <signal.h>
10801 $signal_t blech(int s) { exit(3); }
10808 signal(SIGFPE, blech);
10810 /* Don't let compiler optimize the test away. Store the number
10811 in a writable string for gcc to pass to sscanf under HP/UX.
10813 sprintf(str, "2147483647");
10814 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10818 /* x86 processors will probably give 0x8000 0000, which is a
10819 sign change. We don't want that. We want to mimic SPARC
10820 behavior here, which is to preserve the sign and give
10823 if (i32 != ($xxx) f)
10829 if eval $compile_ok; then
10833 echo "(I can't seem to compile the test program--assuming it can't)"
10838 echo "Yup, it can."
10841 echo "Nope, it can't."
10848 : check for ability to cast negative floats to unsigned
10850 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10853 #$i_stdlib I_STDLIB
10855 #include <stdlib.h>
10857 #include <sys/types.h>
10858 #include <signal.h>
10859 $signal_t blech(int s) { exit(7); }
10860 $signal_t blech_in_list(int s) { exit(4); }
10861 unsigned long dummy_long(unsigned long p) { return p; }
10862 unsigned int dummy_int(unsigned int p) { return p; }
10863 unsigned short dummy_short(unsigned short p) { return p; }
10867 unsigned long along;
10869 unsigned short ashort;
10873 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10874 a direct f = -123. assignment. gcc-2.8.0 reportedly
10875 optimized the whole file away
10877 /* Store the number in a writable string for gcc to pass to
10878 sscanf under HP/UX.
10880 sprintf(str, "-123");
10881 sscanf(str, "%lf", &f); /* f = -123.; */
10883 signal(SIGFPE, blech);
10884 along = (unsigned long)f;
10885 aint = (unsigned int)f;
10886 ashort = (unsigned short)f;
10887 if (along != (unsigned long)-123)
10889 if (aint != (unsigned int)-123)
10891 if (ashort != (unsigned short)-123)
10893 sprintf(str, "1073741824.");
10894 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10897 along = (unsigned long)f;
10898 if (along != 0x80000000)
10902 along = (unsigned long)f;
10903 if (along != 0x7fffffff)
10907 along = (unsigned long)f;
10908 if (along != 0x80000001)
10912 signal(SIGFPE, blech_in_list);
10913 sprintf(str, "123.");
10914 sscanf(str, "%lf", &f); /* f = 123.; */
10915 along = dummy_long((unsigned long)f);
10916 aint = dummy_int((unsigned int)f);
10917 ashort = dummy_short((unsigned short)f);
10918 if (along != (unsigned long)123)
10920 if (aint != (unsigned int)123)
10922 if (ashort != (unsigned short)123)
10929 if eval $compile_ok; then
10933 echo "(I can't seem to compile the test program--assuming it can't)"
10936 case "$castflags" in
10938 echo "Yup, it can."
10941 echo "Nope, it can't."
10948 : see if vprintf exists
10950 if set vprintf val -f d_vprintf; eval $csym; $val; then
10951 echo 'vprintf() found.' >&4
10954 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10955 #$i_varargs I_VARARGS
10957 #$i_stdlib I_STDLIB
10958 #$i_unistd I_UNISTD
10961 # include <stdarg.h>
10962 #else /* I_VARARGS */
10963 # include <varargs.h>
10967 # include <unistd.h>
10971 # include <stdlib.h>
10974 #include <stdio.h> /* vsprintf prototype */
10977 void xxx(int n, ...)
10982 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10984 int main() { xxx(1, "foo"); }
10986 #else /* I_VARARGS */
10994 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10996 int main() { xxx("foo"); }
11002 if eval $compile_ok; then
11003 if $run ./try; then
11004 echo "Your vsprintf() returns (int)." >&4
11007 echo "Your vsprintf() returns (char*)." >&4
11011 echo 'I am unable to compile the vsprintf() test program.' >&4
11012 # We shouldn't get here. If we do, assume the standard signature,
11013 # not the old BSD one.
11014 echo 'Guessing that vsprintf() returns (int).' >&4
11018 echo 'vprintf() NOT found.' >&4
11029 : see if chown exists
11033 : see if chroot exists
11034 set chroot d_chroot
11037 : see if chsize exists
11038 set chsize d_chsize
11041 : see if class exists
11045 : see if clearenv exists
11046 set clearenv d_clearenv
11049 : Define hasstruct macro for Configure internal use
11050 hasstruct='varname=$1; struct=$2; shift; shift;
11051 while $test $# -ge 2; do
11053 $define) echo "#include <$2>";;
11057 echo "int main () { struct $struct foo; }" >> try.c;
11059 if eval $compile; then
11068 : see whether socket exists
11072 $echo $n "Hmm... $c" >&4
11073 if set socket val -f d_socket; eval $csym; $val; then
11074 echo "Looks like you have Berkeley networking support." >&4
11076 if set setsockopt val -f; eval $csym; $val; then
11079 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11080 d_oldsock="$define"
11083 if $contains socklib libc.list >/dev/null 2>&1; then
11084 echo "Looks like you have Berkeley networking support." >&4
11086 : we will have to assume that it supports the 4.2 BSD interface
11089 echo "You don't have Berkeley networking in libc$_a..." >&4
11090 if test "X$d_socket" = "X$define"; then
11091 echo "...but you seem to believe that you have sockets." >&4
11093 for net in net socket
11095 if test -f /usr/lib/lib$net$_a; then
11096 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11097 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11098 if $contains socket libc.list >/dev/null 2>&1; then
11103 echo "...but the Wollongong group seems to have hacked it in." >&4
11104 sockethdr="-I/usr/netinclude"
11107 echo "Found Berkeley sockets interface in lib$net." >&4
11108 if $contains setsockopt libc.list >/dev/null 2>&1; then
11111 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11112 d_oldsock="$define"
11118 if test "X$d_socket" != "X$define"; then
11119 echo "or anywhere else I see." >&4
11127 : see if socketpair exists
11128 set socketpair d_sockpair
11133 echo "Checking the availability of certain socket constants..." >&4
11134 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11135 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11137 #include <sys/types.h>
11138 #include <sys/socket.h>
11144 set try; if eval $compile; then
11147 set d_${enum}; eval $setvar
11151 : see if this is a sys/uio.h system
11152 set sys/uio.h i_sysuio
11155 : Check for cmsghdr support
11157 echo "Checking to see if your system supports struct cmsghdr..." >&4
11158 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11160 case "$d_cmsghdr_s" in
11161 "$define") echo "Yes, it does." ;;
11162 *) echo "No, it doesn't." ;;
11166 : check for const keyword
11168 echo 'Checking to see if your C compiler knows about "const"...' >&4
11169 $cat >const.c <<'EOCP'
11170 typedef struct spug { int drokk; } spug;
11174 const spug y = { 0 };
11177 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11179 echo "Yup, it does."
11182 echo "Nope, it doesn't."
11187 : see if copysignl exists
11188 set copysignl d_copysignl
11191 : see if crypt exists
11196 $define) cryptlib='' ;;
11197 *) if set crypt val -f d_crypt; eval $csym; $val; then
11198 echo 'crypt() found.' >&4
11202 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11203 if $test -z "$cryptlib"; then
11204 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11208 if $test -z "$cryptlib"; then
11209 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11213 if $test -z "$cryptlib"; then
11214 cryptlib=`./loc libcrypt$_a "" $libpth`
11218 if $test -z "$cryptlib"; then
11219 echo 'crypt() NOT found.' >&4
11230 : see if this is a crypt.h system
11231 set crypt.h i_crypt
11234 : see if crypt_r exists
11235 set crypt_r d_crypt_r
11237 case "$d_crypt_r" in
11239 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11240 case "$d_crypt_r_proto:$usethreads" in
11241 ":define") d_crypt_r_proto=define
11242 set d_crypt_r_proto crypt_r $hdrs
11246 case "$d_crypt_r_proto" in
11248 case "$crypt_r_proto" in
11249 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11250 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11252 case "$crypt_r_proto" in
11253 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11254 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11256 case "$crypt_r_proto" in
11257 ''|0) d_crypt_r=undef
11259 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11260 * ) case "$crypt_r_proto" in
11261 REENTRANT_PROTO*) ;;
11262 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11264 echo "Prototype: $try" ;;
11267 *) case "$usethreads" in
11268 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11279 : get csh whereabouts
11281 'csh') val="$undef" ;;
11282 *) val="$define" ;;
11286 : Respect a hint or command line value for full_csh.
11287 case "$full_csh" in
11288 '') full_csh=$csh ;;
11291 : see if ctermid exists
11292 set ctermid d_ctermid
11295 : see if ctermid_r exists
11296 set ctermid_r d_ctermid_r
11298 case "$d_ctermid_r" in
11300 hdrs="$i_systypes sys/types.h define stdio.h "
11301 case "$d_ctermid_r_proto:$usethreads" in
11302 ":define") d_ctermid_r_proto=define
11303 set d_ctermid_r_proto ctermid_r $hdrs
11307 case "$d_ctermid_r_proto" in
11309 case "$ctermid_r_proto" in
11310 ''|0) try='char* ctermid_r(char*);'
11311 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11313 case "$ctermid_r_proto" in
11314 ''|0) d_ctermid_r=undef
11316 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11317 * ) case "$ctermid_r_proto" in
11318 REENTRANT_PROTO*) ;;
11319 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11321 echo "Prototype: $try" ;;
11324 *) case "$usethreads" in
11325 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11332 *) ctermid_r_proto=0
11336 : see if ctime_r exists
11337 set ctime_r d_ctime_r
11339 case "$d_ctime_r" in
11341 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11342 case "$d_ctime_r_proto:$usethreads" in
11343 ":define") d_ctime_r_proto=define
11344 set d_ctime_r_proto ctime_r $hdrs
11348 case "$d_ctime_r_proto" in
11350 case "$ctime_r_proto" in
11351 ''|0) try='char* ctime_r(const time_t*, char*);'
11352 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11354 case "$ctime_r_proto" in
11355 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11356 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11358 case "$ctime_r_proto" in
11359 ''|0) try='int ctime_r(const time_t*, char*);'
11360 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11362 case "$ctime_r_proto" in
11363 ''|0) try='int ctime_r(const time_t*, char*, int);'
11364 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11366 case "$ctime_r_proto" in
11367 ''|0) d_ctime_r=undef
11369 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11370 * ) case "$ctime_r_proto" in
11371 REENTRANT_PROTO*) ;;
11372 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11374 echo "Prototype: $try" ;;
11377 *) case "$usethreads" in
11378 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11389 : see if cuserid exists
11390 set cuserid d_cuserid
11393 : see if this is a limits.h system
11394 set limits.h i_limits
11397 : see if this is a float.h system
11398 set float.h i_float
11401 : See if number of significant digits in a double precision number is known
11403 $cat >dbl_dig.c <<EOM
11404 #$i_limits I_LIMITS
11407 #include <limits.h>
11413 printf("Contains DBL_DIG");
11416 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11417 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11418 echo "DBL_DIG found." >&4
11421 echo "DBL_DIG NOT found." >&4
11428 : see if dbm.h is available
11429 : see if dbmclose exists
11430 set dbmclose d_dbmclose
11433 case "$d_dbmclose" in
11443 *) set rpcsvc/dbm.h i_rpcsvcdbm
11448 *) echo "We won't be including <dbm.h>"
11458 : see if prototype for dbminit is available
11460 set d_dbminitproto dbminit $i_dbm dbm.h
11463 : see if difftime exists
11464 set difftime d_difftime
11467 : see if this is a dirent system
11469 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11471 echo "<dirent.h> found." >&4
11474 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11475 echo "<sys/dir.h> found." >&4
11478 xinc=`./findhdr sys/ndir.h`
11480 echo "<dirent.h> NOT found." >&4
11485 : Look for type of directory structure.
11487 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11489 case "$direntrytype" in
11491 case "$i_dirent" in
11492 $define) guess1='struct dirent' ;;
11493 *) guess1='struct direct' ;;
11496 *) guess1="$direntrytype"
11501 'struct dirent') guess2='struct direct' ;;
11502 *) guess2='struct dirent' ;;
11505 if $contains "$guess1" try.c >/dev/null 2>&1; then
11506 direntrytype="$guess1"
11507 echo "Your directory entries are $direntrytype." >&4
11508 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11509 direntrytype="$guess2"
11510 echo "Your directory entries seem to be $direntrytype." >&4
11512 echo "I don't recognize your system's directory entries." >&4
11513 rp="What type is used for directory entries on this system?"
11516 direntrytype="$ans"
11520 : see if the directory entry stores field length
11522 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11523 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11524 echo "Good, your directory entry keeps length information in d_namlen." >&4
11527 echo "Your directory entry does not know about the d_namlen field." >&4
11534 : Look for DIR.dd_fd
11535 case "$i_dirent" in
11537 echo "Checking to see if DIR has a dd_fd member variable" >&4
11539 #$i_stdlib I_STDLIB
11541 #include <stdlib.h>
11543 #include <dirent.h>
11553 if eval $compile; then
11554 echo "Yes, it does."
11557 echo "No, it does not."
11562 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11570 : see if this is an sysdir system
11571 set sys/dir.h i_sysdir
11574 : see if this is an sysndir system
11575 set sys/ndir.h i_sysndir
11580 $cat >dirfd.c <<EOM
11582 #$i_stdlib I_STDLIB
11584 #include <stdlib.h>
11586 #$i_dirent I_DIRENT /**/
11587 #$i_sysdir I_SYS_DIR /**/
11588 #$i_sysndir I_SYS_NDIR /**/
11589 #$i_systypes I_SYS_TYPES /**/
11590 #if defined(I_SYS_TYPES)
11591 #include <sys/types.h>
11593 #if defined(I_DIRENT)
11594 #include <dirent.h>
11595 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11596 #include <sys/dir.h>
11600 #include <sys/ndir.h>
11604 #include <ndir.h> /* may be wrong in the future */
11606 #include <sys/dir.h>
11612 DIR *dirp = opendir(".");
11613 if (dirfd(dirp) >= 0)
11621 if eval $compile; then
11625 $define) echo "dirfd() found." >&4 ;;
11626 *) echo "dirfd() NOT found." >&4 ;;
11632 : see if dlerror exists
11635 set dlerror d_dlerror
11639 : see if dlfcn is available
11640 set dlfcn.h i_dlfcn
11643 : Check what extension to use for shared libs
11648 On a few systems, the dynamically loaded modules that perl generates and uses
11649 will need a different extension than shared libs. The default will probably
11655 *) dflt="$dlext" ;;
11657 rp='What is the extension of dynamically loaded modules'
11666 : Check if dlsym need a leading underscore
11672 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11673 $cat >dyna.c <<'EOM'
11680 #$i_stdlib I_STDLIB
11682 #include <stdlib.h>
11686 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11688 #include <sys/types.h>
11693 extern int fred() ;
11702 int mode = RTLD_LAZY ;
11704 handle = dlopen("./dyna.$dlext", mode) ;
11705 if (handle == NULL) {
11710 symbol = dlsym(handle, "fred") ;
11711 if (symbol == NULL) {
11712 /* try putting a leading underscore */
11713 symbol = dlsym(handle, "_fred") ;
11714 if (symbol == NULL) {
11727 : Call the object file tmp-dyna.o in case dlext=o.
11728 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11729 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11730 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11731 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11734 1) echo "Test program failed using dlopen." >&4
11735 echo "Perhaps you should not use dynamic loading." >&4;;
11736 2) echo "Test program failed using dlsym." >&4
11737 echo "Perhaps you should not use dynamic loading." >&4;;
11738 3) echo "dlsym needs a leading underscore" >&4
11740 4) echo "dlsym doesn't need a leading underscore." >&4;;
11743 echo "I can't compile and run the test program." >&4
11744 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11749 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11754 : see if drand48_r exists
11755 set drand48_r d_drand48_r
11757 case "$d_drand48_r" in
11759 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11760 case "$d_drand48_r_proto:$usethreads" in
11761 ":define") d_drand48_r_proto=define
11762 set d_drand48_r_proto drand48_r $hdrs
11766 case "$d_drand48_r_proto" in
11768 case "$drand48_r_proto" in
11769 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11770 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11772 case "$drand48_r_proto" in
11773 ''|0) d_drand48_r=undef
11775 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11776 * ) case "$drand48_r_proto" in
11777 REENTRANT_PROTO*) ;;
11778 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11780 echo "Prototype: $try" ;;
11783 *) case "$usethreads" in
11784 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11791 *) drand48_r_proto=0
11795 : see if prototype for drand48 is available
11797 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11800 : see if dup2 exists
11804 : see if eaccess exists
11805 set eaccess d_eaccess
11808 : see if endgrent exists
11809 set endgrent d_endgrent
11812 : see if this is an grp system
11818 xxx=`./findhdr grp.h`
11819 $cppstdin $cppflags $cppminus < $xxx >$$.h
11821 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11833 set d_grpasswd; eval $setvar
11837 : see if endgrent_r exists
11838 set endgrent_r d_endgrent_r
11840 case "$d_endgrent_r" in
11842 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11843 case "$d_endgrent_r_proto:$usethreads" in
11844 ":define") d_endgrent_r_proto=define
11845 set d_endgrent_r_proto endgrent_r $hdrs
11849 case "$d_endgrent_r_proto" in
11851 case "$endgrent_r_proto" in
11852 ''|0) try='int endgrent_r(FILE**);'
11853 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11855 case "$endgrent_r_proto" in
11856 ''|0) try='void endgrent_r(FILE**);'
11857 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11859 case "$endgrent_r_proto" in
11860 ''|0) d_endgrent_r=undef
11862 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11863 * ) case "$endgrent_r_proto" in
11864 REENTRANT_PROTO*) ;;
11865 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11867 echo "Prototype: $try" ;;
11870 *) case "$usethreads" in
11871 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11878 *) endgrent_r_proto=0
11882 : see if endhostent exists
11883 set endhostent d_endhent
11886 : see if this is a netdb.h system
11887 set netdb.h i_netdb
11890 : see if endhostent_r exists
11891 set endhostent_r d_endhostent_r
11893 case "$d_endhostent_r" in
11895 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11896 case "$d_endhostent_r_proto:$usethreads" in
11897 ":define") d_endhostent_r_proto=define
11898 set d_endhostent_r_proto endhostent_r $hdrs
11902 case "$d_endhostent_r_proto" in
11904 case "$endhostent_r_proto" in
11905 ''|0) try='int endhostent_r(struct hostent_data*);'
11906 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11908 case "$endhostent_r_proto" in
11909 ''|0) try='void endhostent_r(struct hostent_data*);'
11910 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11912 case "$endhostent_r_proto" in
11913 ''|0) d_endhostent_r=undef
11914 endhostent_r_proto=0
11915 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11916 * ) case "$endhostent_r_proto" in
11917 REENTRANT_PROTO*) ;;
11918 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11920 echo "Prototype: $try" ;;
11923 *) case "$usethreads" in
11924 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11926 d_endhostent_r=undef
11927 endhostent_r_proto=0
11931 *) endhostent_r_proto=0
11935 : see if endnetent exists
11936 set endnetent d_endnent
11939 : see if endnetent_r exists
11940 set endnetent_r d_endnetent_r
11942 case "$d_endnetent_r" in
11944 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11945 case "$d_endnetent_r_proto:$usethreads" in
11946 ":define") d_endnetent_r_proto=define
11947 set d_endnetent_r_proto endnetent_r $hdrs
11951 case "$d_endnetent_r_proto" in
11953 case "$endnetent_r_proto" in
11954 ''|0) try='int endnetent_r(struct netent_data*);'
11955 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11957 case "$endnetent_r_proto" in
11958 ''|0) try='void endnetent_r(struct netent_data*);'
11959 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11961 case "$endnetent_r_proto" in
11962 ''|0) d_endnetent_r=undef
11963 endnetent_r_proto=0
11964 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11965 * ) case "$endnetent_r_proto" in
11966 REENTRANT_PROTO*) ;;
11967 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11969 echo "Prototype: $try" ;;
11972 *) case "$usethreads" in
11973 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11975 d_endnetent_r=undef
11976 endnetent_r_proto=0
11980 *) endnetent_r_proto=0
11984 : see if endprotoent exists
11985 set endprotoent d_endpent
11988 : see if endprotoent_r exists
11989 set endprotoent_r d_endprotoent_r
11991 case "$d_endprotoent_r" in
11993 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11994 case "$d_endprotoent_r_proto:$usethreads" in
11995 ":define") d_endprotoent_r_proto=define
11996 set d_endprotoent_r_proto endprotoent_r $hdrs
12000 case "$d_endprotoent_r_proto" in
12002 case "$endprotoent_r_proto" in
12003 ''|0) try='int endprotoent_r(struct protoent_data*);'
12004 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12006 case "$endprotoent_r_proto" in
12007 ''|0) try='void endprotoent_r(struct protoent_data*);'
12008 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12010 case "$endprotoent_r_proto" in
12011 ''|0) d_endprotoent_r=undef
12012 endprotoent_r_proto=0
12013 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12014 * ) case "$endprotoent_r_proto" in
12015 REENTRANT_PROTO*) ;;
12016 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12018 echo "Prototype: $try" ;;
12021 *) case "$usethreads" in
12022 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12024 d_endprotoent_r=undef
12025 endprotoent_r_proto=0
12029 *) endprotoent_r_proto=0
12033 : see if endpwent exists
12034 set endpwent d_endpwent
12037 : see if this is a pwd.h system
12043 xxx=`./findhdr pwd.h`
12044 $cppstdin $cppflags $cppminus < $xxx >$$.h
12046 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12054 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12062 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12070 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12078 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12086 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12094 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12102 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12114 set d_pwquota; eval $setvar
12115 set d_pwage; eval $setvar
12116 set d_pwchange; eval $setvar
12117 set d_pwclass; eval $setvar
12118 set d_pwexpire; eval $setvar
12119 set d_pwcomment; eval $setvar
12120 set d_pwgecos; eval $setvar
12121 set d_pwpasswd; eval $setvar
12125 : see if endpwent_r exists
12126 set endpwent_r d_endpwent_r
12128 case "$d_endpwent_r" in
12130 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12131 case "$d_endpwent_r_proto:$usethreads" in
12132 ":define") d_endpwent_r_proto=define
12133 set d_endpwent_r_proto endpwent_r $hdrs
12137 case "$d_endpwent_r_proto" in
12139 case "$endpwent_r_proto" in
12140 ''|0) try='int endpwent_r(FILE**);'
12141 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12143 case "$endpwent_r_proto" in
12144 ''|0) try='void endpwent_r(FILE**);'
12145 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12147 case "$endpwent_r_proto" in
12148 ''|0) d_endpwent_r=undef
12150 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12151 * ) case "$endpwent_r_proto" in
12152 REENTRANT_PROTO*) ;;
12153 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12155 echo "Prototype: $try" ;;
12158 *) case "$usethreads" in
12159 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12166 *) endpwent_r_proto=0
12170 : see if endservent exists
12171 set endservent d_endsent
12174 : see if endservent_r exists
12175 set endservent_r d_endservent_r
12177 case "$d_endservent_r" in
12179 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12180 case "$d_endservent_r_proto:$usethreads" in
12181 ":define") d_endservent_r_proto=define
12182 set d_endservent_r_proto endservent_r $hdrs
12186 case "$d_endservent_r_proto" in
12188 case "$endservent_r_proto" in
12189 ''|0) try='int endservent_r(struct servent_data*);'
12190 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12192 case "$endservent_r_proto" in
12193 ''|0) try='void endservent_r(struct servent_data*);'
12194 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12196 case "$endservent_r_proto" in
12197 ''|0) d_endservent_r=undef
12198 endservent_r_proto=0
12199 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12200 * ) case "$endservent_r_proto" in
12201 REENTRANT_PROTO*) ;;
12202 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12204 echo "Prototype: $try" ;;
12207 *) case "$usethreads" in
12208 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12210 d_endservent_r=undef
12211 endservent_r_proto=0
12215 *) endservent_r_proto=0
12219 : Locate the flags for 'open()'
12222 #include <sys/types.h>
12227 #include <sys/file.h>
12229 #$i_stdlib I_STDLIB
12231 #include <stdlib.h>
12242 : check sys/file.h first to get FREAD on Sun
12243 if $test `./findhdr sys/file.h` && \
12244 set try -DI_SYS_FILE && eval $compile; then
12246 echo "<sys/file.h> defines the O_* constants..." >&4
12247 if $run ./try; then
12248 echo "and you have the 3 argument form of open()." >&4
12251 echo "but not the 3 argument form of open(). Oh, well." >&4
12254 elif $test `./findhdr fcntl.h` && \
12255 set try -DI_FCNTL && eval $compile; then
12257 echo "<fcntl.h> defines the O_* constants..." >&4
12258 if $run ./try; then
12259 echo "and you have the 3 argument form of open()." >&4
12262 echo "but not the 3 argument form of open(). Oh, well." >&4
12267 echo "I can't find the O_* constant definitions! You got problems." >&4
12273 : see which of string.h or strings.h is needed
12275 strings=`./findhdr string.h`
12276 if $test "$strings" && $test -r "$strings"; then
12277 echo "Using <string.h> instead of <strings.h>." >&4
12281 strings=`./findhdr strings.h`
12282 if $test "$strings" && $test -r "$strings"; then
12283 echo "Using <strings.h> instead of <string.h>." >&4
12285 echo "No string header found -- You'll surely have problems." >&4
12290 case "$i_string" in
12291 "$undef") strings=`./findhdr strings.h`;;
12292 *) strings=`./findhdr string.h`;;
12295 : see if this is a sys/file.h system
12300 : do we need to include sys/file.h ?
12304 if $h_sysfile; then
12306 echo "We'll be including <sys/file.h>." >&4
12309 echo "We won't be including <sys/file.h>." >&4
12319 : see if fcntl.h is there
12324 : see if we can include fcntl.h
12330 echo "We'll be including <fcntl.h>." >&4
12333 if $h_sysfile; then
12334 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12336 echo "We won't be including <fcntl.h>." >&4
12348 : see if fork exists
12352 : see if pipe exists
12356 : check for non-blocking I/O stuff
12357 case "$h_sysfile" in
12358 true) echo "#include <sys/file.h>" > head.c;;
12361 true) echo "#include <fcntl.h>" > head.c;;
12362 *) echo "#include <sys/fcntl.h>" > head.c;;
12367 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12368 case "$o_nonblock" in
12370 $cat head.c > try.c
12371 $cat >>try.c <<EOCP
12373 #$i_stdlib I_STDLIB
12375 #include <stdlib.h>
12383 printf("O_NONBLOCK\n");
12387 printf("O_NDELAY\n");
12391 printf("FNDELAY\n");
12398 if eval $compile_ok; then
12399 o_nonblock=`$run ./try`
12400 case "$o_nonblock" in
12401 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12402 *) echo "Seems like we can use $o_nonblock.";;
12405 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12408 *) echo "Using $hint value $o_nonblock.";;
12413 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12416 case "$d_fork:$d_pipe" in
12418 $cat head.c > try.c
12419 $cat >>try.c <<EOCP
12421 #include <sys/types.h>
12422 #include <signal.h>
12424 #$i_stdlib I_STDLIB
12426 #include <stdlib.h>
12432 #define MY_O_NONBLOCK $o_nonblock
12433 #ifndef errno /* XXX need better Configure test */
12436 #$i_unistd I_UNISTD
12438 #include <unistd.h>
12440 #$i_string I_STRING
12442 #include <string.h>
12444 #include <strings.h>
12446 $signal_t blech(int x) { exit(3); }
12448 $cat >> try.c <<'EOCP'
12456 pipe(pd); /* Down: child -> parent */
12457 pipe(pu); /* Up: parent -> child */
12460 close(pd[1]); /* Parent reads from pd[0] */
12461 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12463 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12468 signal(SIGALRM, blech);
12470 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12472 sprintf(string, "%d\n", ret);
12473 write(2, string, strlen(string));
12476 if (errno == EAGAIN) {
12477 printf("EAGAIN\n");
12482 if (errno == EWOULDBLOCK)
12483 printf("EWOULDBLOCK\n");
12486 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12487 sleep(2); /* Give it time to close our pipe */
12489 ret = read(pd[0], buf, 1); /* Should read EOF */
12491 sprintf(string, "%d\n", ret);
12492 write(4, string, strlen(string));
12496 close(pd[0]); /* We write to pd[1] */
12497 close(pu[1]); /* We read from pu[0] */
12498 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12499 close(pd[1]); /* Pipe pd is now fully closed! */
12500 exit(0); /* Bye bye, thank you for playing! */
12504 if eval $compile_ok; then
12505 echo "$startsh" >mtry
12506 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12508 ./mtry >/dev/null 2>&1
12510 0) eagain=`$cat try.out`;;
12511 1) echo "Could not perform non-blocking setting!";;
12512 2) echo "I did a successful read() for something that was not there!";;
12513 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12514 4) echo "Could not find F_SETFL!";;
12515 *) echo "Something terribly wrong happened during testing.";;
12517 rd_nodata=`$cat try.ret`
12518 echo "A read() system call with no data present returns $rd_nodata."
12519 case "$rd_nodata" in
12522 echo "(That's peculiar, fixing that to be -1.)"
12528 echo "Forcing errno EAGAIN on read() with no data available."
12532 echo "Your read() sets errno to $eagain when no data is available."
12535 status=`$cat try.err`
12537 0) echo "And it correctly returns 0 to signal EOF.";;
12538 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12539 *) echo "However, your read() returns '$status' on EOF??";;
12542 if test "$status" = "$rd_nodata"; then
12543 echo "WARNING: you can't distinguish between EOF and no data!"
12547 echo "I can't compile the test program--assuming errno EAGAIN will do."
12551 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12560 echo "Using $hint value $eagain."
12561 echo "Your read() returns $rd_nodata when no data is present."
12562 case "$d_eofnblk" in
12563 "$define") echo "And you can see EOF because read() returns 0.";;
12564 "$undef") echo "But you can't see EOF status from read() returned value.";;
12566 echo "(Assuming you can't see EOF status from read anyway.)"
12572 $rm_try head.c mtry
12574 : see if _ptr and _cnt from stdio act std
12577 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12578 echo "(Looks like you have stdio.h from BSD.)"
12579 case "$stdio_ptr" in
12580 '') stdio_ptr='((fp)->_p)'
12583 *) ptr_lval=$d_stdio_ptr_lval;;
12585 case "$stdio_cnt" in
12586 '') stdio_cnt='((fp)->_r)'
12589 *) cnt_lval=$d_stdio_cnt_lval;;
12591 case "$stdio_base" in
12592 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12594 case "$stdio_bufsiz" in
12595 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12597 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12598 echo "(Looks like you have stdio.h from Linux.)"
12599 case "$stdio_ptr" in
12600 '') stdio_ptr='((fp)->_IO_read_ptr)'
12603 *) ptr_lval=$d_stdio_ptr_lval;;
12605 case "$stdio_cnt" in
12606 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12609 *) cnt_lval=$d_stdio_cnt_lval;;
12611 case "$stdio_base" in
12612 '') stdio_base='((fp)->_IO_read_base)';;
12614 case "$stdio_bufsiz" in
12615 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12618 case "$stdio_ptr" in
12619 '') stdio_ptr='((fp)->_ptr)'
12622 *) ptr_lval=$d_stdio_ptr_lval;;
12624 case "$stdio_cnt" in
12625 '') stdio_cnt='((fp)->_cnt)'
12628 *) cnt_lval=$d_stdio_cnt_lval;;
12630 case "$stdio_base" in
12631 '') stdio_base='((fp)->_base)';;
12633 case "$stdio_bufsiz" in
12634 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12638 : test whether _ptr and _cnt really work
12639 echo "Checking how std your stdio is..." >&4
12642 #$i_stdlib I_STDLIB
12644 #include <stdlib.h>
12646 #define FILE_ptr(fp) $stdio_ptr
12647 #define FILE_cnt(fp) $stdio_cnt
12649 FILE *fp = fopen("try.c", "r");
12652 18 <= FILE_cnt(fp) &&
12653 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12661 if eval $compile && $to try.c; then
12662 if $run ./try; then
12663 echo "Your stdio acts pretty std."
12666 echo "Your stdio isn't very std."
12669 echo "Your stdio doesn't appear very std."
12673 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12674 # direct buffer manipulation no longer works. The Configure tests
12675 # should be changed to correctly detect this, but until then,
12676 # the following check should at least let perl compile and run.
12677 # (This quick fix should be updated before 5.8.1.)
12678 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12679 # A. Dougherty, June 3, 2002.
12680 case "$d_gnulibc" in
12682 case "$gnulibc_version" in
12686 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12695 : Can _ptr be used as an lvalue?
12696 case "$d_stdstdio$ptr_lval" in
12697 $define$define) val=$define ;;
12700 set d_stdio_ptr_lval
12703 : Can _cnt be used as an lvalue?
12704 case "$d_stdstdio$cnt_lval" in
12705 $define$define) val=$define ;;
12708 set d_stdio_cnt_lval
12712 : test whether setting _ptr sets _cnt as a side effect
12713 d_stdio_ptr_lval_sets_cnt="$undef"
12714 d_stdio_ptr_lval_nochange_cnt="$undef"
12715 case "$d_stdio_ptr_lval$d_stdstdio" in
12717 echo "Checking to see what happens if we set the stdio ptr..." >&4
12720 /* Can we scream? */
12721 /* Eat dust sed :-) */
12722 /* In the buffer space, no one can hear you scream. */
12723 #$i_stdlib I_STDLIB
12725 #include <stdlib.h>
12727 #define FILE_ptr(fp) $stdio_ptr
12728 #define FILE_cnt(fp) $stdio_cnt
12729 #include <sys/types.h>
12731 FILE *fp = fopen("try.c", "r");
12736 puts("Fail even to read");
12739 c = getc(fp); /* Read away the first # */
12741 puts("Fail even to read");
12745 18 <= FILE_cnt(fp) &&
12746 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12748 puts("Fail even to read");
12751 ptr = (char*) FILE_ptr(fp);
12752 cnt = (size_t)FILE_cnt(fp);
12754 FILE_ptr(fp) += 42;
12756 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12757 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12760 if (FILE_cnt(fp) <= 20) {
12761 printf ("Fail (<20 chars to test)");
12764 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12765 puts("Fail compare");
12768 if (cnt == FILE_cnt(fp)) {
12769 puts("Pass_unchanged");
12772 if (FILE_cnt(fp) == (cnt - 42)) {
12773 puts("Pass_changed");
12776 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12782 if eval $compile && $to try.c; then
12783 case `$run ./try` in
12785 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12786 d_stdio_ptr_lval_sets_cnt="$define" ;;
12788 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12789 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12791 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12793 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12796 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12802 : see if _base is also standard
12804 case "$d_stdstdio" in
12808 #$i_stdlib I_STDLIB
12810 #include <stdlib.h>
12812 #define FILE_base(fp) $stdio_base
12813 #define FILE_bufsiz(fp) $stdio_bufsiz
12815 FILE *fp = fopen("try.c", "r");
12818 19 <= FILE_bufsiz(fp) &&
12819 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12826 if eval $compile && $to try.c; then
12827 if $run ./try; then
12828 echo "And its _base field acts std."
12831 echo "But its _base field isn't std."
12834 echo "However, it seems to be lacking the _base field."
12842 : see if fast_stdio exists
12844 case "$d_stdstdio:$d_stdio_ptr_lval" in
12846 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12848 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12859 : see if fchdir exists
12860 set fchdir d_fchdir
12863 : see if fchmod exists
12864 set fchmod d_fchmod
12867 : see if fchown exists
12868 set fchown d_fchown
12871 : see if this is an fcntl system
12875 : See if fcntl-based locking works.
12878 #$i_stdlib I_STDLIB
12880 #include <stdlib.h>
12882 #include <unistd.h>
12884 #include <signal.h>
12885 $signal_t blech(int x) { exit(3); }
12887 #if defined(F_SETLK) && defined(F_SETLKW)
12888 struct flock flock;
12890 fd = open("try.c", O_RDONLY);
12891 flock.l_type = F_RDLCK;
12892 flock.l_whence = SEEK_SET;
12893 flock.l_start = flock.l_len = 0;
12894 signal(SIGALRM, blech);
12896 retval = fcntl(fd, F_SETLK, &flock);
12898 (retval < 0 ? exit(2) : exit(0));
12904 echo "Checking if fcntl-based file locking works... "
12908 if eval $compile_ok; then
12909 if $run ./try; then
12910 echo "Yes, it seems to work."
12913 echo "Nope, it didn't work."
12918 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12919 *** This is (almost) impossible.
12920 *** If your NFS lock daemons are not feeling well, something like
12921 *** this may happen, please investigate. Cannot continue, aborting.
12929 echo "I'm unable to compile the test program, so I'll assume not."
12934 echo "Nope, since you don't even have fcntl()."
12937 set d_fcntl_can_lock
12941 : check for fd_set items
12944 Checking to see how well your C compiler handles fd_set and friends ...
12947 #$i_stdlib I_STDLIB
12949 #include <stdlib.h>
12951 #$i_systime I_SYS_TIME
12952 #$i_sysselct I_SYS_SELECT
12953 #$d_socket HAS_SOCKET
12954 #include <sys/types.h>
12956 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12959 #include <sys/time.h>
12961 #ifdef I_SYS_SELECT
12962 #include <sys/select.h>
12971 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12979 if eval $compile; then
12980 d_fds_bits="$define"
12982 echo "Well, your system knows about the normal fd_set typedef..." >&4
12983 if $run ./try; then
12984 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12985 d_fd_macros="$define"
12988 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12990 d_fd_macros="$undef"
12994 Hmm, your compiler has some difficulty with fd_set. Checking further...
12997 if eval $compile; then
12998 d_fds_bits="$undef"
13000 echo "Well, your system has some sort of fd_set available..." >&4
13001 if $run ./try; then
13002 echo "and you have the normal fd_set macros." >&4
13003 d_fd_macros="$define"
13006 but not the normal fd_set macros! Gross! More work for me...
13008 d_fd_macros="$undef"
13011 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13013 d_fds_bits="$undef"
13014 d_fd_macros="$undef"
13019 : see if fgetpos exists
13020 set fgetpos d_fgetpos
13023 : see if finite exists
13024 set finite d_finite
13027 : see if finitel exists
13028 set finitel d_finitel
13031 : see if flock exists
13035 : see if prototype for flock is available
13037 set d_flockproto flock $i_sysfile sys/file.h
13040 : see if fp_class exists
13041 set fp_class d_fp_class
13044 : see if pathconf exists
13045 set pathconf d_pathconf
13048 : see if fpathconf exists
13049 set fpathconf d_fpathconf
13052 : see if fpclass exists
13053 set fpclass d_fpclass
13056 : see if fpclassify exists
13057 set fpclassify d_fpclassify
13060 : see if fpclassl exists
13061 set fpclassl d_fpclassl
13064 : check for fpos64_t
13066 echo "Checking to see if you have fpos64_t..." >&4
13069 int main() { fpos64_t x = 7; }
13072 if eval $compile; then
13074 echo "You have fpos64_t."
13077 echo "You do not have fpos64_t."
13078 case "$fpossize" in
13079 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13086 : see if frexpl exists
13087 set frexpl d_frexpl
13090 : see if this is a sys/param system
13091 set sys/param.h i_sysparam
13094 : see if this is a sys/mount.h system
13095 set sys/mount.h i_sysmount
13098 : Check for fs_data_s
13100 echo "Checking to see if your system supports struct fs_data..." >&4
13101 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13103 case "$d_fs_data_s" in
13104 "$define") echo "Yes, it does." ;;
13105 *) echo "No, it doesn't." ;;
13108 : see if fseeko exists
13109 set fseeko d_fseeko
13111 case "$longsize" in
13112 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13115 : see if fsetpos exists
13116 set fsetpos d_fsetpos
13119 : see if fstatfs exists
13120 set fstatfs d_fstatfs
13123 : see if statvfs exists
13124 set statvfs d_statvfs
13127 : see if fstatvfs exists
13128 set fstatvfs d_fstatvfs
13132 : see if fsync exists
13136 : see if ftello exists
13137 set ftello d_ftello
13139 case "$longsize" in
13140 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13143 : check for a working futimes
13146 echo "Checking if you have a working futimes()" >&4
13149 #include <sys/time.h>
13156 fd = open ("try.c", O_RDWR);
13157 if (-1 == fd) exit (1);
13158 rv = futimes (fd, NULL);
13159 exit (rv == -1 ? errno : 0);
13163 if eval $compile; then
13167 0) echo "Yes, you have" >&4
13168 d_futimes="$define"
13170 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13174 echo "No, it does not (probably harmless)" >&4
13178 : see if getcwd exists
13179 set getcwd d_getcwd
13182 : see if getespwnam exists
13183 set getespwnam d_getespwnam
13186 : see if getfsstat exists
13187 set getfsstat d_getfsstat
13190 : see if getgrent exists
13191 set getgrent d_getgrent
13194 : see if getgrent_r exists
13195 set getgrent_r d_getgrent_r
13197 case "$d_getgrent_r" in
13199 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13200 case "$d_getgrent_r_proto:$usethreads" in
13201 ":define") d_getgrent_r_proto=define
13202 set d_getgrent_r_proto getgrent_r $hdrs
13206 case "$d_getgrent_r_proto" in
13208 case "$getgrent_r_proto" in
13209 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13210 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13212 case "$getgrent_r_proto" in
13213 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13214 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13216 case "$getgrent_r_proto" in
13217 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13218 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13220 case "$getgrent_r_proto" in
13221 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13222 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13224 case "$getgrent_r_proto" in
13225 ''|0) try='int getgrent_r(struct group*, char*, int);'
13226 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13228 case "$getgrent_r_proto" in
13229 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13230 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13232 case "$getgrent_r_proto" in
13233 ''|0) d_getgrent_r=undef
13235 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13236 * ) case "$getgrent_r_proto" in
13237 REENTRANT_PROTO*) ;;
13238 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13240 echo "Prototype: $try" ;;
13243 *) case "$usethreads" in
13244 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13251 *) getgrent_r_proto=0
13255 : see if getgrgid_r exists
13256 set getgrgid_r d_getgrgid_r
13258 case "$d_getgrgid_r" in
13260 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13261 case "$d_getgrgid_r_proto:$usethreads" in
13262 ":define") d_getgrgid_r_proto=define
13263 set d_getgrgid_r_proto getgrgid_r $hdrs
13267 case "$d_getgrgid_r_proto" in
13269 case "$getgrgid_r_proto" in
13270 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13271 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13273 case "$getgrgid_r_proto" in
13274 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13275 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13277 case "$getgrgid_r_proto" in
13278 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13279 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13281 case "$getgrgid_r_proto" in
13282 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13283 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13285 case "$getgrgid_r_proto" in
13286 ''|0) d_getgrgid_r=undef
13288 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13289 * ) case "$getgrgid_r_proto" in
13290 REENTRANT_PROTO*) ;;
13291 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13293 echo "Prototype: $try" ;;
13296 *) case "$usethreads" in
13297 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13304 *) getgrgid_r_proto=0
13308 : see if getgrnam_r exists
13309 set getgrnam_r d_getgrnam_r
13311 case "$d_getgrnam_r" in
13313 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13314 case "$d_getgrnam_r_proto:$usethreads" in
13315 ":define") d_getgrnam_r_proto=define
13316 set d_getgrnam_r_proto getgrnam_r $hdrs
13320 case "$d_getgrnam_r_proto" in
13322 case "$getgrnam_r_proto" in
13323 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13324 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13326 case "$getgrnam_r_proto" in
13327 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13328 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13330 case "$getgrnam_r_proto" in
13331 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13332 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13334 case "$getgrnam_r_proto" in
13335 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13336 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13338 case "$getgrnam_r_proto" in
13339 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13340 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13342 case "$getgrnam_r_proto" in
13343 ''|0) d_getgrnam_r=undef
13345 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13346 * ) case "$getgrnam_r_proto" in
13347 REENTRANT_PROTO*) ;;
13348 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13350 echo "Prototype: $try" ;;
13353 *) case "$usethreads" in
13354 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13361 *) getgrnam_r_proto=0
13365 : see if gethostbyaddr exists
13366 set gethostbyaddr d_gethbyaddr
13369 : see if gethostbyname exists
13370 set gethostbyname d_gethbyname
13373 : see if gethostent exists
13374 set gethostent d_gethent
13377 : see how we will look up host name
13380 if set gethostname val -f d_gethname; eval $csym; $val; then
13381 echo 'gethostname() found.' >&4
13382 d_gethname="$define"
13385 if set uname val -f d_uname; eval $csym; $val; then
13388 uname() was found, but you're running xenix, and older versions of xenix
13389 have a broken uname(). If you don't really know whether your xenix is old
13390 enough to have a broken system call, use the default answer.
13395 "$define") dflt=n;;
13397 rp='Is your uname() broken?'
13400 n*) d_uname="$define"; call=uname;;
13403 echo 'uname() found.' >&4
13410 case "$d_gethname" in
13411 '') d_gethname="$undef";;
13414 '') d_uname="$undef";;
13416 case "$d_uname$d_gethname" in
13421 Every now and then someone has a $call() that lies about the hostname
13422 but can't be fixed for political or economic reasons. If you wish, I can
13423 pretend $call() isn't there and maybe compute hostname at run-time
13424 thanks to the '$phostname' command.
13427 rp="Shall I ignore $call() from now on?"
13430 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13433 case "$phostname" in
13434 '') aphostname='';;
13435 *) case "$aphostname" in
13437 *) set X $phostname
13441 file=`./loc $file $file $pth`
13442 aphostname=`echo $file $*`
13447 case "$d_uname$d_gethname" in
13450 case "$phostname" in
13452 echo "There will be no way for $package to get your hostname." >&4;;
13454 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13458 case "$d_phostname" in
13459 '') d_phostname="$undef";;
13462 : see if gethostbyaddr_r exists
13463 set gethostbyaddr_r d_gethostbyaddr_r
13465 case "$d_gethostbyaddr_r" in
13467 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13468 case "$d_gethostbyaddr_r_proto:$usethreads" in
13469 ":define") d_gethostbyaddr_r_proto=define
13470 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13474 case "$d_gethostbyaddr_r_proto" in
13476 case "$gethostbyaddr_r_proto" in
13477 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13478 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13480 case "$gethostbyaddr_r_proto" in
13481 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13482 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13484 case "$gethostbyaddr_r_proto" in
13485 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13486 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13488 case "$gethostbyaddr_r_proto" in
13489 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13490 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13492 case "$gethostbyaddr_r_proto" in
13493 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13494 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13496 case "$gethostbyaddr_r_proto" in
13497 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13498 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13500 case "$gethostbyaddr_r_proto" in
13501 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13502 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13504 case "$gethostbyaddr_r_proto" in
13505 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13506 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13508 case "$gethostbyaddr_r_proto" in
13509 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13510 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13512 case "$gethostbyaddr_r_proto" in
13513 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13514 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13516 case "$gethostbyaddr_r_proto" in
13517 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13518 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13520 case "$gethostbyaddr_r_proto" in
13521 ''|0) d_gethostbyaddr_r=undef
13522 gethostbyaddr_r_proto=0
13523 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13524 * ) case "$gethostbyaddr_r_proto" in
13525 REENTRANT_PROTO*) ;;
13526 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13528 echo "Prototype: $try" ;;
13531 *) case "$usethreads" in
13532 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13534 d_gethostbyaddr_r=undef
13535 gethostbyaddr_r_proto=0
13539 *) gethostbyaddr_r_proto=0
13543 : see if gethostbyname_r exists
13544 set gethostbyname_r d_gethostbyname_r
13546 case "$d_gethostbyname_r" in
13548 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13549 case "$d_gethostbyname_r_proto:$usethreads" in
13550 ":define") d_gethostbyname_r_proto=define
13551 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13555 case "$d_gethostbyname_r_proto" in
13557 case "$gethostbyname_r_proto" in
13558 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13559 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13561 case "$gethostbyname_r_proto" in
13562 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13563 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13565 case "$gethostbyname_r_proto" in
13566 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13567 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13569 case "$gethostbyname_r_proto" in
13570 ''|0) d_gethostbyname_r=undef
13571 gethostbyname_r_proto=0
13572 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13573 * ) case "$gethostbyname_r_proto" in
13574 REENTRANT_PROTO*) ;;
13575 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13577 echo "Prototype: $try" ;;
13580 *) case "$usethreads" in
13581 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13583 d_gethostbyname_r=undef
13584 gethostbyname_r_proto=0
13588 *) gethostbyname_r_proto=0
13592 : see if gethostent_r exists
13593 set gethostent_r d_gethostent_r
13595 case "$d_gethostent_r" in
13597 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13598 case "$d_gethostent_r_proto:$usethreads" in
13599 ":define") d_gethostent_r_proto=define
13600 set d_gethostent_r_proto gethostent_r $hdrs
13604 case "$d_gethostent_r_proto" in
13606 case "$gethostent_r_proto" in
13607 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13608 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13610 case "$gethostent_r_proto" in
13611 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13612 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13614 case "$gethostent_r_proto" in
13615 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13616 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13618 case "$gethostent_r_proto" in
13619 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13620 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13622 case "$gethostent_r_proto" in
13623 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13624 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13626 case "$gethostent_r_proto" in
13627 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13628 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13630 case "$gethostent_r_proto" in
13631 ''|0) d_gethostent_r=undef
13632 gethostent_r_proto=0
13633 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13634 * ) case "$gethostent_r_proto" in
13635 REENTRANT_PROTO*) ;;
13636 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13638 echo "Prototype: $try" ;;
13641 *) case "$usethreads" in
13642 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13644 d_gethostent_r=undef
13645 gethostent_r_proto=0
13649 *) gethostent_r_proto=0
13653 : see if prototypes for various gethostxxx netdb.h functions are available
13655 set d_gethostprotos gethostent $i_netdb netdb.h
13658 : see if getitimer exists
13659 set getitimer d_getitimer
13662 : see if getlogin exists
13663 set getlogin d_getlogin
13666 : see if getlogin_r exists
13667 set getlogin_r d_getlogin_r
13669 case "$d_getlogin_r" in
13671 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13672 case "$d_getlogin_r_proto:$usethreads" in
13673 ":define") d_getlogin_r_proto=define
13674 set d_getlogin_r_proto getlogin_r $hdrs
13678 case "$d_getlogin_r_proto" in
13680 case "$getlogin_r_proto" in
13681 ''|0) try='int getlogin_r(char*, size_t);'
13682 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13684 case "$getlogin_r_proto" in
13685 ''|0) try='int getlogin_r(char*, int);'
13686 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13688 case "$getlogin_r_proto" in
13689 ''|0) try='char* getlogin_r(char*, size_t);'
13690 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13692 case "$getlogin_r_proto" in
13693 ''|0) try='char* getlogin_r(char*, int);'
13694 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13696 case "$getlogin_r_proto" in
13697 ''|0) d_getlogin_r=undef
13699 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13700 * ) case "$getlogin_r_proto" in
13701 REENTRANT_PROTO*) ;;
13702 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13704 echo "Prototype: $try" ;;
13707 *) case "$usethreads" in
13708 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13715 *) getlogin_r_proto=0
13719 : see if getmnt exists
13720 set getmnt d_getmnt
13723 : see if getmntent exists
13724 set getmntent d_getmntent
13727 : see if getnetbyaddr exists
13728 set getnetbyaddr d_getnbyaddr
13731 : see if getnetbyname exists
13732 set getnetbyname d_getnbyname
13735 : see if getnetent exists
13736 set getnetent d_getnent
13739 : see if getnetbyaddr_r exists
13740 set getnetbyaddr_r d_getnetbyaddr_r
13742 case "$d_getnetbyaddr_r" in
13744 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13745 case "$d_getnetbyaddr_r_proto:$usethreads" in
13746 ":define") d_getnetbyaddr_r_proto=define
13747 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13751 case "$d_getnetbyaddr_r_proto" in
13753 case "$getnetbyaddr_r_proto" in
13754 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13755 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13757 case "$getnetbyaddr_r_proto" in
13758 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13759 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13761 case "$getnetbyaddr_r_proto" in
13762 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13763 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13765 case "$getnetbyaddr_r_proto" in
13766 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13767 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13769 case "$getnetbyaddr_r_proto" in
13770 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13771 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13773 case "$getnetbyaddr_r_proto" in
13774 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13775 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13777 case "$getnetbyaddr_r_proto" in
13778 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13779 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13781 case "$getnetbyaddr_r_proto" in
13782 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13783 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13785 case "$getnetbyaddr_r_proto" in
13786 ''|0) d_getnetbyaddr_r=undef
13787 getnetbyaddr_r_proto=0
13788 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13789 * ) case "$getnetbyaddr_r_proto" in
13790 REENTRANT_PROTO*) ;;
13791 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13793 echo "Prototype: $try" ;;
13796 *) case "$usethreads" in
13797 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13799 d_getnetbyaddr_r=undef
13800 getnetbyaddr_r_proto=0
13804 *) getnetbyaddr_r_proto=0
13808 : see if getnetbyname_r exists
13809 set getnetbyname_r d_getnetbyname_r
13811 case "$d_getnetbyname_r" in
13813 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13814 case "$d_getnetbyname_r_proto:$usethreads" in
13815 ":define") d_getnetbyname_r_proto=define
13816 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13820 case "$d_getnetbyname_r_proto" in
13822 case "$getnetbyname_r_proto" in
13823 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13824 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13826 case "$getnetbyname_r_proto" in
13827 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13828 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13830 case "$getnetbyname_r_proto" in
13831 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13832 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13834 case "$getnetbyname_r_proto" in
13835 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13836 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13838 case "$getnetbyname_r_proto" in
13839 ''|0) d_getnetbyname_r=undef
13840 getnetbyname_r_proto=0
13841 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13842 * ) case "$getnetbyname_r_proto" in
13843 REENTRANT_PROTO*) ;;
13844 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13846 echo "Prototype: $try" ;;
13849 *) case "$usethreads" in
13850 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13852 d_getnetbyname_r=undef
13853 getnetbyname_r_proto=0
13857 *) getnetbyname_r_proto=0
13861 : see if getnetent_r exists
13862 set getnetent_r d_getnetent_r
13864 case "$d_getnetent_r" in
13866 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13867 case "$d_getnetent_r_proto:$usethreads" in
13868 ":define") d_getnetent_r_proto=define
13869 set d_getnetent_r_proto getnetent_r $hdrs
13873 case "$d_getnetent_r_proto" in
13875 case "$getnetent_r_proto" in
13876 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13877 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13879 case "$getnetent_r_proto" in
13880 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13881 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13883 case "$getnetent_r_proto" in
13884 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13885 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13887 case "$getnetent_r_proto" in
13888 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13889 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13891 case "$getnetent_r_proto" in
13892 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13893 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13895 case "$getnetent_r_proto" in
13896 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13897 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13899 case "$getnetent_r_proto" in
13900 ''|0) d_getnetent_r=undef
13901 getnetent_r_proto=0
13902 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13903 * ) case "$getnetent_r_proto" in
13904 REENTRANT_PROTO*) ;;
13905 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13907 echo "Prototype: $try" ;;
13910 *) case "$usethreads" in
13911 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13913 d_getnetent_r=undef
13914 getnetent_r_proto=0
13918 *) getnetent_r_proto=0
13922 : see if prototypes for various getnetxxx netdb.h functions are available
13924 set d_getnetprotos getnetent $i_netdb netdb.h
13927 : see if getpagesize exists
13928 set getpagesize d_getpagsz
13931 : Optional checks for getprotobyname and getprotobynumber
13933 : see if getprotobyname exists
13934 set getprotobyname d_getpbyname
13937 : see if getprotobynumber exists
13938 set getprotobynumber d_getpbynumber
13941 : see if getprotoent exists
13942 set getprotoent d_getpent
13945 : see if getpgid exists
13946 set getpgid d_getpgid
13949 : see if getpgrp2 exists
13950 set getpgrp2 d_getpgrp2
13953 : see if getppid exists
13954 set getppid d_getppid
13957 : see if getpriority exists
13958 set getpriority d_getprior
13961 : see if getprotobyname_r exists
13962 set getprotobyname_r d_getprotobyname_r
13964 case "$d_getprotobyname_r" in
13966 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13967 case "$d_getprotobyname_r_proto:$usethreads" in
13968 ":define") d_getprotobyname_r_proto=define
13969 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13973 case "$d_getprotobyname_r_proto" in
13975 case "$getprotobyname_r_proto" in
13976 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13977 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13979 case "$getprotobyname_r_proto" in
13980 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13981 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13983 case "$getprotobyname_r_proto" in
13984 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13985 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13987 case "$getprotobyname_r_proto" in
13988 ''|0) d_getprotobyname_r=undef
13989 getprotobyname_r_proto=0
13990 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13991 * ) case "$getprotobyname_r_proto" in
13992 REENTRANT_PROTO*) ;;
13993 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13995 echo "Prototype: $try" ;;
13998 *) case "$usethreads" in
13999 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14001 d_getprotobyname_r=undef
14002 getprotobyname_r_proto=0
14006 *) getprotobyname_r_proto=0
14010 : see if getprotobynumber_r exists
14011 set getprotobynumber_r d_getprotobynumber_r
14013 case "$d_getprotobynumber_r" in
14015 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14016 case "$d_getprotobynumber_r_proto:$usethreads" in
14017 ":define") d_getprotobynumber_r_proto=define
14018 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14022 case "$d_getprotobynumber_r_proto" in
14024 case "$getprotobynumber_r_proto" in
14025 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14026 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14028 case "$getprotobynumber_r_proto" in
14029 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14030 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14032 case "$getprotobynumber_r_proto" in
14033 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14034 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14036 case "$getprotobynumber_r_proto" in
14037 ''|0) d_getprotobynumber_r=undef
14038 getprotobynumber_r_proto=0
14039 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14040 * ) case "$getprotobynumber_r_proto" in
14041 REENTRANT_PROTO*) ;;
14042 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14044 echo "Prototype: $try" ;;
14047 *) case "$usethreads" in
14048 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14050 d_getprotobynumber_r=undef
14051 getprotobynumber_r_proto=0
14055 *) getprotobynumber_r_proto=0
14059 : see if getprotoent_r exists
14060 set getprotoent_r d_getprotoent_r
14062 case "$d_getprotoent_r" in
14064 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14065 case "$d_getprotoent_r_proto:$usethreads" in
14066 ":define") d_getprotoent_r_proto=define
14067 set d_getprotoent_r_proto getprotoent_r $hdrs
14071 case "$d_getprotoent_r_proto" in
14073 case "$getprotoent_r_proto" in
14074 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14075 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14077 case "$getprotoent_r_proto" in
14078 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14079 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14081 case "$getprotoent_r_proto" in
14082 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14083 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14085 case "$getprotoent_r_proto" in
14086 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14087 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14089 case "$getprotoent_r_proto" in
14090 ''|0) d_getprotoent_r=undef
14091 getprotoent_r_proto=0
14092 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14093 * ) case "$getprotoent_r_proto" in
14094 REENTRANT_PROTO*) ;;
14095 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14097 echo "Prototype: $try" ;;
14100 *) case "$usethreads" in
14101 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14103 d_getprotoent_r=undef
14104 getprotoent_r_proto=0
14108 *) getprotoent_r_proto=0
14112 : see if prototypes for various getprotoxxx netdb.h functions are available
14114 set d_getprotoprotos getprotoent $i_netdb netdb.h
14117 : see if getprpwnam exists
14118 set getprpwnam d_getprpwnam
14121 : see if getpwent exists
14122 set getpwent d_getpwent
14125 : see if getpwent_r exists
14126 set getpwent_r d_getpwent_r
14128 case "$d_getpwent_r" in
14130 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14131 case "$d_getpwent_r_proto:$usethreads" in
14132 ":define") d_getpwent_r_proto=define
14133 set d_getpwent_r_proto getpwent_r $hdrs
14137 case "$d_getpwent_r_proto" in
14139 case "$getpwent_r_proto" in
14140 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14141 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14143 case "$getpwent_r_proto" in
14144 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14145 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14147 case "$getpwent_r_proto" in
14148 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14149 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14151 case "$getpwent_r_proto" in
14152 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14153 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14155 case "$getpwent_r_proto" in
14156 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14157 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14159 case "$getpwent_r_proto" in
14160 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14161 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14163 case "$getpwent_r_proto" in
14164 ''|0) d_getpwent_r=undef
14166 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14167 * ) case "$getpwent_r_proto" in
14168 REENTRANT_PROTO*) ;;
14169 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14171 echo "Prototype: $try" ;;
14174 *) case "$usethreads" in
14175 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14182 *) getpwent_r_proto=0
14186 : see if getpwnam_r exists
14187 set getpwnam_r d_getpwnam_r
14189 case "$d_getpwnam_r" in
14191 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14192 case "$d_getpwnam_r_proto:$usethreads" in
14193 ":define") d_getpwnam_r_proto=define
14194 set d_getpwnam_r_proto getpwnam_r $hdrs
14198 case "$d_getpwnam_r_proto" in
14200 case "$getpwnam_r_proto" in
14201 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14202 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14204 case "$getpwnam_r_proto" in
14205 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14206 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14208 case "$getpwnam_r_proto" in
14209 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14210 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14212 case "$getpwnam_r_proto" in
14213 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14214 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14216 case "$getpwnam_r_proto" in
14217 ''|0) d_getpwnam_r=undef
14219 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14220 * ) case "$getpwnam_r_proto" in
14221 REENTRANT_PROTO*) ;;
14222 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14224 echo "Prototype: $try" ;;
14227 *) case "$usethreads" in
14228 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14235 *) getpwnam_r_proto=0
14239 : see if getpwuid_r exists
14240 set getpwuid_r d_getpwuid_r
14242 case "$d_getpwuid_r" in
14244 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14245 case "$d_getpwuid_r_proto:$usethreads" in
14246 ":define") d_getpwuid_r_proto=define
14247 set d_getpwuid_r_proto getpwuid_r $hdrs
14251 case "$d_getpwuid_r_proto" in
14253 case "$getpwuid_r_proto" in
14254 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14255 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14257 case "$getpwuid_r_proto" in
14258 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14259 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14261 case "$getpwuid_r_proto" in
14262 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14263 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14265 case "$getpwuid_r_proto" in
14266 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14267 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14269 case "$getpwuid_r_proto" in
14270 ''|0) d_getpwuid_r=undef
14272 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14273 * ) case "$getpwuid_r_proto" in
14274 REENTRANT_PROTO*) ;;
14275 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14277 echo "Prototype: $try" ;;
14280 *) case "$usethreads" in
14281 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14288 *) getpwuid_r_proto=0
14292 : Optional checks for getsbyname and getsbyport
14294 : see if getservbyname exists
14295 set getservbyname d_getsbyname
14298 : see if getservbyport exists
14299 set getservbyport d_getsbyport
14302 : see if getservent exists
14303 set getservent d_getsent
14306 : see if getservbyname_r exists
14307 set getservbyname_r d_getservbyname_r
14309 case "$d_getservbyname_r" in
14311 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14312 case "$d_getservbyname_r_proto:$usethreads" in
14313 ":define") d_getservbyname_r_proto=define
14314 set d_getservbyname_r_proto getservbyname_r $hdrs
14318 case "$d_getservbyname_r_proto" in
14320 case "$getservbyname_r_proto" in
14321 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14322 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14324 case "$getservbyname_r_proto" in
14325 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14326 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14328 case "$getservbyname_r_proto" in
14329 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14330 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14332 case "$getservbyname_r_proto" in
14333 ''|0) d_getservbyname_r=undef
14334 getservbyname_r_proto=0
14335 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14336 * ) case "$getservbyname_r_proto" in
14337 REENTRANT_PROTO*) ;;
14338 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14340 echo "Prototype: $try" ;;
14343 *) case "$usethreads" in
14344 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14346 d_getservbyname_r=undef
14347 getservbyname_r_proto=0
14351 *) getservbyname_r_proto=0
14355 : see if getservbyport_r exists
14356 set getservbyport_r d_getservbyport_r
14358 case "$d_getservbyport_r" in
14360 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14361 case "$d_getservbyport_r_proto:$usethreads" in
14362 ":define") d_getservbyport_r_proto=define
14363 set d_getservbyport_r_proto getservbyport_r $hdrs
14367 case "$d_getservbyport_r_proto" in
14369 case "$getservbyport_r_proto" in
14370 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14371 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14373 case "$getservbyport_r_proto" in
14374 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14375 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14377 case "$getservbyport_r_proto" in
14378 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14379 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14381 case "$getservbyport_r_proto" in
14382 ''|0) d_getservbyport_r=undef
14383 getservbyport_r_proto=0
14384 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14385 * ) case "$getservbyport_r_proto" in
14386 REENTRANT_PROTO*) ;;
14387 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14389 echo "Prototype: $try" ;;
14392 *) case "$usethreads" in
14393 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14395 d_getservbyport_r=undef
14396 getservbyport_r_proto=0
14400 *) getservbyport_r_proto=0
14404 : see if getservent_r exists
14405 set getservent_r d_getservent_r
14407 case "$d_getservent_r" in
14409 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14410 case "$d_getservent_r_proto:$usethreads" in
14411 ":define") d_getservent_r_proto=define
14412 set d_getservent_r_proto getservent_r $hdrs
14416 case "$d_getservent_r_proto" in
14418 case "$getservent_r_proto" in
14419 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14420 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14422 case "$getservent_r_proto" in
14423 ''|0) try='int getservent_r(struct servent*, char*, int);'
14424 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14426 case "$getservent_r_proto" in
14427 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14428 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14430 case "$getservent_r_proto" in
14431 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14432 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14434 case "$getservent_r_proto" in
14435 ''|0) d_getservent_r=undef
14436 getservent_r_proto=0
14437 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14438 * ) case "$getservent_r_proto" in
14439 REENTRANT_PROTO*) ;;
14440 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14442 echo "Prototype: $try" ;;
14445 *) case "$usethreads" in
14446 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14448 d_getservent_r=undef
14449 getservent_r_proto=0
14453 *) getservent_r_proto=0
14457 : see if prototypes for various getservxxx netdb.h functions are available
14459 set d_getservprotos getservent $i_netdb netdb.h
14462 : see if getspnam exists
14463 set getspnam d_getspnam
14466 : see if this is a shadow.h system
14467 set shadow.h i_shadow
14470 : see if getspnam_r exists
14471 set getspnam_r d_getspnam_r
14473 case "$d_getspnam_r" in
14475 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14476 case "$d_getspnam_r_proto:$usethreads" in
14477 ":define") d_getspnam_r_proto=define
14478 set d_getspnam_r_proto getspnam_r $hdrs
14482 case "$d_getspnam_r_proto" in
14484 case "$getspnam_r_proto" in
14485 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14486 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14488 case "$getspnam_r_proto" in
14489 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14490 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14492 case "$getspnam_r_proto" in
14493 ''|0) d_getspnam_r=undef
14495 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14496 * ) case "$getspnam_r_proto" in
14497 REENTRANT_PROTO*) ;;
14498 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14500 echo "Prototype: $try" ;;
14503 *) case "$usethreads" in
14504 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14511 *) getspnam_r_proto=0
14515 : see if gettimeofday or ftime exists
14516 set gettimeofday d_gettimeod
14518 case "$d_gettimeod" in
14524 val="$undef"; set d_ftime; eval $setvar
14527 case "$d_gettimeod$d_ftime" in
14530 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14534 : see if gmtime_r exists
14535 set gmtime_r d_gmtime_r
14537 case "$d_gmtime_r" in
14539 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14540 case "$d_gmtime_r_proto:$usethreads" in
14541 ":define") d_gmtime_r_proto=define
14542 set d_gmtime_r_proto gmtime_r $hdrs
14546 case "$d_gmtime_r_proto" in
14548 case "$gmtime_r_proto" in
14549 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14550 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14552 case "$gmtime_r_proto" in
14553 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14554 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14556 case "$gmtime_r_proto" in
14557 ''|0) d_gmtime_r=undef
14559 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14560 * ) case "$gmtime_r_proto" in
14561 REENTRANT_PROTO*) ;;
14562 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14564 echo "Prototype: $try" ;;
14567 *) case "$usethreads" in
14568 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14575 *) gmtime_r_proto=0
14579 : see if hasmntopt exists
14580 set hasmntopt d_hasmntopt
14583 : see if this is a netinet/in.h or sys/in.h system
14584 set netinet/in.h i_niin sys/in.h i_sysin
14587 : see if arpa/inet.h has to be included
14588 set arpa/inet.h i_arpainet
14591 : see if htonl --and friends-- exists
14596 : Maybe they are macros.
14599 $cat >htonl.c <<EOM
14601 #include <sys/types.h>
14602 #$i_niin I_NETINET_IN
14604 #$i_arpainet I_ARPA_INET
14605 #ifdef I_NETINET_IN
14606 #include <netinet/in.h>
14609 #include <sys/in.h>
14612 #include <arpa/inet.h>
14615 printf("Defined as a macro.");
14618 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14619 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14621 echo "But it seems to be defined as a macro." >&4
14629 : see if ilogbl exists
14630 set ilogbl d_ilogbl
14635 if set index val -f; eval $csym; $val; then
14636 if set strchr val -f d_strchr; eval $csym; $val; then
14637 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14640 echo "strchr() found." >&4
14644 echo "index() found." >&4
14649 echo "index() found." >&4
14652 if set strchr val -f d_strchr; eval $csym; $val; then
14655 echo "strchr() found." >&4
14657 echo "No index() or strchr() found!" >&4
14662 set d_strchr; eval $setvar
14664 set d_index; eval $setvar
14666 : check whether inet_aton exists
14667 set inet_aton d_inetaton
14672 $cat >isascii.c <<EOCP
14675 #$i_stdlib I_STDLIB
14677 #include <stdlib.h>
14688 if eval $compile; then
14689 echo "isascii() found." >&4
14692 echo "isascii() NOT found." >&4
14699 : see if isfinite exists
14700 set isfinite d_isfinite
14703 : see if isinf exists
14707 : see if isnan exists
14711 : see if isnanl exists
14712 set isnanl d_isnanl
14715 : see if killpg exists
14716 set killpg d_killpg
14719 : see if lchown exists
14721 $cat > try.c <<'EOCP'
14722 /* System header to define __stub macros and hopefully few prototypes,
14723 which can conflict with char lchown(); below. */
14724 #include <assert.h>
14725 /* Override any gcc2 internal prototype to avoid an error. */
14726 /* We use char because int might match the return type of a gcc2
14727 builtin and then its argument prototype would still apply. */
14730 /* The GNU C library defines this for functions which it implements
14731 to always fail with ENOSYS. Some functions are actually named
14732 something starting with __ and the normal name is an alias. */
14733 #if defined (__stub_lchown) || defined (__stub___lchown)
14741 if eval $compile; then
14742 $echo "lchown() found." >&4
14745 $echo "lchown() NOT found." >&4
14751 : See if number of significant digits in a double precision number is known
14753 $cat >ldbl_dig.c <<EOM
14754 #$i_limits I_LIMITS
14757 #include <limits.h>
14763 printf("Contains LDBL_DIG");
14766 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14767 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14768 echo "LDBL_DIG found." >&4
14771 echo "LDBL_DIG NOT found." >&4
14778 : see if this is a math.h system
14782 : check to see if math.h defines _LIB_VERSION
14783 d_libm_lib_version="$undef"
14787 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14789 #include <unistd.h>
14791 int main (int argc, char *argv[])
14793 printf ("%d\n", _LIB_VERSION);
14798 if eval $compile; then
14800 echo "Yes, it does ($foo)" >&4
14801 d_libm_lib_version="$define"
14803 echo "No, it does not (probably harmless)" >&4
14810 : see if link exists
14814 : see if localtime_r exists
14815 set localtime_r d_localtime_r
14817 case "$d_localtime_r" in
14819 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14820 case "$d_localtime_r_proto:$usethreads" in
14821 ":define") d_localtime_r_proto=define
14822 set d_localtime_r_proto localtime_r $hdrs
14826 case "$d_localtime_r_proto" in
14828 case "$localtime_r_proto" in
14829 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14830 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14832 case "$localtime_r_proto" in
14833 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14834 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14836 case "$localtime_r_proto" in
14837 ''|0) d_localtime_r=undef
14838 localtime_r_proto=0
14839 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14840 * ) case "$localtime_r_proto" in
14841 REENTRANT_PROTO*) ;;
14842 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14844 echo "Prototype: $try" ;;
14847 *) case "$usethreads" in
14848 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14850 d_localtime_r=undef
14851 localtime_r_proto=0
14855 *) localtime_r_proto=0
14859 : see if localtime_r calls tzset
14860 case "$localtime_r_proto" in
14863 /* Does our libc's localtime_r call tzset ?
14864 * return 0 if so, 1 otherwise.
14866 #include <sys/types.h>
14867 #include <unistd.h>
14869 #include <string.h>
14870 #include <malloc.h>
14873 time_t t = time(0L);
14874 char w_tz[]="TZ" "=GMT+5",
14875 e_tz[]="TZ" "=GMT-5",
14876 *tz_e = (char*)malloc(16),
14877 *tz_w = (char*)malloc(16);
14878 struct tm tm_e, tm_w;
14879 memset(&tm_e,'\0',sizeof(struct tm));
14880 memset(&tm_w,'\0',sizeof(struct tm));
14885 localtime_r(&t, &tm_e);
14888 localtime_r(&t, &tm_w);
14890 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14896 if eval $compile; then
14897 if $run ./try; then
14898 d_localtime_r_needs_tzset=undef;
14900 d_localtime_r_needs_tzset=define;
14903 d_localtime_r_needs_tzset=undef;
14907 d_localtime_r_needs_tzset=undef;
14912 : see if localeconv exists
14913 set localeconv d_locconv
14916 : see if lockf exists
14920 : see if prototype for lseek is available
14922 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14925 : see if lstat exists
14929 : see if madvise exists
14930 set madvise d_madvise
14933 : see if malloc_size exists
14934 set malloc_size d_malloc_size
14937 : see if malloc_size_good exists
14938 set malloc_good_size d_malloc_good_size
14941 : see if mblen exists
14945 : see if mbstowcs exists
14946 set mbstowcs d_mbstowcs
14949 : see if mbtowc exists
14950 set mbtowc d_mbtowc
14953 : see if memchr exists
14954 set memchr d_memchr
14957 : see if memcmp exists
14958 set memcmp d_memcmp
14961 : see if memcpy exists
14962 set memcpy d_memcpy
14965 : see if memmove exists
14966 set memmove d_memmove
14969 : see if memset exists
14970 set memset d_memset
14973 : see if mkdir exists
14977 : see if mkdtemp exists
14978 set mkdtemp d_mkdtemp
14981 : see if mkfifo exists
14982 set mkfifo d_mkfifo
14985 : see if mkstemp exists
14986 set mkstemp d_mkstemp
14989 : see if mkstemps exists
14990 set mkstemps d_mkstemps
14993 : see if mktime exists
14994 set mktime d_mktime
14997 : see if this is a sys/mman.h system
14998 set sys/mman.h i_sysmman
15001 : see if mmap exists
15004 : see what shmat returns
15005 : default to something harmless
15007 case "$i_sysmman$d_mmap" in
15009 $cat >mmap.c <<'END'
15010 #include <sys/mman.h>
15013 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15018 echo "and it returns ($mmaptype)." >&4
15024 : see if sqrtl exists
15028 : see if scalbnl exists
15029 set scalbnl d_scalbnl
15032 : see if modfl exists
15036 : see if prototype for modfl is available
15038 set d_modflproto modfl $i_math math.h
15041 d_modfl_pow32_bug="$undef"
15043 case "$d_longdbl$d_modfl" in
15046 Checking to see whether your modfl() is okay for large values...
15052 if $test "X$d_modflproto" != "X$define"; then
15053 $cat >>try.c <<EOCP
15054 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15055 long double modfl (long double, long double *);
15058 $cat >>try.c <<EOCP
15060 long double nv = 4294967303.15;
15066 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15070 case "$osname:$gccversion" in
15071 aix:) saveccflags="$ccflags"
15072 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15075 if eval $compile; then
15078 *" 4294967303.150000 1.150000 4294967302.000000")
15079 echo >&4 "Your modfl() is broken for large values."
15080 d_modfl_pow32_bug="$define"
15082 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15086 *" 4294967303.150000 0.150000 4294967303.000000")
15087 echo >&4 "Your modfl() seems okay for large values."
15089 *) echo >&4 "I don't understand your modfl() at all."
15095 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15098 case "$osname:$gccversion" in
15099 aix:) ccflags="$saveccflags" ;; # restore
15104 if $test "$uselongdouble" = "$define"; then
15106 if $test "$d_sqrtl" != "$define"; then
15107 message="$message sqrtl"
15109 if $test "$d_modfl" != "$define"; then
15110 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15111 echo "You have both aintl and copysignl, so I can emulate modfl."
15113 message="$message modfl"
15116 if $test "$d_frexpl" != "$define"; then
15117 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15118 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15120 message="$message frexpl"
15124 if $test "$message" != ""; then
15127 *** You requested the use of long doubles but you do not seem to have
15128 *** the following mathematical functions needed for long double support:
15130 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15131 *** Cannot continue, aborting.
15139 : see if mprotect exists
15140 set mprotect d_mprotect
15143 : see if msgctl exists
15144 set msgctl d_msgctl
15147 : see if msgget exists
15148 set msgget d_msgget
15151 : see if msgsnd exists
15152 set msgsnd d_msgsnd
15155 : see if msgrcv exists
15156 set msgrcv d_msgrcv
15159 : see how much of the 'msg*(2)' library is present.
15162 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15163 *"$undef"*) h_msg=false;;
15167 case "`ipcs 2>&1`" in
15168 "SVID messages"*"not configured"*)
15169 echo "Your $osname does not have the msg*(2) configured." >&4
15172 set msgctl d_msgctl
15174 set msgget d_msgget
15176 set msgsnd d_msgsnd
15178 set msgrcv d_msgrcv
15184 : we could also check for sys/ipc.h ...
15185 if $h_msg && $test `./findhdr sys/msg.h`; then
15186 echo "You have the full msg*(2) library." >&4
15189 echo "You don't have the full msg*(2) library." >&4
15195 : Check for msghdr_s
15197 echo "Checking to see if your system supports struct msghdr..." >&4
15198 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15200 case "$d_msghdr_s" in
15201 "$define") echo "Yes, it does." ;;
15202 *) echo "No, it doesn't." ;;
15206 : see if msync exists
15210 : see if munmap exists
15211 set munmap d_munmap
15214 : see if nice exists
15218 : see if this is a langinfo.h system
15219 set langinfo.h i_langinfo
15222 : see if nl_langinfo exists
15223 set nl_langinfo d_nl_langinfo
15226 : check for volatile keyword
15228 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15229 $cat >try.c <<'EOCP'
15232 typedef struct _goo_struct goo_struct;
15233 goo_struct * volatile goo = ((goo_struct *)0);
15234 struct _goo_struct {
15239 typedef unsigned short foo_t;
15240 char *volatile foo;
15242 volatile foo_t blech;
15246 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15248 echo "Yup, it does."
15251 echo "Nope, it doesn't."
15257 : Check basic sizes
15259 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15261 case "$use64bitint:$d_quad:$quadtype" in
15264 uvtype="$uquadtype"
15269 uvtype="unsigned long"
15275 case "$uselongdouble:$d_longdbl" in
15277 nvtype="long double"
15278 nvsize=$longdblsize
15285 $echo "(IV will be "$ivtype", $ivsize bytes)"
15286 $echo "(UV will be "$uvtype", $uvsize bytes)"
15287 $echo "(NV will be "$nvtype", $nvsize bytes)"
15290 #$i_inttypes I_INTTYPES
15292 #include <inttypes.h>
15297 int8_t i = INT8_MAX;
15298 uint8_t u = UINT8_MAX;
15299 printf("int8_t\n");
15302 int16_t i = INT16_MAX;
15303 uint16_t i = UINT16_MAX;
15304 printf("int16_t\n");
15307 int32_t i = INT32_MAX;
15308 uint32_t u = UINT32_MAX;
15309 printf("int32_t\n");
15314 i8type="signed char"
15315 u8type="unsigned char"
15320 '') case "$shortsize" in
15322 u16type="unsigned short"
15330 '') set try -DINT16
15331 if eval $compile; then
15332 case "`$run ./try`" in
15344 '') if $test $shortsize -ge 2; then
15346 u16type="unsigned short"
15354 '') case "$longsize" in
15356 u32type="unsigned long"
15360 *) case "$intsize" in
15362 u32type="unsigned int"
15372 '') set try -DINT32
15373 if eval $compile; then
15374 case "`$run ./try`" in
15386 '') if $test $intsize -ge 4; then
15388 u32type="unsigned int"
15396 '') case "$d_quad:$quadtype" in
15398 i64type="$quadtype"
15399 u64type="$uquadtype"
15407 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15408 : volatile so that the compiler has to store it out to memory.
15409 if test X"$d_volatile" = X"$define"; then
15414 #$i_stdlib I_STDLIB
15416 #include <stdlib.h>
15418 #include <sys/types.h>
15419 #include <signal.h>
15421 $volatile int bletched = 0;
15422 $signal_t blech(int s) { bletched = 1; }
15427 int n = 8 * $uvsize;
15430 signal(SIGFPE, blech);
15433 for (i = 0; i < n; i++) {
15434 u = u << 1 | ($uvtype)1;
15436 if (($uvtype)d != u)
15440 d = ($nvtype)(u - 1);
15441 if (($uvtype)d != (u - 1))
15448 printf("%d\n", ((i == n) ? -n : i));
15454 d_nv_preserves_uv="$undef"
15455 if eval $compile; then
15456 nv_preserves_uv_bits="`$run ./try`"
15458 case "$nv_preserves_uv_bits" in
15460 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15461 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15462 d_nv_preserves_uv="$define"
15464 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15465 d_nv_preserves_uv="$undef" ;;
15466 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15467 nv_preserves_uv_bits="0" ;;
15471 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15472 : volatile so that the compiler has to store it out to memory.
15473 if test X"$d_volatile" = X"$define"; then
15478 #$i_stdlib I_STDLIB
15480 #include <stdlib.h>
15482 #$i_string I_STRING
15484 # include <string.h>
15486 # include <strings.h>
15488 #include <sys/types.h>
15489 #include <signal.h>
15491 $volatile int bletched = 0;
15492 $signal_t blech(int s) { bletched = 1; }
15495 int checkit($nvtype d, char *where) {
15496 unsigned char *p = (char *)&d;
15497 unsigned char *end = p + sizeof(d);
15507 printf("No - %s: 0x", where);
15509 printf ("%02X", *p++);
15514 int main(int argc, char **argv) {
15517 fail += checkit(d, "0.0");
15519 /* The compiler shouldn't be assuming that bletched is 0 */
15522 fail += checkit(d, "bleched");
15525 signal(SIGFPE, blech);
15528 /* Paranoia - the compiler should have no way of knowing that ANSI says
15529 that argv[argc] will always be NULL. Actually, if it did assume this it
15530 would be buggy, as this is C and main() can be called from elsewhere in
15532 d = argv[argc] ? 1 : 0;
15535 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15538 fail += checkit(d, "ternary");
15540 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15543 printf("No - memset doesn't give 0.0\n");
15544 /* This might just blow up: */
15545 printf("(gives %g)\n", d);
15551 printf("No - something bleched\n");
15556 printf("No - %d fail(s)\n", fail);
15565 d_nv_zero_is_allbits_zero="$undef"
15566 if eval $compile; then
15572 0.0 is represented as all bits zero in memory
15574 d_nv_zero_is_allbits_zero="$define"
15577 0.0 is not represented as all bits zero in memory
15579 d_nv_zero_is_allbits_zero="$undef"
15584 0.0 is not represented as all bits zero in memory
15586 d_nv_zero_is_allbits_zero="$undef"
15592 : check for off64_t
15594 echo "Checking to see if you have off64_t..." >&4
15596 #include <sys/types.h>
15597 #include <unistd.h>
15598 int main() { off64_t x = 7; }
15601 if eval $compile; then
15603 echo "You have off64_t."
15606 echo "You do not have off64_t."
15607 case "$lseeksize" in
15608 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15615 : how to create joinable pthreads
15616 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15618 echo "Checking what constant to use for creating joinable pthreads..." >&4
15619 $cat >try.c <<'EOCP'
15620 #include <pthread.h>
15622 int detachstate = JOINABLE;
15625 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15626 if eval $compile; then
15627 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15628 val="$undef" # Yes, undef.
15629 set d_old_pthread_create_joinable
15632 set old_pthread_create_joinable
15635 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15636 if eval $compile; then
15637 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15639 set d_old_pthread_create_joinable
15641 val=PTHREAD_CREATE_UNDETACHED
15642 set old_pthread_create_joinable
15645 set try -DJOINABLE=__UNDETACHED
15646 if eval $compile; then
15647 echo "You seem to use __UNDETACHED." >&4
15649 set d_old_pthread_create_joinable
15652 set old_pthread_create_joinable
15655 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15657 set d_old_pthread_create_joinable
15660 set old_pthread_create_joinable
15667 d_old_pthread_create_joinable="$undef"
15668 old_pthread_create_joinable=""
15671 : see if pause exists
15675 : see if poll exists
15679 : see if readlink exists
15680 set readlink d_readlink
15683 : Check if exe is symlink to abs path of executing program
15687 case "$d_readlink" in
15689 if $issymlink /proc/self/exe ; then
15690 $ls -l /proc/self/exe > reflect
15691 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15692 echo "You have Linux-like /proc/self/exe."
15693 procselfexe='"/proc/self/exe"'
15697 if $issymlink /proc/curproc/file ; then
15698 $ls -l /proc/curproc/file > reflect
15699 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15700 echo "You have BSD-like /proc/curproc/file."
15701 procselfexe='"/proc/curproc/file"'
15711 : backward compatibility for d_hvfork
15712 if test X$d_hvfork != X; then
15713 d_vfork="$d_hvfork"
15716 : see if there is a vfork
15721 d_pseudofork=$undef
15723 : Ok, but do we want to use it. vfork is reportedly unreliable in
15724 : perl on Solaris 2.x, and probably elsewhere.
15728 case "$usevfork" in
15734 Perl can only use a vfork() that doesn't suffer from strict
15735 restrictions on calling functions or modifying global data in
15736 the child. For example, glibc-2.1 contains such a vfork()
15737 that is unsuitable. If your system provides a proper fork()
15738 call, chances are that you do NOT want perl to use vfork().
15741 rp="Do you still want to use vfork()?"
15746 echo "Ok, we won't use vfork()."
15755 $define) usevfork='true';;
15756 *) usevfork='false';;
15759 : see whether the pthread_atfork exists
15761 #include <pthread.h>
15764 #ifdef PTHREAD_ATFORK
15765 pthread_atfork(NULL,NULL,NULL);
15770 : see if pthread_atfork exists
15771 set try -DPTHREAD_ATFORK
15772 if eval $compile; then
15777 case "$usethreads" in
15780 $define) echo 'pthread_atfork found.' >&4 ;;
15781 *) echo 'pthread_atfork NOT found.' >&4 ;;
15784 set d_pthread_atfork
15787 : see if pthread_attr_setscope exists
15788 set pthread_attr_setscope d_pthread_attr_setscope
15791 : see whether the various POSIXish _yields exist
15793 #include <pthread.h>
15799 #ifdef PTHREAD_YIELD
15802 #ifdef PTHREAD_YIELD_NULL
15803 pthread_yield(NULL);
15809 : see if sched_yield exists
15810 set try -DSCHED_YIELD
15811 if eval $compile; then
15813 sched_yield='sched_yield()'
15817 case "$usethreads" in
15820 $define) echo 'sched_yield() found.' >&4 ;;
15821 *) echo 'sched_yield() NOT found.' >&4 ;;
15827 : see if pthread_yield exists
15828 set try -DPTHREAD_YIELD
15829 if eval $compile; then
15831 case "$sched_yield" in
15832 '') sched_yield='pthread_yield()' ;;
15835 set try -DPTHREAD_YIELD_NULL
15836 if eval $compile; then
15838 case "$sched_yield" in
15839 '') sched_yield='pthread_yield(NULL)' ;;
15845 case "$usethreads" in
15848 $define) echo 'pthread_yield() found.' >&4 ;;
15849 *) echo 'pthread_yield() NOT found.' >&4 ;;
15853 set d_pthread_yield
15855 case "$sched_yield" in
15856 '') sched_yield=undef ;;
15860 : see if random_r exists
15861 set random_r d_random_r
15863 case "$d_random_r" in
15865 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15866 case "$d_random_r_proto:$usethreads" in
15867 ":define") d_random_r_proto=define
15868 set d_random_r_proto random_r $hdrs
15872 case "$d_random_r_proto" in
15874 case "$random_r_proto" in
15875 ''|0) try='int random_r(int*, struct random_data*);'
15876 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15878 case "$random_r_proto" in
15879 ''|0) try='int random_r(long*, struct random_data*);'
15880 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15882 case "$random_r_proto" in
15883 ''|0) try='int random_r(struct random_data*, int32_t*);'
15884 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15886 case "$random_r_proto" in
15887 ''|0) d_random_r=undef
15889 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15890 * ) case "$random_r_proto" in
15891 REENTRANT_PROTO*) ;;
15892 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15894 echo "Prototype: $try" ;;
15897 *) case "$usethreads" in
15898 define) echo "random_r has no prototype, not using it." >&4 ;;
15905 *) random_r_proto=0
15909 : see if readdir and friends exist
15910 set readdir d_readdir
15912 set seekdir d_seekdir
15914 set telldir d_telldir
15916 set rewinddir d_rewinddir
15919 : see if readdir64_r exists
15920 set readdir64_r d_readdir64_r
15922 case "$d_readdir64_r" in
15924 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15925 case "$d_readdir64_r_proto:$usethreads" in
15926 ":define") d_readdir64_r_proto=define
15927 set d_readdir64_r_proto readdir64_r $hdrs
15931 case "$d_readdir64_r_proto" in
15933 case "$readdir64_r_proto" in
15934 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15935 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15937 case "$readdir64_r_proto" in
15938 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15939 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15941 case "$readdir64_r_proto" in
15942 ''|0) d_readdir64_r=undef
15943 readdir64_r_proto=0
15944 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15945 * ) case "$readdir64_r_proto" in
15946 REENTRANT_PROTO*) ;;
15947 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15949 echo "Prototype: $try" ;;
15952 *) case "$usethreads" in
15953 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15955 d_readdir64_r=undef
15956 readdir64_r_proto=0
15960 *) readdir64_r_proto=0
15964 : see if readdir_r exists
15965 set readdir_r d_readdir_r
15967 case "$d_readdir_r" in
15969 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15970 case "$d_readdir_r_proto:$usethreads" in
15971 ":define") d_readdir_r_proto=define
15972 set d_readdir_r_proto readdir_r $hdrs
15976 case "$d_readdir_r_proto" in
15978 case "$readdir_r_proto" in
15979 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15980 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15982 case "$readdir_r_proto" in
15983 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15984 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15986 case "$readdir_r_proto" in
15987 ''|0) d_readdir_r=undef
15989 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15990 * ) case "$readdir_r_proto" in
15991 REENTRANT_PROTO*) ;;
15992 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15994 echo "Prototype: $try" ;;
15997 *) case "$usethreads" in
15998 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16005 *) readdir_r_proto=0
16009 : see if readv exists
16013 : see if recvmsg exists
16014 set recvmsg d_recvmsg
16017 : see if rename exists
16018 set rename d_rename
16021 : see if rmdir exists
16025 : see if memory.h is available.
16030 : See if it conflicts with string.h
16036 $cppstdin $cppflags $cppminus < $strings > mem.h
16037 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16039 echo "We won't be including <memory.h>."
16049 : can bcopy handle overlapping blocks?
16052 case "$d_memmove" in
16053 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16054 *) case "$d_bcopy" in
16056 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16058 #$i_memory I_MEMORY
16059 #$i_stdlib I_STDLIB
16060 #$i_string I_STRING
16061 #$i_unistd I_UNISTD
16063 $cat >>try.c <<'EOCP'
16066 # include <memory.h>
16069 # include <stdlib.h>
16072 # include <string.h>
16074 # include <strings.h>
16077 # include <unistd.h> /* Needed for NetBSD */
16081 char buf[128], abc[128];
16087 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16088 try to store the string in read-only memory. */
16089 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16091 for (align = 7; align >= 0; align--) {
16092 for (len = 36; len; len--) {
16094 bcopy(abc, b, len);
16095 for (off = 1; off <= len; off++) {
16096 bcopy(b, b+off, len);
16097 bcopy(b+off, b, len);
16098 if (bcmp(b, abc, len))
16107 if eval $compile_ok; then
16108 if $run ./try 2>/dev/null; then
16109 echo "Yes, it can."
16112 echo "It can't, sorry."
16115 echo "(I can't compile the test program, so we'll assume not...)"
16125 : can memcpy handle overlapping blocks?
16128 case "$d_memmove" in
16129 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16130 *) case "$d_memcpy" in
16132 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16134 #$i_memory I_MEMORY
16135 #$i_stdlib I_STDLIB
16136 #$i_string I_STRING
16137 #$i_unistd I_UNISTD
16139 $cat >>try.c <<'EOCP'
16142 # include <memory.h>
16145 # include <stdlib.h>
16148 # include <string.h>
16150 # include <strings.h>
16153 # include <unistd.h> /* Needed for NetBSD */
16157 char buf[128], abc[128];
16163 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16164 try to store the string in read-only memory. */
16165 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16167 for (align = 7; align >= 0; align--) {
16168 for (len = 36; len; len--) {
16170 memcpy(b, abc, len);
16171 for (off = 1; off <= len; off++) {
16172 memcpy(b+off, b, len);
16173 memcpy(b, b+off, len);
16174 if (memcmp(b, abc, len))
16183 if eval $compile_ok; then
16184 if $run ./try 2>/dev/null; then
16185 echo "Yes, it can."
16188 echo "It can't, sorry."
16191 echo "(I can't compile the test program, so we'll assume not...)"
16201 : can memcmp be trusted to compare relative magnitude?
16203 case "$d_memcmp" in
16206 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16208 #$i_memory I_MEMORY
16209 #$i_stdlib I_STDLIB
16210 #$i_string I_STRING
16211 #$i_unistd I_UNISTD
16213 $cat >>try.c <<'EOCP'
16216 # include <memory.h>
16219 # include <stdlib.h>
16222 # include <string.h>
16224 # include <strings.h>
16227 # include <unistd.h> /* Needed for NetBSD */
16233 if ((a < b) && memcmp(&a, &b, 1) < 0)
16239 if eval $compile_ok; then
16240 if $run ./try 2>/dev/null; then
16241 echo "Yes, it can."
16244 echo "No, it can't (it uses signed chars)."
16247 echo "(I can't compile the test program, so we'll assume not...)"
16255 : see if prototype for sbrk is available
16257 set d_sbrkproto sbrk $i_unistd unistd.h
16260 : see if select exists
16261 set select d_select
16264 : see if semctl exists
16265 set semctl d_semctl
16268 : see if semget exists
16269 set semget d_semget
16272 : see if semop exists
16276 : see how much of the 'sem*(2)' library is present.
16279 case "$d_semctl$d_semget$d_semop" in
16280 *"$undef"*) h_sem=false;;
16284 case "`ipcs 2>&1`" in
16285 "SVID messages"*"not configured"*)
16286 echo "Your $osname does not have the sem*(2) configured." >&4
16289 set semctl d_semctl
16291 set semget d_semget
16299 : we could also check for sys/ipc.h ...
16300 if $h_sem && $test `./findhdr sys/sem.h`; then
16301 echo "You have the full sem*(2) library." >&4
16304 echo "You don't have the full sem*(2) library." >&4
16310 : see whether sys/sem.h defines union semun
16312 $cat > try.c <<'END'
16313 #include <sys/types.h>
16314 #include <sys/ipc.h>
16315 #include <sys/sem.h>
16316 int main () { union semun semun; semun.buf = 0; }
16319 if eval $compile; then
16320 echo "You have union semun in <sys/sem.h>." >&4
16323 echo "You do not have union semun in <sys/sem.h>." >&4
16330 : see how to do semctl IPC_STAT
16334 $cat > tryh.h <<END
16337 # define S_IRUSR S_IREAD
16338 # define S_IWUSR S_IWRITE
16339 # define S_IXUSR S_IEXEC
16341 # define S_IRUSR 0400
16342 # define S_IWUSR 0200
16343 # define S_IXUSR 0100
16345 # define S_IRGRP (S_IRUSR>>3)
16346 # define S_IWGRP (S_IWUSR>>3)
16347 # define S_IXGRP (S_IXUSR>>3)
16348 # define S_IROTH (S_IRUSR>>6)
16349 # define S_IWOTH (S_IWUSR>>6)
16350 # define S_IXOTH (S_IXUSR>>6)
16353 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16354 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16355 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16358 : see whether semctl IPC_STAT can use union semun
16359 case "$d_semctl_semun" in
16363 #include <sys/types.h>
16364 #include <sys/ipc.h>
16365 #include <sys/sem.h>
16366 #include <sys/stat.h>
16373 #$d_union_semun HAS_UNION_SEMUN
16376 #ifndef HAS_UNION_SEMUN
16379 struct semid_ds *buf;
16380 unsigned short *array;
16386 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16387 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16389 struct semid_ds argbuf;
16392 st = semctl(sem, 0, IPC_STAT, arg);
16396 # endif /* IPC_STAT */
16397 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16399 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16400 # endif /* IPC_RMID */
16401 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16403 #endif /* IPC_PRIVATE && ... */
16404 printf("semget failed: errno = %d\n", errno);
16409 if eval $compile; then
16412 semun) val="$define" ;;
16420 case "$d_semctl_semun" in
16422 echo "You can use union semun for semctl IPC_STAT." >&4
16425 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16430 : see whether semctl IPC_STAT can use struct semid_ds pointer
16431 case "$d_semctl_semid_ds" in
16434 $cat > try.c <<'END'
16435 #include <sys/types.h>
16436 #include <sys/ipc.h>
16437 #include <sys/sem.h>
16438 #include <sys/stat.h>
16446 struct semid_ds arg;
16449 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16450 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16453 st = semctl(sem, 0, IPC_STAT, &arg);
16455 printf("semid_ds\n");
16457 # endif /* IPC_STAT */
16458 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16460 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16461 # endif /* IPC_RMID */
16462 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16464 #endif /* IPC_PRIVATE && ... */
16465 printf("semget failed: errno = %d\n", errno);
16471 if eval $compile; then
16474 semid_ds) val="$define" ;;
16478 set d_semctl_semid_ds
16482 case "$d_semctl_semid_ds" in
16484 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16486 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16492 # We do not have the full sem*(2) library, so assume we can not
16498 set d_semctl_semid_ds
16504 : see if sendmsg exists
16505 set sendmsg d_sendmsg
16508 : see if setegid exists
16509 set setegid d_setegid
16512 : see if seteuid exists
16513 set seteuid d_seteuid
16516 : see if setgrent exists
16517 set setgrent d_setgrent
16520 : see if setgrent_r exists
16521 set setgrent_r d_setgrent_r
16523 case "$d_setgrent_r" in
16525 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16526 case "$d_setgrent_r_proto:$usethreads" in
16527 ":define") d_setgrent_r_proto=define
16528 set d_setgrent_r_proto setgrent_r $hdrs
16532 case "$d_setgrent_r_proto" in
16534 case "$setgrent_r_proto" in
16535 ''|0) try='int setgrent_r(FILE**);'
16536 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16538 case "$setgrent_r_proto" in
16539 ''|0) try='void setgrent_r(FILE**);'
16540 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16542 case "$setgrent_r_proto" in
16543 ''|0) d_setgrent_r=undef
16545 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16546 * ) case "$setgrent_r_proto" in
16547 REENTRANT_PROTO*) ;;
16548 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16550 echo "Prototype: $try" ;;
16553 *) case "$usethreads" in
16554 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16561 *) setgrent_r_proto=0
16565 : see if sethostent exists
16566 set sethostent d_sethent
16569 : see if sethostent_r exists
16570 set sethostent_r d_sethostent_r
16572 case "$d_sethostent_r" in
16574 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16575 case "$d_sethostent_r_proto:$usethreads" in
16576 ":define") d_sethostent_r_proto=define
16577 set d_sethostent_r_proto sethostent_r $hdrs
16581 case "$d_sethostent_r_proto" in
16583 case "$sethostent_r_proto" in
16584 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16585 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16587 case "$sethostent_r_proto" in
16588 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16589 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16591 case "$sethostent_r_proto" in
16592 ''|0) d_sethostent_r=undef
16593 sethostent_r_proto=0
16594 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16595 * ) case "$sethostent_r_proto" in
16596 REENTRANT_PROTO*) ;;
16597 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16599 echo "Prototype: $try" ;;
16602 *) case "$usethreads" in
16603 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16605 d_sethostent_r=undef
16606 sethostent_r_proto=0
16610 *) sethostent_r_proto=0
16614 : see if setitimer exists
16615 set setitimer d_setitimer
16618 : see if setlinebuf exists
16619 set setlinebuf d_setlinebuf
16622 : see if setlocale exists
16623 set setlocale d_setlocale
16626 : see if locale.h is available
16627 set locale.h i_locale
16630 : see if setlocale_r exists
16631 set setlocale_r d_setlocale_r
16633 case "$d_setlocale_r" in
16635 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16636 case "$d_setlocale_r_proto:$usethreads" in
16637 ":define") d_setlocale_r_proto=define
16638 set d_setlocale_r_proto setlocale_r $hdrs
16642 case "$d_setlocale_r_proto" in
16644 case "$setlocale_r_proto" in
16645 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16646 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16648 case "$setlocale_r_proto" in
16649 ''|0) d_setlocale_r=undef
16650 setlocale_r_proto=0
16651 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16652 * ) case "$setlocale_r_proto" in
16653 REENTRANT_PROTO*) ;;
16654 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16656 echo "Prototype: $try" ;;
16659 *) case "$usethreads" in
16660 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16662 d_setlocale_r=undef
16663 setlocale_r_proto=0
16667 *) setlocale_r_proto=0
16671 : see if setnetent exists
16672 set setnetent d_setnent
16675 : see if setnetent_r exists
16676 set setnetent_r d_setnetent_r
16678 case "$d_setnetent_r" in
16680 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16681 case "$d_setnetent_r_proto:$usethreads" in
16682 ":define") d_setnetent_r_proto=define
16683 set d_setnetent_r_proto setnetent_r $hdrs
16687 case "$d_setnetent_r_proto" in
16689 case "$setnetent_r_proto" in
16690 ''|0) try='int setnetent_r(int, struct netent_data*);'
16691 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16693 case "$setnetent_r_proto" in
16694 ''|0) try='void setnetent_r(int, struct netent_data*);'
16695 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16697 case "$setnetent_r_proto" in
16698 ''|0) d_setnetent_r=undef
16699 setnetent_r_proto=0
16700 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16701 * ) case "$setnetent_r_proto" in
16702 REENTRANT_PROTO*) ;;
16703 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16705 echo "Prototype: $try" ;;
16708 *) case "$usethreads" in
16709 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16711 d_setnetent_r=undef
16712 setnetent_r_proto=0
16716 *) setnetent_r_proto=0
16720 : see if setprotoent exists
16721 set setprotoent d_setpent
16724 : see if setpgid exists
16725 set setpgid d_setpgid
16728 : see if setpgrp2 exists
16729 set setpgrp2 d_setpgrp2
16732 : see if setpriority exists
16733 set setpriority d_setprior
16736 : see if setproctitle exists
16737 set setproctitle d_setproctitle
16740 : see if setprotoent_r exists
16741 set setprotoent_r d_setprotoent_r
16743 case "$d_setprotoent_r" in
16745 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16746 case "$d_setprotoent_r_proto:$usethreads" in
16747 ":define") d_setprotoent_r_proto=define
16748 set d_setprotoent_r_proto setprotoent_r $hdrs
16752 case "$d_setprotoent_r_proto" in
16754 case "$setprotoent_r_proto" in
16755 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16756 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16758 case "$setprotoent_r_proto" in
16759 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16760 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16762 case "$setprotoent_r_proto" in
16763 ''|0) d_setprotoent_r=undef
16764 setprotoent_r_proto=0
16765 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16766 * ) case "$setprotoent_r_proto" in
16767 REENTRANT_PROTO*) ;;
16768 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16770 echo "Prototype: $try" ;;
16773 *) case "$usethreads" in
16774 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16776 d_setprotoent_r=undef
16777 setprotoent_r_proto=0
16781 *) setprotoent_r_proto=0
16785 : see if setpwent exists
16786 set setpwent d_setpwent
16789 : see if setpwent_r exists
16790 set setpwent_r d_setpwent_r
16792 case "$d_setpwent_r" in
16794 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16795 case "$d_setpwent_r_proto:$usethreads" in
16796 ":define") d_setpwent_r_proto=define
16797 set d_setpwent_r_proto setpwent_r $hdrs
16801 case "$d_setpwent_r_proto" in
16803 case "$setpwent_r_proto" in
16804 ''|0) try='int setpwent_r(FILE**);'
16805 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16807 case "$setpwent_r_proto" in
16808 ''|0) try='void setpwent_r(FILE**);'
16809 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16811 case "$setpwent_r_proto" in
16812 ''|0) d_setpwent_r=undef
16814 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16815 * ) case "$setpwent_r_proto" in
16816 REENTRANT_PROTO*) ;;
16817 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16819 echo "Prototype: $try" ;;
16822 *) case "$usethreads" in
16823 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16830 *) setpwent_r_proto=0
16834 : see if setregid exists
16835 set setregid d_setregid
16837 set setresgid d_setresgid
16840 : see if setreuid exists
16841 set setreuid d_setreuid
16843 set setresuid d_setresuid
16846 : see if setrgid exists
16847 set setrgid d_setrgid
16850 : see if setruid exists
16851 set setruid d_setruid
16854 : see if setservent exists
16855 set setservent d_setsent
16858 : see if setservent_r exists
16859 set setservent_r d_setservent_r
16861 case "$d_setservent_r" in
16863 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16864 case "$d_setservent_r_proto:$usethreads" in
16865 ":define") d_setservent_r_proto=define
16866 set d_setservent_r_proto setservent_r $hdrs
16870 case "$d_setservent_r_proto" in
16872 case "$setservent_r_proto" in
16873 ''|0) try='int setservent_r(int, struct servent_data*);'
16874 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16876 case "$setservent_r_proto" in
16877 ''|0) try='void setservent_r(int, struct servent_data*);'
16878 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16880 case "$setservent_r_proto" in
16881 ''|0) d_setservent_r=undef
16882 setservent_r_proto=0
16883 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16884 * ) case "$setservent_r_proto" in
16885 REENTRANT_PROTO*) ;;
16886 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16888 echo "Prototype: $try" ;;
16891 *) case "$usethreads" in
16892 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16894 d_setservent_r=undef
16895 setservent_r_proto=0
16899 *) setservent_r_proto=0
16903 : see if setsid exists
16904 set setsid d_setsid
16907 : see if setvbuf exists
16908 set setvbuf d_setvbuf
16911 : see if sfio.h is available
16915 : see if sfio library is available
16926 : Ok, but do we want to use it.
16930 true|$define|[yY]*) dflt='y';;
16933 echo "$package can use the sfio library, but it is experimental."
16934 case "$useperlio" in
16936 echo "For sfio also the PerlIO abstraction layer is needed."
16937 echo "Earlier you said you wouldn't want that."
16940 rp="You seem to have sfio available, do you want to try using it?"
16943 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16944 useperlio="$define"
16947 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16952 *) case "$usesfio" in
16953 true|$define|[yY]*)
16954 echo "Sorry, cannot find sfio on this machine." >&4
16955 echo "Ignoring your setting of usesfio=$usesfio." >&4
16964 $define) usesfio='true';;
16965 *) usesfio='false';;
16969 *) : Remove sfio from list of libraries to use
16972 echo "Removing unneeded -lsfio from library list" >&4
16973 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16976 echo "libs = $libs" >&4
16983 : see if shmctl exists
16984 set shmctl d_shmctl
16987 : see if shmget exists
16988 set shmget d_shmget
16991 : see if shmat exists
16994 : see what shmat returns
16997 $cat >shmat.c <<'END'
16998 #include <sys/shm.h>
17001 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17006 echo "and it returns ($shmattype)." >&4
17007 : see if a prototype for shmat is available
17008 xxx=`./findhdr sys/shm.h`
17009 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17010 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17021 set d_shmatprototype
17024 : see if shmdt exists
17028 : see how much of the 'shm*(2)' library is present.
17031 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17032 *"$undef"*) h_shm=false;;
17036 case "`ipcs 2>&1`" in
17037 "SVID shared memory"*"not configured"*)
17038 echo "Your $osname does not have the shm*(2) configured." >&4
17041 set shmctl d_shmctl
17043 set shmget d_shmget
17053 : we could also check for sys/ipc.h ...
17054 if $h_shm && $test `./findhdr sys/shm.h`; then
17055 echo "You have the full shm*(2) library." >&4
17058 echo "You don't have the full shm*(2) library." >&4
17064 : see if we have sigaction
17066 if set sigaction val -f d_sigaction; eval $csym; $val; then
17067 echo 'sigaction() found.' >&4
17070 #include <sys/types.h>
17071 #include <signal.h>
17072 #$i_stdlib I_STDLIB
17074 #include <stdlib.h>
17078 struct sigaction act, oact;
17080 oact.sa_handler = 0;
17081 /* so that act and oact are used */
17082 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17086 if eval $compile_ok; then
17089 echo "But you don't seem to have a useable struct sigaction." >&4
17093 echo 'sigaction NOT found.' >&4
17096 set d_sigaction; eval $setvar
17099 : see if this is a sunmath.h system
17100 set sunmath.h i_sunmath
17103 : see if signbit exists
17104 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17107 #$i_sunmath I_SUNMATH
17111 #ifdef I_SUNMATH /* Solaris special math library */
17112 # include <sunmath.h>
17115 int main(int argc, char **argv)
17119 if ((signbit(x) == 0) && (signbit(y) != 0))
17127 if eval $compile; then
17128 if $run ./try; then
17132 $echo "Signbit seems to be available, but doesn't work as I expected."
17133 $echo "I won't use it." >&4
17144 : see if sigprocmask exists
17145 set sigprocmask d_sigprocmask
17148 : see if sigsetjmp exists
17150 case "$d_sigsetjmp" in
17153 #include <setjmp.h>
17154 #$i_stdlib I_STDLIB
17156 #include <stdlib.h>
17162 if (sigsetjmp(env,1))
17165 siglongjmp(env, 1);
17170 if eval $compile; then
17171 if $run ./try >/dev/null 2>&1; then
17172 echo "POSIX sigsetjmp found." >&4
17176 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17182 echo "sigsetjmp not found." >&4
17186 *) val="$d_sigsetjmp"
17187 case "$d_sigsetjmp" in
17188 $define) echo "POSIX sigsetjmp found." >&4;;
17189 $undef) echo "sigsetjmp not found." >&4;;
17197 : see if snprintf exists
17198 set snprintf d_snprintf
17201 : see if vsnprintf exists
17202 set vsnprintf d_vsnprintf
17205 case "$d_snprintf-$d_vsnprintf" in
17208 Checking whether your snprintf() and vsnprintf() work okay...
17210 $cat >try.c <<'EOCP'
17211 /* v?snprintf testing logic courtesy of Russ Allbery.
17212 * According to C99:
17213 * - if the buffer is too short it still must be \0-terminated
17214 * - if the buffer is too short the potentially required length
17215 * must be returned and not -1
17216 * - if the buffer is NULL the potentially required length
17217 * must be returned and not -1 or core dump
17220 #include <stdarg.h>
17224 int test (char *format, ...)
17229 va_start (args, format);
17230 count = vsnprintf (buf, sizeof buf, format, args);
17237 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17238 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17242 if eval $compile; then
17245 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17247 Your snprintf() and snprintf() don't seem to be working okay.
17249 d_snprintf="$undef"
17250 d_vsnprintf="$undef"
17254 echo "(I can't seem to compile the test program--assuming they don't)"
17255 d_snprintf="$undef"
17256 d_vsnprintf="$undef"
17262 : see if sockatmark exists
17263 set sockatmark d_sockatmark
17266 : see if prototype for sockatmark is available
17268 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17271 : see if socks5_init exists
17272 set socks5_init d_socks5_init
17275 : see if sprintf returns the length of the string in the buffer as per ANSI
17276 $echo "Checking whether sprintf returns the length of the string..." >&4
17279 #$i_stdlib I_STDLIB
17281 #include <stdlib.h>
17283 #$i_string I_STRING
17285 # include <string.h>
17287 # include <strings.h>
17296 int check (size_t expect, int test) {
17297 size_t got = strlen(buffer);
17301 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17306 int main(int argc, char **argv) {
17309 check(sprintf(buffer, ""), ++test);
17310 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17311 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17318 d_sprintf_returns_strlen="$undef"
17319 if eval $compile; then
17323 sprintf returns the length of the string (as ANSI says it should)
17325 d_sprintf_returns_strlen="$define"
17328 sprintf does not return the length of the string (how old is this system?)
17330 d_sprintf_returns_strlen="$undef"
17336 : see if srand48_r exists
17337 set srand48_r d_srand48_r
17339 case "$d_srand48_r" in
17341 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17342 case "$d_srand48_r_proto:$usethreads" in
17343 ":define") d_srand48_r_proto=define
17344 set d_srand48_r_proto srand48_r $hdrs
17348 case "$d_srand48_r_proto" in
17350 case "$srand48_r_proto" in
17351 ''|0) try='int srand48_r(long, struct drand48_data*);'
17352 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17354 case "$srand48_r_proto" in
17355 ''|0) d_srand48_r=undef
17357 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17358 * ) case "$srand48_r_proto" in
17359 REENTRANT_PROTO*) ;;
17360 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17362 echo "Prototype: $try" ;;
17365 *) case "$usethreads" in
17366 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17373 *) srand48_r_proto=0
17377 : see if srandom_r exists
17378 set srandom_r d_srandom_r
17380 case "$d_srandom_r" in
17382 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17383 case "$d_srandom_r_proto:$usethreads" in
17384 ":define") d_srandom_r_proto=define
17385 set d_srandom_r_proto srandom_r $hdrs
17389 case "$d_srandom_r_proto" in
17391 case "$srandom_r_proto" in
17392 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17393 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17395 case "$srandom_r_proto" in
17396 ''|0) d_srandom_r=undef
17398 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17399 * ) case "$srandom_r_proto" in
17400 REENTRANT_PROTO*) ;;
17401 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17403 echo "Prototype: $try" ;;
17406 *) case "$usethreads" in
17407 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17414 *) srandom_r_proto=0
17418 : see if prototype for setresgid is available
17420 set d_sresgproto setresgid $i_unistd unistd.h
17423 : see if prototype for setresuid is available
17425 set d_sresuproto setresuid $i_unistd unistd.h
17428 : see if sys/stat.h is available
17429 set sys/stat.h i_sysstat
17432 : see if stat knows about block sizes
17434 echo "Checking to see if your struct stat has st_blocks field..." >&4
17435 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17438 : see if this is a sys/vfs.h system
17439 set sys/vfs.h i_sysvfs
17442 : see if this is a sys/statfs.h system
17443 set sys/statfs.h i_sysstatfs
17446 : Check for statfs_s
17448 echo "Checking to see if your system supports struct statfs..." >&4
17449 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
17451 case "$d_statfs_s" in
17452 "$define") echo "Yes, it does." ;;
17453 *) echo "No, it doesn't." ;;
17457 : see if struct statfs knows about f_flags
17458 case "$d_statfs_s" in
17461 echo "Checking to see if your struct statfs has f_flags field..." >&4
17462 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
17466 set d_statfs_f_flags
17470 case "$d_statfs_f_flags" in
17471 "$define") echo "Yes, it does." ;;
17472 *) echo "No, it doesn't." ;;
17475 : Check stream access
17477 Checking how to access stdio streams by file descriptor number...
17479 case "$stdio_stream_array" in
17480 '') $cat >try.c <<EOCP
17483 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17487 for s in _iob __iob __sF
17489 set try -DSTDIO_STREAM_ARRAY=$s
17490 if eval $compile; then
17491 case "`$run ./try`" in
17492 yes) stdio_stream_array=$s; break ;;
17498 case "$stdio_stream_array" in
17500 I can't figure out how to access stdio streams by file descriptor number.
17502 d_stdio_stream_array="$undef"
17505 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17507 d_stdio_stream_array="$define"
17511 : see if strcoll exists
17512 set strcoll d_strcoll
17515 : check for structure copying
17517 echo "Checking to see if your C compiler can copy structs..." >&4
17518 $cat >try.c <<'EOCP'
17528 if $cc -c try.c >/dev/null 2>&1 ; then
17530 echo "Yup, it can."
17533 echo "Nope, it can't."
17539 : see if strerror and/or sys_errlist[] exist
17541 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17542 if set strerror val -f d_strerror; eval $csym; $val; then
17543 echo 'strerror() found.' >&4
17544 d_strerror="$define"
17545 d_strerrm='strerror(e)'
17546 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17547 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17548 d_syserrlst="$define"
17550 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17551 d_syserrlst="$undef"
17553 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17554 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17555 echo 'strerror() found in string header.' >&4
17556 d_strerror="$define"
17557 d_strerrm='strerror(e)'
17558 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17559 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17560 d_syserrlst="$define"
17562 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17563 d_syserrlst="$undef"
17565 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17566 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17567 d_strerror="$undef"
17568 d_syserrlst="$define"
17569 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17571 echo 'strerror() and sys_errlist[] NOT found.' >&4
17572 d_strerror="$undef"
17573 d_syserrlst="$undef"
17574 d_strerrm='"unknown"'
17578 : see if strerror_r exists
17579 set strerror_r d_strerror_r
17581 case "$d_strerror_r" in
17583 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17584 case "$d_strerror_r_proto:$usethreads" in
17585 ":define") d_strerror_r_proto=define
17586 set d_strerror_r_proto strerror_r $hdrs
17590 case "$d_strerror_r_proto" in
17592 case "$strerror_r_proto" in
17593 ''|0) try='int strerror_r(int, char*, size_t);'
17594 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17596 case "$strerror_r_proto" in
17597 ''|0) try='int strerror_r(int, char*, int);'
17598 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17600 case "$strerror_r_proto" in
17601 ''|0) try='char* strerror_r(int, char*, size_t);'
17602 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17604 case "$strerror_r_proto" in
17605 ''|0) d_strerror_r=undef
17607 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17608 * ) case "$strerror_r_proto" in
17609 REENTRANT_PROTO*) ;;
17610 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17612 echo "Prototype: $try" ;;
17615 *) case "$usethreads" in
17616 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17623 *) strerror_r_proto=0
17627 : see if strftime exists
17628 set strftime d_strftime
17631 : see if strlcat exists
17632 set strlcat d_strlcat
17635 : see if strlcpy exists
17636 set strlcpy d_strlcpy
17639 : see if strtod exists
17640 set strtod d_strtod
17643 : see if strtol exists
17644 set strtol d_strtol
17647 : see if strtold exists
17648 set strtold d_strtold
17651 : see if strtoll exists
17652 set strtoll d_strtoll
17655 case "$d_longlong-$d_strtoll" in
17658 Checking whether your strtoll() works okay...
17660 $cat >try.c <<'EOCP'
17663 #define strtoll __strtoll
17666 #define strtoll _strtoll
17669 extern long long int strtoll(char *s, char **, int);
17670 static int bad = 0;
17671 int check(char *s, long long ell, int een) {
17674 gll = strtoll(s, 0, 10);
17675 if (!((gll == ell) && (errno == een)))
17679 check(" 1", 1LL, 0);
17680 check(" 0", 0LL, 0);
17681 check("-1", -1LL, 0);
17682 check("-9223372036854775808", -9223372036854775808LL, 0);
17683 check("-9223372036854775808", -9223372036854775808LL, 0);
17684 check(" 9223372036854775807", 9223372036854775807LL, 0);
17685 check("-9223372036854775808", -9223372036854775808LL, 0);
17686 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17687 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17693 if eval $compile; then
17696 ok) echo "Your strtoll() seems to be working okay." ;;
17698 Your strtoll() doesn't seem to be working okay.
17704 echo "(I can't seem to compile the test program--assuming it doesn't)"
17710 : see if strtoq exists
17711 set strtoq d_strtoq
17714 : see if strtoul exists
17715 set strtoul d_strtoul
17718 case "$d_strtoul" in
17721 Checking whether your strtoul() works okay...
17723 $cat >try.c <<'EOCP'
17726 extern unsigned long int strtoul(char *s, char **, int);
17727 static int bad = 0;
17728 void check(char *s, unsigned long eul, int een) {
17731 gul = strtoul(s, 0, 10);
17732 if (!((gul == eul) && (errno == een)))
17736 check(" 1", 1L, 0);
17737 check(" 0", 0L, 0);
17739 case "$longsize" in
17741 $cat >>try.c <<'EOCP'
17742 check("18446744073709551615", 18446744073709551615UL, 0);
17743 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17744 #if 0 /* strtoul() for /^-/ strings is undefined. */
17745 check("-1", 18446744073709551615UL, 0);
17746 check("-18446744073709551614", 2, 0);
17747 check("-18446744073709551615", 1, 0);
17748 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17749 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17754 $cat >>try.c <<'EOCP'
17755 check("4294967295", 4294967295UL, 0);
17756 check("4294967296", 4294967295UL, ERANGE);
17757 #if 0 /* strtoul() for /^-/ strings is undefined. */
17758 check("-1", 4294967295UL, 0);
17759 check("-4294967294", 2, 0);
17760 check("-4294967295", 1, 0);
17761 check("-4294967296", 4294967295UL, ERANGE);
17762 check("-4294967297", 4294967295UL, ERANGE);
17767 : Should we write these tests to be more portable by sprintf-ing
17768 : ~0 and then manipulating that char string as input for strtol?
17771 $cat >>try.c <<'EOCP'
17778 if eval $compile; then
17779 case "`$run ./try`" in
17780 ok) echo "Your strtoul() seems to be working okay." ;;
17782 Your strtoul() doesn't seem to be working okay.
17788 echo "(I can't seem to compile the test program--assuming it doesn't)"
17794 : see if strtoull exists
17795 set strtoull d_strtoull
17798 case "$d_longlong-$d_strtoull" in
17801 Checking whether your strtoull() works okay...
17803 $cat >try.c <<'EOCP'
17806 #define strtoull __strtoull
17809 extern unsigned long long int strtoull(char *s, char **, int);
17810 static int bad = 0;
17811 int check(char *s, long long eull, int een) {
17814 gull = strtoull(s, 0, 10);
17815 if (!((gull == eull) && (errno == een)))
17819 check(" 1", 1LL, 0);
17820 check(" 0", 0LL, 0);
17821 check("18446744073709551615", 18446744073709551615ULL, 0);
17822 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17823 #if 0 /* strtoull() for /^-/ strings is undefined. */
17824 check("-1", 18446744073709551615ULL, 0);
17825 check("-18446744073709551614", 2LL, 0);
17826 check("-18446744073709551615", 1LL, 0);
17827 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17828 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17835 if eval $compile; then
17836 case "`$run ./try`" in
17837 ok) echo "Your strtoull() seems to be working okay." ;;
17839 Your strtoull() doesn't seem to be working okay.
17841 d_strtoull="$undef"
17845 echo "(I can't seem to compile the test program--assuming it doesn't)"
17846 d_strtoull="$undef"
17851 : see if strtouq exists
17852 set strtouq d_strtouq
17855 case "$d_strtouq" in
17858 Checking whether your strtouq() works okay...
17860 $cat >try.c <<'EOCP'
17863 extern unsigned long long int strtouq(char *s, char **, int);
17864 static int bad = 0;
17865 void check(char *s, unsigned long long eull, int een) {
17866 unsigned long long gull;
17868 gull = strtouq(s, 0, 10);
17869 if (!((gull == eull) && (errno == een)))
17873 check(" 1", 1LL, 0);
17874 check(" 0", 0LL, 0);
17875 check("18446744073709551615", 18446744073709551615ULL, 0);
17876 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17877 #if 0 /* strtouq() for /^-/ strings is undefined. */
17878 check("-1", 18446744073709551615ULL, 0);
17879 check("-18446744073709551614", 2LL, 0);
17880 check("-18446744073709551615", 1LL, 0);
17881 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17882 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17890 if eval $compile; then
17891 case "`$run ./try`" in
17892 ok) echo "Your strtouq() seems to be working okay." ;;
17894 Your strtouq() doesn't seem to be working okay.
17900 echo "(I can't seem to compile the test program--assuming it doesn't)"
17906 : see if strxfrm exists
17907 set strxfrm d_strxfrm
17910 : see if symlink exists
17911 set symlink d_symlink
17914 : see if syscall exists
17915 set syscall d_syscall
17918 : see if prototype for syscall is available
17920 set d_syscallproto syscall $i_unistd unistd.h
17923 : see if sysconf exists
17924 set sysconf d_sysconf
17927 : see if system exists
17928 set system d_system
17931 : see if tcgetpgrp exists
17932 set tcgetpgrp d_tcgetpgrp
17935 : see if tcsetpgrp exists
17936 set tcsetpgrp d_tcsetpgrp
17939 : see if prototype for telldir is available
17941 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17944 : see if time exists
17946 if test "X$d_time" = X -o X"$timetype" = X; then
17947 if set time val -f d_time; eval $csym; $val; then
17948 echo 'time() found.' >&4
17950 rp="What is the type returned by time() on this system?"
17951 set time_t timetype long stdio.h sys/types.h
17954 echo 'time() not found, hope that will do.' >&4
17962 : see if this is a sys/times.h system
17963 set sys/times.h i_systimes
17966 : see if times exists
17968 if set times val -f d_times; eval $csym; $val; then
17969 echo 'times() found.' >&4
17972 case "$i_systimes" in
17973 "$define") inc='sys/times.h';;
17975 rp="What is the type returned by times() on this system?"
17976 set clock_t clocktype long stdio.h sys/types.h $inc
17979 echo 'times() NOT found, hope that will do.' >&4
17984 : see if tmpnam_r exists
17985 set tmpnam_r d_tmpnam_r
17987 case "$d_tmpnam_r" in
17989 hdrs="$i_systypes sys/types.h define stdio.h "
17990 case "$d_tmpnam_r_proto:$usethreads" in
17991 ":define") d_tmpnam_r_proto=define
17992 set d_tmpnam_r_proto tmpnam_r $hdrs
17996 case "$d_tmpnam_r_proto" in
17998 case "$tmpnam_r_proto" in
17999 ''|0) try='char* tmpnam_r(char*);'
18000 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18002 case "$tmpnam_r_proto" in
18003 ''|0) d_tmpnam_r=undef
18005 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18006 * ) case "$tmpnam_r_proto" in
18007 REENTRANT_PROTO*) ;;
18008 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18010 echo "Prototype: $try" ;;
18013 *) case "$usethreads" in
18014 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18021 *) tmpnam_r_proto=0
18025 : see if truncate exists
18026 set truncate d_truncate
18029 : see if ttyname_r exists
18030 set ttyname_r d_ttyname_r
18032 case "$d_ttyname_r" in
18034 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18035 case "$d_ttyname_r_proto:$usethreads" in
18036 ":define") d_ttyname_r_proto=define
18037 set d_ttyname_r_proto ttyname_r $hdrs
18041 case "$d_ttyname_r_proto" in
18043 case "$ttyname_r_proto" in
18044 ''|0) try='int ttyname_r(int, char*, size_t);'
18045 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18047 case "$ttyname_r_proto" in
18048 ''|0) try='int ttyname_r(int, char*, int);'
18049 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18051 case "$ttyname_r_proto" in
18052 ''|0) try='char* ttyname_r(int, char*, int);'
18053 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18055 case "$ttyname_r_proto" in
18056 ''|0) d_ttyname_r=undef
18058 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18059 * ) case "$ttyname_r_proto" in
18060 REENTRANT_PROTO*) ;;
18061 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18063 echo "Prototype: $try" ;;
18066 *) case "$usethreads" in
18067 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18074 *) ttyname_r_proto=0
18078 : see if tzname[] exists
18080 if set tzname val -a d_tzname; eval $csym; $val; then
18082 echo 'tzname[] found.' >&4
18085 echo 'tzname[] NOT found.' >&4
18090 : Check if is a multiplatform env
18092 next|rhapsody|darwin) multiarch="$define" ;;
18094 case "$multiarch" in
18095 ''|[nN]*) multiarch="$undef" ;;
18098 : check for ordering of bytes in a UV
18100 case "$usecrosscompile$multiarch" in
18103 You seem to be either cross-compiling or doing a multiarchitecture build,
18104 skipping the byteorder check.
18110 case "$byteorder" in
18113 In the following, larger digits indicate more significance. A big-endian
18114 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18115 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18116 machines may have weird orders like 3412. A Cray will report 87654321,
18117 an Alpha will report 12345678. If the test program works the default is
18119 I'm now running the test program...
18123 #$i_stdlib I_STDLIB
18125 #include <stdlib.h>
18127 #include <sys/types.h>
18128 typedef $uvtype UV;
18138 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18140 u.l = (UV)0x04030201;
18141 for (i = 0; i < $uvsize; i++)
18142 printf("%c", u.c[i]+'0');
18149 if eval $compile && $run ./try > /dev/null; then
18152 [1-4][1-4][1-4][1-4]|12345678|87654321)
18153 echo "(The test program ran ok.)"
18154 echo "byteorder=$dflt"
18157 ????|????????) echo "(The test program ran ok.)" ;;
18158 *) echo "(The test program didn't run right for some reason.)" ;;
18163 (I can't seem to compile the test program. Guessing big-endian...)
18166 case "$xxx_prompt" in
18168 rp="What is the order of bytes in $uvtype?"
18181 : Checking 32bit aligndness
18184 Checking to see whether you can access character data unalignedly...
18186 case "$d_u32align" in
18187 '') $cat >try.c <<EOCP
18189 #$i_stdlib I_STDLIB
18191 #include <stdlib.h>
18193 #define U32 $u32type
18194 #define BYTEORDER 0x$byteorder
18196 #include <signal.h>
18198 $signal_t bletch(int s) { exit(4); }
18201 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18206 if (sizeof(U32) != 4) {
18207 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18214 signal(SIGBUS, bletch);
18226 for (i = 0; i < 4; i++) {
18227 up = (U32*)(buf + i);
18228 if (! ((*up == 1 << (8*i)) || /* big-endian */
18229 (*up == 1 << (8*(3-i))) /* little-endian */
18233 printf("read failed (%x)\n", *up);
18239 for (i = 0; i < 4; i++) {
18240 up = (U32*)(buf + i);
18242 if (*up != 0xBeef) {
18243 printf("write failed (%x)\n", *up);
18257 if eval $compile_ok; then
18258 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18259 $run ./try 2>&1 >/dev/null
18262 You can access character data pretty unalignedly.
18264 d_u32align="$undef"
18267 It seems that you must access character data in an aligned manner.
18269 d_u32align="$define"
18273 rp='Can you access character data at unaligned addresses?'
18277 [yY]*) d_u32align="$undef" ;;
18278 *) d_u32align="$define" ;;
18285 : see if ualarm exists
18286 set ualarm d_ualarm
18289 : see if umask exists
18293 : see if unordered exists
18294 set unordered d_unordered
18297 : see if unsetenv exists
18298 set unsetenv d_unsetenv
18301 : see if usleep exists
18302 set usleep d_usleep
18305 : see if prototype for usleep is available
18307 set d_usleepproto usleep $i_unistd unistd.h
18310 : see if ustat exists
18314 : see if closedir exists
18315 set closedir d_closedir
18318 case "$d_closedir" in
18321 echo "Checking whether closedir() returns a status..." >&4
18323 #$i_dirent I_DIRENT /**/
18324 #$i_sysdir I_SYS_DIR /**/
18325 #$i_sysndir I_SYS_NDIR /**/
18326 #$i_systypes I_SYS_TYPES /**/
18328 #if defined(I_SYS_TYPES)
18329 #include <sys/types.h>
18331 #if defined(I_DIRENT)
18332 #include <dirent.h>
18333 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18334 #include <sys/dir.h>
18338 #include <sys/ndir.h>
18342 #include <ndir.h> /* may be wrong in the future */
18344 #include <sys/dir.h>
18349 int main() { return closedir(opendir(".")); }
18352 if eval $compile_ok; then
18353 if $run ./try > /dev/null 2>&1 ; then
18354 echo "Yes, it does."
18357 echo "No, it doesn't."
18361 echo "(I can't seem to compile the test program--assuming it doesn't)"
18369 set d_void_closedir
18373 : see if there is a wait4
18377 : see if waitpid exists
18378 set waitpid d_waitpid
18381 : see if wcstombs exists
18382 set wcstombs d_wcstombs
18385 : see if wctomb exists
18386 set wctomb d_wctomb
18389 : see if writev exists
18390 set writev d_writev
18393 : preserve RCS keywords in files with variable substitution, grrr
18398 Revision='$Revision'
18400 : check for alignment requirements
18402 case "$usecrosscompile$multiarch" in
18405 You seem to be either cross-compiling or doing a multiarchitecture build,
18406 skipping the memory alignment check.
18409 case "$alignbytes" in
18410 '') alignbytes=8 ;;
18414 case "$alignbytes" in
18415 '') echo "Checking alignment constraints..." >&4
18416 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18417 $cat >try.c <<'EOCP'
18418 typedef long double NV;
18421 $cat >try.c <<'EOCP'
18425 $cat >>try.c <<'EOCP'
18433 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18438 if eval $compile_ok; then
18442 echo "(I can't seem to compile the test program...)"
18445 *) dflt="$alignbytes"
18448 rp="Doubles must be aligned on a how-many-byte boundary?"
18456 : set the base revision
18459 : how do we concatenate cpp tokens here?
18461 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18462 $cat >cpp_stuff.c <<'EOCP'
18463 #define RCAT(a,b)a/**/b
18464 #define ACAT(a,b)a ## b
18468 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18469 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18470 echo "Oh! Smells like ANSI's been here." >&4
18471 echo "We can catify or stringify, separately or together!"
18473 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18474 echo "Ah, yes! The good old days!" >&4
18475 echo "However, in the good old days we don't know how to stringify and"
18476 echo "catify at the same time."
18480 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18481 You're going to have to edit the values of CAT[2-5] in config.h...
18483 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18487 : see if this is a db.h system
18493 : Check db version.
18495 echo "Checking Berkeley DB version ..." >&4
18501 #include <sys/types.h>
18503 #$i_stdlib I_STDLIB
18505 #include <stdlib.h>
18508 int main(int argc, char *argv[])
18510 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18511 int Major, Minor, Patch ;
18512 unsigned long Version ;
18513 (void)db_version(&Major, &Minor, &Patch) ;
18515 printf("%d %d %d %d %d %d\n",
18516 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18517 Major, Minor, Patch);
18520 printf("You have Berkeley DB Version 2 or greater.\n");
18522 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18523 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18524 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18525 Major, Minor, Patch) ;
18527 /* check that db.h & libdb are compatible */
18528 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18529 printf("db.h and libdb are incompatible.\n") ;
18533 printf("db.h and libdb are compatible.\n") ;
18535 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18536 + DB_VERSION_PATCH ;
18538 /* needs to be >= 2.3.4 */
18539 if (Version < 2003004) {
18540 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18541 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18547 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18552 printf("You have Berkeley DB Version 1.\n");
18553 exit(0); /* DB version < 2: the coast is clear. */
18555 exit(1); /* <db.h> not Berkeley DB? */
18561 if eval $compile_ok && $run ./try; then
18562 echo 'Looks OK.' >&4
18564 db_version_major=$1
18565 db_version_minor=$2
18566 db_version_patch=$3
18568 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18572 : Remove db from list of libraries to use
18573 echo "Removing unusable -ldb from library list" >&4
18574 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18577 echo "libs = $libs" >&4
18587 : Check the return type needed for hash
18589 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18595 #include <sys/types.h>
18598 #ifndef DB_VERSION_MAJOR
18599 u_int32_t hash_cb (ptr, size)
18607 info.hash = hash_cb;
18611 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18612 if $contains warning try.out >>/dev/null 2>&1 ; then
18615 db_hashtype='u_int32_t'
18618 : XXX Maybe we should just give up here.
18619 db_hashtype=u_int32_t
18621 echo "Help: I can't seem to compile the db test program." >&4
18622 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18625 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18627 *) db_hashtype=u_int32_t
18632 : Check the return type needed for prefix
18634 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18640 #include <sys/types.h>
18643 #ifndef DB_VERSION_MAJOR
18644 size_t prefix_cb (key1, key2)
18652 info.prefix = prefix_cb;
18656 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18657 if $contains warning try.out >>/dev/null 2>&1 ; then
18658 db_prefixtype='int'
18660 db_prefixtype='size_t'
18663 db_prefixtype='size_t'
18664 : XXX Maybe we should just give up here.
18666 echo "Help: I can't seem to compile the db test program." >&4
18667 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18670 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18672 *) db_prefixtype='size_t'
18676 : How can we generate normalized random numbers ?
18678 echo "Looking for a random number function..." >&4
18679 case "$randfunc" in
18681 if set drand48 val -f; eval $csym; $val; then
18683 echo "Good, found drand48()." >&4
18684 elif set random val -f; eval $csym; $val; then
18686 echo "OK, found random()." >&4
18689 echo "Yick, looks like I have to use rand()." >&4
18700 *-Dmy_rand=*|*-Dmy_srand=*)
18701 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18702 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18703 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18704 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18708 while $test "$cont"; do
18709 rp="Use which function to generate random numbers?"
18711 if $test "$ans" = "$dflt"; then
18717 if set $ans val -f; eval $csym; $val; then
18721 rp="I cannot find function $ans. Use that name anyway?"
18730 case "$randfunc" in
18732 drand01="drand48()"
18738 case "$randbits" in
18740 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18742 #$i_unistd I_UNISTD
18743 #$i_stdlib I_STDLIB
18746 # include <unistd.h>
18749 # include <stdlib.h>
18754 register unsigned long tmp;
18755 register unsigned long max = 0L;
18757 for (i = 1000; i; i--) {
18758 tmp = (unsigned long) $randfunc();
18759 if (tmp > max) max = tmp;
18761 for (i = 0; max; i++)
18767 if eval $compile_ok; then
18771 echo "(I can't seem to compile the test program...)"
18778 rp="How many bits does your $randfunc() function produce?"
18782 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18783 seedfunc="s$randfunc"
18784 randseedtype=unsigned
18788 rp="How many bits does your $randfunc() function produce?"
18791 seedfunc="s$randfunc"
18792 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18793 if set $seedfunc val -f; eval $csym; $val; then
18794 echo "(Using $seedfunc() to seed random generator)"
18796 echo "(Warning: no $seedfunc() to seed random generator)"
18799 randseedtype=unsigned
18806 : Determine if this is an EBCDIC system
18808 echo "Determining whether or not we are on an EBCDIC system..." >&4
18809 $cat >try.c <<'EOM'
18812 if ('M'==0xd4) return 0;
18819 if eval $compile_ok; then
18820 if $run ./try; then
18821 echo "You seem to speak EBCDIC." >&4
18824 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18827 echo "I'm unable to compile the test program." >&4
18828 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18834 : Check how to flush
18837 Checking how to flush all pending stdio output...
18839 # I only know how to find the first 32 possibly open files on SunOS.
18840 # See also hints/sunos_4_1.sh and util.c --AD
18842 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18844 $cat >>try.c <<EOCP
18846 #$i_stdlib I_STDLIB
18848 #include <stdlib.h>
18850 #$i_unistd I_UNISTD
18852 # include <unistd.h>
18854 #$d_sysconf HAS_SYSCONF
18855 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18856 #ifdef HAS_STDIO_STREAM_ARRAY
18857 # define STDIO_STREAM_ARRAY $stdio_stream_array
18862 p = fopen("try.out", "w");
18866 # ifdef TRY_FPRINTF
18870 #ifdef TRY_FFLUSH_NULL
18873 #ifdef TRY_FFLUSH_ALL
18875 long open_max = -1;
18876 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18877 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18879 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18880 open_max = sysconf(_SC_OPEN_MAX);
18883 open_max = FOPEN_MAX;
18886 open_max = OPEN_MAX;
18895 # ifdef HAS_STDIO_STREAM_ARRAY
18896 if (open_max > 0) {
18898 for (i = 0; i < open_max; i++)
18899 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18900 STDIO_STREAM_ARRAY[i]._file < open_max &&
18901 STDIO_STREAM_ARRAY[i]._flag)
18902 fflush(&STDIO_STREAM_ARRAY[i]);
18910 : first we have to find out how _not_ to flush
18912 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18914 set try -DTRY_FPUTC
18915 if eval $compile; then
18916 $run ./try 2>/dev/null
18919 if $test ! -s try.out -a "X$code" = X42; then
18925 set try -DTRY_FPRINTF
18926 if eval $compile; then
18927 $run ./try 2>/dev/null
18930 if $test ! -s try.out -a "X$code" = X42; then
18931 output=-DTRY_FPRINTF
18937 : check for fflush NULL behaviour
18938 case "$fflushNULL" in
18939 '') set try -DTRY_FFLUSH_NULL $output
18940 if eval $compile; then
18941 $run ./try 2>/dev/null
18944 if $test -s try.out -a "X$code" = X42; then
18945 fflushNULL="`$cat try.out`"
18947 if $test "X$code" != X42; then
18949 (If this test failed, don't worry, we'll try another method shortly.)
18955 case "$fflushNULL" in
18957 Your fflush(NULL) works okay for output streams.
18958 Let's see if it clobbers input pipes...
18960 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18961 # bug that improperly flushes the input end of pipes. So we avoid the
18962 # autoflush on fork/system/exec support for now. :-(
18963 $cat >tryp.c <<EOCP
18966 main(int argc, char **argv)
18972 while ((i = getc(stdin)) != -1
18973 && (*bp++ = i) != '\n'
18974 && bp < &buf[1024])
18977 fprintf(stdout, "%s", buf);
18985 fflushNULL="$define"
18987 if eval $compile; then
18989 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18990 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18992 fflush(NULL) seems to behave okay with input streams.
18994 fflushNULL="$define"
18997 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18999 fflushNULL="$undef"
19002 $rm -f core tryp.c tryp.core core.tryp.*
19005 Your fflush(NULL) isn't working (contrary to ANSI C).
19007 fflushNULL="$undef"
19010 Cannot figure out whether your fflush(NULL) works or not.
19011 I'm assuming it doesn't (contrary to ANSI C).
19013 fflushNULL="$undef"
19017 $define|true|[yY]*)
19018 fflushNULL="$define"
19021 fflushNULL="$undef"
19024 : check explicit looping only if NULL did not work, and if the pipe
19025 : bug does not show up on an explicit flush too
19026 case "$fflushNULL" in
19028 $cat >tryp.c <<EOCP
19031 main(int argc, char **argv)
19037 while ((i = getc(stdin)) != -1
19038 && (*bp++ = i) != '\n'
19039 && bp < &buf[1024])
19042 fprintf(stdout, "%s", buf);
19051 if eval $compile; then
19053 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19054 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19056 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19058 : now check for fflushall behaviour
19059 case "$fflushall" in
19060 '') set try -DTRY_FFLUSH_ALL $output
19061 if eval $compile; then
19063 (Now testing the other method--but note that this also may fail.)
19065 $run ./try 2>/dev/null
19068 if $test -s try.out -a "X$code" = X42; then
19069 fflushall="`$cat try.out`"
19073 case "$fflushall" in
19075 Whew. Flushing explicitly all the stdio streams works.
19077 fflushall="$define"
19080 Sigh. Flushing explicitly all the stdio streams doesn't work.
19085 Cannot figure out whether flushing stdio streams explicitly works or not.
19086 I'm assuming it doesn't.
19092 "$define"|true|[yY]*)
19093 fflushall="$define"
19101 All is futile. Even fflush(stdin) clobbers input pipes!
19108 $rm -f core tryp.c tryp.core core.tryp.*
19110 *) fflushall="$undef"
19114 case "$fflushNULL$fflushall" in
19117 OK, I give up. I cannot figure out how to flush pending stdio output.
19118 We won't be flushing handles at all before fork/exec/popen.
19124 : Store the full pathname to the ar program for use in the C program
19125 : Respect a hint or command line value for full_ar.
19130 : Store the full pathname to the sed program for use in the C program
19133 : see what type gids are declared as in the kernel
19135 echo "Looking for the type for group ids returned by getgid()."
19136 set gid_t gidtype xxx stdio.h sys/types.h
19140 xxx=`./findhdr sys/user.h`
19141 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19143 unsigned) dflt="$1 $2" ;;
19147 *) dflt="$gidtype";;
19150 gid_t) echo "gid_t found." ;;
19151 *) rp="What is the type for group ids returned by getgid()?"
19157 : Check the size of GID
19160 *_t) zzz="$gidtype" ;;
19163 echo "Checking the size of $zzz..." >&4
19165 #include <sys/types.h>
19167 #$i_stdlib I_STDLIB
19169 #include <stdlib.h>
19172 printf("%d\n", (int)sizeof($gidtype));
19177 if eval $compile_ok; then
19181 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19184 echo "Your $zzz is $gidsize bytes long."
19189 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19193 : Check if GID is signed
19196 *_t) zzz="$gidtype" ;;
19199 echo "Checking the sign of $zzz..." >&4
19201 #include <sys/types.h>
19212 if eval $compile; then
19216 echo "(I can't execute the test program--guessing unsigned.)" >&4
19220 1) echo "Your $zzz is unsigned." ;;
19221 -1) echo "Your $zzz is signed." ;;
19227 echo "(I can't compile the test program--guessing unsigned.)" >&4
19231 : Check 64bit sizes
19234 if $test X"$quadtype" != X; then
19236 echo "Checking how to print 64-bit integers..." >&4
19238 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19239 $cat >try.c <<'EOCP'
19240 #include <sys/types.h>
19243 int q = 12345678901;
19244 printf("%ld\n", q);
19248 if eval $compile; then
19252 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19253 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19254 echo "We will use %d."
19260 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19261 $cat >try.c <<'EOCP'
19262 #include <sys/types.h>
19265 long q = 12345678901;
19266 printf("%ld\n", q);
19270 if eval $compile; then
19274 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19275 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19276 echo "We will use %ld."
19282 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19283 $cat >try.c <<'EOCP'
19284 #include <sys/types.h>
19285 #include <inttypes.h>
19288 int64_t q = 12345678901;
19289 printf("%" PRId64 "\n", q);
19293 if eval $compile; then
19297 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19298 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19299 echo "We will use the C9X style."
19305 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19307 #include <sys/types.h>
19310 $quadtype q = 12345678901;
19311 printf("%Ld\n", q);
19315 if eval $compile; then
19319 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19320 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19321 echo "We will use %Ld."
19327 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19328 $cat >try.c <<'EOCP'
19329 #include <sys/types.h>
19332 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19333 printf("%lld\n", q);
19337 if eval $compile; then
19341 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19342 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19343 echo "We will use the %lld style."
19349 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19351 #include <sys/types.h>
19354 $quadtype q = 12345678901;
19355 printf("%qd\n", q);
19359 if eval $compile; then
19363 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19364 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19365 echo "We will use %qd."
19371 if $test X"$sPRId64" = X; then
19372 echo "Cannot figure out how to print 64-bit integers." >&4
19379 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19380 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19382 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19383 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19387 : Check format strings for internal types
19389 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19391 if $test X"$ivsize" = X8; then
19392 ivdformat="$sPRId64"
19393 uvuformat="$sPRIu64"
19394 uvoformat="$sPRIo64"
19395 uvxformat="$sPRIx64"
19396 uvXUformat="$sPRIXU64"
19398 if $test X"$ivsize" = X"$longsize"; then
19405 if $test X"$ivsize" = X"$intsize"; then
19413 if $test X"$ivsize" = X"$shortsize"; then
19424 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19425 nveformat="$sPRIeldbl"
19426 nvfformat="$sPRIfldbl"
19427 nvgformat="$sPRIgldbl"
19428 nvEUformat="$sPRIEUldbl"
19429 nvFUformat="$sPRIFUldbl"
19430 nvGUformat="$sPRIGUldbl"
19440 case "$ivdformat" in
19441 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19446 : Check format string for GID
19449 $echo "Checking the format string to be used for gids..." >&4
19452 -1) if $test X"$gidsize" = X"$ivsize"; then
19453 gidformat="$ivdformat"
19455 if $test X"$gidsize" = X"$longsize"; then
19458 if $test X"$gidsize" = X"$intsize"; then
19461 if $test X"$gidsize" = X"$shortsize"; then
19468 *) if $test X"$gidsize" = X"$uvsize"; then
19469 gidformat="$uvuformat"
19471 if $test X"$gidsize" = X"$longsize"; then
19474 if $test X"$gidsize" = X"$intsize"; then
19477 if $test X"$gidsize" = X"$shortsize"; then
19486 : see if getgroups exists
19487 set getgroups d_getgrps
19490 : see if setgroups exists
19491 set setgroups d_setgrps
19494 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19496 case "$d_getgrps$d_setgrps" in
19498 case "$groupstype" in
19499 '') dflt="$gidtype" ;;
19500 *) dflt="$groupstype" ;;
19503 What type of pointer is the second argument to getgroups() and setgroups()?
19504 Usually this is the same as group ids, $gidtype, but not always.
19507 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19511 *) groupstype="$gidtype";;
19514 : MAD = Misc Attribute Definition
19516 if $test $patchlevel -lt 9; then
19517 : MAD is not available in 5.8.x or earlier.
19521 $define|true|[yY]*) dflt='y' ;;
19526 Would you like to build with Misc Attribute Decoration? This is development
19527 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19528 overhead on the interpreter.
19530 If this doesn't make any sense to you, just accept the default '$dflt'.
19532 rp='Build Perl with MAD?'
19537 madlyh='madly.h madly.act madly.tab'
19539 madlyobj="madly$_o" ;;
19549 echo "Checking if your $make program sets \$(MAKE)..." >&4
19550 case "$make_set_make" in
19552 $sed 's/^X //' > testmake.mak << 'EOF'
19554 X @echo 'maketemp="$(MAKE)"'
19556 case "`$make -f testmake.mak 2>/dev/null`" in
19557 *maketemp=*) make_set_make='#' ;;
19558 *) make_set_make="MAKE=$make" ;;
19560 $rm -f testmake.mak
19563 case "$make_set_make" in
19564 '#') echo "Yup, it does.";;
19565 *) echo "Nope, it doesn't.";;
19568 : see what type is used for mode_t
19569 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19570 set mode_t modetype int stdio.h sys/types.h
19573 : see if we need va_copy
19575 case "$i_stdarg" in
19578 #include <stdarg.h>
19580 #$i_stdlib I_STDLIB
19582 #include <stdlib.h>
19584 #include <signal.h>
19587 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19589 return vfprintf(f, fmt, *valp);
19593 myvfprintf(FILE *f, const char *fmt, va_list val)
19595 return ivfprintf(f, fmt, &val);
19599 myprintf(char *fmt, ...)
19602 va_start(val, fmt);
19603 return myvfprintf(stdout, fmt, val);
19607 main(int ac, char **av)
19609 signal(SIGSEGV, exit);
19611 myprintf("%s%cs all right, then\n", "that", '\'');
19616 if eval $compile && $run ./try 2>&1 >/dev/null; then
19617 case "`$run ./try`" in
19618 "that's all right, then")
19624 yes) echo "It seems that you don't need va_copy()." >&4
19625 need_va_copy="$undef"
19627 *) echo "It seems that va_copy() or similar will be needed." >&4
19628 need_va_copy="$define"
19633 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19637 : see what type is used for size_t
19638 rp="What is the type used for the length parameter for string functions?"
19639 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19642 : check for type of arguments to gethostbyaddr.
19643 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19644 case "$d_gethbyaddr" in
19648 Checking to see what type of arguments are accepted by gethostbyaddr().
19650 hdrs="$define sys/types.h
19651 $d_socket sys/socket.h
19652 $i_niin netinet/in.h
19654 $i_unistd unistd.h"
19655 : The first arg can 'char *' or 'void *'
19656 : The second arg is some of integral type
19657 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19658 for yyy in size_t long int; do
19659 case "$netdb_host_type" in
19660 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19661 if ./protochk "$try" $hdrs; then
19662 echo "Your system accepts $xxx for the first arg."
19663 echo "...and $yyy for the second arg."
19664 netdb_host_type="$xxx"
19665 netdb_hlen_type="$yyy"
19671 : In case none of those worked, prompt the user.
19672 case "$netdb_host_type" in
19673 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19676 netdb_host_type=$ans
19677 rp='What is the type for the 2nd argument to gethostbyaddr?'
19680 netdb_hlen_type=$ans
19684 *) : no gethostbyaddr, so pick harmless defaults
19685 netdb_host_type='char *'
19686 netdb_hlen_type="$sizetype"
19689 # Remove the "const" if needed. -- but then we'll have a
19691 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19694 : check for type of argument to gethostbyname.
19695 if test "X$netdb_name_type" = X ; then
19696 case "$d_gethbyname" in
19700 Checking to see what type of argument is accepted by gethostbyname().
19702 hdrs="$define sys/types.h
19703 $d_socket sys/socket.h
19704 $i_niin netinet/in.h
19706 $i_unistd unistd.h"
19707 for xxx in "const char *" "char *"; do
19708 case "$netdb_name_type" in
19709 '') try="extern struct hostent *gethostbyname($xxx);"
19710 if ./protochk "$try" $hdrs; then
19711 echo "Your system accepts $xxx."
19712 netdb_name_type="$xxx"
19717 : In case none of those worked, prompt the user.
19718 case "$netdb_name_type" in
19719 '') rp='What is the type for the 1st argument to gethostbyname?'
19722 netdb_name_type=$ans
19726 *) : no gethostbyname, so pick harmless default
19727 netdb_name_type='char *'
19732 : check for type of 1st argument to getnetbyaddr.
19733 if test "X$netdb_net_type" = X ; then
19734 case "$d_getnbyaddr" in
19738 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19740 hdrs="$define sys/types.h
19741 $d_socket sys/socket.h
19742 $i_niin netinet/in.h
19744 $i_unistd unistd.h"
19745 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19746 case "$netdb_net_type" in
19747 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19748 if ./protochk "$try" $hdrs; then
19749 echo "Your system accepts $xxx."
19750 netdb_net_type="$xxx"
19755 : In case none of those worked, prompt the user.
19756 case "$netdb_net_type" in
19757 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19760 netdb_net_type=$ans
19764 *) : no getnetbyaddr, so pick harmless default
19765 netdb_net_type='long'
19769 : locate the preferred pager for this system
19776 [a-zA-Z]:/*) dflt=$pg;;
19780 [a-zA-Z]:/*) dflt=$more;;
19784 [a-zA-Z]:/*) dflt=$less;;
19787 '') dflt=/usr/ucb/more;;
19791 : Instruct ./getfile to trust the hinted or previous pager value,
19792 : even if it does not begin with a slash. For example, on os2,
19793 : pager might be cmd /c more. See comments in UU/getfile.
19798 rp='What pager is used on your system?'
19802 : see what type pids are declared as in the kernel
19803 rp="What is the type of process ids on this system?"
19804 set pid_t pidtype int stdio.h sys/types.h
19807 : see if ar generates random libraries by itself
19809 echo "Checking how to generate random libraries on your machine..." >&4
19810 echo 'int bar1() { return bar2(); }' > bar1.c
19811 echo 'int bar2() { return 2; }' > bar2.c
19813 #$i_stdlib I_STDLIB
19815 #include <stdlib.h>
19817 int main() { printf("%d\n", bar1()); exit(0); }
19819 $cc $ccflags -c bar1.c >/dev/null 2>&1
19820 $cc $ccflags -c bar2.c >/dev/null 2>&1
19821 $cc $ccflags -c foo.c >/dev/null 2>&1
19822 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19823 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19824 $run ./foobar >/dev/null 2>&1; then
19825 echo "$ar appears to generate random libraries itself."
19827 if [ "X$ranlib" = "X" ]; then
19830 elif $ar s bar$_a >/dev/null 2>&1 &&
19831 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19832 $run ./foobar >/dev/null 2>&1; then
19833 echo "a table of contents needs to be added with '$ar s'."
19836 elif $ar ts bar$_a >/dev/null 2>&1 &&
19837 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19838 $run ./foobar >/dev/null 2>&1; then
19839 echo "a table of contents needs to be added with '$ar ts'."
19846 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19847 $test -f $ranlib || ranlib=''
19850 if $test -n "$ranlib"; then
19851 echo "your system has '$ranlib'; we'll use that."
19854 echo "your system doesn't seem to support random libraries"
19855 echo "so we'll use lorder and tsort to order the libraries."
19862 : check for type of arguments to select.
19863 case "$selecttype" in
19864 '') case "$d_select" in
19868 Checking to see what type of arguments are accepted by select().
19870 hdrs="$define sys/types.h
19871 $i_systime sys/time.h
19872 $i_sysselct sys/select.h
19873 $d_socket sys/socket.h"
19874 : The first arg can be int, unsigned, or size_t
19875 : The last arg may or may not be 'const'
19877 : void pointer has been seen but using that
19878 : breaks the selectminbits test
19879 for xxx in 'fd_set *' 'int *'; do
19880 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19881 for tmo in 'struct timeval *' 'const struct timeval *'; do
19883 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19884 if ./protochk "$try" $hdrs; then
19885 echo "Your system accepts $xxx."
19894 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19895 case "$d_fd_set" in
19896 $define) dflt="fd_set *" ;;
19905 *) : no select, so pick a harmless default
19912 : check for the select 'width'
19913 case "$selectminbits" in
19914 '') safebits=`expr $ptrsize \* 8`
19915 case "$d_select" in
19919 Checking to see on how many bits at a time your select() operates...
19922 #include <sys/types.h>
19924 #$i_systime I_SYS_TIME
19925 #$i_systimek I_SYS_TIME_KERNEL
19930 # ifdef I_SYS_TIME_KERNEL
19933 # include <sys/time.h>
19934 # ifdef I_SYS_TIME_KERNEL
19938 #$i_sysselct I_SYS_SELECT
19939 #ifdef I_SYS_SELECT
19940 #include <sys/select.h>
19942 #$d_socket HAS_SOCKET
19944 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19947 #$i_stdlib I_STDLIB
19949 #include <stdlib.h>
19952 #define S sizeof(*(b))
19954 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19955 #define NBITS (NBYTES * 8)
19957 char *s = (char *)malloc(NBYTES);
19966 fp = fopen("try.c", "r");
19972 b = ($selecttype)s;
19973 for (i = 0; i < NBITS; i++)
19977 select(fd + 1, b, 0, 0, &t);
19978 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19980 printf("%d\n", i + 1);
19985 if eval $compile_ok; then
19986 selectminbits=`$run ./try`
19987 case "$selectminbits" in
19989 Cannot figure out on how many bits at a time your select() operates.
19990 I'll play safe and guess it is $safebits bits.
19992 selectminbits=$safebits
19993 bits="$safebits bits"
19996 *) bits="$selectminbits bits" ;;
19998 echo "Your select() operates on $bits at a time." >&4
20000 rp='What is the minimum number of bits your select() operates on?'
20001 case "$byteorder" in
20002 12345678) dflt=64 ;;
20008 selectminbits="$val"
20012 *) : no select, so pick a harmless default
20013 selectminbits=$safebits
20019 : Trace out the files included by signal.h, then look for SIGxxx names.
20020 if [ "X$fieldn" = X ]; then
20021 : Just make some guesses. We check them later.
20022 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20024 xxx=`echo '#include <signal.h>' |
20025 $cppstdin $cppminus $cppflags 2>/dev/null |
20026 $grep '^[ ]*#.*include' |
20027 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20028 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20031 for xx in $xxx /dev/null ; do
20032 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20034 case "$xxxfiles" in
20035 '') xxxfiles=`./findhdr signal.h` ;;
20038 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20039 print substr($2, 4, 20)
20041 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20042 print substr($3, 4, 20)
20044 : Append some common names just in case the awk scan failed.
20045 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20046 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20047 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20048 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20049 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20051 : generate a few handy files for later
20052 $cat > signal.c <<EOCP
20053 #include <sys/types.h>
20054 #include <signal.h>
20055 #$i_stdlib I_STDLIB
20057 #include <stdlib.h>
20062 /* Strange style to avoid deeply-nested #if/#else/#endif */
20065 # define NSIG (_NSIG)
20071 # define NSIG (SIGMAX+1)
20077 # define NSIG (SIG_MAX+1)
20083 # define NSIG (_SIG_MAX+1)
20089 # define NSIG (MAXSIG+1)
20095 # define NSIG (MAX_SIG+1)
20100 # ifdef SIGARRAYSIZE
20101 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20107 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20111 /* Default to some arbitrary number that's big enough to get most
20112 of the common signals.
20118 printf("NSIG %d\n", NSIG);
20124 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20126 printf "#ifdef SIG"; printf $1; printf "\n"
20127 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20128 printf $1; printf ");\n"
20132 printf "#endif /* JUST_NSIG */\n";
20133 printf "exit(0);\n}\n";
20136 $cat >signal.awk <<'EOP'
20137 BEGIN { ndups = 0 }
20138 $1 ~ /^NSIG$/ { nsig = $2 }
20139 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20140 if ($2 > maxsig) { maxsig = $2 }
20141 if (sig_name[$2]) {
20142 dup_name[ndups] = $1
20143 dup_num[ndups] = $2
20155 printf("NSIG %d\n", nsig);
20156 for (n = 1; n < nsig; n++) {
20158 printf("%s %d\n", sig_name[n], sig_num[n])
20161 printf("NUM%d %d\n", n, n)
20164 for (n = 0; n < ndups; n++) {
20165 printf("%s %d\n", dup_name[n], dup_num[n])
20169 $cat >signal_cmd <<EOS
20171 if $test -s signal.lst; then
20172 echo "Using your existing signal.lst file"
20177 $cat >>signal_cmd <<'EOS'
20180 if eval $compile_ok; then
20181 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20182 $uniq | $awk -f signal.awk >signal.lst
20184 echo "(I can't seem be able to compile the whole test program)" >&4
20185 echo "(I'll try it in little pieces.)" >&4
20186 set signal -DJUST_NSIG
20187 if eval $compile_ok; then
20188 $run ./signal$_exe > signal.nsg
20191 echo "I can't seem to figure out how many signals you have." >&4
20192 echo "Guessing 50." >&4
20193 echo 'NSIG 50' > signal.nsg
20195 : Now look at all the signal names, one at a time.
20196 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20197 $cat > signal.c <<EOCP
20198 #include <sys/types.h>
20199 #include <signal.h>
20202 printf("$xx %d\n", SIG${xx});
20207 if eval $compile; then
20208 echo "SIG${xx} found."
20209 $run ./signal$_exe >> signal.ls1
20211 echo "SIG${xx} NOT found."
20214 if $test -s signal.ls1; then
20215 $cat signal.nsg signal.ls1 |
20216 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20220 if $test -s signal.lst; then
20223 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20224 echo 'kill -l' >signal
20225 set X `csh -f <signal`
20229 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20231 echo $@ | $tr ' ' $trnl | \
20232 $awk '{ printf "%s %d\n", $1, ++s; }
20233 END { printf "NSIG %d\n", ++s }' >signal.lst
20235 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20237 chmod a+x signal_cmd
20238 $eunicefix signal_cmd
20240 : generate list of signal names
20242 case "$sig_name_init" in
20244 *) case "$sig_num_init" in
20245 ''|*,*) doinit=yes ;;
20250 echo "Generating a list of signal names and numbers..." >&4
20252 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20253 sig_name=`$awk 'BEGIN { printf "ZERO " }
20254 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20255 sig_num=`$awk 'BEGIN { printf "0 " }
20256 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20257 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20258 !/^NSIG/ { printf "\"%s\", ", $1 }
20259 END { printf "0\n" }' signal.lst`
20260 sig_num_init=`$awk 'BEGIN { printf "0, " }
20261 !/^NSIG/ { printf "%d, ", $2}
20262 END { printf "0\n"}' signal.lst`
20265 echo "The following $sig_count signals are available:"
20267 echo $sig_name | $awk \
20268 'BEGIN { linelen = 0 }
20270 for (i = 1; i <= NF; i++) {
20271 name = "SIG" $i " "
20272 linelen = linelen + length(name)
20273 if (linelen > 70) {
20275 linelen = length(name)
20281 sig_size=`echo $sig_name | awk '{print NF}'`
20282 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20284 : Check size of size
20286 case "$sizetype" in
20287 *_t) zzz="$sizetype" ;;
20288 *) zzz="filesize" ;;
20290 echo "Checking the size of $zzz..." >&4
20292 #include <sys/types.h>
20294 #$i_stdlib I_STDLIB
20296 #include <stdlib.h>
20299 printf("%d\n", (int)sizeof($sizetype));
20304 if eval $compile_ok; then
20308 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20311 echo "Your $zzz size is $sizesize bytes."
20316 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20320 : check for socklen_t
20322 echo "Checking to see if you have socklen_t..." >&4
20324 #include <sys/types.h>
20325 #$d_socket HAS_SOCKET
20327 #include <sys/socket.h>
20329 int main() { socklen_t x = 16; }
20332 if eval $compile; then
20334 echo "You have socklen_t."
20337 echo "You do not have socklen_t."
20338 case "$sizetype" in
20339 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20346 : see if this is a socks.h system
20347 set socks.h i_socks
20350 : check for type of the size argument to socket calls
20351 case "$d_socket" in
20355 Checking to see what type is the last argument of accept().
20358 case "$d_socklen_t" in
20359 "$define") yyy="$yyy socklen_t"
20361 yyy="$yyy $sizetype int long unsigned"
20362 for xxx in $yyy; do
20363 case "$socksizetype" in
20364 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20365 case "$usesocks" in
20367 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20368 echo "Your system accepts '$xxx *' for the last argument of accept()."
20369 socksizetype="$xxx"
20372 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20373 echo "Your system accepts '$xxx *' for the last argument of accept()."
20374 socksizetype="$xxx"
20381 : In case none of those worked, prompt the user.
20382 case "$socksizetype" in
20383 '') rp='What is the type for socket address structure sizes?'
20390 *) : no sockets, so pick relatively harmless default
20395 : see what type is used for signed size_t
20396 set ssize_t ssizetype int stdio.h sys/types.h
20401 #$i_stdlib I_STDLIB
20403 #include <stdlib.h>
20405 #include <sys/types.h>
20406 #define Size_t $sizetype
20407 #define SSize_t $dflt
20410 if (sizeof(Size_t) == sizeof(SSize_t))
20412 else if (sizeof(Size_t) == sizeof(int))
20421 if eval $compile_ok && $run ./try > /dev/null; then
20422 ssizetype=`$run ./try`
20423 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20426 Help! I can't compile and run the ssize_t test program: please enlighten me!
20427 (This is probably a misconfiguration in your system or libraries, and
20428 you really ought to fix it. Still, I'll try anyway.)
20430 I need a type that is the same size as $sizetype, but is guaranteed to
20431 be signed. Common values are ssize_t, int and long.
20434 rp="What signed type is the same size as $sizetype?"
20440 : see what type of char stdio uses.
20442 echo '#include <stdio.h>' > stdio.c
20443 $cppstdin $cppminus < stdio.c > stdioh
20444 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20445 echo "Your stdio uses unsigned chars." >&4
20446 stdchar="unsigned char"
20448 echo "Your stdio uses signed chars." >&4
20451 $rm -f stdio.* stdioh
20453 : see what type uids are declared as in the kernel
20455 echo "Looking for the type for user ids returned by getuid()."
20456 set uid_t uidtype xxx stdio.h sys/types.h
20460 xxx=`./findhdr sys/user.h`
20461 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20463 unsigned) dflt="$1 $2" ;;
20467 *) dflt="$uidtype";;
20470 uid_t) echo "uid_t found." ;;
20471 *) rp="What is the type for user ids returned by getuid()?"
20477 : Check size of UID
20480 *_t) zzz="$uidtype" ;;
20483 echo "Checking the size of $zzz..." >&4
20485 #include <sys/types.h>
20487 #$i_stdlib I_STDLIB
20489 #include <stdlib.h>
20492 printf("%d\n", (int)sizeof($uidtype));
20497 if eval $compile_ok; then
20501 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20504 echo "Your $zzz is $uidsize bytes long."
20509 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20512 : Check if UID is signed
20515 *_t) zzz="$uidtype" ;;
20518 echo "Checking the sign of $zzz..." >&4
20520 #include <sys/types.h>
20531 if eval $compile; then
20535 echo "(I can't execute the test program--guessing unsigned.)" >&4
20539 1) echo "Your $zzz is unsigned." ;;
20540 -1) echo "Your $zzz is signed." ;;
20546 echo "(I can't compile the test program--guessing unsigned.)" >&4
20550 : Check format string for UID
20552 $echo "Checking the format string to be used for uids..." >&4
20555 -1) if $test X"$uidsize" = X"$ivsize"; then
20556 uidformat="$ivdformat"
20558 if $test X"$uidsize" = X"$longsize"; then
20561 if $test X"$uidsize" = X"$intsize"; then
20564 if $test X"$uidsize" = X"$shortsize"; then
20571 *) if $test X"$uidsize" = X"$uvsize"; then
20572 uidformat="$uvuformat"
20574 if $test X"$uidsize" = X"$longsize"; then
20577 if $test X"$uidsize" = X"$intsize"; then
20580 if $test X"$uidsize" = X"$shortsize"; then
20589 : Check if site customization support was requested
20590 case "$usesitecustomize" in
20591 $define|true|[Yy]*)
20592 usesitecustomize="$define"
20595 usesitecustomize="$undef"
20599 : determine compiler compiler
20608 if $test -f "$byacc$_exe"; then
20610 comp="byacc or $comp"
20612 if $test -f "$bison$_exe"; then
20613 comp="$comp or bison -y"
20615 rp="Which compiler compiler ($comp) shall I use?"
20624 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20630 : see if this is a assert.h system
20631 set assert.h i_assert
20634 : see if this is a fp.h system
20638 : see if this is a fp_class.h system
20639 set fp_class.h i_fp_class
20642 : see if gdbm.h is available
20647 : see if gdbm_open exists
20648 set gdbm_open d_gdbm_open
20650 case "$d_gdbm_open" in
20653 echo "We won't be including <gdbm.h>"
20662 : see if this is a ieeefp.h system
20663 case "$i_ieeefp" in
20664 '' ) set ieeefp.h i_ieeefp
20669 : see if this is a libutil.h system
20670 set libutil.h i_libutil
20673 : see if mach cthreads are available
20674 if test "X$usethreads" = "X$define"; then
20675 set mach/cthreads.h i_machcthr
20678 i_machcthr="$undef"
20681 : see if this is a mntent.h system
20682 set mntent.h i_mntent
20685 : see if ndbm.h is available
20691 # Some Linux distributions such as RedHat 7.1 put the
20692 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20693 if $test -f /usr/include/gdbm/ndbm.h; then
20694 echo '<gdbm/ndbm.h> found.'
20695 ccflags="$ccflags -I/usr/include/gdbm"
20696 cppflags="$cppflags -I/usr/include/gdbm"
20704 : see if dbm_open exists
20705 set dbm_open d_dbm_open
20707 case "$d_dbm_open" in
20710 echo "We won't be including <ndbm.h>"
20719 : see if net/errno.h is available
20721 set net/errno.h val
20724 : Unfortunately, it causes problems on some systems. Arrgh.
20727 cat > try.c <<'EOM'
20730 #include <net/errno.h>
20736 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20737 echo "We'll be including <net/errno.h>." >&4
20739 echo "We won't be including <net/errno.h>." >&4
20748 : see if netinet/tcp.h is available
20749 set netinet/tcp.h i_netinettcp
20752 : see if this is a poll.h system
20756 : see if this is a prot.h system
20760 : Preprocessor symbols
20762 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20763 $cat <<'EOSH' > Cppsym.know
20764 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20765 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20766 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20767 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20768 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20769 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20770 bull c cadmus clipper CMU COFF COMPILER_VERSION
20771 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20772 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20773 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20774 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20776 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20777 H3050R H3050RX hbullx20 hcx host_mips
20778 hp200 hp300 hp700 HP700 hp800 hp9000
20779 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20780 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20781 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20782 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20783 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20784 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20785 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20786 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20787 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20788 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20789 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20790 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20791 MATH_HAS_NO_SIDE_EFFECTS
20792 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20793 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20794 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20795 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20796 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20797 NetBSD news1500 news1700 news1800 news1900 news3700
20798 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20799 ns32016 ns32332 ns32k nsc32000
20800 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20801 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20802 pc532 pdp11 PGC PIC plexus PORTAR posix
20803 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20804 POSIX_C_SOURCE POSIX_SOURCE POWER
20805 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20806 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20807 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20808 sony sony_news sonyrisc sparc sparclite spectrum
20809 stardent stdc STDC_EXT stratos sun sun3 sun386
20810 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20811 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20812 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20813 sysV68 sysV88 Tek4132 Tek4300 titan
20814 TM3200 TM5400 TM5600
20815 tower tower32 tower32_200 tower32_600 tower32_700
20816 tower32_800 tower32_850 tss
20817 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20818 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20819 unix UNIX95 UNIX99 unixpc unos
20820 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20821 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20822 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20824 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20825 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20826 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20829 # Maybe put other stuff here too.
20830 cat <<EOSH >>Cppsym.know
20833 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20834 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20835 $cat Cppsym.know > Cppsym.c
20836 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20837 $rm -f Cppsym.a Cppsym.b Cppsym.c
20838 cat <<EOSH > Cppsym
20840 if $test \$# -gt 0; then
20841 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20842 if $test -s Cppsym.got; then
20849 $tr " " "$trnl" | ./Cppsym.try
20855 cat <<EOSH > Cppsym.try
20857 cat <<'EOCP' > try.c
20860 #define STRINGIFY(a) "a"
20862 #if cpp_stuff == 42
20863 #define StGiFy(a) #a
20864 #define STRINGIFY(a) StGiFy(a)
20866 #if $cpp_stuff != 1 && $cpp_stuff != 42
20867 # include "Bletch: How does this C preprocessor stringify macros?"
20873 cat <<'EOSH' >> Cppsym.try
20875 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20876 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20877 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20878 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20880 echo 'return 0;}' >> try.c
20882 cat <<EOSH >> Cppsym.try
20884 case "$osname-$gccversion" in
20885 irix-) ccflags="\$ccflags -woff 1178" ;;
20886 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20888 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20890 chmod +x Cppsym.try
20891 $eunicefix Cppsym.try
20892 ./Cppsym < Cppsym.know > Cppsym.true
20893 : Add in any linux cpp "predefined macros":
20894 case "$osname::$gccversion" in
20897 rm -f $tHdrH'.h' $tHdrH
20899 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20900 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20901 if [ -s $tHdrH'_cppsym.real' ]; then
20902 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20905 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20908 : now check the C compiler for additional symbols
20909 postprocess_cc_v=''
20911 aix) postprocess_cc_v="|$tr , ' '" ;;
20918 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20921 -D*) echo "\$i" | $sed 's/^-D//';;
20922 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20927 postprocess_cc_v=''
20930 ./ccsym > ccsym1.raw
20931 if $test -s ccsym1.raw; then
20932 $sort ccsym1.raw | $uniq >ccsym.raw
20934 mv ccsym1.raw ccsym.raw
20937 $awk '/\=/ { print $0; next }
20938 { print $0"=1" }' ccsym.raw >ccsym.list
20939 $comm -13 Cppsym.true ccsym.list >ccsym.own
20940 $comm -12 Cppsym.true ccsym.list >ccsym.com
20941 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20943 if $test -z ccsym.raw; then
20944 echo "Your C compiler doesn't seem to define any symbols!" >&4
20946 echo "However, your C preprocessor defines the following symbols:"
20949 cppsymbols=`$cat Cppsym.true`
20950 cppsymbols=`echo $cppsymbols`
20951 cppccsymbols="$cppsymbols"
20953 if $test -s ccsym.com; then
20954 echo "Your C compiler and pre-processor define these symbols:"
20955 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20958 cppccsymbols=`$cat ccsym.com`
20959 cppccsymbols=`echo $cppccsymbols`
20960 $test "$silent" || sleep 1
20962 if $test -s ccsym.cpp; then
20963 $test "$also" && echo " "
20964 echo "Your C pre-processor ${also}defines the following symbols:"
20965 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20967 cppsymbols=`$cat ccsym.cpp`
20968 cppsymbols=`echo $cppsymbols`
20969 $test "$silent" || sleep 1
20971 if $test -s ccsym.own; then
20972 $test "$also" && echo " "
20973 echo "Your C compiler ${also}defines the following cpp symbols:"
20974 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20975 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20976 ccsymbols=`$cat ccsym.own`
20977 ccsymbols=`echo $ccsymbols`
20978 $test "$silent" || sleep 1
20982 : see if this is a termio system
20986 if $test `./findhdr termios.h`; then
20987 set tcsetattr i_termios
20993 "$define") echo "You have POSIX termios.h... good!" >&4;;
20994 *) if ./Cppsym pyr; then
20995 case "`/bin/universe`" in
20996 ucb) if $test `./findhdr sgtty.h`; then
20998 echo "<sgtty.h> found." >&4
21000 echo "System is pyramid with BSD universe."
21001 echo "<sgtty.h> not found--you could have problems." >&4
21003 *) if $test `./findhdr termio.h`; then
21005 echo "<termio.h> found." >&4
21007 echo "System is pyramid with USG universe."
21008 echo "<termio.h> not found--you could have problems." >&4
21012 if $test `./findhdr termio.h`; then
21013 echo "<termio.h> found." >&4
21015 elif $test `./findhdr sgtty.h`; then
21016 echo "<sgtty.h> found." >&4
21019 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
21022 if $test `./findhdr sgtty.h`; then
21023 echo "<sgtty.h> found." >&4
21025 elif $test `./findhdr termio.h`; then
21026 echo "<termio.h> found." >&4
21029 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
21033 set i_termio; eval $setvar
21034 val=$val2; set i_sgtty; eval $setvar
21035 val=$val3; set i_termios; eval $setvar
21037 : see if stddef is available
21038 set stddef.h i_stddef
21041 : see if sys/access.h is available
21042 set sys/access.h i_sysaccess
21045 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21046 set sys/filio.h i_sysfilio
21049 if $test `./findhdr sys/ioctl.h`; then
21051 echo '<sys/ioctl.h> found.' >&4
21054 if $test $i_sysfilio = "$define"; then
21055 echo '<sys/ioctl.h> NOT found.' >&4
21057 $test $i_sgtty = "$define" && xxx="sgtty.h"
21058 $test $i_termio = "$define" && xxx="termio.h"
21059 $test $i_termios = "$define" && xxx="termios.h"
21060 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21066 : see if socket ioctl defs are in sys/sockio.h
21068 xxx=`./findhdr sys/sockio.h`
21069 if $test "$xxx"; then
21070 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21072 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21075 echo "No socket ioctls found in <sys/sockio.h>." >&4
21080 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21086 : see if this is a syslog.h system
21087 set syslog.h i_syslog
21090 : see if this is a sys/mode.h system
21091 set sys/mode.h i_sysmode
21094 : see if sys/resource.h has to be included
21095 set sys/resource.h i_sysresrc
21098 : see if sys/security.h is available
21099 set sys/security.h i_syssecrt
21102 : see if this is a sys/statvfs.h system
21103 set sys/statvfs.h i_sysstatvfs
21106 : see if this is a sys/un.h system
21107 set sys/un.h i_sysun
21110 : see if this is a sys/utsname.h system
21111 set sys/utsname.h i_sysutsname
21114 : see if this is a syswait system
21115 set sys/wait.h i_syswait
21118 : see if this is a ustat.h system
21119 set ustat.h i_ustat
21122 : see if this is an utime system
21123 set utime.h i_utime
21126 : see if this is a values.h system
21127 set values.h i_values
21130 : see if this is a vfork system
21133 set vfork.h i_vfork
21143 echo "Looking for extensions..." >&4
21144 : If we are using the old config.sh, known_extensions may contain
21145 : old or inaccurate or duplicate values.
21146 known_extensions=''
21147 nonxs_extensions=''
21148 : We do not use find because it might not be available.
21149 : We do not just use MANIFEST because the user may have dropped
21150 : some additional extensions into the source tree and expect them
21153 : Function to recursively find available extensions, ignoring DynaLoader
21154 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21158 DynaLoader|dynaload) ;;
21160 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21161 known_extensions="$known_extensions $1$xxx";
21162 elif $test -f $xxx/Makefile.PL; then
21163 nonxs_extensions="$nonxs_extensions $1$xxx";
21165 if $test -d $xxx -a $# -lt 10; then
21168 eval $find_extensions;
21180 eval $find_extensions
21181 # Special case: Add in modules that nest beyond the first level.
21182 # Currently threads/shared and Hash/Util/FieldHash, since they are
21183 # not picked up by the recursive find above (and adding in general
21184 # recursive finding breaks SDBM_File/sdbm).
21185 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21186 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21187 set X $known_extensions
21189 known_extensions="$*"
21190 set X $nonxs_extensions
21192 nonxs_extensions="$*"
21195 : Now see which are supported on this system.
21197 for xxx in $known_extensions ; do
21201 $define) avail_ext="$avail_ext $xxx" ;;
21204 GDBM_File|gdbm_fil)
21206 $define) avail_ext="$avail_ext $xxx" ;;
21209 I18N/Langinfo|i18n_lan)
21210 case "$i_langinfo$d_nl_langinfo" in
21211 $define$define) avail_ext="$avail_ext $xxx" ;;
21215 : XXX Do we need a useipcsysv variable here
21216 case "${d_msg}${d_sem}${d_shm}" in
21217 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21220 NDBM_File|ndbm_fil)
21223 case "$osname-$use64bitint" in
21226 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21229 *) avail_ext="$avail_ext $xxx" ;;
21234 ODBM_File|odbm_fil)
21235 case "${i_dbm}${i_rpcsvcdbm}" in
21237 case "$d_cplusplus" in
21238 define) ;; # delete as a function name will not work
21239 *) case "$osname-$use64bitint" in
21242 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21245 *) avail_ext="$avail_ext $xxx" ;;
21253 case "$useopcode" in
21254 true|define|y) avail_ext="$avail_ext $xxx" ;;
21258 case "$useposix" in
21259 true|define|y) avail_ext="$avail_ext $xxx" ;;
21263 case "$d_socket" in
21266 beos) ;; # not unless BONE
21267 *) avail_ext="$avail_ext $xxx" ;;
21272 Sys/Syslog|sys/syslog)
21273 : XXX syslog requires socket
21274 case "$d_socket" in
21275 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21279 case "$usethreads" in
21281 case "$use5005threads" in
21282 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21286 threads|threads/shared)
21287 # threads and threads::shared are special cases.
21288 # To stop people from asking "Perl 5.8.0 was supposed
21289 # to have this new fancy threads implementation but my
21290 # perl doesn't have it" and from people trying to
21291 # (re)install the threads module using CPAN.pm and
21292 # CPAN.pm then offering to reinstall Perl 5.8.0,
21293 # the threads.pm and threads/shared.pm will always be
21294 # there, croaking informatively ("you need to rebuild
21295 # all of Perl with threads, sorry") when threads haven't
21296 # been compiled in.
21298 avail_ext="$avail_ext $xxx"
21302 cygwin) avail_ext="$avail_ext $xxx" ;;
21305 XS/APItest|xs/apitest)
21306 # This is just for testing. Skip it unless we have dynamic loading.
21309 $define) avail_ext="$avail_ext $xxx" ;;
21312 XS/Typemap|xs/typemap)
21313 # This is just for testing. Skip it unless we have dynamic loading.
21315 $define) avail_ext="$avail_ext $xxx" ;;
21318 *) avail_ext="$avail_ext $xxx"
21327 case "$onlyextensions" in
21329 *) keepextensions=''
21330 echo "You have requested that only certains extensions be included..." >&4
21331 for i in $onlyextensions; do
21332 case " $avail_ext " in
21334 echo "Keeping extension $i."
21335 keepextensions="$keepextensions $i"
21337 *) echo "Ignoring extension $i." ;;
21340 avail_ext="$keepextensions"
21344 case "$noextensions" in
21346 *) keepextensions=''
21347 echo "You have requested that certain extensions be ignored..." >&4
21348 for i in $avail_ext; do
21349 case " $noextensions " in
21350 *" $i "*) echo "Ignoring extension $i." ;;
21351 *) echo "Keeping extension $i.";
21352 keepextensions="$keepextensions $i"
21356 avail_ext="$keepextensions"
21360 : Now see which nonxs extensions are supported on this system.
21361 : For now assume all are.
21363 for xxx in $nonxs_extensions ; do
21365 *) nonxs_ext="$nonxs_ext $xxx"
21377 A number of extensions are supplied with $package. You may choose to
21378 compile these extensions for dynamic loading (the default), compile
21379 them into the $package executable (static loading), or not include
21380 them at all. Answer "none" to include no extensions.
21381 Note that DynaLoader is always built and need not be mentioned here.
21384 case "$dynamic_ext" in
21386 : Exclude those listed in static_ext
21388 for xxx in $avail_ext; do
21389 case " $static_ext " in
21391 *) dflt="$dflt $xxx" ;;
21398 *) dflt="$dynamic_ext"
21399 # Perhaps we are reusing an old out-of-date config.sh.
21402 if test X"$dynamic_ext" != X"$avail_ext"; then
21404 NOTICE: Your previous config.sh list may be incorrect.
21405 The extensions now available to you are
21407 but the default list from your previous config.sh is
21419 rp="What extensions do you wish to load dynamically?"
21422 none) dynamic_ext=' ' ;;
21423 *) dynamic_ext="$ans" ;;
21426 case "$static_ext" in
21428 : Exclude those already listed in dynamic linking
21430 for xxx in $avail_ext; do
21431 case " $dynamic_ext " in
21433 *) dflt="$dflt $xxx" ;;
21440 *) dflt="$static_ext"
21447 rp="What extensions do you wish to load statically?"
21450 none) static_ext=' ' ;;
21451 *) static_ext="$ans" ;;
21456 A number of extensions are supplied with $package. Answer "none"
21457 to include no extensions.
21458 Note that DynaLoader is always built and need not be mentioned here.
21461 case "$static_ext" in
21462 '') dflt="$avail_ext" ;;
21463 *) dflt="$static_ext"
21464 # Perhaps we are reusing an old out-of-date config.sh.
21467 if test X"$static_ext" != X"$avail_ext"; then
21469 NOTICE: Your previous config.sh list may be incorrect.
21470 The extensions now available to you are
21472 but the default list from your previous config.sh is
21481 : Exclude those that are not xs extensions
21485 rp="What extensions do you wish to include?"
21488 none) static_ext=' ' ;;
21489 *) static_ext="$ans" ;;
21494 # Encode is a special case. If we are building Encode as a static
21495 # extension, we need to explicitly list its subextensions as well.
21496 # For other nested extensions, this is handled automatically by
21497 # the appropriate Makefile.PL.
21498 case " $static_ext " in
21499 *" Encode "*) # Add the subextensions of Encode
21501 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21502 static_ext="$static_ext Encode/$xxx"
21508 set X $dynamic_ext $static_ext $nonxs_ext
21512 # Sanity check: We require an extension suitable for use with
21513 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21514 # should show up as failures in the test suite, but it's helpful to
21515 # catch them now.) The 'extensions' list is normally sorted
21516 # alphabetically, so we need to accept either
21517 # DB_File ... Fcntl ... IO ....
21518 # or something like
21519 # Fcntl ... NDBM_File ... IO ....
21520 case " $extensions" in
21521 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21522 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21523 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21524 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21525 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21529 : Remove libraries needed only for extensions
21530 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21531 : The exception is SunOS 4.x, which needs them.
21532 case "${osname}X${osvers}" in
21536 *) case "$usedl" in
21537 $define|true|[yY]*)
21538 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21542 *) perllibs="$libs"
21548 : Remove build directory name from cppstdin so it can be used from
21549 : either the present location or the final installed location.
21551 : Get out of the UU directory to get correct path name.
21553 case "$cppstdin" in
21555 echo "Stripping down cppstdin path name"
21561 : end of configuration questions
21563 echo "End of configuration questions."
21566 : back to where it started
21567 if test -d ../UU; then
21571 : configuration may be unconditionally patched via a 'config.arch' file
21572 if $test -f config.arch; then
21573 echo "I see a config.arch file, loading it." >&4
21577 : configuration may be patched via a 'config.over' file
21578 if $test -f config.over; then
21581 rp='I see a config.over file. Do you wish to load it?'
21584 n*) echo "OK, I'll ignore it.";;
21586 echo "Configuration override changes have been loaded."
21591 : in case they want portability, strip down executable paths
21592 case "$d_portable" in
21595 echo "Stripping down executable paths..." >&4
21596 for file in $loclist $trylist; do
21598 eval $file=`basename $temp`
21603 : create config.sh file
21605 echo "Creating config.sh..." >&4
21606 $spitshell <<EOT >config.sh
21609 # This file was produced by running the Configure script. It holds all the
21610 # definitions figured out by Configure. Should you modify one of these values,
21611 # do not forget to propagate your changes by running "Configure -der". You may
21612 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21615 # Package name : $package
21616 # Source directory : $src
21617 # Configuration time: $cf_time
21618 # Configured by : $cf_by
21619 # Target system : $myuname
21622 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21623 $spitshell <<EOT >>config.sh
21632 Revision='$Revision'
21640 alignbytes='$alignbytes'
21641 ansi2knr='$ansi2knr'
21642 aphostname='$aphostname'
21643 api_revision='$api_revision'
21644 api_subversion='$api_subversion'
21645 api_version='$api_version'
21646 api_versionstring='$api_versionstring'
21649 archlibexp='$archlibexp'
21650 archname64='$archname64'
21651 archname='$archname'
21652 archobjs='$archobjs'
21653 asctime_r_proto='$asctime_r_proto'
21661 byteorder='$byteorder'
21663 castflags='$castflags'
21666 cccdlflags='$cccdlflags'
21667 ccdlflags='$ccdlflags'
21669 ccflags_uselargefiles='$ccflags_uselargefiles'
21671 ccsymbols='$ccsymbols'
21672 ccversion='$ccversion'
21674 cf_email='$cf_email'
21679 clocktype='$clocktype'
21681 compress='$compress'
21682 contains='$contains'
21686 cpp_stuff='$cpp_stuff'
21687 cppccsymbols='$cppccsymbols'
21688 cppflags='$cppflags'
21690 cppminus='$cppminus'
21692 cppstdin='$cppstdin'
21693 cppsymbols='$cppsymbols'
21694 crypt_r_proto='$crypt_r_proto'
21695 cryptlib='$cryptlib'
21697 ctermid_r_proto='$ctermid_r_proto'
21698 ctime_r_proto='$ctime_r_proto'
21699 d_Gconvert='$d_Gconvert'
21700 d_PRIEUldbl='$d_PRIEUldbl'
21701 d_PRIFUldbl='$d_PRIFUldbl'
21702 d_PRIGUldbl='$d_PRIGUldbl'
21703 d_PRIXU64='$d_PRIXU64'
21704 d_PRId64='$d_PRId64'
21705 d_PRIeldbl='$d_PRIeldbl'
21706 d_PRIfldbl='$d_PRIfldbl'
21707 d_PRIgldbl='$d_PRIgldbl'
21708 d_PRIi64='$d_PRIi64'
21709 d_PRIo64='$d_PRIo64'
21710 d_PRIu64='$d_PRIu64'
21711 d_PRIx64='$d_PRIx64'
21712 d_SCNfldbl='$d_SCNfldbl'
21713 d__fwalk='$d__fwalk'
21714 d_access='$d_access'
21715 d_accessx='$d_accessx'
21718 d_archlib='$d_archlib'
21719 d_asctime_r='$d_asctime_r'
21722 d_attribute_format='$d_attribute_format'
21723 d_attribute_malloc='$d_attribute_malloc'
21724 d_attribute_nonnull='$d_attribute_nonnull'
21725 d_attribute_noreturn='$d_attribute_noreturn'
21726 d_attribute_pure='$d_attribute_pure'
21727 d_attribute_unused='$d_attribute_unused'
21728 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21732 d_bsdgetpgrp='$d_bsdgetpgrp'
21733 d_bsdsetpgrp='$d_bsdsetpgrp'
21734 d_builtin_choose_expr='$d_builtin_choose_expr'
21735 d_builtin_expect='$d_builtin_expect'
21737 d_c99_variadic_macros='$d_c99_variadic_macros'
21738 d_casti32='$d_casti32'
21739 d_castneg='$d_castneg'
21740 d_charvspr='$d_charvspr'
21742 d_chroot='$d_chroot'
21743 d_chsize='$d_chsize'
21745 d_clearenv='$d_clearenv'
21746 d_closedir='$d_closedir'
21747 d_cmsghdr_s='$d_cmsghdr_s'
21749 d_copysignl='$d_copysignl'
21750 d_cplusplus='$d_cplusplus'
21752 d_crypt_r='$d_crypt_r'
21754 d_ctermid='$d_ctermid'
21755 d_ctermid_r='$d_ctermid_r'
21756 d_ctime_r='$d_ctime_r'
21757 d_cuserid='$d_cuserid'
21758 d_dbl_dig='$d_dbl_dig'
21759 d_dbminitproto='$d_dbminitproto'
21760 d_difftime='$d_difftime'
21761 d_dir_dd_fd='$d_dir_dd_fd'
21763 d_dirnamlen='$d_dirnamlen'
21764 d_dlerror='$d_dlerror'
21765 d_dlopen='$d_dlopen'
21766 d_dlsymun='$d_dlsymun'
21767 d_dosuid='$d_dosuid'
21768 d_drand48_r='$d_drand48_r'
21769 d_drand48proto='$d_drand48proto'
21771 d_eaccess='$d_eaccess'
21772 d_endgrent='$d_endgrent'
21773 d_endgrent_r='$d_endgrent_r'
21774 d_endhent='$d_endhent'
21775 d_endhostent_r='$d_endhostent_r'
21776 d_endnent='$d_endnent'
21777 d_endnetent_r='$d_endnetent_r'
21778 d_endpent='$d_endpent'
21779 d_endprotoent_r='$d_endprotoent_r'
21780 d_endpwent='$d_endpwent'
21781 d_endpwent_r='$d_endpwent_r'
21782 d_endsent='$d_endsent'
21783 d_endservent_r='$d_endservent_r'
21784 d_eofnblk='$d_eofnblk'
21785 d_eunice='$d_eunice'
21786 d_faststdio='$d_faststdio'
21787 d_fchdir='$d_fchdir'
21788 d_fchmod='$d_fchmod'
21789 d_fchown='$d_fchown'
21791 d_fcntl_can_lock='$d_fcntl_can_lock'
21792 d_fd_macros='$d_fd_macros'
21793 d_fd_set='$d_fd_set'
21794 d_fds_bits='$d_fds_bits'
21795 d_fgetpos='$d_fgetpos'
21796 d_finite='$d_finite'
21797 d_finitel='$d_finitel'
21798 d_flexfnam='$d_flexfnam'
21800 d_flockproto='$d_flockproto'
21802 d_fp_class='$d_fp_class'
21803 d_fpathconf='$d_fpathconf'
21804 d_fpclass='$d_fpclass'
21805 d_fpclassify='$d_fpclassify'
21806 d_fpclassl='$d_fpclassl'
21807 d_fpos64_t='$d_fpos64_t'
21808 d_frexpl='$d_frexpl'
21809 d_fs_data_s='$d_fs_data_s'
21810 d_fseeko='$d_fseeko'
21811 d_fsetpos='$d_fsetpos'
21812 d_fstatfs='$d_fstatfs'
21813 d_fstatvfs='$d_fstatvfs'
21815 d_ftello='$d_ftello'
21817 d_futimes='$d_futimes'
21818 d_getcwd='$d_getcwd'
21819 d_getespwnam='$d_getespwnam'
21820 d_getfsstat='$d_getfsstat'
21821 d_getgrent='$d_getgrent'
21822 d_getgrent_r='$d_getgrent_r'
21823 d_getgrgid_r='$d_getgrgid_r'
21824 d_getgrnam_r='$d_getgrnam_r'
21825 d_getgrps='$d_getgrps'
21826 d_gethbyaddr='$d_gethbyaddr'
21827 d_gethbyname='$d_gethbyname'
21828 d_gethent='$d_gethent'
21829 d_gethname='$d_gethname'
21830 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21831 d_gethostbyname_r='$d_gethostbyname_r'
21832 d_gethostent_r='$d_gethostent_r'
21833 d_gethostprotos='$d_gethostprotos'
21834 d_getitimer='$d_getitimer'
21835 d_getlogin='$d_getlogin'
21836 d_getlogin_r='$d_getlogin_r'
21837 d_getmnt='$d_getmnt'
21838 d_getmntent='$d_getmntent'
21839 d_getnbyaddr='$d_getnbyaddr'
21840 d_getnbyname='$d_getnbyname'
21841 d_getnent='$d_getnent'
21842 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21843 d_getnetbyname_r='$d_getnetbyname_r'
21844 d_getnetent_r='$d_getnetent_r'
21845 d_getnetprotos='$d_getnetprotos'
21846 d_getpagsz='$d_getpagsz'
21847 d_getpbyname='$d_getpbyname'
21848 d_getpbynumber='$d_getpbynumber'
21849 d_getpent='$d_getpent'
21850 d_getpgid='$d_getpgid'
21851 d_getpgrp2='$d_getpgrp2'
21852 d_getpgrp='$d_getpgrp'
21853 d_getppid='$d_getppid'
21854 d_getprior='$d_getprior'
21855 d_getprotobyname_r='$d_getprotobyname_r'
21856 d_getprotobynumber_r='$d_getprotobynumber_r'
21857 d_getprotoent_r='$d_getprotoent_r'
21858 d_getprotoprotos='$d_getprotoprotos'
21859 d_getprpwnam='$d_getprpwnam'
21860 d_getpwent='$d_getpwent'
21861 d_getpwent_r='$d_getpwent_r'
21862 d_getpwnam_r='$d_getpwnam_r'
21863 d_getpwuid_r='$d_getpwuid_r'
21864 d_getsbyname='$d_getsbyname'
21865 d_getsbyport='$d_getsbyport'
21866 d_getsent='$d_getsent'
21867 d_getservbyname_r='$d_getservbyname_r'
21868 d_getservbyport_r='$d_getservbyport_r'
21869 d_getservent_r='$d_getservent_r'
21870 d_getservprotos='$d_getservprotos'
21871 d_getspnam='$d_getspnam'
21872 d_getspnam_r='$d_getspnam_r'
21873 d_gettimeod='$d_gettimeod'
21874 d_gmtime_r='$d_gmtime_r'
21875 d_gnulibc='$d_gnulibc'
21876 d_grpasswd='$d_grpasswd'
21877 d_hasmntopt='$d_hasmntopt'
21879 d_ilogbl='$d_ilogbl'
21880 d_inc_version_list='$d_inc_version_list'
21882 d_inetaton='$d_inetaton'
21883 d_int64_t='$d_int64_t'
21884 d_isascii='$d_isascii'
21885 d_isfinite='$d_isfinite'
21888 d_isnanl='$d_isnanl'
21889 d_killpg='$d_killpg'
21890 d_lchown='$d_lchown'
21891 d_ldbl_dig='$d_ldbl_dig'
21892 d_libm_lib_version='$d_libm_lib_version'
21894 d_localtime_r='$d_localtime_r'
21895 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21896 d_locconv='$d_locconv'
21898 d_longdbl='$d_longdbl'
21899 d_longlong='$d_longlong'
21900 d_lseekproto='$d_lseekproto'
21902 d_madvise='$d_madvise'
21903 d_malloc_good_size='$d_malloc_good_size'
21904 d_malloc_size='$d_malloc_size'
21906 d_mbstowcs='$d_mbstowcs'
21907 d_mbtowc='$d_mbtowc'
21908 d_memchr='$d_memchr'
21909 d_memcmp='$d_memcmp'
21910 d_memcpy='$d_memcpy'
21911 d_memmove='$d_memmove'
21912 d_memset='$d_memset'
21914 d_mkdtemp='$d_mkdtemp'
21915 d_mkfifo='$d_mkfifo'
21916 d_mkstemp='$d_mkstemp'
21917 d_mkstemps='$d_mkstemps'
21918 d_mktime='$d_mktime'
21921 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21922 d_modflproto='$d_modflproto'
21923 d_mprotect='$d_mprotect'
21925 d_msg_ctrunc='$d_msg_ctrunc'
21926 d_msg_dontroute='$d_msg_dontroute'
21927 d_msg_oob='$d_msg_oob'
21928 d_msg_peek='$d_msg_peek'
21929 d_msg_proxy='$d_msg_proxy'
21930 d_msgctl='$d_msgctl'
21931 d_msgget='$d_msgget'
21932 d_msghdr_s='$d_msghdr_s'
21933 d_msgrcv='$d_msgrcv'
21934 d_msgsnd='$d_msgsnd'
21936 d_munmap='$d_munmap'
21937 d_mymalloc='$d_mymalloc'
21939 d_nl_langinfo='$d_nl_langinfo'
21940 d_nv_preserves_uv='$d_nv_preserves_uv'
21941 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21942 d_off64_t='$d_off64_t'
21943 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21944 d_oldpthreads='$d_oldpthreads'
21945 d_oldsock='$d_oldsock'
21947 d_pathconf='$d_pathconf'
21949 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21950 d_phostname='$d_phostname'
21953 d_portable='$d_portable'
21954 d_printf_format_null='$d_printf_format_null'
21955 d_procselfexe='$d_procselfexe'
21956 d_pseudofork='$d_pseudofork'
21957 d_pthread_atfork='$d_pthread_atfork'
21958 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21959 d_pthread_yield='$d_pthread_yield'
21961 d_pwchange='$d_pwchange'
21962 d_pwclass='$d_pwclass'
21963 d_pwcomment='$d_pwcomment'
21964 d_pwexpire='$d_pwexpire'
21965 d_pwgecos='$d_pwgecos'
21966 d_pwpasswd='$d_pwpasswd'
21967 d_pwquota='$d_pwquota'
21970 d_random_r='$d_random_r'
21971 d_readdir64_r='$d_readdir64_r'
21972 d_readdir='$d_readdir'
21973 d_readdir_r='$d_readdir_r'
21974 d_readlink='$d_readlink'
21976 d_recvmsg='$d_recvmsg'
21977 d_rename='$d_rename'
21978 d_rewinddir='$d_rewinddir'
21980 d_safebcpy='$d_safebcpy'
21981 d_safemcpy='$d_safemcpy'
21982 d_sanemcmp='$d_sanemcmp'
21983 d_sbrkproto='$d_sbrkproto'
21984 d_scalbnl='$d_scalbnl'
21985 d_sched_yield='$d_sched_yield'
21986 d_scm_rights='$d_scm_rights'
21987 d_seekdir='$d_seekdir'
21988 d_select='$d_select'
21990 d_semctl='$d_semctl'
21991 d_semctl_semid_ds='$d_semctl_semid_ds'
21992 d_semctl_semun='$d_semctl_semun'
21993 d_semget='$d_semget'
21995 d_sendmsg='$d_sendmsg'
21996 d_setegid='$d_setegid'
21997 d_seteuid='$d_seteuid'
21998 d_setgrent='$d_setgrent'
21999 d_setgrent_r='$d_setgrent_r'
22000 d_setgrps='$d_setgrps'
22001 d_sethent='$d_sethent'
22002 d_sethostent_r='$d_sethostent_r'
22003 d_setitimer='$d_setitimer'
22004 d_setlinebuf='$d_setlinebuf'
22005 d_setlocale='$d_setlocale'
22006 d_setlocale_r='$d_setlocale_r'
22007 d_setnent='$d_setnent'
22008 d_setnetent_r='$d_setnetent_r'
22009 d_setpent='$d_setpent'
22010 d_setpgid='$d_setpgid'
22011 d_setpgrp2='$d_setpgrp2'
22012 d_setpgrp='$d_setpgrp'
22013 d_setprior='$d_setprior'
22014 d_setproctitle='$d_setproctitle'
22015 d_setprotoent_r='$d_setprotoent_r'
22016 d_setpwent='$d_setpwent'
22017 d_setpwent_r='$d_setpwent_r'
22018 d_setregid='$d_setregid'
22019 d_setresgid='$d_setresgid'
22020 d_setresuid='$d_setresuid'
22021 d_setreuid='$d_setreuid'
22022 d_setrgid='$d_setrgid'
22023 d_setruid='$d_setruid'
22024 d_setsent='$d_setsent'
22025 d_setservent_r='$d_setservent_r'
22026 d_setsid='$d_setsid'
22027 d_setvbuf='$d_setvbuf'
22031 d_shmatprototype='$d_shmatprototype'
22032 d_shmctl='$d_shmctl'
22034 d_shmget='$d_shmget'
22035 d_sigaction='$d_sigaction'
22036 d_signbit='$d_signbit'
22037 d_sigprocmask='$d_sigprocmask'
22038 d_sigsetjmp='$d_sigsetjmp'
22039 d_sitearch='$d_sitearch'
22040 d_snprintf='$d_snprintf'
22041 d_sockatmark='$d_sockatmark'
22042 d_sockatmarkproto='$d_sockatmarkproto'
22043 d_socket='$d_socket'
22044 d_socklen_t='$d_socklen_t'
22045 d_sockpair='$d_sockpair'
22046 d_socks5_init='$d_socks5_init'
22047 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22049 d_srand48_r='$d_srand48_r'
22050 d_srandom_r='$d_srandom_r'
22051 d_sresgproto='$d_sresgproto'
22052 d_sresuproto='$d_sresuproto'
22053 d_statblks='$d_statblks'
22054 d_statfs_f_flags='$d_statfs_f_flags'
22055 d_statfs_s='$d_statfs_s'
22056 d_statvfs='$d_statvfs'
22057 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22058 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22059 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22060 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22061 d_stdio_stream_array='$d_stdio_stream_array'
22062 d_stdiobase='$d_stdiobase'
22063 d_stdstdio='$d_stdstdio'
22064 d_strchr='$d_strchr'
22065 d_strcoll='$d_strcoll'
22066 d_strctcpy='$d_strctcpy'
22067 d_strerrm='$d_strerrm'
22068 d_strerror='$d_strerror'
22069 d_strerror_r='$d_strerror_r'
22070 d_strftime='$d_strftime'
22071 d_strlcat='$d_strlcat'
22072 d_strlcpy='$d_strlcpy'
22073 d_strtod='$d_strtod'
22074 d_strtol='$d_strtol'
22075 d_strtold='$d_strtold'
22076 d_strtoll='$d_strtoll'
22077 d_strtoq='$d_strtoq'
22078 d_strtoul='$d_strtoul'
22079 d_strtoull='$d_strtoull'
22080 d_strtouq='$d_strtouq'
22081 d_strxfrm='$d_strxfrm'
22082 d_suidsafe='$d_suidsafe'
22083 d_symlink='$d_symlink'
22084 d_syscall='$d_syscall'
22085 d_syscallproto='$d_syscallproto'
22086 d_sysconf='$d_sysconf'
22087 d_sysernlst='$d_sysernlst'
22088 d_syserrlst='$d_syserrlst'
22089 d_system='$d_system'
22090 d_tcgetpgrp='$d_tcgetpgrp'
22091 d_tcsetpgrp='$d_tcsetpgrp'
22092 d_telldir='$d_telldir'
22093 d_telldirproto='$d_telldirproto'
22096 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22097 d_tm_tm_zone='$d_tm_tm_zone'
22098 d_tmpnam_r='$d_tmpnam_r'
22099 d_truncate='$d_truncate'
22100 d_ttyname_r='$d_ttyname_r'
22101 d_tzname='$d_tzname'
22102 d_u32align='$d_u32align'
22103 d_ualarm='$d_ualarm'
22106 d_union_semun='$d_union_semun'
22107 d_unordered='$d_unordered'
22108 d_unsetenv='$d_unsetenv'
22109 d_usleep='$d_usleep'
22110 d_usleepproto='$d_usleepproto'
22112 d_vendorarch='$d_vendorarch'
22113 d_vendorbin='$d_vendorbin'
22114 d_vendorlib='$d_vendorlib'
22115 d_vendorscript='$d_vendorscript'
22117 d_void_closedir='$d_void_closedir'
22118 d_voidsig='$d_voidsig'
22119 d_voidtty='$d_voidtty'
22120 d_volatile='$d_volatile'
22121 d_vprintf='$d_vprintf'
22122 d_vsnprintf='$d_vsnprintf'
22124 d_waitpid='$d_waitpid'
22125 d_wcstombs='$d_wcstombs'
22126 d_wctomb='$d_wctomb'
22127 d_writev='$d_writev'
22130 db_hashtype='$db_hashtype'
22131 db_prefixtype='$db_prefixtype'
22132 db_version_major='$db_version_major'
22133 db_version_minor='$db_version_minor'
22134 db_version_patch='$db_version_patch'
22135 defvoidused='$defvoidused'
22136 direntrytype='$direntrytype'
22139 doublesize='$doublesize'
22141 drand48_r_proto='$drand48_r_proto'
22143 dynamic_ext='$dynamic_ext'
22149 endgrent_r_proto='$endgrent_r_proto'
22150 endhostent_r_proto='$endhostent_r_proto'
22151 endnetent_r_proto='$endnetent_r_proto'
22152 endprotoent_r_proto='$endprotoent_r_proto'
22153 endpwent_r_proto='$endpwent_r_proto'
22154 endservent_r_proto='$endservent_r_proto'
22155 eunicefix='$eunicefix'
22158 extensions='$extensions'
22160 fflushNULL='$fflushNULL'
22161 fflushall='$fflushall'
22163 firstmakefile='$firstmakefile'
22165 fpossize='$fpossize'
22166 fpostype='$fpostype'
22167 freetype='$freetype'
22170 full_csh='$full_csh'
22171 full_sed='$full_sed'
22172 gccansipedantic='$gccansipedantic'
22173 gccosandvers='$gccosandvers'
22174 gccversion='$gccversion'
22175 getgrent_r_proto='$getgrent_r_proto'
22176 getgrgid_r_proto='$getgrgid_r_proto'
22177 getgrnam_r_proto='$getgrnam_r_proto'
22178 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22179 gethostbyname_r_proto='$gethostbyname_r_proto'
22180 gethostent_r_proto='$gethostent_r_proto'
22181 getlogin_r_proto='$getlogin_r_proto'
22182 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22183 getnetbyname_r_proto='$getnetbyname_r_proto'
22184 getnetent_r_proto='$getnetent_r_proto'
22185 getprotobyname_r_proto='$getprotobyname_r_proto'
22186 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22187 getprotoent_r_proto='$getprotoent_r_proto'
22188 getpwent_r_proto='$getpwent_r_proto'
22189 getpwnam_r_proto='$getpwnam_r_proto'
22190 getpwuid_r_proto='$getpwuid_r_proto'
22191 getservbyname_r_proto='$getservbyname_r_proto'
22192 getservbyport_r_proto='$getservbyport_r_proto'
22193 getservent_r_proto='$getservent_r_proto'
22194 getspnam_r_proto='$getspnam_r_proto'
22195 gidformat='$gidformat'
22201 gmtime_r_proto='$gmtime_r_proto'
22202 gnulibc_version='$gnulibc_version'
22204 groupcat='$groupcat'
22205 groupstype='$groupstype'
22208 h_sysfile='$h_sysfile'
22211 html1dir='$html1dir'
22212 html1direxp='$html1direxp'
22213 html3dir='$html3dir'
22214 html3direxp='$html3direxp'
22223 i_arpainet='$i_arpainet'
22224 i_assert='$i_assert'
22225 i_bsdioctl='$i_bsdioctl'
22229 i_dirent='$i_dirent'
22235 i_fp_class='$i_fp_class'
22238 i_ieeefp='$i_ieeefp'
22239 i_inttypes='$i_inttypes'
22240 i_langinfo='$i_langinfo'
22241 i_libutil='$i_libutil'
22242 i_limits='$i_limits'
22243 i_locale='$i_locale'
22244 i_machcthr='$i_machcthr'
22245 i_malloc='$i_malloc'
22247 i_memory='$i_memory'
22248 i_mntent='$i_mntent'
22251 i_neterrno='$i_neterrno'
22252 i_netinettcp='$i_netinettcp'
22256 i_pthread='$i_pthread'
22258 i_rpcsvcdbm='$i_rpcsvcdbm'
22261 i_shadow='$i_shadow'
22263 i_stdarg='$i_stdarg'
22264 i_stddef='$i_stddef'
22265 i_stdlib='$i_stdlib'
22266 i_string='$i_string'
22267 i_sunmath='$i_sunmath'
22268 i_sysaccess='$i_sysaccess'
22269 i_sysdir='$i_sysdir'
22270 i_sysfile='$i_sysfile'
22271 i_sysfilio='$i_sysfilio'
22273 i_sysioctl='$i_sysioctl'
22274 i_syslog='$i_syslog'
22275 i_sysmman='$i_sysmman'
22276 i_sysmode='$i_sysmode'
22277 i_sysmount='$i_sysmount'
22278 i_sysndir='$i_sysndir'
22279 i_sysparam='$i_sysparam'
22280 i_sysresrc='$i_sysresrc'
22281 i_syssecrt='$i_syssecrt'
22282 i_sysselct='$i_sysselct'
22283 i_syssockio='$i_syssockio'
22284 i_sysstat='$i_sysstat'
22285 i_sysstatfs='$i_sysstatfs'
22286 i_sysstatvfs='$i_sysstatvfs'
22287 i_systime='$i_systime'
22288 i_systimek='$i_systimek'
22289 i_systimes='$i_systimes'
22290 i_systypes='$i_systypes'
22291 i_sysuio='$i_sysuio'
22293 i_sysutsname='$i_sysutsname'
22294 i_sysvfs='$i_sysvfs'
22295 i_syswait='$i_syswait'
22296 i_termio='$i_termio'
22297 i_termios='$i_termios'
22299 i_unistd='$i_unistd'
22302 i_values='$i_values'
22303 i_varargs='$i_varargs'
22304 i_varhdr='$i_varhdr'
22306 ignore_versioned_solibs='$ignore_versioned_solibs'
22307 inc_version_list='$inc_version_list'
22308 inc_version_list_init='$inc_version_list_init'
22311 initialinstalllocation='$initialinstalllocation'
22312 installarchlib='$installarchlib'
22313 installbin='$installbin'
22314 installhtml1dir='$installhtml1dir'
22315 installhtml3dir='$installhtml3dir'
22316 installman1dir='$installman1dir'
22317 installman3dir='$installman3dir'
22318 installprefix='$installprefix'
22319 installprefixexp='$installprefixexp'
22320 installprivlib='$installprivlib'
22321 installscript='$installscript'
22322 installsitearch='$installsitearch'
22323 installsitebin='$installsitebin'
22324 installsitehtml1dir='$installsitehtml1dir'
22325 installsitehtml3dir='$installsitehtml3dir'
22326 installsitelib='$installsitelib'
22327 installsiteman1dir='$installsiteman1dir'
22328 installsiteman3dir='$installsiteman3dir'
22329 installsitescript='$installsitescript'
22330 installstyle='$installstyle'
22331 installusrbinperl='$installusrbinperl'
22332 installvendorarch='$installvendorarch'
22333 installvendorbin='$installvendorbin'
22334 installvendorhtml1dir='$installvendorhtml1dir'
22335 installvendorhtml3dir='$installvendorhtml3dir'
22336 installvendorlib='$installvendorlib'
22337 installvendorman1dir='$installvendorman1dir'
22338 installvendorman3dir='$installvendorman3dir'
22339 installvendorscript='$installvendorscript'
22341 issymlink='$issymlink'
22342 ivdformat='$ivdformat'
22345 known_extensions='$known_extensions'
22348 lddlflags='$lddlflags'
22350 ldflags_uselargefiles='$ldflags_uselargefiles'
22351 ldlibpthname='$ldlibpthname'
22358 libsdirs='$libsdirs'
22359 libsfiles='$libsfiles'
22360 libsfound='$libsfound'
22361 libspath='$libspath'
22362 libswanted='$libswanted'
22363 libswanted_uselargefiles='$libswanted_uselargefiles'
22369 localtime_r_proto='$localtime_r_proto'
22370 locincpth='$locincpth'
22371 loclibpth='$loclibpth'
22372 longdblsize='$longdblsize'
22373 longlongsize='$longlongsize'
22374 longsize='$longsize'
22378 lseeksize='$lseeksize'
22379 lseektype='$lseektype'
22382 madlyobj='$madlyobj'
22383 madlysrc='$madlysrc'
22387 make_set_make='$make_set_make'
22388 mallocobj='$mallocobj'
22389 mallocsrc='$mallocsrc'
22390 malloctype='$malloctype'
22392 man1direxp='$man1direxp'
22395 man3direxp='$man3direxp'
22397 mips_type='$mips_type'
22398 mistrustnm='$mistrustnm'
22400 mmaptype='$mmaptype'
22401 modetype='$modetype'
22403 multiarch='$multiarch'
22405 myarchname='$myarchname'
22406 mydomain='$mydomain'
22407 myhostname='$myhostname'
22410 need_va_copy='$need_va_copy'
22411 netdb_hlen_type='$netdb_hlen_type'
22412 netdb_host_type='$netdb_host_type'
22413 netdb_name_type='$netdb_name_type'
22414 netdb_net_type='$netdb_net_type'
22417 nm_so_opt='$nm_so_opt'
22418 nonxs_ext='$nonxs_ext'
22420 nvEUformat='$nvEUformat'
22421 nvFUformat='$nvFUformat'
22422 nvGUformat='$nvGUformat'
22423 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22424 nveformat='$nveformat'
22425 nvfformat='$nvfformat'
22426 nvgformat='$nvgformat'
22429 o_nonblock='$o_nonblock'
22431 old_pthread_create_joinable='$old_pthread_create_joinable'
22432 optimize='$optimize'
22433 orderlib='$orderlib'
22436 otherlibdirs='$otherlibdirs'
22440 patchlevel='$patchlevel'
22441 path_sep='$path_sep'
22444 perl_patchlevel='$perl_patchlevel'
22445 perladmin='$perladmin'
22446 perllibs='$perllibs'
22447 perlpath='$perlpath'
22449 phostname='$phostname'
22455 prefixexp='$prefixexp'
22457 privlibexp='$privlibexp'
22458 procselfexe='$procselfexe'
22459 prototype='$prototype'
22461 quadkind='$quadkind'
22462 quadtype='$quadtype'
22463 randbits='$randbits'
22464 randfunc='$randfunc'
22465 random_r_proto='$random_r_proto'
22466 randseedtype='$randseedtype'
22468 rd_nodata='$rd_nodata'
22469 readdir64_r_proto='$readdir64_r_proto'
22470 readdir_r_proto='$readdir_r_proto'
22471 revision='$revision'
22477 sPRIEUldbl='$sPRIEUldbl'
22478 sPRIFUldbl='$sPRIFUldbl'
22479 sPRIGUldbl='$sPRIGUldbl'
22480 sPRIXU64='$sPRIXU64'
22482 sPRIeldbl='$sPRIeldbl'
22483 sPRIfldbl='$sPRIfldbl'
22484 sPRIgldbl='$sPRIgldbl'
22489 sSCNfldbl='$sSCNfldbl'
22490 sched_yield='$sched_yield'
22491 scriptdir='$scriptdir'
22492 scriptdirexp='$scriptdirexp'
22494 seedfunc='$seedfunc'
22495 selectminbits='$selectminbits'
22496 selecttype='$selecttype'
22497 sendmail='$sendmail'
22498 setgrent_r_proto='$setgrent_r_proto'
22499 sethostent_r_proto='$sethostent_r_proto'
22500 setlocale_r_proto='$setlocale_r_proto'
22501 setnetent_r_proto='$setnetent_r_proto'
22502 setprotoent_r_proto='$setprotoent_r_proto'
22503 setpwent_r_proto='$setpwent_r_proto'
22504 setservent_r_proto='$setservent_r_proto'
22507 sharpbang='$sharpbang'
22508 shmattype='$shmattype'
22509 shortsize='$shortsize'
22512 sig_count='$sig_count'
22513 sig_name='$sig_name'
22514 sig_name_init='$sig_name_init'
22516 sig_num_init='$sig_num_init'
22517 sig_size='$sig_size'
22518 signal_t='$signal_t'
22519 sitearch='$sitearch'
22520 sitearchexp='$sitearchexp'
22522 sitebinexp='$sitebinexp'
22523 sitehtml1dir='$sitehtml1dir'
22524 sitehtml1direxp='$sitehtml1direxp'
22525 sitehtml3dir='$sitehtml3dir'
22526 sitehtml3direxp='$sitehtml3direxp'
22528 sitelib_stem='$sitelib_stem'
22529 sitelibexp='$sitelibexp'
22530 siteman1dir='$siteman1dir'
22531 siteman1direxp='$siteman1direxp'
22532 siteman3dir='$siteman3dir'
22533 siteman3direxp='$siteman3direxp'
22534 siteprefix='$siteprefix'
22535 siteprefixexp='$siteprefixexp'
22536 sitescript='$sitescript'
22537 sitescriptexp='$sitescriptexp'
22538 sizesize='$sizesize'
22539 sizetype='$sizetype'
22543 sockethdr='$sockethdr'
22544 socketlib='$socketlib'
22545 socksizetype='$socksizetype'
22547 spackage='$spackage'
22548 spitshell='$spitshell'
22549 srand48_r_proto='$srand48_r_proto'
22550 srandom_r_proto='$srandom_r_proto'
22552 ssizetype='$ssizetype'
22553 startperl='$startperl'
22555 static_ext='$static_ext'
22557 stdio_base='$stdio_base'
22558 stdio_bufsiz='$stdio_bufsiz'
22559 stdio_cnt='$stdio_cnt'
22560 stdio_filbuf='$stdio_filbuf'
22561 stdio_ptr='$stdio_ptr'
22562 stdio_stream_array='$stdio_stream_array'
22563 strerror_r_proto='$strerror_r_proto'
22566 subversion='$subversion'
22570 targetarch='$targetarch'
22574 timeincl='$timeincl'
22575 timetype='$timetype'
22576 tmpnam_r_proto='$tmpnam_r_proto'
22582 ttyname_r_proto='$ttyname_r_proto'
22591 uidformat='$uidformat'
22597 uquadtype='$uquadtype'
22598 use5005threads='$use5005threads'
22599 use64bitall='$use64bitall'
22600 use64bitint='$use64bitint'
22601 usecrosscompile='$usecrosscompile'
22603 usedtrace='$usedtrace'
22604 usefaststdio='$usefaststdio'
22605 useithreads='$useithreads'
22606 uselargefiles='$uselargefiles'
22607 uselongdouble='$uselongdouble'
22608 usemallocwrap='$usemallocwrap'
22609 usemorebits='$usemorebits'
22610 usemultiplicity='$usemultiplicity'
22611 usemymalloc='$usemymalloc'
22613 useopcode='$useopcode'
22614 useperlio='$useperlio'
22615 useposix='$useposix'
22616 usereentrant='$usereentrant'
22617 userelocatableinc='$userelocatableinc'
22619 useshrplib='$useshrplib'
22620 usesitecustomize='$usesitecustomize'
22621 usesocks='$usesocks'
22622 usethreads='$usethreads'
22623 usevendorprefix='$usevendorprefix'
22624 usevfork='$usevfork'
22627 uvXUformat='$uvXUformat'
22628 uvoformat='$uvoformat'
22631 uvuformat='$uvuformat'
22632 uvxformat='$uvxformat'
22633 vendorarch='$vendorarch'
22634 vendorarchexp='$vendorarchexp'
22635 vendorbin='$vendorbin'
22636 vendorbinexp='$vendorbinexp'
22637 vendorhtml1dir='$vendorhtml1dir'
22638 vendorhtml1direxp='$vendorhtml1direxp'
22639 vendorhtml3dir='$vendorhtml3dir'
22640 vendorhtml3direxp='$vendorhtml3direxp'
22641 vendorlib='$vendorlib'
22642 vendorlib_stem='$vendorlib_stem'
22643 vendorlibexp='$vendorlibexp'
22644 vendorman1dir='$vendorman1dir'
22645 vendorman1direxp='$vendorman1direxp'
22646 vendorman3dir='$vendorman3dir'
22647 vendorman3direxp='$vendorman3direxp'
22648 vendorprefix='$vendorprefix'
22649 vendorprefixexp='$vendorprefixexp'
22650 vendorscript='$vendorscript'
22651 vendorscriptexp='$vendorscriptexp'
22653 version_patchlevel_string='$version_patchlevel_string'
22654 versiononly='$versiononly'
22656 voidflags='$voidflags'
22659 yaccflags='$yaccflags'
22664 : Add in command line options if available
22665 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22667 : add special variables
22668 $test -f $src/patchlevel.h && \
22669 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22670 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22671 echo "PERL_CONFIG_SH=true" >>config.sh
22673 : propagate old symbols
22674 if $test -f UU/config.sh; then
22675 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22676 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
22677 config.sh config.sh UU/oldconfig.sh |\
22678 $sort | $uniq -u >UU/oldsyms
22679 set X `cat UU/oldsyms`
22685 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22687 echo ": Variables propagated from previous config.sh file." >>config.sh
22688 for sym in `cat UU/oldsyms`; do
22689 echo " Propagating $hint variable "'$'"$sym..."
22690 eval 'tmp="$'"${sym}"'"'
22692 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22698 : Finish up by extracting the .SH files
22702 echo "Extraction done."
22712 If you'd like to make any changes to the config.sh file before I begin
22713 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22716 rp="Press return or use a shell escape to edit config.sh:"
22721 *) : in case they cannot read
22722 sh 1>&4 -c "$ans";;
22727 : if this fails, just run all the .SH files by hand
22736 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22743 Now you need to generate make dependencies by running "$make depend".
22744 You might prefer to run it in background: "$make depend > makedepend.out &"
22745 It can take a while, so you might not want to run it right now.
22750 rp="Run $make depend now?"
22754 $make depend && echo "Now you must run '$make'."
22757 echo "You must run '$make depend' then '$make'."
22760 elif test -f [Mm]akefile; then
22762 echo "Now you must run a $make."
22764 echo "Configure done."
22767 if $test -f Policy.sh; then
22770 If you compile $package on a different machine or from a different object
22771 directory, copy the Policy.sh file from this object directory to the
22772 new one before you run Configure -- this will help you with most of
22773 the policy defaults.
22777 if $test -f config.msg; then
22778 echo "Hmm. I also noted the following information while running:"
22780 $cat config.msg >&4
22783 $rm -f kit*isdone ark*isdone