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 Fri Feb 15 17:37:37 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_overflows_integers_at=''
1061 nv_preserves_uv_bits=''
1133 installsitehtml1dir=''
1136 installsitehtml3dir=''
1143 installsiteman1dir=''
1146 installsiteman3dir=''
1151 installsitescript=''
1166 d_stdio_stream_array=''
1167 stdio_stream_array=''
1180 ccflags_uselargefiles=''
1181 ldflags_uselargefiles=''
1182 libswanted_uselargefiles=''
1202 installvendorarch=''
1209 installvendorhtml1dir=''
1211 vendorhtml1direxp=''
1212 installvendorhtml3dir=''
1214 vendorhtml3direxp=''
1220 installvendorman1dir=''
1223 installvendorman3dir=''
1230 installvendorscript=''
1243 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1246 : We must find out about Eunice early
1248 if test -f /etc/unixtovms; then
1249 eunicefix=/etc/unixtovms
1251 if test -f /etc/unixtovms.exe; then
1252 eunicefix=/etc/unixtovms.exe
1255 : Set executable suffix now -- needed before hints available
1256 if test -f "/libs/version.library"; then
1259 elif test -f "/system/gnu_library/bin/ar.pm"; then
1262 elif test -n "$DJGPP"; then
1265 elif test -d c:/. -o -n "$is_os2" ; then
1271 : Trailing extension. Override this in a hint file, if needed.
1272 : Extra object files, if any, needed on this platform.
1277 : change the next line if compiling for Xenix/286 on Xenix/386
1278 xlibpth='/usr/lib/386 /lib/386'
1279 : Possible local library directories to search.
1280 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1281 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1283 : general looking path for locating libraries
1284 glibpth="/lib /usr/lib $xlibpth"
1285 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1286 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1287 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1288 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1290 : Private path used by Configure to find libraries. Its value
1291 : is prepended to libpth. This variable takes care of special
1292 : machines, like the mips. Usually, it should be empty.
1295 : default library list
1297 : some systems want to use only the non-versioned libso:s
1298 ignore_versioned_solibs=''
1299 : set usethreads on the Configure command line to enable threads.
1300 usereentrant='undef'
1301 : full support for void wanted by default
1304 : Possible local include directories to search.
1305 : Set locincpth to "" in a hint file to defeat local include searches.
1306 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1307 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1309 : no include file wanted by default
1312 : Enable -DEBUGGING and -DDEBUGGING from the command line
1319 : set useposix=false in your hint file to disable the POSIX extension.
1321 : set useopcode=false in your hint file to disable the Opcode extension.
1324 ccflags_uselargefiles=''
1325 ldflags_uselargefiles=''
1326 libswanted_uselargefiles=''
1327 : set usemultiplicity on the Configure command line to enable multiplicity.
1328 : set usesocks on the Configure command line to enable socks.
1329 : List of libraries we want.
1330 : If anyone needs extra -lxxx, put those in a hint file.
1331 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1332 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1333 : We probably want to search /usr/shlib before most other libraries.
1334 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1335 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1336 glibpth="/usr/shlib $glibpth"
1337 : Do not use vfork unless overridden by a hint file.
1340 : Find the basic shell for Bourne shell scripts
1344 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1347 if test -f "$xxx"; then
1350 : Build up a list and do a single loop so we can 'break' out.
1351 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1352 for xxx in sh bash ksh pdksh ash; do
1354 try="$try ${p}/${xxx}"
1358 if test -f "$xxx"; then
1361 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1364 elif test -f "$xxx.exe"; then
1375 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1377 Usually it's in /bin/sh. How did you even get this far?
1378 Please contact me (Perl Maintainers) at perlbug@perl.org and
1379 we'll try to straighten this all out.
1385 : see if sh knows # comments
1386 if `$sh -c '#' >/dev/null 2>&1`; then
1390 test -f $xcat$_exe || xcat=/usr/bin/cat
1391 if test ! -f $xcat$_exe; then
1392 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1393 if test -f $p/cat$_exe; then
1398 if test ! -f $xcat$_exe; then
1399 echo "Can't find cat anywhere!"
1403 echo "#!$xcat" >sharp
1407 if test -s today; then
1410 echo "#! $xcat" > sharp
1414 if test -s today; then
1422 echo "Your $sh doesn't grok # comments--I will strip them later on."
1425 echo "exec grep -v '^[ ]*#'" >spitshell
1427 $eunicefix spitshell
1428 spitshell=`pwd`/spitshell
1430 echo "I presume that if # doesn't work, #! won't work either!"
1435 : figure out how to guarantee sh startup
1437 '') startsh=${sharpbang}${sh} ;;
1449 : echo "Yup, it does."
1451 echo "Hmm... '$startsh' does not guarantee sh startup..."
1452 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1456 : Save command line options in file UU/cmdline.opt for later use in
1457 : generating config.sh.
1458 cat > cmdline.opt <<EOSH
1459 : Configure command line arguments.
1468 cat >>cmdline.opt <<EOSH
1469 config_arg$argn='$arg'
1471 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1474 arg_exp=`cat cmdl.opt`
1475 args_exp="$args_exp$args_sep'$arg_exp'"
1476 argn=`expr $argn + 1`
1481 : produce awk script to parse command line options
1482 cat >options.awk <<'EOF'
1484 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1486 len = length(optstr);
1487 for (i = 1; i <= len; i++) {
1488 c = substr(optstr, i, 1);
1489 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1500 if (substr(str, 1, 1) != "-") {
1501 printf("'%s'\n", str);
1505 for (i = 2; i <= len; i++) {
1506 c = substr(str, i, 1);
1508 printf("-%s\n", substr(str, i));
1514 printf("'%s'\n", substr(str, i + 1));
1527 : process the command line options
1528 set X `for arg in "$@"; do echo "X$arg"; done |
1529 sed -e s/X// | awk -f options.awk`
1534 : set up default values
1544 rm -f optdef.sh posthint.sh
1545 cat >optdef.sh <<EOS
1551 while test $# -gt 0; do
1553 -d) shift; fastread=yes;;
1554 -e) shift; alldone=cont;;
1558 if test -r "$1"; then
1561 echo "$me: cannot read config file $1." >&2
1567 -h) shift; error=true;;
1568 -r) shift; reuseval=true;;
1569 -s) shift; silent=true; realsilent=true;;
1570 -E) shift; alldone=exit;;
1571 -K) shift; knowitall=true;;
1572 -O) shift; override=true;;
1573 -S) shift; silent=true; extractsh=true;;
1578 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1579 echo "$me: ignoring -D $1" >&2
1582 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1583 *) echo "$1='define'" >> optdef.sh;;
1590 *=) echo "$1" >> optdef.sh;;
1592 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1593 echo "$me: ignoring -U $1" >&2
1595 *) echo "$1='undef'" >> optdef.sh;;
1606 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1610 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1611 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1617 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1618 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1619 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1620 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1621 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1622 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1628 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1630 echo "$yyy=''" >> posthint.sh ;;
1635 echo "$yyy='$zzz'" >> posthint.sh ;;
1637 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1639 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1644 echo "$yyy=$zzz" >> posthint.sh ;;
1645 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1649 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1652 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1660 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1661 [-U symbol] [-U symbol=] [-A command:symbol...]
1662 -d : use defaults for all answers.
1663 -e : go on without questioning past the production of config.sh.
1664 -f : specify an alternate default configuration file.
1665 -h : print this help message and exit (with an error status).
1666 -r : reuse C symbols value if possible (skips costly nm extraction).
1667 -s : silent mode, only echoes questions and essential information.
1668 -D : define symbol to have some value:
1669 -D symbol symbol gets the value 'define'
1670 -D symbol=value symbol gets the value 'value'
1671 common used examples (see INSTALL for more info):
1672 -Duse64bitint use 64bit integers
1673 -Duse64bitall use 64bit integers and pointers
1674 -Dusethreads use thread support
1675 -Dinc_version_list=none do not include older perl trees in @INC
1676 -DEBUGGING=none DEBUGGING options
1677 -Dcc=gcc choose your compiler
1678 -Dprefix=/opt/perl5 choose your destination
1679 -E : stop at the end of questions, after having produced config.sh.
1680 -K : do not use unless you know what you are doing.
1681 -O : let -D and -U override definitions from loaded configuration file.
1682 -S : perform variable substitutions on all .SH files (can mix with -f)
1683 -U : undefine symbol:
1684 -U symbol symbol gets the value 'undef'
1685 -U symbol= symbol gets completely empty
1687 -A : manipulate symbol after the platform specific hints have been applied:
1688 -A append:symbol=value append value to symbol
1689 -A symbol=value like append:, but with a separating space
1690 -A define:symbol=value define symbol to have value
1691 -A clear:symbol define symbol to be ''
1692 -A define:symbol define symbol to be 'define'
1693 -A eval:symbol=value define symbol to be eval of value
1694 -A prepend:symbol=value prepend value to symbol
1695 -A undef:symbol define symbol to be 'undef'
1696 -A undef:symbol= define symbol to be ''
1697 e.g.: -A prepend:libswanted='cl pthread '
1698 -A ccflags=-DSOME_MACRO
1699 -V : print version number and exit (with a zero status).
1706 case "$fastread$alldone" in
1709 case "$extractsh" in
1712 if test ! -t 0; then
1713 echo "Say 'sh Configure', not 'sh <Configure'"
1723 true) exec 1>/dev/null;;
1726 : run the defines and the undefines, if any, but leave the file out there...
1729 : create the posthint manipulation script and leave the file out there...
1734 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1735 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1736 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1737 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1738 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1741 : Some greps do not return status, grrr.
1742 echo "grimblepritz" >grimble
1743 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1745 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1751 : the following should work in any shell
1755 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1756 cat >contains <<'EOSS'
1757 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1762 : Find the path to the source tree
1765 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1769 *) src=`cd ../$src && pwd` ;;
1782 if test -f $rsrc/Configure && \
1783 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1785 : found it, so we are ok.
1788 for src in . .. ../.. ../../.. ../../../..; do
1789 if test -f ../$src/Configure && \
1790 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1801 Sorry, I can't seem to locate the source dir for $package. Please start
1802 Configure with an explicit path -- i.e. /some/path/Configure.
1810 echo "Sources for $package found in \"$src\"." >&4
1814 : script used to extract .SH files with variable substitutions
1815 cat >extract <<'EOS'
1817 echo "Doing variable substitutions on .SH files..."
1818 if test -f MANIFEST; then
1819 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1821 echo "(Looking for .SH files under the source directory.)"
1822 set x `(cd "$src"; find . -name "*.SH" -print)`
1826 0) set x `(cd "$src"; echo *.SH)`; shift;;
1828 if test ! -f "$src/$1"; then
1834 while test $name; do
1835 if test ! -d "$name"; then
1836 create="$name $create";
1837 name=`echo $name | sed -e "s|^[^/]*$||"`;
1838 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1843 for file in $create; do
1852 dir=`expr X$file : 'X\(.*\)/'`
1853 file=`expr X$file : 'X.*/\(.*\)'`
1854 (cd "$dir" && . ./$file)
1864 dir=`expr X$file : 'X\(.*\)/'`
1865 file=`expr X$file : 'X.*/\(.*\)'`
1866 (set x $dir; shift; eval $mkdir_p)
1867 sh <"$src/$dir/$file"
1876 if test -f "$src/config_h.SH"; then
1877 if test ! -f config.h; then
1878 : oops, they left it out of MANIFEST, probably, so do it anyway.
1879 . "$src/config_h.SH"
1884 : extract files and exit if asked to do so
1885 case "$extractsh" in
1887 case "$realsilent" in
1891 case "$config_sh" in
1892 '') config_sh='config.sh';;
1895 echo "Fetching answers from $config_sh..."
1898 test "$override" && . ./optdef.sh
1902 echo "Extraction done."
1907 : Eunice requires " " instead of "", can you believe it
1910 echo "Beginning of configuration questions for $package."
1912 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1914 : first determine how to suppress newline on echo command
1916 echo "Checking echo to see how to suppress newlines..."
1917 (echo "hi there\c" ; echo " ") >.echotmp
1918 if $contains c .echotmp >/dev/null 2>&1 ; then
1929 echo $n "The star should be here-->$c"
1933 : Now test for existence of everything in MANIFEST
1935 if test -f "$rsrc/MANIFEST"; then
1936 echo "First let's make sure your kit is complete. Checking..." >&4
1937 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" |\
1938 (split -l 50 2>/dev/null || split -50)
1941 for filelist in x??; do
1942 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1943 >/dev/null 2>>"$tmppwd/missing")
1945 if test -s missing; then
1949 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1951 You have the option of continuing the configuration process, despite the
1952 distinct possibility that your kit is damaged, by typing 'y'es. If you
1953 do, don't blame me if something goes wrong. I advise you to type 'n'o
1954 and contact the author (perlbug@perl.org).
1957 echo $n "Continue? [n] $c" >&4
1961 echo "Continuing..." >&4
1965 echo "ABORTING..." >&4
1970 echo "Looks good..."
1973 echo "There is no MANIFEST file. I hope your kit is complete !"
1977 : Find the appropriate value for a newline for tr
1979 if test -n "$DJGPP"; then
1982 if test X"$trnl" = X; then
1983 case "`echo foo|tr '\n' x 2>/dev/null`" in
1987 if test X"$trnl" = X; then
1988 case "`echo foo|tr '\012' x 2>/dev/null`" in
1989 foox) trnl='\012' ;;
1992 if test X"$trnl" = X; then
1993 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1994 fooxy) trnl='\n\r' ;;
1997 if test X"$trnl" = X; then
2000 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2006 : compute the number of columns on the terminal for proper question formatting
2011 : set up the echo used in my read
2012 myecho="case \"\$xxxm\" in
2013 '') echo $n \"\$rp $c\" >&4;;
2015 '') echo $n \"[\$xxxm] $c\";;
2017 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2019 echo $n \"[\$xxxm] $c\" >&4
2021 echo $n \"\$rp [\$xxxm] $c\" >&4
2027 : now set up to do reads with possible shell escape and default assignment
2033 case "\$fastread" in
2034 yes) case "\$dflt" in
2037 case "\$silent-\$rp" in
2042 *) case "\$silent" in
2043 true) case "\$rp" in
2048 while expr "X\$ans" : "X!" >/dev/null; do
2052 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2060 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2069 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2074 echo "(OK, I'll run with -d after this question.)" >&4
2077 echo "*** Sorry, \$1 not supported yet." >&4
2087 echo "*** Substitution done -- please confirm."
2089 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2094 echo "*** Error -- try again."
2101 case "\$ans\$xxxm\$nostick" in
2113 : create .config dir to save info across Configure sessions
2114 test -d ../.config || mkdir ../.config
2115 cat >../.config/README <<EOF
2116 This directory created by Configure to save information that should
2117 persist across sessions for $package.
2119 You may safely delete it if you wish.
2122 : See if we are using a devel version and want that
2123 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2125 $define|true|[yY]*) ;;
2126 *) case "$xversion" in
2129 *** WHOA THERE!!! ***
2131 This is an UNSTABLE DEVELOPMENT release.
2132 The version of this $package distribution is $xversion, that is, odd,
2133 (as opposed to even) and that signifies a development release.
2134 If you want a maintenance release, you want an even-numbered version.
2136 Do ***NOT*** install this into production use.
2137 Data corruption and crashes are possible.
2139 It is most seriously suggested that you do not continue any further
2140 unless you want to help in developing and debugging Perl.
2142 If you *still* want to build perl, you can answer 'y' now,
2143 or pass -Dusedevel to Configure.
2146 rp='Do you really want to continue?'
2150 [yY]) echo >&4 "Okay, continuing."
2151 usedevel="$define" ;;
2152 *) echo >&4 "Okay, bye."
2162 case "$versiononly" in
2163 '') versiononly="$define" ;;
2165 case "$installusrbinperl" in
2166 '') installusrbinperl="$undef" ;;
2171 : general instructions
2174 user=`(logname) 2>/dev/null`
2176 '') user=`whoami 2>&1`;;
2178 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2181 rp='Would you like to see the instructions?'
2192 This installation shell script will examine your system and ask you questions
2193 to determine how the perl5 package should be installed. If you get
2194 stuck on a question, you may use a ! shell escape to start a subshell or
2195 execute a command. Many of the questions will have default answers in square
2196 brackets; typing carriage return will give you the default.
2198 On some of the questions which ask for file or directory names you are allowed
2199 to use the ~name construct to specify the login directory belonging to "name",
2200 even if you don't have a shell which knows about that. Questions where this is
2201 allowed will be marked "(~name ok)".
2205 dflt='Type carriage return to continue'
2209 The prompter used in this script allows you to use shell variables and
2210 backticks in your answers. You may use $1, $2, etc... to refer to the words
2211 in the default answer, as if the default line was a set of arguments given to a
2212 script shell. This means you may also use $* to repeat the whole default line,
2213 so you do not have to re-type everything to add something to the default.
2215 Everytime there is a substitution, you will have to confirm. If there is an
2216 error (e.g. an unmatched backtick), the default answer will remain unchanged
2217 and you will be prompted again.
2219 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2220 the questions and use the computed defaults (or the previous answers if there
2221 was already a config.sh file). Type 'Configure -h' for a list of options.
2222 You may also start interactively and then answer '& -d' at any prompt to turn
2223 on the non-interactive behaviour for the remainder of the execution.
2229 Much effort has been expended to ensure that this shell script will run on any
2230 Unix system. If despite that it blows up on yours, your best bet is to edit
2231 Configure and run it again. If you can't run Configure for some reason,
2232 you'll have to generate a config.sh file by hand. Whatever problems you
2233 have, let me (perlbug@perl.org) know how I blew it.
2235 This installation script affects things in two ways:
2237 1) it may do direct variable substitutions on some of the files included
2239 2) it builds a config.h file for inclusion in C programs. You may edit
2240 any of these files as the need arises after running this script.
2242 If you make a mistake on a question, there is no easy way to back up to it
2243 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2244 files. Configure will offer to let you do this before it runs the SH files.
2247 dflt='Type carriage return to continue'
2249 case "$firsttime" in
2250 true) echo $user >>../.config/instruct;;
2254 : find out where common programs are
2256 echo "Locating common programs..." >&4
2269 if test -d \$dir/\$thing; then
2275 for thisthing in \$dir/\$thing; do
2276 : just loop through to pick last item
2278 if test -f \$thisthing; then
2281 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2284 elif test -f \$dir/\$thing.exe; then
2285 if test -n "$DJGPP"; then
2286 echo \$dir/\$thing.exe
2287 elif test "$eunicefix" != ":"; then
2288 : on Eunice apparently
2340 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2341 pth="$pth /lib /usr/lib"
2342 for file in $loclist; do
2346 if test -f "$xxx"; then
2349 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2350 xxx=`./loc $file $file $pth`
2353 '') xxx=`./loc $file $file $pth`;;
2354 *) xxx=`./loc $xxx $xxx $pth`;;
2356 eval $file=$xxx$_exe
2360 echo $file is in $xxx.
2363 echo $file is in $xxx.
2366 echo "I don't know where '$file' is, and my life depends on it." >&4
2367 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2373 echo "Don't worry if any of the following aren't found..."
2375 for file in $trylist; do
2379 if test -f "$xxx"; then
2382 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2383 xxx=`./loc $file $file $pth`
2386 '') xxx=`./loc $file $file $pth`;;
2387 *) xxx=`./loc $xxx $xxx $pth`;;
2389 eval $file=$xxx$_exe
2393 echo $file is in $xxx.
2396 echo $file is in $xxx.
2399 echo "I don't see $file out there, $say."
2406 echo "Substituting grep for egrep."
2413 echo "Substituting cp for ln."
2422 echo "I can't find make or gmake, and my life depends on it." >&4
2423 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2431 *) # We can't have osname yet.
2432 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2433 # Assume that gmake, if found, is definitely GNU make
2434 # and prefer it over the system make.
2435 echo "Substituting gmake for make."
2443 echo "Hopefully test is built into your sh."
2446 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2447 echo "Using the test built into your sh."
2455 echo "Hopefully echo is built into your sh."
2460 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2461 $echo $n "hi there$c" >foo1
2462 echo $n "hi there$c" >foo2
2463 if cmp foo1 foo2 >/dev/null 2>&1; then
2464 echo "They are compatible. In fact, they may be identical."
2471 They are not compatible! You are probably running ksh on a non-USG system.
2472 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2473 have echo built in and we may have to run some Bourne shell scripts. That
2474 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2477 $echo $n "The star should be here-->$c"
2484 # This question was auctioned at YAPC::Europe-2007 in Vienna
2485 # I never promised you could answer it. I only auctioned the question.
2487 The following message is sponsored by
2489 Dresden.pm<--The stars should be here.
2491 Dear Perl user, system administrator or package
2492 maintainer, the Perl community sends greetings to
2493 you. Do you (emblematical) greet back [Y/n]? n
2497 : Check what type of C compiler we use
2501 cat <<'EOSC' >>trygcc
2506 int main(int argc, char *argv[]) {
2510 if $cc -o try $ccflags $ldflags try.c; then
2513 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2519 # Skip this test because it gives a false match on output like:
2520 # ./trygcc: line 23: cc: command not found
2521 # case "`$cc -v -c try.c 2>&1`" in
2522 # *gcc*) trygcc=no ;;
2524 if $test X"$trygcc" = Xyes; then
2525 if gcc -o try -c try.c; then
2527 echo "You seem to have a working gcc, though." >&4
2528 # Switching compilers may undo the work of hints files.
2529 # The most common problem is -D_REENTRANT for threads.
2530 # This heuristic catches that case, but gets false positives
2531 # if -Dusethreads was not actually specified. Better to
2532 # bail out here with a useful message than fail
2533 # mysteriously later. Should we perhaps just try to
2534 # re-invoke Configure -Dcc=gcc config_args ?
2535 if $test -f usethreads.cbu; then
2538 *** However, any setting of the C compiler flags (e.g. for thread support)
2539 *** will be lost. It may be necessary for you to restart Configure and
2540 *** add -Dcc=gcc to your Configure command line.
2543 rp="Would you like to go ahead and try gcc anyway?"
2546 rp="Would you like to use it?"
2549 if $test -f myread; then
2552 if $test -f UU/myread; then
2555 echo "Cannot find myread, sorry. Aborting." >&2
2560 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2573 cat <<'EOSC' >>checkcc
2578 int main(int argc, char *argv[]) {
2582 if $cc -o try $ccflags $ldflags try.c; then
2585 if $test X"$despair" = Xyes; then
2586 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2589 You need to find a working C compiler.
2590 Either (purchase and) install the C compiler supplied by your OS vendor,
2591 or for a free C compiler try http://gcc.gnu.org/
2592 I cannot continue any further, aborting.
2601 : determine whether symbolic links are supported
2604 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2605 echo "Symbolic links are supported." >&4
2608 echo "Symbolic links are NOT supported." >&4
2613 : determine whether symbolic links are supported
2617 echo "Checking how to test for symbolic links..." >&4
2619 if $test "X$issymlink" = X; then
2621 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2622 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2624 if test $? = 0; then
2627 echo "Your builtin 'test -h' may be broken." >&4
2630 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2633 if test -f "$p/$test"; then
2642 echo "Trying external '$test -h'." >&4
2643 issymlink="$test -h"
2644 if $test ! -h sym >/dev/null 2>&1; then
2645 echo "External '$test -h' is broken, too." >&4
2653 if $test "X$issymlink" = X; then
2654 if $test -L sym 2>/dev/null; then
2655 issymlink="$test -L"
2656 echo "The builtin '$test -L' worked." >&4
2659 if $test "X$issymlink" != X; then
2660 echo "You can test for symbolic links with '$issymlink'." >&4
2662 echo "I do not know how you can test for symbolic links." >&4
2666 *) echo "No symbolic links, so not testing for their testing..." >&4
2671 : Make symlinks util
2672 case "$mksymlinks" in
2675 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2678 *) case "$lns:$issymlink" in
2679 *"ln"*" -s:"*"test -"?)
2680 echo "Creating the symbolic links..." >&4
2681 echo "(First creating the subdirectories...)" >&4
2683 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2685 test -z "$directory" && break
2689 if test ! -d t/base; then
2690 echo "Failed to create the subdirectories. Aborting." >&4
2693 echo "(Then creating the symlinks...)" >&4
2694 awk '{print $1}' $src/MANIFEST | while true; do
2696 test -z "$filename" && break
2697 if test -f $filename; then
2698 if $issymlink $filename; then
2702 if test -f $filename; then
2703 echo "$filename already exists, not symlinking."
2705 ln -s $src/$filename $filename
2709 if test ! -f t/base/lex.t; then
2710 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2715 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2723 : Check for Cross-Compilation
2724 case "$usecrosscompile" in
2726 $echo "Cross-compiling..."
2729 *-*-gcc) # A cross-compiling gcc, probably.
2730 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2732 # leave out ld, choosing it is more complex
2734 ranlib=$targetarch-ranlib
2735 $echo 'extern int foo;' > try.c
2736 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2738 if $test $# -gt 0; then
2740 incpth="`$echo $incpth|$sed 's/^ //'`"
2741 echo "Guessing incpth '$incpth'." >&4
2743 j="`$echo $i|$sed 's,/include$,/lib,'`"
2744 if $test -d $j; then
2748 libpth="`$echo $libpth|$sed 's/^ //'`"
2749 echo "Guessing libpth '$libpth'." >&4
2754 case "$targetarch" in
2755 '') echo "Targetarch not defined." >&4; croak=y ;;
2756 *) echo "Using targetarch $targetarch." >&4 ;;
2759 '') echo "Incpth not defined." >&4; croak=y ;;
2760 *) echo "Using incpth '$incpth'." >&4 ;;
2763 '') echo "Libpth not defined." >&4; croak=y ;;
2764 *) echo "Using libpth '$libpth'." >&4 ;;
2767 '') for i in $incpth; do
2768 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2770 echo "Guessing usrinc $usrinc." >&4
2775 '') echo "Usrinc not defined." >&4; croak=y ;;
2778 *) echo "Using usrinc $usrinc." >&4 ;;
2780 case "$targethost" in
2781 '') echo "Targethost not defined." >&4; croak=y ;;
2782 *) echo "Using targethost $targethost." >&4
2787 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2790 /*) run=$src/Cross/run
2791 targetmkdir=$src/Cross/mkdir
2793 from=$src/Cross/from
2795 *) pwd=`$test -f ../Configure & cd ..; pwd`
2797 targetmkdir=$pwd/Cross/mkdir
2799 from=$pwd/Cross/from
2802 case "$targetrun" in
2803 '') targetrun=ssh ;;
2808 case "$targetfrom" in
2809 '') targetfrom=scp ;;
2813 from=$from-$targetfrom
2814 case "$targetdir" in
2816 echo "Guessing targetdir $targetdir." >&4
2819 case "$targetuser" in
2821 echo "Guessing targetuser $targetuser." >&4
2824 case "$targetfrom" in
2828 case "$targetrun" in
2840 '') cwd=$targetdir ;;
2844 if $test ! -f \$exe.xok; then
2848 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2851 *) echo "Unknown targetrun '$targetrun'" >&4
2855 case "$targetmkdir" in
2857 cat >$targetmkdir <<EOF
2859 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2861 $chmod a+rx $targetmkdir
2863 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2875 $targetmkdir \`dirname \$f\`
2876 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2879 $targetmkdir $targetdir/\`dirname \$f\`
2880 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2893 $mkdir -p $targetdir/\`dirname \$f\`
2894 $cp \$f $targetdir/\$f || exit 1
2897 $targetmkdir $targetdir/\`dirname \$f\`
2898 $cp \$f $targetdir/\$f || exit 1
2905 *) echo "Unknown targetto '$targetto'" >&4
2909 case "$targetfrom" in
2916 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2921 cp) cat >$from <<EOF
2926 cp $targetdir/\$f . || exit 1
2931 *) echo "Unknown targetfrom '$targetfrom'" >&4
2935 if $test ! -f $run; then
2936 echo "Target 'run' script '$run' not found." >&4
2940 if $test ! -f $to; then
2941 echo "Target 'to' script '$to' not found." >&4
2945 if $test ! -f $from; then
2946 echo "Target 'from' script '$from' not found." >&4
2950 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2954 Using '$run' for remote execution,
2955 and '$from' and '$to'
2956 for remote file transfer.
2962 usecrosscompile='undef'
2967 : see whether [:lower:] and [:upper:] are supported character classes
2969 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2971 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2975 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2976 # (0xd9 and 0xe2), therefore that is a nice testing point.
2977 if test "X$up" = X -o "X$low" = X; then
2978 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2984 if test "X$up" = X -o "X$low" = X; then
2985 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2991 if test "X$up" = X -o "X$low" = X; then
2992 case "`echo RS | od -x 2>/dev/null`" in
2994 echo "Hey, this might be EBCDIC." >&4
2995 if test "X$up" = X -o "X$low" = X; then
2996 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2997 rs) up='[A-IJ-RS-Z]'
3002 if test "X$up" = X -o "X$low" = X; then
3003 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3013 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3015 echo "Using $up and $low to convert case." >&4
3018 echo "I don't know how to translate letters from upper to lower case." >&4
3019 echo "Your tr is not acting any way I know of." >&4
3023 : set up the translation script tr, must be called with ./tr of course
3027 '[A-Z][a-z]') exec $tr '$up' '$low';;
3028 '[a-z][A-Z]') exec $tr '$low' '$up';;
3035 : Try to determine whether config.sh was made on this system
3036 case "$config_sh" in
3038 myuname=`$uname -a 2>/dev/null`
3039 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3040 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3041 # because the A-Z/a-z are not consecutive.
3042 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3043 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3044 newmyuname="$myuname"
3046 case "$knowitall" in
3048 if test -f ../config.sh; then
3049 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3050 eval "`grep myuname= ../config.sh`"
3052 if test "X$myuname" = "X$newmyuname"; then
3060 : Get old answers from old config file if Configure was run on the
3061 : same system, otherwise use the hints.
3064 if test -f config.sh; then
3066 rp="I see a config.sh file. Shall I use it to set the defaults?"
3069 n*|N*) echo "OK, I'll ignore it."
3070 mv config.sh config.sh.old
3071 myuname="$newmyuname"
3073 *) echo "Fetching default answers from your old config.sh file..." >&4
3081 : Older versions did not always set $sh. Catch re-use of such
3091 if test ! -f config.sh; then
3094 First time through, eh? I have some defaults handy for some systems
3095 that need some extra help getting the Configure answers right:
3098 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3100 : Half the following guesses are probably wrong... If you have better
3101 : tests or hints, please send them to perlbug@perl.org
3102 : The metaconfig authors would also appreciate a copy...
3103 $test -f /irix && osname=irix
3104 $test -f /xenix && osname=sco_xenix
3105 $test -f /dynix && osname=dynix
3106 $test -f /dnix && osname=dnix
3107 $test -f /lynx.os && osname=lynxos
3108 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3109 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3110 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3111 $test -f /bin/mips && /bin/mips && osname=mips
3112 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3113 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3114 $test -d /usr/apollo/bin && osname=apollo
3115 $test -f /etc/saf/_sactab && osname=svr4
3116 $test -d /usr/include/minix && osname=minix
3117 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3118 if $test -d /MachTen -o -d /MachTen_Folder; then
3120 if $test -x /sbin/version; then
3121 osvers=`/sbin/version | $awk '{print $2}' |
3122 $sed -e 's/[A-Za-z]$//'`
3123 elif $test -x /usr/etc/version; then
3124 osvers=`/usr/etc/version | $awk '{print $2}' |
3125 $sed -e 's/[A-Za-z]$//'`
3131 $test -f /sys/posix.dll &&
3132 $test -f /usr/bin/what &&
3133 set X `/usr/bin/what /sys/posix.dll` &&
3134 $test "$3" = UWIN &&
3138 if $test -f $uname; then
3146 umips) osname=umips ;;
3149 [23]100) osname=mips ;;
3150 next*) osname=next ;;
3152 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3153 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3156 elif $test -f /etc/kconfig; then
3158 if test "$lns" = "$ln -s"; then
3160 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3162 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3169 if test -n "$DJGPP"; then
3178 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3180 # oslevel can fail with:
3181 # oslevel: Unable to acquire lock.
3182 *not\ found) osvers="$4"."$3" ;;
3183 '<3240'|'<>3240') osvers=3.2.0 ;;
3184 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3185 '=3250'|'>3250') osvers=3.2.5 ;;
3189 bsd386) osname=bsd386
3192 cygwin*) osname=cygwin
3195 *dc.osx) osname=dcosx
3201 domainos) osname=apollo
3207 dragonfly) osname=dragonfly
3210 dynixptx*) osname=dynixptx
3211 osvers=`echo "$4"|sed 's/^v//'`
3213 freebsd) osname=freebsd
3215 genix) osname=genix ;;
3219 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3235 netbsd*) osname=netbsd
3238 news-os) osvers="$3"
3240 4*) osname=newsos4 ;;
3244 next*) osname=next ;;
3245 nonstop-ux) osname=nonstopux ;;
3246 openbsd) osname=openbsd
3252 POSIX-BC | posix-bc ) osname=posix-bc
3255 powerux | power_ux | powermax_os | powermaxos | \
3256 powerunix | power_unix) osname=powerux
3262 solaris) osname=solaris
3264 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3271 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3275 titanos) osname=titanos
3284 ultrix) osname=ultrix
3287 osf1|mls+) case "$5" in
3290 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3293 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3296 hp*) osname=hp_osf1 ;;
3297 mips) osname=mips_osf1 ;;
3300 # UnixWare 7.1.2 is known as Open UNIX 8
3301 openunix|unixware) osname=svr5
3309 $2) case "$osname" in
3313 : svr4.x or possibly later
3323 if test -f /stand/boot ; then
3324 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3325 if test -n "$INITPROG" -a -f "$INITPROG"; then
3326 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3327 if test -n "$isesix"; then
3335 *) if test -f /etc/systemid; then
3337 set `echo $3 | $sed 's/\./ /g'` $4
3338 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3340 elif $test -f $src/hints/sco_$1_$2.sh; then
3342 elif $test -f $src/hints/sco_$1.sh; then
3347 '') : Still unknown. Probably a generic Sys V.
3356 *) case "$osname" in
3357 '') : Still unknown. Probably a generic BSD.
3365 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3366 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3367 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3370 $rm -f UU/kernel.what
3371 elif test -d c:/. -o -n "$is_os2" ; then
3378 case "$targetarch" in
3381 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3386 : Now look for a hint file osname_osvers, unless one has been
3387 : specified already.
3390 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3391 : Also try without trailing minor version numbers.
3392 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3393 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3394 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3395 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3398 *) case "$osvers" in
3401 *) if $test -f $src/hints/$file.sh ; then
3403 elif $test -f $src/hints/$xfile.sh ; then
3405 elif $test -f $src/hints/$xxfile.sh ; then
3407 elif $test -f $src/hints/$xxxfile.sh ; then
3409 elif $test -f $src/hints/$xxxxfile.sh ; then
3411 elif $test -f "$src/hints/${osname}.sh" ; then
3420 if $test -f Policy.sh ; then
3423 none) dflt="Policy" ;;
3424 *) dflt="Policy $dflt" ;;
3429 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3433 if $test -f Policy.sh ; then
3436 There's also a Policy hint file available, which should make the
3437 site-specific (policy) questions easier to answer.
3444 You may give one or more space-separated answers, or "none" if appropriate.
3445 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3446 previous run of Configure, you may specify it as well as or instead of
3447 OS-specific hints. If hints are provided for your OS, you should use them:
3448 although Perl can probably be built without hints on many platforms, using
3449 hints often improve performance and may enable features that Configure can't
3450 set up on its own. If there are no hints that match your OS, specify "none";
3451 DO NOT give a wrong version or a wrong OS.
3455 rp="Which of these apply, if any?"
3458 for file in $tans; do
3459 if $test X$file = XPolicy -a -f Policy.sh; then
3461 $cat Policy.sh >> UU/config.sh
3462 elif $test -f $src/hints/$file.sh; then
3463 . $src/hints/$file.sh
3464 $cat $src/hints/$file.sh >> UU/config.sh
3465 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3468 : Give one chance to correct a possible typo.
3469 echo "$file.sh does not exist"
3471 rp="hint to use instead?"
3473 for file in $ans; do
3474 if $test -f "$src/hints/$file.sh"; then
3475 . $src/hints/$file.sh
3476 $cat $src/hints/$file.sh >> UU/config.sh
3477 elif $test X$ans = X -o X$ans = Xnone ; then
3480 echo "$file.sh does not exist -- ignored."
3487 : Remember our hint file for later.
3488 if $test -f "$src/hints/$file.sh" ; then
3498 echo "Fetching default answers from $config_sh..." >&4
3502 cp $config_sh config.sh 2>/dev/null
3512 test "$override" && . ./optdef.sh
3514 : Restore computed paths
3515 for file in $loclist $trylist; do
3516 eval $file="\$_$file"
3521 Configure uses the operating system name and version to set some defaults.
3522 The default value is probably right if the name rings a bell. Otherwise,
3523 since spelling matters for me, either accept the default or answer "none"
3530 ''|' '|none) dflt=none ;;
3531 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3534 *) dflt="$osname" ;;
3536 rp="Operating system name?"
3540 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3546 ''|' '|none) dflt=none ;;
3547 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3548 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3550 ''|' ') dflt=none ;;
3555 *) dflt="$osvers" ;;
3557 rp="Operating system version?"
3567 : who configured the system
3568 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3571 cf_by=`(logname) 2>/dev/null`
3574 cf_by=`(whoami) 2>/dev/null`
3576 "") cf_by=unknown ;;
3581 : decide how portable to be. Allow command line overrides.
3582 case "$d_portable" in
3584 *) d_portable="$define" ;;
3587 : set up shell script to do ~ expansion
3593 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3596 if $test -f /bin/csh; then
3597 /bin/csh -f -c "glob \$1"
3602 name=\`$expr x\$1 : '..\([^/]*\)'\`
3603 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3604 if $test ! -d "\$dir"; then
3606 echo "\$me: can't locate home directory for: \$name" >&2
3611 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3627 : now set up to get a file name
3631 cat <<'EOSC' >>getfile
3647 : getfile will accept an answer from the comma-separated list
3648 : enclosed in parentheses even if it does not meet other criteria.
3649 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3650 fn=`echo $fn | sed 's/(.*)//'`
3656 loc_file=`expr $fn : '.*:\(.*\)'`
3657 fn=`expr $fn : '\(.*\):.*'`
3665 */*) fullpath=true;;
3674 *e*) exp_file=true;;
3677 *p*) nopath_ok=true;;
3682 *d*) type='Directory';;
3683 *l*) type='Locate';;
3688 Locate) what='File';;
3693 case "$d_portable" in
3701 while test "$type"; do
3706 true) rp="$rp (~name ok)";;
3709 if test -f UU/getfile.ok && \
3710 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3729 value=`UU/filexp $ans`
3732 if test "$ans" != "$value"; then
3733 echo "(That expands to $value on this system.)"
3747 /*) value="$ansexp" ;;
3748 [a-zA-Z]:/*) value="$ansexp" ;;
3753 echo "I shall only accept a full path name, as in /bin/ls." >&4
3754 echo "Use a ! shell escape if you wish to check pathnames." >&4
3757 echo "Please give a full path name, starting with slash." >&4
3760 echo "Note that using ~name is ok provided it expands well." >&4
3773 for fp in $gfpth; do
3774 if test "X$fp" = X.; then
3779 if test -f "$pf"; then
3781 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3783 echo "($value is not a plain file, but that's ok.)"
3786 if test X"$type" = X; then
3793 for fp in $gfpth; do
3794 if test "X$fp" = X.; then
3799 direxp="$fp/$ansexp"
3801 if test -d "$direxp"; then
3809 if test -d "$ansexp"; then
3810 echo "(Looking for $loc_file in directory $value.)"
3811 value="$value/$loc_file"
3812 ansexp="$ansexp/$loc_file"
3814 if test -f "$ansexp"; then
3817 case "$nopath_ok" in
3818 true) case "$value" in
3820 *) echo "Assuming $value will be in people's path."
3836 if test "$fastread" = yes; then
3841 rp="$what $value doesn't exist. Use that name anyway?"
3860 test "X$gfpthkeep" != Xy && gfpth=""
3863 : determine root of directory hierarchy where package will be installed.
3866 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3869 dflt=`echo "$prefix" | sed 's/.$//'`
3877 By default, $package will be installed in $dflt/bin, manual pages
3878 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3879 installation directories. Typically this is something like /usr/local.
3880 If you wish to have binaries under /usr/bin but other parts of the
3881 installation under /usr/local, that's ok: you will be prompted
3882 separately for each of the installation directories, the prefix being
3883 only used to set the defaults.
3887 rp='Installation prefix to use?'
3895 *) oldprefix="$prefix";;
3902 : allow them to override the AFS root
3905 *) afsroot=$afsroot ;;
3911 $define|true) afs=true ;;
3912 $undef|false) afs=false ;;
3913 *) if $test -d $afsroot; then
3921 echo "AFS may be running... I'll be extra cautious then..." >&4
3923 echo "AFS does not seem to be running..." >&4
3926 : determine installation prefix for where package is to be installed.
3930 Since you are running AFS, I need to distinguish the directory in which
3931 files will reside from the directory in which they are installed (and from
3932 which they are presumably copied to the former directory by occult means).
3935 case "$installprefix" in
3936 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3937 *) dflt="$installprefix";;
3942 In some special cases, particularly when building $package for distribution,
3943 it is convenient to distinguish the directory in which files should be
3944 installed from the directory ($prefix) in which they will
3945 eventually reside. For most users, these two directories are the same.
3948 case "$installprefix" in
3950 *) dflt=$installprefix;;
3954 rp='What installation prefix should I use for installing files?'
3956 installprefix="$ans"
3957 installprefixexp="$ansexp"
3959 : Perform the prefixexp/installprefixexp correction if necessary
3960 cat <<EOS >installprefix
3963 cat <<'EOSC' >>installprefix
3964 : Change installation prefix, if necessary.
3965 if $test X"$prefix" != X"$installprefix"; then
3966 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3968 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3971 chmod +x installprefix
3972 $eunicefix installprefix
3974 : Set variables such as privlib and privlibexp from the output of ./getfile
3975 : performing the prefixexp/installprefixexp correction if necessary.
3976 cat <<EOS >setprefixvar
3979 cat <<'EOSC' >>setprefixvar
3980 eval "${prefixvar}=\"\$ans\""
3981 eval "${prefixvar}exp=\"\$ansexp\""
3984 chmod +x setprefixvar
3985 $eunicefix setprefixvar
3987 : set up the script used to warn in case of inconsistency
3996 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3998 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
3999 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4004 echo "*** WHOA THERE!!! ***" >&4
4005 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4008 rp=" Keep the $hint value?"
4011 y) td=$was; tu=$was;;
4015 : function used to set $1 to $val
4016 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4018 $define$undef) . ./whoa; eval "$var=\$td";;
4019 $undef$define) . ./whoa; eval "$var=\$tu";;
4020 *) eval "$var=$val";;
4023 : Check is we will use socks
4025 $define|true|[yY]*) dflt='y';;
4030 Perl can be built to use the SOCKS proxy protocol library. To do so,
4031 Configure must be run with -Dusesocks. If you use SOCKS you also need
4032 to use the PerlIO abstraction layer, this will be implicitly selected.
4034 If this doesn't make any sense to you, just accept the default '$dflt'.
4036 rp='Build Perl for SOCKS?'
4039 y|Y) val="$define" ;;
4046 $define|true|[yY]*) useperlio="$define";;
4049 : Check if we want perlio
4050 case "$useperlio" in
4051 $define|true|[yY]*|'') dflt='y';;
4056 Previous version of $package used the standard IO mechanisms as
4057 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4058 alternate IO mechanisms via the PerlIO abstraction layer, but the
4059 stdio mechanism is still available if needed. The abstraction layer
4060 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4061 Using PerlIO with sfio may cause problems with some extension modules.
4063 If this doesn't make any sense to you, just accept the default '$dflt'.
4065 rp='Use the PerlIO abstraction layer?'
4072 echo "Ok, doing things the stdio way."
4081 case "$useperlio" in
4082 $define|true|[yY]*) ;;
4085 You are using the SOCKS proxy protocol library which means that you
4086 should also use the PerlIO layer. You may be headed for trouble.
4094 : get the patchlevel
4096 echo "Getting the current patchlevel..." >&4
4097 if $test -r $rsrc/patchlevel.h;then
4098 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4099 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4100 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4101 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4102 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4103 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4104 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4113 $echo "(You do not have patchlevel.h. Eek.)"
4115 if $test -r $rsrc/.patch ; then
4116 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4117 perl_patchlevel=`cat $rsrc/.patch`
4120 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4121 version_patchlevel_string="version $patchlevel subversion $subversion"
4122 case "$perl_patchlevel" in
4124 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4127 $echo "(You have $package $version_patchlevel_string.)"
4131 : XXX Should be a Configure test for double-dots in filenames.
4132 version=`echo $revision $patchlevel $subversion | \
4133 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4134 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4135 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4138 version=`echo $revision $patchlevel $subversion | \
4139 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4140 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4141 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4144 : Special case the 5.005_xx maintenance series, which used 5.005
4145 : without any subversion label as a subdirectory in $sitelib
4146 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4147 api_versionstring='5.005'
4150 : Do we want threads support and if so, what type
4151 case "$usethreads" in
4152 $define|true|[yY]*) dflt='y';;
4153 *) # Catch case where user specified ithreads or 5005threads but
4154 # forgot -Dusethreads (A.D. 4/2002)
4155 case "$useithreads$use5005threads" in
4157 case "$useperlio" in
4158 "$define") dflt='y' ;;
4168 Perl can be built to take advantage of threads on some systems.
4169 To do so, Configure can be run with -Dusethreads.
4171 Note that Perl built with threading support runs slightly slower
4172 and uses more memory than plain Perl. The current implementation
4173 is believed to be stable, but it is fairly new, and so should be
4174 treated with caution.
4176 If this doesn't make any sense to you, just accept the default '$dflt'.
4178 rp='Build a threading Perl?'
4181 y|Y) val="$define" ;;
4187 if $test $patchlevel -lt 9; then
4188 case "$usethreads" in
4192 Since release 5.6, Perl has had two different threading implementations,
4193 the newer interpreter-based version (ithreads) with one interpreter per
4194 thread, and the older 5.005 version (5005threads).
4195 The 5005threads version is effectively unmaintained and will probably be
4196 removed in Perl 5.10, so there should be no need to build a Perl using it
4197 unless needed for backwards compatibility with some existing 5.005threads
4201 : Default to ithreads unless overridden on command line or with
4204 case "$use5005threads" in
4205 $define|true|[yY]*) dflt='n';;
4207 case "$useithreads" in
4208 $undef|false|[nN]*) dflt='n';;
4210 rp='Use the newer interpreter-based ithreads?'
4213 y|Y) val="$define" ;;
4218 : Now set use5005threads to the opposite value.
4219 case "$useithreads" in
4220 $define) val="$undef" ;;
4227 useithreads="$undef"
4228 use5005threads="$undef"
4232 case "$useithreads$use5005threads" in
4236 You cannot have both the ithreads and the 5.005 threads enabled
4237 at the same time. Disabling the 5.005 threads since they are
4238 much less stable than the ithreads.
4241 use5005threads="$undef"
4246 : perl-5.9.x and later
4248 if test X"$usethreads" = "X$define"; then
4249 case "$use5005threads" in
4253 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4260 use5005threads="$undef"
4261 useithreads="$usethreads"
4264 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4267 *** To build with ithreads you must also use the PerlIO layer.
4268 *** Cannot continue, aborting.
4274 case "$d_oldpthreads" in
4275 '') : Configure tests would be welcome here. For now, assume undef.
4277 *) val="$d_oldpthreads" ;;
4283 : Look for a hint-file generated 'call-back-unit'. If the
4284 : user has specified that a threading perl is to be built,
4285 : we may need to set or change some other defaults.
4286 if $test -f usethreads.cbu; then
4287 echo "Your platform has some specific hints regarding threaded builds, using them..."
4290 case "$usethreads" in
4291 "$define"|true|[yY]*)
4293 (Your platform does not have any specific hints for threaded builds.
4294 Assuming POSIX threads, then.)
4300 : Check if multiplicity is required
4303 Perl can be built so that multiple Perl interpreters can coexist
4304 within the same Perl executable.
4307 case "$useithreads" in
4310 This multiple interpreter support is required for interpreter-based threads.
4314 *) case "$usemultiplicity" in
4315 $define|true|[yY]*) dflt='y';;
4319 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4320 rp='Build Perl for multiplicity?'
4323 y|Y) val="$define" ;;
4331 : Check if morebits is requested
4332 case "$usemorebits" in
4333 "$define"|true|[yY]*)
4334 use64bitint="$define"
4335 uselongdouble="$define"
4336 usemorebits="$define"
4338 *) usemorebits="$undef"
4342 : Determine the C compiler to be used
4348 rp="Use which C compiler?"
4352 : See whether they have no cc but they do have gcc
4354 if $test -f cc.cbu; then
4359 : make some quick guesses about what we are up against
4361 $echo $n "Hmm... $c"
4371 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4372 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4374 echo "Looks kind of like an OSF/1 system, but we'll see..."
4376 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4377 xxx=`./loc addbib blurfl $pth`
4378 if $test -f $xxx; then
4379 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4383 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4384 echo "Looks kind of like an extended USG system, but we'll see..."
4386 echo "Looks kind of like a USG system, but we'll see..."
4390 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4391 echo "Looks kind of like a BSD system, but we'll see..."
4395 echo "Looks kind of like a Version 7 system, but we'll see..."
4398 case "$eunicefix" in
4401 There is, however, a strange, musty smell in the air that reminds me of
4402 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4406 : it so happens the Eunice I know will not run shell scripts in Unix format
4410 echo "Congratulations. You aren't running Eunice."
4414 : Detect OS2. The p_ variable is set above in the Head.U unit.
4415 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4416 : semicolon as a patch separator
4421 I have the feeling something is not exactly right, however...don't tell me...
4422 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4423 (Or you may be running DOS with DJGPP.)
4428 if test -f /xenix; then
4429 echo "Actually, this looks more like a XENIX system..."
4434 echo "It's not Xenix..."
4439 if test -f /venix; then
4440 echo "Actually, this looks more like a VENIX system..."
4447 echo "Nor is it Venix..."
4450 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4451 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4454 : Check if we are using GNU gcc and what its version is
4456 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4460 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4462 printf("%s\n", __VERSION__);
4464 printf("%s\n", "1");
4470 if $cc -o try $ccflags $ldflags try.c; then
4471 gccversion=`$run ./try`
4472 case "$gccversion" in
4473 '') echo "You are not using GNU cc." ;;
4474 *) echo "You are using GNU cc $gccversion."
4480 echo "*** WHOA THERE!!! ***" >&4
4481 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4482 case "$knowitall" in
4484 echo " You'd better start hunting for one and let me know about it." >&4
4490 case "$gccversion" in
4491 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4493 case "$gccversion" in
4494 '') gccosandvers='' ;;
4495 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4496 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4498 case "$gccosandvers" in
4499 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4500 $osname$osvers) ;; # looking good
4501 $osname*) cat <<EOM >&4
4503 *** WHOA THERE!!! ***
4505 Your gcc has not been compiled for the exact release of
4506 your operating system ($gccosandvers versus $osname$osvers).
4508 In general it is a good idea to keep gcc synchronized with
4509 the operating system because otherwise serious problems
4510 may ensue when trying to compile software, like Perl.
4512 I'm trying to be optimistic here, though, and will continue.
4513 If later during the configuration and build icky compilation
4514 problems appear (headerfile conflicts being the most common
4515 manifestation), I suggest reinstalling the gcc to match
4516 your operating system release.
4520 *) gccosandvers='' ;; # failed to parse, better be silent
4528 # gcc 3.* complain about adding -Idirectories that they already know about,
4529 # so we will take those off from locincpth.
4530 case "$gccversion" in
4532 echo "main(){}">try.c
4533 for incdir in $locincpth; do
4534 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4535 grep '^c[cp]p*[01]: warning: changing search order '`
4536 if test "X$warn" != X; then
4537 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4543 : What should the include directory be ?
4545 $echo $n "Hmm... $c"
4549 if $test -f /bin/mips && /bin/mips; then
4550 echo "Looks like a MIPS system..."
4551 $cat >usr.c <<'EOCP'
4552 #ifdef SYSTYPE_BSD43
4556 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4557 dflt='/bsd43/usr/include'
4561 mips_type='System V'
4563 $rm -f usr.c usr.out
4564 echo "and you're compiling with the $mips_type compiler and libraries."
4568 echo "Doesn't look like a MIPS system."
4578 case "$xxx_prompt" in
4581 rp='Where are the include files you want to use?'
4589 : see how we invoke the C preprocessor
4591 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4592 cat <<'EOT' >testcpp.c
4598 if test ! -f cppstdin; then
4599 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4600 # AIX cc -E doesn't show the absolute headerfile
4601 # locations but we'll cheat by using the -M flag.
4602 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
4604 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4607 echo "Keeping your $hint cppstdin wrapper."
4610 wrapper=`pwd`/cppstdin
4614 if $test "X$cppstdin" != "X" && \
4615 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4616 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4618 echo "You used to use $cppstdin $cppminus so we'll use that again."
4620 '') echo "But let's see if we can live without a wrapper..." ;;
4622 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4623 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4625 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4628 echo "(However, $cpprun $cpplast does not work, let's see...)"
4636 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4643 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4644 $cc -E <testcpp.c >testcpp.out 2>&1; \
4645 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4646 echo "Yup, it does."
4649 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4650 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4651 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4652 echo "Yup, it does."
4655 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4656 $cc -P <testcpp.c >testcpp.out 2>&1; \
4657 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4658 echo "Yipee, that works!"
4661 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4662 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4663 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4664 echo "At long last!"
4667 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4668 $cpp <testcpp.c >testcpp.out 2>&1; \
4669 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4673 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4674 $cpp - <testcpp.c >testcpp.out 2>&1; \
4675 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4676 echo "Hooray, it works! I was beginning to wonder."
4679 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4680 $wrapper <testcpp.c >testcpp.out 2>&1; \
4681 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4687 rp="No dice. I can't find a C preprocessor. Name one:"
4691 $x_cpp <testcpp.c >testcpp.out 2>&1
4692 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4693 echo "OK, that will do." >&4
4695 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4710 echo "Perhaps can we force $cc -E using a wrapper..."
4711 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4712 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4718 echo "Nope, we'll have to live without it..."
4732 "$wrapper"|'cppstdin') ;;
4733 *) $rm -f $wrapper;;
4735 $rm -f testcpp.c testcpp.out
4737 : Set private lib path
4740 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4745 '') dlist="$loclibpth $plibpth $glibpth";;
4746 *) dlist="$libpth";;
4749 : Now check and see which directories actually exist, avoiding duplicates
4753 if $test -d $xxx; then
4756 *) libpth="$libpth $xxx";;
4762 Some systems have incompatible or broken versions of libraries. Among
4763 the directories listed in the question below, please remove any you
4764 know not to be holding relevant libraries, and add any that are needed.
4765 Say "none" for none.
4776 rp="Directories to use for library searches?"
4783 : compute shared library extension
4786 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4796 On some systems, shared libraries may be available. Answer 'none' if
4797 you want to suppress searching of shared libraries for the remainder
4798 of this configuration.
4801 rp='What is the file extension used for shared libraries?'
4805 : Define several unixisms.
4806 : Hints files or command line option can be used to override them.
4807 : The convoluted testing is in case hints files set either the old
4810 '') case "$exe_ext" in
4812 *) _exe="$exe_ext" ;;
4817 '') case "$lib_ext" in
4824 '') case "$obj_ext" in
4831 '') case "$path_sep" in
4842 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4844 : Which makefile gets called first. This is used by make depend.
4845 case "$firstmakefile" in
4846 '') firstmakefile='makefile';;
4849 : Check for uselongdouble support
4851 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4854 case "$uselongdouble" in
4855 $define|true|[yY]*) dflt='y';;
4860 Perl can be built to take advantage of long doubles which
4861 (if available) may give more accuracy and range for floating point numbers.
4863 If this doesn't make any sense to you, just accept the default '$dflt'.
4865 rp='Try to use long doubles if available?'
4868 y|Y) val="$define" ;;
4874 case "$uselongdouble" in
4875 true|[yY]*) uselongdouble="$define" ;;
4878 : Look for a hint-file generated 'call-back-unit'. If the
4879 : user has specified that long doubles should be used,
4880 : we may need to set or change some other defaults.
4881 if $test -f uselongdouble.cbu; then
4882 echo "Your platform has some specific hints regarding long doubles, using them..."
4883 . ./uselongdouble.cbu
4885 case "$uselongdouble" in
4888 (Your platform does not have any specific hints for long doubles.)
4894 : Looking for optional libraries
4896 echo "Checking for optional libraries..." >&4
4901 case "$libswanted" in
4902 '') libswanted='c_s';;
4905 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4911 for thisdir in $libpth $xlibpth; do
4912 test -d $thisdir && libspath="$libspath $thisdir"
4914 for thislib in $libswanted; do
4915 for thisdir in $libspath; do
4917 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4918 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4919 $test -f "$xxx" && eval $libscheck
4920 $test -f "$xxx" && libstyle=shared
4922 if test ! -f "$xxx"; then
4923 xxx=$thisdir/lib$thislib.$so
4924 $test -f "$xxx" && eval $libscheck
4925 $test -f "$xxx" && libstyle=shared
4927 if test ! -f "$xxx"; then
4928 xxx=$thisdir/lib$thislib$_a
4929 $test -f "$xxx" && eval $libscheck
4930 $test -f "$xxx" && libstyle=static
4932 if test ! -f "$xxx"; then
4933 xxx=$thisdir/$thislib$_a
4934 $test -f "$xxx" && eval $libscheck
4935 $test -f "$xxx" && libstyle=static
4937 if test ! -f "$xxx"; then
4938 xxx=$thisdir/lib${thislib}_s$_a
4939 $test -f "$xxx" && eval $libscheck
4940 $test -f "$xxx" && libstyle=static
4941 $test -f "$xxx" && thislib=${thislib}_s
4943 if test ! -f "$xxx"; then
4944 xxx=$thisdir/Slib$thislib$_a
4945 $test -f "$xxx" && eval $libscheck
4946 $test -f "$xxx" && libstyle=static
4948 if $test -f "$xxx"; then
4950 shared) echo "Found -l$thislib (shared)." ;;
4951 static) echo "Found -l$thislib." ;;
4952 *) echo "Found -l$thislib ($libstyle)." ;;
4956 *) dflt="$dflt -l$thislib"
4957 libsfound="$libsfound $xxx"
4959 libsfiles="$libsfiles $yyy"
4960 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4961 case " $libsdirs " in
4963 *) libsdirs="$libsdirs $yyy" ;;
4970 if $test ! -f "$xxx"; then
4971 echo "No -l$thislib."
4982 ' '|'') dflt='none';;
4987 In order to compile $package on your machine, a number of libraries
4988 are usually needed. Include any other special libraries here as well.
4989 Say "none" for none. The default list is almost always right.
4993 rp="What libraries to use?"
5000 : determine optimization, if desired, or use for debug flag also
5002 ' '|$undef) dflt='none';;
5004 *) dflt="$optimize";;
5008 By default, $package compiles with the -O flag to use the optimizer.
5009 Alternately, you might want to use the symbolic debugger, which uses
5010 the -g flag (on traditional Unix systems). Either flag can be
5011 specified here. To use neither flag, specify the word "none".
5014 rp="What optimizer/debugger flag should be used?"
5018 'none') optimize=" ";;
5021 : Check what DEBUGGING is required from the command line
5022 : -DEBUGGING or -DDEBUGGING or
5023 : -DEBUGGING=both = -g + -DDEBUGGING
5024 : -DEBUGGING=-g or -Doptimize=-g = -g
5025 : -DEBUGGING=none or -UDEBUGGING =
5026 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5029 *) DEBUGGING=$EBUGGING ;;
5032 case "$DEBUGGING" in
5036 *) optimize="$optimize -g" ;;
5040 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5048 case "$DEBUGGING" in
5049 both|$define) dflt='-DDEBUGGING'
5052 : argument order is deliberate, as the flag will start with - which set could
5053 : think is an option
5054 checkccflag='check=$1; flag=$2; callback=$3;
5056 echo "Checking if your compiler accepts $flag" 2>&1;
5057 echo "int main(void) { return 0; }" > gcctest.c;
5058 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5059 echo "Yes, it does." 2>&1;
5060 if $test -s gcctest.out ; then
5061 echo "But your platform does not like it:";
5066 echo "Leaving current flags $ccflags alone." 2>&1
5068 *) dflt="$dflt $flag";
5074 echo "Nope, it does not, but that is ok." 2>&1;
5078 : We will not override a previous value, but we might want to
5079 : augment a hint file
5081 default|recommended)
5082 case "$gccversion" in
5083 1*) dflt="$dflt -fpcc-struct-return" ;;
5085 case "$optimize:$DEBUGGING" in
5086 *-g*:old) dflt="$dflt -DDEBUGGING";;
5088 case "$gccversion" in
5089 2*) if $test -d /etc/conf/kconfig.d &&
5090 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5092 # Interactive Systems (ISC) POSIX mode.
5097 case "$gccversion" in
5100 ?*) set strict-aliasing -fno-strict-aliasing
5104 # For gcc, adding -pipe speeds up compilations for some, but apparently
5105 # some assemblers can't read from stdin. (It also slows down compilations
5106 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5107 case "$gccversion" in
5113 # on x86_64 (at least) we require an extra library (libssp) in the
5114 # link command line. This library is not named, so I infer that it is
5115 # an implementation detail that may change. Hence the safest approach
5116 # is to add the flag to the flags passed to the compiler at link time,
5117 # as that way the compiler can do the right implementation dependant
5119 case "$gccversion" in
5120 ?*) set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"'
5127 case "$mips_type" in
5128 *BSD*|'') inclwanted="$locincpth $usrinc";;
5129 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5131 for thisincl in $inclwanted; do
5132 if $test -d $thisincl; then
5133 if $test x$thisincl != x$usrinc; then
5135 *" -I$thisincl "*);;
5136 *) dflt="$dflt -I$thisincl ";;
5142 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5144 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5152 *) dflt="$dflt -D$2";;
5156 set signal.h LANGUAGE_C; eval $inctest
5160 ccflags="$ccflags -DSOCKS"
5165 default|recommended) dflt="$ccflags $dflt" ;;
5166 *) dflt="$ccflags";;
5175 Your C compiler may want other flags. For this question you should include
5176 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5177 but you should NOT include libraries or ld flags like -lwhatever. If you
5178 want $package to honor its debug switch, you should include -DDEBUGGING here.
5179 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5181 To use no flags, specify the word "none".
5187 rp="Any additional cc flags?"
5194 : the following weeds options from ccflags that are of no interest to cpp
5196 '') cppflags="$ccflags" ;;
5197 *) cppflags="$cppflags $ccflags" ;;
5199 case "$gccversion" in
5200 1*) cppflags="$cppflags -D__GNUC__"
5202 case "$mips_type" in
5204 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5210 echo "Let me guess what the preprocessor flags are..." >&4
5224 *) ftry="$previous $flag";;
5226 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5227 >cpp1.out 2>/dev/null && \
5228 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5229 >cpp2.out 2>/dev/null && \
5230 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5231 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5233 cppflags="$cppflags $ftry"
5243 *-*) echo "They appear to be: $cppflags";;
5245 $rm -f cpp.c cpp?.out
5249 : flags used in final linking phase
5251 '') if ./venix; then
5257 *-posix*) dflt="$dflt -posix" ;;
5260 *) dflt="$ldflags";;
5263 : Try to guess additional flags to pick up local libraries.
5264 for thislibdir in $libpth; do
5265 case " $loclibpth " in
5268 *"-L$thislibdir "*) ;;
5269 *) dflt="$dflt -L$thislibdir" ;;
5281 Your C linker may need flags. For this question you should
5282 include -L/whatever and any other flags used by the C linker, but you
5283 should NOT include libraries like -lwhatever.
5285 Make sure you include the appropriate -L/path flags if your C linker
5286 does not normally search all of the directories you specified above,
5289 To use no flags, specify the word "none".
5293 rp="Any additional ld flags (NOT including libraries)?"
5299 rmlist="$rmlist pdp11"
5303 echo "Checking your choice of C compiler and flags for coherency..." >&4
5304 $cat > try.c <<'EOF'
5306 int main() { printf("Ok\n"); return(0); }
5308 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5310 $cat >try.msg <<'EOM'
5311 I've tried to compile and run the following simple program:
5314 $cat try.c >> try.msg
5316 $cat >> try.msg <<EOM
5323 and I got the following output:
5327 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5328 if $sh -c "$run ./try " >>try.msg 2>&1; then
5332 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5335 cat >> try.msg <<'EOQS'
5336 If $libs contains -lsfio, and sfio is mis-configured, then it
5337 sometimes (apparently) runs and exits with a 0 status, but with no
5338 output! It may have to do with sfio's use of _exit vs. exit.
5341 rp="You have a big problem. Shall I abort Configure"
5348 echo "The program compiled OK, but exited with status $?." >>try.msg
5349 rp="You have a problem. Shall I abort Configure"
5353 echo "I can't compile the test program." >>try.msg
5354 rp="You have a BIG problem. Shall I abort Configure"
5360 case "$knowitall" in
5362 echo "(The supplied flags or libraries might be incorrect.)"
5370 *) echo "Ok. Stopping Configure." >&4
5375 n) echo "OK, that should do.";;
5377 $rm_try gcctest gcctest.out
5379 : define a shorthand compile call
5383 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5384 : define a shorthand compile call for compilations that should be ok.
5388 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5390 : determine filename position in cpp output
5392 echo "Computing filename position in cpp output for #include directives..." >&4
5394 vos) testaccess=-e ;;
5397 echo '#include <stdio.h>' > foo.c
5400 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5401 $grep '^[ ]*#.*stdio\.h' | \
5402 while read cline; do
5405 while $test \$# -gt 0; do
5406 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5411 pos=\`expr \$pos + 1\`
5423 *) pos="${fieldn}th";;
5425 echo "Your cpp writes the filename in the $pos field of the line."
5428 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5429 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5432 : locate header file
5437 for usrincdir in $usrinc
5439 if test -f \$usrincdir/\$wanted; then
5440 echo "\$usrincdir/\$wanted"
5444 awkprg='{ print \$$fieldn }'
5445 echo "#include <\$wanted>" > foo\$\$.c
5446 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5447 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5448 while read cline; do
5449 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5451 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5452 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5457 # status = 0: grep returned 0 lines, case statement not executed
5458 # status = 1: headerfile found
5459 # status = 2: while loop executed, no headerfile found
5463 if test \$status -eq 1; then
5470 : define an alternate in-header-list? function
5471 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5472 cont=true; xxf="echo \"<\$1> found.\" >&4";
5473 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5474 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5476 case $# in 4) instead=instead;; *) instead="at last";; esac;
5477 while $test "$cont"; do
5479 var=$2; eval "was=\$$2";
5480 if $test "$xxx" && $test -r "$xxx";
5482 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5485 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5486 set $yyy; shift; shift; yyy=$@;
5487 case $# in 0) cont="";;
5488 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5489 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5490 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5491 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5495 do set $yyy; var=$2; eval "was=\$$2";
5496 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5497 set $yyy; shift; shift; yyy=$@;
5500 : see if stdlib is available
5501 set stdlib.h i_stdlib
5504 : check for lengths of integral types
5508 echo "Checking to see how big your integers are..." >&4
5517 printf("intsize=%d;\n", (int)sizeof(int));
5518 printf("longsize=%d;\n", (int)sizeof(long));
5519 printf("shortsize=%d;\n", (int)sizeof(short));
5524 if eval $compile_ok && $run ./try > /dev/null; then
5526 echo "Your integers are $intsize bytes long."
5527 echo "Your long integers are $longsize bytes long."
5528 echo "Your short integers are $shortsize bytes long."
5532 Help! I can't compile and run the intsize test program: please enlighten me!
5533 (This is probably a misconfiguration in your system or libraries, and
5534 you really ought to fix it. Still, I'll try anyway.)
5538 rp="What is the size of an integer (in bytes)?"
5542 rp="What is the size of a long integer (in bytes)?"
5546 rp="What is the size of a short integer (in bytes)?"
5554 : check for long long
5556 echo "Checking to see if you have long long..." >&4
5557 echo 'int main() { long long x = 7; return 0; }' > try.c
5559 if eval $compile; then
5561 echo "You have long long."
5564 echo "You do not have long long."
5570 : check for length of long long
5571 case "${d_longlong}${longlongsize}" in
5574 echo "Checking to see how big your long longs are..." >&4
5575 $cat >try.c <<'EOCP'
5579 printf("%d\n", (int)sizeof(long long));
5584 if eval $compile_ok; then
5585 longlongsize=`$run ./try`
5586 echo "Your long longs are $longlongsize bytes long."
5590 echo "(I can't seem to compile the test program. Guessing...)"
5591 rp="What is the size of a long long (in bytes)?"
5595 if $test "X$longsize" = "X$longlongsize"; then
5596 echo "(That isn't any different from an ordinary long.)"
5602 : see if inttypes.h is available
5603 : we want a real compile instead of Inhdr because some systems
5604 : have an inttypes.h which includes non-existent headers
5607 #include <inttypes.h>
5609 static int32_t foo32 = 0x12345678;
5613 if eval $compile; then
5614 echo "<inttypes.h> found." >&4
5617 echo "<inttypes.h> NOT found." >&4
5626 echo "Checking to see if you have int64_t..." >&4
5628 #include <sys/types.h>
5629 #$i_inttypes I_INTTYPES
5631 #include <inttypes.h>
5633 int main() { int64_t x = 7; }
5636 if eval $compile; then
5638 echo "You have int64_t."
5641 echo "You do not have int64_t."
5647 : Check if 64bit ints have a quad type
5649 echo "Checking which 64-bit integer type we could use..." >&4
5655 val='"unsigned int"'
5660 *) case "$longsize" in
5664 val='"unsigned long"'
5669 *) case "$d_longlong:$longlongsize" in
5674 val='"unsigned long long"'
5679 *) case "$d_int64_t" in
5698 '') echo "Alas, no 64-bit integer types in sight." >&4
5701 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5706 : Do we want 64bit support
5707 case "$uselonglong" in
5708 "$define"|true|[yY]*)
5711 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5713 use64bitint="$define"
5716 case "$use64bits" in
5717 "$define"|true|[yY]*)
5720 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5722 use64bitint="$define"
5725 case "$use64bitints" in
5726 "$define"|true|[yY]*)
5729 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5731 use64bitint="$define"
5734 case "$use64bitsint" in
5735 "$define"|true|[yY]*)
5738 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5740 use64bitint="$define"
5743 case "$uselonglongs" in
5744 "$define"|true|[yY]*)
5747 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5749 use64bitint="$define"
5752 case "$use64bitsall" in
5753 "$define"|true|[yY]*)
5756 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5758 use64bitall="$define"
5763 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5765 case "$use64bitall" in
5766 "$define"|true|[yY]*) use64bitint="$define" ;;
5772 You have natively 64-bit long integers.
5776 *) case "$use64bitint" in
5777 "$define"|true|[yY]*) dflt='y';;
5786 Perl can be built to take advantage of 64-bit integer types
5787 on some systems. To do so, Configure can be run with -Duse64bitint.
5788 Choosing this option will most probably introduce binary incompatibilities.
5790 If this doesn't make any sense to you, just accept the default '$dflt'.
5791 (The default has been chosen based on your configuration.)
5793 rp='Try to use 64-bit integers, if available?'
5796 [yY]*) val="$define" ;;
5804 case "$use64bitall" in
5805 "$define"|true|[yY]*) dflt='y' ;;
5806 *) case "$longsize" in
5814 You may also choose to try maximal 64-bitness. It means using as much
5815 64-bitness as possible on the platform. This in turn means even more
5816 binary incompatibilities. On the other hand, your platform may not
5817 have any more 64-bitness available than what you already have chosen.
5819 If this doesn't make any sense to you, just accept the default '$dflt'.
5820 (The default has been chosen based on your configuration.)
5822 rp='Try to use maximal 64-bit support, if available?'
5825 [yY]*) val="$define" ;;
5830 case "$use64bitall" in
5832 case "$use64bitint" in
5836 Since you have chosen a maximally 64-bit build, I'm also turning on
5837 the use of 64-bit integers.
5839 use64bitint="$define" ;;
5844 : Look for a hint-file generated 'call-back-unit'. If the
5845 : user has specified that a 64-bit perl is to be built,
5846 : we may need to set or change some other defaults.
5847 if $test -f use64bitint.cbu; then
5848 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5851 case "$use64bitint" in
5852 "$define"|true|[yY]*)
5854 4) case "$archname64" in
5855 '') archname64=64int ;;
5862 : Look for a hint-file generated 'call-back-unit'. If the
5863 : user has specified that a maximally 64-bit perl is to be built,
5864 : we may need to set or change some other defaults.
5865 if $test -f use64bitall.cbu; then
5866 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5869 case "$use64bitall" in
5870 "$define"|true|[yY]*)
5872 4) case "$archname64" in
5873 ''|64int) archname64=64all ;;
5880 case "$d_quad:$use64bitint" in
5884 *** You have chosen to use 64-bit integers,
5885 *** but none can be found.
5886 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5887 *** Cannot continue, aborting.
5894 : check for length of double
5896 case "$doublesize" in
5898 echo "Checking to see how big your double precision numbers are..." >&4
5907 printf("%d\n", (int)sizeof(double));
5912 if eval $compile_ok; then
5913 doublesize=`$run ./try`
5914 echo "Your double is $doublesize bytes long."
5917 echo "(I can't seem to compile the test program. Guessing...)"
5918 rp="What is the size of a double precision number (in bytes)?"
5926 : check for long doubles
5928 echo "Checking to see if you have long double..." >&4
5929 echo 'int main() { long double x = 7.0; }' > try.c
5931 if eval $compile; then
5933 echo "You have long double."
5936 echo "You do not have long double."
5942 : check for length of long double
5943 case "${d_longdbl}${longdblsize}" in
5946 echo "Checking to see how big your long doubles are..." >&4
5947 $cat >try.c <<'EOCP'
5951 printf("%d\n", sizeof(long double));
5956 if eval $compile; then
5957 longdblsize=`$run ./try`
5958 echo "Your long doubles are $longdblsize bytes long."
5962 echo "(I can't seem to compile the test program. Guessing...)" >&4
5963 rp="What is the size of a long double (in bytes)?"
5967 if $test "X$doublesize" = "X$longdblsize"; then
5968 echo "That isn't any different from an ordinary double."
5969 echo "I'll keep your setting anyway, but you may see some"
5970 echo "harmless compilation warnings."
5976 : determine the architecture name
5978 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5979 tarch=`arch`"-$osname"
5980 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5981 if uname -m > tmparch 2>&1 ; then
5982 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5983 -e 's/$/'"-$osname/" tmparch`
5991 case "$myarchname" in
5994 echo "(Your architecture name used to be $myarchname.)"
5998 case "$targetarch" in
6000 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6005 *) dflt="$archname";;
6007 rp='What is your architecture name'
6010 case "$usethreads" in
6012 echo "Threads selected." >&4
6014 *-thread*) echo "...and architecture name already has -thread." >&4
6016 *) archname="$archname-thread"
6017 echo "...setting architecture name to $archname." >&4
6022 case "$usemultiplicity" in
6024 echo "Multiplicity selected." >&4
6026 *-multi*) echo "...and architecture name already has -multi." >&4
6028 *) archname="$archname-multi"
6029 echo "...setting architecture name to $archname." >&4
6034 case "$use64bitint$use64bitall" in
6036 case "$archname64" in
6038 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6041 case "$use64bitint" in
6042 "$define") echo "64 bit integers selected." >&4 ;;
6044 case "$use64bitall" in
6045 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6048 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6050 *) archname="$archname-$archname64"
6051 echo "...setting architecture name to $archname." >&4
6057 case "$uselongdouble" in
6059 echo "Long doubles selected." >&4
6060 case "$longdblsize" in
6062 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6066 *-ld*) echo "...and architecture name already has -ld." >&4
6068 *) archname="$archname-ld"
6069 echo "...setting architecture name to $archname." >&4
6076 case "$useperlio" in
6078 echo "Perlio selected." >&4
6081 echo "Perlio not selected, using stdio." >&4
6083 *-stdio*) echo "...and architecture name already has -stdio." >&4
6085 *) archname="$archname-stdio"
6086 echo "...setting architecture name to $archname." >&4
6091 if $test -f archname.cbu; then
6092 echo "Your platform has some specific hints for architecture name, using them..."
6096 : set the prefixit variable, to compute a suitable default value
6097 prefixit='case "$3" in
6099 case "$oldprefix" in
6100 "") eval "$1=\"\$$2\"";;
6107 ""|" ") eval "$1=\"\$$2\"";;
6113 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6115 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6116 /*-$oldprefix/*|\~*-$oldprefix/*)
6117 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6118 *) eval "$1=\"\$$2\"";;
6122 : determine installation style
6123 : For now, try to deduce it from prefix unless it is already set.
6124 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6125 case "$installstyle" in
6126 '') case "$prefix" in
6127 *perl*) dflt='lib';;
6128 *) dflt='lib/perl5' ;;
6131 *) dflt="$installstyle" ;;
6133 : Probably not worth prompting for this since we prompt for all
6134 : the directories individually, and the prompt would be too long and
6138 : determine where public executables go
6143 rp='Pathname where the public executables will reside?'
6145 if $test "X$ansexp" != "X$binexp"; then
6149 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6150 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6151 : this via initialinstalllocation
6154 case "$userelocatableinc" in
6155 $define|true|[yY]*) dflt='y' ;;
6160 Would you like to build Perl so that the installation is relocatable, so that
6161 library paths in @INC are determined relative to the path of the perl binary?
6162 This is not advised for system Perl installs, or if you need to run setid
6163 scripts or scripts under taint mode.
6165 If this doesn't make any sense to you, just accept the default '$dflt'.
6167 rp='Use relocatable @INC?'
6170 y|Y) val="$define" ;;
6173 set userelocatableinc
6176 initialinstalllocation="$binexp"
6177 : Default prefix is now "up one level from where the binaries are"
6178 case "$userelocatableinc" in
6184 installprefixexp=".../.."
6188 : determine where private library files go
6189 : Usual default is /usr/local/lib/perl5/$version.
6190 : Also allow things like /opt/perl/lib/$version, since
6191 : /opt/perl/lib/perl5... would be redundant.
6192 : The default "style" setting is made in installstyle.U
6193 case "$installstyle" in
6194 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6195 *) set dflt privlib lib/$version ;;
6200 There are some auxiliary files for $package that need to be put into a
6201 private library directory that is accessible by everyone.
6206 rp='Pathname where the private library files will reside?'
6211 : set the prefixup variable, to restore leading tilda escape
6212 prefixup='case "$prefixexp" in
6214 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6217 : determine where public architecture dependent libraries go
6220 : privlib default is /usr/local/lib/$package/$version
6221 : archlib default is /usr/local/lib/$package/$version/$archname
6222 : privlib may have an optional trailing /share.
6223 tdflt=`echo $privlib | $sed 's,/share$,,'`
6224 tdflt=$tdflt/$archname
6233 $spackage contains architecture-dependent library files. If you are
6234 sharing libraries in a heterogeneous environment, you might store
6235 these files in a separate location. Otherwise, you can just include
6236 them with the rest of the public library files.
6241 rp='Where do you want to put the public architecture-dependent libraries?'
6245 if $test X"$archlib" = X"$privlib"; then
6251 : see if setuid scripts can be secure
6254 Some kernels have a bug that prevents setuid #! scripts from being
6255 secure. Some sites have disabled setuid #! scripts because of this.
6257 First let's decide if your kernel supports secure setuid #! scripts.
6258 (If setuid #! scripts would be secure but have been disabled anyway,
6259 don't say that they are secure if asked.)
6264 if $test -d /dev/fd; then
6265 echo "#!$ls" >reflect
6266 chmod +x,u+s reflect
6267 ./reflect >flect 2>&1
6268 if $contains "/dev/fd" flect >/dev/null; then
6269 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6273 If you are not sure if they are secure, I can check but I'll need a
6274 username and password different from the one you are using right now.
6275 If you don't have such a username or don't want me to test, simply
6279 rp='Other username to test security of setuid scripts with?'
6284 case "$d_suidsafe" in
6285 '') echo "I'll assume setuid scripts are *not* secure." >&4
6288 echo "Well, the $hint value is *not* secure." >&4
6290 *) echo "Well, the $hint value *is* secure." >&4
6295 $rm -f reflect flect
6296 echo "#!$ls" >reflect
6297 chmod +x,u+s reflect
6300 echo '"su" will (probably) prompt you for '"$ans's password."
6301 su $ans -c './reflect >flect'
6302 if $contains "/dev/fd" flect >/dev/null; then
6303 echo "Okay, it looks like setuid scripts are secure." >&4
6306 echo "I don't think setuid scripts are secure." >&4
6311 rp='Does your kernel have *secure* setuid scripts?'
6314 [yY]*) val="$define";;
6319 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6320 echo "(That's for file descriptors, not floppy disks.)"
6326 $rm -f reflect flect
6328 : now see if they want to do setuid emulation
6331 case "$d_suidsafe" in
6334 echo "No need to emulate SUID scripts since they are secure here." >&4
6338 Some systems have disabled setuid scripts, especially systems where
6339 setuid scripts cannot be secure. On systems where setuid scripts have
6340 been disabled, the setuid/setgid bits on scripts are currently
6341 useless. It is possible for $package to detect those bits and emulate
6342 setuid/setgid in a secure fashion. This emulation will only work if
6343 setuid scripts have been disabled in your kernel.
6347 "$define") dflt=y ;;
6350 rp="Do you want to do setuid/setgid emulation?"
6353 [yY]*) val="$define";;
6361 : Find perl5.005 or later.
6362 echo "Looking for a previously installed perl5.005 or later... "
6364 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6365 : Check if this perl is recent and can load a simple module
6366 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6369 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6379 '') echo "None found. That's ok.";;
6380 *) echo "Using $perl5." ;;
6383 : Set the siteprefix variables
6386 After $package is installed, you may wish to install various
6387 add-on modules and utilities. Typically, these add-ons will
6388 be installed under $prefix with the rest
6389 of this package. However, you may wish to install such add-ons
6390 elsewhere under a different prefix.
6392 If you do not wish to put everything under a single prefix, that's
6393 ok. You will be prompted for the individual locations; this siteprefix
6394 is only used to suggest the defaults.
6396 The default should be fine for most people.
6400 rp='Installation prefix to use for add-on modules and utilities?'
6401 : XXX Here might be another good place for an installstyle setting.
6402 case "$siteprefix" in
6404 *) dflt=$siteprefix ;;
6407 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6409 case "$siteprefix" in
6413 *) oldsiteprefix="$prefix";;
6418 siteprefixexp="$ansexp"
6420 : determine where site specific libraries go.
6421 : Usual default is /usr/local/lib/perl5/site_perl/$version
6422 : The default "style" setting is made in installstyle.U
6423 : XXX No longer works with Prefixit stuff.
6424 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6426 '') case "$installstyle" in
6427 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6428 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6436 The installation process will create a directory for
6437 site-specific extensions and modules. Most users find it convenient
6438 to place all site-specific files in this directory rather than in the
6439 main distribution directory.
6443 rp='Pathname for the site-specific library files?'
6447 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6449 : Determine list of previous versions to include in @INC
6450 $cat > getverlist <<EOPL
6453 \$api_versionstring = "$api_versionstring";
6454 \$version = "$version";
6455 \$stem = "$sitelib_stem";
6456 \$archname = "$archname";
6458 $cat >> getverlist <<'EOPL'
6459 # The list found is store twice for each entry: the original name, and
6460 # the binary broken down version as pack "sss", so sorting is easy and
6461 # unambiguous. This will work for all versions that have a maximum of
6462 # three digit groups, separate by '.'s or '_'s. Names are extended with
6463 # ".0.0" to ensure at least three elements for the pack.
6464 # -- H.Merijn Brand (m)'06 23-10-2006
6466 # Can't have leading @ because metaconfig interprets it as a command!
6467 ;@inc_version_list=();
6468 # XXX Redo to do opendir/readdir?
6471 ;@candidates = map {
6472 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6478 ($pversion, $aversion, $vsn5005) = map {
6479 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6480 foreach $d (@candidates) {
6481 if ($d->[1] lt $pversion) {
6482 if ($d->[1] ge $aversion) {
6483 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6485 elsif ($d->[1] ge $vsn5005) {
6486 unshift(@inc_version_list, grep { -d } $d->[0]);
6490 # Skip newer version. I.e. don't look in
6491 # 5.7.0 if we're installing 5.6.1.
6495 if (@inc_version_list) {
6496 print join(' ', @inc_version_list);
6499 # Blank space to preserve value for next Configure run.
6504 case "$inc_version_list" in
6505 '') if test -x "$perl5$exe_ext"; then
6506 dflt=`$perl5 getverlist`
6511 $undef) dflt='none' ;;
6512 *) eval dflt=\"$inc_version_list\" ;;
6515 ''|' ') dflt=none ;;
6522 In order to ease the process of upgrading, this version of perl
6523 can be configured to use modules built and installed with earlier
6524 versions of perl that were installed under $prefix. Specify here
6525 the list of earlier versions that this version of perl should check.
6526 If Configure detected no earlier versions of perl installed under
6527 $prefix, then the list will be empty. Answer 'none' to tell perl
6528 to not search earlier versions.
6530 The default should almost always be sensible, so if you're not sure,
6531 just accept the default.
6534 rp='List of earlier versions to include in @INC?'
6537 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6538 *) inc_version_list="$ans" ;;
6540 case "$inc_version_list" in
6542 inc_version_list_init='0'
6543 d_inc_version_list="$undef"
6545 *) inc_version_list_init=`echo $inc_version_list |
6546 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6547 d_inc_version_list="$define"
6552 : see if this is a malloc.h system
6553 : we want a real compile instead of Inhdr because some systems have a
6554 : malloc.h that just gives a compile error saying to use stdlib.h instead
6559 int main () { return 0; }
6562 if eval $compile; then
6563 echo "<malloc.h> found." >&4
6566 echo "<malloc.h> NOT found." >&4
6573 : check for void type
6575 echo "Checking to see how well your C compiler groks the void type..." >&4
6576 case "$voidflags" in
6588 extern void moo(); /* function returning void */
6589 void (*goo)(); /* ptr to func returning void */
6591 void *hue; /* generic ptr */
6604 int main() { sub(); }
6606 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6607 voidflags=$defvoidused
6608 echo "Good. It appears to support void to the level $package wants.">&4
6609 if $contains warning .out >/dev/null 2>&1; then
6610 echo "However, you might get some warnings that look like this:"
6614 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6615 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6616 echo "It supports 1..."
6617 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6618 echo "It also supports 2..."
6619 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6621 echo "And it supports 4 but not 8 definitely."
6623 echo "It doesn't support 4..."
6624 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6626 echo "But it supports 8."
6629 echo "Neither does it support 8."
6633 echo "It does not support 2..."
6634 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6636 echo "But it supports 4 and 8."
6638 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6640 echo "And it supports 4 but has not heard about 8."
6642 echo "However it supports 8 but not 4."
6647 echo "There is no support at all for void."
6652 case "$voidflags" in
6655 Support flag bits are:
6656 1: basic void declarations.
6657 2: arrays of pointers to functions returning void.
6658 4: operations between pointers to and addresses of void functions.
6659 8: generic void pointers.
6662 rp="Your void support flags add up to what?"
6669 : check for length of pointer
6673 echo "Checking to see how big your pointers are..." >&4
6674 if test "$voidflags" -gt 7; then
6675 echo '#define VOID_PTR char *' > try.c
6677 echo '#define VOID_PTR void *' > try.c
6687 printf("%d\n", (int)sizeof(VOID_PTR));
6692 if eval $compile_ok; then
6693 ptrsize=`$run ./try`
6694 echo "Your pointers are $ptrsize bytes long."
6697 echo "(I can't seem to compile the test program. Guessing...)" >&4
6698 rp="What is the size of a pointer (in bytes)?"
6705 case "$use64bitall" in
6706 "$define"|true|[yY]*)
6710 *** You have chosen a maximally 64-bit build,
6711 *** but your pointers are only 4 bytes wide.
6712 *** Please rerun Configure without -Duse64bitall.
6717 *** Since you have quads, you could possibly try with -Duse64bitint.
6722 *** Cannot continue, aborting.
6733 : determine whether to use malloc wrapping
6735 case "$usemallocwrap" in
6736 [yY]*|true|$define) dflt='y' ;;
6737 [nN]*|false|$undef) dflt='n' ;;
6738 *) case "$usedevel" in
6739 [yY]*|true|$define) dflt='y' ;;
6744 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6746 usemallocwrap="$ans"
6749 usemallocwrap="$define" ;;
6751 usemallocwrap="$undef" ;;
6754 : determine which malloc to compile in
6756 case "$usemymalloc" in
6757 [yY]*|true|$define) dflt='y' ;;
6758 [nN]*|false|$undef) dflt='n' ;;
6759 *) case "$ptrsize" in
6765 rp="Do you wish to attempt to use the malloc that comes with $package?"
6771 mallocsrc='malloc.c'
6772 mallocobj="malloc$_o"
6773 d_mymalloc="$define"
6776 : Remove malloc from list of libraries to use
6777 echo "Removing unneeded -lmalloc from library list" >&4
6778 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6781 echo "libs = $libs" >&4
6793 : compute the return types of malloc and free
6795 $cat >malloc.c <<END
6799 #include <sys/types.h>
6813 case "$malloctype" in
6815 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6822 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6826 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6833 echo "Your system uses $freetype free(), it would seem." >&4
6835 : determine where site specific architecture-dependent libraries go.
6836 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6837 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6838 : sitelib may have an optional trailing /share.
6840 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6841 dflt="$dflt/$archname"
6846 set sitearch sitearch none
6850 The installation process will also create a directory for
6851 architecture-dependent site-specific extensions and modules.
6855 rp='Pathname for the site-specific architecture-dependent library files?'
6859 if $test X"$sitearch" = X"$sitelib"; then
6862 d_sitearch="$define"
6865 : Set the vendorprefix variables
6868 The installation process will also create a directory for
6869 vendor-supplied add-ons. Vendors who supply perl with their system
6870 may find it convenient to place all vendor-supplied files in this
6871 directory rather than in the main distribution directory. This will
6872 ease upgrades between binary-compatible maintenance versions of perl.
6874 Of course you may also use these directories in whatever way you see
6875 fit. For example, you might use them to access modules shared over a
6876 company-wide network.
6878 The default answer should be fine for most people.
6879 This causes further questions about vendor add-ons to be skipped
6880 and no vendor-specific directories will be configured for perl.
6883 rp='Do you want to configure vendor-specific add-on directories?'
6884 case "$usevendorprefix" in
6885 define|true|[yY]*) dflt=y ;;
6886 *) : User may have set vendorprefix directly on Configure command line.
6887 case "$vendorprefix" in
6896 rp='Installation prefix to use for vendor-supplied add-ons?'
6897 case "$vendorprefix" in
6899 *) dflt=$vendorprefix ;;
6902 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6904 case "$vendorprefix" in
6908 *) oldvendorprefix="$prefix";;
6912 usevendorprefix="$define"
6914 vendorprefixexp="$ansexp"
6916 *) usevendorprefix="$undef"
6922 : Set the vendorlib variables
6923 case "$vendorprefix" in
6924 '') d_vendorlib="$undef"
6928 *) d_vendorlib="$define"
6929 : determine where vendor-supplied modules go.
6930 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6931 case "$vendorlib" in
6933 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6934 case "$installstyle" in
6935 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6936 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6939 *) dflt="$vendorlib"
6943 rp='Pathname for the vendor-supplied library files?'
6946 vendorlibexp="$ansexp"
6949 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6953 : Set the vendorarch variables
6954 case "$vendorprefix" in
6955 '') d_vendorarch="$undef"
6959 *) d_vendorarch="$define"
6960 : determine where vendor-supplied architecture-dependent libraries go.
6961 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6962 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6963 : vendorlib may have an optional trailing /share.
6964 case "$vendorarch" in
6965 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6966 dflt="$dflt/$archname"
6968 *) dflt="$vendorarch" ;;
6971 rp='Pathname for vendor-supplied architecture-dependent files?'
6974 vendorarchexp="$ansexp"
6977 prefixvar=vendorarch
6980 : Final catch-all directories to search
6983 Lastly, you can have perl look in other directories for extensions and
6984 modules in addition to those already specified.
6985 These directories will be searched after
6989 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6990 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6992 case "$otherlibdirs" in
6993 ''|' ') dflt='none' ;;
6994 *) dflt="$otherlibdirs" ;;
6997 Enter a colon-separated set of extra paths to include in perl's @INC
6998 search path, or enter 'none' for no extra paths.
7002 rp='Colon-separated list of additional directories for perl to search?'
7005 ' '|''|none) otherlibdirs=' ' ;;
7006 *) otherlibdirs="$ans" ;;
7008 case "$otherlibdirs" in
7012 set d_perl_otherlibdirs
7015 : Cruising for prototypes
7017 echo "Checking out function prototypes..." >&4
7018 $cat >prototype.c <<EOCP
7023 int main(int argc, char *argv[]) {
7026 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7027 echo "Your C compiler appears to support function prototypes."
7030 echo "Your C compiler doesn't seem to understand function prototypes."
7037 : Check if ansi2knr is required
7038 case "$prototype" in
7040 *) ansi2knr='ansi2knr'
7045 This version of $package can only be compiled by a compiler that
7046 understands function prototypes. Unfortunately, your C compiler
7048 doesn't seem to understand them. Sorry about that.
7050 If GNU cc is available for your system, perhaps you could try that instead.
7052 Eventually, we hope to support building Perl with pre-ANSI compilers.
7053 If you would like to help in that effort, please contact <perlbug@perl.org>.
7055 Aborting Configure now.
7062 dflt_dtrace='/usr/sbin/dtrace'
7065 Perl can be built to support DTrace on platforms that support it.
7066 DTrace is a diagnosis and performance analysis tool from Sun.
7068 If this doesn't make any sense to you, just accept the default '$dflt'.
7072 case "$usedtrace" in
7078 dflt_dtrace=$usedtrace
7085 rp='Support DTrace if available?'
7088 y|Y) val="$define" ;;
7094 test "X$usedtrace" != "X$define" && break
7097 rp='Where is the dtrace executable?'
7106 if $dtrace -h -s ../perldtrace.d \
7107 -o perldtrace.tmp >/dev/null 2>&1 \
7108 && rm -f perldtrace.tmp
7111 echo "Good: your $dtrace knows about the -h flag."
7115 *** $me: Fatal Error: $dtrace doesn't support -h flag
7117 *** Your installed dtrace doesn't support the -h switch to compile a D
7118 *** program into a C header. Can't continue.
7130 *** $me: Fatal Error: $dtrace not found.
7137 echo "*** $dtrace was not found."
7143 : See if we want extra modules installed
7150 Perl can be built with extra modules or bundles of modules which
7151 will be fetched from the CPAN and installed alongside Perl.
7153 Notice that you will need access to the CPAN; either via the Internet,
7154 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7155 be asked later to configure the CPAN.pm module which will in turn do
7156 the installation of the rest of the extra modules or bundles.)
7158 Notice also that if the modules require any external software such as
7159 libraries and headers (the libz library and the zlib.h header for the
7160 Compress::Zlib module, for example) you MUST have any such software
7161 already installed, this configuration process will NOT install such
7164 If this doesn't make any sense to you, just accept the default '$dflt'.
7166 rp='Install any extra modules (y or n)?'
7172 Please list any extra modules or bundles to be installed from CPAN,
7173 with spaces between the names. The names can be in any format the
7174 'install' command of CPAN.pm will understand. (Answer 'none',
7175 without the quotes, to install no extra modules or bundles.)
7185 $rm -f ../extras.lst
7187 *) echo "(Saving the list of extras for later...)"
7188 echo "$extras" > ../extras.lst
7196 : determine where html pages for programs go
7197 set html1dir html1dir none
7201 If you wish to install html files for programs in $spackage, indicate
7202 the appropriate directory here. To skip installing html files,
7206 ''|none|$undef|' ') dflt=none ;;
7207 *) dflt=$html1dir ;;
7210 rp="Directory for the main $spackage html pages?"
7214 : Use ' ' for none so value is preserved next time through Configure
7215 $test X"$html1dir" = "X" && html1dir=' '
7217 : determine where html pages for libraries and modules go
7218 set html3dir html3dir none
7222 If you wish to install html files for modules associated with $spackage,
7223 indicate the appropriate directory here. To skip installing html files,
7226 : There is no obvious default. If they have specified html1dir, then
7227 : try to key off that, possibly changing .../html1 into .../html3.
7229 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7230 *) dflt=$html3dir ;;
7233 rp="Directory for the $spackage module html pages?"
7237 : Use ' ' for none so value is preserved next time through Configure
7238 $test X"$html3dir" = "X" && html3dir=' '
7240 : determine whether to install perl also as /usr/bin/perl
7243 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7245 Many scripts expect perl to be installed as /usr/bin/perl.
7247 If you want to, I can install the perl you are about to compile
7248 as /usr/bin/perl (in addition to $bin/perl).
7250 if test -f /usr/bin/perl; then
7253 However, please note that because you already have a /usr/bin/perl,
7254 overwriting that with a new Perl would very probably cause problems.
7255 Therefore I'm assuming you don't want to do that (unless you insist).
7258 case "$installusrbinperl" in
7259 "$define"|[yY]*) dflt='y';;
7265 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7268 case "$installusrbinperl" in
7269 "$undef"|[nN]*) dflt='n';;
7273 rp="Do you want to install perl as /usr/bin/perl?"
7276 [yY]*) val="$define";;
7282 set installusrbinperl
7285 : Check if we are using the GNU C library
7287 echo "Checking for GNU C Library..." >&4
7289 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7290 alone are insufficient to distinguish different versions, such as
7291 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7292 libc version 2.1.0. A. Dougherty, June 3, 2002.
7298 # ifdef __GLIBC_MINOR__
7299 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7300 # include <gnu/libc-version.h>
7301 printf("%s\n", gnu_get_libc_version());
7303 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7306 printf("%d\n", __GLIBC__);
7315 if eval $compile_ok && $run ./try > glibc.ver; then
7317 gnulibc_version=`$cat glibc.ver`
7318 echo "You are using the GNU C Library version $gnulibc_version"
7322 echo "You are not using the GNU C Library"
7328 : see if nm is to be used to determine whether a symbol is defined or not
7332 case "$d_gnulibc" in
7335 echo "nm probably won't work on the GNU C Library." >&4
7341 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7343 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7344 echo "'nm' won't be sufficient on this sytem." >&4
7350 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7351 if $test $dflt -gt 20; then
7361 true|$define) dflt=y;;
7368 I can use $nm to extract the symbols from your C libraries. This
7369 is a time consuming task which may generate huge output on the disk (up
7370 to 3 megabytes) but that should make the symbols extraction faster. The
7371 alternative is to skip the 'nm' extraction part and to compile a small
7372 test program instead to determine whether each symbol is present. If
7373 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7374 this may be the best solution.
7376 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7379 rp="Shall I use $nm to extract C symbols from the libraries?"
7382 [Nn]*) usenm=false;;
7391 : nm options which may be necessary
7393 '') if $test -f /mach_boot; then
7395 elif $test -d /usr/ccs/lib; then
7396 nm_opt='-p' # Solaris (and SunOS?)
7397 elif $test -f /dgux; then
7399 elif $test -f /lib64/rld; then
7400 nm_opt='-p' # 64-bit Irix
7406 : nm options which may be necessary for shared libraries but illegal
7407 : for archive libraries. Thank you, Linux.
7408 case "$nm_so_opt" in
7409 '') case "$myuname" in
7411 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7412 nm_so_opt='--dynamic'
7419 : get list of predefined functions in a handy place
7426 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7432 *) for thislib in $libs; do
7435 : Handle C library specially below.
7438 thislib=`echo $thislib | $sed -e 's/^-l//'`
7439 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7441 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7443 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7445 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7447 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7449 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7451 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7456 libnames="$libnames $try"
7458 *) libnames="$libnames $thislib" ;;
7467 for xxx in $libpth; do
7468 $test -r $1 || set $xxx/libc.$so
7469 : The messy sed command sorts on library version numbers.
7471 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7472 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7474 s/[0-9][0-9]*/0000&/g
7475 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7478 $sort | $sed -e 's/^.* //'`
7481 $test -r $1 || set /usr/ccs/lib/libc.$so
7482 $test -r $1 || set /lib/libsys_s$_a
7488 if $test -r "$1"; then
7489 echo "Your (shared) C library seems to be in $1."
7491 elif $test -r /lib/libc && $test -r /lib/clib; then
7492 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7494 libc='/lib/clib /lib/libc'
7495 if $test -r /lib/syslib; then
7496 echo "(Your math library is in /lib/syslib.)"
7497 libc="$libc /lib/syslib"
7499 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7500 echo "Your C library seems to be in $libc, as you said before."
7501 elif $test -r $incpath/usr/lib/libc$_a; then
7502 libc=$incpath/usr/lib/libc$_a;
7503 echo "Your C library seems to be in $libc. That's fine."
7504 elif $test -r /lib/libc$_a; then
7506 echo "Your C library seems to be in $libc. You're normal."
7508 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7510 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7511 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7512 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7514 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7516 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7519 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7521 if $test -r "$tans"; then
7522 echo "Your C library seems to be in $tans, of all places."
7528 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7532 If the guess above is wrong (which it might be if you're using a strange
7533 compiler, or your machine supports multiple models), you can override it here.
7538 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7540 I can't seem to find your C library. I've looked in the following places:
7543 $sed 's/^/ /' libpath
7546 None of these seems to contain your C library. I need to get its name...
7551 rp='Where is your C library?'
7556 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7557 set X `cat libnames`
7560 case $# in 1) xxx=file; esac
7561 echo "Extracting names from the following $xxx for later perusal:" >&4
7563 $sed 's/^/ /' libnames >&4
7565 $echo $n "This may take a while...$c" >&4
7569 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7570 *) $nm $nm_opt $file 2>/dev/null;;
7575 $grep fprintf libc.tmp > libc.ptf
7576 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7577 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7579 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7581 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7583 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7585 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7587 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7589 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7591 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7593 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7595 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7597 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7599 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7601 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7603 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7604 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7606 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7608 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7612 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7616 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7620 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7628 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7632 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7637 $nm -p $* 2>/dev/null >libc.tmp
7638 $grep fprintf libc.tmp > libc.ptf
7639 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7640 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7646 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7648 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7649 for thisname in $libnames $libc; do
7650 $ar t $thisname >>libc.tmp
7652 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7654 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7655 # Repeat libc to extract forwarders to DLL entries too
7656 for thisname in $libnames $libc; do
7657 $ar tv $thisname >>libc.tmp
7658 # Revision 50 of EMX has bug in $ar.
7659 # it will not extract forwarders to DLL entries
7660 # Use emximp which will extract exactly them.
7661 emximp -o tmp.imp $thisname \
7663 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7664 < tmp.imp >>libc.tmp
7667 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7670 echo "$ar didn't seem to work right." >&4
7671 echo "Maybe this is a Cray...trying bld instead..." >&4
7672 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7674 for thisname in $libnames; do
7676 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7677 $ar t $thisname >>libc.tmp
7681 echo "That didn't work either. Giving up." >&4
7691 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7692 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7694 *) if $test -f /lib/syscalls.exp; then
7696 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7697 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7703 $rm -f libnames libpath
7705 : see if dld is available
7709 : Check if we are using C++
7711 echo "Checking for C++..." >&4
7712 $cat >try.c <<'EOCP'
7724 if eval $compile_ok && $run ./try; then
7726 echo "You are using a C++ compiler."
7729 echo "You are not using a C++ compiler."
7735 : is a C symbol defined?
7738 -v) tf=libc.tmp; tdc="";;
7739 -a) tf=libc.tmp; tdc="[]";;
7740 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7743 case "$reuseval-$4" in
7745 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7750 case "$d_cplusplus" in
7751 $define) extern_C=\"C\";;
7753 if $test "$runnm" = true; then
7754 if $contains $tlook $tf >/dev/null 2>&1; then
7756 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7757 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7758 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7759 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7763 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7764 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7770 $define) tval=true;;
7777 : define an is-in-libc? function
7778 inlibc='echo " "; td=$define; tu=$undef;
7779 sym=$1; var=$2; eval "was=\$$2";
7781 case "$reuseval$was" in
7791 echo "$sym() found." >&4;
7792 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7794 echo "$sym() NOT found." >&4;
7795 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7799 $define) echo "$sym() found." >&4;;
7800 *) echo "$sym() NOT found." >&4;;
7804 : see if dlopen exists
7806 xxx_ccflags="$ccflags"
7808 : with g++ one needs -shared to get is-in-libc to work for dlopen
7809 case "$gccversion" in
7811 *) case "$d_cplusplus" in
7812 "$define") ccflags="$ccflags -shared" ;;
7819 ccflags="$xxx_ccflags"
7821 : see if this is a unistd.h system
7822 set unistd.h i_unistd
7825 : determine which dynamic loading, if any, to compile in
7827 dldir="ext/DynaLoader"
7840 $define) dflt='y' ;;
7843 $define) dflt='y' ;;
7845 : Does a dl_xxx.xs file exist for this operating system
7846 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7849 rp="Do you wish to use dynamic loading?"
7856 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7857 dflt="$dldir/dl_${osname}.xs"
7858 elif $test "$d_dlopen" = "$define" ; then
7859 dflt="$dldir/dl_dlopen.xs"
7860 elif $test "$i_dld" = "$define" ; then
7861 dflt="$dldir/dl_dld.xs"
7866 *) dflt="$dldir/$dlsrc"
7869 echo "The following dynamic loading files are available:"
7870 : Can not go over to $dldir because getfile has path hard-coded in.
7871 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7872 rp="Source file to use for dynamic loading"
7878 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7882 Some systems may require passing special flags to $cc -c to
7883 compile modules that will be used to create a shared library.
7884 To use no flags, say "none".
7887 case "$cccdlflags" in
7888 '') case "$gccversion" in
7889 '') case "$osname" in
7891 next) dflt='none' ;;
7892 irix*) dflt='-KPIC' ;;
7893 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7894 sunos) dflt='-pic' ;;
7898 *) case "$osname" in
7899 darwin) dflt='none' ;;
7900 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7905 *) dflt="$cccdlflags" ;;
7907 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7910 none) cccdlflags=' ' ;;
7911 *) cccdlflags="$ans" ;;
7916 Some systems use ld to create libraries that can be dynamically loaded,
7917 while other systems (such as those using ELF) use $cc.
7921 '') $cat >try.c <<EOM
7922 /* Test for whether ELF binaries are produced */
7934 int i = open("a.out",O_RDONLY);
7937 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7938 exit(0); /* succeed (yes, it's ELF) */
7943 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7945 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7949 echo "I'll use ld to build dynamic libraries."
7958 rp="What command should be used to create dynamic libraries?"
7964 Some systems may require passing special flags to $ld to create a
7965 library that can be dynamically loaded. If your ld flags include
7966 -L/other/path options to locate libraries outside your loader's normal
7967 search path, you may need to specify those -L options here as well. To
7968 use no flags, say "none".
7971 case "$lddlflags" in
7972 '') case "$osname" in
7973 beos) dflt='-nostart' ;;
7975 case "$gccversion" in
7976 '') dflt="$dflt +vnocompatwarnings" ;;
7979 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7980 next) dflt='none' ;;
7981 solaris) dflt='-G' ;;
7982 sunos) dflt='-assert nodefinitions' ;;
7983 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7987 *) dflt="$lddlflags" ;;
7990 : Try to guess additional flags to pick up local libraries.
7991 : Be careful not to append to a plain 'none'
7995 for thisflag in $ldflags; do
8000 *) dflt="$dflt $thisflag" ;;
8007 ''|' ') dflt='none' ;;
8010 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8013 none) lddlflags=' ' ;;
8014 *) lddlflags="$ans" ;;
8019 Some systems may require passing special flags to $cc to indicate that
8020 the resulting executable will use dynamic linking. To use no flags,
8024 case "$ccdlflags" in
8025 '') case "$osname" in
8026 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8027 next|sunos) dflt='none' ;;
8031 *) dflt="$ccdlflags" ;;
8033 rp="Any special flags to pass to $cc to use dynamic linking?"
8036 none) ccdlflags=' ' ;;
8037 *) ccdlflags="$ans" ;;
8048 : Do we want a shared libperl?
8052 # No dynamic loading being used, so don't bother even to prompt.
8055 *) case "$useshrplib" in
8056 '') case "$osname" in
8057 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8059 also='Building a shared libperl is required for dynamic loading to work on your system.'
8064 also='Building a shared libperl is needed for MAB support.'
8082 The perl executable is normally obtained by linking perlmain.c with
8083 libperl${_a}, any static extensions (usually just DynaLoader), and
8084 any other libraries needed on this system (such as -lm, etc.). Since
8085 your system supports dynamic loading, it is probably possible to build
8086 a shared libperl.$so. If you will have more than one executable linked
8087 to libperl.$so, this will significantly reduce the size of each
8088 executable, but it may have a noticeable effect on performance. The
8089 default is probably sensible for your system.
8093 rp="Build a shared libperl.$so (y/n)"
8097 useshrplib='true' ;;
8098 *) useshrplib='false' ;;
8103 case "$useshrplib" in
8107 # Figure out a good name for libperl.so. Since it gets stored in
8108 # a version-specific architecture-dependent library, the version
8109 # number isn't really that important, except for making cc/ld happy.
8111 # A name such as libperl.so.3.1
8112 majmin="libperl.$so.$patchlevel.$subversion"
8113 # A name such as libperl.so.301
8114 majonly=`echo $patchlevel $subversion |
8115 $awk '{printf "%d%02d", $1, $2}'`
8116 majonly=libperl.$so.$majonly
8117 # I'd prefer to keep the os-specific stuff here to a minimum, and
8118 # rely on figuring it out from the naming of libc.
8119 case "${osname}${osvers}" in
8122 # XXX How handle the --version stuff for MAB?
8124 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8127 cygwin*) # ld links against an importlib
8128 dflt=libperl$lib_ext
8130 *) # Try to guess based on whether libc has major.minor.
8132 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8133 *libc.$so.[0-9]*) dflt=$majonly ;;
8134 *) dflt=libperl.$so ;;
8144 I need to select a good name for the shared libperl. If your system uses
8145 library names with major and minor numbers, then you might want something
8146 like $majmin. Alternatively, if your system uses a single version
8147 number for shared libraries, then you might want to use $majonly.
8148 Or, your system might be quite happy with a simple libperl.$so.
8150 Since the shared libperl will get installed into a version-specific
8151 architecture-dependent directory, the version number of the shared perl
8152 library probably isn't important, so the default should be o.k.
8155 rp='What name do you want to give to the shared libperl?'
8158 echo "Ok, I'll use $libperl"
8161 libperl="libperl${_a}"
8165 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8169 WARNING: Use of the shrpdir variable for the installation location of
8170 the shared $libperl is not supported. It was never documented and
8171 will not work in this version. Let me (perlbug@perl.org)
8172 know of any problems this may cause.
8178 But your current setting of $shrpdir is
8179 the default anyway, so it's harmless.
8184 Further, your current attempted setting of $shrpdir
8185 conflicts with the value of $archlibexp/CORE
8186 that installperl will use.
8193 # How will the perl executable find the installed shared $libperl?
8194 # Add $xxx to ccdlflags.
8195 # If we can't figure out a command-line option, use $shrpenv to
8196 # set env LD_RUN_PATH. The main perl makefile uses this.
8197 shrpdir=$archlibexp/CORE
8200 if "$useshrplib"; then
8203 # We'll set it in Makefile.SH...
8208 freebsd|netbsd|openbsd|interix|dragonfly)
8209 xxx="-Wl,-R$shrpdir"
8211 bsdos|linux|irix*|dec_osf|gnu*)
8212 xxx="-Wl,-rpath,$shrpdir"
8215 # next doesn't like the default...
8218 # beos doesn't like the default, either.
8221 # hpux doesn't like the default, either.
8222 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8225 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8231 # Only add $xxx if it isn't already in ccdlflags.
8232 case " $ccdlflags " in
8234 *) ccdlflags="$ccdlflags $xxx"
8237 Adding $xxx to the flags
8238 passed to $ld so that the perl executable will find the
8239 installed shared $libperl.
8247 # Fix ccdlflags in AIX for building external extensions.
8248 # (For building Perl itself bare -bE:perl.exp is needed,
8249 # Makefile.SH takes care of this.)
8251 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8253 # Respect a hint or command-line value.
8255 '') shrpenv="$tmp_shrpenv" ;;
8257 case "$ldlibpthname" in
8258 '') ldlibpthname=LD_LIBRARY_PATH ;;
8259 none) ldlibpthname='' ;;
8262 : determine where manual pages are on this system
8266 syspath='/usr/share/man/man1 /usr/man/man1'
8267 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8268 syspath="$syspath /usr/man/u_man/man1"
8269 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8270 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8271 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8272 sysman=`./loc . /usr/man/man1 $syspath`
8275 if $test -d "$sysman"; then
8276 echo "System manual is in $sysman." >&4
8278 echo "Could not find manual pages in source form." >&4
8281 : determine where manual pages go
8282 set man1dir man1dir none
8286 $spackage has manual pages available in source form.
8290 echo "However, you don't have nroff, so they're probably useless to you."
8292 '') man1dir="none";;
8295 echo "If you don't want the manual sources installed, answer 'none'."
8300 lookpath="$prefixexp/share/man/man1"
8301 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8302 lookpath="$lookpath $prefixexp/man/p_man/man1"
8303 lookpath="$lookpath $prefixexp/man/u_man/man1"
8304 lookpath="$lookpath $prefixexp/man/man.1"
8306 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8307 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8317 rp="Where do the main $spackage manual pages (source) go?"
8319 if $test "X$man1direxp" != "X$ansexp"; then
8330 : What suffix to use on installed man pages
8337 rp="What suffix should be used for the main $spackage man pages?"
8339 '') case "$man1dir" in
8353 *) dflt="$man1ext";;
8360 : see if we can have long filenames
8362 first=123456789abcdef
8364 if (echo hi >$first) 2>/dev/null; then
8365 if $test -f 123456789abcde; then
8366 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8369 echo 'You can have filenames longer than 14 characters.'>&4
8374 You can't have filenames longer than 14 chars.
8375 You can't even think about them!
8381 $rm -rf 123456789abcde*
8383 : determine where library module manual pages go
8384 set man3dir man3dir none
8388 $spackage has manual pages for many of the library modules.
8394 However, you don't have nroff, so they're probably useless to you.
8397 '') man3dir="none";;
8401 case "$d_flexfnam" in
8404 However, your system can't handle the long file names like File::Basename.3.
8407 '') man3dir="none";;
8411 echo "If you don't want the manual sources installed, answer 'none'."
8412 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8414 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8415 if $test -d "$privlib/man/man3"; then
8418 WARNING: Previous versions of perl installed man3 pages into
8419 $privlib/man/man3. This version will suggest a
8420 new default of $dflt.
8424 rp='Do you wish to preserve the old behavior?(y/n)'
8427 y*) dflt="$privlib/man/man3" ;;
8432 *) dflt="$man3dir" ;;
8439 rp="Where do the $package library man pages (source) go?"
8449 : What suffix to use on installed man pages
8455 rp="What suffix should be used for the $package library man pages?"
8457 '') case "$man3dir" in
8471 *) dflt="$man3ext";;
8478 : see if we have to deal with yellow pages, now NIS.
8479 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8480 if $test -f /usr/etc/nibindd; then
8482 echo "I'm fairly confident you're on a NeXT."
8484 rp='Do you get the hosts file via NetInfo?'
8493 y*) hostcat='nidump hosts .';;
8494 *) case "$hostcat" in
8495 nidump*) hostcat='';;
8505 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8513 rp='Are you getting the hosts file via yellow pages?'
8516 y*) hostcat='ypcat hosts';;
8517 *) hostcat='cat /etc/hosts';;
8523 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8526 '') test -f /etc/group && groupcat='cat /etc/group';;
8529 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8532 : now get the host name
8534 echo "Figuring out host name..." >&4
8535 case "$myhostname" in
8537 echo 'Maybe "hostname" will work...'
8538 if tans=`sh -c hostname 2>&1` ; then
8546 if $test "$cont"; then
8548 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8549 if tans=`cat /etc/systemid 2>&1` ; then
8551 phostname='cat /etc/systemid'
8552 echo "Whadyaknow. Xenix always was a bit strange..."
8555 elif $test -r /etc/systemid; then
8556 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8559 if $test "$cont"; then
8560 echo 'No, maybe "uuname -l" will work...'
8561 if tans=`sh -c 'uuname -l' 2>&1` ; then
8563 phostname='uuname -l'
8565 echo 'Strange. Maybe "uname -n" will work...'
8566 if tans=`sh -c 'uname -n' 2>&1` ; then
8568 phostname='uname -n'
8570 echo 'Oh well, maybe I can mine it out of whoami.h...'
8571 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8572 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8573 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8575 case "$myhostname" in
8576 '') echo "Does this machine have an identity crisis or something?"
8579 echo "Well, you said $myhostname before..."
8580 phostname='echo $myhostname';;
8586 case "$myhostname" in
8587 '') myhostname=noname ;;
8589 : you do not want to know about this
8594 if $test "$myhostname" ; then
8596 rp='Your host name appears to be "'$myhostname'".'" Right?"
8604 : bad guess or no guess
8605 while $test "X$myhostname" = X ; do
8607 rp="Please type the (one word) name of your host:"
8612 : translate upper to lower if necessary
8613 case "$myhostname" in
8615 echo "(Normalizing case in your host name)"
8616 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8620 case "$myhostname" in
8622 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8623 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8624 echo "(Trimming domain name from host name--host name is now $myhostname)"
8626 *) case "$mydomain" in
8629 test "X$hostcat" = "Xypcat hosts" &&
8630 ypmatch "$myhostname" hosts 2>/dev/null |\
8631 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8634 test "X$hostcat" != "X" &&
8635 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8636 /[ ]$myhostname[ . ]/p" > hosts
8639 if $test -f hosts; then
8640 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8641 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8642 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8643 hosts | $sort | $uniq | \
8644 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8645 case `$echo X$dflt` in
8646 X*\ *) echo "(Several hosts in the database matched hostname)"
8649 X.) echo "(You do not have fully-qualified names in the hosts database)"
8653 echo "(I cannot locate a hosts database anywhere)"
8658 tans=`./loc resolv.conf X /etc /usr/etc`
8659 if $test -f "$tans"; then
8660 echo "(Attempting domain name extraction from $tans)"
8661 dflt=.`$sed -n -e 's/ / /g' \
8662 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8663 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8665 .) dflt=.`$sed -n -e 's/ / /g' \
8666 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8667 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8674 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8675 dflt=.`sh -c domainname 2>/dev/null`
8678 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8682 case "$dflt$osname" in
8683 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8684 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8688 .) echo "(Lost all hope -- silly guess then)"
8694 *) dflt="$mydomain";;
8698 rp="What is your domain name?"
8708 : translate upper to lower if necessary
8711 echo "(Normalizing case in your domain name)"
8712 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8716 : a little sanity check here
8717 case "$phostname" in
8720 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8721 $myhostname$mydomain|$myhostname) ;;
8723 case "$phostname" in
8725 echo "(That doesn't agree with your whoami.h file, by the way.)"
8728 echo "(That doesn't agree with your $phostname command, by the way.)"
8736 : determine the e-mail address of the user who is running us
8739 I need to get your e-mail address in Internet format if possible, i.e.
8740 something like user@host.domain. Please answer accurately since I have
8741 no easy means to double check it. The default value provided below
8742 is most probably close to reality but may not be valid from outside
8743 your organization...
8747 while test "$cont"; do
8749 '') dflt="$cf_by@$myhostname$mydomain";;
8750 *) dflt="$cf_email";;
8752 rp='What is your e-mail address?'
8758 rp='Address does not look like an Internet one. Use it anyway?'
8772 : Ask e-mail of administrator
8775 If you or somebody else will be maintaining perl at your site, please
8776 fill in the correct e-mail address here so that they may be contacted
8777 if necessary. Currently, the "perlbug" program included with perl
8778 will send mail to this address in addition to perlbug@perl.org. You may
8779 enter "none" for no administrator.
8782 case "$perladmin" in
8783 '') dflt="$cf_email";;
8784 *) dflt="$perladmin";;
8786 rp='Perl administrator e-mail address'
8790 : determine whether to only install version-specific parts.
8793 Do you want to install only the version-specific parts of the perl
8794 distribution? Usually you do *not* want to do this.
8796 case "$versiononly" in
8797 "$define"|[Yy]*|true) dflt='y' ;;
8800 rp="Do you want to install only the version-specific parts of perl?"
8803 [yY]*) val="$define";;
8809 case "$versiononly" in
8810 "$define") inc_version_list=''
8811 inc_version_list_init=0
8815 : figure out how to guarantee perl startup
8816 : XXX Note that this currently takes advantage of the bug that binexp ignores
8817 : the Configure -Dinstallprefix setting, which in turn means that under
8818 : relocatable @INC, initialinstalllocation is what binexp started as.
8819 case "$startperl" in
8821 case "$sharpbang" in
8825 I can use the #! construct to start perl on your system. This will
8826 make startup of perl scripts faster, but may cause problems if you
8827 want to share those scripts and perl is not in a standard place
8828 ($initialinstalllocation/perl) on all your platforms. The alternative
8829 is to force a shell by starting the script with a single ':' character.
8832 case "$versiononly" in
8833 "$define") dflt="$initialinstalllocation/perl$version";;
8834 *) dflt="$initialinstalllocation/perl";;
8836 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8839 none) startperl=": # use perl";;
8840 *) startperl="#!$ans"
8841 if $test 30 -lt `echo "$ans" | wc -c`; then
8844 WARNING: Some systems limit the #! command to 32 characters.
8845 If you experience difficulty running Perl scripts with #!, try
8846 installing Perl in a directory with a shorter pathname.
8852 *) startperl=": # use perl"
8857 echo "I'll use $startperl to start perl scripts."
8859 : figure best path for perl in scripts
8862 case "$versiononly" in
8863 "$define") perlpath="$initialinstalllocation/perl$version";;
8864 *) perlpath="$initialinstalllocation/perl";;
8866 case "$startperl" in
8871 I will use the "eval 'exec'" idiom to start Perl on your system.
8872 I can use the full path of your Perl binary for this purpose, but
8873 doing so may cause problems if you want to share those scripts and
8874 Perl is not always in a standard place ($initialinstalllocation/perl).
8877 dflt="$initialinstalllocation/perl"
8878 rp="What path shall I use in \"eval 'exec'\"?"
8885 case "$startperl" in
8887 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8890 : determine where public executable scripts go
8891 set scriptdir scriptdir
8893 case "$scriptdir" in
8896 : guess some guesses
8897 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8898 $test -d /usr/share/bin && dflt=/usr/share/bin
8899 $test -d /usr/local/script && dflt=/usr/local/script
8900 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8901 $test -d $prefixexp/script && dflt=$prefixexp/script
8905 *) dflt="$scriptdir"
8910 Some installations have a separate directory just for executable scripts so
8911 that they can mount it across multiple architectures but keep the scripts in
8912 one spot. You might, for example, have a subdirectory of /usr/share for this.
8913 Or you might just lump your scripts in with all your other executables.
8917 rp='Where do you keep publicly executable scripts?'
8919 if $test "X$ansexp" != "X$scriptdirexp"; then
8925 : A little fix up for an irregularly named variable.
8926 installscript="$installscriptdir"
8928 : determine where add-on public executables go
8930 '') dflt=$siteprefix/bin ;;
8934 rp='Pathname where the add-on public executables should be installed?'
8939 : determine where add-on html pages go
8940 : There is no standard location, so try to copy the previously-selected
8941 : directory structure for the core html pages.
8942 case "$sitehtml1dir" in
8943 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8944 *) dflt=$sitehtml1dir ;;
8947 ''|' ') dflt=none ;;
8950 rp='Pathname where the site-specific html pages should be installed?'
8952 prefixvar=sitehtml1dir
8955 : determine where add-on library html pages go
8956 : There is no standard location, so try to copy the previously-selected
8957 : directory structure for the core html pages.
8958 case "$sitehtml3dir" in
8959 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8960 *) dflt=$sitehtml3dir ;;
8963 ''|' ') dflt=none ;;
8966 rp='Pathname where the site-specific library html pages should be installed?'
8968 prefixvar=sitehtml3dir
8971 : determine where add-on manual pages go
8972 case "$siteman1dir" in
8973 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8974 *) dflt=$siteman1dir ;;
8977 ''|' ') dflt=none ;;
8980 rp='Pathname where the site-specific manual pages should be installed?'
8982 prefixvar=siteman1dir
8985 : determine where add-on library man pages go
8986 case "$siteman3dir" in
8987 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8988 *) dflt=$siteman3dir ;;
8991 ''|' ') dflt=none ;;
8994 rp='Pathname where the site-specific library manual pages should be installed?'
8996 prefixvar=siteman3dir
8999 : determine where add-on public executable scripts go
9000 case "$sitescript" in
9001 '') dflt=$siteprefix/script
9002 $test -d $dflt || dflt=$sitebin ;;
9003 *) dflt="$sitescript" ;;
9006 rp='Pathname where add-on public executable scripts should be installed?'
9008 prefixvar=sitescript
9011 : Check if faststdio is requested and available
9012 case "$usefaststdio" in
9013 $define|true|[yY]*|'')
9014 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9024 Perl can be built to use 'fast stdio', which means using the stdio
9025 library but also directly manipulating the stdio buffers to enable
9026 faster I/O. Using stdio is better for backward compatibility (especially
9027 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9028 interface has been preferred instead of stdio.
9030 If this doesn't make any sense to you, just accept the default '$dflt'.
9032 rp='Use the "fast stdio" if available?'
9035 y|Y) val="$define" ;;
9042 : define an is-a-typedef? function
9043 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9045 "") inclist="sys/types.h";;
9047 eval "varval=\$$var";
9051 for inc in $inclist; do
9052 echo "#include <$inc>" >>temp.c;
9054 echo "#ifdef $type" >> temp.c;
9055 echo "printf(\"We have $type\");" >> temp.c;
9056 echo "#endif" >> temp.c;
9057 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9058 if $contains $type temp.E >/dev/null 2>&1; then
9064 *) eval "$var=\$varval";;
9067 : define an is-a-typedef? function that prompts if the type is not available.
9068 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9070 "") inclist="sys/types.h";;
9072 eval "varval=\$$var";
9076 for inc in $inclist; do
9077 echo "#include <$inc>" >>temp.c;
9079 echo "#ifdef $type" >> temp.c;
9080 echo "printf(\"We have $type\");" >> temp.c;
9081 echo "#endif" >> temp.c;
9082 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9084 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9085 if $contains $type temp.E >/dev/null 2>&1; then
9086 echo "$type found." >&4;
9089 echo "$type NOT found." >&4;
9095 *) eval "$var=\$varval";;
9098 : see what type lseek is declared as in the kernel
9099 rp="What is the type used for lseek's offset on this system?"
9100 set off_t lseektype long stdio.h sys/types.h
9104 echo "Checking to see how big your file offsets are..." >&4
9106 #include <sys/types.h>
9110 printf("%d\n", (int)sizeof($lseektype));
9115 if eval $compile_ok; then
9116 lseeksize=`$run ./try`
9117 echo "Your file offsets are $lseeksize bytes long."
9121 echo "(I can't seem to compile the test program. Guessing...)"
9122 rp="What is the size of your file offsets (in bytes)?"
9128 : see what type file positions are declared as in the library
9129 rp="What is the type for file position used by fsetpos()?"
9130 set fpos_t fpostype long stdio.h sys/types.h
9133 : Check size for Fpos_t
9136 *_t) zzz="$fpostype" ;;
9139 echo "Checking the size of $zzz..." >&4
9141 #include <sys/types.h>
9148 printf("%d\n", (int)sizeof($fpostype));
9153 if eval $compile_ok; then
9157 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9160 echo "Your $zzz is $fpossize bytes long."
9166 echo "(I can't compile the test program. Guessing...)" >&4
9167 rp="What is the size of your file positions (in bytes)?"
9172 : Check for large file support
9173 # Backward compatibility (uselfs is deprecated).
9175 "$define"|true|[yY]*)
9178 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9180 uselargefiles="$define"
9184 case "$lseeksize:$fpossize" in
9187 You can have files larger than 2 gigabytes.
9190 *) case "$uselargefiles" in
9191 "$undef"|false|[nN]*) dflt='n' ;;
9196 Perl can be built to understand large files (files larger than 2 gigabytes)
9197 on some systems. To do so, Configure can be run with -Duselargefiles.
9199 If this doesn't make any sense to you, just accept the default '$dflt'.
9201 rp='Try to understand large files, if available?'
9204 y|Y) val="$define" ;;
9211 : Look for a hint-file generated 'call-back-unit'. If the
9212 : user has specified that a large files perl is to be built,
9213 : we may need to set or change some other defaults.
9214 if $test -f uselargefiles.cbu; then
9215 echo "Your platform has some specific hints regarding large file builds, using them..."
9216 . ./uselargefiles.cbu
9218 case "$uselargefiles" in
9220 if $test -f uselargefiles.cbu; then
9222 echo "Rechecking to see how big your file offsets are..." >&4
9224 #include <sys/types.h>
9228 printf("%d\n", (int)sizeof($lseektype));
9233 if eval $compile_ok; then
9234 lseeksize=`$run ./try`
9235 $echo "Your file offsets are now $lseeksize bytes long."
9239 echo "(I can't seem to compile the test program. Guessing...)"
9240 rp="What is the size of your file offsets (in bytes)?"
9245 *_t) zzz="$fpostype" ;;
9248 $echo $n "Rechecking the size of $zzz...$c" >&4
9250 #include <sys/types.h>
9257 printf("%d\n", (int)sizeof($fpostype));
9262 if eval $compile_ok; then
9267 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9270 echo " $fpossize bytes." >&4
9276 echo "(I can't compile the test program. Guessing...)" >&4
9277 rp="What is the size of your file positions (in bytes)?"
9286 : Set the vendorbin variables
9287 case "$vendorprefix" in
9288 '') d_vendorbin="$undef"
9292 *) d_vendorbin="$define"
9293 : determine where vendor-supplied executables go.
9294 case "$vendorbin" in
9295 '') dflt=$vendorprefix/bin ;;
9296 *) dflt="$vendorbin" ;;
9299 rp='Pathname for the vendor-supplied executables directory?'
9302 vendorbinexp="$ansexp"
9308 : Set the vendorhtml1dir variables
9309 case "$vendorprefix" in
9310 '') vendorhtml1dir=''
9311 vendorhtml1direxp=''
9313 *) : determine where vendor-supplied html pages go.
9314 : There is no standard location, so try to copy the previously-selected
9315 : directory structure for the core html pages.
9316 : XXX Better default suggestions would be welcome.
9317 case "$vendorhtml1dir" in
9318 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9319 *) dflt=$vendorhtml1dir ;;
9322 ''|' ') dflt=none ;;
9325 rp='Pathname for the vendor-supplied html pages?'
9327 vendorhtml1dir="$ans"
9328 vendorhtml1direxp="$ansexp"
9331 : Use ' ' for none so value is preserved next time through Configure
9332 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9333 prefixvar=vendorhtml1dir
9336 : Set the vendorhtml3dir variables
9337 case "$vendorprefix" in
9338 '') vendorhtml3dir=''
9339 vendorhtml3direxp=''
9341 *) : determine where vendor-supplied module html pages go.
9342 : There is no standard location, so try to copy the previously-selected
9343 : directory structure for the core html pages.
9344 : XXX Better default suggestions would be welcome.
9345 case "$vendorhtml3dir" in
9346 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9347 *) dflt=$vendorhtml3dir ;;
9350 ''|' ') dflt=none ;;
9353 rp='Pathname for the vendor-supplied html pages?'
9355 vendorhtml3dir="$ans"
9356 vendorhtml3direxp="$ansexp"
9359 : Use ' ' for none so value is preserved next time through Configure
9360 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9361 prefixvar=vendorhtml3dir
9364 : Set the vendorman1dir variables
9365 case "$vendorprefix" in
9366 '') vendorman1dir=''
9369 *) : determine where vendor-supplied manual pages go.
9370 case "$vendorman1dir" in
9371 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9372 *) dflt=$vendorman1dir ;;
9375 ''|' ') dflt=none ;;
9378 rp='Pathname for the vendor-supplied manual section 1 pages?'
9380 vendorman1dir="$ans"
9381 vendorman1direxp="$ansexp"
9384 : Use ' ' for none so value is preserved next time through Configure
9385 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9386 prefixvar=vendorman1dir
9389 : Set the vendorman3dir variables
9390 case "$vendorprefix" in
9391 '') vendorman3dir=''
9394 *) : determine where vendor-supplied module manual pages go.
9395 case "$vendorman3dir" in
9396 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9397 *) dflt=$vendorman3dir ;;
9400 ''|' ') dflt=none ;;
9403 rp='Pathname for the vendor-supplied manual section 3 pages?'
9405 vendorman3dir="$ans"
9406 vendorman3direxp="$ansexp"
9409 : Use ' ' for none so value is preserved next time through Configure
9410 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9411 prefixvar=vendorman3dir
9414 : Set the vendorscript variables
9415 case "$vendorprefix" in
9416 '') d_vendorscript="$undef"
9420 *) d_vendorscript="$define"
9421 : determine where vendor-supplied scripts go.
9422 case "$vendorscript" in
9423 '') dflt=$vendorprefix/script
9424 $test -d $dflt || dflt=$vendorbin ;;
9425 *) dflt="$vendorscript" ;;
9429 The installation process will create a directory for
9430 vendor-supplied scripts.
9434 rp='Pathname for the vendor-supplied scripts directory?'
9437 vendorscriptexp="$ansexp"
9440 prefixvar=vendorscript
9443 : see if qgcvt exists
9447 : Check print/scan long double stuff
9450 if $test X"$d_longdbl" = X"$define"; then
9452 echo "Checking how to print long doubles..." >&4
9454 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9455 $cat >try.c <<'EOCP'
9456 #include <sys/types.h>
9460 printf("%.3f\n", d);
9464 if eval $compile; then
9468 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9469 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9470 echo "We will use %f."
9476 if $test X"$sPRIfldbl" = X; then
9477 $cat >try.c <<'EOCP'
9478 #include <sys/types.h>
9481 long double d = 123.456;
9482 printf("%.3Lf\n", d);
9486 if eval $compile; then
9490 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9491 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9492 echo "We will use %Lf."
9498 if $test X"$sPRIfldbl" = X; then
9499 $cat >try.c <<'EOCP'
9500 #include <sys/types.h>
9503 long double d = 123.456;
9504 printf("%.3llf\n", d);
9508 if eval $compile; then
9512 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9513 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9514 echo "We will use %llf."
9520 if $test X"$sPRIfldbl" = X; then
9521 $cat >try.c <<'EOCP'
9522 #include <sys/types.h>
9525 long double d = 123.456;
9526 printf("%.3lf\n", d);
9530 if eval $compile; then
9534 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9535 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9536 echo "We will use %lf."
9542 if $test X"$sPRIfldbl" = X; then
9543 echo "Cannot figure out how to print long doubles." >&4
9545 sSCNfldbl=$sPRIfldbl # expect consistency
9552 case "$sPRIfldbl" in
9553 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9554 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9555 d_SCNfldbl="$undef";
9557 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9558 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9559 d_SCNfldbl="$define";
9563 : Check how to convert floats to strings.
9565 if test "X$d_Gconvert" = X; then
9568 echo "Checking for an efficient way to convert floats to strings."
9570 case "$uselongdouble" in
9571 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9573 case "$d_longdbl" in
9574 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9576 case "$d_PRIgldbl" in
9577 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9581 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9582 char *myname = "gconvert";
9585 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9586 char *myname = "gcvt";
9589 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9590 char *myname = "qgcvt";
9591 #define DOUBLETYPE long double
9594 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9596 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9598 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9601 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9603 char *myname = "sprintf";
9607 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9608 #define DOUBLETYPE long double
9610 #define DOUBLETYPE double
9616 #define I_STDLIB $i_stdlib
9622 checkit(expect, got)
9626 if (strcmp(expect, got)) {
9627 printf("%s oddity: Expected %s, got %s\n",
9628 myname, expect, got);
9638 /* This must be 1st test on (which?) platform */
9639 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9640 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9641 checkit("0.1", buf);
9643 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9644 checkit("0.01", buf);
9646 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9647 checkit("0.001", buf);
9649 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9650 checkit("0.0001", buf);
9652 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9653 if (strlen(buf) > 5)
9654 checkit("9e-005", buf); /* for Microsoft ?? */
9656 checkit("9e-05", buf);
9658 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9661 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9662 checkit("1.1", buf);
9664 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9665 checkit("1.01", buf);
9667 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9668 checkit("1.001", buf);
9670 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9671 checkit("1.0001", buf);
9673 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9674 checkit("1.00001", buf);
9676 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9677 checkit("1.000001", buf);
9679 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9682 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9685 /* Some Linux gcvt's give 1.e+5 here. */
9686 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9687 checkit("100000", buf);
9689 /* Some Linux gcvt's give -1.e+5 here. */
9690 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9691 checkit("-100000", buf);
9693 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9694 checkit("123.456", buf);
9696 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9697 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9698 /* 34 should be enough to scare even long double
9699 * places into using the e notation. */
9700 if (strlen(buf) > 5)
9701 checkit("1e+034", buf); /* for Microsoft */
9703 checkit("1e+34", buf);
9705 /* For Perl, if you add additional tests here, also add them to
9706 * t/base/num.t for benefit of platforms not using Configure or
9707 * overriding d_Gconvert */
9712 : first add preferred functions to our list
9714 for xxx_convert in $gconvert_preference; do
9715 case $xxx_convert in
9716 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9717 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9720 : then add any others
9721 for xxx_convert in gconvert gcvt sprintf; do
9724 *) xxx_list="$xxx_list $xxx_convert" ;;
9728 case "$d_longdbl$uselongdouble" in
9730 : again, add prefered functions to our list first
9732 for xxx_convert in $gconvert_ld_preference; do
9733 case $xxx_convert in
9734 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9735 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9738 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9739 for xxx_convert in qgcvt sprintf $xxx_list; do
9740 case "$xxx_ld_list" in
9741 $xxx_convert*|*" $xxx_convert"*) ;;
9742 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9745 : if sprintf cannot do long doubles, move it to the end
9746 if test "$d_PRIgldbl" != "$define"; then
9747 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9749 : if no qgcvt, remove it
9750 if test "$d_qgcvt" != "$define"; then
9751 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9754 xxx_list="$xxx_ld_list"
9758 for xxx_convert in $xxx_list; do
9759 echo "Trying $xxx_convert..."
9760 $rm -f try try$_o core
9761 set try -DTRY_$xxx_convert
9762 if eval $compile; then
9763 echo "$xxx_convert() found." >&4
9765 echo "I'll use $xxx_convert to convert floats into a string." >&4
9768 echo "...But $xxx_convert didn't work as I expected."
9772 echo "$xxx_convert NOT found." >&4
9776 if test X$xxx_convert = X; then
9777 echo "*** WHOA THERE!!! ***" >&4
9778 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9782 case "$xxx_convert" in
9783 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9784 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9785 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9786 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9787 "$define$define$define")
9788 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9789 "$define$define$undef")
9790 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9791 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9799 : see if _fwalk exists
9803 : Initialize h_fcntl
9806 : Initialize h_sysfile
9809 : access call always available on UNIX
9813 : locate the flags for 'access()'
9817 $cat >access.c <<EOCP
9818 #include <sys/types.h>
9823 #include <sys/file.h>
9836 : check sys/file.h first, no particular reason here
9837 if $test `./findhdr sys/file.h` && \
9838 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9840 echo "<sys/file.h> defines the *_OK access constants." >&4
9841 elif $test `./findhdr fcntl.h` && \
9842 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9844 echo "<fcntl.h> defines the *_OK access constants." >&4
9845 elif $test `./findhdr unistd.h` && \
9846 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9847 echo "<unistd.h> defines the *_OK access constants." >&4
9849 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9855 : see if accessx exists
9856 set accessx d_accessx
9859 : see if aintl exists
9863 : see if alarm exists
9867 : see if POSIX threads are available
9868 set pthread.h i_pthread
9871 : define a fucntion to check prototypes
9872 $cat > protochk <<EOSH
9875 optimize="$optimize"
9877 prototype="$prototype"
9880 usethreads=$usethreads
9881 i_pthread=$i_pthread
9882 pthread_h_first=$pthread_h_first
9885 $cat >> protochk <<'EOSH'
9890 while test $# -ge 2; do
9892 $define) echo "#include <$2>" >> try.c ;;
9893 literal) echo "$2" >> try.c ;;
9895 # Extra magic for the benefit of systems that need pthread.h
9896 # to be included early to correctly detect threadsafe functions.
9897 # Such functions must guarantee themselves, though, that the usethreads
9898 # and i_pthread have been defined, before calling protochk.
9899 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9900 echo "#include <pthread.h>" >> try.c
9905 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9906 cat >> try.c <<'EOCP'
9907 #ifdef CAN_PROTOTYPE
9908 #define _(args) args
9913 echo "$foo" >> try.c
9914 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9915 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9923 : Define hasproto macro for Configure internal use
9924 hasproto='varname=$1; func=$2; shift; shift;
9925 while $test $# -ge 2; do
9927 $define) echo "#include <$2>";;
9931 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9932 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9933 echo "$func() prototype found.";
9936 echo "$func() prototype NOT found.";
9943 : see if sys/types.h has to be included
9944 set sys/types.h i_systypes
9947 : see if sys/select.h has to be included
9948 set sys/select.h i_sysselct
9951 : Define hasfield macro for Configure internal use
9952 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9953 while $test $# -ge 2; do
9955 $define) echo "#include <$2>";;
9959 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9961 if eval $compile; then
9970 : see if we should include time.h, sys/time.h, or both
9972 if test "X$timeincl" = X; then
9973 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9974 $echo $n "I'm now running the test program...$c"
9976 #include <sys/types.h>
9981 #ifdef SYSTIMEKERNEL
9984 #include <sys/time.h>
9987 #include <sys/select.h>
10000 struct timezone tzp;
10002 if (foo.tm_sec == foo.tm_sec)
10005 if (bar.tv_sec == bar.tv_sec)
10012 for s_timezone in '-DS_TIMEZONE' ''; do
10014 for s_timeval in '-DS_TIMEVAL' ''; do
10015 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10016 for i_time in '' '-DI_TIME'; do
10017 for i_systime in '-DI_SYSTIME' ''; do
10020 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10021 if eval $compile; then
10022 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10026 $echo $n "Succeeded with $flags$c"
10038 *SYSTIMEKERNEL*) i_systimek="$define"
10039 timeincl=`./findhdr sys/time.h`
10040 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10041 *) i_systimek="$undef";;
10044 *I_TIME*) i_time="$define"
10045 timeincl=`./findhdr time.h`" $timeincl"
10046 echo "We'll include <time.h>." >&4;;
10047 *) i_time="$undef";;
10050 *I_SYSTIME*) i_systime="$define"
10051 timeincl=`./findhdr sys/time.h`" $timeincl"
10052 echo "We'll include <sys/time.h>." >&4;;
10053 *) i_systime="$undef";;
10057 : see if struct tm knows about tm_zone
10058 case "$i_systime$i_time" in
10061 echo "Checking to see if your struct tm has tm_zone field..." >&4
10062 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10070 case "$d_tm_tm_zone" in
10071 "$define") echo "Yes, it does." ;;
10072 *) echo "No, it doesn't." ;;
10074 : see if struct tm knows about tm_gmtoff
10075 case "$i_systime$i_time" in
10078 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10079 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10087 case "$d_tm_tm_gmtoff" in
10088 "$define") echo "Yes, it does." ;;
10089 *) echo "No, it doesn't." ;;
10092 : see if asctime_r exists
10093 set asctime_r d_asctime_r
10095 case "$d_asctime_r" in
10097 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10098 case "$d_asctime_r_proto:$usethreads" in
10099 ":define") d_asctime_r_proto=define
10100 set d_asctime_r_proto asctime_r $hdrs
10104 case "$d_asctime_r_proto" in
10106 case "$asctime_r_proto" in
10107 ''|0) try='char* asctime_r(const struct tm*, char*);'
10108 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10110 case "$asctime_r_proto" in
10111 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10112 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10114 case "$asctime_r_proto" in
10115 ''|0) try='int asctime_r(const struct tm*, char*);'
10116 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10118 case "$asctime_r_proto" in
10119 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10120 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10122 case "$asctime_r_proto" in
10123 ''|0) d_asctime_r=undef
10125 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10126 * ) case "$asctime_r_proto" in
10127 REENTRANT_PROTO*) ;;
10128 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10130 echo "Prototype: $try" ;;
10133 *) case "$usethreads" in
10134 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10141 *) asctime_r_proto=0
10145 : see if atolf exists
10149 : see if atoll exists
10153 : Look for GCC-style attribute format
10154 case "$d_attribute_format" in
10157 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10158 $cat >attrib.c <<'EOCP'
10160 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10162 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10163 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10164 echo "Your C compiler doesn't support __attribute__((format))."
10167 echo "Your C compiler supports __attribute__((format))."
10171 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10175 *) val="$d_attribute_format" ;;
10177 set d_attribute_format
10181 : Look for GCC-style attribute format with null format allowed
10182 case "$d_printf_format_null" in
10183 '') case "$d_attribute_format" in
10186 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10187 $cat >attrib.c <<EOCP
10189 #$i_stdlib I_STDLIB
10191 #include <stdlib.h>
10193 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10194 int null_printf (char* pat,...) { return (int)pat; }
10195 int main () { exit(null_printf(NULL)); }
10197 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10198 : run the executable in case it produces a run-time warning
10199 if $run ./attrib >>attrib.out 2>&1; then
10200 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10201 echo "Your C compiler doesn't allow __printf__ format to be null."
10204 echo "Your C compiler allows __printf__ format to be null."
10208 echo "Your C compiler executable failed with __printf__ format null."
10212 echo "Your C compiler fails with __printf__ format null."
10219 *) val="$d_printf_format_null" ;;
10221 set d_printf_format_null
10225 : Look for GCC-style attribute malloc
10226 case "$d_attribute_malloc" in
10229 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10230 $cat >attrib.c <<'EOCP'
10232 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10234 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10235 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10236 echo "Your C compiler doesn't support __attribute__((malloc))."
10239 echo "Your C compiler supports __attribute__((malloc))."
10243 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10247 *) val="$d_attribute_malloc" ;;
10249 set d_attribute_malloc
10253 : Look for GCC-style attribute nonnull
10254 case "$d_attribute_nonnull" in
10257 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10258 $cat >attrib.c <<'EOCP'
10260 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10262 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10263 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10264 echo "Your C compiler doesn't support __attribute__((nonnull))."
10267 echo "Your C compiler supports __attribute__((nonnull))."
10271 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10275 *) val="$d_attribute_nonnull" ;;
10277 set d_attribute_nonnull
10281 : Look for GCC-style attribute noreturn
10282 case "$d_attribute_noreturn" in
10285 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10286 $cat >attrib.c <<'EOCP'
10288 void fall_over_dead( void ) __attribute__((noreturn));
10290 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10291 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10292 echo "Your C compiler doesn't support __attribute__((noreturn))."
10295 echo "Your C compiler supports __attribute__((noreturn))."
10299 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10303 *) val="$d_attribute_noreturn" ;;
10305 set d_attribute_noreturn
10309 : Look for GCC-style attribute pure
10310 case "$d_attribute_pure" in
10313 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10314 $cat >attrib.c <<'EOCP'
10316 int square( int n ) __attribute__((pure));
10318 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10319 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10320 echo "Your C compiler doesn't support __attribute__((pure))."
10323 echo "Your C compiler supports __attribute__((pure))."
10327 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10331 *) val="$d_attribute_pure" ;;
10333 set d_attribute_pure
10337 : Look for GCC-style attribute unused
10338 case "$d_attribute_unused" in
10341 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10342 $cat >attrib.c <<'EOCP'
10344 int do_something( int dummy __attribute__((unused)), int n );
10346 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10347 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10348 echo "Your C compiler doesn't support __attribute__((unused))."
10351 echo "Your C compiler supports __attribute__((unused))."
10355 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10359 *) val="$d_attribute_unused" ;;
10361 set d_attribute_unused
10365 : Look for GCC-style attribute warn_unused_result
10366 case "$d_attribute_warn_unused_result" in
10369 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10370 $cat >attrib.c <<'EOCP'
10372 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10374 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10375 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10376 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10379 echo "Your C compiler supports __attribute__((warn_unused_result))."
10383 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10387 *) val="$d_attribute_warn_unused_result" ;;
10389 set d_attribute_warn_unused_result
10393 : see if bcmp exists
10397 : see if bcopy exists
10401 : see if getpgrp exists
10402 set getpgrp d_getpgrp
10405 case "$d_getpgrp" in
10408 echo "Checking to see which flavor of getpgrp is in use..."
10410 #$i_unistd I_UNISTD
10411 #include <sys/types.h>
10413 # include <unistd.h>
10415 #$i_stdlib I_STDLIB
10417 #include <stdlib.h>
10421 if (getuid() == 0) {
10422 printf("(I see you are running Configure as super-user...)\n");
10425 #ifdef TRY_BSD_PGRP
10426 if (getpgrp(1) == 0)
10435 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10436 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10438 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10439 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10442 echo "I can't seem to compile and run the test program."
10444 xxx="a USG one, i.e. you use getpgrp()."
10446 # SVR4 systems can appear rather BSD-ish.
10447 case "$i_unistd" in
10449 xxx="a BSD one, i.e. you use getpgrp(pid)."
10453 xxx="probably a USG one, i.e. you use getpgrp()."
10458 echo "Assuming your getpgrp is $xxx" >&4
10467 : see if setpgrp exists
10468 set setpgrp d_setpgrp
10471 case "$d_setpgrp" in
10474 echo "Checking to see which flavor of setpgrp is in use..."
10476 #$i_unistd I_UNISTD
10477 #include <sys/types.h>
10479 # include <unistd.h>
10481 #$i_stdlib I_STDLIB
10483 #include <stdlib.h>
10487 if (getuid() == 0) {
10488 printf("(I see you are running Configure as super-user...)\n");
10491 #ifdef TRY_BSD_PGRP
10492 if (-1 == setpgrp(1, 1))
10495 if (setpgrp() != -1)
10501 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10502 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10504 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10505 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10508 echo "(I can't seem to compile and run the test program.)"
10510 xxx="a USG one, i.e. you use setpgrp()."
10512 # SVR4 systems can appear rather BSD-ish.
10513 case "$i_unistd" in
10515 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10519 xxx="probably a USG one, i.e. you use setpgrp()."
10524 echo "Assuming your setpgrp is $xxx" >&4
10533 : Look for GCC-style __builtin_choose_expr
10534 case "$d_builtin_choose_expr" in
10537 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10538 $cat >try.c <<'EOCP'
10539 #include <assert.h>
10540 #include <stdlib.h>
10543 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10546 assert( SYRINX(1) == 2112 );
10547 assert( SYRINX(1) != 5150 );
10548 assert( SYRINX(0) == 5150 );
10549 assert( SYRINX(0) != 2112 );
10550 puts( "All good!" );
10556 if eval $compile; then
10557 echo "Your C compiler supports __builtin_choose_expr."
10560 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10564 *) val="$d_builtin_choose_expr" ;;
10567 set d_builtin_choose_expr
10571 : Look for GCC-style __builtin_expect
10572 case "$d_builtin_expect" in
10575 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10576 $cat >builtin.c <<'EOCP'
10579 if ( __builtin_expect(n, 0) ) n = 1;
10583 if eval $compile; then
10584 echo "Your C compiler supports __builtin_choose_expr."
10587 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10591 *) val="$d_builtin_expect" ;;
10594 set d_builtin_expect
10598 : see if bzero exists
10602 : see if stdarg is available
10604 if $test `./findhdr stdarg.h`; then
10605 echo "<stdarg.h> found." >&4
10608 echo "<stdarg.h> NOT found." >&4
10612 : see if varags is available
10614 if $test `./findhdr varargs.h`; then
10615 echo "<varargs.h> found." >&4
10617 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10620 : set up the varargs testing programs
10621 $cat > varargs.c <<EOP
10623 #include <stdarg.h>
10626 #include <varargs.h>
10630 int f(char *p, ...)
10644 p = va_arg(ap, char *);
10650 $cat > varargs <<EOP
10652 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10661 : now check which varargs header should be included
10666 if `./varargs I_STDARG`; then
10668 elif `./varargs I_VARARGS`; then
10673 if `./varargs I_VARARGS`; then
10680 echo "I could not find the definition for va_dcl... You have problems..." >&4
10681 val="$undef"; set i_stdarg; eval $setvar
10682 val="$undef"; set i_varargs; eval $setvar
10687 case "$i_varhdr" in
10689 val="$define"; set i_stdarg; eval $setvar
10690 val="$undef"; set i_varargs; eval $setvar
10693 val="$undef"; set i_stdarg; eval $setvar
10694 val="$define"; set i_varargs; eval $setvar
10697 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10701 : see if the Compiler supports C99 variadic macros
10702 case "$i_stdarg$i_stdlib" in
10704 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10707 #include <stdarg.h>
10709 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10713 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10719 if eval $compile && $run ./try 2>&1 >/dev/null; then
10720 case "`$run ./try`" in
10722 echo "You have C99 variadic macros." >&4
10723 d_c99_variadic_macros="$define"
10726 echo "You don't have functional C99 variadic macros." >&4
10727 d_c99_variadic_macros="$undef"
10731 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10732 d_c99_variadic_macros="$undef"
10737 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10738 d_c99_variadic_macros="$undef"
10742 : see if signal is declared as pointer to function returning int or void
10744 xxx=`./findhdr signal.h`
10745 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10746 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10747 echo "You have int (*signal())() instead of void." >&4
10749 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10750 echo "You have void (*signal())()." >&4
10752 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10753 echo "You have int (*signal())() instead of void." >&4
10755 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10756 echo "You have void (*signal())()." >&4
10759 case "$d_voidsig" in
10761 echo "I can't determine whether signal handler returns void or int..." >&4
10763 rp="What type does your signal handler return?"
10766 v*) val="$define";;
10770 echo "As you already told me, signal handler returns void." >&4
10773 *) echo "As you already told me, signal handler returns int." >&4
10780 case "$d_voidsig" in
10781 "$define") signal_t="void";;
10782 *) signal_t="int";;
10786 : check for ability to cast large floats to 32-bit ints.
10788 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10789 if $test "$intsize" -ge 4; then
10796 #$i_stdlib I_STDLIB
10798 #include <stdlib.h>
10800 #include <sys/types.h>
10801 #include <signal.h>
10802 $signal_t blech(int s) { exit(3); }
10809 signal(SIGFPE, blech);
10811 /* Don't let compiler optimize the test away. Store the number
10812 in a writable string for gcc to pass to sscanf under HP/UX.
10814 sprintf(str, "2147483647");
10815 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10819 /* x86 processors will probably give 0x8000 0000, which is a
10820 sign change. We don't want that. We want to mimic SPARC
10821 behavior here, which is to preserve the sign and give
10824 if (i32 != ($xxx) f)
10830 if eval $compile_ok; then
10834 echo "(I can't seem to compile the test program--assuming it can't)"
10839 echo "Yup, it can."
10842 echo "Nope, it can't."
10849 : check for ability to cast negative floats to unsigned
10851 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10854 #$i_stdlib I_STDLIB
10856 #include <stdlib.h>
10858 #include <sys/types.h>
10859 #include <signal.h>
10860 $signal_t blech(int s) { exit(7); }
10861 $signal_t blech_in_list(int s) { exit(4); }
10862 unsigned long dummy_long(unsigned long p) { return p; }
10863 unsigned int dummy_int(unsigned int p) { return p; }
10864 unsigned short dummy_short(unsigned short p) { return p; }
10868 unsigned long along;
10870 unsigned short ashort;
10874 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10875 a direct f = -123. assignment. gcc-2.8.0 reportedly
10876 optimized the whole file away
10878 /* Store the number in a writable string for gcc to pass to
10879 sscanf under HP/UX.
10881 sprintf(str, "-123");
10882 sscanf(str, "%lf", &f); /* f = -123.; */
10884 signal(SIGFPE, blech);
10885 along = (unsigned long)f;
10886 aint = (unsigned int)f;
10887 ashort = (unsigned short)f;
10888 if (along != (unsigned long)-123)
10890 if (aint != (unsigned int)-123)
10892 if (ashort != (unsigned short)-123)
10894 sprintf(str, "1073741824.");
10895 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10898 along = (unsigned long)f;
10899 if (along != 0x80000000)
10903 along = (unsigned long)f;
10904 if (along != 0x7fffffff)
10908 along = (unsigned long)f;
10909 if (along != 0x80000001)
10913 signal(SIGFPE, blech_in_list);
10914 sprintf(str, "123.");
10915 sscanf(str, "%lf", &f); /* f = 123.; */
10916 along = dummy_long((unsigned long)f);
10917 aint = dummy_int((unsigned int)f);
10918 ashort = dummy_short((unsigned short)f);
10919 if (along != (unsigned long)123)
10921 if (aint != (unsigned int)123)
10923 if (ashort != (unsigned short)123)
10930 if eval $compile_ok; then
10934 echo "(I can't seem to compile the test program--assuming it can't)"
10937 case "$castflags" in
10939 echo "Yup, it can."
10942 echo "Nope, it can't."
10949 : see if vprintf exists
10951 if set vprintf val -f d_vprintf; eval $csym; $val; then
10952 echo 'vprintf() found.' >&4
10955 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10956 #$i_varargs I_VARARGS
10958 #$i_stdlib I_STDLIB
10959 #$i_unistd I_UNISTD
10962 # include <stdarg.h>
10963 #else /* I_VARARGS */
10964 # include <varargs.h>
10968 # include <unistd.h>
10972 # include <stdlib.h>
10975 #include <stdio.h> /* vsprintf prototype */
10978 void xxx(int n, ...)
10983 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10985 int main() { xxx(1, "foo"); }
10987 #else /* I_VARARGS */
10995 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10997 int main() { xxx("foo"); }
11003 if eval $compile_ok; then
11004 if $run ./try; then
11005 echo "Your vsprintf() returns (int)." >&4
11008 echo "Your vsprintf() returns (char*)." >&4
11012 echo 'I am unable to compile the vsprintf() test program.' >&4
11013 # We shouldn't get here. If we do, assume the standard signature,
11014 # not the old BSD one.
11015 echo 'Guessing that vsprintf() returns (int).' >&4
11019 echo 'vprintf() NOT found.' >&4
11030 : see if chown exists
11034 : see if chroot exists
11035 set chroot d_chroot
11038 : see if chsize exists
11039 set chsize d_chsize
11042 : see if class exists
11046 : see if clearenv exists
11047 set clearenv d_clearenv
11050 : Define hasstruct macro for Configure internal use
11051 hasstruct='varname=$1; struct=$2; shift; shift;
11052 while $test $# -ge 2; do
11054 $define) echo "#include <$2>";;
11058 echo "int main () { struct $struct foo; }" >> try.c;
11060 if eval $compile; then
11069 : see whether socket exists
11073 $echo $n "Hmm... $c" >&4
11074 if set socket val -f d_socket; eval $csym; $val; then
11075 echo "Looks like you have Berkeley networking support." >&4
11077 if set setsockopt val -f; eval $csym; $val; then
11080 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11081 d_oldsock="$define"
11084 if $contains socklib libc.list >/dev/null 2>&1; then
11085 echo "Looks like you have Berkeley networking support." >&4
11087 : we will have to assume that it supports the 4.2 BSD interface
11090 echo "You don't have Berkeley networking in libc$_a..." >&4
11091 if test "X$d_socket" = "X$define"; then
11092 echo "...but you seem to believe that you have sockets." >&4
11094 for net in net socket
11096 if test -f /usr/lib/lib$net$_a; then
11097 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11098 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11099 if $contains socket libc.list >/dev/null 2>&1; then
11104 echo "...but the Wollongong group seems to have hacked it in." >&4
11105 sockethdr="-I/usr/netinclude"
11108 echo "Found Berkeley sockets interface in lib$net." >&4
11109 if $contains setsockopt libc.list >/dev/null 2>&1; then
11112 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11113 d_oldsock="$define"
11119 if test "X$d_socket" != "X$define"; then
11120 echo "or anywhere else I see." >&4
11128 : see if socketpair exists
11129 set socketpair d_sockpair
11134 echo "Checking the availability of certain socket constants..." >&4
11135 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11136 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11138 #include <sys/types.h>
11139 #include <sys/socket.h>
11145 set try; if eval $compile; then
11148 set d_${enum}; eval $setvar
11152 : see if this is a sys/uio.h system
11153 set sys/uio.h i_sysuio
11156 : Check for cmsghdr support
11158 echo "Checking to see if your system supports struct cmsghdr..." >&4
11159 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11161 case "$d_cmsghdr_s" in
11162 "$define") echo "Yes, it does." ;;
11163 *) echo "No, it doesn't." ;;
11167 : check for const keyword
11169 echo 'Checking to see if your C compiler knows about "const"...' >&4
11170 $cat >const.c <<'EOCP'
11171 typedef struct spug { int drokk; } spug;
11175 const spug y = { 0 };
11178 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11180 echo "Yup, it does."
11183 echo "Nope, it doesn't."
11188 : see if copysignl exists
11189 set copysignl d_copysignl
11192 : see if crypt exists
11197 $define) cryptlib='' ;;
11198 *) if set crypt val -f d_crypt; eval $csym; $val; then
11199 echo 'crypt() found.' >&4
11203 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11204 if $test -z "$cryptlib"; then
11205 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11209 if $test -z "$cryptlib"; then
11210 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11214 if $test -z "$cryptlib"; then
11215 cryptlib=`./loc libcrypt$_a "" $libpth`
11219 if $test -z "$cryptlib"; then
11220 echo 'crypt() NOT found.' >&4
11231 : see if this is a crypt.h system
11232 set crypt.h i_crypt
11235 : see if crypt_r exists
11236 set crypt_r d_crypt_r
11238 case "$d_crypt_r" in
11240 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11241 case "$d_crypt_r_proto:$usethreads" in
11242 ":define") d_crypt_r_proto=define
11243 set d_crypt_r_proto crypt_r $hdrs
11247 case "$d_crypt_r_proto" in
11249 case "$crypt_r_proto" in
11250 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11251 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11253 case "$crypt_r_proto" in
11254 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11255 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11257 case "$crypt_r_proto" in
11258 ''|0) d_crypt_r=undef
11260 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11261 * ) case "$crypt_r_proto" in
11262 REENTRANT_PROTO*) ;;
11263 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11265 echo "Prototype: $try" ;;
11268 *) case "$usethreads" in
11269 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11280 : get csh whereabouts
11282 'csh') val="$undef" ;;
11283 *) val="$define" ;;
11287 : Respect a hint or command line value for full_csh.
11288 case "$full_csh" in
11289 '') full_csh=$csh ;;
11292 : see if ctermid exists
11293 set ctermid d_ctermid
11296 : see if ctermid_r exists
11297 set ctermid_r d_ctermid_r
11299 case "$d_ctermid_r" in
11301 hdrs="$i_systypes sys/types.h define stdio.h "
11302 case "$d_ctermid_r_proto:$usethreads" in
11303 ":define") d_ctermid_r_proto=define
11304 set d_ctermid_r_proto ctermid_r $hdrs
11308 case "$d_ctermid_r_proto" in
11310 case "$ctermid_r_proto" in
11311 ''|0) try='char* ctermid_r(char*);'
11312 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11314 case "$ctermid_r_proto" in
11315 ''|0) d_ctermid_r=undef
11317 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11318 * ) case "$ctermid_r_proto" in
11319 REENTRANT_PROTO*) ;;
11320 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11322 echo "Prototype: $try" ;;
11325 *) case "$usethreads" in
11326 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11333 *) ctermid_r_proto=0
11337 : see if ctime_r exists
11338 set ctime_r d_ctime_r
11340 case "$d_ctime_r" in
11342 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11343 case "$d_ctime_r_proto:$usethreads" in
11344 ":define") d_ctime_r_proto=define
11345 set d_ctime_r_proto ctime_r $hdrs
11349 case "$d_ctime_r_proto" in
11351 case "$ctime_r_proto" in
11352 ''|0) try='char* ctime_r(const time_t*, char*);'
11353 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11355 case "$ctime_r_proto" in
11356 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11357 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11359 case "$ctime_r_proto" in
11360 ''|0) try='int ctime_r(const time_t*, char*);'
11361 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11363 case "$ctime_r_proto" in
11364 ''|0) try='int ctime_r(const time_t*, char*, int);'
11365 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11367 case "$ctime_r_proto" in
11368 ''|0) d_ctime_r=undef
11370 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11371 * ) case "$ctime_r_proto" in
11372 REENTRANT_PROTO*) ;;
11373 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11375 echo "Prototype: $try" ;;
11378 *) case "$usethreads" in
11379 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11390 : see if cuserid exists
11391 set cuserid d_cuserid
11394 : see if this is a limits.h system
11395 set limits.h i_limits
11398 : see if this is a float.h system
11399 set float.h i_float
11402 : See if number of significant digits in a double precision number is known
11404 $cat >dbl_dig.c <<EOM
11405 #$i_limits I_LIMITS
11408 #include <limits.h>
11414 printf("Contains DBL_DIG");
11417 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11418 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11419 echo "DBL_DIG found." >&4
11422 echo "DBL_DIG NOT found." >&4
11429 : see if dbm.h is available
11430 : see if dbmclose exists
11431 set dbmclose d_dbmclose
11434 case "$d_dbmclose" in
11444 *) set rpcsvc/dbm.h i_rpcsvcdbm
11449 *) echo "We won't be including <dbm.h>"
11459 : see if prototype for dbminit is available
11461 set d_dbminitproto dbminit $i_dbm dbm.h
11464 : see if difftime exists
11465 set difftime d_difftime
11468 : see if this is a dirent system
11470 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11472 echo "<dirent.h> found." >&4
11475 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11476 echo "<sys/dir.h> found." >&4
11479 xinc=`./findhdr sys/ndir.h`
11481 echo "<dirent.h> NOT found." >&4
11486 : Look for type of directory structure.
11488 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11490 case "$direntrytype" in
11492 case "$i_dirent" in
11493 $define) guess1='struct dirent' ;;
11494 *) guess1='struct direct' ;;
11497 *) guess1="$direntrytype"
11502 'struct dirent') guess2='struct direct' ;;
11503 *) guess2='struct dirent' ;;
11506 if $contains "$guess1" try.c >/dev/null 2>&1; then
11507 direntrytype="$guess1"
11508 echo "Your directory entries are $direntrytype." >&4
11509 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11510 direntrytype="$guess2"
11511 echo "Your directory entries seem to be $direntrytype." >&4
11513 echo "I don't recognize your system's directory entries." >&4
11514 rp="What type is used for directory entries on this system?"
11517 direntrytype="$ans"
11521 : see if the directory entry stores field length
11523 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11524 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11525 echo "Good, your directory entry keeps length information in d_namlen." >&4
11528 echo "Your directory entry does not know about the d_namlen field." >&4
11535 : Look for DIR.dd_fd
11536 case "$i_dirent" in
11538 echo "Checking to see if DIR has a dd_fd member variable" >&4
11540 #$i_stdlib I_STDLIB
11542 #include <stdlib.h>
11544 #include <dirent.h>
11554 if eval $compile; then
11555 echo "Yes, it does."
11558 echo "No, it does not."
11563 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11571 : see if this is an sysdir system
11572 set sys/dir.h i_sysdir
11575 : see if this is an sysndir system
11576 set sys/ndir.h i_sysndir
11581 $cat >dirfd.c <<EOM
11583 #$i_stdlib I_STDLIB
11585 #include <stdlib.h>
11587 #$i_dirent I_DIRENT /**/
11588 #$i_sysdir I_SYS_DIR /**/
11589 #$i_sysndir I_SYS_NDIR /**/
11590 #$i_systypes I_SYS_TYPES /**/
11591 #if defined(I_SYS_TYPES)
11592 #include <sys/types.h>
11594 #if defined(I_DIRENT)
11595 #include <dirent.h>
11596 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11597 #include <sys/dir.h>
11601 #include <sys/ndir.h>
11605 #include <ndir.h> /* may be wrong in the future */
11607 #include <sys/dir.h>
11613 DIR *dirp = opendir(".");
11614 if (dirfd(dirp) >= 0)
11622 if eval $compile; then
11626 $define) echo "dirfd() found." >&4 ;;
11627 *) echo "dirfd() NOT found." >&4 ;;
11633 : see if dlerror exists
11636 set dlerror d_dlerror
11640 : see if dlfcn is available
11641 set dlfcn.h i_dlfcn
11644 : Check what extension to use for shared libs
11649 On a few systems, the dynamically loaded modules that perl generates and uses
11650 will need a different extension than shared libs. The default will probably
11656 *) dflt="$dlext" ;;
11658 rp='What is the extension of dynamically loaded modules'
11667 : Check if dlsym need a leading underscore
11673 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11674 $cat >dyna.c <<'EOM'
11681 #$i_stdlib I_STDLIB
11683 #include <stdlib.h>
11687 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11689 #include <sys/types.h>
11694 extern int fred() ;
11703 int mode = RTLD_LAZY ;
11705 handle = dlopen("./dyna.$dlext", mode) ;
11706 if (handle == NULL) {
11711 symbol = dlsym(handle, "fred") ;
11712 if (symbol == NULL) {
11713 /* try putting a leading underscore */
11714 symbol = dlsym(handle, "_fred") ;
11715 if (symbol == NULL) {
11728 : Call the object file tmp-dyna.o in case dlext=o.
11729 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11730 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11731 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11732 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11735 1) echo "Test program failed using dlopen." >&4
11736 echo "Perhaps you should not use dynamic loading." >&4;;
11737 2) echo "Test program failed using dlsym." >&4
11738 echo "Perhaps you should not use dynamic loading." >&4;;
11739 3) echo "dlsym needs a leading underscore" >&4
11741 4) echo "dlsym doesn't need a leading underscore." >&4;;
11744 echo "I can't compile and run the test program." >&4
11745 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11750 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11755 : see if drand48_r exists
11756 set drand48_r d_drand48_r
11758 case "$d_drand48_r" in
11760 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11761 case "$d_drand48_r_proto:$usethreads" in
11762 ":define") d_drand48_r_proto=define
11763 set d_drand48_r_proto drand48_r $hdrs
11767 case "$d_drand48_r_proto" in
11769 case "$drand48_r_proto" in
11770 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11771 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11773 case "$drand48_r_proto" in
11774 ''|0) d_drand48_r=undef
11776 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11777 * ) case "$drand48_r_proto" in
11778 REENTRANT_PROTO*) ;;
11779 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11781 echo "Prototype: $try" ;;
11784 *) case "$usethreads" in
11785 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11792 *) drand48_r_proto=0
11796 : see if prototype for drand48 is available
11798 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11801 : see if dup2 exists
11805 : see if eaccess exists
11806 set eaccess d_eaccess
11809 : see if endgrent exists
11810 set endgrent d_endgrent
11813 : see if this is an grp system
11819 xxx=`./findhdr grp.h`
11820 $cppstdin $cppflags $cppminus < $xxx >$$.h
11822 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11834 set d_grpasswd; eval $setvar
11838 : see if endgrent_r exists
11839 set endgrent_r d_endgrent_r
11841 case "$d_endgrent_r" in
11843 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11844 case "$d_endgrent_r_proto:$usethreads" in
11845 ":define") d_endgrent_r_proto=define
11846 set d_endgrent_r_proto endgrent_r $hdrs
11850 case "$d_endgrent_r_proto" in
11852 case "$endgrent_r_proto" in
11853 ''|0) try='int endgrent_r(FILE**);'
11854 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11856 case "$endgrent_r_proto" in
11857 ''|0) try='void endgrent_r(FILE**);'
11858 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11860 case "$endgrent_r_proto" in
11861 ''|0) d_endgrent_r=undef
11863 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11864 * ) case "$endgrent_r_proto" in
11865 REENTRANT_PROTO*) ;;
11866 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11868 echo "Prototype: $try" ;;
11871 *) case "$usethreads" in
11872 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11879 *) endgrent_r_proto=0
11883 : see if endhostent exists
11884 set endhostent d_endhent
11887 : see if this is a netdb.h system
11888 set netdb.h i_netdb
11891 : see if endhostent_r exists
11892 set endhostent_r d_endhostent_r
11894 case "$d_endhostent_r" in
11896 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11897 case "$d_endhostent_r_proto:$usethreads" in
11898 ":define") d_endhostent_r_proto=define
11899 set d_endhostent_r_proto endhostent_r $hdrs
11903 case "$d_endhostent_r_proto" in
11905 case "$endhostent_r_proto" in
11906 ''|0) try='int endhostent_r(struct hostent_data*);'
11907 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11909 case "$endhostent_r_proto" in
11910 ''|0) try='void endhostent_r(struct hostent_data*);'
11911 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11913 case "$endhostent_r_proto" in
11914 ''|0) d_endhostent_r=undef
11915 endhostent_r_proto=0
11916 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11917 * ) case "$endhostent_r_proto" in
11918 REENTRANT_PROTO*) ;;
11919 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11921 echo "Prototype: $try" ;;
11924 *) case "$usethreads" in
11925 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11927 d_endhostent_r=undef
11928 endhostent_r_proto=0
11932 *) endhostent_r_proto=0
11936 : see if endnetent exists
11937 set endnetent d_endnent
11940 : see if endnetent_r exists
11941 set endnetent_r d_endnetent_r
11943 case "$d_endnetent_r" in
11945 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11946 case "$d_endnetent_r_proto:$usethreads" in
11947 ":define") d_endnetent_r_proto=define
11948 set d_endnetent_r_proto endnetent_r $hdrs
11952 case "$d_endnetent_r_proto" in
11954 case "$endnetent_r_proto" in
11955 ''|0) try='int endnetent_r(struct netent_data*);'
11956 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11958 case "$endnetent_r_proto" in
11959 ''|0) try='void endnetent_r(struct netent_data*);'
11960 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11962 case "$endnetent_r_proto" in
11963 ''|0) d_endnetent_r=undef
11964 endnetent_r_proto=0
11965 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11966 * ) case "$endnetent_r_proto" in
11967 REENTRANT_PROTO*) ;;
11968 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11970 echo "Prototype: $try" ;;
11973 *) case "$usethreads" in
11974 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11976 d_endnetent_r=undef
11977 endnetent_r_proto=0
11981 *) endnetent_r_proto=0
11985 : see if endprotoent exists
11986 set endprotoent d_endpent
11989 : see if endprotoent_r exists
11990 set endprotoent_r d_endprotoent_r
11992 case "$d_endprotoent_r" in
11994 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11995 case "$d_endprotoent_r_proto:$usethreads" in
11996 ":define") d_endprotoent_r_proto=define
11997 set d_endprotoent_r_proto endprotoent_r $hdrs
12001 case "$d_endprotoent_r_proto" in
12003 case "$endprotoent_r_proto" in
12004 ''|0) try='int endprotoent_r(struct protoent_data*);'
12005 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12007 case "$endprotoent_r_proto" in
12008 ''|0) try='void endprotoent_r(struct protoent_data*);'
12009 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12011 case "$endprotoent_r_proto" in
12012 ''|0) d_endprotoent_r=undef
12013 endprotoent_r_proto=0
12014 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12015 * ) case "$endprotoent_r_proto" in
12016 REENTRANT_PROTO*) ;;
12017 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12019 echo "Prototype: $try" ;;
12022 *) case "$usethreads" in
12023 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12025 d_endprotoent_r=undef
12026 endprotoent_r_proto=0
12030 *) endprotoent_r_proto=0
12034 : see if endpwent exists
12035 set endpwent d_endpwent
12038 : see if this is a pwd.h system
12044 xxx=`./findhdr pwd.h`
12045 $cppstdin $cppflags $cppminus < $xxx >$$.h
12047 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12055 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12063 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12071 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12079 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12087 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12095 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12103 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12115 set d_pwquota; eval $setvar
12116 set d_pwage; eval $setvar
12117 set d_pwchange; eval $setvar
12118 set d_pwclass; eval $setvar
12119 set d_pwexpire; eval $setvar
12120 set d_pwcomment; eval $setvar
12121 set d_pwgecos; eval $setvar
12122 set d_pwpasswd; eval $setvar
12126 : see if endpwent_r exists
12127 set endpwent_r d_endpwent_r
12129 case "$d_endpwent_r" in
12131 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12132 case "$d_endpwent_r_proto:$usethreads" in
12133 ":define") d_endpwent_r_proto=define
12134 set d_endpwent_r_proto endpwent_r $hdrs
12138 case "$d_endpwent_r_proto" in
12140 case "$endpwent_r_proto" in
12141 ''|0) try='int endpwent_r(FILE**);'
12142 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12144 case "$endpwent_r_proto" in
12145 ''|0) try='void endpwent_r(FILE**);'
12146 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12148 case "$endpwent_r_proto" in
12149 ''|0) d_endpwent_r=undef
12151 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12152 * ) case "$endpwent_r_proto" in
12153 REENTRANT_PROTO*) ;;
12154 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12156 echo "Prototype: $try" ;;
12159 *) case "$usethreads" in
12160 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12167 *) endpwent_r_proto=0
12171 : see if endservent exists
12172 set endservent d_endsent
12175 : see if endservent_r exists
12176 set endservent_r d_endservent_r
12178 case "$d_endservent_r" in
12180 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12181 case "$d_endservent_r_proto:$usethreads" in
12182 ":define") d_endservent_r_proto=define
12183 set d_endservent_r_proto endservent_r $hdrs
12187 case "$d_endservent_r_proto" in
12189 case "$endservent_r_proto" in
12190 ''|0) try='int endservent_r(struct servent_data*);'
12191 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12193 case "$endservent_r_proto" in
12194 ''|0) try='void endservent_r(struct servent_data*);'
12195 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12197 case "$endservent_r_proto" in
12198 ''|0) d_endservent_r=undef
12199 endservent_r_proto=0
12200 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12201 * ) case "$endservent_r_proto" in
12202 REENTRANT_PROTO*) ;;
12203 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12205 echo "Prototype: $try" ;;
12208 *) case "$usethreads" in
12209 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12211 d_endservent_r=undef
12212 endservent_r_proto=0
12216 *) endservent_r_proto=0
12220 : Locate the flags for 'open()'
12223 #include <sys/types.h>
12228 #include <sys/file.h>
12230 #$i_stdlib I_STDLIB
12232 #include <stdlib.h>
12243 : check sys/file.h first to get FREAD on Sun
12244 if $test `./findhdr sys/file.h` && \
12245 set try -DI_SYS_FILE && eval $compile; then
12247 echo "<sys/file.h> defines the O_* constants..." >&4
12248 if $run ./try; then
12249 echo "and you have the 3 argument form of open()." >&4
12252 echo "but not the 3 argument form of open(). Oh, well." >&4
12255 elif $test `./findhdr fcntl.h` && \
12256 set try -DI_FCNTL && eval $compile; then
12258 echo "<fcntl.h> defines the O_* constants..." >&4
12259 if $run ./try; then
12260 echo "and you have the 3 argument form of open()." >&4
12263 echo "but not the 3 argument form of open(). Oh, well." >&4
12268 echo "I can't find the O_* constant definitions! You got problems." >&4
12274 : see which of string.h or strings.h is needed
12276 strings=`./findhdr string.h`
12277 if $test "$strings" && $test -r "$strings"; then
12278 echo "Using <string.h> instead of <strings.h>." >&4
12282 strings=`./findhdr strings.h`
12283 if $test "$strings" && $test -r "$strings"; then
12284 echo "Using <strings.h> instead of <string.h>." >&4
12286 echo "No string header found -- You'll surely have problems." >&4
12291 case "$i_string" in
12292 "$undef") strings=`./findhdr strings.h`;;
12293 *) strings=`./findhdr string.h`;;
12296 : see if this is a sys/file.h system
12301 : do we need to include sys/file.h ?
12305 if $h_sysfile; then
12307 echo "We'll be including <sys/file.h>." >&4
12310 echo "We won't be including <sys/file.h>." >&4
12320 : see if fcntl.h is there
12325 : see if we can include fcntl.h
12331 echo "We'll be including <fcntl.h>." >&4
12334 if $h_sysfile; then
12335 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12337 echo "We won't be including <fcntl.h>." >&4
12349 : see if fork exists
12353 : see if pipe exists
12357 : check for non-blocking I/O stuff
12358 case "$h_sysfile" in
12359 true) echo "#include <sys/file.h>" > head.c;;
12362 true) echo "#include <fcntl.h>" > head.c;;
12363 *) echo "#include <sys/fcntl.h>" > head.c;;
12368 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12369 case "$o_nonblock" in
12371 $cat head.c > try.c
12372 $cat >>try.c <<EOCP
12374 #$i_stdlib I_STDLIB
12376 #include <stdlib.h>
12384 printf("O_NONBLOCK\n");
12388 printf("O_NDELAY\n");
12392 printf("FNDELAY\n");
12399 if eval $compile_ok; then
12400 o_nonblock=`$run ./try`
12401 case "$o_nonblock" in
12402 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12403 *) echo "Seems like we can use $o_nonblock.";;
12406 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12409 *) echo "Using $hint value $o_nonblock.";;
12414 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12417 case "$d_fork:$d_pipe" in
12419 $cat head.c > try.c
12420 $cat >>try.c <<EOCP
12422 #include <sys/types.h>
12423 #include <signal.h>
12425 #$i_stdlib I_STDLIB
12427 #include <stdlib.h>
12433 #define MY_O_NONBLOCK $o_nonblock
12434 #ifndef errno /* XXX need better Configure test */
12437 #$i_unistd I_UNISTD
12439 #include <unistd.h>
12441 #$i_string I_STRING
12443 #include <string.h>
12445 #include <strings.h>
12447 $signal_t blech(int x) { exit(3); }
12449 $cat >> try.c <<'EOCP'
12457 pipe(pd); /* Down: child -> parent */
12458 pipe(pu); /* Up: parent -> child */
12461 close(pd[1]); /* Parent reads from pd[0] */
12462 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12464 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12469 signal(SIGALRM, blech);
12471 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12473 sprintf(string, "%d\n", ret);
12474 write(2, string, strlen(string));
12477 if (errno == EAGAIN) {
12478 printf("EAGAIN\n");
12483 if (errno == EWOULDBLOCK)
12484 printf("EWOULDBLOCK\n");
12487 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12488 sleep(2); /* Give it time to close our pipe */
12490 ret = read(pd[0], buf, 1); /* Should read EOF */
12492 sprintf(string, "%d\n", ret);
12493 write(4, string, strlen(string));
12497 close(pd[0]); /* We write to pd[1] */
12498 close(pu[1]); /* We read from pu[0] */
12499 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12500 close(pd[1]); /* Pipe pd is now fully closed! */
12501 exit(0); /* Bye bye, thank you for playing! */
12505 if eval $compile_ok; then
12506 echo "$startsh" >mtry
12507 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12509 ./mtry >/dev/null 2>&1
12511 0) eagain=`$cat try.out`;;
12512 1) echo "Could not perform non-blocking setting!";;
12513 2) echo "I did a successful read() for something that was not there!";;
12514 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12515 4) echo "Could not find F_SETFL!";;
12516 *) echo "Something terribly wrong happened during testing.";;
12518 rd_nodata=`$cat try.ret`
12519 echo "A read() system call with no data present returns $rd_nodata."
12520 case "$rd_nodata" in
12523 echo "(That's peculiar, fixing that to be -1.)"
12529 echo "Forcing errno EAGAIN on read() with no data available."
12533 echo "Your read() sets errno to $eagain when no data is available."
12536 status=`$cat try.err`
12538 0) echo "And it correctly returns 0 to signal EOF.";;
12539 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12540 *) echo "However, your read() returns '$status' on EOF??";;
12543 if test "$status" = "$rd_nodata"; then
12544 echo "WARNING: you can't distinguish between EOF and no data!"
12548 echo "I can't compile the test program--assuming errno EAGAIN will do."
12552 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12561 echo "Using $hint value $eagain."
12562 echo "Your read() returns $rd_nodata when no data is present."
12563 case "$d_eofnblk" in
12564 "$define") echo "And you can see EOF because read() returns 0.";;
12565 "$undef") echo "But you can't see EOF status from read() returned value.";;
12567 echo "(Assuming you can't see EOF status from read anyway.)"
12573 $rm_try head.c mtry
12575 : see if _ptr and _cnt from stdio act std
12578 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12579 echo "(Looks like you have stdio.h from BSD.)"
12580 case "$stdio_ptr" in
12581 '') stdio_ptr='((fp)->_p)'
12584 *) ptr_lval=$d_stdio_ptr_lval;;
12586 case "$stdio_cnt" in
12587 '') stdio_cnt='((fp)->_r)'
12590 *) cnt_lval=$d_stdio_cnt_lval;;
12592 case "$stdio_base" in
12593 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12595 case "$stdio_bufsiz" in
12596 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12598 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12599 echo "(Looks like you have stdio.h from Linux.)"
12600 case "$stdio_ptr" in
12601 '') stdio_ptr='((fp)->_IO_read_ptr)'
12604 *) ptr_lval=$d_stdio_ptr_lval;;
12606 case "$stdio_cnt" in
12607 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12610 *) cnt_lval=$d_stdio_cnt_lval;;
12612 case "$stdio_base" in
12613 '') stdio_base='((fp)->_IO_read_base)';;
12615 case "$stdio_bufsiz" in
12616 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12619 case "$stdio_ptr" in
12620 '') stdio_ptr='((fp)->_ptr)'
12623 *) ptr_lval=$d_stdio_ptr_lval;;
12625 case "$stdio_cnt" in
12626 '') stdio_cnt='((fp)->_cnt)'
12629 *) cnt_lval=$d_stdio_cnt_lval;;
12631 case "$stdio_base" in
12632 '') stdio_base='((fp)->_base)';;
12634 case "$stdio_bufsiz" in
12635 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12639 : test whether _ptr and _cnt really work
12640 echo "Checking how std your stdio is..." >&4
12643 #$i_stdlib I_STDLIB
12645 #include <stdlib.h>
12647 #define FILE_ptr(fp) $stdio_ptr
12648 #define FILE_cnt(fp) $stdio_cnt
12650 FILE *fp = fopen("try.c", "r");
12653 18 <= FILE_cnt(fp) &&
12654 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12662 if eval $compile && $to try.c; then
12663 if $run ./try; then
12664 echo "Your stdio acts pretty std."
12667 echo "Your stdio isn't very std."
12670 echo "Your stdio doesn't appear very std."
12674 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12675 # direct buffer manipulation no longer works. The Configure tests
12676 # should be changed to correctly detect this, but until then,
12677 # the following check should at least let perl compile and run.
12678 # (This quick fix should be updated before 5.8.1.)
12679 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12680 # A. Dougherty, June 3, 2002.
12681 case "$d_gnulibc" in
12683 case "$gnulibc_version" in
12687 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12696 : Can _ptr be used as an lvalue?
12697 case "$d_stdstdio$ptr_lval" in
12698 $define$define) val=$define ;;
12701 set d_stdio_ptr_lval
12704 : Can _cnt be used as an lvalue?
12705 case "$d_stdstdio$cnt_lval" in
12706 $define$define) val=$define ;;
12709 set d_stdio_cnt_lval
12713 : test whether setting _ptr sets _cnt as a side effect
12714 d_stdio_ptr_lval_sets_cnt="$undef"
12715 d_stdio_ptr_lval_nochange_cnt="$undef"
12716 case "$d_stdio_ptr_lval$d_stdstdio" in
12718 echo "Checking to see what happens if we set the stdio ptr..." >&4
12721 /* Can we scream? */
12722 /* Eat dust sed :-) */
12723 /* In the buffer space, no one can hear you scream. */
12724 #$i_stdlib I_STDLIB
12726 #include <stdlib.h>
12728 #define FILE_ptr(fp) $stdio_ptr
12729 #define FILE_cnt(fp) $stdio_cnt
12730 #include <sys/types.h>
12732 FILE *fp = fopen("try.c", "r");
12737 puts("Fail even to read");
12740 c = getc(fp); /* Read away the first # */
12742 puts("Fail even to read");
12746 18 <= FILE_cnt(fp) &&
12747 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12749 puts("Fail even to read");
12752 ptr = (char*) FILE_ptr(fp);
12753 cnt = (size_t)FILE_cnt(fp);
12755 FILE_ptr(fp) += 42;
12757 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12758 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12761 if (FILE_cnt(fp) <= 20) {
12762 printf ("Fail (<20 chars to test)");
12765 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12766 puts("Fail compare");
12769 if (cnt == FILE_cnt(fp)) {
12770 puts("Pass_unchanged");
12773 if (FILE_cnt(fp) == (cnt - 42)) {
12774 puts("Pass_changed");
12777 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12783 if eval $compile && $to try.c; then
12784 case `$run ./try` in
12786 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12787 d_stdio_ptr_lval_sets_cnt="$define" ;;
12789 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12790 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12792 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12794 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12797 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12803 : see if _base is also standard
12805 case "$d_stdstdio" in
12809 #$i_stdlib I_STDLIB
12811 #include <stdlib.h>
12813 #define FILE_base(fp) $stdio_base
12814 #define FILE_bufsiz(fp) $stdio_bufsiz
12816 FILE *fp = fopen("try.c", "r");
12819 19 <= FILE_bufsiz(fp) &&
12820 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12827 if eval $compile && $to try.c; then
12828 if $run ./try; then
12829 echo "And its _base field acts std."
12832 echo "But its _base field isn't std."
12835 echo "However, it seems to be lacking the _base field."
12843 : see if fast_stdio exists
12845 case "$d_stdstdio:$d_stdio_ptr_lval" in
12847 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12849 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12860 : see if fchdir exists
12861 set fchdir d_fchdir
12864 : see if fchmod exists
12865 set fchmod d_fchmod
12868 : see if fchown exists
12869 set fchown d_fchown
12872 : see if this is an fcntl system
12876 : See if fcntl-based locking works.
12879 #$i_stdlib I_STDLIB
12881 #include <stdlib.h>
12883 #include <unistd.h>
12885 #include <signal.h>
12886 $signal_t blech(int x) { exit(3); }
12888 #if defined(F_SETLK) && defined(F_SETLKW)
12889 struct flock flock;
12891 fd = open("try.c", O_RDONLY);
12892 flock.l_type = F_RDLCK;
12893 flock.l_whence = SEEK_SET;
12894 flock.l_start = flock.l_len = 0;
12895 signal(SIGALRM, blech);
12897 retval = fcntl(fd, F_SETLK, &flock);
12899 (retval < 0 ? exit(2) : exit(0));
12905 echo "Checking if fcntl-based file locking works... "
12909 if eval $compile_ok; then
12910 if $run ./try; then
12911 echo "Yes, it seems to work."
12914 echo "Nope, it didn't work."
12919 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12920 *** This is (almost) impossible.
12921 *** If your NFS lock daemons are not feeling well, something like
12922 *** this may happen, please investigate. Cannot continue, aborting.
12930 echo "I'm unable to compile the test program, so I'll assume not."
12935 echo "Nope, since you don't even have fcntl()."
12938 set d_fcntl_can_lock
12942 : check for fd_set items
12945 Checking to see how well your C compiler handles fd_set and friends ...
12948 #$i_stdlib I_STDLIB
12950 #include <stdlib.h>
12952 #$i_systime I_SYS_TIME
12953 #$i_sysselct I_SYS_SELECT
12954 #$d_socket HAS_SOCKET
12955 #include <sys/types.h>
12957 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12960 #include <sys/time.h>
12962 #ifdef I_SYS_SELECT
12963 #include <sys/select.h>
12972 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12980 if eval $compile; then
12981 d_fds_bits="$define"
12983 echo "Well, your system knows about the normal fd_set typedef..." >&4
12984 if $run ./try; then
12985 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12986 d_fd_macros="$define"
12989 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12991 d_fd_macros="$undef"
12995 Hmm, your compiler has some difficulty with fd_set. Checking further...
12998 if eval $compile; then
12999 d_fds_bits="$undef"
13001 echo "Well, your system has some sort of fd_set available..." >&4
13002 if $run ./try; then
13003 echo "and you have the normal fd_set macros." >&4
13004 d_fd_macros="$define"
13007 but not the normal fd_set macros! Gross! More work for me...
13009 d_fd_macros="$undef"
13012 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13014 d_fds_bits="$undef"
13015 d_fd_macros="$undef"
13020 : see if fgetpos exists
13021 set fgetpos d_fgetpos
13024 : see if finite exists
13025 set finite d_finite
13028 : see if finitel exists
13029 set finitel d_finitel
13032 : see if flock exists
13036 : see if prototype for flock is available
13038 set d_flockproto flock $i_sysfile sys/file.h
13041 : see if fp_class exists
13042 set fp_class d_fp_class
13045 : see if pathconf exists
13046 set pathconf d_pathconf
13049 : see if fpathconf exists
13050 set fpathconf d_fpathconf
13053 : see if fpclass exists
13054 set fpclass d_fpclass
13057 : see if fpclassify exists
13058 set fpclassify d_fpclassify
13061 : see if fpclassl exists
13062 set fpclassl d_fpclassl
13065 : check for fpos64_t
13067 echo "Checking to see if you have fpos64_t..." >&4
13070 int main() { fpos64_t x = 7; }
13073 if eval $compile; then
13075 echo "You have fpos64_t."
13078 echo "You do not have fpos64_t."
13079 case "$fpossize" in
13080 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13087 : see if frexpl exists
13088 set frexpl d_frexpl
13091 : see if this is a sys/param system
13092 set sys/param.h i_sysparam
13095 : see if this is a sys/mount.h system
13096 set sys/mount.h i_sysmount
13099 : Check for fs_data_s
13101 echo "Checking to see if your system supports struct fs_data..." >&4
13102 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13104 case "$d_fs_data_s" in
13105 "$define") echo "Yes, it does." ;;
13106 *) echo "No, it doesn't." ;;
13109 : see if fseeko exists
13110 set fseeko d_fseeko
13112 case "$longsize" in
13113 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13116 : see if fsetpos exists
13117 set fsetpos d_fsetpos
13120 : see if fstatfs exists
13121 set fstatfs d_fstatfs
13124 : see if statvfs exists
13125 set statvfs d_statvfs
13128 : see if fstatvfs exists
13129 set fstatvfs d_fstatvfs
13133 : see if fsync exists
13137 : see if ftello exists
13138 set ftello d_ftello
13140 case "$longsize" in
13141 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13144 : check for a working futimes
13147 echo "Checking if you have a working futimes()" >&4
13150 #include <sys/time.h>
13157 fd = open ("try.c", O_RDWR);
13158 if (-1 == fd) exit (1);
13159 rv = futimes (fd, NULL);
13160 exit (rv == -1 ? errno : 0);
13164 if eval $compile; then
13168 0) echo "Yes, you have" >&4
13169 d_futimes="$define"
13171 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13175 echo "No, it does not (probably harmless)" >&4
13179 : see if getcwd exists
13180 set getcwd d_getcwd
13183 : see if getespwnam exists
13184 set getespwnam d_getespwnam
13187 : see if getfsstat exists
13188 set getfsstat d_getfsstat
13191 : see if getgrent exists
13192 set getgrent d_getgrent
13195 : see if getgrent_r exists
13196 set getgrent_r d_getgrent_r
13198 case "$d_getgrent_r" in
13200 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13201 case "$d_getgrent_r_proto:$usethreads" in
13202 ":define") d_getgrent_r_proto=define
13203 set d_getgrent_r_proto getgrent_r $hdrs
13207 case "$d_getgrent_r_proto" in
13209 case "$getgrent_r_proto" in
13210 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13211 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13213 case "$getgrent_r_proto" in
13214 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13215 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13217 case "$getgrent_r_proto" in
13218 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13219 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13221 case "$getgrent_r_proto" in
13222 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13223 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13225 case "$getgrent_r_proto" in
13226 ''|0) try='int getgrent_r(struct group*, char*, int);'
13227 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13229 case "$getgrent_r_proto" in
13230 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13231 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13233 case "$getgrent_r_proto" in
13234 ''|0) d_getgrent_r=undef
13236 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13237 * ) case "$getgrent_r_proto" in
13238 REENTRANT_PROTO*) ;;
13239 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13241 echo "Prototype: $try" ;;
13244 *) case "$usethreads" in
13245 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13252 *) getgrent_r_proto=0
13256 : see if getgrgid_r exists
13257 set getgrgid_r d_getgrgid_r
13259 case "$d_getgrgid_r" in
13261 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13262 case "$d_getgrgid_r_proto:$usethreads" in
13263 ":define") d_getgrgid_r_proto=define
13264 set d_getgrgid_r_proto getgrgid_r $hdrs
13268 case "$d_getgrgid_r_proto" in
13270 case "$getgrgid_r_proto" in
13271 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13272 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13274 case "$getgrgid_r_proto" in
13275 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13276 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13278 case "$getgrgid_r_proto" in
13279 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13280 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13282 case "$getgrgid_r_proto" in
13283 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13284 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13286 case "$getgrgid_r_proto" in
13287 ''|0) d_getgrgid_r=undef
13289 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13290 * ) case "$getgrgid_r_proto" in
13291 REENTRANT_PROTO*) ;;
13292 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13294 echo "Prototype: $try" ;;
13297 *) case "$usethreads" in
13298 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13305 *) getgrgid_r_proto=0
13309 : see if getgrnam_r exists
13310 set getgrnam_r d_getgrnam_r
13312 case "$d_getgrnam_r" in
13314 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13315 case "$d_getgrnam_r_proto:$usethreads" in
13316 ":define") d_getgrnam_r_proto=define
13317 set d_getgrnam_r_proto getgrnam_r $hdrs
13321 case "$d_getgrnam_r_proto" in
13323 case "$getgrnam_r_proto" in
13324 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13325 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13327 case "$getgrnam_r_proto" in
13328 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13329 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13331 case "$getgrnam_r_proto" in
13332 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13333 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13335 case "$getgrnam_r_proto" in
13336 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13337 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13339 case "$getgrnam_r_proto" in
13340 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13341 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13343 case "$getgrnam_r_proto" in
13344 ''|0) d_getgrnam_r=undef
13346 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13347 * ) case "$getgrnam_r_proto" in
13348 REENTRANT_PROTO*) ;;
13349 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13351 echo "Prototype: $try" ;;
13354 *) case "$usethreads" in
13355 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13362 *) getgrnam_r_proto=0
13366 : see if gethostbyaddr exists
13367 set gethostbyaddr d_gethbyaddr
13370 : see if gethostbyname exists
13371 set gethostbyname d_gethbyname
13374 : see if gethostent exists
13375 set gethostent d_gethent
13378 : see how we will look up host name
13381 if set gethostname val -f d_gethname; eval $csym; $val; then
13382 echo 'gethostname() found.' >&4
13383 d_gethname="$define"
13386 if set uname val -f d_uname; eval $csym; $val; then
13389 uname() was found, but you're running xenix, and older versions of xenix
13390 have a broken uname(). If you don't really know whether your xenix is old
13391 enough to have a broken system call, use the default answer.
13396 "$define") dflt=n;;
13398 rp='Is your uname() broken?'
13401 n*) d_uname="$define"; call=uname;;
13404 echo 'uname() found.' >&4
13411 case "$d_gethname" in
13412 '') d_gethname="$undef";;
13415 '') d_uname="$undef";;
13417 case "$d_uname$d_gethname" in
13422 Every now and then someone has a $call() that lies about the hostname
13423 but can't be fixed for political or economic reasons. If you wish, I can
13424 pretend $call() isn't there and maybe compute hostname at run-time
13425 thanks to the '$phostname' command.
13428 rp="Shall I ignore $call() from now on?"
13431 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13434 case "$phostname" in
13435 '') aphostname='';;
13436 *) case "$aphostname" in
13438 *) set X $phostname
13442 file=`./loc $file $file $pth`
13443 aphostname=`echo $file $*`
13448 case "$d_uname$d_gethname" in
13451 case "$phostname" in
13453 echo "There will be no way for $package to get your hostname." >&4;;
13455 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13459 case "$d_phostname" in
13460 '') d_phostname="$undef";;
13463 : see if gethostbyaddr_r exists
13464 set gethostbyaddr_r d_gethostbyaddr_r
13466 case "$d_gethostbyaddr_r" in
13468 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13469 case "$d_gethostbyaddr_r_proto:$usethreads" in
13470 ":define") d_gethostbyaddr_r_proto=define
13471 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13475 case "$d_gethostbyaddr_r_proto" in
13477 case "$gethostbyaddr_r_proto" in
13478 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13479 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13481 case "$gethostbyaddr_r_proto" in
13482 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13483 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13485 case "$gethostbyaddr_r_proto" in
13486 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13487 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13489 case "$gethostbyaddr_r_proto" in
13490 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13491 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13493 case "$gethostbyaddr_r_proto" in
13494 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13495 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13497 case "$gethostbyaddr_r_proto" in
13498 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13499 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13501 case "$gethostbyaddr_r_proto" in
13502 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13503 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13505 case "$gethostbyaddr_r_proto" in
13506 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13507 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13509 case "$gethostbyaddr_r_proto" in
13510 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13511 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13513 case "$gethostbyaddr_r_proto" in
13514 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13515 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13517 case "$gethostbyaddr_r_proto" in
13518 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13519 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13521 case "$gethostbyaddr_r_proto" in
13522 ''|0) d_gethostbyaddr_r=undef
13523 gethostbyaddr_r_proto=0
13524 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13525 * ) case "$gethostbyaddr_r_proto" in
13526 REENTRANT_PROTO*) ;;
13527 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13529 echo "Prototype: $try" ;;
13532 *) case "$usethreads" in
13533 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13535 d_gethostbyaddr_r=undef
13536 gethostbyaddr_r_proto=0
13540 *) gethostbyaddr_r_proto=0
13544 : see if gethostbyname_r exists
13545 set gethostbyname_r d_gethostbyname_r
13547 case "$d_gethostbyname_r" in
13549 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13550 case "$d_gethostbyname_r_proto:$usethreads" in
13551 ":define") d_gethostbyname_r_proto=define
13552 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13556 case "$d_gethostbyname_r_proto" in
13558 case "$gethostbyname_r_proto" in
13559 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13560 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13562 case "$gethostbyname_r_proto" in
13563 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13564 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13566 case "$gethostbyname_r_proto" in
13567 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13568 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13570 case "$gethostbyname_r_proto" in
13571 ''|0) d_gethostbyname_r=undef
13572 gethostbyname_r_proto=0
13573 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13574 * ) case "$gethostbyname_r_proto" in
13575 REENTRANT_PROTO*) ;;
13576 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13578 echo "Prototype: $try" ;;
13581 *) case "$usethreads" in
13582 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13584 d_gethostbyname_r=undef
13585 gethostbyname_r_proto=0
13589 *) gethostbyname_r_proto=0
13593 : see if gethostent_r exists
13594 set gethostent_r d_gethostent_r
13596 case "$d_gethostent_r" in
13598 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13599 case "$d_gethostent_r_proto:$usethreads" in
13600 ":define") d_gethostent_r_proto=define
13601 set d_gethostent_r_proto gethostent_r $hdrs
13605 case "$d_gethostent_r_proto" in
13607 case "$gethostent_r_proto" in
13608 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13609 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13611 case "$gethostent_r_proto" in
13612 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13613 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13615 case "$gethostent_r_proto" in
13616 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13617 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13619 case "$gethostent_r_proto" in
13620 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13621 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13623 case "$gethostent_r_proto" in
13624 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13625 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13627 case "$gethostent_r_proto" in
13628 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13629 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13631 case "$gethostent_r_proto" in
13632 ''|0) d_gethostent_r=undef
13633 gethostent_r_proto=0
13634 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13635 * ) case "$gethostent_r_proto" in
13636 REENTRANT_PROTO*) ;;
13637 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13639 echo "Prototype: $try" ;;
13642 *) case "$usethreads" in
13643 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13645 d_gethostent_r=undef
13646 gethostent_r_proto=0
13650 *) gethostent_r_proto=0
13654 : see if prototypes for various gethostxxx netdb.h functions are available
13656 set d_gethostprotos gethostent $i_netdb netdb.h
13659 : see if getitimer exists
13660 set getitimer d_getitimer
13663 : see if getlogin exists
13664 set getlogin d_getlogin
13667 : see if getlogin_r exists
13668 set getlogin_r d_getlogin_r
13670 case "$d_getlogin_r" in
13672 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13673 case "$d_getlogin_r_proto:$usethreads" in
13674 ":define") d_getlogin_r_proto=define
13675 set d_getlogin_r_proto getlogin_r $hdrs
13679 case "$d_getlogin_r_proto" in
13681 case "$getlogin_r_proto" in
13682 ''|0) try='int getlogin_r(char*, size_t);'
13683 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13685 case "$getlogin_r_proto" in
13686 ''|0) try='int getlogin_r(char*, int);'
13687 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13689 case "$getlogin_r_proto" in
13690 ''|0) try='char* getlogin_r(char*, size_t);'
13691 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13693 case "$getlogin_r_proto" in
13694 ''|0) try='char* getlogin_r(char*, int);'
13695 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13697 case "$getlogin_r_proto" in
13698 ''|0) d_getlogin_r=undef
13700 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13701 * ) case "$getlogin_r_proto" in
13702 REENTRANT_PROTO*) ;;
13703 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13705 echo "Prototype: $try" ;;
13708 *) case "$usethreads" in
13709 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13716 *) getlogin_r_proto=0
13720 : see if getmnt exists
13721 set getmnt d_getmnt
13724 : see if getmntent exists
13725 set getmntent d_getmntent
13728 : see if getnetbyaddr exists
13729 set getnetbyaddr d_getnbyaddr
13732 : see if getnetbyname exists
13733 set getnetbyname d_getnbyname
13736 : see if getnetent exists
13737 set getnetent d_getnent
13740 : see if getnetbyaddr_r exists
13741 set getnetbyaddr_r d_getnetbyaddr_r
13743 case "$d_getnetbyaddr_r" in
13745 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13746 case "$d_getnetbyaddr_r_proto:$usethreads" in
13747 ":define") d_getnetbyaddr_r_proto=define
13748 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13752 case "$d_getnetbyaddr_r_proto" in
13754 case "$getnetbyaddr_r_proto" in
13755 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13756 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13758 case "$getnetbyaddr_r_proto" in
13759 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13760 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13762 case "$getnetbyaddr_r_proto" in
13763 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13764 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13766 case "$getnetbyaddr_r_proto" in
13767 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13768 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13770 case "$getnetbyaddr_r_proto" in
13771 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13772 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13774 case "$getnetbyaddr_r_proto" in
13775 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13776 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13778 case "$getnetbyaddr_r_proto" in
13779 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13780 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13782 case "$getnetbyaddr_r_proto" in
13783 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13784 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13786 case "$getnetbyaddr_r_proto" in
13787 ''|0) d_getnetbyaddr_r=undef
13788 getnetbyaddr_r_proto=0
13789 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13790 * ) case "$getnetbyaddr_r_proto" in
13791 REENTRANT_PROTO*) ;;
13792 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13794 echo "Prototype: $try" ;;
13797 *) case "$usethreads" in
13798 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13800 d_getnetbyaddr_r=undef
13801 getnetbyaddr_r_proto=0
13805 *) getnetbyaddr_r_proto=0
13809 : see if getnetbyname_r exists
13810 set getnetbyname_r d_getnetbyname_r
13812 case "$d_getnetbyname_r" in
13814 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13815 case "$d_getnetbyname_r_proto:$usethreads" in
13816 ":define") d_getnetbyname_r_proto=define
13817 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13821 case "$d_getnetbyname_r_proto" in
13823 case "$getnetbyname_r_proto" in
13824 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13825 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13827 case "$getnetbyname_r_proto" in
13828 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13829 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13831 case "$getnetbyname_r_proto" in
13832 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13833 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13835 case "$getnetbyname_r_proto" in
13836 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13837 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13839 case "$getnetbyname_r_proto" in
13840 ''|0) d_getnetbyname_r=undef
13841 getnetbyname_r_proto=0
13842 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13843 * ) case "$getnetbyname_r_proto" in
13844 REENTRANT_PROTO*) ;;
13845 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13847 echo "Prototype: $try" ;;
13850 *) case "$usethreads" in
13851 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13853 d_getnetbyname_r=undef
13854 getnetbyname_r_proto=0
13858 *) getnetbyname_r_proto=0
13862 : see if getnetent_r exists
13863 set getnetent_r d_getnetent_r
13865 case "$d_getnetent_r" in
13867 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13868 case "$d_getnetent_r_proto:$usethreads" in
13869 ":define") d_getnetent_r_proto=define
13870 set d_getnetent_r_proto getnetent_r $hdrs
13874 case "$d_getnetent_r_proto" in
13876 case "$getnetent_r_proto" in
13877 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13878 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13880 case "$getnetent_r_proto" in
13881 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13882 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13884 case "$getnetent_r_proto" in
13885 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13886 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13888 case "$getnetent_r_proto" in
13889 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13890 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13892 case "$getnetent_r_proto" in
13893 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13894 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13896 case "$getnetent_r_proto" in
13897 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13898 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13900 case "$getnetent_r_proto" in
13901 ''|0) d_getnetent_r=undef
13902 getnetent_r_proto=0
13903 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13904 * ) case "$getnetent_r_proto" in
13905 REENTRANT_PROTO*) ;;
13906 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13908 echo "Prototype: $try" ;;
13911 *) case "$usethreads" in
13912 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13914 d_getnetent_r=undef
13915 getnetent_r_proto=0
13919 *) getnetent_r_proto=0
13923 : see if prototypes for various getnetxxx netdb.h functions are available
13925 set d_getnetprotos getnetent $i_netdb netdb.h
13928 : see if getpagesize exists
13929 set getpagesize d_getpagsz
13932 : Optional checks for getprotobyname and getprotobynumber
13934 : see if getprotobyname exists
13935 set getprotobyname d_getpbyname
13938 : see if getprotobynumber exists
13939 set getprotobynumber d_getpbynumber
13942 : see if getprotoent exists
13943 set getprotoent d_getpent
13946 : see if getpgid exists
13947 set getpgid d_getpgid
13950 : see if getpgrp2 exists
13951 set getpgrp2 d_getpgrp2
13954 : see if getppid exists
13955 set getppid d_getppid
13958 : see if getpriority exists
13959 set getpriority d_getprior
13962 : see if getprotobyname_r exists
13963 set getprotobyname_r d_getprotobyname_r
13965 case "$d_getprotobyname_r" in
13967 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13968 case "$d_getprotobyname_r_proto:$usethreads" in
13969 ":define") d_getprotobyname_r_proto=define
13970 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13974 case "$d_getprotobyname_r_proto" in
13976 case "$getprotobyname_r_proto" in
13977 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13978 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13980 case "$getprotobyname_r_proto" in
13981 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13982 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13984 case "$getprotobyname_r_proto" in
13985 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13986 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13988 case "$getprotobyname_r_proto" in
13989 ''|0) d_getprotobyname_r=undef
13990 getprotobyname_r_proto=0
13991 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13992 * ) case "$getprotobyname_r_proto" in
13993 REENTRANT_PROTO*) ;;
13994 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13996 echo "Prototype: $try" ;;
13999 *) case "$usethreads" in
14000 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14002 d_getprotobyname_r=undef
14003 getprotobyname_r_proto=0
14007 *) getprotobyname_r_proto=0
14011 : see if getprotobynumber_r exists
14012 set getprotobynumber_r d_getprotobynumber_r
14014 case "$d_getprotobynumber_r" in
14016 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14017 case "$d_getprotobynumber_r_proto:$usethreads" in
14018 ":define") d_getprotobynumber_r_proto=define
14019 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14023 case "$d_getprotobynumber_r_proto" in
14025 case "$getprotobynumber_r_proto" in
14026 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14027 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14029 case "$getprotobynumber_r_proto" in
14030 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14031 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14033 case "$getprotobynumber_r_proto" in
14034 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14035 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14037 case "$getprotobynumber_r_proto" in
14038 ''|0) d_getprotobynumber_r=undef
14039 getprotobynumber_r_proto=0
14040 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14041 * ) case "$getprotobynumber_r_proto" in
14042 REENTRANT_PROTO*) ;;
14043 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14045 echo "Prototype: $try" ;;
14048 *) case "$usethreads" in
14049 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14051 d_getprotobynumber_r=undef
14052 getprotobynumber_r_proto=0
14056 *) getprotobynumber_r_proto=0
14060 : see if getprotoent_r exists
14061 set getprotoent_r d_getprotoent_r
14063 case "$d_getprotoent_r" in
14065 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14066 case "$d_getprotoent_r_proto:$usethreads" in
14067 ":define") d_getprotoent_r_proto=define
14068 set d_getprotoent_r_proto getprotoent_r $hdrs
14072 case "$d_getprotoent_r_proto" in
14074 case "$getprotoent_r_proto" in
14075 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14076 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14078 case "$getprotoent_r_proto" in
14079 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14080 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14082 case "$getprotoent_r_proto" in
14083 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14084 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14086 case "$getprotoent_r_proto" in
14087 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14088 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14090 case "$getprotoent_r_proto" in
14091 ''|0) d_getprotoent_r=undef
14092 getprotoent_r_proto=0
14093 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14094 * ) case "$getprotoent_r_proto" in
14095 REENTRANT_PROTO*) ;;
14096 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14098 echo "Prototype: $try" ;;
14101 *) case "$usethreads" in
14102 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14104 d_getprotoent_r=undef
14105 getprotoent_r_proto=0
14109 *) getprotoent_r_proto=0
14113 : see if prototypes for various getprotoxxx netdb.h functions are available
14115 set d_getprotoprotos getprotoent $i_netdb netdb.h
14118 : see if getprpwnam exists
14119 set getprpwnam d_getprpwnam
14122 : see if getpwent exists
14123 set getpwent d_getpwent
14126 : see if getpwent_r exists
14127 set getpwent_r d_getpwent_r
14129 case "$d_getpwent_r" in
14131 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14132 case "$d_getpwent_r_proto:$usethreads" in
14133 ":define") d_getpwent_r_proto=define
14134 set d_getpwent_r_proto getpwent_r $hdrs
14138 case "$d_getpwent_r_proto" in
14140 case "$getpwent_r_proto" in
14141 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14142 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14144 case "$getpwent_r_proto" in
14145 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14146 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14148 case "$getpwent_r_proto" in
14149 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14150 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14152 case "$getpwent_r_proto" in
14153 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14154 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14156 case "$getpwent_r_proto" in
14157 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14158 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14160 case "$getpwent_r_proto" in
14161 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14162 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14164 case "$getpwent_r_proto" in
14165 ''|0) d_getpwent_r=undef
14167 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14168 * ) case "$getpwent_r_proto" in
14169 REENTRANT_PROTO*) ;;
14170 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14172 echo "Prototype: $try" ;;
14175 *) case "$usethreads" in
14176 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14183 *) getpwent_r_proto=0
14187 : see if getpwnam_r exists
14188 set getpwnam_r d_getpwnam_r
14190 case "$d_getpwnam_r" in
14192 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14193 case "$d_getpwnam_r_proto:$usethreads" in
14194 ":define") d_getpwnam_r_proto=define
14195 set d_getpwnam_r_proto getpwnam_r $hdrs
14199 case "$d_getpwnam_r_proto" in
14201 case "$getpwnam_r_proto" in
14202 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14203 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14205 case "$getpwnam_r_proto" in
14206 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14207 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14209 case "$getpwnam_r_proto" in
14210 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14211 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14213 case "$getpwnam_r_proto" in
14214 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14215 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14217 case "$getpwnam_r_proto" in
14218 ''|0) d_getpwnam_r=undef
14220 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14221 * ) case "$getpwnam_r_proto" in
14222 REENTRANT_PROTO*) ;;
14223 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14225 echo "Prototype: $try" ;;
14228 *) case "$usethreads" in
14229 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14236 *) getpwnam_r_proto=0
14240 : see if getpwuid_r exists
14241 set getpwuid_r d_getpwuid_r
14243 case "$d_getpwuid_r" in
14245 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14246 case "$d_getpwuid_r_proto:$usethreads" in
14247 ":define") d_getpwuid_r_proto=define
14248 set d_getpwuid_r_proto getpwuid_r $hdrs
14252 case "$d_getpwuid_r_proto" in
14254 case "$getpwuid_r_proto" in
14255 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14256 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14258 case "$getpwuid_r_proto" in
14259 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14260 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14262 case "$getpwuid_r_proto" in
14263 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14264 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14266 case "$getpwuid_r_proto" in
14267 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14268 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14270 case "$getpwuid_r_proto" in
14271 ''|0) d_getpwuid_r=undef
14273 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14274 * ) case "$getpwuid_r_proto" in
14275 REENTRANT_PROTO*) ;;
14276 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14278 echo "Prototype: $try" ;;
14281 *) case "$usethreads" in
14282 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14289 *) getpwuid_r_proto=0
14293 : Optional checks for getsbyname and getsbyport
14295 : see if getservbyname exists
14296 set getservbyname d_getsbyname
14299 : see if getservbyport exists
14300 set getservbyport d_getsbyport
14303 : see if getservent exists
14304 set getservent d_getsent
14307 : see if getservbyname_r exists
14308 set getservbyname_r d_getservbyname_r
14310 case "$d_getservbyname_r" in
14312 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14313 case "$d_getservbyname_r_proto:$usethreads" in
14314 ":define") d_getservbyname_r_proto=define
14315 set d_getservbyname_r_proto getservbyname_r $hdrs
14319 case "$d_getservbyname_r_proto" in
14321 case "$getservbyname_r_proto" in
14322 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14323 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14325 case "$getservbyname_r_proto" in
14326 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14327 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14329 case "$getservbyname_r_proto" in
14330 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14331 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14333 case "$getservbyname_r_proto" in
14334 ''|0) d_getservbyname_r=undef
14335 getservbyname_r_proto=0
14336 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14337 * ) case "$getservbyname_r_proto" in
14338 REENTRANT_PROTO*) ;;
14339 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14341 echo "Prototype: $try" ;;
14344 *) case "$usethreads" in
14345 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14347 d_getservbyname_r=undef
14348 getservbyname_r_proto=0
14352 *) getservbyname_r_proto=0
14356 : see if getservbyport_r exists
14357 set getservbyport_r d_getservbyport_r
14359 case "$d_getservbyport_r" in
14361 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14362 case "$d_getservbyport_r_proto:$usethreads" in
14363 ":define") d_getservbyport_r_proto=define
14364 set d_getservbyport_r_proto getservbyport_r $hdrs
14368 case "$d_getservbyport_r_proto" in
14370 case "$getservbyport_r_proto" in
14371 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14372 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14374 case "$getservbyport_r_proto" in
14375 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14376 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14378 case "$getservbyport_r_proto" in
14379 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14380 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14382 case "$getservbyport_r_proto" in
14383 ''|0) d_getservbyport_r=undef
14384 getservbyport_r_proto=0
14385 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14386 * ) case "$getservbyport_r_proto" in
14387 REENTRANT_PROTO*) ;;
14388 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14390 echo "Prototype: $try" ;;
14393 *) case "$usethreads" in
14394 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14396 d_getservbyport_r=undef
14397 getservbyport_r_proto=0
14401 *) getservbyport_r_proto=0
14405 : see if getservent_r exists
14406 set getservent_r d_getservent_r
14408 case "$d_getservent_r" in
14410 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14411 case "$d_getservent_r_proto:$usethreads" in
14412 ":define") d_getservent_r_proto=define
14413 set d_getservent_r_proto getservent_r $hdrs
14417 case "$d_getservent_r_proto" in
14419 case "$getservent_r_proto" in
14420 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14421 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14423 case "$getservent_r_proto" in
14424 ''|0) try='int getservent_r(struct servent*, char*, int);'
14425 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14427 case "$getservent_r_proto" in
14428 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14429 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14431 case "$getservent_r_proto" in
14432 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14433 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14435 case "$getservent_r_proto" in
14436 ''|0) d_getservent_r=undef
14437 getservent_r_proto=0
14438 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14439 * ) case "$getservent_r_proto" in
14440 REENTRANT_PROTO*) ;;
14441 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14443 echo "Prototype: $try" ;;
14446 *) case "$usethreads" in
14447 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14449 d_getservent_r=undef
14450 getservent_r_proto=0
14454 *) getservent_r_proto=0
14458 : see if prototypes for various getservxxx netdb.h functions are available
14460 set d_getservprotos getservent $i_netdb netdb.h
14463 : see if getspnam exists
14464 set getspnam d_getspnam
14467 : see if this is a shadow.h system
14468 set shadow.h i_shadow
14471 : see if getspnam_r exists
14472 set getspnam_r d_getspnam_r
14474 case "$d_getspnam_r" in
14476 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14477 case "$d_getspnam_r_proto:$usethreads" in
14478 ":define") d_getspnam_r_proto=define
14479 set d_getspnam_r_proto getspnam_r $hdrs
14483 case "$d_getspnam_r_proto" in
14485 case "$getspnam_r_proto" in
14486 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14487 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14489 case "$getspnam_r_proto" in
14490 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14491 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14493 case "$getspnam_r_proto" in
14494 ''|0) d_getspnam_r=undef
14496 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14497 * ) case "$getspnam_r_proto" in
14498 REENTRANT_PROTO*) ;;
14499 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14501 echo "Prototype: $try" ;;
14504 *) case "$usethreads" in
14505 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14512 *) getspnam_r_proto=0
14516 : see if gettimeofday or ftime exists
14517 set gettimeofday d_gettimeod
14519 case "$d_gettimeod" in
14525 val="$undef"; set d_ftime; eval $setvar
14528 case "$d_gettimeod$d_ftime" in
14531 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14535 : see if gmtime_r exists
14536 set gmtime_r d_gmtime_r
14538 case "$d_gmtime_r" in
14540 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14541 case "$d_gmtime_r_proto:$usethreads" in
14542 ":define") d_gmtime_r_proto=define
14543 set d_gmtime_r_proto gmtime_r $hdrs
14547 case "$d_gmtime_r_proto" in
14549 case "$gmtime_r_proto" in
14550 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14551 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14553 case "$gmtime_r_proto" in
14554 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14555 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14557 case "$gmtime_r_proto" in
14558 ''|0) d_gmtime_r=undef
14560 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14561 * ) case "$gmtime_r_proto" in
14562 REENTRANT_PROTO*) ;;
14563 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14565 echo "Prototype: $try" ;;
14568 *) case "$usethreads" in
14569 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14576 *) gmtime_r_proto=0
14580 : see if hasmntopt exists
14581 set hasmntopt d_hasmntopt
14584 : see if this is a netinet/in.h or sys/in.h system
14585 set netinet/in.h i_niin sys/in.h i_sysin
14588 : see if arpa/inet.h has to be included
14589 set arpa/inet.h i_arpainet
14592 : see if htonl --and friends-- exists
14597 : Maybe they are macros.
14600 $cat >htonl.c <<EOM
14602 #include <sys/types.h>
14603 #$i_niin I_NETINET_IN
14605 #$i_arpainet I_ARPA_INET
14606 #ifdef I_NETINET_IN
14607 #include <netinet/in.h>
14610 #include <sys/in.h>
14613 #include <arpa/inet.h>
14616 printf("Defined as a macro.");
14619 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14620 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14622 echo "But it seems to be defined as a macro." >&4
14630 : see if ilogbl exists
14631 set ilogbl d_ilogbl
14636 if set index val -f; eval $csym; $val; then
14637 if set strchr val -f d_strchr; eval $csym; $val; then
14638 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14641 echo "strchr() found." >&4
14645 echo "index() found." >&4
14650 echo "index() found." >&4
14653 if set strchr val -f d_strchr; eval $csym; $val; then
14656 echo "strchr() found." >&4
14658 echo "No index() or strchr() found!" >&4
14663 set d_strchr; eval $setvar
14665 set d_index; eval $setvar
14667 : check whether inet_aton exists
14668 set inet_aton d_inetaton
14673 $cat >isascii.c <<EOCP
14676 #$i_stdlib I_STDLIB
14678 #include <stdlib.h>
14689 if eval $compile; then
14690 echo "isascii() found." >&4
14693 echo "isascii() NOT found." >&4
14700 : see if isfinite exists
14701 set isfinite d_isfinite
14704 : see if isinf exists
14708 : see if isnan exists
14712 : see if isnanl exists
14713 set isnanl d_isnanl
14716 : see if killpg exists
14717 set killpg d_killpg
14720 : see if lchown exists
14722 $cat > try.c <<'EOCP'
14723 /* System header to define __stub macros and hopefully few prototypes,
14724 which can conflict with char lchown(); below. */
14725 #include <assert.h>
14726 /* Override any gcc2 internal prototype to avoid an error. */
14727 /* We use char because int might match the return type of a gcc2
14728 builtin and then its argument prototype would still apply. */
14731 /* The GNU C library defines this for functions which it implements
14732 to always fail with ENOSYS. Some functions are actually named
14733 something starting with __ and the normal name is an alias. */
14734 #if defined (__stub_lchown) || defined (__stub___lchown)
14742 if eval $compile; then
14743 $echo "lchown() found." >&4
14746 $echo "lchown() NOT found." >&4
14752 : See if number of significant digits in a double precision number is known
14754 $cat >ldbl_dig.c <<EOM
14755 #$i_limits I_LIMITS
14758 #include <limits.h>
14764 printf("Contains LDBL_DIG");
14767 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14768 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14769 echo "LDBL_DIG found." >&4
14772 echo "LDBL_DIG NOT found." >&4
14779 : see if this is a math.h system
14783 : check to see if math.h defines _LIB_VERSION
14784 d_libm_lib_version="$undef"
14788 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14790 #include <unistd.h>
14792 int main (int argc, char *argv[])
14794 printf ("%d\n", _LIB_VERSION);
14799 if eval $compile; then
14801 echo "Yes, it does ($foo)" >&4
14802 d_libm_lib_version="$define"
14804 echo "No, it does not (probably harmless)" >&4
14811 : see if link exists
14815 : see if localtime_r exists
14816 set localtime_r d_localtime_r
14818 case "$d_localtime_r" in
14820 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14821 case "$d_localtime_r_proto:$usethreads" in
14822 ":define") d_localtime_r_proto=define
14823 set d_localtime_r_proto localtime_r $hdrs
14827 case "$d_localtime_r_proto" in
14829 case "$localtime_r_proto" in
14830 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14831 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14833 case "$localtime_r_proto" in
14834 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14835 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14837 case "$localtime_r_proto" in
14838 ''|0) d_localtime_r=undef
14839 localtime_r_proto=0
14840 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14841 * ) case "$localtime_r_proto" in
14842 REENTRANT_PROTO*) ;;
14843 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14845 echo "Prototype: $try" ;;
14848 *) case "$usethreads" in
14849 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14851 d_localtime_r=undef
14852 localtime_r_proto=0
14856 *) localtime_r_proto=0
14860 : see if localtime_r calls tzset
14861 case "$localtime_r_proto" in
14864 /* Does our libc's localtime_r call tzset ?
14865 * return 0 if so, 1 otherwise.
14867 #include <sys/types.h>
14868 #include <unistd.h>
14870 #include <string.h>
14871 #include <malloc.h>
14874 time_t t = time(0L);
14875 char w_tz[]="TZ" "=GMT+5",
14876 e_tz[]="TZ" "=GMT-5",
14877 *tz_e = (char*)malloc(16),
14878 *tz_w = (char*)malloc(16);
14879 struct tm tm_e, tm_w;
14880 memset(&tm_e,'\0',sizeof(struct tm));
14881 memset(&tm_w,'\0',sizeof(struct tm));
14886 localtime_r(&t, &tm_e);
14889 localtime_r(&t, &tm_w);
14891 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14897 if eval $compile; then
14898 if $run ./try; then
14899 d_localtime_r_needs_tzset=undef;
14901 d_localtime_r_needs_tzset=define;
14904 d_localtime_r_needs_tzset=undef;
14908 d_localtime_r_needs_tzset=undef;
14913 : see if localeconv exists
14914 set localeconv d_locconv
14917 : see if lockf exists
14921 : see if prototype for lseek is available
14923 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14926 : see if lstat exists
14930 : see if madvise exists
14931 set madvise d_madvise
14934 : see if malloc_size exists
14935 set malloc_size d_malloc_size
14938 : see if malloc_size_good exists
14939 set malloc_good_size d_malloc_good_size
14942 : see if mblen exists
14946 : see if mbstowcs exists
14947 set mbstowcs d_mbstowcs
14950 : see if mbtowc exists
14951 set mbtowc d_mbtowc
14954 : see if memchr exists
14955 set memchr d_memchr
14958 : see if memcmp exists
14959 set memcmp d_memcmp
14962 : see if memcpy exists
14963 set memcpy d_memcpy
14966 : see if memmove exists
14967 set memmove d_memmove
14970 : see if memset exists
14971 set memset d_memset
14974 : see if mkdir exists
14978 : see if mkdtemp exists
14979 set mkdtemp d_mkdtemp
14982 : see if mkfifo exists
14983 set mkfifo d_mkfifo
14986 : see if mkstemp exists
14987 set mkstemp d_mkstemp
14990 : see if mkstemps exists
14991 set mkstemps d_mkstemps
14994 : see if mktime exists
14995 set mktime d_mktime
14998 : see if this is a sys/mman.h system
14999 set sys/mman.h i_sysmman
15002 : see if mmap exists
15005 : see what shmat returns
15006 : default to something harmless
15008 case "$i_sysmman$d_mmap" in
15010 $cat >mmap.c <<'END'
15011 #include <sys/mman.h>
15014 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15019 echo "and it returns ($mmaptype)." >&4
15025 : see if sqrtl exists
15029 : see if scalbnl exists
15030 set scalbnl d_scalbnl
15033 : see if modfl exists
15037 : see if prototype for modfl is available
15039 set d_modflproto modfl $i_math math.h
15042 d_modfl_pow32_bug="$undef"
15044 case "$d_longdbl$d_modfl" in
15047 Checking to see whether your modfl() is okay for large values...
15053 if $test "X$d_modflproto" != "X$define"; then
15054 $cat >>try.c <<EOCP
15055 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15056 long double modfl (long double, long double *);
15059 $cat >>try.c <<EOCP
15061 long double nv = 4294967303.15;
15067 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15071 case "$osname:$gccversion" in
15072 aix:) saveccflags="$ccflags"
15073 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15076 if eval $compile; then
15079 *" 4294967303.150000 1.150000 4294967302.000000")
15080 echo >&4 "Your modfl() is broken for large values."
15081 d_modfl_pow32_bug="$define"
15083 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15087 *" 4294967303.150000 0.150000 4294967303.000000")
15088 echo >&4 "Your modfl() seems okay for large values."
15090 *) echo >&4 "I don't understand your modfl() at all."
15096 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15099 case "$osname:$gccversion" in
15100 aix:) ccflags="$saveccflags" ;; # restore
15105 if $test "$uselongdouble" = "$define"; then
15107 if $test "$d_sqrtl" != "$define"; then
15108 message="$message sqrtl"
15110 if $test "$d_modfl" != "$define"; then
15111 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15112 echo "You have both aintl and copysignl, so I can emulate modfl."
15114 message="$message modfl"
15117 if $test "$d_frexpl" != "$define"; then
15118 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15119 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15121 message="$message frexpl"
15125 if $test "$message" != ""; then
15128 *** You requested the use of long doubles but you do not seem to have
15129 *** the following mathematical functions needed for long double support:
15131 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15132 *** Cannot continue, aborting.
15140 : see if mprotect exists
15141 set mprotect d_mprotect
15144 : see if msgctl exists
15145 set msgctl d_msgctl
15148 : see if msgget exists
15149 set msgget d_msgget
15152 : see if msgsnd exists
15153 set msgsnd d_msgsnd
15156 : see if msgrcv exists
15157 set msgrcv d_msgrcv
15160 : see how much of the 'msg*(2)' library is present.
15163 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15164 *"$undef"*) h_msg=false;;
15168 case "`ipcs 2>&1`" in
15169 "SVID messages"*"not configured"*)
15170 echo "Your $osname does not have the msg*(2) configured." >&4
15173 set msgctl d_msgctl
15175 set msgget d_msgget
15177 set msgsnd d_msgsnd
15179 set msgrcv d_msgrcv
15185 : we could also check for sys/ipc.h ...
15186 if $h_msg && $test `./findhdr sys/msg.h`; then
15187 echo "You have the full msg*(2) library." >&4
15190 echo "You don't have the full msg*(2) library." >&4
15196 : Check for msghdr_s
15198 echo "Checking to see if your system supports struct msghdr..." >&4
15199 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15201 case "$d_msghdr_s" in
15202 "$define") echo "Yes, it does." ;;
15203 *) echo "No, it doesn't." ;;
15207 : see if msync exists
15211 : see if munmap exists
15212 set munmap d_munmap
15215 : see if nice exists
15219 : see if this is a langinfo.h system
15220 set langinfo.h i_langinfo
15223 : see if nl_langinfo exists
15224 set nl_langinfo d_nl_langinfo
15227 : check for volatile keyword
15229 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15230 $cat >try.c <<'EOCP'
15233 typedef struct _goo_struct goo_struct;
15234 goo_struct * volatile goo = ((goo_struct *)0);
15235 struct _goo_struct {
15240 typedef unsigned short foo_t;
15241 char *volatile foo;
15243 volatile foo_t blech;
15247 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15249 echo "Yup, it does."
15252 echo "Nope, it doesn't."
15258 : Check basic sizes
15260 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15262 case "$use64bitint:$d_quad:$quadtype" in
15265 uvtype="$uquadtype"
15270 uvtype="unsigned long"
15276 case "$uselongdouble:$d_longdbl" in
15278 nvtype="long double"
15279 nvsize=$longdblsize
15286 $echo "(IV will be "$ivtype", $ivsize bytes)"
15287 $echo "(UV will be "$uvtype", $uvsize bytes)"
15288 $echo "(NV will be "$nvtype", $nvsize bytes)"
15291 #$i_inttypes I_INTTYPES
15293 #include <inttypes.h>
15298 int8_t i = INT8_MAX;
15299 uint8_t u = UINT8_MAX;
15300 printf("int8_t\n");
15303 int16_t i = INT16_MAX;
15304 uint16_t i = UINT16_MAX;
15305 printf("int16_t\n");
15308 int32_t i = INT32_MAX;
15309 uint32_t u = UINT32_MAX;
15310 printf("int32_t\n");
15315 i8type="signed char"
15316 u8type="unsigned char"
15321 '') case "$shortsize" in
15323 u16type="unsigned short"
15331 '') set try -DINT16
15332 if eval $compile; then
15333 case "`$run ./try`" in
15345 '') if $test $shortsize -ge 2; then
15347 u16type="unsigned short"
15355 '') case "$longsize" in
15357 u32type="unsigned long"
15361 *) case "$intsize" in
15363 u32type="unsigned int"
15373 '') set try -DINT32
15374 if eval $compile; then
15375 case "`$run ./try`" in
15387 '') if $test $intsize -ge 4; then
15389 u32type="unsigned int"
15397 '') case "$d_quad:$quadtype" in
15399 i64type="$quadtype"
15400 u64type="$uquadtype"
15408 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15409 : volatile so that the compiler has to store it out to memory.
15410 if test X"$d_volatile" = X"$define"; then
15415 #$i_stdlib I_STDLIB
15417 #include <stdlib.h>
15419 #include <sys/types.h>
15420 #include <signal.h>
15422 $volatile int bletched = 0;
15423 $signal_t blech(int s) { bletched = 1; }
15428 int n = 8 * $uvsize;
15431 signal(SIGFPE, blech);
15434 for (i = 0; i < n; i++) {
15435 u = u << 1 | ($uvtype)1;
15437 if (($uvtype)d != u)
15441 d = ($nvtype)(u - 1);
15442 if (($uvtype)d != (u - 1))
15449 printf("%d\n", ((i == n) ? -n : i));
15455 d_nv_preserves_uv="$undef"
15456 if eval $compile; then
15457 nv_preserves_uv_bits="`$run ./try`"
15459 case "$nv_preserves_uv_bits" in
15461 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15462 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15463 d_nv_preserves_uv="$define"
15465 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15466 d_nv_preserves_uv="$undef" ;;
15467 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15468 nv_preserves_uv_bits="0" ;;
15472 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15473 : volatile so that the compiler has to store it out to memory.
15474 if test X"$d_volatile" = X"$define"; then
15480 typedef $nvtype NV;
15487 while(count < 256) {
15488 $volatile NV up = value + 1.0;
15489 $volatile NV negated = -value;
15490 $volatile NV down = negated - 1.0;
15491 $volatile NV got_up = up - value;
15492 int up_good = got_up == 1.0;
15493 int got_down = down - negated;
15494 int down_good = got_down == -1.0;
15496 if (down_good != up_good) {
15498 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15499 up_good, (double) got_up, down_good, (double) got_down,
15500 count, (double) value);
15507 fputs("256.0", stdout);
15510 fputs("2.0", stdout);
15516 fputs("*", stdout);
15522 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15523 count, (double) value);
15529 nv_overflows_integers_at='0'
15530 if eval $compile; then
15536 The largest integer your NVs can preserve is equal to $xxx
15538 nv_overflows_integers_at="$xxx"
15541 Cannot determine the largest integer value your NVs can hold, unexpected output
15548 Cannot determine the largest integer value your NVs can hold
15555 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15556 : volatile so that the compiler has to store it out to memory.
15557 if test X"$d_volatile" = X"$define"; then
15562 #$i_stdlib I_STDLIB
15564 #include <stdlib.h>
15566 #$i_string I_STRING
15568 # include <string.h>
15570 # include <strings.h>
15572 #include <sys/types.h>
15573 #include <signal.h>
15575 $volatile int bletched = 0;
15576 $signal_t blech(int s) { bletched = 1; }
15579 int checkit($nvtype d, char *where) {
15580 unsigned char *p = (char *)&d;
15581 unsigned char *end = p + sizeof(d);
15591 printf("No - %s: 0x", where);
15593 printf ("%02X", *p++);
15598 int main(int argc, char **argv) {
15601 fail += checkit(d, "0.0");
15603 /* The compiler shouldn't be assuming that bletched is 0 */
15606 fail += checkit(d, "bleched");
15609 signal(SIGFPE, blech);
15612 /* Paranoia - the compiler should have no way of knowing that ANSI says
15613 that argv[argc] will always be NULL. Actually, if it did assume this it
15614 would be buggy, as this is C and main() can be called from elsewhere in
15616 d = argv[argc] ? 1 : 0;
15619 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15622 fail += checkit(d, "ternary");
15624 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15627 printf("No - memset doesn't give 0.0\n");
15628 /* This might just blow up: */
15629 printf("(gives %g)\n", d);
15635 printf("No - something bleched\n");
15640 printf("No - %d fail(s)\n", fail);
15649 d_nv_zero_is_allbits_zero="$undef"
15650 if eval $compile; then
15656 0.0 is represented as all bits zero in memory
15658 d_nv_zero_is_allbits_zero="$define"
15661 0.0 is not represented as all bits zero in memory
15663 d_nv_zero_is_allbits_zero="$undef"
15668 0.0 is not represented as all bits zero in memory
15670 d_nv_zero_is_allbits_zero="$undef"
15676 : check for off64_t
15678 echo "Checking to see if you have off64_t..." >&4
15680 #include <sys/types.h>
15681 #include <unistd.h>
15682 int main() { off64_t x = 7; }
15685 if eval $compile; then
15687 echo "You have off64_t."
15690 echo "You do not have off64_t."
15691 case "$lseeksize" in
15692 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15699 : how to create joinable pthreads
15700 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15702 echo "Checking what constant to use for creating joinable pthreads..." >&4
15703 $cat >try.c <<'EOCP'
15704 #include <pthread.h>
15706 int detachstate = JOINABLE;
15709 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15710 if eval $compile; then
15711 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15712 val="$undef" # Yes, undef.
15713 set d_old_pthread_create_joinable
15716 set old_pthread_create_joinable
15719 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15720 if eval $compile; then
15721 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15723 set d_old_pthread_create_joinable
15725 val=PTHREAD_CREATE_UNDETACHED
15726 set old_pthread_create_joinable
15729 set try -DJOINABLE=__UNDETACHED
15730 if eval $compile; then
15731 echo "You seem to use __UNDETACHED." >&4
15733 set d_old_pthread_create_joinable
15736 set old_pthread_create_joinable
15739 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15741 set d_old_pthread_create_joinable
15744 set old_pthread_create_joinable
15751 d_old_pthread_create_joinable="$undef"
15752 old_pthread_create_joinable=""
15755 : see if pause exists
15759 : see if poll exists
15763 : see if readlink exists
15764 set readlink d_readlink
15767 : Check if exe is symlink to abs path of executing program
15771 case "$d_readlink" in
15773 if $issymlink /proc/self/exe ; then
15774 $ls -l /proc/self/exe > reflect
15775 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15776 echo "You have Linux-like /proc/self/exe."
15777 procselfexe='"/proc/self/exe"'
15781 if $issymlink /proc/curproc/file ; then
15782 $ls -l /proc/curproc/file > reflect
15783 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15784 echo "You have BSD-like /proc/curproc/file."
15785 procselfexe='"/proc/curproc/file"'
15795 : backward compatibility for d_hvfork
15796 if test X$d_hvfork != X; then
15797 d_vfork="$d_hvfork"
15800 : see if there is a vfork
15805 d_pseudofork=$undef
15807 : Ok, but do we want to use it. vfork is reportedly unreliable in
15808 : perl on Solaris 2.x, and probably elsewhere.
15812 case "$usevfork" in
15818 Perl can only use a vfork() that doesn't suffer from strict
15819 restrictions on calling functions or modifying global data in
15820 the child. For example, glibc-2.1 contains such a vfork()
15821 that is unsuitable. If your system provides a proper fork()
15822 call, chances are that you do NOT want perl to use vfork().
15825 rp="Do you still want to use vfork()?"
15830 echo "Ok, we won't use vfork()."
15839 $define) usevfork='true';;
15840 *) usevfork='false';;
15843 : see whether the pthread_atfork exists
15845 #include <pthread.h>
15848 #ifdef PTHREAD_ATFORK
15849 pthread_atfork(NULL,NULL,NULL);
15854 : see if pthread_atfork exists
15855 set try -DPTHREAD_ATFORK
15856 if eval $compile; then
15861 case "$usethreads" in
15864 $define) echo 'pthread_atfork found.' >&4 ;;
15865 *) echo 'pthread_atfork NOT found.' >&4 ;;
15868 set d_pthread_atfork
15871 : see if pthread_attr_setscope exists
15872 set pthread_attr_setscope d_pthread_attr_setscope
15875 : see whether the various POSIXish _yields exist
15877 #include <pthread.h>
15883 #ifdef PTHREAD_YIELD
15886 #ifdef PTHREAD_YIELD_NULL
15887 pthread_yield(NULL);
15893 : see if sched_yield exists
15894 set try -DSCHED_YIELD
15895 if eval $compile; then
15897 sched_yield='sched_yield()'
15901 case "$usethreads" in
15904 $define) echo 'sched_yield() found.' >&4 ;;
15905 *) echo 'sched_yield() NOT found.' >&4 ;;
15911 : see if pthread_yield exists
15912 set try -DPTHREAD_YIELD
15913 if eval $compile; then
15915 case "$sched_yield" in
15916 '') sched_yield='pthread_yield()' ;;
15919 set try -DPTHREAD_YIELD_NULL
15920 if eval $compile; then
15922 case "$sched_yield" in
15923 '') sched_yield='pthread_yield(NULL)' ;;
15929 case "$usethreads" in
15932 $define) echo 'pthread_yield() found.' >&4 ;;
15933 *) echo 'pthread_yield() NOT found.' >&4 ;;
15937 set d_pthread_yield
15939 case "$sched_yield" in
15940 '') sched_yield=undef ;;
15944 : see if random_r exists
15945 set random_r d_random_r
15947 case "$d_random_r" in
15949 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15950 case "$d_random_r_proto:$usethreads" in
15951 ":define") d_random_r_proto=define
15952 set d_random_r_proto random_r $hdrs
15956 case "$d_random_r_proto" in
15958 case "$random_r_proto" in
15959 ''|0) try='int random_r(int*, struct random_data*);'
15960 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15962 case "$random_r_proto" in
15963 ''|0) try='int random_r(long*, struct random_data*);'
15964 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15966 case "$random_r_proto" in
15967 ''|0) try='int random_r(struct random_data*, int32_t*);'
15968 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15970 case "$random_r_proto" in
15971 ''|0) d_random_r=undef
15973 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15974 * ) case "$random_r_proto" in
15975 REENTRANT_PROTO*) ;;
15976 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15978 echo "Prototype: $try" ;;
15981 *) case "$usethreads" in
15982 define) echo "random_r has no prototype, not using it." >&4 ;;
15989 *) random_r_proto=0
15993 : see if readdir and friends exist
15994 set readdir d_readdir
15996 set seekdir d_seekdir
15998 set telldir d_telldir
16000 set rewinddir d_rewinddir
16003 : see if readdir64_r exists
16004 set readdir64_r d_readdir64_r
16006 case "$d_readdir64_r" in
16008 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16009 case "$d_readdir64_r_proto:$usethreads" in
16010 ":define") d_readdir64_r_proto=define
16011 set d_readdir64_r_proto readdir64_r $hdrs
16015 case "$d_readdir64_r_proto" in
16017 case "$readdir64_r_proto" in
16018 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16019 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16021 case "$readdir64_r_proto" in
16022 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16023 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16025 case "$readdir64_r_proto" in
16026 ''|0) d_readdir64_r=undef
16027 readdir64_r_proto=0
16028 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16029 * ) case "$readdir64_r_proto" in
16030 REENTRANT_PROTO*) ;;
16031 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16033 echo "Prototype: $try" ;;
16036 *) case "$usethreads" in
16037 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16039 d_readdir64_r=undef
16040 readdir64_r_proto=0
16044 *) readdir64_r_proto=0
16048 : see if readdir_r exists
16049 set readdir_r d_readdir_r
16051 case "$d_readdir_r" in
16053 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16054 case "$d_readdir_r_proto:$usethreads" in
16055 ":define") d_readdir_r_proto=define
16056 set d_readdir_r_proto readdir_r $hdrs
16060 case "$d_readdir_r_proto" in
16062 case "$readdir_r_proto" in
16063 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16064 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16066 case "$readdir_r_proto" in
16067 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16068 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16070 case "$readdir_r_proto" in
16071 ''|0) d_readdir_r=undef
16073 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16074 * ) case "$readdir_r_proto" in
16075 REENTRANT_PROTO*) ;;
16076 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16078 echo "Prototype: $try" ;;
16081 *) case "$usethreads" in
16082 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16089 *) readdir_r_proto=0
16093 : see if readv exists
16097 : see if recvmsg exists
16098 set recvmsg d_recvmsg
16101 : see if rename exists
16102 set rename d_rename
16105 : see if rmdir exists
16109 : see if memory.h is available.
16114 : See if it conflicts with string.h
16120 $cppstdin $cppflags $cppminus < $strings > mem.h
16121 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16123 echo "We won't be including <memory.h>."
16133 : can bcopy handle overlapping blocks?
16136 case "$d_memmove" in
16137 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16138 *) case "$d_bcopy" in
16140 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16142 #$i_memory I_MEMORY
16143 #$i_stdlib I_STDLIB
16144 #$i_string I_STRING
16145 #$i_unistd I_UNISTD
16147 $cat >>try.c <<'EOCP'
16150 # include <memory.h>
16153 # include <stdlib.h>
16156 # include <string.h>
16158 # include <strings.h>
16161 # include <unistd.h> /* Needed for NetBSD */
16165 char buf[128], abc[128];
16171 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16172 try to store the string in read-only memory. */
16173 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16175 for (align = 7; align >= 0; align--) {
16176 for (len = 36; len; len--) {
16178 bcopy(abc, b, len);
16179 for (off = 1; off <= len; off++) {
16180 bcopy(b, b+off, len);
16181 bcopy(b+off, b, len);
16182 if (bcmp(b, abc, len))
16191 if eval $compile_ok; then
16192 if $run ./try 2>/dev/null; then
16193 echo "Yes, it can."
16196 echo "It can't, sorry."
16199 echo "(I can't compile the test program, so we'll assume not...)"
16209 : can memcpy handle overlapping blocks?
16212 case "$d_memmove" in
16213 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16214 *) case "$d_memcpy" in
16216 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16218 #$i_memory I_MEMORY
16219 #$i_stdlib I_STDLIB
16220 #$i_string I_STRING
16221 #$i_unistd I_UNISTD
16223 $cat >>try.c <<'EOCP'
16226 # include <memory.h>
16229 # include <stdlib.h>
16232 # include <string.h>
16234 # include <strings.h>
16237 # include <unistd.h> /* Needed for NetBSD */
16241 char buf[128], abc[128];
16247 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16248 try to store the string in read-only memory. */
16249 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16251 for (align = 7; align >= 0; align--) {
16252 for (len = 36; len; len--) {
16254 memcpy(b, abc, len);
16255 for (off = 1; off <= len; off++) {
16256 memcpy(b+off, b, len);
16257 memcpy(b, b+off, len);
16258 if (memcmp(b, abc, len))
16267 if eval $compile_ok; then
16268 if $run ./try 2>/dev/null; then
16269 echo "Yes, it can."
16272 echo "It can't, sorry."
16275 echo "(I can't compile the test program, so we'll assume not...)"
16285 : can memcmp be trusted to compare relative magnitude?
16287 case "$d_memcmp" in
16290 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16292 #$i_memory I_MEMORY
16293 #$i_stdlib I_STDLIB
16294 #$i_string I_STRING
16295 #$i_unistd I_UNISTD
16297 $cat >>try.c <<'EOCP'
16300 # include <memory.h>
16303 # include <stdlib.h>
16306 # include <string.h>
16308 # include <strings.h>
16311 # include <unistd.h> /* Needed for NetBSD */
16317 if ((a < b) && memcmp(&a, &b, 1) < 0)
16323 if eval $compile_ok; then
16324 if $run ./try 2>/dev/null; then
16325 echo "Yes, it can."
16328 echo "No, it can't (it uses signed chars)."
16331 echo "(I can't compile the test program, so we'll assume not...)"
16339 : see if prototype for sbrk is available
16341 set d_sbrkproto sbrk $i_unistd unistd.h
16344 : see if select exists
16345 set select d_select
16348 : see if semctl exists
16349 set semctl d_semctl
16352 : see if semget exists
16353 set semget d_semget
16356 : see if semop exists
16360 : see how much of the 'sem*(2)' library is present.
16363 case "$d_semctl$d_semget$d_semop" in
16364 *"$undef"*) h_sem=false;;
16368 case "`ipcs 2>&1`" in
16369 "SVID messages"*"not configured"*)
16370 echo "Your $osname does not have the sem*(2) configured." >&4
16373 set semctl d_semctl
16375 set semget d_semget
16383 : we could also check for sys/ipc.h ...
16384 if $h_sem && $test `./findhdr sys/sem.h`; then
16385 echo "You have the full sem*(2) library." >&4
16388 echo "You don't have the full sem*(2) library." >&4
16394 : see whether sys/sem.h defines union semun
16396 $cat > try.c <<'END'
16397 #include <sys/types.h>
16398 #include <sys/ipc.h>
16399 #include <sys/sem.h>
16400 int main () { union semun semun; semun.buf = 0; }
16403 if eval $compile; then
16404 echo "You have union semun in <sys/sem.h>." >&4
16407 echo "You do not have union semun in <sys/sem.h>." >&4
16414 : see how to do semctl IPC_STAT
16418 $cat > tryh.h <<END
16421 # define S_IRUSR S_IREAD
16422 # define S_IWUSR S_IWRITE
16423 # define S_IXUSR S_IEXEC
16425 # define S_IRUSR 0400
16426 # define S_IWUSR 0200
16427 # define S_IXUSR 0100
16429 # define S_IRGRP (S_IRUSR>>3)
16430 # define S_IWGRP (S_IWUSR>>3)
16431 # define S_IXGRP (S_IXUSR>>3)
16432 # define S_IROTH (S_IRUSR>>6)
16433 # define S_IWOTH (S_IWUSR>>6)
16434 # define S_IXOTH (S_IXUSR>>6)
16437 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16438 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16439 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16442 : see whether semctl IPC_STAT can use union semun
16443 case "$d_semctl_semun" in
16447 #include <sys/types.h>
16448 #include <sys/ipc.h>
16449 #include <sys/sem.h>
16450 #include <sys/stat.h>
16457 #$d_union_semun HAS_UNION_SEMUN
16460 #ifndef HAS_UNION_SEMUN
16463 struct semid_ds *buf;
16464 unsigned short *array;
16470 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16471 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16473 struct semid_ds argbuf;
16476 st = semctl(sem, 0, IPC_STAT, arg);
16480 # endif /* IPC_STAT */
16481 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16483 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16484 # endif /* IPC_RMID */
16485 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16487 #endif /* IPC_PRIVATE && ... */
16488 printf("semget failed: errno = %d\n", errno);
16493 if eval $compile; then
16496 semun) val="$define" ;;
16504 case "$d_semctl_semun" in
16506 echo "You can use union semun for semctl IPC_STAT." >&4
16509 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16514 : see whether semctl IPC_STAT can use struct semid_ds pointer
16515 case "$d_semctl_semid_ds" in
16518 $cat > try.c <<'END'
16519 #include <sys/types.h>
16520 #include <sys/ipc.h>
16521 #include <sys/sem.h>
16522 #include <sys/stat.h>
16530 struct semid_ds arg;
16533 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16534 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16537 st = semctl(sem, 0, IPC_STAT, &arg);
16539 printf("semid_ds\n");
16541 # endif /* IPC_STAT */
16542 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16544 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16545 # endif /* IPC_RMID */
16546 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16548 #endif /* IPC_PRIVATE && ... */
16549 printf("semget failed: errno = %d\n", errno);
16555 if eval $compile; then
16558 semid_ds) val="$define" ;;
16562 set d_semctl_semid_ds
16566 case "$d_semctl_semid_ds" in
16568 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16570 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16576 # We do not have the full sem*(2) library, so assume we can not
16582 set d_semctl_semid_ds
16588 : see if sendmsg exists
16589 set sendmsg d_sendmsg
16592 : see if setegid exists
16593 set setegid d_setegid
16596 : see if seteuid exists
16597 set seteuid d_seteuid
16600 : see if setgrent exists
16601 set setgrent d_setgrent
16604 : see if setgrent_r exists
16605 set setgrent_r d_setgrent_r
16607 case "$d_setgrent_r" in
16609 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16610 case "$d_setgrent_r_proto:$usethreads" in
16611 ":define") d_setgrent_r_proto=define
16612 set d_setgrent_r_proto setgrent_r $hdrs
16616 case "$d_setgrent_r_proto" in
16618 case "$setgrent_r_proto" in
16619 ''|0) try='int setgrent_r(FILE**);'
16620 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16622 case "$setgrent_r_proto" in
16623 ''|0) try='void setgrent_r(FILE**);'
16624 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16626 case "$setgrent_r_proto" in
16627 ''|0) d_setgrent_r=undef
16629 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16630 * ) case "$setgrent_r_proto" in
16631 REENTRANT_PROTO*) ;;
16632 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16634 echo "Prototype: $try" ;;
16637 *) case "$usethreads" in
16638 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16645 *) setgrent_r_proto=0
16649 : see if sethostent exists
16650 set sethostent d_sethent
16653 : see if sethostent_r exists
16654 set sethostent_r d_sethostent_r
16656 case "$d_sethostent_r" in
16658 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16659 case "$d_sethostent_r_proto:$usethreads" in
16660 ":define") d_sethostent_r_proto=define
16661 set d_sethostent_r_proto sethostent_r $hdrs
16665 case "$d_sethostent_r_proto" in
16667 case "$sethostent_r_proto" in
16668 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16669 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16671 case "$sethostent_r_proto" in
16672 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16673 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16675 case "$sethostent_r_proto" in
16676 ''|0) d_sethostent_r=undef
16677 sethostent_r_proto=0
16678 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16679 * ) case "$sethostent_r_proto" in
16680 REENTRANT_PROTO*) ;;
16681 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16683 echo "Prototype: $try" ;;
16686 *) case "$usethreads" in
16687 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16689 d_sethostent_r=undef
16690 sethostent_r_proto=0
16694 *) sethostent_r_proto=0
16698 : see if setitimer exists
16699 set setitimer d_setitimer
16702 : see if setlinebuf exists
16703 set setlinebuf d_setlinebuf
16706 : see if setlocale exists
16707 set setlocale d_setlocale
16710 : see if locale.h is available
16711 set locale.h i_locale
16714 : see if setlocale_r exists
16715 set setlocale_r d_setlocale_r
16717 case "$d_setlocale_r" in
16719 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16720 case "$d_setlocale_r_proto:$usethreads" in
16721 ":define") d_setlocale_r_proto=define
16722 set d_setlocale_r_proto setlocale_r $hdrs
16726 case "$d_setlocale_r_proto" in
16728 case "$setlocale_r_proto" in
16729 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16730 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16732 case "$setlocale_r_proto" in
16733 ''|0) d_setlocale_r=undef
16734 setlocale_r_proto=0
16735 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16736 * ) case "$setlocale_r_proto" in
16737 REENTRANT_PROTO*) ;;
16738 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16740 echo "Prototype: $try" ;;
16743 *) case "$usethreads" in
16744 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16746 d_setlocale_r=undef
16747 setlocale_r_proto=0
16751 *) setlocale_r_proto=0
16755 : see if setnetent exists
16756 set setnetent d_setnent
16759 : see if setnetent_r exists
16760 set setnetent_r d_setnetent_r
16762 case "$d_setnetent_r" in
16764 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16765 case "$d_setnetent_r_proto:$usethreads" in
16766 ":define") d_setnetent_r_proto=define
16767 set d_setnetent_r_proto setnetent_r $hdrs
16771 case "$d_setnetent_r_proto" in
16773 case "$setnetent_r_proto" in
16774 ''|0) try='int setnetent_r(int, struct netent_data*);'
16775 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16777 case "$setnetent_r_proto" in
16778 ''|0) try='void setnetent_r(int, struct netent_data*);'
16779 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16781 case "$setnetent_r_proto" in
16782 ''|0) d_setnetent_r=undef
16783 setnetent_r_proto=0
16784 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16785 * ) case "$setnetent_r_proto" in
16786 REENTRANT_PROTO*) ;;
16787 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16789 echo "Prototype: $try" ;;
16792 *) case "$usethreads" in
16793 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16795 d_setnetent_r=undef
16796 setnetent_r_proto=0
16800 *) setnetent_r_proto=0
16804 : see if setprotoent exists
16805 set setprotoent d_setpent
16808 : see if setpgid exists
16809 set setpgid d_setpgid
16812 : see if setpgrp2 exists
16813 set setpgrp2 d_setpgrp2
16816 : see if setpriority exists
16817 set setpriority d_setprior
16820 : see if setproctitle exists
16821 set setproctitle d_setproctitle
16824 : see if setprotoent_r exists
16825 set setprotoent_r d_setprotoent_r
16827 case "$d_setprotoent_r" in
16829 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16830 case "$d_setprotoent_r_proto:$usethreads" in
16831 ":define") d_setprotoent_r_proto=define
16832 set d_setprotoent_r_proto setprotoent_r $hdrs
16836 case "$d_setprotoent_r_proto" in
16838 case "$setprotoent_r_proto" in
16839 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16840 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16842 case "$setprotoent_r_proto" in
16843 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16844 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16846 case "$setprotoent_r_proto" in
16847 ''|0) d_setprotoent_r=undef
16848 setprotoent_r_proto=0
16849 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16850 * ) case "$setprotoent_r_proto" in
16851 REENTRANT_PROTO*) ;;
16852 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16854 echo "Prototype: $try" ;;
16857 *) case "$usethreads" in
16858 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16860 d_setprotoent_r=undef
16861 setprotoent_r_proto=0
16865 *) setprotoent_r_proto=0
16869 : see if setpwent exists
16870 set setpwent d_setpwent
16873 : see if setpwent_r exists
16874 set setpwent_r d_setpwent_r
16876 case "$d_setpwent_r" in
16878 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16879 case "$d_setpwent_r_proto:$usethreads" in
16880 ":define") d_setpwent_r_proto=define
16881 set d_setpwent_r_proto setpwent_r $hdrs
16885 case "$d_setpwent_r_proto" in
16887 case "$setpwent_r_proto" in
16888 ''|0) try='int setpwent_r(FILE**);'
16889 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16891 case "$setpwent_r_proto" in
16892 ''|0) try='void setpwent_r(FILE**);'
16893 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16895 case "$setpwent_r_proto" in
16896 ''|0) d_setpwent_r=undef
16898 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16899 * ) case "$setpwent_r_proto" in
16900 REENTRANT_PROTO*) ;;
16901 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16903 echo "Prototype: $try" ;;
16906 *) case "$usethreads" in
16907 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16914 *) setpwent_r_proto=0
16918 : see if setregid exists
16919 set setregid d_setregid
16921 set setresgid d_setresgid
16924 : see if setreuid exists
16925 set setreuid d_setreuid
16927 set setresuid d_setresuid
16930 : see if setrgid exists
16931 set setrgid d_setrgid
16934 : see if setruid exists
16935 set setruid d_setruid
16938 : see if setservent exists
16939 set setservent d_setsent
16942 : see if setservent_r exists
16943 set setservent_r d_setservent_r
16945 case "$d_setservent_r" in
16947 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16948 case "$d_setservent_r_proto:$usethreads" in
16949 ":define") d_setservent_r_proto=define
16950 set d_setservent_r_proto setservent_r $hdrs
16954 case "$d_setservent_r_proto" in
16956 case "$setservent_r_proto" in
16957 ''|0) try='int setservent_r(int, struct servent_data*);'
16958 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16960 case "$setservent_r_proto" in
16961 ''|0) try='void setservent_r(int, struct servent_data*);'
16962 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16964 case "$setservent_r_proto" in
16965 ''|0) d_setservent_r=undef
16966 setservent_r_proto=0
16967 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16968 * ) case "$setservent_r_proto" in
16969 REENTRANT_PROTO*) ;;
16970 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16972 echo "Prototype: $try" ;;
16975 *) case "$usethreads" in
16976 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16978 d_setservent_r=undef
16979 setservent_r_proto=0
16983 *) setservent_r_proto=0
16987 : see if setsid exists
16988 set setsid d_setsid
16991 : see if setvbuf exists
16992 set setvbuf d_setvbuf
16995 : see if sfio.h is available
16999 : see if sfio library is available
17010 : Ok, but do we want to use it.
17014 true|$define|[yY]*) dflt='y';;
17017 echo "$package can use the sfio library, but it is experimental."
17018 case "$useperlio" in
17020 echo "For sfio also the PerlIO abstraction layer is needed."
17021 echo "Earlier you said you wouldn't want that."
17024 rp="You seem to have sfio available, do you want to try using it?"
17027 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17028 useperlio="$define"
17031 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17036 *) case "$usesfio" in
17037 true|$define|[yY]*)
17038 echo "Sorry, cannot find sfio on this machine." >&4
17039 echo "Ignoring your setting of usesfio=$usesfio." >&4
17048 $define) usesfio='true';;
17049 *) usesfio='false';;
17053 *) : Remove sfio from list of libraries to use
17056 echo "Removing unneeded -lsfio from library list" >&4
17057 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17060 echo "libs = $libs" >&4
17067 : see if shmctl exists
17068 set shmctl d_shmctl
17071 : see if shmget exists
17072 set shmget d_shmget
17075 : see if shmat exists
17078 : see what shmat returns
17081 $cat >shmat.c <<'END'
17082 #include <sys/shm.h>
17085 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17090 echo "and it returns ($shmattype)." >&4
17091 : see if a prototype for shmat is available
17092 xxx=`./findhdr sys/shm.h`
17093 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17094 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17105 set d_shmatprototype
17108 : see if shmdt exists
17112 : see how much of the 'shm*(2)' library is present.
17115 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17116 *"$undef"*) h_shm=false;;
17120 case "`ipcs 2>&1`" in
17121 "SVID shared memory"*"not configured"*)
17122 echo "Your $osname does not have the shm*(2) configured." >&4
17125 set shmctl d_shmctl
17127 set shmget d_shmget
17137 : we could also check for sys/ipc.h ...
17138 if $h_shm && $test `./findhdr sys/shm.h`; then
17139 echo "You have the full shm*(2) library." >&4
17142 echo "You don't have the full shm*(2) library." >&4
17148 : see if we have sigaction
17150 if set sigaction val -f d_sigaction; eval $csym; $val; then
17151 echo 'sigaction() found.' >&4
17154 #include <sys/types.h>
17155 #include <signal.h>
17156 #$i_stdlib I_STDLIB
17158 #include <stdlib.h>
17162 struct sigaction act, oact;
17164 oact.sa_handler = 0;
17165 /* so that act and oact are used */
17166 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17170 if eval $compile_ok; then
17173 echo "But you don't seem to have a useable struct sigaction." >&4
17177 echo 'sigaction NOT found.' >&4
17180 set d_sigaction; eval $setvar
17183 : see if this is a sunmath.h system
17184 set sunmath.h i_sunmath
17187 : see if signbit exists
17188 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17191 #$i_sunmath I_SUNMATH
17195 #ifdef I_SUNMATH /* Solaris special math library */
17196 # include <sunmath.h>
17199 int main(int argc, char **argv)
17203 if ((signbit(x) == 0) && (signbit(y) != 0))
17211 if eval $compile; then
17212 if $run ./try; then
17216 $echo "Signbit seems to be available, but doesn't work as I expected."
17217 $echo "I won't use it." >&4
17228 : see if sigprocmask exists
17229 set sigprocmask d_sigprocmask
17232 : see if sigsetjmp exists
17234 case "$d_sigsetjmp" in
17237 #include <setjmp.h>
17238 #$i_stdlib I_STDLIB
17240 #include <stdlib.h>
17246 if (sigsetjmp(env,1))
17249 siglongjmp(env, 1);
17254 if eval $compile; then
17255 if $run ./try >/dev/null 2>&1; then
17256 echo "POSIX sigsetjmp found." >&4
17260 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17266 echo "sigsetjmp not found." >&4
17270 *) val="$d_sigsetjmp"
17271 case "$d_sigsetjmp" in
17272 $define) echo "POSIX sigsetjmp found." >&4;;
17273 $undef) echo "sigsetjmp not found." >&4;;
17281 : see if snprintf exists
17282 set snprintf d_snprintf
17285 : see if vsnprintf exists
17286 set vsnprintf d_vsnprintf
17289 case "$d_snprintf-$d_vsnprintf" in
17292 Checking whether your snprintf() and vsnprintf() work okay...
17294 $cat >try.c <<'EOCP'
17295 /* v?snprintf testing logic courtesy of Russ Allbery.
17296 * According to C99:
17297 * - if the buffer is too short it still must be \0-terminated
17298 * - if the buffer is too short the potentially required length
17299 * must be returned and not -1
17300 * - if the buffer is NULL the potentially required length
17301 * must be returned and not -1 or core dump
17304 #include <stdarg.h>
17308 int test (char *format, ...)
17313 va_start (args, format);
17314 count = vsnprintf (buf, sizeof buf, format, args);
17321 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17322 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17326 if eval $compile; then
17329 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17331 Your snprintf() and snprintf() don't seem to be working okay.
17333 d_snprintf="$undef"
17334 d_vsnprintf="$undef"
17338 echo "(I can't seem to compile the test program--assuming they don't)"
17339 d_snprintf="$undef"
17340 d_vsnprintf="$undef"
17346 : see if sockatmark exists
17347 set sockatmark d_sockatmark
17350 : see if prototype for sockatmark is available
17352 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17355 : see if socks5_init exists
17356 set socks5_init d_socks5_init
17359 : see if sprintf returns the length of the string in the buffer as per ANSI
17360 $echo "Checking whether sprintf returns the length of the string..." >&4
17363 #$i_stdlib I_STDLIB
17365 #include <stdlib.h>
17367 #$i_string I_STRING
17369 # include <string.h>
17371 # include <strings.h>
17380 int check (size_t expect, int test) {
17381 size_t got = strlen(buffer);
17385 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17390 int main(int argc, char **argv) {
17393 check(sprintf(buffer, ""), ++test);
17394 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17395 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17402 d_sprintf_returns_strlen="$undef"
17403 if eval $compile; then
17407 sprintf returns the length of the string (as ANSI says it should)
17409 d_sprintf_returns_strlen="$define"
17412 sprintf does not return the length of the string (how old is this system?)
17414 d_sprintf_returns_strlen="$undef"
17420 : see if srand48_r exists
17421 set srand48_r d_srand48_r
17423 case "$d_srand48_r" in
17425 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17426 case "$d_srand48_r_proto:$usethreads" in
17427 ":define") d_srand48_r_proto=define
17428 set d_srand48_r_proto srand48_r $hdrs
17432 case "$d_srand48_r_proto" in
17434 case "$srand48_r_proto" in
17435 ''|0) try='int srand48_r(long, struct drand48_data*);'
17436 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17438 case "$srand48_r_proto" in
17439 ''|0) d_srand48_r=undef
17441 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17442 * ) case "$srand48_r_proto" in
17443 REENTRANT_PROTO*) ;;
17444 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17446 echo "Prototype: $try" ;;
17449 *) case "$usethreads" in
17450 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17457 *) srand48_r_proto=0
17461 : see if srandom_r exists
17462 set srandom_r d_srandom_r
17464 case "$d_srandom_r" in
17466 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17467 case "$d_srandom_r_proto:$usethreads" in
17468 ":define") d_srandom_r_proto=define
17469 set d_srandom_r_proto srandom_r $hdrs
17473 case "$d_srandom_r_proto" in
17475 case "$srandom_r_proto" in
17476 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17477 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17479 case "$srandom_r_proto" in
17480 ''|0) d_srandom_r=undef
17482 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17483 * ) case "$srandom_r_proto" in
17484 REENTRANT_PROTO*) ;;
17485 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17487 echo "Prototype: $try" ;;
17490 *) case "$usethreads" in
17491 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17498 *) srandom_r_proto=0
17502 : see if prototype for setresgid is available
17504 set d_sresgproto setresgid $i_unistd unistd.h
17507 : see if prototype for setresuid is available
17509 set d_sresuproto setresuid $i_unistd unistd.h
17512 : see if sys/stat.h is available
17513 set sys/stat.h i_sysstat
17516 : see if stat knows about block sizes
17518 echo "Checking to see if your struct stat has st_blocks field..." >&4
17519 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17522 : see if this is a sys/vfs.h system
17523 set sys/vfs.h i_sysvfs
17526 : see if this is a sys/statfs.h system
17527 set sys/statfs.h i_sysstatfs
17530 : Check for statfs_s
17532 echo "Checking to see if your system supports struct statfs..." >&4
17533 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
17535 case "$d_statfs_s" in
17536 "$define") echo "Yes, it does." ;;
17537 *) echo "No, it doesn't." ;;
17541 : see if struct statfs knows about f_flags
17542 case "$d_statfs_s" in
17545 echo "Checking to see if your struct statfs has f_flags field..." >&4
17546 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
17550 set d_statfs_f_flags
17554 case "$d_statfs_f_flags" in
17555 "$define") echo "Yes, it does." ;;
17556 *) echo "No, it doesn't." ;;
17559 : Check stream access
17561 Checking how to access stdio streams by file descriptor number...
17563 case "$stdio_stream_array" in
17564 '') $cat >try.c <<EOCP
17567 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17571 for s in _iob __iob __sF
17573 set try -DSTDIO_STREAM_ARRAY=$s
17574 if eval $compile; then
17575 case "`$run ./try`" in
17576 yes) stdio_stream_array=$s; break ;;
17582 case "$stdio_stream_array" in
17584 I can't figure out how to access stdio streams by file descriptor number.
17586 d_stdio_stream_array="$undef"
17589 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17591 d_stdio_stream_array="$define"
17595 : see if strcoll exists
17596 set strcoll d_strcoll
17599 : check for structure copying
17601 echo "Checking to see if your C compiler can copy structs..." >&4
17602 $cat >try.c <<'EOCP'
17612 if $cc -c try.c >/dev/null 2>&1 ; then
17614 echo "Yup, it can."
17617 echo "Nope, it can't."
17623 : see if strerror and/or sys_errlist[] exist
17625 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17626 if set strerror val -f d_strerror; eval $csym; $val; then
17627 echo 'strerror() found.' >&4
17628 d_strerror="$define"
17629 d_strerrm='strerror(e)'
17630 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17631 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17632 d_syserrlst="$define"
17634 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17635 d_syserrlst="$undef"
17637 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17638 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17639 echo 'strerror() found in string header.' >&4
17640 d_strerror="$define"
17641 d_strerrm='strerror(e)'
17642 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17643 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17644 d_syserrlst="$define"
17646 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17647 d_syserrlst="$undef"
17649 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17650 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17651 d_strerror="$undef"
17652 d_syserrlst="$define"
17653 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17655 echo 'strerror() and sys_errlist[] NOT found.' >&4
17656 d_strerror="$undef"
17657 d_syserrlst="$undef"
17658 d_strerrm='"unknown"'
17662 : see if strerror_r exists
17663 set strerror_r d_strerror_r
17665 case "$d_strerror_r" in
17667 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17668 case "$d_strerror_r_proto:$usethreads" in
17669 ":define") d_strerror_r_proto=define
17670 set d_strerror_r_proto strerror_r $hdrs
17674 case "$d_strerror_r_proto" in
17676 case "$strerror_r_proto" in
17677 ''|0) try='int strerror_r(int, char*, size_t);'
17678 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17680 case "$strerror_r_proto" in
17681 ''|0) try='int strerror_r(int, char*, int);'
17682 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17684 case "$strerror_r_proto" in
17685 ''|0) try='char* strerror_r(int, char*, size_t);'
17686 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17688 case "$strerror_r_proto" in
17689 ''|0) d_strerror_r=undef
17691 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17692 * ) case "$strerror_r_proto" in
17693 REENTRANT_PROTO*) ;;
17694 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17696 echo "Prototype: $try" ;;
17699 *) case "$usethreads" in
17700 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17707 *) strerror_r_proto=0
17711 : see if strftime exists
17712 set strftime d_strftime
17715 : see if strlcat exists
17716 set strlcat d_strlcat
17719 : see if strlcpy exists
17720 set strlcpy d_strlcpy
17723 : see if strtod exists
17724 set strtod d_strtod
17727 : see if strtol exists
17728 set strtol d_strtol
17731 : see if strtold exists
17732 set strtold d_strtold
17735 : see if strtoll exists
17736 set strtoll d_strtoll
17739 case "$d_longlong-$d_strtoll" in
17742 Checking whether your strtoll() works okay...
17744 $cat >try.c <<'EOCP'
17747 #define strtoll __strtoll
17750 #define strtoll _strtoll
17753 extern long long int strtoll(char *s, char **, int);
17754 static int bad = 0;
17755 int check(char *s, long long ell, int een) {
17758 gll = strtoll(s, 0, 10);
17759 if (!((gll == ell) && (errno == een)))
17763 check(" 1", 1LL, 0);
17764 check(" 0", 0LL, 0);
17765 check("-1", -1LL, 0);
17766 check("-9223372036854775808", -9223372036854775808LL, 0);
17767 check("-9223372036854775808", -9223372036854775808LL, 0);
17768 check(" 9223372036854775807", 9223372036854775807LL, 0);
17769 check("-9223372036854775808", -9223372036854775808LL, 0);
17770 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17771 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17777 if eval $compile; then
17780 ok) echo "Your strtoll() seems to be working okay." ;;
17782 Your strtoll() 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 strtoq exists
17795 set strtoq d_strtoq
17798 : see if strtoul exists
17799 set strtoul d_strtoul
17802 case "$d_strtoul" in
17805 Checking whether your strtoul() works okay...
17807 $cat >try.c <<'EOCP'
17810 extern unsigned long int strtoul(char *s, char **, int);
17811 static int bad = 0;
17812 void check(char *s, unsigned long eul, int een) {
17815 gul = strtoul(s, 0, 10);
17816 if (!((gul == eul) && (errno == een)))
17820 check(" 1", 1L, 0);
17821 check(" 0", 0L, 0);
17823 case "$longsize" in
17825 $cat >>try.c <<'EOCP'
17826 check("18446744073709551615", 18446744073709551615UL, 0);
17827 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17828 #if 0 /* strtoul() for /^-/ strings is undefined. */
17829 check("-1", 18446744073709551615UL, 0);
17830 check("-18446744073709551614", 2, 0);
17831 check("-18446744073709551615", 1, 0);
17832 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17833 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17838 $cat >>try.c <<'EOCP'
17839 check("4294967295", 4294967295UL, 0);
17840 check("4294967296", 4294967295UL, ERANGE);
17841 #if 0 /* strtoul() for /^-/ strings is undefined. */
17842 check("-1", 4294967295UL, 0);
17843 check("-4294967294", 2, 0);
17844 check("-4294967295", 1, 0);
17845 check("-4294967296", 4294967295UL, ERANGE);
17846 check("-4294967297", 4294967295UL, ERANGE);
17851 : Should we write these tests to be more portable by sprintf-ing
17852 : ~0 and then manipulating that char string as input for strtol?
17855 $cat >>try.c <<'EOCP'
17862 if eval $compile; then
17863 case "`$run ./try`" in
17864 ok) echo "Your strtoul() seems to be working okay." ;;
17866 Your strtoul() doesn't seem to be working okay.
17872 echo "(I can't seem to compile the test program--assuming it doesn't)"
17878 : see if strtoull exists
17879 set strtoull d_strtoull
17882 case "$d_longlong-$d_strtoull" in
17885 Checking whether your strtoull() works okay...
17887 $cat >try.c <<'EOCP'
17890 #define strtoull __strtoull
17893 extern unsigned long long int strtoull(char *s, char **, int);
17894 static int bad = 0;
17895 int check(char *s, long long eull, int een) {
17898 gull = strtoull(s, 0, 10);
17899 if (!((gull == eull) && (errno == een)))
17903 check(" 1", 1LL, 0);
17904 check(" 0", 0LL, 0);
17905 check("18446744073709551615", 18446744073709551615ULL, 0);
17906 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17907 #if 0 /* strtoull() for /^-/ strings is undefined. */
17908 check("-1", 18446744073709551615ULL, 0);
17909 check("-18446744073709551614", 2LL, 0);
17910 check("-18446744073709551615", 1LL, 0);
17911 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17912 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17919 if eval $compile; then
17920 case "`$run ./try`" in
17921 ok) echo "Your strtoull() seems to be working okay." ;;
17923 Your strtoull() doesn't seem to be working okay.
17925 d_strtoull="$undef"
17929 echo "(I can't seem to compile the test program--assuming it doesn't)"
17930 d_strtoull="$undef"
17935 : see if strtouq exists
17936 set strtouq d_strtouq
17939 case "$d_strtouq" in
17942 Checking whether your strtouq() works okay...
17944 $cat >try.c <<'EOCP'
17947 extern unsigned long long int strtouq(char *s, char **, int);
17948 static int bad = 0;
17949 void check(char *s, unsigned long long eull, int een) {
17950 unsigned long long gull;
17952 gull = strtouq(s, 0, 10);
17953 if (!((gull == eull) && (errno == een)))
17957 check(" 1", 1LL, 0);
17958 check(" 0", 0LL, 0);
17959 check("18446744073709551615", 18446744073709551615ULL, 0);
17960 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17961 #if 0 /* strtouq() for /^-/ strings is undefined. */
17962 check("-1", 18446744073709551615ULL, 0);
17963 check("-18446744073709551614", 2LL, 0);
17964 check("-18446744073709551615", 1LL, 0);
17965 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17966 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17974 if eval $compile; then
17975 case "`$run ./try`" in
17976 ok) echo "Your strtouq() seems to be working okay." ;;
17978 Your strtouq() doesn't seem to be working okay.
17984 echo "(I can't seem to compile the test program--assuming it doesn't)"
17990 : see if strxfrm exists
17991 set strxfrm d_strxfrm
17994 : see if symlink exists
17995 set symlink d_symlink
17998 : see if syscall exists
17999 set syscall d_syscall
18002 : see if prototype for syscall is available
18004 set d_syscallproto syscall $i_unistd unistd.h
18007 : see if sysconf exists
18008 set sysconf d_sysconf
18011 : see if system exists
18012 set system d_system
18015 : see if tcgetpgrp exists
18016 set tcgetpgrp d_tcgetpgrp
18019 : see if tcsetpgrp exists
18020 set tcsetpgrp d_tcsetpgrp
18023 : see if prototype for telldir is available
18025 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18028 : see if time exists
18030 if test "X$d_time" = X -o X"$timetype" = X; then
18031 if set time val -f d_time; eval $csym; $val; then
18032 echo 'time() found.' >&4
18034 rp="What is the type returned by time() on this system?"
18035 set time_t timetype long stdio.h sys/types.h
18038 echo 'time() not found, hope that will do.' >&4
18046 : see if this is a sys/times.h system
18047 set sys/times.h i_systimes
18050 : see if times exists
18052 if set times val -f d_times; eval $csym; $val; then
18053 echo 'times() found.' >&4
18056 case "$i_systimes" in
18057 "$define") inc='sys/times.h';;
18059 rp="What is the type returned by times() on this system?"
18060 set clock_t clocktype long stdio.h sys/types.h $inc
18063 echo 'times() NOT found, hope that will do.' >&4
18068 : see if tmpnam_r exists
18069 set tmpnam_r d_tmpnam_r
18071 case "$d_tmpnam_r" in
18073 hdrs="$i_systypes sys/types.h define stdio.h "
18074 case "$d_tmpnam_r_proto:$usethreads" in
18075 ":define") d_tmpnam_r_proto=define
18076 set d_tmpnam_r_proto tmpnam_r $hdrs
18080 case "$d_tmpnam_r_proto" in
18082 case "$tmpnam_r_proto" in
18083 ''|0) try='char* tmpnam_r(char*);'
18084 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18086 case "$tmpnam_r_proto" in
18087 ''|0) d_tmpnam_r=undef
18089 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18090 * ) case "$tmpnam_r_proto" in
18091 REENTRANT_PROTO*) ;;
18092 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18094 echo "Prototype: $try" ;;
18097 *) case "$usethreads" in
18098 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18105 *) tmpnam_r_proto=0
18109 : see if truncate exists
18110 set truncate d_truncate
18113 : see if ttyname_r exists
18114 set ttyname_r d_ttyname_r
18116 case "$d_ttyname_r" in
18118 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18119 case "$d_ttyname_r_proto:$usethreads" in
18120 ":define") d_ttyname_r_proto=define
18121 set d_ttyname_r_proto ttyname_r $hdrs
18125 case "$d_ttyname_r_proto" in
18127 case "$ttyname_r_proto" in
18128 ''|0) try='int ttyname_r(int, char*, size_t);'
18129 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18131 case "$ttyname_r_proto" in
18132 ''|0) try='int ttyname_r(int, char*, int);'
18133 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18135 case "$ttyname_r_proto" in
18136 ''|0) try='char* ttyname_r(int, char*, int);'
18137 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18139 case "$ttyname_r_proto" in
18140 ''|0) d_ttyname_r=undef
18142 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18143 * ) case "$ttyname_r_proto" in
18144 REENTRANT_PROTO*) ;;
18145 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18147 echo "Prototype: $try" ;;
18150 *) case "$usethreads" in
18151 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18158 *) ttyname_r_proto=0
18162 : see if tzname[] exists
18164 if set tzname val -a d_tzname; eval $csym; $val; then
18166 echo 'tzname[] found.' >&4
18169 echo 'tzname[] NOT found.' >&4
18174 : Check if is a multiplatform env
18176 next|rhapsody|darwin) multiarch="$define" ;;
18178 case "$multiarch" in
18179 ''|[nN]*) multiarch="$undef" ;;
18182 : check for ordering of bytes in a UV
18184 case "$usecrosscompile$multiarch" in
18187 You seem to be either cross-compiling or doing a multiarchitecture build,
18188 skipping the byteorder check.
18194 case "$byteorder" in
18197 In the following, larger digits indicate more significance. A big-endian
18198 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18199 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18200 machines may have weird orders like 3412. A Cray will report 87654321,
18201 an Alpha will report 12345678. If the test program works the default is
18203 I'm now running the test program...
18207 #$i_stdlib I_STDLIB
18209 #include <stdlib.h>
18211 #include <sys/types.h>
18212 typedef $uvtype UV;
18222 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18224 u.l = (UV)0x04030201;
18225 for (i = 0; i < $uvsize; i++)
18226 printf("%c", u.c[i]+'0');
18233 if eval $compile && $run ./try > /dev/null; then
18236 [1-4][1-4][1-4][1-4]|12345678|87654321)
18237 echo "(The test program ran ok.)"
18238 echo "byteorder=$dflt"
18241 ????|????????) echo "(The test program ran ok.)" ;;
18242 *) echo "(The test program didn't run right for some reason.)" ;;
18247 (I can't seem to compile the test program. Guessing big-endian...)
18250 case "$xxx_prompt" in
18252 rp="What is the order of bytes in $uvtype?"
18265 : Checking 32bit aligndness
18268 Checking to see whether you can access character data unalignedly...
18270 case "$d_u32align" in
18271 '') $cat >try.c <<EOCP
18273 #$i_stdlib I_STDLIB
18275 #include <stdlib.h>
18277 #define U32 $u32type
18278 #define BYTEORDER 0x$byteorder
18280 #include <signal.h>
18282 $signal_t bletch(int s) { exit(4); }
18285 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18290 if (sizeof(U32) != 4) {
18291 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18298 signal(SIGBUS, bletch);
18310 for (i = 0; i < 4; i++) {
18311 up = (U32*)(buf + i);
18312 if (! ((*up == 1 << (8*i)) || /* big-endian */
18313 (*up == 1 << (8*(3-i))) /* little-endian */
18317 printf("read failed (%x)\n", *up);
18323 for (i = 0; i < 4; i++) {
18324 up = (U32*)(buf + i);
18326 if (*up != 0xBeef) {
18327 printf("write failed (%x)\n", *up);
18341 if eval $compile_ok; then
18342 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18343 $run ./try 2>&1 >/dev/null
18346 You can access character data pretty unalignedly.
18348 d_u32align="$undef"
18351 It seems that you must access character data in an aligned manner.
18353 d_u32align="$define"
18357 rp='Can you access character data at unaligned addresses?'
18361 [yY]*) d_u32align="$undef" ;;
18362 *) d_u32align="$define" ;;
18369 : see if ualarm exists
18370 set ualarm d_ualarm
18373 : see if umask exists
18377 : see if unordered exists
18378 set unordered d_unordered
18381 : see if unsetenv exists
18382 set unsetenv d_unsetenv
18385 : see if usleep exists
18386 set usleep d_usleep
18389 : see if prototype for usleep is available
18391 set d_usleepproto usleep $i_unistd unistd.h
18394 : see if ustat exists
18398 : see if closedir exists
18399 set closedir d_closedir
18402 case "$d_closedir" in
18405 echo "Checking whether closedir() returns a status..." >&4
18407 #$i_dirent I_DIRENT /**/
18408 #$i_sysdir I_SYS_DIR /**/
18409 #$i_sysndir I_SYS_NDIR /**/
18410 #$i_systypes I_SYS_TYPES /**/
18412 #if defined(I_SYS_TYPES)
18413 #include <sys/types.h>
18415 #if defined(I_DIRENT)
18416 #include <dirent.h>
18417 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18418 #include <sys/dir.h>
18422 #include <sys/ndir.h>
18426 #include <ndir.h> /* may be wrong in the future */
18428 #include <sys/dir.h>
18433 int main() { return closedir(opendir(".")); }
18436 if eval $compile_ok; then
18437 if $run ./try > /dev/null 2>&1 ; then
18438 echo "Yes, it does."
18441 echo "No, it doesn't."
18445 echo "(I can't seem to compile the test program--assuming it doesn't)"
18453 set d_void_closedir
18457 : see if there is a wait4
18461 : see if waitpid exists
18462 set waitpid d_waitpid
18465 : see if wcstombs exists
18466 set wcstombs d_wcstombs
18469 : see if wctomb exists
18470 set wctomb d_wctomb
18473 : see if writev exists
18474 set writev d_writev
18477 : preserve RCS keywords in files with variable substitution, grrr
18482 Revision='$Revision'
18484 : check for alignment requirements
18486 case "$usecrosscompile$multiarch" in
18489 You seem to be either cross-compiling or doing a multiarchitecture build,
18490 skipping the memory alignment check.
18493 case "$alignbytes" in
18494 '') alignbytes=8 ;;
18498 case "$alignbytes" in
18499 '') echo "Checking alignment constraints..." >&4
18500 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18501 $cat >try.c <<'EOCP'
18502 typedef long double NV;
18505 $cat >try.c <<'EOCP'
18509 $cat >>try.c <<'EOCP'
18517 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18522 if eval $compile_ok; then
18526 echo "(I can't seem to compile the test program...)"
18529 *) dflt="$alignbytes"
18532 rp="Doubles must be aligned on a how-many-byte boundary?"
18540 : set the base revision
18543 : how do we concatenate cpp tokens here?
18545 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18546 $cat >cpp_stuff.c <<'EOCP'
18547 #define RCAT(a,b)a/**/b
18548 #define ACAT(a,b)a ## b
18552 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18553 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18554 echo "Oh! Smells like ANSI's been here." >&4
18555 echo "We can catify or stringify, separately or together!"
18557 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18558 echo "Ah, yes! The good old days!" >&4
18559 echo "However, in the good old days we don't know how to stringify and"
18560 echo "catify at the same time."
18564 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18565 You're going to have to edit the values of CAT[2-5] in config.h...
18567 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18571 : see if this is a db.h system
18577 : Check db version.
18579 echo "Checking Berkeley DB version ..." >&4
18585 #include <sys/types.h>
18587 #$i_stdlib I_STDLIB
18589 #include <stdlib.h>
18592 int main(int argc, char *argv[])
18594 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18595 int Major, Minor, Patch ;
18596 unsigned long Version ;
18597 (void)db_version(&Major, &Minor, &Patch) ;
18599 printf("%d %d %d %d %d %d\n",
18600 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18601 Major, Minor, Patch);
18604 printf("You have Berkeley DB Version 2 or greater.\n");
18606 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18607 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18608 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18609 Major, Minor, Patch) ;
18611 /* check that db.h & libdb are compatible */
18612 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18613 printf("db.h and libdb are incompatible.\n") ;
18617 printf("db.h and libdb are compatible.\n") ;
18619 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18620 + DB_VERSION_PATCH ;
18622 /* needs to be >= 2.3.4 */
18623 if (Version < 2003004) {
18624 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18625 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18631 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18636 printf("You have Berkeley DB Version 1.\n");
18637 exit(0); /* DB version < 2: the coast is clear. */
18639 exit(1); /* <db.h> not Berkeley DB? */
18645 if eval $compile_ok && $run ./try; then
18646 echo 'Looks OK.' >&4
18648 db_version_major=$1
18649 db_version_minor=$2
18650 db_version_patch=$3
18652 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18656 : Remove db from list of libraries to use
18657 echo "Removing unusable -ldb from library list" >&4
18658 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18661 echo "libs = $libs" >&4
18671 : Check the return type needed for hash
18673 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18679 #include <sys/types.h>
18682 #ifndef DB_VERSION_MAJOR
18683 u_int32_t hash_cb (ptr, size)
18691 info.hash = hash_cb;
18695 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18696 if $contains warning try.out >>/dev/null 2>&1 ; then
18699 db_hashtype='u_int32_t'
18702 : XXX Maybe we should just give up here.
18703 db_hashtype=u_int32_t
18705 echo "Help: I can't seem to compile the db test program." >&4
18706 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18709 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18711 *) db_hashtype=u_int32_t
18716 : Check the return type needed for prefix
18718 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18724 #include <sys/types.h>
18727 #ifndef DB_VERSION_MAJOR
18728 size_t prefix_cb (key1, key2)
18736 info.prefix = prefix_cb;
18740 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18741 if $contains warning try.out >>/dev/null 2>&1 ; then
18742 db_prefixtype='int'
18744 db_prefixtype='size_t'
18747 db_prefixtype='size_t'
18748 : XXX Maybe we should just give up here.
18750 echo "Help: I can't seem to compile the db test program." >&4
18751 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18754 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18756 *) db_prefixtype='size_t'
18760 : How can we generate normalized random numbers ?
18762 echo "Looking for a random number function..." >&4
18763 case "$randfunc" in
18765 if set drand48 val -f; eval $csym; $val; then
18767 echo "Good, found drand48()." >&4
18768 elif set random val -f; eval $csym; $val; then
18770 echo "OK, found random()." >&4
18773 echo "Yick, looks like I have to use rand()." >&4
18784 *-Dmy_rand=*|*-Dmy_srand=*)
18785 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18786 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18787 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18788 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18792 while $test "$cont"; do
18793 rp="Use which function to generate random numbers?"
18795 if $test "$ans" = "$dflt"; then
18801 if set $ans val -f; eval $csym; $val; then
18805 rp="I cannot find function $ans. Use that name anyway?"
18814 case "$randfunc" in
18816 drand01="drand48()"
18822 case "$randbits" in
18824 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18826 #$i_unistd I_UNISTD
18827 #$i_stdlib I_STDLIB
18830 # include <unistd.h>
18833 # include <stdlib.h>
18838 register unsigned long tmp;
18839 register unsigned long max = 0L;
18841 for (i = 1000; i; i--) {
18842 tmp = (unsigned long) $randfunc();
18843 if (tmp > max) max = tmp;
18845 for (i = 0; max; i++)
18851 if eval $compile_ok; then
18855 echo "(I can't seem to compile the test program...)"
18862 rp="How many bits does your $randfunc() function produce?"
18866 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18867 seedfunc="s$randfunc"
18868 randseedtype=unsigned
18872 rp="How many bits does your $randfunc() function produce?"
18875 seedfunc="s$randfunc"
18876 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18877 if set $seedfunc val -f; eval $csym; $val; then
18878 echo "(Using $seedfunc() to seed random generator)"
18880 echo "(Warning: no $seedfunc() to seed random generator)"
18883 randseedtype=unsigned
18890 : Determine if this is an EBCDIC system
18892 echo "Determining whether or not we are on an EBCDIC system..." >&4
18893 $cat >try.c <<'EOM'
18896 if ('M'==0xd4) return 0;
18903 if eval $compile_ok; then
18904 if $run ./try; then
18905 echo "You seem to speak EBCDIC." >&4
18908 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18911 echo "I'm unable to compile the test program." >&4
18912 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18918 : Check how to flush
18921 Checking how to flush all pending stdio output...
18923 # I only know how to find the first 32 possibly open files on SunOS.
18924 # See also hints/sunos_4_1.sh and util.c --AD
18926 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18928 $cat >>try.c <<EOCP
18930 #$i_stdlib I_STDLIB
18932 #include <stdlib.h>
18934 #$i_unistd I_UNISTD
18936 # include <unistd.h>
18938 #$d_sysconf HAS_SYSCONF
18939 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18940 #ifdef HAS_STDIO_STREAM_ARRAY
18941 # define STDIO_STREAM_ARRAY $stdio_stream_array
18946 p = fopen("try.out", "w");
18950 # ifdef TRY_FPRINTF
18954 #ifdef TRY_FFLUSH_NULL
18957 #ifdef TRY_FFLUSH_ALL
18959 long open_max = -1;
18960 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18961 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18963 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18964 open_max = sysconf(_SC_OPEN_MAX);
18967 open_max = FOPEN_MAX;
18970 open_max = OPEN_MAX;
18979 # ifdef HAS_STDIO_STREAM_ARRAY
18980 if (open_max > 0) {
18982 for (i = 0; i < open_max; i++)
18983 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18984 STDIO_STREAM_ARRAY[i]._file < open_max &&
18985 STDIO_STREAM_ARRAY[i]._flag)
18986 fflush(&STDIO_STREAM_ARRAY[i]);
18994 : first we have to find out how _not_ to flush
18996 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18998 set try -DTRY_FPUTC
18999 if eval $compile; then
19000 $run ./try 2>/dev/null
19003 if $test ! -s try.out -a "X$code" = X42; then
19009 set try -DTRY_FPRINTF
19010 if eval $compile; then
19011 $run ./try 2>/dev/null
19014 if $test ! -s try.out -a "X$code" = X42; then
19015 output=-DTRY_FPRINTF
19021 : check for fflush NULL behaviour
19022 case "$fflushNULL" in
19023 '') set try -DTRY_FFLUSH_NULL $output
19024 if eval $compile; then
19025 $run ./try 2>/dev/null
19028 if $test -s try.out -a "X$code" = X42; then
19029 fflushNULL="`$cat try.out`"
19031 if $test "X$code" != X42; then
19033 (If this test failed, don't worry, we'll try another method shortly.)
19039 case "$fflushNULL" in
19041 Your fflush(NULL) works okay for output streams.
19042 Let's see if it clobbers input pipes...
19044 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19045 # bug that improperly flushes the input end of pipes. So we avoid the
19046 # autoflush on fork/system/exec support for now. :-(
19047 $cat >tryp.c <<EOCP
19050 main(int argc, char **argv)
19056 while ((i = getc(stdin)) != -1
19057 && (*bp++ = i) != '\n'
19058 && bp < &buf[1024])
19061 fprintf(stdout, "%s", buf);
19069 fflushNULL="$define"
19071 if eval $compile; then
19073 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19074 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19076 fflush(NULL) seems to behave okay with input streams.
19078 fflushNULL="$define"
19081 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19083 fflushNULL="$undef"
19086 $rm -f core tryp.c tryp.core core.tryp.*
19089 Your fflush(NULL) isn't working (contrary to ANSI C).
19091 fflushNULL="$undef"
19094 Cannot figure out whether your fflush(NULL) works or not.
19095 I'm assuming it doesn't (contrary to ANSI C).
19097 fflushNULL="$undef"
19101 $define|true|[yY]*)
19102 fflushNULL="$define"
19105 fflushNULL="$undef"
19108 : check explicit looping only if NULL did not work, and if the pipe
19109 : bug does not show up on an explicit flush too
19110 case "$fflushNULL" in
19112 $cat >tryp.c <<EOCP
19115 main(int argc, char **argv)
19121 while ((i = getc(stdin)) != -1
19122 && (*bp++ = i) != '\n'
19123 && bp < &buf[1024])
19126 fprintf(stdout, "%s", buf);
19135 if eval $compile; then
19137 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19138 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19140 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19142 : now check for fflushall behaviour
19143 case "$fflushall" in
19144 '') set try -DTRY_FFLUSH_ALL $output
19145 if eval $compile; then
19147 (Now testing the other method--but note that this also may fail.)
19149 $run ./try 2>/dev/null
19152 if $test -s try.out -a "X$code" = X42; then
19153 fflushall="`$cat try.out`"
19157 case "$fflushall" in
19159 Whew. Flushing explicitly all the stdio streams works.
19161 fflushall="$define"
19164 Sigh. Flushing explicitly all the stdio streams doesn't work.
19169 Cannot figure out whether flushing stdio streams explicitly works or not.
19170 I'm assuming it doesn't.
19176 "$define"|true|[yY]*)
19177 fflushall="$define"
19185 All is futile. Even fflush(stdin) clobbers input pipes!
19192 $rm -f core tryp.c tryp.core core.tryp.*
19194 *) fflushall="$undef"
19198 case "$fflushNULL$fflushall" in
19201 OK, I give up. I cannot figure out how to flush pending stdio output.
19202 We won't be flushing handles at all before fork/exec/popen.
19208 : Store the full pathname to the ar program for use in the C program
19209 : Respect a hint or command line value for full_ar.
19214 : Store the full pathname to the sed program for use in the C program
19217 : see what type gids are declared as in the kernel
19219 echo "Looking for the type for group ids returned by getgid()."
19220 set gid_t gidtype xxx stdio.h sys/types.h
19224 xxx=`./findhdr sys/user.h`
19225 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19227 unsigned) dflt="$1 $2" ;;
19231 *) dflt="$gidtype";;
19234 gid_t) echo "gid_t found." ;;
19235 *) rp="What is the type for group ids returned by getgid()?"
19241 : Check the size of GID
19244 *_t) zzz="$gidtype" ;;
19247 echo "Checking the size of $zzz..." >&4
19249 #include <sys/types.h>
19251 #$i_stdlib I_STDLIB
19253 #include <stdlib.h>
19256 printf("%d\n", (int)sizeof($gidtype));
19261 if eval $compile_ok; then
19265 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19268 echo "Your $zzz is $gidsize bytes long."
19273 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19277 : Check if GID is signed
19280 *_t) zzz="$gidtype" ;;
19283 echo "Checking the sign of $zzz..." >&4
19285 #include <sys/types.h>
19296 if eval $compile; then
19300 echo "(I can't execute the test program--guessing unsigned.)" >&4
19304 1) echo "Your $zzz is unsigned." ;;
19305 -1) echo "Your $zzz is signed." ;;
19311 echo "(I can't compile the test program--guessing unsigned.)" >&4
19315 : Check 64bit sizes
19318 if $test X"$quadtype" != X; then
19320 echo "Checking how to print 64-bit integers..." >&4
19322 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19323 $cat >try.c <<'EOCP'
19324 #include <sys/types.h>
19327 int q = 12345678901;
19328 printf("%ld\n", q);
19332 if eval $compile; then
19336 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19337 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19338 echo "We will use %d."
19344 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19345 $cat >try.c <<'EOCP'
19346 #include <sys/types.h>
19349 long q = 12345678901;
19350 printf("%ld\n", q);
19354 if eval $compile; then
19358 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19359 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19360 echo "We will use %ld."
19366 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19367 $cat >try.c <<'EOCP'
19368 #include <sys/types.h>
19369 #include <inttypes.h>
19372 int64_t q = 12345678901;
19373 printf("%" PRId64 "\n", q);
19377 if eval $compile; then
19381 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19382 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19383 echo "We will use the C9X style."
19389 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19391 #include <sys/types.h>
19394 $quadtype q = 12345678901;
19395 printf("%Ld\n", q);
19399 if eval $compile; then
19403 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19404 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19405 echo "We will use %Ld."
19411 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19412 $cat >try.c <<'EOCP'
19413 #include <sys/types.h>
19416 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19417 printf("%lld\n", q);
19421 if eval $compile; then
19425 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19426 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19427 echo "We will use the %lld style."
19433 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19435 #include <sys/types.h>
19438 $quadtype q = 12345678901;
19439 printf("%qd\n", q);
19443 if eval $compile; then
19447 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19448 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19449 echo "We will use %qd."
19455 if $test X"$sPRId64" = X; then
19456 echo "Cannot figure out how to print 64-bit integers." >&4
19463 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19464 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19466 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19467 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19471 : Check format strings for internal types
19473 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19475 if $test X"$ivsize" = X8; then
19476 ivdformat="$sPRId64"
19477 uvuformat="$sPRIu64"
19478 uvoformat="$sPRIo64"
19479 uvxformat="$sPRIx64"
19480 uvXUformat="$sPRIXU64"
19482 if $test X"$ivsize" = X"$longsize"; then
19489 if $test X"$ivsize" = X"$intsize"; then
19497 if $test X"$ivsize" = X"$shortsize"; then
19508 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19509 nveformat="$sPRIeldbl"
19510 nvfformat="$sPRIfldbl"
19511 nvgformat="$sPRIgldbl"
19512 nvEUformat="$sPRIEUldbl"
19513 nvFUformat="$sPRIFUldbl"
19514 nvGUformat="$sPRIGUldbl"
19524 case "$ivdformat" in
19525 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19530 : Check format string for GID
19533 $echo "Checking the format string to be used for gids..." >&4
19536 -1) if $test X"$gidsize" = X"$ivsize"; then
19537 gidformat="$ivdformat"
19539 if $test X"$gidsize" = X"$longsize"; then
19542 if $test X"$gidsize" = X"$intsize"; then
19545 if $test X"$gidsize" = X"$shortsize"; then
19552 *) if $test X"$gidsize" = X"$uvsize"; then
19553 gidformat="$uvuformat"
19555 if $test X"$gidsize" = X"$longsize"; then
19558 if $test X"$gidsize" = X"$intsize"; then
19561 if $test X"$gidsize" = X"$shortsize"; then
19570 : see if getgroups exists
19571 set getgroups d_getgrps
19574 : see if setgroups exists
19575 set setgroups d_setgrps
19578 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19580 case "$d_getgrps$d_setgrps" in
19582 case "$groupstype" in
19583 '') dflt="$gidtype" ;;
19584 *) dflt="$groupstype" ;;
19587 What type of pointer is the second argument to getgroups() and setgroups()?
19588 Usually this is the same as group ids, $gidtype, but not always.
19591 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19595 *) groupstype="$gidtype";;
19598 : MAD = Misc Attribute Definition
19600 if $test $patchlevel -lt 9; then
19601 : MAD is not available in 5.8.x or earlier.
19605 $define|true|[yY]*) dflt='y' ;;
19610 Would you like to build with Misc Attribute Decoration? This is development
19611 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19612 overhead on the interpreter.
19614 If this doesn't make any sense to you, just accept the default '$dflt'.
19616 rp='Build Perl with MAD?'
19621 madlyh='madly.h madly.act madly.tab'
19623 madlyobj="madly$_o" ;;
19633 echo "Checking if your $make program sets \$(MAKE)..." >&4
19634 case "$make_set_make" in
19636 $sed 's/^X //' > testmake.mak << 'EOF'
19638 X @echo 'maketemp="$(MAKE)"'
19640 case "`$make -f testmake.mak 2>/dev/null`" in
19641 *maketemp=*) make_set_make='#' ;;
19642 *) make_set_make="MAKE=$make" ;;
19644 $rm -f testmake.mak
19647 case "$make_set_make" in
19648 '#') echo "Yup, it does.";;
19649 *) echo "Nope, it doesn't.";;
19652 : see what type is used for mode_t
19653 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19654 set mode_t modetype int stdio.h sys/types.h
19657 : see if we need va_copy
19659 case "$i_stdarg" in
19662 #include <stdarg.h>
19664 #$i_stdlib I_STDLIB
19666 #include <stdlib.h>
19668 #include <signal.h>
19671 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19673 return vfprintf(f, fmt, *valp);
19677 myvfprintf(FILE *f, const char *fmt, va_list val)
19679 return ivfprintf(f, fmt, &val);
19683 myprintf(char *fmt, ...)
19686 va_start(val, fmt);
19687 return myvfprintf(stdout, fmt, val);
19691 main(int ac, char **av)
19693 signal(SIGSEGV, exit);
19695 myprintf("%s%cs all right, then\n", "that", '\'');
19700 if eval $compile && $run ./try 2>&1 >/dev/null; then
19701 case "`$run ./try`" in
19702 "that's all right, then")
19708 yes) echo "It seems that you don't need va_copy()." >&4
19709 need_va_copy="$undef"
19711 *) echo "It seems that va_copy() or similar will be needed." >&4
19712 need_va_copy="$define"
19717 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19721 : see what type is used for size_t
19722 rp="What is the type used for the length parameter for string functions?"
19723 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19726 : check for type of arguments to gethostbyaddr.
19727 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19728 case "$d_gethbyaddr" in
19732 Checking to see what type of arguments are accepted by gethostbyaddr().
19734 hdrs="$define sys/types.h
19735 $d_socket sys/socket.h
19736 $i_niin netinet/in.h
19738 $i_unistd unistd.h"
19739 : The first arg can 'char *' or 'void *'
19740 : The second arg is some of integral type
19741 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19742 for yyy in size_t long int; do
19743 case "$netdb_host_type" in
19744 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19745 if ./protochk "$try" $hdrs; then
19746 echo "Your system accepts $xxx for the first arg."
19747 echo "...and $yyy for the second arg."
19748 netdb_host_type="$xxx"
19749 netdb_hlen_type="$yyy"
19755 : In case none of those worked, prompt the user.
19756 case "$netdb_host_type" in
19757 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19760 netdb_host_type=$ans
19761 rp='What is the type for the 2nd argument to gethostbyaddr?'
19764 netdb_hlen_type=$ans
19768 *) : no gethostbyaddr, so pick harmless defaults
19769 netdb_host_type='char *'
19770 netdb_hlen_type="$sizetype"
19773 # Remove the "const" if needed. -- but then we'll have a
19775 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19778 : check for type of argument to gethostbyname.
19779 if test "X$netdb_name_type" = X ; then
19780 case "$d_gethbyname" in
19784 Checking to see what type of argument is accepted by gethostbyname().
19786 hdrs="$define sys/types.h
19787 $d_socket sys/socket.h
19788 $i_niin netinet/in.h
19790 $i_unistd unistd.h"
19791 for xxx in "const char *" "char *"; do
19792 case "$netdb_name_type" in
19793 '') try="extern struct hostent *gethostbyname($xxx);"
19794 if ./protochk "$try" $hdrs; then
19795 echo "Your system accepts $xxx."
19796 netdb_name_type="$xxx"
19801 : In case none of those worked, prompt the user.
19802 case "$netdb_name_type" in
19803 '') rp='What is the type for the 1st argument to gethostbyname?'
19806 netdb_name_type=$ans
19810 *) : no gethostbyname, so pick harmless default
19811 netdb_name_type='char *'
19816 : check for type of 1st argument to getnetbyaddr.
19817 if test "X$netdb_net_type" = X ; then
19818 case "$d_getnbyaddr" in
19822 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19824 hdrs="$define sys/types.h
19825 $d_socket sys/socket.h
19826 $i_niin netinet/in.h
19828 $i_unistd unistd.h"
19829 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19830 case "$netdb_net_type" in
19831 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19832 if ./protochk "$try" $hdrs; then
19833 echo "Your system accepts $xxx."
19834 netdb_net_type="$xxx"
19839 : In case none of those worked, prompt the user.
19840 case "$netdb_net_type" in
19841 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19844 netdb_net_type=$ans
19848 *) : no getnetbyaddr, so pick harmless default
19849 netdb_net_type='long'
19853 : locate the preferred pager for this system
19860 [a-zA-Z]:/*) dflt=$pg;;
19864 [a-zA-Z]:/*) dflt=$more;;
19868 [a-zA-Z]:/*) dflt=$less;;
19871 '') dflt=/usr/ucb/more;;
19875 : Instruct ./getfile to trust the hinted or previous pager value,
19876 : even if it does not begin with a slash. For example, on os2,
19877 : pager might be cmd /c more. See comments in UU/getfile.
19882 rp='What pager is used on your system?'
19886 : see what type pids are declared as in the kernel
19887 rp="What is the type of process ids on this system?"
19888 set pid_t pidtype int stdio.h sys/types.h
19891 : see if ar generates random libraries by itself
19893 echo "Checking how to generate random libraries on your machine..." >&4
19894 echo 'int bar1() { return bar2(); }' > bar1.c
19895 echo 'int bar2() { return 2; }' > bar2.c
19897 #$i_stdlib I_STDLIB
19899 #include <stdlib.h>
19901 int main() { printf("%d\n", bar1()); exit(0); }
19903 $cc $ccflags -c bar1.c >/dev/null 2>&1
19904 $cc $ccflags -c bar2.c >/dev/null 2>&1
19905 $cc $ccflags -c foo.c >/dev/null 2>&1
19906 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19907 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19908 $run ./foobar >/dev/null 2>&1; then
19909 echo "$ar appears to generate random libraries itself."
19911 if [ "X$ranlib" = "X" ]; then
19914 elif $ar s bar$_a >/dev/null 2>&1 &&
19915 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19916 $run ./foobar >/dev/null 2>&1; then
19917 echo "a table of contents needs to be added with '$ar s'."
19920 elif $ar ts bar$_a >/dev/null 2>&1 &&
19921 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19922 $run ./foobar >/dev/null 2>&1; then
19923 echo "a table of contents needs to be added with '$ar ts'."
19930 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19931 $test -f $ranlib || ranlib=''
19934 if $test -n "$ranlib"; then
19935 echo "your system has '$ranlib'; we'll use that."
19938 echo "your system doesn't seem to support random libraries"
19939 echo "so we'll use lorder and tsort to order the libraries."
19946 : check for type of arguments to select.
19947 case "$selecttype" in
19948 '') case "$d_select" in
19952 Checking to see what type of arguments are accepted by select().
19954 hdrs="$define sys/types.h
19955 $i_systime sys/time.h
19956 $i_sysselct sys/select.h
19957 $d_socket sys/socket.h"
19958 : The first arg can be int, unsigned, or size_t
19959 : The last arg may or may not be 'const'
19961 : void pointer has been seen but using that
19962 : breaks the selectminbits test
19963 for xxx in 'fd_set *' 'int *'; do
19964 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19965 for tmo in 'struct timeval *' 'const struct timeval *'; do
19967 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19968 if ./protochk "$try" $hdrs; then
19969 echo "Your system accepts $xxx."
19978 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19979 case "$d_fd_set" in
19980 $define) dflt="fd_set *" ;;
19989 *) : no select, so pick a harmless default
19996 : check for the select 'width'
19997 case "$selectminbits" in
19998 '') safebits=`expr $ptrsize \* 8`
19999 case "$d_select" in
20003 Checking to see on how many bits at a time your select() operates...
20006 #include <sys/types.h>
20008 #$i_systime I_SYS_TIME
20009 #$i_systimek I_SYS_TIME_KERNEL
20014 # ifdef I_SYS_TIME_KERNEL
20017 # include <sys/time.h>
20018 # ifdef I_SYS_TIME_KERNEL
20022 #$i_sysselct I_SYS_SELECT
20023 #ifdef I_SYS_SELECT
20024 #include <sys/select.h>
20026 #$d_socket HAS_SOCKET
20028 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20031 #$i_stdlib I_STDLIB
20033 #include <stdlib.h>
20036 #define S sizeof(*(b))
20038 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20039 #define NBITS (NBYTES * 8)
20041 char *s = (char *)malloc(NBYTES);
20050 fp = fopen("try.c", "r");
20056 b = ($selecttype)s;
20057 for (i = 0; i < NBITS; i++)
20061 select(fd + 1, b, 0, 0, &t);
20062 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20064 printf("%d\n", i + 1);
20069 if eval $compile_ok; then
20070 selectminbits=`$run ./try`
20071 case "$selectminbits" in
20073 Cannot figure out on how many bits at a time your select() operates.
20074 I'll play safe and guess it is $safebits bits.
20076 selectminbits=$safebits
20077 bits="$safebits bits"
20080 *) bits="$selectminbits bits" ;;
20082 echo "Your select() operates on $bits at a time." >&4
20084 rp='What is the minimum number of bits your select() operates on?'
20085 case "$byteorder" in
20086 12345678) dflt=64 ;;
20092 selectminbits="$val"
20096 *) : no select, so pick a harmless default
20097 selectminbits=$safebits
20103 : Trace out the files included by signal.h, then look for SIGxxx names.
20104 if [ "X$fieldn" = X ]; then
20105 : Just make some guesses. We check them later.
20106 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20108 xxx=`echo '#include <signal.h>' |
20109 $cppstdin $cppminus $cppflags 2>/dev/null |
20110 $grep '^[ ]*#.*include' |
20111 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20112 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20115 for xx in $xxx /dev/null ; do
20116 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20118 case "$xxxfiles" in
20119 '') xxxfiles=`./findhdr signal.h` ;;
20122 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20123 print substr($2, 4, 20)
20125 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20126 print substr($3, 4, 20)
20128 : Append some common names just in case the awk scan failed.
20129 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20130 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20131 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20132 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20133 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20135 : generate a few handy files for later
20136 $cat > signal.c <<EOCP
20137 #include <sys/types.h>
20138 #include <signal.h>
20139 #$i_stdlib I_STDLIB
20141 #include <stdlib.h>
20146 /* Strange style to avoid deeply-nested #if/#else/#endif */
20149 # define NSIG (_NSIG)
20155 # define NSIG (SIGMAX+1)
20161 # define NSIG (SIG_MAX+1)
20167 # define NSIG (_SIG_MAX+1)
20173 # define NSIG (MAXSIG+1)
20179 # define NSIG (MAX_SIG+1)
20184 # ifdef SIGARRAYSIZE
20185 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20191 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20195 /* Default to some arbitrary number that's big enough to get most
20196 of the common signals.
20202 printf("NSIG %d\n", NSIG);
20208 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20210 printf "#ifdef SIG"; printf $1; printf "\n"
20211 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20212 printf $1; printf ");\n"
20216 printf "#endif /* JUST_NSIG */\n";
20217 printf "exit(0);\n}\n";
20220 $cat >signal.awk <<'EOP'
20221 BEGIN { ndups = 0 }
20222 $1 ~ /^NSIG$/ { nsig = $2 }
20223 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20224 if ($2 > maxsig) { maxsig = $2 }
20225 if (sig_name[$2]) {
20226 dup_name[ndups] = $1
20227 dup_num[ndups] = $2
20239 printf("NSIG %d\n", nsig);
20240 for (n = 1; n < nsig; n++) {
20242 printf("%s %d\n", sig_name[n], sig_num[n])
20245 printf("NUM%d %d\n", n, n)
20248 for (n = 0; n < ndups; n++) {
20249 printf("%s %d\n", dup_name[n], dup_num[n])
20253 $cat >signal_cmd <<EOS
20255 if $test -s signal.lst; then
20256 echo "Using your existing signal.lst file"
20261 $cat >>signal_cmd <<'EOS'
20264 if eval $compile_ok; then
20265 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20266 $uniq | $awk -f signal.awk >signal.lst
20268 echo "(I can't seem be able to compile the whole test program)" >&4
20269 echo "(I'll try it in little pieces.)" >&4
20270 set signal -DJUST_NSIG
20271 if eval $compile_ok; then
20272 $run ./signal$_exe > signal.nsg
20275 echo "I can't seem to figure out how many signals you have." >&4
20276 echo "Guessing 50." >&4
20277 echo 'NSIG 50' > signal.nsg
20279 : Now look at all the signal names, one at a time.
20280 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20281 $cat > signal.c <<EOCP
20282 #include <sys/types.h>
20283 #include <signal.h>
20286 printf("$xx %d\n", SIG${xx});
20291 if eval $compile; then
20292 echo "SIG${xx} found."
20293 $run ./signal$_exe >> signal.ls1
20295 echo "SIG${xx} NOT found."
20298 if $test -s signal.ls1; then
20299 $cat signal.nsg signal.ls1 |
20300 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20304 if $test -s signal.lst; then
20307 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20308 echo 'kill -l' >signal
20309 set X `csh -f <signal`
20313 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20315 echo $@ | $tr ' ' $trnl | \
20316 $awk '{ printf "%s %d\n", $1, ++s; }
20317 END { printf "NSIG %d\n", ++s }' >signal.lst
20319 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20321 chmod a+x signal_cmd
20322 $eunicefix signal_cmd
20324 : generate list of signal names
20326 case "$sig_name_init" in
20328 *) case "$sig_num_init" in
20329 ''|*,*) doinit=yes ;;
20334 echo "Generating a list of signal names and numbers..." >&4
20336 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20337 sig_name=`$awk 'BEGIN { printf "ZERO " }
20338 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20339 sig_num=`$awk 'BEGIN { printf "0 " }
20340 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20341 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20342 !/^NSIG/ { printf "\"%s\", ", $1 }
20343 END { printf "0\n" }' signal.lst`
20344 sig_num_init=`$awk 'BEGIN { printf "0, " }
20345 !/^NSIG/ { printf "%d, ", $2}
20346 END { printf "0\n"}' signal.lst`
20349 echo "The following $sig_count signals are available:"
20351 echo $sig_name | $awk \
20352 'BEGIN { linelen = 0 }
20354 for (i = 1; i <= NF; i++) {
20355 name = "SIG" $i " "
20356 linelen = linelen + length(name)
20357 if (linelen > 70) {
20359 linelen = length(name)
20365 sig_size=`echo $sig_name | awk '{print NF}'`
20366 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20368 : Check size of size
20370 case "$sizetype" in
20371 *_t) zzz="$sizetype" ;;
20372 *) zzz="filesize" ;;
20374 echo "Checking the size of $zzz..." >&4
20376 #include <sys/types.h>
20378 #$i_stdlib I_STDLIB
20380 #include <stdlib.h>
20383 printf("%d\n", (int)sizeof($sizetype));
20388 if eval $compile_ok; then
20392 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20395 echo "Your $zzz size is $sizesize bytes."
20400 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20404 : check for socklen_t
20406 echo "Checking to see if you have socklen_t..." >&4
20408 #include <sys/types.h>
20409 #$d_socket HAS_SOCKET
20411 #include <sys/socket.h>
20413 int main() { socklen_t x = 16; }
20416 if eval $compile; then
20418 echo "You have socklen_t."
20421 echo "You do not have socklen_t."
20422 case "$sizetype" in
20423 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20430 : see if this is a socks.h system
20431 set socks.h i_socks
20434 : check for type of the size argument to socket calls
20435 case "$d_socket" in
20439 Checking to see what type is the last argument of accept().
20442 case "$d_socklen_t" in
20443 "$define") yyy="$yyy socklen_t"
20445 yyy="$yyy $sizetype int long unsigned"
20446 for xxx in $yyy; do
20447 case "$socksizetype" in
20448 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20449 case "$usesocks" in
20451 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20452 echo "Your system accepts '$xxx *' for the last argument of accept()."
20453 socksizetype="$xxx"
20456 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20457 echo "Your system accepts '$xxx *' for the last argument of accept()."
20458 socksizetype="$xxx"
20465 : In case none of those worked, prompt the user.
20466 case "$socksizetype" in
20467 '') rp='What is the type for socket address structure sizes?'
20474 *) : no sockets, so pick relatively harmless default
20479 : see what type is used for signed size_t
20480 set ssize_t ssizetype int stdio.h sys/types.h
20485 #$i_stdlib I_STDLIB
20487 #include <stdlib.h>
20489 #include <sys/types.h>
20490 #define Size_t $sizetype
20491 #define SSize_t $dflt
20494 if (sizeof(Size_t) == sizeof(SSize_t))
20496 else if (sizeof(Size_t) == sizeof(int))
20505 if eval $compile_ok && $run ./try > /dev/null; then
20506 ssizetype=`$run ./try`
20507 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20510 Help! I can't compile and run the ssize_t test program: please enlighten me!
20511 (This is probably a misconfiguration in your system or libraries, and
20512 you really ought to fix it. Still, I'll try anyway.)
20514 I need a type that is the same size as $sizetype, but is guaranteed to
20515 be signed. Common values are ssize_t, int and long.
20518 rp="What signed type is the same size as $sizetype?"
20524 : see what type of char stdio uses.
20526 echo '#include <stdio.h>' > stdio.c
20527 $cppstdin $cppminus < stdio.c > stdioh
20528 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20529 echo "Your stdio uses unsigned chars." >&4
20530 stdchar="unsigned char"
20532 echo "Your stdio uses signed chars." >&4
20535 $rm -f stdio.* stdioh
20537 : see what type uids are declared as in the kernel
20539 echo "Looking for the type for user ids returned by getuid()."
20540 set uid_t uidtype xxx stdio.h sys/types.h
20544 xxx=`./findhdr sys/user.h`
20545 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20547 unsigned) dflt="$1 $2" ;;
20551 *) dflt="$uidtype";;
20554 uid_t) echo "uid_t found." ;;
20555 *) rp="What is the type for user ids returned by getuid()?"
20561 : Check size of UID
20564 *_t) zzz="$uidtype" ;;
20567 echo "Checking the size of $zzz..." >&4
20569 #include <sys/types.h>
20571 #$i_stdlib I_STDLIB
20573 #include <stdlib.h>
20576 printf("%d\n", (int)sizeof($uidtype));
20581 if eval $compile_ok; then
20585 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20588 echo "Your $zzz is $uidsize bytes long."
20593 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20596 : Check if UID is signed
20599 *_t) zzz="$uidtype" ;;
20602 echo "Checking the sign of $zzz..." >&4
20604 #include <sys/types.h>
20615 if eval $compile; then
20619 echo "(I can't execute the test program--guessing unsigned.)" >&4
20623 1) echo "Your $zzz is unsigned." ;;
20624 -1) echo "Your $zzz is signed." ;;
20630 echo "(I can't compile the test program--guessing unsigned.)" >&4
20634 : Check format string for UID
20636 $echo "Checking the format string to be used for uids..." >&4
20639 -1) if $test X"$uidsize" = X"$ivsize"; then
20640 uidformat="$ivdformat"
20642 if $test X"$uidsize" = X"$longsize"; then
20645 if $test X"$uidsize" = X"$intsize"; then
20648 if $test X"$uidsize" = X"$shortsize"; then
20655 *) if $test X"$uidsize" = X"$uvsize"; then
20656 uidformat="$uvuformat"
20658 if $test X"$uidsize" = X"$longsize"; then
20661 if $test X"$uidsize" = X"$intsize"; then
20664 if $test X"$uidsize" = X"$shortsize"; then
20673 : Check if site customization support was requested
20674 case "$usesitecustomize" in
20675 $define|true|[Yy]*)
20676 usesitecustomize="$define"
20679 usesitecustomize="$undef"
20683 : determine compiler compiler
20692 if $test -f "$byacc$_exe"; then
20694 comp="byacc or $comp"
20696 if $test -f "$bison$_exe"; then
20697 comp="$comp or bison -y"
20699 rp="Which compiler compiler ($comp) shall I use?"
20708 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20714 : see if this is a assert.h system
20715 set assert.h i_assert
20718 : see if this is a fp.h system
20722 : see if this is a fp_class.h system
20723 set fp_class.h i_fp_class
20726 : see if gdbm.h is available
20731 : see if gdbm_open exists
20732 set gdbm_open d_gdbm_open
20734 case "$d_gdbm_open" in
20737 echo "We won't be including <gdbm.h>"
20746 : see if this is a ieeefp.h system
20747 case "$i_ieeefp" in
20748 '' ) set ieeefp.h i_ieeefp
20753 : see if this is a libutil.h system
20754 set libutil.h i_libutil
20757 : see if mach cthreads are available
20758 if test "X$usethreads" = "X$define"; then
20759 set mach/cthreads.h i_machcthr
20762 i_machcthr="$undef"
20765 : see if this is a mntent.h system
20766 set mntent.h i_mntent
20769 : see if ndbm.h is available
20775 # Some Linux distributions such as RedHat 7.1 put the
20776 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20777 if $test -f /usr/include/gdbm/ndbm.h; then
20778 echo '<gdbm/ndbm.h> found.'
20779 ccflags="$ccflags -I/usr/include/gdbm"
20780 cppflags="$cppflags -I/usr/include/gdbm"
20788 : see if dbm_open exists
20789 set dbm_open d_dbm_open
20791 case "$d_dbm_open" in
20794 echo "We won't be including <ndbm.h>"
20803 : see if net/errno.h is available
20805 set net/errno.h val
20808 : Unfortunately, it causes problems on some systems. Arrgh.
20811 cat > try.c <<'EOM'
20814 #include <net/errno.h>
20820 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20821 echo "We'll be including <net/errno.h>." >&4
20823 echo "We won't be including <net/errno.h>." >&4
20832 : see if netinet/tcp.h is available
20833 set netinet/tcp.h i_netinettcp
20836 : see if this is a poll.h system
20840 : see if this is a prot.h system
20844 : Preprocessor symbols
20846 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20847 $cat <<'EOSH' > Cppsym.know
20848 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20849 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20850 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20851 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20852 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20853 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20854 bull c cadmus clipper CMU COFF COMPILER_VERSION
20855 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20856 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20857 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20858 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20860 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20861 H3050R H3050RX hbullx20 hcx host_mips
20862 hp200 hp300 hp700 HP700 hp800 hp9000
20863 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20864 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20865 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20866 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20867 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20868 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20869 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20870 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20871 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20872 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20873 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20874 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20875 MATH_HAS_NO_SIDE_EFFECTS
20876 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20877 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20878 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20879 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20880 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20881 NetBSD news1500 news1700 news1800 news1900 news3700
20882 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20883 ns32016 ns32332 ns32k nsc32000
20884 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20885 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20886 pc532 pdp11 PGC PIC plexus PORTAR posix
20887 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20888 POSIX_C_SOURCE POSIX_SOURCE POWER
20889 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20890 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20891 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20892 sony sony_news sonyrisc sparc sparclite spectrum
20893 stardent stdc STDC_EXT stratos sun sun3 sun386
20894 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20895 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20896 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20897 sysV68 sysV88 Tek4132 Tek4300 titan
20898 TM3200 TM5400 TM5600
20899 tower tower32 tower32_200 tower32_600 tower32_700
20900 tower32_800 tower32_850 tss
20901 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20902 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20903 unix UNIX95 UNIX99 unixpc unos
20904 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20905 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20906 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20908 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20909 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20910 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20913 # Maybe put other stuff here too.
20914 cat <<EOSH >>Cppsym.know
20917 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20918 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20919 $cat Cppsym.know > Cppsym.c
20920 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20921 $rm -f Cppsym.a Cppsym.b Cppsym.c
20922 cat <<EOSH > Cppsym
20924 if $test \$# -gt 0; then
20925 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20926 if $test -s Cppsym.got; then
20933 $tr " " "$trnl" | ./Cppsym.try
20939 cat <<EOSH > Cppsym.try
20941 cat <<'EOCP' > try.c
20944 #define STRINGIFY(a) "a"
20946 #if cpp_stuff == 42
20947 #define StGiFy(a) #a
20948 #define STRINGIFY(a) StGiFy(a)
20950 #if $cpp_stuff != 1 && $cpp_stuff != 42
20951 # include "Bletch: How does this C preprocessor stringify macros?"
20957 cat <<'EOSH' >> Cppsym.try
20959 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20960 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20961 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20962 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20964 echo 'return 0;}' >> try.c
20966 cat <<EOSH >> Cppsym.try
20968 case "$osname-$gccversion" in
20969 irix-) ccflags="\$ccflags -woff 1178" ;;
20970 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20972 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20974 chmod +x Cppsym.try
20975 $eunicefix Cppsym.try
20976 ./Cppsym < Cppsym.know > Cppsym.true
20977 : Add in any linux cpp "predefined macros":
20978 case "$osname::$gccversion" in
20981 rm -f $tHdrH'.h' $tHdrH
20983 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20984 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20985 if [ -s $tHdrH'_cppsym.real' ]; then
20986 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20989 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20992 : now check the C compiler for additional symbols
20993 postprocess_cc_v=''
20995 aix) postprocess_cc_v="|$tr , ' '" ;;
21002 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21005 -D*) echo "\$i" | $sed 's/^-D//';;
21006 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21011 postprocess_cc_v=''
21014 ./ccsym > ccsym1.raw
21015 if $test -s ccsym1.raw; then
21016 $sort ccsym1.raw | $uniq >ccsym.raw
21018 mv ccsym1.raw ccsym.raw
21021 $awk '/\=/ { print $0; next }
21022 { print $0"=1" }' ccsym.raw >ccsym.list
21023 $comm -13 Cppsym.true ccsym.list >ccsym.own
21024 $comm -12 Cppsym.true ccsym.list >ccsym.com
21025 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21027 if $test -z ccsym.raw; then
21028 echo "Your C compiler doesn't seem to define any symbols!" >&4
21030 echo "However, your C preprocessor defines the following symbols:"
21033 cppsymbols=`$cat Cppsym.true`
21034 cppsymbols=`echo $cppsymbols`
21035 cppccsymbols="$cppsymbols"
21037 if $test -s ccsym.com; then
21038 echo "Your C compiler and pre-processor define these symbols:"
21039 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21042 cppccsymbols=`$cat ccsym.com`
21043 cppccsymbols=`echo $cppccsymbols`
21044 $test "$silent" || sleep 1
21046 if $test -s ccsym.cpp; then
21047 $test "$also" && echo " "
21048 echo "Your C pre-processor ${also}defines the following symbols:"
21049 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21051 cppsymbols=`$cat ccsym.cpp`
21052 cppsymbols=`echo $cppsymbols`
21053 $test "$silent" || sleep 1
21055 if $test -s ccsym.own; then
21056 $test "$also" && echo " "
21057 echo "Your C compiler ${also}defines the following cpp symbols:"
21058 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21059 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21060 ccsymbols=`$cat ccsym.own`
21061 ccsymbols=`echo $ccsymbols`
21062 $test "$silent" || sleep 1
21066 : see if this is a termio system
21070 if $test `./findhdr termios.h`; then
21071 set tcsetattr i_termios
21077 "$define") echo "You have POSIX termios.h... good!" >&4;;
21078 *) if ./Cppsym pyr; then
21079 case "`/bin/universe`" in
21080 ucb) if $test `./findhdr sgtty.h`; then
21082 echo "<sgtty.h> found." >&4
21084 echo "System is pyramid with BSD universe."
21085 echo "<sgtty.h> not found--you could have problems." >&4
21087 *) if $test `./findhdr termio.h`; then
21089 echo "<termio.h> found." >&4
21091 echo "System is pyramid with USG universe."
21092 echo "<termio.h> not found--you could have problems." >&4
21096 if $test `./findhdr termio.h`; then
21097 echo "<termio.h> found." >&4
21099 elif $test `./findhdr sgtty.h`; then
21100 echo "<sgtty.h> found." >&4
21103 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
21106 if $test `./findhdr sgtty.h`; then
21107 echo "<sgtty.h> found." >&4
21109 elif $test `./findhdr termio.h`; then
21110 echo "<termio.h> found." >&4
21113 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
21117 set i_termio; eval $setvar
21118 val=$val2; set i_sgtty; eval $setvar
21119 val=$val3; set i_termios; eval $setvar
21121 : see if stddef is available
21122 set stddef.h i_stddef
21125 : see if sys/access.h is available
21126 set sys/access.h i_sysaccess
21129 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21130 set sys/filio.h i_sysfilio
21133 if $test `./findhdr sys/ioctl.h`; then
21135 echo '<sys/ioctl.h> found.' >&4
21138 if $test $i_sysfilio = "$define"; then
21139 echo '<sys/ioctl.h> NOT found.' >&4
21141 $test $i_sgtty = "$define" && xxx="sgtty.h"
21142 $test $i_termio = "$define" && xxx="termio.h"
21143 $test $i_termios = "$define" && xxx="termios.h"
21144 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21150 : see if socket ioctl defs are in sys/sockio.h
21152 xxx=`./findhdr sys/sockio.h`
21153 if $test "$xxx"; then
21154 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21156 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21159 echo "No socket ioctls found in <sys/sockio.h>." >&4
21164 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21170 : see if this is a syslog.h system
21171 set syslog.h i_syslog
21174 : see if this is a sys/mode.h system
21175 set sys/mode.h i_sysmode
21178 : see if sys/resource.h has to be included
21179 set sys/resource.h i_sysresrc
21182 : see if sys/security.h is available
21183 set sys/security.h i_syssecrt
21186 : see if this is a sys/statvfs.h system
21187 set sys/statvfs.h i_sysstatvfs
21190 : see if this is a sys/un.h system
21191 set sys/un.h i_sysun
21194 : see if this is a sys/utsname.h system
21195 set sys/utsname.h i_sysutsname
21198 : see if this is a syswait system
21199 set sys/wait.h i_syswait
21202 : see if this is a ustat.h system
21203 set ustat.h i_ustat
21206 : see if this is an utime system
21207 set utime.h i_utime
21210 : see if this is a values.h system
21211 set values.h i_values
21214 : see if this is a vfork system
21217 set vfork.h i_vfork
21227 echo "Looking for extensions..." >&4
21228 : If we are using the old config.sh, known_extensions may contain
21229 : old or inaccurate or duplicate values.
21230 known_extensions=''
21231 nonxs_extensions=''
21232 : We do not use find because it might not be available.
21233 : We do not just use MANIFEST because the user may have dropped
21234 : some additional extensions into the source tree and expect them
21237 : Function to recursively find available extensions, ignoring DynaLoader
21238 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21242 DynaLoader|dynaload) ;;
21244 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21245 known_extensions="$known_extensions $1$xxx";
21246 elif $test -f $xxx/Makefile.PL; then
21247 nonxs_extensions="$nonxs_extensions $1$xxx";
21249 if $test -d $xxx -a $# -lt 10; then
21252 eval $find_extensions;
21264 eval $find_extensions
21265 # Special case: Add in modules that nest beyond the first level.
21266 # Currently threads/shared and Hash/Util/FieldHash, since they are
21267 # not picked up by the recursive find above (and adding in general
21268 # recursive finding breaks SDBM_File/sdbm).
21269 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21270 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21271 set X $known_extensions
21273 known_extensions="$*"
21274 set X $nonxs_extensions
21276 nonxs_extensions="$*"
21279 : Now see which are supported on this system.
21281 for xxx in $known_extensions ; do
21285 $define) avail_ext="$avail_ext $xxx" ;;
21288 GDBM_File|gdbm_fil)
21290 $define) avail_ext="$avail_ext $xxx" ;;
21293 I18N/Langinfo|i18n_lan)
21294 case "$i_langinfo$d_nl_langinfo" in
21295 $define$define) avail_ext="$avail_ext $xxx" ;;
21299 : XXX Do we need a useipcsysv variable here
21300 case "${d_msg}${d_sem}${d_shm}" in
21301 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21304 NDBM_File|ndbm_fil)
21307 case "$osname-$use64bitint" in
21310 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21313 *) avail_ext="$avail_ext $xxx" ;;
21318 ODBM_File|odbm_fil)
21319 case "${i_dbm}${i_rpcsvcdbm}" in
21321 case "$d_cplusplus" in
21322 define) ;; # delete as a function name will not work
21323 *) case "$osname-$use64bitint" in
21326 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21329 *) avail_ext="$avail_ext $xxx" ;;
21337 case "$useopcode" in
21338 true|define|y) avail_ext="$avail_ext $xxx" ;;
21342 case "$useposix" in
21343 true|define|y) avail_ext="$avail_ext $xxx" ;;
21347 case "$d_socket" in
21350 beos) ;; # not unless BONE
21351 *) avail_ext="$avail_ext $xxx" ;;
21356 Sys/Syslog|sys/syslog)
21357 : XXX syslog requires socket
21358 case "$d_socket" in
21359 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21363 case "$usethreads" in
21365 case "$use5005threads" in
21366 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21370 threads|threads/shared)
21371 # threads and threads::shared are special cases.
21372 # To stop people from asking "Perl 5.8.0 was supposed
21373 # to have this new fancy threads implementation but my
21374 # perl doesn't have it" and from people trying to
21375 # (re)install the threads module using CPAN.pm and
21376 # CPAN.pm then offering to reinstall Perl 5.8.0,
21377 # the threads.pm and threads/shared.pm will always be
21378 # there, croaking informatively ("you need to rebuild
21379 # all of Perl with threads, sorry") when threads haven't
21380 # been compiled in.
21382 avail_ext="$avail_ext $xxx"
21386 cygwin) avail_ext="$avail_ext $xxx" ;;
21389 XS/APItest|xs/apitest)
21390 # This is just for testing. Skip it unless we have dynamic loading.
21393 $define) avail_ext="$avail_ext $xxx" ;;
21396 XS/Typemap|xs/typemap)
21397 # This is just for testing. Skip it unless we have dynamic loading.
21399 $define) avail_ext="$avail_ext $xxx" ;;
21402 *) avail_ext="$avail_ext $xxx"
21411 case "$onlyextensions" in
21413 *) keepextensions=''
21414 echo "You have requested that only certains extensions be included..." >&4
21415 for i in $onlyextensions; do
21416 case " $avail_ext " in
21418 echo "Keeping extension $i."
21419 keepextensions="$keepextensions $i"
21421 *) echo "Ignoring extension $i." ;;
21424 avail_ext="$keepextensions"
21428 case "$noextensions" in
21430 *) keepextensions=''
21431 echo "You have requested that certain extensions be ignored..." >&4
21432 for i in $avail_ext; do
21433 case " $noextensions " in
21434 *" $i "*) echo "Ignoring extension $i." ;;
21435 *) echo "Keeping extension $i.";
21436 keepextensions="$keepextensions $i"
21440 avail_ext="$keepextensions"
21444 : Now see which nonxs extensions are supported on this system.
21445 : For now assume all are.
21447 for xxx in $nonxs_extensions ; do
21449 *) nonxs_ext="$nonxs_ext $xxx"
21461 A number of extensions are supplied with $package. You may choose to
21462 compile these extensions for dynamic loading (the default), compile
21463 them into the $package executable (static loading), or not include
21464 them at all. Answer "none" to include no extensions.
21465 Note that DynaLoader is always built and need not be mentioned here.
21468 case "$dynamic_ext" in
21470 : Exclude those listed in static_ext
21472 for xxx in $avail_ext; do
21473 case " $static_ext " in
21475 *) dflt="$dflt $xxx" ;;
21482 *) dflt="$dynamic_ext"
21483 # Perhaps we are reusing an old out-of-date config.sh.
21486 if test X"$dynamic_ext" != X"$avail_ext"; then
21488 NOTICE: Your previous config.sh list may be incorrect.
21489 The extensions now available to you are
21491 but the default list from your previous config.sh is
21503 rp="What extensions do you wish to load dynamically?"
21506 none) dynamic_ext=' ' ;;
21507 *) dynamic_ext="$ans" ;;
21510 case "$static_ext" in
21512 : Exclude those already listed in dynamic linking
21514 for xxx in $avail_ext; do
21515 case " $dynamic_ext " in
21517 *) dflt="$dflt $xxx" ;;
21524 *) dflt="$static_ext"
21531 rp="What extensions do you wish to load statically?"
21534 none) static_ext=' ' ;;
21535 *) static_ext="$ans" ;;
21540 A number of extensions are supplied with $package. Answer "none"
21541 to include no extensions.
21542 Note that DynaLoader is always built and need not be mentioned here.
21545 case "$static_ext" in
21546 '') dflt="$avail_ext" ;;
21547 *) dflt="$static_ext"
21548 # Perhaps we are reusing an old out-of-date config.sh.
21551 if test X"$static_ext" != X"$avail_ext"; then
21553 NOTICE: Your previous config.sh list may be incorrect.
21554 The extensions now available to you are
21556 but the default list from your previous config.sh is
21565 : Exclude those that are not xs extensions
21569 rp="What extensions do you wish to include?"
21572 none) static_ext=' ' ;;
21573 *) static_ext="$ans" ;;
21578 # Encode is a special case. If we are building Encode as a static
21579 # extension, we need to explicitly list its subextensions as well.
21580 # For other nested extensions, this is handled automatically by
21581 # the appropriate Makefile.PL.
21582 case " $static_ext " in
21583 *" Encode "*) # Add the subextensions of Encode
21585 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21586 static_ext="$static_ext Encode/$xxx"
21592 set X $dynamic_ext $static_ext $nonxs_ext
21596 # Sanity check: We require an extension suitable for use with
21597 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21598 # should show up as failures in the test suite, but it's helpful to
21599 # catch them now.) The 'extensions' list is normally sorted
21600 # alphabetically, so we need to accept either
21601 # DB_File ... Fcntl ... IO ....
21602 # or something like
21603 # Fcntl ... NDBM_File ... IO ....
21604 case " $extensions" in
21605 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21606 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21607 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21608 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21609 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21613 : Remove libraries needed only for extensions
21614 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21615 : The exception is SunOS 4.x, which needs them.
21616 case "${osname}X${osvers}" in
21620 *) case "$usedl" in
21621 $define|true|[yY]*)
21622 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21626 *) perllibs="$libs"
21632 : Remove build directory name from cppstdin so it can be used from
21633 : either the present location or the final installed location.
21635 : Get out of the UU directory to get correct path name.
21637 case "$cppstdin" in
21639 echo "Stripping down cppstdin path name"
21645 : end of configuration questions
21647 echo "End of configuration questions."
21650 : back to where it started
21651 if test -d ../UU; then
21655 : configuration may be unconditionally patched via a 'config.arch' file
21656 if $test -f config.arch; then
21657 echo "I see a config.arch file, loading it." >&4
21661 : configuration may be patched via a 'config.over' file
21662 if $test -f config.over; then
21665 rp='I see a config.over file. Do you wish to load it?'
21668 n*) echo "OK, I'll ignore it.";;
21670 echo "Configuration override changes have been loaded."
21675 : in case they want portability, strip down executable paths
21676 case "$d_portable" in
21679 echo "Stripping down executable paths..." >&4
21680 for file in $loclist $trylist; do
21682 eval $file=`basename $temp`
21687 : create config.sh file
21689 echo "Creating config.sh..." >&4
21690 $spitshell <<EOT >config.sh
21693 # This file was produced by running the Configure script. It holds all the
21694 # definitions figured out by Configure. Should you modify one of these values,
21695 # do not forget to propagate your changes by running "Configure -der". You may
21696 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21699 # Package name : $package
21700 # Source directory : $src
21701 # Configuration time: $cf_time
21702 # Configured by : $cf_by
21703 # Target system : $myuname
21706 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21707 $spitshell <<EOT >>config.sh
21716 Revision='$Revision'
21724 alignbytes='$alignbytes'
21725 ansi2knr='$ansi2knr'
21726 aphostname='$aphostname'
21727 api_revision='$api_revision'
21728 api_subversion='$api_subversion'
21729 api_version='$api_version'
21730 api_versionstring='$api_versionstring'
21733 archlibexp='$archlibexp'
21734 archname64='$archname64'
21735 archname='$archname'
21736 archobjs='$archobjs'
21737 asctime_r_proto='$asctime_r_proto'
21745 byteorder='$byteorder'
21747 castflags='$castflags'
21750 cccdlflags='$cccdlflags'
21751 ccdlflags='$ccdlflags'
21753 ccflags_uselargefiles='$ccflags_uselargefiles'
21755 ccsymbols='$ccsymbols'
21756 ccversion='$ccversion'
21758 cf_email='$cf_email'
21763 clocktype='$clocktype'
21765 compress='$compress'
21766 contains='$contains'
21770 cpp_stuff='$cpp_stuff'
21771 cppccsymbols='$cppccsymbols'
21772 cppflags='$cppflags'
21774 cppminus='$cppminus'
21776 cppstdin='$cppstdin'
21777 cppsymbols='$cppsymbols'
21778 crypt_r_proto='$crypt_r_proto'
21779 cryptlib='$cryptlib'
21781 ctermid_r_proto='$ctermid_r_proto'
21782 ctime_r_proto='$ctime_r_proto'
21783 d_Gconvert='$d_Gconvert'
21784 d_PRIEUldbl='$d_PRIEUldbl'
21785 d_PRIFUldbl='$d_PRIFUldbl'
21786 d_PRIGUldbl='$d_PRIGUldbl'
21787 d_PRIXU64='$d_PRIXU64'
21788 d_PRId64='$d_PRId64'
21789 d_PRIeldbl='$d_PRIeldbl'
21790 d_PRIfldbl='$d_PRIfldbl'
21791 d_PRIgldbl='$d_PRIgldbl'
21792 d_PRIi64='$d_PRIi64'
21793 d_PRIo64='$d_PRIo64'
21794 d_PRIu64='$d_PRIu64'
21795 d_PRIx64='$d_PRIx64'
21796 d_SCNfldbl='$d_SCNfldbl'
21797 d__fwalk='$d__fwalk'
21798 d_access='$d_access'
21799 d_accessx='$d_accessx'
21802 d_archlib='$d_archlib'
21803 d_asctime_r='$d_asctime_r'
21806 d_attribute_format='$d_attribute_format'
21807 d_attribute_malloc='$d_attribute_malloc'
21808 d_attribute_nonnull='$d_attribute_nonnull'
21809 d_attribute_noreturn='$d_attribute_noreturn'
21810 d_attribute_pure='$d_attribute_pure'
21811 d_attribute_unused='$d_attribute_unused'
21812 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21816 d_bsdgetpgrp='$d_bsdgetpgrp'
21817 d_bsdsetpgrp='$d_bsdsetpgrp'
21818 d_builtin_choose_expr='$d_builtin_choose_expr'
21819 d_builtin_expect='$d_builtin_expect'
21821 d_c99_variadic_macros='$d_c99_variadic_macros'
21822 d_casti32='$d_casti32'
21823 d_castneg='$d_castneg'
21824 d_charvspr='$d_charvspr'
21826 d_chroot='$d_chroot'
21827 d_chsize='$d_chsize'
21829 d_clearenv='$d_clearenv'
21830 d_closedir='$d_closedir'
21831 d_cmsghdr_s='$d_cmsghdr_s'
21833 d_copysignl='$d_copysignl'
21834 d_cplusplus='$d_cplusplus'
21836 d_crypt_r='$d_crypt_r'
21838 d_ctermid='$d_ctermid'
21839 d_ctermid_r='$d_ctermid_r'
21840 d_ctime_r='$d_ctime_r'
21841 d_cuserid='$d_cuserid'
21842 d_dbl_dig='$d_dbl_dig'
21843 d_dbminitproto='$d_dbminitproto'
21844 d_difftime='$d_difftime'
21845 d_dir_dd_fd='$d_dir_dd_fd'
21847 d_dirnamlen='$d_dirnamlen'
21848 d_dlerror='$d_dlerror'
21849 d_dlopen='$d_dlopen'
21850 d_dlsymun='$d_dlsymun'
21851 d_dosuid='$d_dosuid'
21852 d_drand48_r='$d_drand48_r'
21853 d_drand48proto='$d_drand48proto'
21855 d_eaccess='$d_eaccess'
21856 d_endgrent='$d_endgrent'
21857 d_endgrent_r='$d_endgrent_r'
21858 d_endhent='$d_endhent'
21859 d_endhostent_r='$d_endhostent_r'
21860 d_endnent='$d_endnent'
21861 d_endnetent_r='$d_endnetent_r'
21862 d_endpent='$d_endpent'
21863 d_endprotoent_r='$d_endprotoent_r'
21864 d_endpwent='$d_endpwent'
21865 d_endpwent_r='$d_endpwent_r'
21866 d_endsent='$d_endsent'
21867 d_endservent_r='$d_endservent_r'
21868 d_eofnblk='$d_eofnblk'
21869 d_eunice='$d_eunice'
21870 d_faststdio='$d_faststdio'
21871 d_fchdir='$d_fchdir'
21872 d_fchmod='$d_fchmod'
21873 d_fchown='$d_fchown'
21875 d_fcntl_can_lock='$d_fcntl_can_lock'
21876 d_fd_macros='$d_fd_macros'
21877 d_fd_set='$d_fd_set'
21878 d_fds_bits='$d_fds_bits'
21879 d_fgetpos='$d_fgetpos'
21880 d_finite='$d_finite'
21881 d_finitel='$d_finitel'
21882 d_flexfnam='$d_flexfnam'
21884 d_flockproto='$d_flockproto'
21886 d_fp_class='$d_fp_class'
21887 d_fpathconf='$d_fpathconf'
21888 d_fpclass='$d_fpclass'
21889 d_fpclassify='$d_fpclassify'
21890 d_fpclassl='$d_fpclassl'
21891 d_fpos64_t='$d_fpos64_t'
21892 d_frexpl='$d_frexpl'
21893 d_fs_data_s='$d_fs_data_s'
21894 d_fseeko='$d_fseeko'
21895 d_fsetpos='$d_fsetpos'
21896 d_fstatfs='$d_fstatfs'
21897 d_fstatvfs='$d_fstatvfs'
21899 d_ftello='$d_ftello'
21901 d_futimes='$d_futimes'
21902 d_getcwd='$d_getcwd'
21903 d_getespwnam='$d_getespwnam'
21904 d_getfsstat='$d_getfsstat'
21905 d_getgrent='$d_getgrent'
21906 d_getgrent_r='$d_getgrent_r'
21907 d_getgrgid_r='$d_getgrgid_r'
21908 d_getgrnam_r='$d_getgrnam_r'
21909 d_getgrps='$d_getgrps'
21910 d_gethbyaddr='$d_gethbyaddr'
21911 d_gethbyname='$d_gethbyname'
21912 d_gethent='$d_gethent'
21913 d_gethname='$d_gethname'
21914 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21915 d_gethostbyname_r='$d_gethostbyname_r'
21916 d_gethostent_r='$d_gethostent_r'
21917 d_gethostprotos='$d_gethostprotos'
21918 d_getitimer='$d_getitimer'
21919 d_getlogin='$d_getlogin'
21920 d_getlogin_r='$d_getlogin_r'
21921 d_getmnt='$d_getmnt'
21922 d_getmntent='$d_getmntent'
21923 d_getnbyaddr='$d_getnbyaddr'
21924 d_getnbyname='$d_getnbyname'
21925 d_getnent='$d_getnent'
21926 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21927 d_getnetbyname_r='$d_getnetbyname_r'
21928 d_getnetent_r='$d_getnetent_r'
21929 d_getnetprotos='$d_getnetprotos'
21930 d_getpagsz='$d_getpagsz'
21931 d_getpbyname='$d_getpbyname'
21932 d_getpbynumber='$d_getpbynumber'
21933 d_getpent='$d_getpent'
21934 d_getpgid='$d_getpgid'
21935 d_getpgrp2='$d_getpgrp2'
21936 d_getpgrp='$d_getpgrp'
21937 d_getppid='$d_getppid'
21938 d_getprior='$d_getprior'
21939 d_getprotobyname_r='$d_getprotobyname_r'
21940 d_getprotobynumber_r='$d_getprotobynumber_r'
21941 d_getprotoent_r='$d_getprotoent_r'
21942 d_getprotoprotos='$d_getprotoprotos'
21943 d_getprpwnam='$d_getprpwnam'
21944 d_getpwent='$d_getpwent'
21945 d_getpwent_r='$d_getpwent_r'
21946 d_getpwnam_r='$d_getpwnam_r'
21947 d_getpwuid_r='$d_getpwuid_r'
21948 d_getsbyname='$d_getsbyname'
21949 d_getsbyport='$d_getsbyport'
21950 d_getsent='$d_getsent'
21951 d_getservbyname_r='$d_getservbyname_r'
21952 d_getservbyport_r='$d_getservbyport_r'
21953 d_getservent_r='$d_getservent_r'
21954 d_getservprotos='$d_getservprotos'
21955 d_getspnam='$d_getspnam'
21956 d_getspnam_r='$d_getspnam_r'
21957 d_gettimeod='$d_gettimeod'
21958 d_gmtime_r='$d_gmtime_r'
21959 d_gnulibc='$d_gnulibc'
21960 d_grpasswd='$d_grpasswd'
21961 d_hasmntopt='$d_hasmntopt'
21963 d_ilogbl='$d_ilogbl'
21964 d_inc_version_list='$d_inc_version_list'
21966 d_inetaton='$d_inetaton'
21967 d_int64_t='$d_int64_t'
21968 d_isascii='$d_isascii'
21969 d_isfinite='$d_isfinite'
21972 d_isnanl='$d_isnanl'
21973 d_killpg='$d_killpg'
21974 d_lchown='$d_lchown'
21975 d_ldbl_dig='$d_ldbl_dig'
21976 d_libm_lib_version='$d_libm_lib_version'
21978 d_localtime_r='$d_localtime_r'
21979 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21980 d_locconv='$d_locconv'
21982 d_longdbl='$d_longdbl'
21983 d_longlong='$d_longlong'
21984 d_lseekproto='$d_lseekproto'
21986 d_madvise='$d_madvise'
21987 d_malloc_good_size='$d_malloc_good_size'
21988 d_malloc_size='$d_malloc_size'
21990 d_mbstowcs='$d_mbstowcs'
21991 d_mbtowc='$d_mbtowc'
21992 d_memchr='$d_memchr'
21993 d_memcmp='$d_memcmp'
21994 d_memcpy='$d_memcpy'
21995 d_memmove='$d_memmove'
21996 d_memset='$d_memset'
21998 d_mkdtemp='$d_mkdtemp'
21999 d_mkfifo='$d_mkfifo'
22000 d_mkstemp='$d_mkstemp'
22001 d_mkstemps='$d_mkstemps'
22002 d_mktime='$d_mktime'
22005 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22006 d_modflproto='$d_modflproto'
22007 d_mprotect='$d_mprotect'
22009 d_msg_ctrunc='$d_msg_ctrunc'
22010 d_msg_dontroute='$d_msg_dontroute'
22011 d_msg_oob='$d_msg_oob'
22012 d_msg_peek='$d_msg_peek'
22013 d_msg_proxy='$d_msg_proxy'
22014 d_msgctl='$d_msgctl'
22015 d_msgget='$d_msgget'
22016 d_msghdr_s='$d_msghdr_s'
22017 d_msgrcv='$d_msgrcv'
22018 d_msgsnd='$d_msgsnd'
22020 d_munmap='$d_munmap'
22021 d_mymalloc='$d_mymalloc'
22023 d_nl_langinfo='$d_nl_langinfo'
22024 d_nv_preserves_uv='$d_nv_preserves_uv'
22025 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22026 d_off64_t='$d_off64_t'
22027 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22028 d_oldpthreads='$d_oldpthreads'
22029 d_oldsock='$d_oldsock'
22031 d_pathconf='$d_pathconf'
22033 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22034 d_phostname='$d_phostname'
22037 d_portable='$d_portable'
22038 d_printf_format_null='$d_printf_format_null'
22039 d_procselfexe='$d_procselfexe'
22040 d_pseudofork='$d_pseudofork'
22041 d_pthread_atfork='$d_pthread_atfork'
22042 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22043 d_pthread_yield='$d_pthread_yield'
22045 d_pwchange='$d_pwchange'
22046 d_pwclass='$d_pwclass'
22047 d_pwcomment='$d_pwcomment'
22048 d_pwexpire='$d_pwexpire'
22049 d_pwgecos='$d_pwgecos'
22050 d_pwpasswd='$d_pwpasswd'
22051 d_pwquota='$d_pwquota'
22054 d_random_r='$d_random_r'
22055 d_readdir64_r='$d_readdir64_r'
22056 d_readdir='$d_readdir'
22057 d_readdir_r='$d_readdir_r'
22058 d_readlink='$d_readlink'
22060 d_recvmsg='$d_recvmsg'
22061 d_rename='$d_rename'
22062 d_rewinddir='$d_rewinddir'
22064 d_safebcpy='$d_safebcpy'
22065 d_safemcpy='$d_safemcpy'
22066 d_sanemcmp='$d_sanemcmp'
22067 d_sbrkproto='$d_sbrkproto'
22068 d_scalbnl='$d_scalbnl'
22069 d_sched_yield='$d_sched_yield'
22070 d_scm_rights='$d_scm_rights'
22071 d_seekdir='$d_seekdir'
22072 d_select='$d_select'
22074 d_semctl='$d_semctl'
22075 d_semctl_semid_ds='$d_semctl_semid_ds'
22076 d_semctl_semun='$d_semctl_semun'
22077 d_semget='$d_semget'
22079 d_sendmsg='$d_sendmsg'
22080 d_setegid='$d_setegid'
22081 d_seteuid='$d_seteuid'
22082 d_setgrent='$d_setgrent'
22083 d_setgrent_r='$d_setgrent_r'
22084 d_setgrps='$d_setgrps'
22085 d_sethent='$d_sethent'
22086 d_sethostent_r='$d_sethostent_r'
22087 d_setitimer='$d_setitimer'
22088 d_setlinebuf='$d_setlinebuf'
22089 d_setlocale='$d_setlocale'
22090 d_setlocale_r='$d_setlocale_r'
22091 d_setnent='$d_setnent'
22092 d_setnetent_r='$d_setnetent_r'
22093 d_setpent='$d_setpent'
22094 d_setpgid='$d_setpgid'
22095 d_setpgrp2='$d_setpgrp2'
22096 d_setpgrp='$d_setpgrp'
22097 d_setprior='$d_setprior'
22098 d_setproctitle='$d_setproctitle'
22099 d_setprotoent_r='$d_setprotoent_r'
22100 d_setpwent='$d_setpwent'
22101 d_setpwent_r='$d_setpwent_r'
22102 d_setregid='$d_setregid'
22103 d_setresgid='$d_setresgid'
22104 d_setresuid='$d_setresuid'
22105 d_setreuid='$d_setreuid'
22106 d_setrgid='$d_setrgid'
22107 d_setruid='$d_setruid'
22108 d_setsent='$d_setsent'
22109 d_setservent_r='$d_setservent_r'
22110 d_setsid='$d_setsid'
22111 d_setvbuf='$d_setvbuf'
22115 d_shmatprototype='$d_shmatprototype'
22116 d_shmctl='$d_shmctl'
22118 d_shmget='$d_shmget'
22119 d_sigaction='$d_sigaction'
22120 d_signbit='$d_signbit'
22121 d_sigprocmask='$d_sigprocmask'
22122 d_sigsetjmp='$d_sigsetjmp'
22123 d_sitearch='$d_sitearch'
22124 d_snprintf='$d_snprintf'
22125 d_sockatmark='$d_sockatmark'
22126 d_sockatmarkproto='$d_sockatmarkproto'
22127 d_socket='$d_socket'
22128 d_socklen_t='$d_socklen_t'
22129 d_sockpair='$d_sockpair'
22130 d_socks5_init='$d_socks5_init'
22131 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22133 d_srand48_r='$d_srand48_r'
22134 d_srandom_r='$d_srandom_r'
22135 d_sresgproto='$d_sresgproto'
22136 d_sresuproto='$d_sresuproto'
22137 d_statblks='$d_statblks'
22138 d_statfs_f_flags='$d_statfs_f_flags'
22139 d_statfs_s='$d_statfs_s'
22140 d_statvfs='$d_statvfs'
22141 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22142 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22143 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22144 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22145 d_stdio_stream_array='$d_stdio_stream_array'
22146 d_stdiobase='$d_stdiobase'
22147 d_stdstdio='$d_stdstdio'
22148 d_strchr='$d_strchr'
22149 d_strcoll='$d_strcoll'
22150 d_strctcpy='$d_strctcpy'
22151 d_strerrm='$d_strerrm'
22152 d_strerror='$d_strerror'
22153 d_strerror_r='$d_strerror_r'
22154 d_strftime='$d_strftime'
22155 d_strlcat='$d_strlcat'
22156 d_strlcpy='$d_strlcpy'
22157 d_strtod='$d_strtod'
22158 d_strtol='$d_strtol'
22159 d_strtold='$d_strtold'
22160 d_strtoll='$d_strtoll'
22161 d_strtoq='$d_strtoq'
22162 d_strtoul='$d_strtoul'
22163 d_strtoull='$d_strtoull'
22164 d_strtouq='$d_strtouq'
22165 d_strxfrm='$d_strxfrm'
22166 d_suidsafe='$d_suidsafe'
22167 d_symlink='$d_symlink'
22168 d_syscall='$d_syscall'
22169 d_syscallproto='$d_syscallproto'
22170 d_sysconf='$d_sysconf'
22171 d_sysernlst='$d_sysernlst'
22172 d_syserrlst='$d_syserrlst'
22173 d_system='$d_system'
22174 d_tcgetpgrp='$d_tcgetpgrp'
22175 d_tcsetpgrp='$d_tcsetpgrp'
22176 d_telldir='$d_telldir'
22177 d_telldirproto='$d_telldirproto'
22180 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22181 d_tm_tm_zone='$d_tm_tm_zone'
22182 d_tmpnam_r='$d_tmpnam_r'
22183 d_truncate='$d_truncate'
22184 d_ttyname_r='$d_ttyname_r'
22185 d_tzname='$d_tzname'
22186 d_u32align='$d_u32align'
22187 d_ualarm='$d_ualarm'
22190 d_union_semun='$d_union_semun'
22191 d_unordered='$d_unordered'
22192 d_unsetenv='$d_unsetenv'
22193 d_usleep='$d_usleep'
22194 d_usleepproto='$d_usleepproto'
22196 d_vendorarch='$d_vendorarch'
22197 d_vendorbin='$d_vendorbin'
22198 d_vendorlib='$d_vendorlib'
22199 d_vendorscript='$d_vendorscript'
22201 d_void_closedir='$d_void_closedir'
22202 d_voidsig='$d_voidsig'
22203 d_voidtty='$d_voidtty'
22204 d_volatile='$d_volatile'
22205 d_vprintf='$d_vprintf'
22206 d_vsnprintf='$d_vsnprintf'
22208 d_waitpid='$d_waitpid'
22209 d_wcstombs='$d_wcstombs'
22210 d_wctomb='$d_wctomb'
22211 d_writev='$d_writev'
22214 db_hashtype='$db_hashtype'
22215 db_prefixtype='$db_prefixtype'
22216 db_version_major='$db_version_major'
22217 db_version_minor='$db_version_minor'
22218 db_version_patch='$db_version_patch'
22219 defvoidused='$defvoidused'
22220 direntrytype='$direntrytype'
22223 doublesize='$doublesize'
22225 drand48_r_proto='$drand48_r_proto'
22227 dynamic_ext='$dynamic_ext'
22233 endgrent_r_proto='$endgrent_r_proto'
22234 endhostent_r_proto='$endhostent_r_proto'
22235 endnetent_r_proto='$endnetent_r_proto'
22236 endprotoent_r_proto='$endprotoent_r_proto'
22237 endpwent_r_proto='$endpwent_r_proto'
22238 endservent_r_proto='$endservent_r_proto'
22239 eunicefix='$eunicefix'
22242 extensions='$extensions'
22244 fflushNULL='$fflushNULL'
22245 fflushall='$fflushall'
22247 firstmakefile='$firstmakefile'
22249 fpossize='$fpossize'
22250 fpostype='$fpostype'
22251 freetype='$freetype'
22254 full_csh='$full_csh'
22255 full_sed='$full_sed'
22256 gccansipedantic='$gccansipedantic'
22257 gccosandvers='$gccosandvers'
22258 gccversion='$gccversion'
22259 getgrent_r_proto='$getgrent_r_proto'
22260 getgrgid_r_proto='$getgrgid_r_proto'
22261 getgrnam_r_proto='$getgrnam_r_proto'
22262 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22263 gethostbyname_r_proto='$gethostbyname_r_proto'
22264 gethostent_r_proto='$gethostent_r_proto'
22265 getlogin_r_proto='$getlogin_r_proto'
22266 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22267 getnetbyname_r_proto='$getnetbyname_r_proto'
22268 getnetent_r_proto='$getnetent_r_proto'
22269 getprotobyname_r_proto='$getprotobyname_r_proto'
22270 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22271 getprotoent_r_proto='$getprotoent_r_proto'
22272 getpwent_r_proto='$getpwent_r_proto'
22273 getpwnam_r_proto='$getpwnam_r_proto'
22274 getpwuid_r_proto='$getpwuid_r_proto'
22275 getservbyname_r_proto='$getservbyname_r_proto'
22276 getservbyport_r_proto='$getservbyport_r_proto'
22277 getservent_r_proto='$getservent_r_proto'
22278 getspnam_r_proto='$getspnam_r_proto'
22279 gidformat='$gidformat'
22285 gmtime_r_proto='$gmtime_r_proto'
22286 gnulibc_version='$gnulibc_version'
22288 groupcat='$groupcat'
22289 groupstype='$groupstype'
22292 h_sysfile='$h_sysfile'
22295 html1dir='$html1dir'
22296 html1direxp='$html1direxp'
22297 html3dir='$html3dir'
22298 html3direxp='$html3direxp'
22307 i_arpainet='$i_arpainet'
22308 i_assert='$i_assert'
22309 i_bsdioctl='$i_bsdioctl'
22313 i_dirent='$i_dirent'
22319 i_fp_class='$i_fp_class'
22322 i_ieeefp='$i_ieeefp'
22323 i_inttypes='$i_inttypes'
22324 i_langinfo='$i_langinfo'
22325 i_libutil='$i_libutil'
22326 i_limits='$i_limits'
22327 i_locale='$i_locale'
22328 i_machcthr='$i_machcthr'
22329 i_malloc='$i_malloc'
22331 i_memory='$i_memory'
22332 i_mntent='$i_mntent'
22335 i_neterrno='$i_neterrno'
22336 i_netinettcp='$i_netinettcp'
22340 i_pthread='$i_pthread'
22342 i_rpcsvcdbm='$i_rpcsvcdbm'
22345 i_shadow='$i_shadow'
22347 i_stdarg='$i_stdarg'
22348 i_stddef='$i_stddef'
22349 i_stdlib='$i_stdlib'
22350 i_string='$i_string'
22351 i_sunmath='$i_sunmath'
22352 i_sysaccess='$i_sysaccess'
22353 i_sysdir='$i_sysdir'
22354 i_sysfile='$i_sysfile'
22355 i_sysfilio='$i_sysfilio'
22357 i_sysioctl='$i_sysioctl'
22358 i_syslog='$i_syslog'
22359 i_sysmman='$i_sysmman'
22360 i_sysmode='$i_sysmode'
22361 i_sysmount='$i_sysmount'
22362 i_sysndir='$i_sysndir'
22363 i_sysparam='$i_sysparam'
22364 i_sysresrc='$i_sysresrc'
22365 i_syssecrt='$i_syssecrt'
22366 i_sysselct='$i_sysselct'
22367 i_syssockio='$i_syssockio'
22368 i_sysstat='$i_sysstat'
22369 i_sysstatfs='$i_sysstatfs'
22370 i_sysstatvfs='$i_sysstatvfs'
22371 i_systime='$i_systime'
22372 i_systimek='$i_systimek'
22373 i_systimes='$i_systimes'
22374 i_systypes='$i_systypes'
22375 i_sysuio='$i_sysuio'
22377 i_sysutsname='$i_sysutsname'
22378 i_sysvfs='$i_sysvfs'
22379 i_syswait='$i_syswait'
22380 i_termio='$i_termio'
22381 i_termios='$i_termios'
22383 i_unistd='$i_unistd'
22386 i_values='$i_values'
22387 i_varargs='$i_varargs'
22388 i_varhdr='$i_varhdr'
22390 ignore_versioned_solibs='$ignore_versioned_solibs'
22391 inc_version_list='$inc_version_list'
22392 inc_version_list_init='$inc_version_list_init'
22395 initialinstalllocation='$initialinstalllocation'
22396 installarchlib='$installarchlib'
22397 installbin='$installbin'
22398 installhtml1dir='$installhtml1dir'
22399 installhtml3dir='$installhtml3dir'
22400 installman1dir='$installman1dir'
22401 installman3dir='$installman3dir'
22402 installprefix='$installprefix'
22403 installprefixexp='$installprefixexp'
22404 installprivlib='$installprivlib'
22405 installscript='$installscript'
22406 installsitearch='$installsitearch'
22407 installsitebin='$installsitebin'
22408 installsitehtml1dir='$installsitehtml1dir'
22409 installsitehtml3dir='$installsitehtml3dir'
22410 installsitelib='$installsitelib'
22411 installsiteman1dir='$installsiteman1dir'
22412 installsiteman3dir='$installsiteman3dir'
22413 installsitescript='$installsitescript'
22414 installstyle='$installstyle'
22415 installusrbinperl='$installusrbinperl'
22416 installvendorarch='$installvendorarch'
22417 installvendorbin='$installvendorbin'
22418 installvendorhtml1dir='$installvendorhtml1dir'
22419 installvendorhtml3dir='$installvendorhtml3dir'
22420 installvendorlib='$installvendorlib'
22421 installvendorman1dir='$installvendorman1dir'
22422 installvendorman3dir='$installvendorman3dir'
22423 installvendorscript='$installvendorscript'
22425 issymlink='$issymlink'
22426 ivdformat='$ivdformat'
22429 known_extensions='$known_extensions'
22432 lddlflags='$lddlflags'
22434 ldflags_uselargefiles='$ldflags_uselargefiles'
22435 ldlibpthname='$ldlibpthname'
22442 libsdirs='$libsdirs'
22443 libsfiles='$libsfiles'
22444 libsfound='$libsfound'
22445 libspath='$libspath'
22446 libswanted='$libswanted'
22447 libswanted_uselargefiles='$libswanted_uselargefiles'
22453 localtime_r_proto='$localtime_r_proto'
22454 locincpth='$locincpth'
22455 loclibpth='$loclibpth'
22456 longdblsize='$longdblsize'
22457 longlongsize='$longlongsize'
22458 longsize='$longsize'
22462 lseeksize='$lseeksize'
22463 lseektype='$lseektype'
22466 madlyobj='$madlyobj'
22467 madlysrc='$madlysrc'
22471 make_set_make='$make_set_make'
22472 mallocobj='$mallocobj'
22473 mallocsrc='$mallocsrc'
22474 malloctype='$malloctype'
22476 man1direxp='$man1direxp'
22479 man3direxp='$man3direxp'
22481 mips_type='$mips_type'
22482 mistrustnm='$mistrustnm'
22484 mmaptype='$mmaptype'
22485 modetype='$modetype'
22487 multiarch='$multiarch'
22489 myarchname='$myarchname'
22490 mydomain='$mydomain'
22491 myhostname='$myhostname'
22494 need_va_copy='$need_va_copy'
22495 netdb_hlen_type='$netdb_hlen_type'
22496 netdb_host_type='$netdb_host_type'
22497 netdb_name_type='$netdb_name_type'
22498 netdb_net_type='$netdb_net_type'
22501 nm_so_opt='$nm_so_opt'
22502 nonxs_ext='$nonxs_ext'
22504 nvEUformat='$nvEUformat'
22505 nvFUformat='$nvFUformat'
22506 nvGUformat='$nvGUformat'
22507 nv_overflows_integers_at='$nv_overflows_integers_at'
22508 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22509 nveformat='$nveformat'
22510 nvfformat='$nvfformat'
22511 nvgformat='$nvgformat'
22514 o_nonblock='$o_nonblock'
22516 old_pthread_create_joinable='$old_pthread_create_joinable'
22517 optimize='$optimize'
22518 orderlib='$orderlib'
22521 otherlibdirs='$otherlibdirs'
22525 patchlevel='$patchlevel'
22526 path_sep='$path_sep'
22529 perl_patchlevel='$perl_patchlevel'
22530 perladmin='$perladmin'
22531 perllibs='$perllibs'
22532 perlpath='$perlpath'
22534 phostname='$phostname'
22540 prefixexp='$prefixexp'
22542 privlibexp='$privlibexp'
22543 procselfexe='$procselfexe'
22544 prototype='$prototype'
22546 quadkind='$quadkind'
22547 quadtype='$quadtype'
22548 randbits='$randbits'
22549 randfunc='$randfunc'
22550 random_r_proto='$random_r_proto'
22551 randseedtype='$randseedtype'
22553 rd_nodata='$rd_nodata'
22554 readdir64_r_proto='$readdir64_r_proto'
22555 readdir_r_proto='$readdir_r_proto'
22556 revision='$revision'
22562 sPRIEUldbl='$sPRIEUldbl'
22563 sPRIFUldbl='$sPRIFUldbl'
22564 sPRIGUldbl='$sPRIGUldbl'
22565 sPRIXU64='$sPRIXU64'
22567 sPRIeldbl='$sPRIeldbl'
22568 sPRIfldbl='$sPRIfldbl'
22569 sPRIgldbl='$sPRIgldbl'
22574 sSCNfldbl='$sSCNfldbl'
22575 sched_yield='$sched_yield'
22576 scriptdir='$scriptdir'
22577 scriptdirexp='$scriptdirexp'
22579 seedfunc='$seedfunc'
22580 selectminbits='$selectminbits'
22581 selecttype='$selecttype'
22582 sendmail='$sendmail'
22583 setgrent_r_proto='$setgrent_r_proto'
22584 sethostent_r_proto='$sethostent_r_proto'
22585 setlocale_r_proto='$setlocale_r_proto'
22586 setnetent_r_proto='$setnetent_r_proto'
22587 setprotoent_r_proto='$setprotoent_r_proto'
22588 setpwent_r_proto='$setpwent_r_proto'
22589 setservent_r_proto='$setservent_r_proto'
22592 sharpbang='$sharpbang'
22593 shmattype='$shmattype'
22594 shortsize='$shortsize'
22597 sig_count='$sig_count'
22598 sig_name='$sig_name'
22599 sig_name_init='$sig_name_init'
22601 sig_num_init='$sig_num_init'
22602 sig_size='$sig_size'
22603 signal_t='$signal_t'
22604 sitearch='$sitearch'
22605 sitearchexp='$sitearchexp'
22607 sitebinexp='$sitebinexp'
22608 sitehtml1dir='$sitehtml1dir'
22609 sitehtml1direxp='$sitehtml1direxp'
22610 sitehtml3dir='$sitehtml3dir'
22611 sitehtml3direxp='$sitehtml3direxp'
22613 sitelib_stem='$sitelib_stem'
22614 sitelibexp='$sitelibexp'
22615 siteman1dir='$siteman1dir'
22616 siteman1direxp='$siteman1direxp'
22617 siteman3dir='$siteman3dir'
22618 siteman3direxp='$siteman3direxp'
22619 siteprefix='$siteprefix'
22620 siteprefixexp='$siteprefixexp'
22621 sitescript='$sitescript'
22622 sitescriptexp='$sitescriptexp'
22623 sizesize='$sizesize'
22624 sizetype='$sizetype'
22628 sockethdr='$sockethdr'
22629 socketlib='$socketlib'
22630 socksizetype='$socksizetype'
22632 spackage='$spackage'
22633 spitshell='$spitshell'
22634 srand48_r_proto='$srand48_r_proto'
22635 srandom_r_proto='$srandom_r_proto'
22637 ssizetype='$ssizetype'
22638 startperl='$startperl'
22640 static_ext='$static_ext'
22642 stdio_base='$stdio_base'
22643 stdio_bufsiz='$stdio_bufsiz'
22644 stdio_cnt='$stdio_cnt'
22645 stdio_filbuf='$stdio_filbuf'
22646 stdio_ptr='$stdio_ptr'
22647 stdio_stream_array='$stdio_stream_array'
22648 strerror_r_proto='$strerror_r_proto'
22651 subversion='$subversion'
22655 targetarch='$targetarch'
22659 timeincl='$timeincl'
22660 timetype='$timetype'
22661 tmpnam_r_proto='$tmpnam_r_proto'
22667 ttyname_r_proto='$ttyname_r_proto'
22676 uidformat='$uidformat'
22682 uquadtype='$uquadtype'
22683 use5005threads='$use5005threads'
22684 use64bitall='$use64bitall'
22685 use64bitint='$use64bitint'
22686 usecrosscompile='$usecrosscompile'
22688 usedtrace='$usedtrace'
22689 usefaststdio='$usefaststdio'
22690 useithreads='$useithreads'
22691 uselargefiles='$uselargefiles'
22692 uselongdouble='$uselongdouble'
22693 usemallocwrap='$usemallocwrap'
22694 usemorebits='$usemorebits'
22695 usemultiplicity='$usemultiplicity'
22696 usemymalloc='$usemymalloc'
22698 useopcode='$useopcode'
22699 useperlio='$useperlio'
22700 useposix='$useposix'
22701 usereentrant='$usereentrant'
22702 userelocatableinc='$userelocatableinc'
22704 useshrplib='$useshrplib'
22705 usesitecustomize='$usesitecustomize'
22706 usesocks='$usesocks'
22707 usethreads='$usethreads'
22708 usevendorprefix='$usevendorprefix'
22709 usevfork='$usevfork'
22712 uvXUformat='$uvXUformat'
22713 uvoformat='$uvoformat'
22716 uvuformat='$uvuformat'
22717 uvxformat='$uvxformat'
22718 vendorarch='$vendorarch'
22719 vendorarchexp='$vendorarchexp'
22720 vendorbin='$vendorbin'
22721 vendorbinexp='$vendorbinexp'
22722 vendorhtml1dir='$vendorhtml1dir'
22723 vendorhtml1direxp='$vendorhtml1direxp'
22724 vendorhtml3dir='$vendorhtml3dir'
22725 vendorhtml3direxp='$vendorhtml3direxp'
22726 vendorlib='$vendorlib'
22727 vendorlib_stem='$vendorlib_stem'
22728 vendorlibexp='$vendorlibexp'
22729 vendorman1dir='$vendorman1dir'
22730 vendorman1direxp='$vendorman1direxp'
22731 vendorman3dir='$vendorman3dir'
22732 vendorman3direxp='$vendorman3direxp'
22733 vendorprefix='$vendorprefix'
22734 vendorprefixexp='$vendorprefixexp'
22735 vendorscript='$vendorscript'
22736 vendorscriptexp='$vendorscriptexp'
22738 version_patchlevel_string='$version_patchlevel_string'
22739 versiononly='$versiononly'
22741 voidflags='$voidflags'
22744 yaccflags='$yaccflags'
22749 : Add in command line options if available
22750 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22752 : add special variables
22753 $test -f $src/patchlevel.h && \
22754 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22755 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22756 echo "PERL_CONFIG_SH=true" >>config.sh
22758 : propagate old symbols
22759 if $test -f UU/config.sh; then
22760 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22761 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
22762 config.sh config.sh UU/oldconfig.sh |\
22763 $sort | $uniq -u >UU/oldsyms
22764 set X `cat UU/oldsyms`
22770 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22772 echo ": Variables propagated from previous config.sh file." >>config.sh
22773 for sym in `cat UU/oldsyms`; do
22774 echo " Propagating $hint variable "'$'"$sym..."
22775 eval 'tmp="$'"${sym}"'"'
22777 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22783 : Finish up by extracting the .SH files
22787 echo "Extraction done."
22797 If you'd like to make any changes to the config.sh file before I begin
22798 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22801 rp="Press return or use a shell escape to edit config.sh:"
22806 *) : in case they cannot read
22807 sh 1>&4 -c "$ans";;
22812 : if this fails, just run all the .SH files by hand
22821 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22828 Now you need to generate make dependencies by running "$make depend".
22829 You might prefer to run it in background: "$make depend > makedepend.out &"
22830 It can take a while, so you might not want to run it right now.
22835 rp="Run $make depend now?"
22839 $make depend && echo "Now you must run '$make'."
22842 echo "You must run '$make depend' then '$make'."
22845 elif test -f [Mm]akefile; then
22847 echo "Now you must run a $make."
22849 echo "Configure done."
22852 if $test -f Policy.sh; then
22855 If you compile $package on a different machine or from a different object
22856 directory, copy the Policy.sh file from this object directory to the
22857 new one before you run Configure -- this will help you with most of
22858 the policy defaults.
22862 if $test -f config.msg; then
22863 echo "Hmm. I also noted the following information while running:"
22865 $cat config.msg >&4
22868 $rm -f kit*isdone ark*isdone