3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Tue Oct 28 18:51:20 CET 2008 [metaconfig 3.5 PL0]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
336 initialinstalllocation=''
363 d_attribute_format=''
364 d_attribute_malloc=''
365 d_attribute_nonnull=''
366 d_attribute_noreturn=''
368 d_attribute_unused=''
369 d_attribute_warn_unused_result=''
370 d_printf_format_null=''
373 d_builtin_choose_expr=''
376 d_c99_variadic_macros=''
423 endhostent_r_proto=''
429 endprotoent_r_proto=''
435 endservent_r_proto=''
487 gethostbyaddr_r_proto=''
489 gethostbyname_r_proto=''
491 gethostent_r_proto=''
503 getnetbyaddr_r_proto=''
505 getnetbyname_r_proto=''
519 d_getprotobyname_r=''
520 getprotobyname_r_proto=''
521 d_getprotobynumber_r=''
522 getprotobynumber_r_proto=''
524 getprotoent_r_proto=''
536 getservbyname_r_proto=''
538 getservbyport_r_proto=''
540 getservent_r_proto=''
564 d_libm_lib_version=''
567 d_localtime_r_needs_tzset=''
578 d_malloc_good_size=''
620 d_old_pthread_create_joinable=''
621 old_pthread_create_joinable=''
623 d_pthread_attr_setscope=''
662 sethostent_r_proto=''
679 setprotoent_r_proto=''
691 setservent_r_proto=''
725 d_sprintf_returns_strlen=''
740 d_stdio_ptr_lval_nochange_cnt=''
741 d_stdio_ptr_lval_sets_cnt=''
958 d_inc_version_list=''
960 inc_version_list_init=''
979 ignore_versioned_solibs=''
1043 d_perl_otherlibdirs=''
1051 api_versionstring=''
1057 version_patchlevel_string=''
1061 d_nv_preserves_uv=''
1062 d_nv_zero_is_allbits_zero=''
1073 nv_overflows_integers_at=''
1074 nv_preserves_uv_bits=''
1146 installsitehtml1dir=''
1149 installsitehtml3dir=''
1156 installsiteman1dir=''
1159 installsiteman3dir=''
1164 installsitescript=''
1179 d_stdio_stream_array=''
1180 stdio_stream_array=''
1197 ccflags_uselargefiles=''
1198 ldflags_uselargefiles=''
1199 libswanted_uselargefiles=''
1219 installvendorarch=''
1226 installvendorhtml1dir=''
1228 vendorhtml1direxp=''
1229 installvendorhtml3dir=''
1231 vendorhtml3direxp=''
1237 installvendorman1dir=''
1240 installvendorman3dir=''
1247 installvendorscript=''
1260 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1263 : We must find out about Eunice early
1265 if test -f /etc/unixtovms; then
1266 eunicefix=/etc/unixtovms
1268 if test -f /etc/unixtovms.exe; then
1269 eunicefix=/etc/unixtovms.exe
1272 : Set executable suffix now -- needed before hints available
1273 if test -f "/libs/version.library"; then
1276 elif test -f "/system/gnu_library/bin/ar.pm"; then
1279 elif test -n "$DJGPP"; then
1282 elif test -d c:/. -o -n "$is_os2" ; then
1289 : Trailing extension. Override this in a hint file, if needed.
1290 : Extra object files, if any, needed on this platform.
1294 : change the next line if compiling for Xenix/286 on Xenix/386
1295 xlibpth='/usr/lib/386 /lib/386'
1296 : Possible local library directories to search.
1297 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1298 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1300 : general looking path for locating libraries
1301 glibpth="/lib /usr/lib $xlibpth"
1302 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1303 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1304 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1305 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1307 : Private path used by Configure to find libraries. Its value
1308 : is prepended to libpth. This variable takes care of special
1309 : machines, like the mips. Usually, it should be empty.
1312 : default library list
1314 : some systems want to use only the non-versioned libso:s
1315 ignore_versioned_solibs=''
1316 : set usethreads on the Configure command line to enable threads.
1317 usereentrant='undef'
1318 : full support for void wanted by default
1321 : Possible local include directories to search.
1322 : Set locincpth to "" in a hint file to defeat local include searches.
1323 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1324 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1326 : no include file wanted by default
1329 : Enable -DEBUGGING and -DDEBUGGING from the command line
1336 : set useposix=false in your hint file to disable the POSIX extension.
1338 : set useopcode=false in your hint file to disable the Opcode extension.
1341 ccflags_uselargefiles=''
1342 ldflags_uselargefiles=''
1343 libswanted_uselargefiles=''
1344 : set usemultiplicity on the Configure command line to enable multiplicity.
1345 : set usesocks on the Configure command line to enable socks.
1346 : List of libraries we want.
1347 : If anyone needs extra -lxxx, put those in a hint file.
1348 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1349 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1350 : We probably want to search /usr/shlib before most other libraries.
1351 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1352 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1353 glibpth="/usr/shlib $glibpth"
1354 : Do not use vfork unless overridden by a hint file.
1357 : Find the basic shell for Bourne shell scripts
1361 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1364 if test -f "$xxx"; then
1367 : Build up a list and do a single loop so we can 'break' out.
1368 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1369 for xxx in sh bash ksh pdksh ash; do
1371 try="$try ${p}/${xxx}"
1375 if test -f "$xxx"; then
1378 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1381 elif test -f "$xxx.exe"; then
1392 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1394 Usually it's in /bin/sh. How did you even get this far?
1395 Please contact me (Perl Maintainers) at perlbug@perl.org and
1396 we'll try to straighten this all out.
1402 : see if sh knows # comments
1403 if `$sh -c '#' >/dev/null 2>&1`; then
1407 test -f $xcat$_exe || xcat=/usr/bin/cat
1408 if test ! -f $xcat$_exe; then
1409 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1410 if test -f $p/cat$_exe; then
1415 if test ! -f $xcat$_exe; then
1416 echo "Can't find cat anywhere!"
1420 echo "#!$xcat" >sharp
1423 ./sharp > today 2>/dev/null
1424 if test -s today; then
1427 echo "#! $xcat" > sharp
1430 ./sharp > today 2>/dev/null
1431 if test -s today; then
1439 echo "Your $sh doesn't grok # comments--I will strip them later on."
1442 echo "exec grep -v '^[ ]*#'" >spitshell
1444 $eunicefix spitshell
1445 spitshell=`pwd`/spitshell
1447 echo "I presume that if # doesn't work, #! won't work either!"
1452 : figure out how to guarantee sh startup
1454 '') startsh=${sharpbang}${sh} ;;
1466 : echo "Yup, it does."
1468 echo "Hmm... '$startsh' does not guarantee sh startup..."
1469 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1473 : Save command line options in file UU/cmdline.opt for later use in
1474 : generating config.sh.
1475 cat > cmdline.opt <<EOSH
1476 : Configure command line arguments.
1485 cat >>cmdline.opt <<EOSH
1486 config_arg$argn='$arg'
1488 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1491 arg_exp=`cat cmdl.opt`
1492 args_exp="$args_exp$args_sep'$arg_exp'"
1493 argn=`expr $argn + 1`
1498 : produce awk script to parse command line options
1499 cat >options.awk <<'EOF'
1501 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1503 len = length(optstr);
1504 for (i = 1; i <= len; i++) {
1505 c = substr(optstr, i, 1);
1506 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1517 if (substr(str, 1, 1) != "-") {
1518 printf("'%s'\n", str);
1522 for (i = 2; i <= len; i++) {
1523 c = substr(str, i, 1);
1525 printf("-%s\n", substr(str, i));
1531 printf("'%s'\n", substr(str, i + 1));
1544 : process the command line options
1545 set X `for arg in "$@"; do echo "X$arg"; done |
1546 sed -e s/X// | awk -f options.awk`
1551 : set up default values
1561 rm -f optdef.sh posthint.sh
1562 cat >optdef.sh <<EOS
1568 while test $# -gt 0; do
1570 -d) shift; fastread=yes;;
1571 -e) shift; alldone=cont;;
1575 if test -r "$1"; then
1578 echo "$me: cannot read config file $1." >&2
1584 -h) shift; error=true;;
1585 -r) shift; reuseval=true;;
1586 -s) shift; silent=true; realsilent=true;;
1587 -E) shift; alldone=exit;;
1588 -K) shift; knowitall=true;;
1589 -O) shift; override=true;;
1590 -S) shift; silent=true; extractsh=true;;
1595 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1596 echo "$me: ignoring -D $1" >&2
1599 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1600 *) echo "$1='define'" >> optdef.sh;;
1607 *=) echo "$1" >> optdef.sh;;
1609 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1610 echo "$me: ignoring -U $1" >&2
1612 *) echo "$1='undef'" >> optdef.sh;;
1623 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1627 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1628 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1634 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1635 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1636 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1637 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1638 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1639 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1645 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1647 echo "$yyy=''" >> posthint.sh ;;
1652 echo "$yyy='$zzz'" >> posthint.sh ;;
1654 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1656 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1661 echo "$yyy=$zzz" >> posthint.sh ;;
1662 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1666 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1669 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1677 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1678 [-U symbol] [-U symbol=] [-A command:symbol...]
1679 -d : use defaults for all answers.
1680 -e : go on without questioning past the production of config.sh.
1681 -f : specify an alternate default configuration file.
1682 -h : print this help message and exit (with an error status).
1683 -r : reuse C symbols value if possible (skips costly nm extraction).
1684 -s : silent mode, only echoes questions and essential information.
1685 -D : define symbol to have some value:
1686 -D symbol symbol gets the value 'define'
1687 -D symbol=value symbol gets the value 'value'
1688 common used examples (see INSTALL for more info):
1689 -Duse64bitint use 64bit integers
1690 -Duse64bitall use 64bit integers and pointers
1691 -Dusethreads use thread support
1692 -Dinc_version_list=none do not include older perl trees in @INC
1693 -DEBUGGING=none DEBUGGING options
1694 -Dcc=gcc choose your compiler
1695 -Dprefix=/opt/perl5 choose your destination
1696 -E : stop at the end of questions, after having produced config.sh.
1697 -K : do not use unless you know what you are doing.
1698 -O : let -D and -U override definitions from loaded configuration file.
1699 -S : perform variable substitutions on all .SH files (can mix with -f)
1700 -U : undefine symbol:
1701 -U symbol symbol gets the value 'undef'
1702 -U symbol= symbol gets completely empty
1704 -A : manipulate symbol after the platform specific hints have been applied:
1705 -A append:symbol=value append value to symbol
1706 -A symbol=value like append:, but with a separating space
1707 -A define:symbol=value define symbol to have value
1708 -A clear:symbol define symbol to be ''
1709 -A define:symbol define symbol to be 'define'
1710 -A eval:symbol=value define symbol to be eval of value
1711 -A prepend:symbol=value prepend value to symbol
1712 -A undef:symbol define symbol to be 'undef'
1713 -A undef:symbol= define symbol to be ''
1714 e.g.: -A prepend:libswanted='cl pthread '
1715 -A ccflags=-DSOME_MACRO
1716 -V : print version number and exit (with a zero status).
1723 case "$fastread$alldone" in
1726 case "$extractsh" in
1729 if test ! -t 0; then
1730 echo "Say 'sh Configure', not 'sh <Configure'"
1740 true) exec 1>/dev/null;;
1743 : run the defines and the undefines, if any, but leave the file out there...
1746 : create the posthint manipulation script and leave the file out there...
1751 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1752 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1753 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1754 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1755 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1758 : Some greps do not return status, grrr.
1759 echo "grimblepritz" >grimble
1760 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1762 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1768 : the following should work in any shell
1772 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1773 cat >contains <<'EOSS'
1774 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1779 : Find the path to the source tree
1782 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1786 *) src=`cd ../$src && pwd` ;;
1799 if test -f $rsrc/Configure && \
1800 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1802 : found it, so we are ok.
1805 for src in . .. ../.. ../../.. ../../../..; do
1806 if test -f ../$src/Configure && \
1807 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1818 Sorry, I can't seem to locate the source dir for $package. Please start
1819 Configure with an explicit path -- i.e. /some/path/Configure.
1827 echo "Sources for $package found in \"$src\"." >&4
1831 : script used to extract .SH files with variable substitutions
1832 cat >extract <<'EOS'
1834 echo "Doing variable substitutions on .SH files..."
1835 if test -f MANIFEST; then
1836 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1838 echo "(Looking for .SH files under the source directory.)"
1839 set x `(cd "$src"; find . -name "*.SH" -print)`
1843 0) set x `(cd "$src"; echo *.SH)`; shift;;
1845 if test ! -f "$src/$1"; then
1851 while test $name; do
1852 if test ! -d "$name"; then
1853 create="$name $create";
1854 name=`echo $name | sed -e "s|^[^/]*$||"`;
1855 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1860 for file in $create; do
1869 dir=`expr X$file : 'X\(.*\)/'`
1870 file=`expr X$file : 'X.*/\(.*\)'`
1871 (cd "$dir" && . ./$file)
1881 dir=`expr X$file : 'X\(.*\)/'`
1882 file=`expr X$file : 'X.*/\(.*\)'`
1883 (set x $dir; shift; eval $mkdir_p)
1884 sh <"$src/$dir/$file"
1893 if test -f "$src/config_h.SH"; then
1894 if test ! -f config.h; then
1895 : oops, they left it out of MANIFEST, probably, so do it anyway.
1896 . "$src/config_h.SH"
1901 : extract files and exit if asked to do so
1902 case "$extractsh" in
1904 case "$realsilent" in
1908 case "$config_sh" in
1909 '') config_sh='config.sh';;
1912 echo "Fetching answers from $config_sh..."
1915 test "$override" && . ./optdef.sh
1919 echo "Extraction done."
1924 : Eunice requires " " instead of "", can you believe it
1927 echo "Beginning of configuration questions for $package."
1929 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1931 : first determine how to suppress newline on echo command
1933 echo "Checking echo to see how to suppress newlines..."
1934 (echo "hi there\c" ; echo " ") >.echotmp
1935 if $contains c .echotmp >/dev/null 2>&1 ; then
1946 echo $n "The star should be here-->$c"
1950 : Now test for existence of everything in MANIFEST
1952 if test -f "$rsrc/MANIFEST"; then
1953 echo "First let's make sure your kit is complete. Checking..." >&4
1954 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1955 (split -l 50 2>/dev/null || split -50)
1958 for filelist in x??; do
1959 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1960 >/dev/null 2>>"$tmppwd/missing")
1962 if test -s missing; then
1966 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1968 You have the option of continuing the configuration process, despite the
1969 distinct possibility that your kit is damaged, by typing 'y'es. If you
1970 do, don't blame me if something goes wrong. I advise you to type 'n'o
1971 and contact the author (perlbug@perl.org).
1974 echo $n "Continue? [n] $c" >&4
1978 echo "Continuing..." >&4
1982 echo "ABORTING..." >&4
1987 echo "Looks good..."
1990 echo "There is no MANIFEST file. I hope your kit is complete !"
1994 : Find the appropriate value for a newline for tr
1996 if test -n "$DJGPP"; then
1999 if test X"$trnl" = X; then
2000 case "`echo foo|tr '\n' x 2>/dev/null`" in
2004 if test X"$trnl" = X; then
2005 case "`echo foo|tr '\012' x 2>/dev/null`" in
2006 foox) trnl='\012' ;;
2009 if test X"$trnl" = X; then
2010 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2011 fooxy) trnl='\n\r' ;;
2014 if test X"$trnl" = X; then
2017 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2023 : compute the number of columns on the terminal for proper question formatting
2028 : set up the echo used in my read
2029 myecho="case \"\$xxxm\" in
2030 '') echo $n \"\$rp $c\" >&4;;
2032 '') echo $n \"[\$xxxm] $c\";;
2034 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2036 echo $n \"[\$xxxm] $c\" >&4
2038 echo $n \"\$rp [\$xxxm] $c\" >&4
2044 : now set up to do reads with possible shell escape and default assignment
2050 case "\$fastread" in
2051 yes) case "\$dflt" in
2054 case "\$silent-\$rp" in
2059 *) case "\$silent" in
2060 true) case "\$rp" in
2065 while expr "X\$ans" : "X!" >/dev/null; do
2069 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2077 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2086 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2091 echo "(OK, I'll run with -d after this question.)" >&4
2094 echo "*** Sorry, \$1 not supported yet." >&4
2104 echo "*** Substitution done -- please confirm."
2106 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2111 echo "*** Error -- try again."
2118 case "\$ans\$xxxm\$nostick" in
2130 : create .config dir to save info across Configure sessions
2131 test -d ../.config || mkdir ../.config
2132 cat >../.config/README <<EOF
2133 This directory created by Configure to save information that should
2134 persist across sessions for $package.
2136 You may safely delete it if you wish.
2139 : See if we are using a devel version and want that
2140 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2142 $define|true|[yY]*) ;;
2143 *) case "$xversion" in
2146 *** WHOA THERE!!! ***
2148 This is an UNSTABLE DEVELOPMENT release.
2149 The version of this $package distribution is $xversion, that is, odd,
2150 (as opposed to even) and that signifies a development release.
2151 If you want a maintenance release, you want an even-numbered version.
2153 Do ***NOT*** install this into production use.
2154 Data corruption and crashes are possible.
2156 It is most seriously suggested that you do not continue any further
2157 unless you want to help in developing and debugging Perl.
2159 If you *still* want to build perl, you can answer 'y' now,
2160 or pass -Dusedevel to Configure.
2163 rp='Do you really want to continue?'
2167 [yY]) echo >&4 "Okay, continuing."
2168 usedevel="$define" ;;
2169 *) echo >&4 "Okay, bye."
2179 case "$versiononly" in
2180 '') versiononly="$define" ;;
2182 case "$installusrbinperl" in
2183 '') installusrbinperl="$undef" ;;
2188 : general instructions
2191 user=`(logname) 2>/dev/null`
2193 '') user=`whoami 2>&1`;;
2195 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2198 rp='Would you like to see the instructions?'
2209 This installation shell script will examine your system and ask you questions
2210 to determine how the perl5 package should be installed. If you get
2211 stuck on a question, you may use a ! shell escape to start a subshell or
2212 execute a command. Many of the questions will have default answers in square
2213 brackets; typing carriage return will give you the default.
2215 On some of the questions which ask for file or directory names you are allowed
2216 to use the ~name construct to specify the login directory belonging to "name",
2217 even if you don't have a shell which knows about that. Questions where this is
2218 allowed will be marked "(~name ok)".
2222 dflt='Type carriage return to continue'
2226 The prompter used in this script allows you to use shell variables and
2227 backticks in your answers. You may use $1, $2, etc... to refer to the words
2228 in the default answer, as if the default line was a set of arguments given to a
2229 script shell. This means you may also use $* to repeat the whole default line,
2230 so you do not have to re-type everything to add something to the default.
2232 Everytime there is a substitution, you will have to confirm. If there is an
2233 error (e.g. an unmatched backtick), the default answer will remain unchanged
2234 and you will be prompted again.
2236 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2237 the questions and use the computed defaults (or the previous answers if there
2238 was already a config.sh file). Type 'Configure -h' for a list of options.
2239 You may also start interactively and then answer '& -d' at any prompt to turn
2240 on the non-interactive behaviour for the remainder of the execution.
2246 Much effort has been expended to ensure that this shell script will run on any
2247 Unix system. If despite that it blows up on yours, your best bet is to edit
2248 Configure and run it again. If you can't run Configure for some reason,
2249 you'll have to generate a config.sh file by hand. Whatever problems you
2250 have, let me (perlbug@perl.org) know how I blew it.
2252 This installation script affects things in two ways:
2254 1) it may do direct variable substitutions on some of the files included
2256 2) it builds a config.h file for inclusion in C programs. You may edit
2257 any of these files as the need arises after running this script.
2259 If you make a mistake on a question, there is no easy way to back up to it
2260 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2261 files. Configure will offer to let you do this before it runs the SH files.
2264 dflt='Type carriage return to continue'
2266 case "$firsttime" in
2267 true) echo $user >>../.config/instruct;;
2271 : find out where common programs are
2273 echo "Locating common programs..." >&4
2286 if test -d \$dir/\$thing; then
2292 for thisthing in \$dir/\$thing; do
2293 : just loop through to pick last item
2295 if test -f \$thisthing; then
2298 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2301 elif test -f \$dir/\$thing.exe; then
2302 if test -n "$DJGPP"; then
2303 echo \$dir/\$thing.exe
2304 elif test "$eunicefix" != ":"; then
2305 : on Eunice apparently
2357 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2358 pth="$pth /lib /usr/lib"
2359 for file in $loclist; do
2363 if test -f "$xxx"; then
2366 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2367 xxx=`./loc $file $file $pth`
2370 '') xxx=`./loc $file $file $pth`;;
2371 *) xxx=`./loc $xxx $xxx $pth`;;
2373 eval $file=$xxx$_exe
2377 echo $file is in $xxx.
2380 echo $file is in $xxx.
2383 echo "I don't know where '$file' is, and my life depends on it." >&4
2384 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2390 echo "Don't worry if any of the following aren't found..."
2392 for file in $trylist; do
2396 if test -f "$xxx"; then
2399 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2400 xxx=`./loc $file $file $pth`
2403 '') xxx=`./loc $file $file $pth`;;
2404 *) xxx=`./loc $xxx $xxx $pth`;;
2406 eval $file=$xxx$_exe
2410 echo $file is in $xxx.
2413 echo $file is in $xxx.
2416 echo "I don't see $file out there, $say."
2423 echo "Substituting grep for egrep."
2430 echo "Substituting cp for ln."
2439 echo "I can't find make or gmake, and my life depends on it." >&4
2440 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2448 *) # We can't have osname yet.
2449 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2450 # Assume that gmake, if found, is definitely GNU make
2451 # and prefer it over the system make.
2452 echo "Substituting gmake for make."
2460 echo "Hopefully test is built into your sh."
2463 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2464 echo "Using the test built into your sh."
2472 echo "Hopefully echo is built into your sh."
2477 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2478 $echo $n "hi there$c" >foo1
2479 echo $n "hi there$c" >foo2
2480 if cmp foo1 foo2 >/dev/null 2>&1; then
2481 echo "They are compatible. In fact, they may be identical."
2488 They are not compatible! You are probably running ksh on a non-USG system.
2489 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2490 have echo built in and we may have to run some Bourne shell scripts. That
2491 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2494 $echo $n "The star should be here-->$c"
2501 # This question was auctioned at YAPC::Europe-2007 in Vienna
2502 # I never promised you could answer it. I only auctioned the question.
2504 The following message is sponsored by
2506 Dresden.pm<--The stars should be here.
2508 Dear Perl user, system administrator or package
2509 maintainer, the Perl community sends greetings to
2510 you. Do you (emblematical) greet back [Y/n]? n
2514 : Check what type of C compiler we use
2518 cat <<'EOSC' >>trygcc
2523 int main(int argc, char *argv[]) {
2527 if $cc -o try $ccflags $ldflags try.c; then
2530 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2536 # Skip this test because it gives a false match on output like:
2537 # ./trygcc: line 23: cc: command not found
2538 # case "`$cc -v -c try.c 2>&1`" in
2539 # *gcc*) trygcc=no ;;
2541 if $test X"$trygcc" = Xyes; then
2542 if gcc -o try -c try.c; then
2544 echo "You seem to have a working gcc, though." >&4
2545 # Switching compilers may undo the work of hints files.
2546 # The most common problem is -D_REENTRANT for threads.
2547 # This heuristic catches that case, but gets false positives
2548 # if -Dusethreads was not actually specified. Better to
2549 # bail out here with a useful message than fail
2550 # mysteriously later. Should we perhaps just try to
2551 # re-invoke Configure -Dcc=gcc config_args ?
2552 if $test -f usethreads.cbu; then
2555 *** However, any setting of the C compiler flags (e.g. for thread support)
2556 *** will be lost. It may be necessary for you to restart Configure and
2557 *** add -Dcc=gcc to your Configure command line.
2560 rp="Would you like to go ahead and try gcc anyway?"
2563 rp="Would you like to use it?"
2566 if $test -f myread; then
2569 if $test -f UU/myread; then
2572 echo "Cannot find myread, sorry. Aborting." >&2
2577 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2590 cat <<'EOSC' >>checkcc
2595 int main(int argc, char *argv[]) {
2599 if $cc -o try $ccflags $ldflags try.c; then
2602 if $test X"$despair" = Xyes; then
2603 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2606 You need to find a working C compiler.
2607 Either (purchase and) install the C compiler supplied by your OS vendor,
2608 or for a free C compiler try http://gcc.gnu.org/
2609 I cannot continue any further, aborting.
2618 : determine whether symbolic links are supported
2621 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2622 echo "Symbolic links are supported." >&4
2625 echo "Symbolic links are NOT supported." >&4
2630 : determine whether symbolic links are supported
2634 echo "Checking how to test for symbolic links..." >&4
2636 if $test "X$issymlink" = X; then
2638 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2639 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2641 if test $? = 0; then
2644 echo "Your builtin 'test -h' may be broken." >&4
2647 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2650 if test -f "$p/$test"; then
2659 echo "Trying external '$test -h'." >&4
2660 issymlink="$test -h"
2661 if $test ! -h sym >/dev/null 2>&1; then
2662 echo "External '$test -h' is broken, too." >&4
2670 if $test "X$issymlink" = X; then
2671 if $test -L sym 2>/dev/null; then
2672 issymlink="$test -L"
2673 echo "The builtin '$test -L' worked." >&4
2676 if $test "X$issymlink" != X; then
2677 echo "You can test for symbolic links with '$issymlink'." >&4
2679 echo "I do not know how you can test for symbolic links." >&4
2683 *) echo "No symbolic links, so not testing for their testing..." >&4
2688 : Make symlinks util
2689 case "$mksymlinks" in
2692 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2695 *) case "$lns:$issymlink" in
2696 *"ln"*" -s:"*"test -"?)
2697 echo "Creating the symbolic links..." >&4
2698 echo "(First creating the subdirectories...)" >&4
2700 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2702 test -z "$directory" && break
2706 if test ! -d t/base; then
2707 echo "Failed to create the subdirectories. Aborting." >&4
2710 echo "(Then creating the symlinks...)" >&4
2711 awk '{print $1}' $src/MANIFEST | while true; do
2713 test -z "$filename" && break
2714 if test -f $filename; then
2715 if $issymlink $filename; then
2719 if test -f $filename; then
2720 echo "$filename already exists, not symlinking."
2722 ln -s $src/$filename $filename
2726 if test ! -f t/base/lex.t; then
2727 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2732 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2740 : Check for Cross-Compilation
2741 case "$usecrosscompile" in
2743 $echo "Cross-compiling..."
2746 *-*-gcc) # A cross-compiling gcc, probably.
2747 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2749 # leave out ld, choosing it is more complex
2751 ranlib=$targetarch-ranlib
2752 $echo 'extern int foo;' > try.c
2753 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2755 if $test $# -gt 0; then
2757 incpth="`$echo $incpth|$sed 's/^ //'`"
2758 echo "Guessing incpth '$incpth'." >&4
2760 j="`$echo $i|$sed 's,/include$,/lib,'`"
2761 if $test -d $j; then
2765 libpth="`$echo $libpth|$sed 's/^ //'`"
2766 echo "Guessing libpth '$libpth'." >&4
2771 case "$targetarch" in
2772 '') echo "Targetarch not defined." >&4; croak=y ;;
2773 *) echo "Using targetarch $targetarch." >&4 ;;
2776 '') echo "Incpth not defined." >&4; croak=y ;;
2777 *) echo "Using incpth '$incpth'." >&4 ;;
2780 '') echo "Libpth not defined." >&4; croak=y ;;
2781 *) echo "Using libpth '$libpth'." >&4 ;;
2784 '') for i in $incpth; do
2785 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2787 echo "Guessing usrinc $usrinc." >&4
2792 '') echo "Usrinc not defined." >&4; croak=y ;;
2795 *) echo "Using usrinc $usrinc." >&4 ;;
2797 case "$targethost" in
2798 '') echo "Targethost not defined." >&4; croak=y ;;
2799 *) echo "Using targethost $targethost." >&4
2804 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2807 /*) run=$src/Cross/run
2808 targetmkdir=$src/Cross/mkdir
2810 from=$src/Cross/from
2812 *) pwd=`$test -f ../Configure & cd ..; pwd`
2814 targetmkdir=$pwd/Cross/mkdir
2816 from=$pwd/Cross/from
2819 case "$targetrun" in
2820 '') targetrun=ssh ;;
2825 case "$targetfrom" in
2826 '') targetfrom=scp ;;
2830 from=$from-$targetfrom
2831 case "$targetdir" in
2833 echo "Guessing targetdir $targetdir." >&4
2836 case "$targetuser" in
2838 echo "Guessing targetuser $targetuser." >&4
2841 case "$targetfrom" in
2845 case "$targetrun" in
2857 '') cwd=$targetdir ;;
2861 if $test ! -f \$exe.xok; then
2865 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2868 *) echo "Unknown targetrun '$targetrun'" >&4
2872 case "$targetmkdir" in
2874 cat >$targetmkdir <<EOF
2876 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2878 $chmod a+rx $targetmkdir
2880 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2892 $targetmkdir \`dirname \$f\`
2893 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2896 $targetmkdir $targetdir/\`dirname \$f\`
2897 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2910 $mkdir -p $targetdir/\`dirname \$f\`
2911 $cp \$f $targetdir/\$f || exit 1
2914 $targetmkdir $targetdir/\`dirname \$f\`
2915 $cp \$f $targetdir/\$f || exit 1
2922 *) echo "Unknown targetto '$targetto'" >&4
2926 case "$targetfrom" in
2933 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2938 cp) cat >$from <<EOF
2943 cp $targetdir/\$f . || exit 1
2948 *) echo "Unknown targetfrom '$targetfrom'" >&4
2952 if $test ! -f $run; then
2953 echo "Target 'run' script '$run' not found." >&4
2957 if $test ! -f $to; then
2958 echo "Target 'to' script '$to' not found." >&4
2962 if $test ! -f $from; then
2963 echo "Target 'from' script '$from' not found." >&4
2967 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2971 Using '$run' for remote execution,
2972 and '$from' and '$to'
2973 for remote file transfer.
2979 usecrosscompile='undef'
2984 : see whether [:lower:] and [:upper:] are supported character classes
2986 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2988 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2992 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2993 # (0xd9 and 0xe2), therefore that is a nice testing point.
2994 if test "X$up" = X -o "X$low" = X; then
2995 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3001 if test "X$up" = X -o "X$low" = X; then
3002 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3008 if test "X$up" = X -o "X$low" = X; then
3009 case "`echo RS | od -x 2>/dev/null`" in
3011 echo "Hey, this might be EBCDIC." >&4
3012 if test "X$up" = X -o "X$low" = X; then
3013 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3014 rs) up='[A-IJ-RS-Z]'
3019 if test "X$up" = X -o "X$low" = X; then
3020 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3030 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3032 echo "Using $up and $low to convert case." >&4
3035 echo "I don't know how to translate letters from upper to lower case." >&4
3036 echo "Your tr is not acting any way I know of." >&4
3040 : set up the translation script tr, must be called with ./tr of course
3044 '[A-Z][a-z]') exec $tr '$up' '$low';;
3045 '[a-z][A-Z]') exec $tr '$low' '$up';;
3052 : Try to determine whether config.sh was made on this system
3053 case "$config_sh" in
3055 myuname=`$uname -a 2>/dev/null`
3056 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3057 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3058 # because the A-Z/a-z are not consecutive.
3059 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3060 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3061 newmyuname="$myuname"
3063 case "$knowitall" in
3065 if test -f ../config.sh; then
3066 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3067 eval "`grep myuname= ../config.sh`"
3069 if test "X$myuname" = "X$newmyuname"; then
3077 : Get old answers from old config file if Configure was run on the
3078 : same system, otherwise use the hints.
3081 if test -f config.sh; then
3083 rp="I see a config.sh file. Shall I use it to set the defaults?"
3086 n*|N*) echo "OK, I'll ignore it."
3087 mv config.sh config.sh.old
3088 myuname="$newmyuname"
3090 *) echo "Fetching default answers from your old config.sh file..." >&4
3098 : Older versions did not always set $sh. Catch re-use of such
3108 if test ! -f config.sh; then
3111 First time through, eh? I have some defaults handy for some systems
3112 that need some extra help getting the Configure answers right:
3115 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3117 : Half the following guesses are probably wrong... If you have better
3118 : tests or hints, please send them to perlbug@perl.org
3119 : The metaconfig authors would also appreciate a copy...
3120 $test -f /irix && osname=irix
3121 $test -f /xenix && osname=sco_xenix
3122 $test -f /dynix && osname=dynix
3123 $test -f /dnix && osname=dnix
3124 $test -f /lynx.os && osname=lynxos
3125 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3126 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3127 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3128 $test -f /bin/mips && /bin/mips && osname=mips
3129 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3130 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3131 $test -d /usr/apollo/bin && osname=apollo
3132 $test -f /etc/saf/_sactab && osname=svr4
3133 $test -d /usr/include/minix && osname=minix
3134 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3135 if $test -d /MachTen -o -d /MachTen_Folder; then
3137 if $test -x /sbin/version; then
3138 osvers=`/sbin/version | $awk '{print $2}' |
3139 $sed -e 's/[A-Za-z]$//'`
3140 elif $test -x /usr/etc/version; then
3141 osvers=`/usr/etc/version | $awk '{print $2}' |
3142 $sed -e 's/[A-Za-z]$//'`
3148 $test -f /sys/posix.dll &&
3149 $test -f /usr/bin/what &&
3150 set X `/usr/bin/what /sys/posix.dll` &&
3151 $test "$3" = UWIN &&
3155 if $test -f $uname; then
3163 umips) osname=umips ;;
3166 [23]100) osname=mips ;;
3167 next*) osname=next ;;
3169 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3170 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3173 elif $test -f /etc/kconfig; then
3175 if test "$lns" = "$ln -s"; then
3177 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3179 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3186 if test -n "$DJGPP"; then
3195 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3197 # oslevel can fail with:
3198 # oslevel: Unable to acquire lock.
3199 *not\ found) osvers="$4"."$3" ;;
3200 '<3240'|'<>3240') osvers=3.2.0 ;;
3201 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3202 '=3250'|'>3250') osvers=3.2.5 ;;
3206 bsd386) osname=bsd386
3209 cygwin*) osname=cygwin
3212 *dc.osx) osname=dcosx
3218 domainos) osname=apollo
3224 dragonfly) osname=dragonfly
3227 dynixptx*) osname=dynixptx
3228 osvers=`echo "$4"|sed 's/^v//'`
3230 freebsd) osname=freebsd
3232 genix) osname=genix ;;
3236 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3252 netbsd*) osname=netbsd
3255 news-os) osvers="$3"
3257 4*) osname=newsos4 ;;
3261 next*) osname=next ;;
3262 nonstop-ux) osname=nonstopux ;;
3263 openbsd) osname=openbsd
3269 POSIX-BC | posix-bc ) osname=posix-bc
3272 powerux | power_ux | powermax_os | powermaxos | \
3273 powerunix | power_unix) osname=powerux
3279 solaris) osname=solaris
3281 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3288 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3292 titanos) osname=titanos
3301 ultrix) osname=ultrix
3304 osf1|mls+) case "$5" in
3307 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3310 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3313 hp*) osname=hp_osf1 ;;
3314 mips) osname=mips_osf1 ;;
3317 # UnixWare 7.1.2 is known as Open UNIX 8
3318 openunix|unixware) osname=svr5
3326 $2) case "$osname" in
3330 : svr4.x or possibly later
3340 if test -f /stand/boot ; then
3341 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3342 if test -n "$INITPROG" -a -f "$INITPROG"; then
3343 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3344 if test -n "$isesix"; then
3352 *) if test -f /etc/systemid; then
3354 set `echo $3 | $sed 's/\./ /g'` $4
3355 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3357 elif $test -f $src/hints/sco_$1_$2.sh; then
3359 elif $test -f $src/hints/sco_$1.sh; then
3364 '') : Still unknown. Probably a generic Sys V.
3373 *) case "$osname" in
3374 '') : Still unknown. Probably a generic BSD.
3382 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3383 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3384 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3387 $rm -f UU/kernel.what
3388 elif test -d c:/. -o -n "$is_os2" ; then
3395 case "$targetarch" in
3398 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3403 : Now look for a hint file osname_osvers, unless one has been
3404 : specified already.
3407 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3408 : Also try without trailing minor version numbers.
3409 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3410 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3411 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3412 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3415 *) case "$osvers" in
3418 *) if $test -f $src/hints/$file.sh ; then
3420 elif $test -f $src/hints/$xfile.sh ; then
3422 elif $test -f $src/hints/$xxfile.sh ; then
3424 elif $test -f $src/hints/$xxxfile.sh ; then
3426 elif $test -f $src/hints/$xxxxfile.sh ; then
3428 elif $test -f "$src/hints/${osname}.sh" ; then
3437 if $test -f Policy.sh ; then
3440 none) dflt="Policy" ;;
3441 *) dflt="Policy $dflt" ;;
3446 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3450 if $test -f Policy.sh ; then
3453 There's also a Policy hint file available, which should make the
3454 site-specific (policy) questions easier to answer.
3461 You may give one or more space-separated answers, or "none" if appropriate.
3462 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3463 previous run of Configure, you may specify it as well as or instead of
3464 OS-specific hints. If hints are provided for your OS, you should use them:
3465 although Perl can probably be built without hints on many platforms, using
3466 hints often improve performance and may enable features that Configure can't
3467 set up on its own. If there are no hints that match your OS, specify "none";
3468 DO NOT give a wrong version or a wrong OS.
3472 rp="Which of these apply, if any?"
3475 for file in $tans; do
3476 if $test X$file = XPolicy -a -f Policy.sh; then
3478 $cat Policy.sh >> UU/config.sh
3479 elif $test -f $src/hints/$file.sh; then
3480 . $src/hints/$file.sh
3481 $cat $src/hints/$file.sh >> UU/config.sh
3482 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3485 : Give one chance to correct a possible typo.
3486 echo "$file.sh does not exist"
3488 rp="hint to use instead?"
3490 for file in $ans; do
3491 if $test -f "$src/hints/$file.sh"; then
3492 . $src/hints/$file.sh
3493 $cat $src/hints/$file.sh >> UU/config.sh
3494 elif $test X$ans = X -o X$ans = Xnone ; then
3497 echo "$file.sh does not exist -- ignored."
3504 : Remember our hint file for later.
3505 if $test -f "$src/hints/$file.sh" ; then
3515 echo "Fetching default answers from $config_sh..." >&4
3519 cp $config_sh config.sh 2>/dev/null
3529 test "$override" && . ./optdef.sh
3531 : Restore computed paths
3532 for file in $loclist $trylist; do
3533 eval $file="\$_$file"
3538 Configure uses the operating system name and version to set some defaults.
3539 The default value is probably right if the name rings a bell. Otherwise,
3540 since spelling matters for me, either accept the default or answer "none"
3547 ''|' '|none) dflt=none ;;
3548 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3551 *) dflt="$osname" ;;
3553 rp="Operating system name?"
3557 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3563 ''|' '|none) dflt=none ;;
3564 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3565 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3567 ''|' ') dflt=none ;;
3572 *) dflt="$osvers" ;;
3574 rp="Operating system version?"
3584 : who configured the system
3585 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3588 cf_by=`(logname) 2>/dev/null`
3591 cf_by=`(whoami) 2>/dev/null`
3593 "") cf_by=unknown ;;
3598 : decide how portable to be. Allow command line overrides.
3599 case "$d_portable" in
3601 *) d_portable="$define" ;;
3604 : set up shell script to do ~ expansion
3610 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3613 if $test -f /bin/csh; then
3614 /bin/csh -f -c "glob \$1"
3619 name=\`$expr x\$1 : '..\([^/]*\)'\`
3620 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3621 if $test ! -d "\$dir"; then
3623 echo "\$me: can't locate home directory for: \$name" >&2
3628 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3644 : now set up to get a file name
3648 cat <<'EOSC' >>getfile
3664 : getfile will accept an answer from the comma-separated list
3665 : enclosed in parentheses even if it does not meet other criteria.
3666 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3667 fn=`echo $fn | sed 's/(.*)//'`
3673 loc_file=`expr $fn : '.*:\(.*\)'`
3674 fn=`expr $fn : '\(.*\):.*'`
3682 */*) fullpath=true;;
3691 *e*) exp_file=true;;
3694 *p*) nopath_ok=true;;
3699 *d*) type='Directory';;
3700 *l*) type='Locate';;
3705 Locate) what='File';;
3710 case "$d_portable" in
3718 while test "$type"; do
3723 true) rp="$rp (~name ok)";;
3726 if test -f UU/getfile.ok && \
3727 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3746 value=`UU/filexp $ans`
3749 if test "$ans" != "$value"; then
3750 echo "(That expands to $value on this system.)"
3764 /*) value="$ansexp" ;;
3765 [a-zA-Z]:/*) value="$ansexp" ;;
3770 echo "I shall only accept a full path name, as in /bin/ls." >&4
3771 echo "Use a ! shell escape if you wish to check pathnames." >&4
3774 echo "Please give a full path name, starting with slash." >&4
3777 echo "Note that using ~name is ok provided it expands well." >&4
3790 for fp in $gfpth; do
3791 if test "X$fp" = X.; then
3796 if test -f "$pf"; then
3798 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3800 echo "($value is not a plain file, but that's ok.)"
3803 if test X"$type" = X; then
3810 for fp in $gfpth; do
3811 if test "X$fp" = X.; then
3816 direxp="$fp/$ansexp"
3818 if test -d "$direxp"; then
3826 if test -d "$ansexp"; then
3827 echo "(Looking for $loc_file in directory $value.)"
3828 value="$value/$loc_file"
3829 ansexp="$ansexp/$loc_file"
3831 if test -f "$ansexp"; then
3834 case "$nopath_ok" in
3835 true) case "$value" in
3837 *) echo "Assuming $value will be in people's path."
3853 if test "$fastread" = yes; then
3858 rp="$what $value doesn't exist. Use that name anyway?"
3877 test "X$gfpthkeep" != Xy && gfpth=""
3880 : determine root of directory hierarchy where package will be installed.
3883 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3886 dflt=`echo "$prefix" | sed 's/.$//'`
3894 By default, $package will be installed in $dflt/bin, manual pages
3895 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3896 installation directories. Typically this is something like /usr/local.
3897 If you wish to have binaries under /usr/bin but other parts of the
3898 installation under /usr/local, that's ok: you will be prompted
3899 separately for each of the installation directories, the prefix being
3900 only used to set the defaults.
3904 rp='Installation prefix to use?'
3912 *) oldprefix="$prefix";;
3919 : allow them to override the AFS root
3922 *) afsroot=$afsroot ;;
3928 $define|true) afs=true ;;
3929 $undef|false) afs=false ;;
3930 *) if $test -d $afsroot; then
3938 echo "AFS may be running... I'll be extra cautious then..." >&4
3940 echo "AFS does not seem to be running..." >&4
3943 : determine installation prefix for where package is to be installed.
3947 Since you are running AFS, I need to distinguish the directory in which
3948 files will reside from the directory in which they are installed (and from
3949 which they are presumably copied to the former directory by occult means).
3952 case "$installprefix" in
3953 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3954 *) dflt="$installprefix";;
3959 In some special cases, particularly when building $package for distribution,
3960 it is convenient to distinguish the directory in which files should be
3961 installed from the directory ($prefix) in which they will
3962 eventually reside. For most users, these two directories are the same.
3965 case "$installprefix" in
3967 *) dflt=$installprefix;;
3971 rp='What installation prefix should I use for installing files?'
3973 installprefix="$ans"
3974 installprefixexp="$ansexp"
3976 : Perform the prefixexp/installprefixexp correction if necessary
3977 cat <<EOS >installprefix
3980 cat <<'EOSC' >>installprefix
3981 : Change installation prefix, if necessary.
3982 if $test X"$prefix" != X"$installprefix"; then
3983 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3985 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3988 chmod +x installprefix
3989 $eunicefix installprefix
3991 : Set variables such as privlib and privlibexp from the output of ./getfile
3992 : performing the prefixexp/installprefixexp correction if necessary.
3993 cat <<EOS >setprefixvar
3996 cat <<'EOSC' >>setprefixvar
3997 eval "${prefixvar}=\"\$ans\""
3998 eval "${prefixvar}exp=\"\$ansexp\""
4001 chmod +x setprefixvar
4002 $eunicefix setprefixvar
4004 : set up the script used to warn in case of inconsistency
4013 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4015 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4016 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4021 echo "*** WHOA THERE!!! ***" >&4
4022 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4025 rp=" Keep the $hint value?"
4028 y) td=$was; tu=$was;;
4032 : function used to set '$1' to '$val'
4033 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4035 $define$undef) . ./whoa; eval "$var=\$td";;
4036 $undef$define) . ./whoa; eval "$var=\$tu";;
4037 *) eval "$var=$val";;
4040 : Check is we will use socks
4042 $define|true|[yY]*) dflt='y';;
4047 Perl can be built to use the SOCKS proxy protocol library. To do so,
4048 Configure must be run with -Dusesocks. If you use SOCKS you also need
4049 to use the PerlIO abstraction layer, this will be implicitly selected.
4051 If this doesn't make any sense to you, just accept the default '$dflt'.
4053 rp='Build Perl for SOCKS?'
4056 y|Y) val="$define" ;;
4063 $define|true|[yY]*) useperlio="$define";;
4066 : Check if we want perlio
4067 case "$useperlio" in
4068 $define|true|[yY]*|'') dflt='y';;
4073 Previous version of $package used the standard IO mechanisms as
4074 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4075 alternate IO mechanisms via the PerlIO abstraction layer, but the
4076 stdio mechanism is still available if needed. The abstraction layer
4077 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4078 Using PerlIO with sfio may cause problems with some extension modules.
4080 If this doesn't make any sense to you, just accept the default '$dflt'.
4082 rp='Use the PerlIO abstraction layer?'
4089 echo "Ok, doing things the stdio way."
4098 case "$useperlio" in
4099 $define|true|[yY]*) ;;
4102 You are using the SOCKS proxy protocol library which means that you
4103 should also use the PerlIO layer. You may be headed for trouble.
4111 : get the patchlevel
4113 echo "Getting the current patchlevel..." >&4
4114 if $test -r $rsrc/patchlevel.h;then
4115 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4116 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4117 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4118 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4119 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4120 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4121 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4130 $echo "(You do not have patchlevel.h. Eek.)"
4132 if $test -r $rsrc/.patch ; then
4133 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4134 perl_patchlevel=`cat $rsrc/.patch`
4137 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4138 version_patchlevel_string="version $patchlevel subversion $subversion"
4139 case "$perl_patchlevel" in
4141 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4144 $echo "(You have $package $version_patchlevel_string.)"
4148 : XXX Should be a Configure test for double-dots in filenames.
4149 version=`echo $revision $patchlevel $subversion | \
4150 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4151 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4152 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4155 version=`echo $revision $patchlevel $subversion | \
4156 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4157 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4158 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4161 : Special case the 5.005_xx maintenance series, which used 5.005
4162 : without any subversion label as a subdirectory in $sitelib
4163 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4164 api_versionstring='5.005'
4167 : Do we want threads support and if so, what type
4168 case "$usethreads" in
4169 $define|true|[yY]*) dflt='y';;
4170 *) # Catch case where user specified ithreads or 5005threads but
4171 # forgot -Dusethreads (A.D. 4/2002)
4172 case "$useithreads$use5005threads" in
4174 case "$useperlio" in
4175 "$define") dflt='y' ;;
4185 Perl can be built to take advantage of threads on some systems.
4186 To do so, Configure can be run with -Dusethreads.
4188 Note that Perl built with threading support runs slightly slower
4189 and uses more memory than plain Perl. The current implementation
4190 is believed to be stable, but it is fairly new, and so should be
4191 treated with caution.
4193 If this doesn't make any sense to you, just accept the default '$dflt'.
4195 rp='Build a threading Perl?'
4198 y|Y) val="$define" ;;
4204 if $test $patchlevel -lt 9; then
4205 case "$usethreads" in
4209 Since release 5.6, Perl has had two different threading implementations,
4210 the newer interpreter-based version (ithreads) with one interpreter per
4211 thread, and the older 5.005 version (5005threads).
4212 The 5005threads version is effectively unmaintained and will probably be
4213 removed in Perl 5.10, so there should be no need to build a Perl using it
4214 unless needed for backwards compatibility with some existing 5.005threads
4218 : Default to ithreads unless overridden on command line or with
4221 case "$use5005threads" in
4222 $define|true|[yY]*) dflt='n';;
4224 case "$useithreads" in
4225 $undef|false|[nN]*) dflt='n';;
4227 rp='Use the newer interpreter-based ithreads?'
4230 y|Y) val="$define" ;;
4235 : Now set use5005threads to the opposite value.
4236 case "$useithreads" in
4237 $define) val="$undef" ;;
4244 useithreads="$undef"
4245 use5005threads="$undef"
4249 case "$useithreads$use5005threads" in
4253 You cannot have both the ithreads and the 5.005 threads enabled
4254 at the same time. Disabling the 5.005 threads since they are
4255 much less stable than the ithreads.
4258 use5005threads="$undef"
4263 : perl-5.9.x and later
4265 if test X"$usethreads" = "X$define"; then
4266 case "$use5005threads" in
4270 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4277 use5005threads="$undef"
4278 useithreads="$usethreads"
4281 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4284 *** To build with ithreads you must also use the PerlIO layer.
4285 *** Cannot continue, aborting.
4291 case "$d_oldpthreads" in
4292 '') : Configure tests would be welcome here. For now, assume undef.
4294 *) val="$d_oldpthreads" ;;
4300 : Look for a hint-file generated 'call-back-unit'. If the
4301 : user has specified that a threading perl is to be built,
4302 : we may need to set or change some other defaults.
4303 if $test -f usethreads.cbu; then
4304 echo "Your platform has some specific hints regarding threaded builds, using them..."
4307 case "$usethreads" in
4308 "$define"|true|[yY]*)
4310 (Your platform does not have any specific hints for threaded builds.
4311 Assuming POSIX threads, then.)
4317 : Check if multiplicity is required
4320 Perl can be built so that multiple Perl interpreters can coexist
4321 within the same Perl executable.
4324 case "$useithreads" in
4327 This multiple interpreter support is required for interpreter-based threads.
4331 *) case "$usemultiplicity" in
4332 $define|true|[yY]*) dflt='y';;
4336 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4337 rp='Build Perl for multiplicity?'
4340 y|Y) val="$define" ;;
4348 : Check if morebits is requested
4349 case "$usemorebits" in
4350 "$define"|true|[yY]*)
4351 use64bitint="$define"
4352 uselongdouble="$define"
4353 usemorebits="$define"
4355 *) usemorebits="$undef"
4359 : Determine the C compiler to be used
4365 rp="Use which C compiler?"
4369 : See whether they have no cc but they do have gcc
4371 if $test -f cc.cbu; then
4376 : make some quick guesses about what we are up against
4378 $echo $n "Hmm... $c"
4388 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4389 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4391 echo "Looks kind of like an OSF/1 system, but we'll see..."
4393 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4394 xxx=`./loc addbib blurfl $pth`
4395 if $test -f $xxx; then
4396 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4400 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4401 echo "Looks kind of like an extended USG system, but we'll see..."
4403 echo "Looks kind of like a USG system, but we'll see..."
4407 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4408 echo "Looks kind of like a BSD system, but we'll see..."
4412 echo "Looks kind of like a Version 7 system, but we'll see..."
4415 case "$eunicefix" in
4418 There is, however, a strange, musty smell in the air that reminds me of
4419 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4423 : it so happens the Eunice I know will not run shell scripts in Unix format
4427 echo "Congratulations. You aren't running Eunice."
4431 : Detect OS2. The p_ variable is set above in the Head.U unit.
4432 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4433 : semicolon as a patch separator
4438 I have the feeling something is not exactly right, however...don't tell me...
4439 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4440 (Or you may be running DOS with DJGPP.)
4445 if test -f /xenix; then
4446 echo "Actually, this looks more like a XENIX system..."
4451 echo "It's not Xenix..."
4456 if test -f /venix; then
4457 echo "Actually, this looks more like a VENIX system..."
4464 echo "Nor is it Venix..."
4467 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4468 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4471 : Check if we are using GNU gcc and what its version is
4473 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4477 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4479 printf("%s\n", __VERSION__);
4481 printf("%s\n", "1");
4487 if $cc -o try $ccflags $ldflags try.c; then
4488 gccversion=`$run ./try`
4489 case "$gccversion" in
4490 '') echo "You are not using GNU cc." ;;
4491 *) echo "You are using GNU cc $gccversion."
4497 echo "*** WHOA THERE!!! ***" >&4
4498 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4499 case "$knowitall" in
4501 echo " You'd better start hunting for one and let me know about it." >&4
4507 case "$gccversion" in
4508 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4510 case "$gccversion" in
4511 '') gccosandvers='' ;;
4512 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4513 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4515 case "$gccosandvers" in
4516 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4517 $osname$osvers) ;; # looking good
4518 $osname*) cat <<EOM >&4
4520 *** WHOA THERE!!! ***
4522 Your gcc has not been compiled for the exact release of
4523 your operating system ($gccosandvers versus $osname$osvers).
4525 In general it is a good idea to keep gcc synchronized with
4526 the operating system because otherwise serious problems
4527 may ensue when trying to compile software, like Perl.
4529 I'm trying to be optimistic here, though, and will continue.
4530 If later during the configuration and build icky compilation
4531 problems appear (headerfile conflicts being the most common
4532 manifestation), I suggest reinstalling the gcc to match
4533 your operating system release.
4537 *) gccosandvers='' ;; # failed to parse, better be silent
4545 # gcc 3.* complain about adding -Idirectories that they already know about,
4546 # so we will take those off from locincpth.
4547 case "$gccversion" in
4549 echo "main(){}">try.c
4550 for incdir in $locincpth; do
4551 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4552 grep '^c[cp]p*[01]: warning: changing search order '`
4553 if test "X$warn" != X; then
4554 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4560 : What should the include directory be ?
4562 $echo $n "Hmm... $c"
4566 if $test -f /bin/mips && /bin/mips; then
4567 echo "Looks like a MIPS system..."
4568 $cat >usr.c <<'EOCP'
4569 #ifdef SYSTYPE_BSD43
4573 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4574 dflt='/bsd43/usr/include'
4578 mips_type='System V'
4580 $rm -f usr.c usr.out
4581 echo "and you're compiling with the $mips_type compiler and libraries."
4585 echo "Doesn't look like a MIPS system."
4595 case "$xxx_prompt" in
4598 rp='Where are the include files you want to use?'
4606 : see how we invoke the C preprocessor
4608 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4609 cat <<'EOT' >testcpp.c
4615 if test ! -f cppstdin; then
4616 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4617 # AIX cc -E doesn't show the absolute headerfile
4618 # locations but we'll cheat by using the -M flag.
4619 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
4621 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4624 echo "Keeping your $hint cppstdin wrapper."
4627 wrapper=`pwd`/cppstdin
4631 if $test "X$cppstdin" != "X" && \
4632 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4633 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4635 echo "You used to use $cppstdin $cppminus so we'll use that again."
4637 '') echo "But let's see if we can live without a wrapper..." ;;
4639 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4640 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4642 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4645 echo "(However, $cpprun $cpplast does not work, let's see...)"
4653 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4660 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4661 $cc -E <testcpp.c >testcpp.out 2>&1; \
4662 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4663 echo "Yup, it does."
4666 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4667 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4668 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4669 echo "Yup, it does."
4672 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4673 $cc -P <testcpp.c >testcpp.out 2>&1; \
4674 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4675 echo "Yipee, that works!"
4678 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4679 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4680 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4681 echo "At long last!"
4684 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4685 $cpp <testcpp.c >testcpp.out 2>&1; \
4686 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4690 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4691 $cpp - <testcpp.c >testcpp.out 2>&1; \
4692 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4693 echo "Hooray, it works! I was beginning to wonder."
4696 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4697 $wrapper <testcpp.c >testcpp.out 2>&1; \
4698 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4704 rp="No dice. I can't find a C preprocessor. Name one:"
4708 $x_cpp <testcpp.c >testcpp.out 2>&1
4709 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4710 echo "OK, that will do." >&4
4712 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4727 echo "Perhaps can we force $cc -E using a wrapper..."
4728 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4729 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4735 echo "Nope, we'll have to live without it..."
4749 "$wrapper"|'cppstdin') ;;
4750 *) $rm -f $wrapper;;
4752 $rm -f testcpp.c testcpp.out
4754 : Set private lib path
4757 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4762 '') dlist="$loclibpth $plibpth $glibpth";;
4763 *) dlist="$libpth";;
4766 : Now check and see which directories actually exist, avoiding duplicates
4770 if $test -d $xxx; then
4773 *) libpth="$libpth $xxx";;
4779 Some systems have incompatible or broken versions of libraries. Among
4780 the directories listed in the question below, please remove any you
4781 know not to be holding relevant libraries, and add any that are needed.
4782 Say "none" for none.
4793 rp="Directories to use for library searches?"
4800 : compute shared library extension
4803 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4813 On some systems, shared libraries may be available. Answer 'none' if
4814 you want to suppress searching of shared libraries for the remainder
4815 of this configuration.
4818 rp='What is the file extension used for shared libraries?'
4822 : Define several unixisms.
4823 : Hints files or command line option can be used to override them.
4824 : The convoluted testing is in case hints files set either the old
4827 '') case "$exe_ext" in
4829 *) _exe="$exe_ext" ;;
4834 '') case "$lib_ext" in
4841 '') case "$obj_ext" in
4848 '') case "$path_sep" in
4859 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4861 : Which makefile gets called first. This is used by make depend.
4862 case "$firstmakefile" in
4863 '') firstmakefile='makefile';;
4866 : Check for uselongdouble support
4868 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4871 case "$uselongdouble" in
4872 $define|true|[yY]*) dflt='y';;
4877 Perl can be built to take advantage of long doubles which
4878 (if available) may give more accuracy and range for floating point numbers.
4880 If this doesn't make any sense to you, just accept the default '$dflt'.
4882 rp='Try to use long doubles if available?'
4885 y|Y) val="$define" ;;
4891 case "$uselongdouble" in
4892 true|[yY]*) uselongdouble="$define" ;;
4895 : Look for a hint-file generated 'call-back-unit'. If the
4896 : user has specified that long doubles should be used,
4897 : we may need to set or change some other defaults.
4898 if $test -f uselongdouble.cbu; then
4899 echo "Your platform has some specific hints regarding long doubles, using them..."
4900 . ./uselongdouble.cbu
4902 case "$uselongdouble" in
4905 (Your platform does not have any specific hints for long doubles.)
4911 : Looking for optional libraries
4913 echo "Checking for optional libraries..." >&4
4918 case "$libswanted" in
4919 '') libswanted='c_s';;
4922 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4928 for thisdir in $libpth $xlibpth; do
4929 test -d $thisdir && libspath="$libspath $thisdir"
4931 for thislib in $libswanted; do
4932 for thisdir in $libspath; do
4934 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4935 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4936 $test -f "$xxx" && eval $libscheck
4937 $test -f "$xxx" && libstyle=shared
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/lib$thislib.$so
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=shared
4944 if test ! -f "$xxx"; then
4945 xxx=$thisdir/lib$thislib$_a
4946 $test -f "$xxx" && eval $libscheck
4947 $test -f "$xxx" && libstyle=static
4949 if test ! -f "$xxx"; then
4950 xxx=$thisdir/$thislib$_a
4951 $test -f "$xxx" && eval $libscheck
4952 $test -f "$xxx" && libstyle=static
4954 if test ! -f "$xxx"; then
4955 xxx=$thisdir/lib${thislib}_s$_a
4956 $test -f "$xxx" && eval $libscheck
4957 $test -f "$xxx" && libstyle=static
4958 $test -f "$xxx" && thislib=${thislib}_s
4960 if test ! -f "$xxx"; then
4961 xxx=$thisdir/Slib$thislib$_a
4962 $test -f "$xxx" && eval $libscheck
4963 $test -f "$xxx" && libstyle=static
4965 if $test -f "$xxx"; then
4967 shared) echo "Found -l$thislib (shared)." ;;
4968 static) echo "Found -l$thislib." ;;
4969 *) echo "Found -l$thislib ($libstyle)." ;;
4973 *) dflt="$dflt -l$thislib"
4974 libsfound="$libsfound $xxx"
4976 libsfiles="$libsfiles $yyy"
4977 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4978 case " $libsdirs " in
4980 *) libsdirs="$libsdirs $yyy" ;;
4987 if $test ! -f "$xxx"; then
4988 echo "No -l$thislib."
4999 ' '|'') dflt='none';;
5004 In order to compile $package on your machine, a number of libraries
5005 are usually needed. Include any other special libraries here as well.
5006 Say "none" for none. The default list is almost always right.
5010 rp="What libraries to use?"
5017 : determine optimization, if desired, or use for debug flag also
5019 ' '|$undef) dflt='none';;
5021 *) dflt="$optimize";;
5025 By default, $package compiles with the -O flag to use the optimizer.
5026 Alternately, you might want to use the symbolic debugger, which uses
5027 the -g flag (on traditional Unix systems). Either flag can be
5028 specified here. To use neither flag, specify the word "none".
5031 rp="What optimizer/debugger flag should be used?"
5035 'none') optimize=" ";;
5038 : Check what DEBUGGING is required from the command line
5039 : -DEBUGGING or -DDEBUGGING or
5040 : -DEBUGGING=both = -g + -DDEBUGGING
5041 : -DEBUGGING=-g or -Doptimize=-g = -g
5042 : -DEBUGGING=none or -UDEBUGGING =
5043 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5046 *) DEBUGGING=$EBUGGING ;;
5049 case "$DEBUGGING" in
5053 *) optimize="$optimize -g" ;;
5057 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5065 case "$DEBUGGING" in
5066 both|$define) dflt='-DDEBUGGING'
5069 : argument order is deliberate, as the flag will start with - which set could
5070 : think is an option
5071 checkccflag='check=$1; flag=$2; callback=$3;
5073 echo "Checking if your compiler accepts $flag" 2>&1;
5074 echo "int main(void) { return 0; }" > gcctest.c;
5075 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5076 echo "Yes, it does." 2>&1;
5077 if $test -s gcctest.out ; then
5078 echo "But your platform does not like it:";
5083 echo "Leaving current flags $ccflags alone." 2>&1
5085 *) dflt="$dflt $flag";
5091 echo "Nope, it does not, but that is ok." 2>&1;
5095 : We will not override a previous value, but we might want to
5096 : augment a hint file
5098 default|recommended)
5099 case "$gccversion" in
5100 1*) dflt="$dflt -fpcc-struct-return" ;;
5102 case "$optimize:$DEBUGGING" in
5103 *-g*:old) dflt="$dflt -DDEBUGGING";;
5105 case "$gccversion" in
5106 2*) if $test -d /etc/conf/kconfig.d &&
5107 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5109 # Interactive Systems (ISC) POSIX mode.
5114 case "$gccversion" in
5117 ?*) set strict-aliasing -fno-strict-aliasing
5121 # For gcc, adding -pipe speeds up compilations for some, but apparently
5122 # some assemblers can't read from stdin. (It also slows down compilations
5123 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5124 case "$gccversion" in
5130 # on x86_64 (at least) we require an extra library (libssp) in the
5131 # link command line. This library is not named, so I infer that it is
5132 # an implementation detail that may change. Hence the safest approach
5133 # is to add the flag to the flags passed to the compiler at link time,
5134 # as that way the compiler can do the right implementation dependant
5136 case "$gccversion" in
5137 ?*) set stack-protector -fstack-protector
5144 case "$mips_type" in
5145 *BSD*|'') inclwanted="$locincpth $usrinc";;
5146 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5148 for thisincl in $inclwanted; do
5149 if $test -d $thisincl; then
5150 if $test x$thisincl != x$usrinc; then
5152 *" -I$thisincl "*);;
5153 *) dflt="$dflt -I$thisincl ";;
5159 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5161 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5169 *) dflt="$dflt -D$2";;
5173 set signal.h LANGUAGE_C; eval $inctest
5177 ccflags="$ccflags -DSOCKS"
5182 default|recommended) dflt="$ccflags $dflt" ;;
5183 *) dflt="$ccflags";;
5192 Your C compiler may want other flags. For this question you should include
5193 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5194 but you should NOT include libraries or ld flags like -lwhatever. If you
5195 want $package to honor its debug switch, you should include -DDEBUGGING here.
5196 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5198 To use no flags, specify the word "none".
5204 rp="Any additional cc flags?"
5211 : the following weeds options from ccflags that are of no interest to cpp
5213 '') cppflags="$ccflags" ;;
5214 *) cppflags="$cppflags $ccflags" ;;
5216 case "$gccversion" in
5217 1*) cppflags="$cppflags -D__GNUC__"
5219 case "$mips_type" in
5221 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5227 echo "Let me guess what the preprocessor flags are..." >&4
5241 *) ftry="$previous $flag";;
5243 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5244 >cpp1.out 2>/dev/null && \
5245 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5246 >cpp2.out 2>/dev/null && \
5247 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5248 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5250 cppflags="$cppflags $ftry"
5260 *-*) echo "They appear to be: $cppflags";;
5262 $rm -f cpp.c cpp?.out
5266 : flags used in final linking phase
5268 '') if ./venix; then
5274 *-posix*) dflt="$dflt -posix" ;;
5277 *) dflt="$ldflags";;
5279 # See note above about -fstack-protector
5281 *-fstack-protector*)
5283 *-fstack-protector*) ;; # Don't add it again
5284 *) dflt="$dflt -fstack-protector" ;;
5289 : Try to guess additional flags to pick up local libraries.
5290 for thislibdir in $libpth; do
5291 case " $loclibpth " in
5294 *"-L$thislibdir "*) ;;
5295 *) dflt="$dflt -L$thislibdir" ;;
5307 Your C linker may need flags. For this question you should
5308 include -L/whatever and any other flags used by the C linker, but you
5309 should NOT include libraries like -lwhatever.
5311 Make sure you include the appropriate -L/path flags if your C linker
5312 does not normally search all of the directories you specified above,
5315 To use no flags, specify the word "none".
5319 rp="Any additional ld flags (NOT including libraries)?"
5325 rmlist="$rmlist pdp11"
5329 echo "Checking your choice of C compiler and flags for coherency..." >&4
5330 $cat > try.c <<'EOF'
5332 int main() { printf("Ok\n"); return(0); }
5334 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5336 $cat >try.msg <<'EOM'
5337 I've tried to compile and run the following simple program:
5340 $cat try.c >> try.msg
5342 $cat >> try.msg <<EOM
5349 and I got the following output:
5353 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5354 if $sh -c "$run ./try " >>try.msg 2>&1; then
5358 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5361 cat >> try.msg <<'EOQS'
5362 If $libs contains -lsfio, and sfio is mis-configured, then it
5363 sometimes (apparently) runs and exits with a 0 status, but with no
5364 output! It may have to do with sfio's use of _exit vs. exit.
5367 rp="You have a big problem. Shall I abort Configure"
5374 echo "The program compiled OK, but exited with status $?." >>try.msg
5375 rp="You have a problem. Shall I abort Configure"
5379 echo "I can't compile the test program." >>try.msg
5380 rp="You have a BIG problem. Shall I abort Configure"
5386 case "$knowitall" in
5388 echo "(The supplied flags or libraries might be incorrect.)"
5396 *) echo "Ok. Stopping Configure." >&4
5401 n) echo "OK, that should do.";;
5403 $rm_try gcctest gcctest.out
5405 : define a shorthand compile call
5409 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5410 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5414 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5415 : define a shorthand compile call for compilations that should be ok.
5419 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5421 : determine filename position in cpp output
5423 echo "Computing filename position in cpp output for #include directives..." >&4
5425 vos) testaccess=-e ;;
5428 echo '#include <stdio.h>' > foo.c
5431 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5432 $grep '^[ ]*#.*stdio\.h' | \
5433 while read cline; do
5436 while $test \$# -gt 0; do
5437 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5442 pos=\`expr \$pos + 1\`
5454 *) pos="${fieldn}th";;
5456 echo "Your cpp writes the filename in the $pos field of the line."
5459 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5460 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5463 : locate header file
5468 for usrincdir in $usrinc
5470 if test -f \$usrincdir/\$wanted; then
5471 echo "\$usrincdir/\$wanted"
5475 awkprg='{ print \$$fieldn }'
5476 echo "#include <\$wanted>" > foo\$\$.c
5477 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5478 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5479 while read cline; do
5480 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5482 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5483 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5488 # status = 0: grep returned 0 lines, case statement not executed
5489 # status = 1: headerfile found
5490 # status = 2: while loop executed, no headerfile found
5494 if test \$status -eq 1; then
5501 : define an alternate in-header-list? function
5502 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5503 cont=true; xxf="echo \"<\$1> found.\" >&4";
5504 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5505 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5507 case $# in 4) instead=instead;; *) instead="at last";; esac;
5508 while $test "$cont"; do
5510 var=$2; eval "was=\$$2";
5511 if $test "$xxx" && $test -r "$xxx";
5513 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5516 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5517 set $yyy; shift; shift; yyy=$@;
5518 case $# in 0) cont="";;
5519 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5520 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5521 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5522 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5526 do set $yyy; var=$2; eval "was=\$$2";
5527 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5528 set $yyy; shift; shift; yyy=$@;
5531 : see if stdlib is available
5532 set stdlib.h i_stdlib
5535 : check for lengths of integral types
5539 echo "Checking to see how big your integers are..." >&4
5548 printf("intsize=%d;\n", (int)sizeof(int));
5549 printf("longsize=%d;\n", (int)sizeof(long));
5550 printf("shortsize=%d;\n", (int)sizeof(short));
5555 if eval $compile_ok && $run ./try > /dev/null; then
5557 echo "Your integers are $intsize bytes long."
5558 echo "Your long integers are $longsize bytes long."
5559 echo "Your short integers are $shortsize bytes long."
5563 Help! I can't compile and run the intsize test program: please enlighten me!
5564 (This is probably a misconfiguration in your system or libraries, and
5565 you really ought to fix it. Still, I'll try anyway.)
5569 rp="What is the size of an integer (in bytes)?"
5573 rp="What is the size of a long integer (in bytes)?"
5577 rp="What is the size of a short integer (in bytes)?"
5585 : check for long long
5587 echo "Checking to see if you have long long..." >&4
5588 echo 'int main() { long long x = 7; return 0; }' > try.c
5590 if eval $compile; then
5592 echo "You have long long."
5595 echo "You do not have long long."
5601 : check for length of long long
5602 case "${d_longlong}${longlongsize}" in
5605 echo "Checking to see how big your long longs are..." >&4
5606 $cat >try.c <<'EOCP'
5610 printf("%d\n", (int)sizeof(long long));
5615 if eval $compile_ok; then
5616 longlongsize=`$run ./try`
5617 echo "Your long longs are $longlongsize bytes long."
5621 echo "(I can't seem to compile the test program. Guessing...)"
5622 rp="What is the size of a long long (in bytes)?"
5626 if $test "X$longsize" = "X$longlongsize"; then
5627 echo "(That isn't any different from an ordinary long.)"
5633 : see if inttypes.h is available
5634 : we want a real compile instead of Inhdr because some systems
5635 : have an inttypes.h which includes non-existent headers
5638 #include <inttypes.h>
5640 static int32_t foo32 = 0x12345678;
5644 if eval $compile; then
5645 echo "<inttypes.h> found." >&4
5648 echo "<inttypes.h> NOT found." >&4
5657 echo "Checking to see if you have int64_t..." >&4
5659 #include <sys/types.h>
5660 #$i_inttypes I_INTTYPES
5662 #include <inttypes.h>
5664 int main() { int64_t x = 7; }
5667 if eval $compile; then
5669 echo "You have int64_t."
5672 echo "You do not have int64_t."
5678 : Check if 64bit ints have a quad type
5680 echo "Checking which 64-bit integer type we could use..." >&4
5686 val='"unsigned int"'
5691 *) case "$longsize" in
5695 val='"unsigned long"'
5700 *) case "$d_longlong:$longlongsize" in
5705 val='"unsigned long long"'
5710 *) case "$d_int64_t" in
5729 '') echo "Alas, no 64-bit integer types in sight." >&4
5732 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5737 : Do we want 64bit support
5738 case "$uselonglong" in
5739 "$define"|true|[yY]*)
5742 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5744 use64bitint="$define"
5747 case "$use64bits" in
5748 "$define"|true|[yY]*)
5751 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5753 use64bitint="$define"
5756 case "$use64bitints" in
5757 "$define"|true|[yY]*)
5760 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5762 use64bitint="$define"
5765 case "$use64bitsint" in
5766 "$define"|true|[yY]*)
5769 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5771 use64bitint="$define"
5774 case "$uselonglongs" in
5775 "$define"|true|[yY]*)
5778 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5780 use64bitint="$define"
5783 case "$use64bitsall" in
5784 "$define"|true|[yY]*)
5787 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5789 use64bitall="$define"
5794 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5796 case "$use64bitall" in
5797 "$define"|true|[yY]*) use64bitint="$define" ;;
5803 You have natively 64-bit long integers.
5807 *) case "$use64bitint" in
5808 "$define"|true|[yY]*) dflt='y';;
5817 Perl can be built to take advantage of 64-bit integer types
5818 on some systems. To do so, Configure can be run with -Duse64bitint.
5819 Choosing this option will most probably introduce binary incompatibilities.
5821 If this doesn't make any sense to you, just accept the default '$dflt'.
5822 (The default has been chosen based on your configuration.)
5824 rp='Try to use 64-bit integers, if available?'
5827 [yY]*) val="$define" ;;
5835 case "$use64bitall" in
5836 "$define"|true|[yY]*) dflt='y' ;;
5837 *) case "$longsize" in
5845 You may also choose to try maximal 64-bitness. It means using as much
5846 64-bitness as possible on the platform. This in turn means even more
5847 binary incompatibilities. On the other hand, your platform may not
5848 have any more 64-bitness available than what you already have chosen.
5850 If this doesn't make any sense to you, just accept the default '$dflt'.
5851 (The default has been chosen based on your configuration.)
5853 rp='Try to use maximal 64-bit support, if available?'
5856 [yY]*) val="$define" ;;
5861 case "$use64bitall" in
5863 case "$use64bitint" in
5867 Since you have chosen a maximally 64-bit build, I'm also turning on
5868 the use of 64-bit integers.
5870 use64bitint="$define" ;;
5875 : Look for a hint-file generated 'call-back-unit'. If the
5876 : user has specified that a 64-bit perl is to be built,
5877 : we may need to set or change some other defaults.
5878 if $test -f use64bitint.cbu; then
5879 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5882 case "$use64bitint" in
5883 "$define"|true|[yY]*)
5885 4) case "$archname64" in
5886 '') archname64=64int ;;
5893 : Look for a hint-file generated 'call-back-unit'. If the
5894 : user has specified that a maximally 64-bit perl is to be built,
5895 : we may need to set or change some other defaults.
5896 if $test -f use64bitall.cbu; then
5897 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5900 case "$use64bitall" in
5901 "$define"|true|[yY]*)
5903 4) case "$archname64" in
5904 ''|64int) archname64=64all ;;
5911 case "$d_quad:$use64bitint" in
5915 *** You have chosen to use 64-bit integers,
5916 *** but none can be found.
5917 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5918 *** Cannot continue, aborting.
5925 : check for length of double
5927 case "$doublesize" in
5929 echo "Checking to see how big your double precision numbers are..." >&4
5938 printf("%d\n", (int)sizeof(double));
5943 if eval $compile_ok; then
5944 doublesize=`$run ./try`
5945 echo "Your double is $doublesize bytes long."
5948 echo "(I can't seem to compile the test program. Guessing...)"
5949 rp="What is the size of a double precision number (in bytes)?"
5957 : check for long doubles
5959 echo "Checking to see if you have long double..." >&4
5960 echo 'int main() { long double x = 7.0; }' > try.c
5962 if eval $compile; then
5964 echo "You have long double."
5967 echo "You do not have long double."
5973 : check for length of long double
5974 case "${d_longdbl}${longdblsize}" in
5977 echo "Checking to see how big your long doubles are..." >&4
5978 $cat >try.c <<'EOCP'
5982 printf("%d\n", sizeof(long double));
5987 if eval $compile; then
5988 longdblsize=`$run ./try`
5989 echo "Your long doubles are $longdblsize bytes long."
5993 echo "(I can't seem to compile the test program. Guessing...)" >&4
5994 rp="What is the size of a long double (in bytes)?"
5998 if $test "X$doublesize" = "X$longdblsize"; then
5999 echo "That isn't any different from an ordinary double."
6000 echo "I'll keep your setting anyway, but you may see some"
6001 echo "harmless compilation warnings."
6007 : determine the architecture name
6009 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6010 tarch=`arch`"-$osname"
6011 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6012 if uname -m > tmparch 2>&1 ; then
6013 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6014 -e 's/$/'"-$osname/" tmparch`
6022 case "$myarchname" in
6025 echo "(Your architecture name used to be $myarchname.)"
6029 case "$targetarch" in
6031 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6036 *) dflt="$archname";;
6038 rp='What is your architecture name'
6041 case "$usethreads" in
6043 echo "Threads selected." >&4
6045 *-thread*) echo "...and architecture name already has -thread." >&4
6047 *) archname="$archname-thread"
6048 echo "...setting architecture name to $archname." >&4
6053 case "$usemultiplicity" in
6055 echo "Multiplicity selected." >&4
6057 *-multi*) echo "...and architecture name already has -multi." >&4
6059 *) archname="$archname-multi"
6060 echo "...setting architecture name to $archname." >&4
6065 case "$use64bitint$use64bitall" in
6067 case "$archname64" in
6069 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6072 case "$use64bitint" in
6073 "$define") echo "64 bit integers selected." >&4 ;;
6075 case "$use64bitall" in
6076 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6079 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6081 *) archname="$archname-$archname64"
6082 echo "...setting architecture name to $archname." >&4
6088 case "$uselongdouble" in
6090 echo "Long doubles selected." >&4
6091 case "$longdblsize" in
6093 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6097 *-ld*) echo "...and architecture name already has -ld." >&4
6099 *) archname="$archname-ld"
6100 echo "...setting architecture name to $archname." >&4
6107 case "$useperlio" in
6109 echo "Perlio selected." >&4
6112 echo "Perlio not selected, using stdio." >&4
6114 *-stdio*) echo "...and architecture name already has -stdio." >&4
6116 *) archname="$archname-stdio"
6117 echo "...setting architecture name to $archname." >&4
6122 if $test -f archname.cbu; then
6123 echo "Your platform has some specific hints for architecture name, using them..."
6127 : set the prefixit variable, to compute a suitable default value
6128 prefixit='case "$3" in
6130 case "$oldprefix" in
6131 "") eval "$1=\"\$$2\"";;
6138 ""|" ") eval "$1=\"\$$2\"";;
6144 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6146 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6147 /*-$oldprefix/*|\~*-$oldprefix/*)
6148 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6149 *) eval "$1=\"\$$2\"";;
6153 : determine installation style
6154 : For now, try to deduce it from prefix unless it is already set.
6155 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6156 case "$installstyle" in
6157 '') case "$prefix" in
6158 *perl*) dflt='lib';;
6159 *) dflt='lib/perl5' ;;
6162 *) dflt="$installstyle" ;;
6164 : Probably not worth prompting for this since we prompt for all
6165 : the directories individually, and the prompt would be too long and
6169 : determine where public executables go
6174 rp='Pathname where the public executables will reside?'
6176 if $test "X$ansexp" != "X$binexp"; then
6180 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6181 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6182 : this via initialinstalllocation
6185 case "$userelocatableinc" in
6186 $define|true|[yY]*) dflt='y' ;;
6191 Would you like to build Perl so that the installation is relocatable, so that
6192 library paths in @INC are determined relative to the path of the perl binary?
6193 This is not advised for system Perl installs, or if you need to run setid
6194 scripts or scripts under taint mode.
6196 If this doesn't make any sense to you, just accept the default '$dflt'.
6198 rp='Use relocatable @INC?'
6201 y|Y) val="$define" ;;
6204 set userelocatableinc
6207 initialinstalllocation="$binexp"
6208 : Default prefix is now "up one level from where the binaries are"
6209 case "$userelocatableinc" in
6215 installprefixexp=".../.."
6219 : determine where private library files go
6220 : Usual default is /usr/local/lib/perl5/$version.
6221 : Also allow things like /opt/perl/lib/$version, since
6222 : /opt/perl/lib/perl5... would be redundant.
6223 : The default "style" setting is made in installstyle.U
6224 case "$installstyle" in
6225 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6226 *) set dflt privlib lib/$version ;;
6231 There are some auxiliary files for $package that need to be put into a
6232 private library directory that is accessible by everyone.
6237 rp='Pathname where the private library files will reside?'
6242 : set the prefixup variable, to restore leading tilda escape
6243 prefixup='case "$prefixexp" in
6245 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6248 : determine where public architecture dependent libraries go
6251 : privlib default is /usr/local/lib/$package/$version
6252 : archlib default is /usr/local/lib/$package/$version/$archname
6253 : privlib may have an optional trailing /share.
6254 tdflt=`echo $privlib | $sed 's,/share$,,'`
6255 tdflt=$tdflt/$archname
6264 $spackage contains architecture-dependent library files. If you are
6265 sharing libraries in a heterogeneous environment, you might store
6266 these files in a separate location. Otherwise, you can just include
6267 them with the rest of the public library files.
6272 rp='Where do you want to put the public architecture-dependent libraries?'
6276 if $test X"$archlib" = X"$privlib"; then
6282 : see if setuid scripts can be secure
6285 Some kernels have a bug that prevents setuid #! scripts from being
6286 secure. Some sites have disabled setuid #! scripts because of this.
6288 First let's decide if your kernel supports secure setuid #! scripts.
6289 (If setuid #! scripts would be secure but have been disabled anyway,
6290 don't say that they are secure if asked.)
6295 if $test -d /dev/fd; then
6296 echo "#!$ls" >reflect
6297 chmod +x,u+s reflect
6298 ./reflect >flect 2>&1
6299 if $contains "/dev/fd" flect >/dev/null; then
6300 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6304 If you are not sure if they are secure, I can check but I'll need a
6305 username and password different from the one you are using right now.
6306 If you don't have such a username or don't want me to test, simply
6310 rp='Other username to test security of setuid scripts with?'
6315 case "$d_suidsafe" in
6316 '') echo "I'll assume setuid scripts are *not* secure." >&4
6319 echo "Well, the $hint value is *not* secure." >&4
6321 *) echo "Well, the $hint value *is* secure." >&4
6326 $rm -f reflect flect
6327 echo "#!$ls" >reflect
6328 chmod +x,u+s reflect
6331 echo '"su" will (probably) prompt you for '"$ans's password."
6332 su $ans -c './reflect >flect'
6333 if $contains "/dev/fd" flect >/dev/null; then
6334 echo "Okay, it looks like setuid scripts are secure." >&4
6337 echo "I don't think setuid scripts are secure." >&4
6342 rp='Does your kernel have *secure* setuid scripts?'
6345 [yY]*) val="$define";;
6350 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6351 echo "(That's for file descriptors, not floppy disks.)"
6357 $rm -f reflect flect
6359 : now see if they want to do setuid emulation
6362 case "$d_suidsafe" in
6365 echo "No need to emulate SUID scripts since they are secure here." >&4
6369 Some systems have disabled setuid scripts, especially systems where
6370 setuid scripts cannot be secure. On systems where setuid scripts have
6371 been disabled, the setuid/setgid bits on scripts are currently
6372 useless. It is possible for $package to detect those bits and emulate
6373 setuid/setgid in a secure fashion. This emulation will only work if
6374 setuid scripts have been disabled in your kernel.
6378 "$define") dflt=y ;;
6381 rp="Do you want to do setuid/setgid emulation?"
6384 [yY]*) val="$define";;
6392 : Find perl5.005 or later.
6393 echo "Looking for a previously installed perl5.005 or later... "
6395 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6396 : Check if this perl is recent and can load a simple module
6397 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6400 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6410 '') echo "None found. That's ok.";;
6411 *) echo "Using $perl5." ;;
6414 : Set the siteprefix variables
6417 After $package is installed, you may wish to install various
6418 add-on modules and utilities. Typically, these add-ons will
6419 be installed under $prefix with the rest
6420 of this package. However, you may wish to install such add-ons
6421 elsewhere under a different prefix.
6423 If you do not wish to put everything under a single prefix, that's
6424 ok. You will be prompted for the individual locations; this siteprefix
6425 is only used to suggest the defaults.
6427 The default should be fine for most people.
6431 rp='Installation prefix to use for add-on modules and utilities?'
6432 : XXX Here might be another good place for an installstyle setting.
6433 case "$siteprefix" in
6435 *) dflt=$siteprefix ;;
6438 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6440 case "$siteprefix" in
6444 *) oldsiteprefix="$prefix";;
6449 siteprefixexp="$ansexp"
6451 : determine where site specific libraries go.
6452 : Usual default is /usr/local/lib/perl5/site_perl/$version
6453 : The default "style" setting is made in installstyle.U
6454 : XXX No longer works with Prefixit stuff.
6455 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6457 '') case "$installstyle" in
6458 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6459 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6467 The installation process will create a directory for
6468 site-specific extensions and modules. Most users find it convenient
6469 to place all site-specific files in this directory rather than in the
6470 main distribution directory.
6474 rp='Pathname for the site-specific library files?'
6478 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6480 : Determine list of previous versions to include in @INC
6481 $cat > getverlist <<EOPL
6484 \$api_versionstring = "$api_versionstring";
6485 \$version = "$version";
6486 \$stem = "$sitelib_stem";
6487 \$archname = "$archname";
6489 $cat >> getverlist <<'EOPL'
6490 # The list found is store twice for each entry: the original name, and
6491 # the binary broken down version as pack "sss", so sorting is easy and
6492 # unambiguous. This will work for all versions that have a maximum of
6493 # three digit groups, separate by '.'s or '_'s. Names are extended with
6494 # ".0.0" to ensure at least three elements for the pack.
6495 # -- H.Merijn Brand (m)'06 23-10-2006
6497 # Can't have leading @ because metaconfig interprets it as a command!
6498 ;@inc_version_list=();
6499 # XXX Redo to do opendir/readdir?
6502 ;@candidates = map {
6503 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6509 ($pversion, $aversion, $vsn5005) = map {
6510 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6511 foreach $d (@candidates) {
6512 if ($d->[1] lt $pversion) {
6513 if ($d->[1] ge $aversion) {
6514 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6516 elsif ($d->[1] ge $vsn5005) {
6517 unshift(@inc_version_list, grep { -d } $d->[0]);
6521 # Skip newer version. I.e. don't look in
6522 # 5.7.0 if we're installing 5.6.1.
6526 if (@inc_version_list) {
6527 print join(' ', @inc_version_list);
6530 # Blank space to preserve value for next Configure run.
6535 case "$inc_version_list" in
6536 '') if test -x "$perl5$exe_ext"; then
6537 dflt=`$perl5 getverlist`
6542 $undef) dflt='none' ;;
6543 *) eval dflt=\"$inc_version_list\" ;;
6546 ''|' ') dflt=none ;;
6553 In order to ease the process of upgrading, this version of perl
6554 can be configured to use modules built and installed with earlier
6555 versions of perl that were installed under $prefix. Specify here
6556 the list of earlier versions that this version of perl should check.
6557 If Configure detected no earlier versions of perl installed under
6558 $prefix, then the list will be empty. Answer 'none' to tell perl
6559 to not search earlier versions.
6561 The default should almost always be sensible, so if you're not sure,
6562 just accept the default.
6565 rp='List of earlier versions to include in @INC?'
6568 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6569 *) inc_version_list="$ans" ;;
6571 case "$inc_version_list" in
6573 inc_version_list_init='0'
6574 d_inc_version_list="$undef"
6576 *) inc_version_list_init=`echo $inc_version_list |
6577 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6578 d_inc_version_list="$define"
6583 : see if malloc/malloc.h has to be included
6584 set malloc/malloc.h i_mallocmalloc
6587 : see if this is a malloc.h system
6588 : we want a real compile instead of Inhdr because some systems have a
6589 : malloc.h that just gives a compile error saying to use stdlib.h instead
6594 #$i_mallocmalloc I_MALLOCMALLOC
6595 #ifdef I_MALLOCMALLOC
6596 # include <malloc/malloc.h>
6599 int main () { return 0; }
6602 if eval $compile; then
6603 echo "<malloc.h> found." >&4
6606 echo "<malloc.h> NOT found." >&4
6613 : check for void type
6615 echo "Checking to see how well your C compiler groks the void type..." >&4
6616 case "$voidflags" in
6628 extern void moo(); /* function returning void */
6629 void (*goo)(); /* ptr to func returning void */
6631 void *hue; /* generic ptr */
6644 int main() { sub(); }
6646 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6647 voidflags=$defvoidused
6648 echo "Good. It appears to support void to the level $package wants.">&4
6649 if $contains warning .out >/dev/null 2>&1; then
6650 echo "However, you might get some warnings that look like this:"
6654 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6655 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6656 echo "It supports 1..."
6657 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6658 echo "It also supports 2..."
6659 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6661 echo "And it supports 4 but not 8 definitely."
6663 echo "It doesn't support 4..."
6664 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6666 echo "But it supports 8."
6669 echo "Neither does it support 8."
6673 echo "It does not support 2..."
6674 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6676 echo "But it supports 4 and 8."
6678 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6680 echo "And it supports 4 but has not heard about 8."
6682 echo "However it supports 8 but not 4."
6687 echo "There is no support at all for void."
6692 case "$voidflags" in
6695 Support flag bits are:
6696 1: basic void declarations.
6697 2: arrays of pointers to functions returning void.
6698 4: operations between pointers to and addresses of void functions.
6699 8: generic void pointers.
6702 rp="Your void support flags add up to what?"
6709 : check for length of pointer
6713 echo "Checking to see how big your pointers are..." >&4
6714 if test "$voidflags" -gt 7; then
6715 echo '#define VOID_PTR char *' > try.c
6717 echo '#define VOID_PTR void *' > try.c
6727 printf("%d\n", (int)sizeof(VOID_PTR));
6732 if eval $compile_ok; then
6733 ptrsize=`$run ./try`
6734 echo "Your pointers are $ptrsize bytes long."
6737 echo "(I can't seem to compile the test program. Guessing...)" >&4
6738 rp="What is the size of a pointer (in bytes)?"
6745 case "$use64bitall" in
6746 "$define"|true|[yY]*)
6750 *** You have chosen a maximally 64-bit build,
6751 *** but your pointers are only 4 bytes wide.
6752 *** Please rerun Configure without -Duse64bitall.
6757 *** Since you have quads, you could possibly try with -Duse64bitint.
6762 *** Cannot continue, aborting.
6773 : determine whether to use malloc wrapping
6775 case "$usemallocwrap" in
6776 [yY]*|true|$define) dflt='y' ;;
6777 [nN]*|false|$undef) dflt='n' ;;
6778 *) case "$usedevel" in
6779 [yY]*|true|$define) dflt='y' ;;
6784 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6786 usemallocwrap="$ans"
6789 usemallocwrap="$define" ;;
6791 usemallocwrap="$undef" ;;
6794 : determine which malloc to compile in
6796 case "$usemymalloc" in
6797 [yY]*|true|$define) dflt='y' ;;
6798 [nN]*|false|$undef) dflt='n' ;;
6799 *) case "$ptrsize" in
6805 rp="Do you wish to attempt to use the malloc that comes with $package?"
6811 mallocsrc='malloc.c'
6812 mallocobj="malloc$_o"
6813 d_mymalloc="$define"
6816 : Remove malloc from list of libraries to use
6817 echo "Removing unneeded -lmalloc from library list" >&4
6818 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6821 echo "libs = $libs" >&4
6833 : compute the return types of malloc and free
6835 $cat >malloc.c <<END
6839 #include <sys/types.h>
6853 case "$malloctype" in
6855 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6862 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6866 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6873 echo "Your system uses $freetype free(), it would seem." >&4
6875 : determine where site specific architecture-dependent libraries go.
6876 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6877 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6878 : sitelib may have an optional trailing /share.
6880 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6881 dflt="$dflt/$archname"
6886 set sitearch sitearch none
6890 The installation process will also create a directory for
6891 architecture-dependent site-specific extensions and modules.
6895 rp='Pathname for the site-specific architecture-dependent library files?'
6899 if $test X"$sitearch" = X"$sitelib"; then
6902 d_sitearch="$define"
6905 : Set the vendorprefix variables
6908 The installation process will also create a directory for
6909 vendor-supplied add-ons. Vendors who supply perl with their system
6910 may find it convenient to place all vendor-supplied files in this
6911 directory rather than in the main distribution directory. This will
6912 ease upgrades between binary-compatible maintenance versions of perl.
6914 Of course you may also use these directories in whatever way you see
6915 fit. For example, you might use them to access modules shared over a
6916 company-wide network.
6918 The default answer should be fine for most people.
6919 This causes further questions about vendor add-ons to be skipped
6920 and no vendor-specific directories will be configured for perl.
6923 rp='Do you want to configure vendor-specific add-on directories?'
6924 case "$usevendorprefix" in
6925 define|true|[yY]*) dflt=y ;;
6926 *) : User may have set vendorprefix directly on Configure command line.
6927 case "$vendorprefix" in
6936 rp='Installation prefix to use for vendor-supplied add-ons?'
6937 case "$vendorprefix" in
6939 *) dflt=$vendorprefix ;;
6942 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6944 case "$vendorprefix" in
6948 *) oldvendorprefix="$prefix";;
6952 usevendorprefix="$define"
6954 vendorprefixexp="$ansexp"
6956 *) usevendorprefix="$undef"
6962 : Set the vendorlib variables
6963 case "$vendorprefix" in
6964 '') d_vendorlib="$undef"
6968 *) d_vendorlib="$define"
6969 : determine where vendor-supplied modules go.
6970 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6971 case "$vendorlib" in
6973 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6974 case "$installstyle" in
6975 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6976 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6979 *) dflt="$vendorlib"
6983 rp='Pathname for the vendor-supplied library files?'
6986 vendorlibexp="$ansexp"
6989 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6993 : Set the vendorarch variables
6994 case "$vendorprefix" in
6995 '') d_vendorarch="$undef"
6999 *) d_vendorarch="$define"
7000 : determine where vendor-supplied architecture-dependent libraries go.
7001 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7002 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7003 : vendorlib may have an optional trailing /share.
7004 case "$vendorarch" in
7005 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7006 dflt="$dflt/$archname"
7008 *) dflt="$vendorarch" ;;
7011 rp='Pathname for vendor-supplied architecture-dependent files?'
7014 vendorarchexp="$ansexp"
7017 prefixvar=vendorarch
7020 : Final catch-all directories to search
7023 Lastly, you can have perl look in other directories for extensions and
7024 modules in addition to those already specified.
7025 These directories will be searched after
7029 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7030 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7032 case "$otherlibdirs" in
7033 ''|' ') dflt='none' ;;
7034 *) dflt="$otherlibdirs" ;;
7037 Enter a colon-separated set of extra paths to include in perl's @INC
7038 search path, or enter 'none' for no extra paths.
7042 rp='Colon-separated list of additional directories for perl to search?'
7045 ' '|''|none) otherlibdirs=' ' ;;
7046 *) otherlibdirs="$ans" ;;
7048 case "$otherlibdirs" in
7052 set d_perl_otherlibdirs
7055 : Cruising for prototypes
7057 echo "Checking out function prototypes..." >&4
7058 $cat >prototype.c <<EOCP
7063 int main(int argc, char *argv[]) {
7066 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7067 echo "Your C compiler appears to support function prototypes."
7070 echo "Your C compiler doesn't seem to understand function prototypes."
7077 : Check if ansi2knr is required
7078 case "$prototype" in
7080 *) ansi2knr='ansi2knr'
7085 This version of $package can only be compiled by a compiler that
7086 understands function prototypes. Unfortunately, your C compiler
7088 doesn't seem to understand them. Sorry about that.
7090 If GNU cc is available for your system, perhaps you could try that instead.
7092 Eventually, we hope to support building Perl with pre-ANSI compilers.
7093 If you would like to help in that effort, please contact <perlbug@perl.org>.
7095 Aborting Configure now.
7102 dflt_dtrace='/usr/sbin/dtrace'
7105 Perl can be built to support DTrace on platforms that support it.
7106 DTrace is a diagnosis and performance analysis tool from Sun.
7108 If this doesn't make any sense to you, just accept the default '$dflt'.
7112 case "$usedtrace" in
7118 dflt_dtrace=$usedtrace
7125 rp='Support DTrace if available?'
7128 y|Y) val="$define" ;;
7134 test "X$usedtrace" != "X$define" && break
7137 rp='Where is the dtrace executable?'
7146 if $dtrace -h -s ../perldtrace.d \
7147 -o perldtrace.tmp >/dev/null 2>&1 \
7148 && rm -f perldtrace.tmp
7151 echo "Good: your $dtrace knows about the -h flag."
7155 *** $me: Fatal Error: $dtrace doesn't support -h flag
7157 *** Your installed dtrace doesn't support the -h switch to compile a D
7158 *** program into a C header. Can't continue.
7170 *** $me: Fatal Error: $dtrace not found.
7177 echo "*** $dtrace was not found."
7183 : See if we want extra modules installed
7190 Perl can be built with extra modules or bundles of modules which
7191 will be fetched from the CPAN and installed alongside Perl.
7193 Notice that you will need access to the CPAN; either via the Internet,
7194 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7195 be asked later to configure the CPAN.pm module which will in turn do
7196 the installation of the rest of the extra modules or bundles.)
7198 Notice also that if the modules require any external software such as
7199 libraries and headers (the libz library and the zlib.h header for the
7200 Compress::Zlib module, for example) you MUST have any such software
7201 already installed, this configuration process will NOT install such
7204 If this doesn't make any sense to you, just accept the default '$dflt'.
7206 rp='Install any extra modules (y or n)?'
7212 Please list any extra modules or bundles to be installed from CPAN,
7213 with spaces between the names. The names can be in any format the
7214 'install' command of CPAN.pm will understand. (Answer 'none',
7215 without the quotes, to install no extra modules or bundles.)
7225 $rm -f ../extras.lst
7227 *) echo "(Saving the list of extras for later...)"
7228 echo "$extras" > ../extras.lst
7236 : determine where html pages for programs go
7237 set html1dir html1dir none
7241 If you wish to install html files for programs in $spackage, indicate
7242 the appropriate directory here. To skip installing html files,
7246 ''|none|$undef|' ') dflt=none ;;
7247 *) dflt=$html1dir ;;
7250 rp="Directory for the main $spackage html pages?"
7254 : Use ' ' for none so value is preserved next time through Configure
7255 $test X"$html1dir" = "X" && html1dir=' '
7257 : determine where html pages for libraries and modules go
7258 set html3dir html3dir none
7262 If you wish to install html files for modules associated with $spackage,
7263 indicate the appropriate directory here. To skip installing html files,
7266 : There is no obvious default. If they have specified html1dir, then
7267 : try to key off that, possibly changing .../html1 into .../html3.
7269 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7270 *) dflt=$html3dir ;;
7273 rp="Directory for the $spackage module html pages?"
7277 : Use ' ' for none so value is preserved next time through Configure
7278 $test X"$html3dir" = "X" && html3dir=' '
7280 : determine whether to install perl also as /usr/bin/perl
7283 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7285 Many scripts expect perl to be installed as /usr/bin/perl.
7287 If you want to, I can install the perl you are about to compile
7288 as /usr/bin/perl (in addition to $bin/perl).
7290 if test -f /usr/bin/perl; then
7293 However, please note that because you already have a /usr/bin/perl,
7294 overwriting that with a new Perl would very probably cause problems.
7295 Therefore I'm assuming you don't want to do that (unless you insist).
7298 case "$installusrbinperl" in
7299 "$define"|[yY]*) dflt='y';;
7305 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7308 case "$installusrbinperl" in
7309 "$undef"|[nN]*) dflt='n';;
7313 rp="Do you want to install perl as /usr/bin/perl?"
7316 [yY]*) val="$define";;
7322 set installusrbinperl
7325 : Check if we are using the GNU C library
7327 echo "Checking for GNU C Library..." >&4
7329 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7330 alone are insufficient to distinguish different versions, such as
7331 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7332 libc version 2.1.0. A. Dougherty, June 3, 2002.
7338 # ifdef __GLIBC_MINOR__
7339 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7340 # include <gnu/libc-version.h>
7341 printf("%s\n", gnu_get_libc_version());
7343 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7346 printf("%d\n", __GLIBC__);
7355 if eval $compile_ok && $run ./try > glibc.ver; then
7357 gnulibc_version=`$cat glibc.ver`
7358 echo "You are using the GNU C Library version $gnulibc_version"
7362 echo "You are not using the GNU C Library"
7368 : see if nm is to be used to determine whether a symbol is defined or not
7372 case "$d_gnulibc" in
7375 echo "nm probably won't work on the GNU C Library." >&4
7381 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7383 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7384 echo "'nm' won't be sufficient on this sytem." >&4
7390 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7391 if $test $dflt -gt 20; then
7401 true|$define) dflt=y;;
7408 I can use $nm to extract the symbols from your C libraries. This
7409 is a time consuming task which may generate huge output on the disk (up
7410 to 3 megabytes) but that should make the symbols extraction faster. The
7411 alternative is to skip the 'nm' extraction part and to compile a small
7412 test program instead to determine whether each symbol is present. If
7413 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7414 this may be the best solution.
7416 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7419 rp="Shall I use $nm to extract C symbols from the libraries?"
7422 [Nn]*) usenm=false;;
7431 : nm options which may be necessary
7433 '') if $test -f /mach_boot; then
7435 elif $test -d /usr/ccs/lib; then
7436 nm_opt='-p' # Solaris (and SunOS?)
7437 elif $test -f /dgux; then
7439 elif $test -f /lib64/rld; then
7440 nm_opt='-p' # 64-bit Irix
7446 : nm options which may be necessary for shared libraries but illegal
7447 : for archive libraries. Thank you, Linux.
7448 case "$nm_so_opt" in
7449 '') case "$myuname" in
7451 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7452 nm_so_opt='--dynamic'
7459 : Figure out where the libc is located
7462 : get list of predefined functions in a handy place
7467 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7473 *) for thislib in $libs; do
7476 : Handle C library specially below.
7479 thislib=`echo $thislib | $sed -e 's/^-l//'`
7480 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7482 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7484 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7486 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7488 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7490 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7492 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7497 libnames="$libnames $try"
7499 *) libnames="$libnames $thislib" ;;
7508 for xxx in $libpth; do
7509 $test -r $1 || set $xxx/libc.$so
7510 : The messy sed command sorts on library version numbers.
7512 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7513 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7515 s/[0-9][0-9]*/0000&/g
7516 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7519 $sort | $sed -e 's/^.* //'`
7522 $test -r $1 || set /usr/ccs/lib/libc.$so
7523 $test -r $1 || set /lib/libsys_s$_a
7529 if $test -r "$1"; then
7530 echo "Your (shared) C library seems to be in $1."
7532 elif $test -r /lib/libc && $test -r /lib/clib; then
7533 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7535 libc='/lib/clib /lib/libc'
7536 if $test -r /lib/syslib; then
7537 echo "(Your math library is in /lib/syslib.)"
7538 libc="$libc /lib/syslib"
7540 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7541 echo "Your C library seems to be in $libc, as you said before."
7542 elif $test -r $incpath/usr/lib/libc$_a; then
7543 libc=$incpath/usr/lib/libc$_a;
7544 echo "Your C library seems to be in $libc. That's fine."
7545 elif $test -r /lib/libc$_a; then
7547 echo "Your C library seems to be in $libc. You're normal."
7549 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7551 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7552 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7553 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7555 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7557 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7560 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7562 if $test -r "$tans"; then
7563 echo "Your C library seems to be in $tans, of all places."
7569 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7573 If the guess above is wrong (which it might be if you're using a strange
7574 compiler, or your machine supports multiple models), you can override it here.
7579 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7581 I can't seem to find your C library. I've looked in the following places:
7584 $sed 's/^/ /' libpath
7587 None of these seems to contain your C library. I need to get its name...
7592 rp='Where is your C library?'
7597 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7598 set X `cat libnames`
7601 case $# in 1) xxx=file; esac
7602 echo "Extracting names from the following $xxx for later perusal:" >&4
7604 $sed 's/^/ /' libnames >&4
7606 $echo $n "This may take a while...$c" >&4
7610 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7611 *) $nm $nm_opt $file 2>/dev/null;;
7616 $grep fprintf libc.tmp > libc.ptf
7617 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7618 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7620 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7624 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7628 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7632 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7636 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7640 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7644 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7645 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7647 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7649 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7651 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7653 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7655 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7657 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7659 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7661 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7663 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7665 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7667 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7669 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7671 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7673 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7675 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7678 $nm -p $* 2>/dev/null >libc.tmp
7679 $grep fprintf libc.tmp > libc.ptf
7680 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7681 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7687 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7689 if $ar t $libc > libc.tmp && \
7690 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7692 for thisname in $libnames $libc; do
7693 $ar t $thisname >>libc.tmp
7695 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7697 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7698 for thisname in $libnames $libc; do
7699 $ar tv $thisname >>libc.tmp
7700 emximp -o tmp.imp $thisname \
7702 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7703 < tmp.imp >>libc.tmp
7706 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7709 echo "$ar didn't seem to work right." >&4
7710 echo "Maybe this is a Cray...trying bld instead..." >&4
7712 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7715 for thisname in $libnames; do
7717 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7718 $ar t $thisname >>libc.tmp
7722 echo "That didn't work either. Giving up." >&4
7732 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7733 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7735 *) if $test -f /lib/syscalls.exp; then
7737 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7738 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7739 /lib/syscalls.exp >>libc.list
7745 $rm -f libnames libpath
7747 : see if dld is available
7751 : Check if we are using C++
7753 echo "Checking for C++..." >&4
7754 $cat >try.c <<'EOCP'
7766 if eval $compile_ok && $run ./try; then
7768 echo "You are using a C++ compiler."
7771 echo "You are not using a C++ compiler."
7777 : is a C symbol defined?
7780 -v) tf=libc.tmp; tdc="";;
7781 -a) tf=libc.tmp; tdc="[]";;
7782 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7784 case "$d_cplusplus" in
7785 $define) extern_C="extern \"C\"" ;;
7786 *) extern_C="extern" ;;
7789 case "$reuseval-$4" in
7791 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7796 if $test "$runnm" = true; then
7797 if $contains $tlook $tf >/dev/null 2>&1; then
7799 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7800 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7801 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7802 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7806 echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7807 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7813 $define) tval=true;;
7820 : define an is-in-libc? function
7821 inlibc='echo " "; td=$define; tu=$undef;
7822 sym=$1; var=$2; eval "was=\$$2";
7824 case "$reuseval$was" in
7834 echo "$sym() found." >&4;
7835 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7837 echo "$sym() NOT found." >&4;
7838 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7842 $define) echo "$sym() found." >&4;;
7843 *) echo "$sym() NOT found." >&4;;
7847 : see if dlopen exists
7849 xxx_ccflags="$ccflags"
7851 : with g++ one needs -shared to get is-in-libc to work for dlopen
7852 case "$gccversion" in
7854 *) case "$d_cplusplus" in
7855 "$define") ccflags="$ccflags -shared" ;;
7862 ccflags="$xxx_ccflags"
7864 : see if this is a unistd.h system
7865 set unistd.h i_unistd
7868 : determine which dynamic loading, if any, to compile in
7870 dldir="ext/DynaLoader"
7883 $define) dflt='y' ;;
7886 $define) dflt='y' ;;
7888 : Does a dl_xxx.xs file exist for this operating system
7889 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7892 rp="Do you wish to use dynamic loading?"
7899 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7900 dflt="$dldir/dl_${osname}.xs"
7901 elif $test "$d_dlopen" = "$define" ; then
7902 dflt="$dldir/dl_dlopen.xs"
7903 elif $test "$i_dld" = "$define" ; then
7904 dflt="$dldir/dl_dld.xs"
7909 *) dflt="$dldir/$dlsrc"
7912 echo "The following dynamic loading files are available:"
7913 : Can not go over to $dldir because getfile has path hard-coded in.
7914 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7915 rp="Source file to use for dynamic loading"
7921 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7925 Some systems may require passing special flags to $cc -c to
7926 compile modules that will be used to create a shared library.
7927 To use no flags, say "none".
7930 case "$cccdlflags" in
7931 '') case "$gccversion" in
7932 '') case "$osname" in
7934 next) dflt='none' ;;
7935 irix*) dflt='-KPIC' ;;
7936 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7937 sunos) dflt='-pic' ;;
7941 *) case "$osname" in
7942 darwin) dflt='none' ;;
7943 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7948 *) dflt="$cccdlflags" ;;
7950 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7953 none) cccdlflags=' ' ;;
7954 *) cccdlflags="$ans" ;;
7959 Some systems use ld to create libraries that can be dynamically loaded,
7960 while other systems (such as those using ELF) use $cc.
7964 '') $cat >try.c <<EOM
7965 /* Test for whether ELF binaries are produced */
7977 int i = open("a.out",O_RDONLY);
7980 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7981 exit(0); /* succeed (yes, it's ELF) */
7986 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7988 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7992 echo "I'll use ld to build dynamic libraries."
8001 rp="What command should be used to create dynamic libraries?"
8007 Some systems may require passing special flags to $ld to create a
8008 library that can be dynamically loaded. If your ld flags include
8009 -L/other/path options to locate libraries outside your loader's normal
8010 search path, you may need to specify those -L options here as well. To
8011 use no flags, say "none".
8014 case "$lddlflags" in
8015 '') case "$osname" in
8016 beos) dflt='-nostart' ;;
8018 case "$gccversion" in
8019 '') dflt="$dflt +vnocompatwarnings" ;;
8022 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8023 next) dflt='none' ;;
8024 solaris) dflt='-G' ;;
8025 sunos) dflt='-assert nodefinitions' ;;
8026 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8030 *) dflt="$lddlflags" ;;
8033 : Try to guess additional flags to pick up local libraries.
8034 : Be careful not to append to a plain 'none'
8038 for thisflag in $ldflags; do
8043 *) dflt="$dflt $thisflag" ;;
8050 ''|' ') dflt='none' ;;
8054 *-fstack-protector*)
8056 *-fstack-protector*) ;; # Don't add it again
8057 *) dflt="$dflt -fstack-protector" ;;
8063 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8066 none) lddlflags=' ' ;;
8067 *) lddlflags="$ans" ;;
8072 Some systems may require passing special flags to $cc to indicate that
8073 the resulting executable will use dynamic linking. To use no flags,
8077 case "$ccdlflags" in
8078 '') case "$osname" in
8079 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8080 next|sunos) dflt='none' ;;
8084 *) dflt="$ccdlflags" ;;
8086 rp="Any special flags to pass to $cc to use dynamic linking?"
8089 none) ccdlflags=' ' ;;
8090 *) ccdlflags="$ans" ;;
8101 : Do we want a shared libperl?
8105 # No dynamic loading being used, so don't bother even to prompt.
8108 *) case "$useshrplib" in
8109 '') case "$osname" in
8110 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8112 also='Building a shared libperl is required for dynamic loading to work on your system.'
8117 also='Building a shared libperl is needed for MAB support.'
8135 The perl executable is normally obtained by linking perlmain.c with
8136 libperl${_a}, any static extensions (usually just DynaLoader), and
8137 any other libraries needed on this system (such as -lm, etc.). Since
8138 your system supports dynamic loading, it is probably possible to build
8139 a shared libperl.$so. If you will have more than one executable linked
8140 to libperl.$so, this will significantly reduce the size of each
8141 executable, but it may have a noticeable effect on performance. The
8142 default is probably sensible for your system.
8146 rp="Build a shared libperl.$so (y/n)"
8150 useshrplib='true' ;;
8151 *) useshrplib='false' ;;
8156 case "$useshrplib" in
8160 # Figure out a good name for libperl.so. Since it gets stored in
8161 # a version-specific architecture-dependent library, the version
8162 # number isn't really that important, except for making cc/ld happy.
8164 # A name such as libperl.so.10.1
8165 majmin="libperl.$so.$patchlevel.$subversion"
8166 # A name such as libperl.so.100
8167 majonly=`echo $patchlevel $subversion |
8168 $awk '{printf "%d%02d", $1, $2}'`
8169 majonly=libperl.$so.$majonly
8170 # I'd prefer to keep the os-specific stuff here to a minimum, and
8171 # rely on figuring it out from the naming of libc.
8172 case "${osname}${osvers}" in
8175 # XXX How handle the --version stuff for MAB?
8177 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8180 cygwin*) # ld links now against the dll directly
8181 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8182 majonly=`echo $patchlevel $subversion |
8183 $awk '{printf "%03d%03d", $1, $2}'`
8184 majonly=cygperl5.$majonly.$so
8187 *) # Try to guess based on whether libc has major.minor.
8189 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8190 *libc.$so.[0-9]*) dflt=$majonly ;;
8191 *) dflt=libperl.$so ;;
8201 I need to select a good name for the shared libperl. If your system uses
8202 library names with major and minor numbers, then you might want something
8203 like $majmin. Alternatively, if your system uses a single version
8204 number for shared libraries, then you might want to use $majonly.
8205 Or, your system might be quite happy with a simple libperl.$so.
8207 Since the shared libperl will get installed into a version-specific
8208 architecture-dependent directory, the version number of the shared perl
8209 library probably isn't important, so the default should be o.k.
8212 rp='What name do you want to give to the shared libperl?'
8215 echo "Ok, I'll use $libperl"
8218 libperl="libperl${_a}"
8222 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8226 WARNING: Use of the shrpdir variable for the installation location of
8227 the shared $libperl is not supported. It was never documented and
8228 will not work in this version. Let me (perlbug@perl.org)
8229 know of any problems this may cause.
8235 But your current setting of $shrpdir is
8236 the default anyway, so it's harmless.
8241 Further, your current attempted setting of $shrpdir
8242 conflicts with the value of $archlibexp/CORE
8243 that installperl will use.
8250 # How will the perl executable find the installed shared $libperl?
8251 # Add $xxx to ccdlflags.
8252 # If we can't figure out a command-line option, use $shrpenv to
8253 # set env LD_RUN_PATH. The main perl makefile uses this.
8254 shrpdir=$archlibexp/CORE
8257 if "$useshrplib"; then
8260 # We'll set it in Makefile.SH...
8265 freebsd|netbsd|openbsd|interix|dragonfly)
8266 xxx="-Wl,-R$shrpdir"
8268 bsdos|linux|irix*|dec_osf|gnu*)
8269 xxx="-Wl,-rpath,$shrpdir"
8272 # next doesn't like the default...
8275 # beos doesn't like the default, either.
8278 # hpux doesn't like the default, either.
8279 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8282 # cygwin needs only ldlibpth
8285 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8291 # Only add $xxx if it isn't already in ccdlflags.
8292 case " $ccdlflags " in
8294 *) ccdlflags="$ccdlflags $xxx"
8297 Adding $xxx to the flags
8298 passed to $ld so that the perl executable will find the
8299 installed shared $libperl.
8307 # Fix ccdlflags in AIX for building external extensions.
8308 # (For building Perl itself bare -bE:perl.exp is needed,
8309 # Makefile.SH takes care of this.)
8311 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8313 # Respect a hint or command-line value.
8315 '') shrpenv="$tmp_shrpenv" ;;
8317 case "$ldlibpthname" in
8318 '') ldlibpthname=LD_LIBRARY_PATH ;;
8319 none) ldlibpthname='' ;;
8322 : determine where manual pages are on this system
8326 syspath='/usr/share/man/man1 /usr/man/man1'
8327 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8328 syspath="$syspath /usr/man/u_man/man1"
8329 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8330 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8331 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8332 sysman=`./loc . /usr/man/man1 $syspath`
8335 if $test -d "$sysman"; then
8336 echo "System manual is in $sysman." >&4
8338 echo "Could not find manual pages in source form." >&4
8341 : determine where manual pages go
8342 set man1dir man1dir none
8346 $spackage has manual pages available in source form.
8350 echo "However, you don't have nroff, so they're probably useless to you."
8352 '') man1dir="none";;
8355 echo "If you don't want the manual sources installed, answer 'none'."
8360 lookpath="$prefixexp/share/man/man1"
8361 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8362 lookpath="$lookpath $prefixexp/man/p_man/man1"
8363 lookpath="$lookpath $prefixexp/man/u_man/man1"
8364 lookpath="$lookpath $prefixexp/man/man.1"
8366 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8367 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8377 rp="Where do the main $spackage manual pages (source) go?"
8379 if $test "X$man1direxp" != "X$ansexp"; then
8390 : What suffix to use on installed man pages
8397 rp="What suffix should be used for the main $spackage man pages?"
8399 '') case "$man1dir" in
8413 *) dflt="$man1ext";;
8420 : see if we can have long filenames
8422 first=123456789abcdef
8424 if (echo hi >$first) 2>/dev/null; then
8425 if $test -f 123456789abcde; then
8426 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8429 echo 'You can have filenames longer than 14 characters.'>&4
8434 You can't have filenames longer than 14 chars.
8435 You can't even think about them!
8441 $rm -rf 123456789abcde*
8443 : determine where library module manual pages go
8444 set man3dir man3dir none
8448 $spackage has manual pages for many of the library modules.
8454 However, you don't have nroff, so they're probably useless to you.
8457 '') man3dir="none";;
8461 case "$d_flexfnam" in
8464 However, your system can't handle the long file names like File::Basename.3.
8467 '') man3dir="none";;
8471 echo "If you don't want the manual sources installed, answer 'none'."
8472 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8474 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8475 if $test -d "$privlib/man/man3"; then
8478 WARNING: Previous versions of perl installed man3 pages into
8479 $privlib/man/man3. This version will suggest a
8480 new default of $dflt.
8484 rp='Do you wish to preserve the old behavior?(y/n)'
8487 y*) dflt="$privlib/man/man3" ;;
8492 *) dflt="$man3dir" ;;
8499 rp="Where do the $package library man pages (source) go?"
8509 : What suffix to use on installed man pages
8515 rp="What suffix should be used for the $package library man pages?"
8517 '') case "$man3dir" in
8531 *) dflt="$man3ext";;
8538 : see if we have to deal with yellow pages, now NIS.
8539 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8540 if $test -f /usr/etc/nibindd; then
8542 echo "I'm fairly confident you're on a NeXT."
8544 rp='Do you get the hosts file via NetInfo?'
8553 y*) hostcat='nidump hosts .';;
8554 *) case "$hostcat" in
8555 nidump*) hostcat='';;
8565 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8573 rp='Are you getting the hosts file via yellow pages?'
8576 y*) hostcat='ypcat hosts';;
8577 *) hostcat='cat /etc/hosts';;
8583 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8586 '') test -f /etc/group && groupcat='cat /etc/group';;
8589 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8592 : now get the host name
8594 echo "Figuring out host name..." >&4
8595 case "$myhostname" in
8597 echo 'Maybe "hostname" will work...'
8598 if tans=`sh -c hostname 2>&1` ; then
8606 if $test "$cont"; then
8608 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8609 if tans=`cat /etc/systemid 2>&1` ; then
8611 phostname='cat /etc/systemid'
8612 echo "Whadyaknow. Xenix always was a bit strange..."
8615 elif $test -r /etc/systemid; then
8616 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8619 if $test "$cont"; then
8620 echo 'No, maybe "uuname -l" will work...'
8621 if tans=`sh -c 'uuname -l' 2>&1` ; then
8623 phostname='uuname -l'
8625 echo 'Strange. Maybe "uname -n" will work...'
8626 if tans=`sh -c 'uname -n' 2>&1` ; then
8628 phostname='uname -n'
8630 echo 'Oh well, maybe I can mine it out of whoami.h...'
8631 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8632 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8633 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8635 case "$myhostname" in
8636 '') echo "Does this machine have an identity crisis or something?"
8639 echo "Well, you said $myhostname before..."
8640 phostname='echo $myhostname';;
8646 case "$myhostname" in
8647 '') myhostname=noname ;;
8649 : you do not want to know about this
8654 if $test "$myhostname" ; then
8656 rp='Your host name appears to be "'$myhostname'".'" Right?"
8664 : bad guess or no guess
8665 while $test "X$myhostname" = X ; do
8667 rp="Please type the (one word) name of your host:"
8672 : translate upper to lower if necessary
8673 case "$myhostname" in
8675 echo "(Normalizing case in your host name)"
8676 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8680 case "$myhostname" in
8682 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8683 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8684 echo "(Trimming domain name from host name--host name is now $myhostname)"
8686 *) case "$mydomain" in
8689 test "X$hostcat" = "Xypcat hosts" &&
8690 ypmatch "$myhostname" hosts 2>/dev/null |\
8691 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8694 test "X$hostcat" != "X" &&
8695 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8696 /[ ]$myhostname[ . ]/p" > hosts
8699 if $test -f hosts; then
8700 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8701 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8702 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8703 hosts | $sort | $uniq | \
8704 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8705 case `$echo X$dflt` in
8706 X*\ *) echo "(Several hosts in the database matched hostname)"
8709 X.) echo "(You do not have fully-qualified names in the hosts database)"
8713 echo "(I cannot locate a hosts database anywhere)"
8718 tans=`./loc resolv.conf X /etc /usr/etc`
8719 if $test -f "$tans"; then
8720 echo "(Attempting domain name extraction from $tans)"
8721 dflt=.`$sed -n -e 's/ / /g' \
8722 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8725 .) dflt=.`$sed -n -e 's/ / /g' \
8726 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8734 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8735 dflt=.`sh -c domainname 2>/dev/null`
8738 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8742 case "$dflt$osname" in
8743 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8744 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8748 .) echo "(Lost all hope -- silly guess then)"
8754 *) dflt="$mydomain";;
8758 rp="What is your domain name?"
8768 : translate upper to lower if necessary
8771 echo "(Normalizing case in your domain name)"
8772 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8776 : a little sanity check here
8777 case "$phostname" in
8780 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8781 $myhostname$mydomain|$myhostname) ;;
8783 case "$phostname" in
8785 echo "(That doesn't agree with your whoami.h file, by the way.)"
8788 echo "(That doesn't agree with your $phostname command, by the way.)"
8796 : determine the e-mail address of the user who is running us
8799 I need to get your e-mail address in Internet format if possible, i.e.
8800 something like user@host.domain. Please answer accurately since I have
8801 no easy means to double check it. The default value provided below
8802 is most probably close to reality but may not be valid from outside
8803 your organization...
8807 while test "$cont"; do
8809 '') dflt="$cf_by@$myhostname$mydomain";;
8810 *) dflt="$cf_email";;
8812 rp='What is your e-mail address?'
8818 rp='Address does not look like an Internet one. Use it anyway?'
8832 : Ask e-mail of administrator
8835 If you or somebody else will be maintaining perl at your site, please
8836 fill in the correct e-mail address here so that they may be contacted
8837 if necessary. Currently, the "perlbug" program included with perl
8838 will send mail to this address in addition to perlbug@perl.org. You may
8839 enter "none" for no administrator.
8842 case "$perladmin" in
8843 '') dflt="$cf_email";;
8844 *) dflt="$perladmin";;
8846 rp='Perl administrator e-mail address'
8850 : determine whether to only install version-specific parts.
8853 Do you want to install only the version-specific parts of the perl
8854 distribution? Usually you do *not* want to do this.
8856 case "$versiononly" in
8857 "$define"|[Yy]*|true) dflt='y' ;;
8860 rp="Do you want to install only the version-specific parts of perl?"
8863 [yY]*) val="$define";;
8869 case "$versiononly" in
8870 "$define") inc_version_list=''
8871 inc_version_list_init=0
8875 : figure out how to guarantee perl startup
8876 : XXX Note that this currently takes advantage of the bug that binexp ignores
8877 : the Configure -Dinstallprefix setting, which in turn means that under
8878 : relocatable @INC, initialinstalllocation is what binexp started as.
8879 case "$startperl" in
8881 case "$sharpbang" in
8885 I can use the #! construct to start perl on your system. This will
8886 make startup of perl scripts faster, but may cause problems if you
8887 want to share those scripts and perl is not in a standard place
8888 ($initialinstalllocation/perl) on all your platforms. The alternative
8889 is to force a shell by starting the script with a single ':' character.
8892 case "$versiononly" in
8893 "$define") dflt="$initialinstalllocation/perl$version";;
8894 *) dflt="$initialinstalllocation/perl";;
8896 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8899 none) startperl=": # use perl";;
8900 *) startperl="#!$ans"
8901 if $test 30 -lt `echo "$ans" | wc -c`; then
8904 WARNING: Some systems limit the #! command to 32 characters.
8905 If you experience difficulty running Perl scripts with #!, try
8906 installing Perl in a directory with a shorter pathname.
8912 *) startperl=": # use perl"
8917 echo "I'll use $startperl to start perl scripts."
8919 : figure best path for perl in scripts
8922 case "$versiononly" in
8923 "$define") perlpath="$initialinstalllocation/perl$version";;
8924 *) perlpath="$initialinstalllocation/perl";;
8926 case "$startperl" in
8931 I will use the "eval 'exec'" idiom to start Perl on your system.
8932 I can use the full path of your Perl binary for this purpose, but
8933 doing so may cause problems if you want to share those scripts and
8934 Perl is not always in a standard place ($initialinstalllocation/perl).
8937 dflt="$initialinstalllocation/perl"
8938 rp="What path shall I use in \"eval 'exec'\"?"
8945 case "$startperl" in
8947 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8950 : determine where public executable scripts go
8951 set scriptdir scriptdir
8953 case "$scriptdir" in
8956 : guess some guesses
8957 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8958 $test -d /usr/share/bin && dflt=/usr/share/bin
8959 $test -d /usr/local/script && dflt=/usr/local/script
8960 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8961 $test -d $prefixexp/script && dflt=$prefixexp/script
8965 *) dflt="$scriptdir"
8970 Some installations have a separate directory just for executable scripts so
8971 that they can mount it across multiple architectures but keep the scripts in
8972 one spot. You might, for example, have a subdirectory of /usr/share for this.
8973 Or you might just lump your scripts in with all your other executables.
8977 rp='Where do you keep publicly executable scripts?'
8979 if $test "X$ansexp" != "X$scriptdirexp"; then
8985 : A little fix up for an irregularly named variable.
8986 installscript="$installscriptdir"
8988 : determine where add-on public executables go
8990 '') dflt=$siteprefix/bin ;;
8994 rp='Pathname where the add-on public executables should be installed?'
8999 : determine where add-on html pages go
9000 : There is no standard location, so try to copy the previously-selected
9001 : directory structure for the core html pages.
9002 case "$sitehtml1dir" in
9003 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9004 *) dflt=$sitehtml1dir ;;
9007 ''|' ') dflt=none ;;
9010 rp='Pathname where the site-specific html pages should be installed?'
9012 prefixvar=sitehtml1dir
9015 : determine where add-on library html pages go
9016 : There is no standard location, so try to copy the previously-selected
9017 : directory structure for the core html pages.
9018 case "$sitehtml3dir" in
9019 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9020 *) dflt=$sitehtml3dir ;;
9023 ''|' ') dflt=none ;;
9026 rp='Pathname where the site-specific library html pages should be installed?'
9028 prefixvar=sitehtml3dir
9031 : determine where add-on manual pages go
9032 case "$siteman1dir" in
9033 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9034 *) dflt=$siteman1dir ;;
9037 ''|' ') dflt=none ;;
9040 rp='Pathname where the site-specific manual pages should be installed?'
9042 prefixvar=siteman1dir
9045 : determine where add-on library man pages go
9046 case "$siteman3dir" in
9047 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9048 *) dflt=$siteman3dir ;;
9051 ''|' ') dflt=none ;;
9054 rp='Pathname where the site-specific library manual pages should be installed?'
9056 prefixvar=siteman3dir
9059 : determine where add-on public executable scripts go
9060 case "$sitescript" in
9061 '') dflt=$siteprefix/script
9062 $test -d $dflt || dflt=$sitebin ;;
9063 *) dflt="$sitescript" ;;
9066 rp='Pathname where add-on public executable scripts should be installed?'
9068 prefixvar=sitescript
9071 : Check if faststdio is requested and available
9072 case "$usefaststdio" in
9073 $define|true|[yY]*|'')
9074 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9084 Perl can be built to use 'fast stdio', which means using the stdio
9085 library but also directly manipulating the stdio buffers to enable
9086 faster I/O. Using stdio is better for backward compatibility (especially
9087 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9088 interface has been preferred instead of stdio.
9090 If this doesn't make any sense to you, just accept the default '$dflt'.
9092 rp='Use the "fast stdio" if available?'
9095 y|Y) val="$define" ;;
9102 : define an is-a-typedef? function
9103 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9105 "") inclist="sys/types.h";;
9107 eval "varval=\$$var";
9111 for inc in $inclist; do
9112 echo "#include <$inc>" >>temp.c;
9114 echo "#ifdef $type" >> temp.c;
9115 echo "printf(\"We have $type\");" >> temp.c;
9116 echo "#endif" >> temp.c;
9117 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9118 if $contains $type temp.E >/dev/null 2>&1; then
9124 *) eval "$var=\$varval";;
9127 : define an is-a-typedef? function that prompts if the type is not available.
9128 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9130 "") inclist="sys/types.h";;
9132 eval "varval=\$$var";
9136 for inc in $inclist; do
9137 echo "#include <$inc>" >>temp.c;
9139 echo "#ifdef $type" >> temp.c;
9140 echo "printf(\"We have $type\");" >> temp.c;
9141 echo "#endif" >> temp.c;
9142 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9144 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9145 if $contains $type temp.E >/dev/null 2>&1; then
9146 echo "$type found." >&4;
9149 echo "$type NOT found." >&4;
9155 *) eval "$var=\$varval";;
9158 : see what type lseek is declared as in the kernel
9159 rp="What is the type used for lseek's offset on this system?"
9160 set off_t lseektype long stdio.h sys/types.h
9164 echo "Checking to see how big your file offsets are..." >&4
9166 #include <sys/types.h>
9170 printf("%d\n", (int)sizeof($lseektype));
9175 if eval $compile_ok; then
9176 lseeksize=`$run ./try`
9177 echo "Your file offsets are $lseeksize bytes long."
9181 echo "(I can't seem to compile the test program. Guessing...)"
9182 rp="What is the size of your file offsets (in bytes)?"
9188 : see what type file positions are declared as in the library
9189 rp="What is the type for file position used by fsetpos()?"
9190 set fpos_t fpostype long stdio.h sys/types.h
9193 : Check size for Fpos_t
9196 *_t) zzz="$fpostype" ;;
9199 echo "Checking the size of $zzz..." >&4
9201 #include <sys/types.h>
9208 printf("%d\n", (int)sizeof($fpostype));
9213 if eval $compile_ok; then
9217 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9220 echo "Your $zzz is $fpossize bytes long."
9226 echo "(I can't compile the test program. Guessing...)" >&4
9227 rp="What is the size of your file positions (in bytes)?"
9232 : Check for large file support
9233 # Backward compatibility (uselfs is deprecated).
9235 "$define"|true|[yY]*)
9238 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9240 uselargefiles="$define"
9244 case "$lseeksize:$fpossize" in
9247 You can have files larger than 2 gigabytes.
9250 *) case "$uselargefiles" in
9251 "$undef"|false|[nN]*) dflt='n' ;;
9256 Perl can be built to understand large files (files larger than 2 gigabytes)
9257 on some systems. To do so, Configure can be run with -Duselargefiles.
9259 If this doesn't make any sense to you, just accept the default '$dflt'.
9261 rp='Try to understand large files, if available?'
9264 y|Y) val="$define" ;;
9271 : Look for a hint-file generated 'call-back-unit'. If the
9272 : user has specified that a large files perl is to be built,
9273 : we may need to set or change some other defaults.
9274 if $test -f uselargefiles.cbu; then
9275 echo "Your platform has some specific hints regarding large file builds, using them..."
9276 . ./uselargefiles.cbu
9278 case "$uselargefiles" in
9280 if $test -f uselargefiles.cbu; then
9282 echo "Rechecking to see how big your file offsets are..." >&4
9284 #include <sys/types.h>
9288 printf("%d\n", (int)sizeof($lseektype));
9293 if eval $compile_ok; then
9294 lseeksize=`$run ./try`
9295 $echo "Your file offsets are now $lseeksize bytes long."
9299 echo "(I can't seem to compile the test program. Guessing...)"
9300 rp="What is the size of your file offsets (in bytes)?"
9305 *_t) zzz="$fpostype" ;;
9308 $echo $n "Rechecking the size of $zzz...$c" >&4
9310 #include <sys/types.h>
9317 printf("%d\n", (int)sizeof($fpostype));
9322 if eval $compile_ok; then
9327 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9330 echo " $fpossize bytes." >&4
9336 echo "(I can't compile the test program. Guessing...)" >&4
9337 rp="What is the size of your file positions (in bytes)?"
9346 : Set the vendorbin variables
9347 case "$vendorprefix" in
9348 '') d_vendorbin="$undef"
9352 *) d_vendorbin="$define"
9353 : determine where vendor-supplied executables go.
9354 case "$vendorbin" in
9355 '') dflt=$vendorprefix/bin ;;
9356 *) dflt="$vendorbin" ;;
9359 rp='Pathname for the vendor-supplied executables directory?'
9362 vendorbinexp="$ansexp"
9368 : Set the vendorhtml1dir variables
9369 case "$vendorprefix" in
9370 '') vendorhtml1dir=''
9371 vendorhtml1direxp=''
9373 *) : determine where vendor-supplied html pages go.
9374 : There is no standard location, so try to copy the previously-selected
9375 : directory structure for the core html pages.
9376 : XXX Better default suggestions would be welcome.
9377 case "$vendorhtml1dir" in
9378 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9379 *) dflt=$vendorhtml1dir ;;
9382 ''|' ') dflt=none ;;
9385 rp='Pathname for the vendor-supplied html pages?'
9387 vendorhtml1dir="$ans"
9388 vendorhtml1direxp="$ansexp"
9391 : Use ' ' for none so value is preserved next time through Configure
9392 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9393 prefixvar=vendorhtml1dir
9396 : Set the vendorhtml3dir variables
9397 case "$vendorprefix" in
9398 '') vendorhtml3dir=''
9399 vendorhtml3direxp=''
9401 *) : determine where vendor-supplied module html pages go.
9402 : There is no standard location, so try to copy the previously-selected
9403 : directory structure for the core html pages.
9404 : XXX Better default suggestions would be welcome.
9405 case "$vendorhtml3dir" in
9406 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9407 *) dflt=$vendorhtml3dir ;;
9410 ''|' ') dflt=none ;;
9413 rp='Pathname for the vendor-supplied html pages?'
9415 vendorhtml3dir="$ans"
9416 vendorhtml3direxp="$ansexp"
9419 : Use ' ' for none so value is preserved next time through Configure
9420 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9421 prefixvar=vendorhtml3dir
9424 : Set the vendorman1dir variables
9425 case "$vendorprefix" in
9426 '') vendorman1dir=''
9429 *) : determine where vendor-supplied manual pages go.
9430 case "$vendorman1dir" in
9431 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9432 *) dflt=$vendorman1dir ;;
9435 ''|' ') dflt=none ;;
9438 rp='Pathname for the vendor-supplied manual section 1 pages?'
9440 vendorman1dir="$ans"
9441 vendorman1direxp="$ansexp"
9444 : Use ' ' for none so value is preserved next time through Configure
9445 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9446 prefixvar=vendorman1dir
9449 : Set the vendorman3dir variables
9450 case "$vendorprefix" in
9451 '') vendorman3dir=''
9454 *) : determine where vendor-supplied module manual pages go.
9455 case "$vendorman3dir" in
9456 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9457 *) dflt=$vendorman3dir ;;
9460 ''|' ') dflt=none ;;
9463 rp='Pathname for the vendor-supplied manual section 3 pages?'
9465 vendorman3dir="$ans"
9466 vendorman3direxp="$ansexp"
9469 : Use ' ' for none so value is preserved next time through Configure
9470 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9471 prefixvar=vendorman3dir
9474 : Set the vendorscript variables
9475 case "$vendorprefix" in
9476 '') d_vendorscript="$undef"
9480 *) d_vendorscript="$define"
9481 : determine where vendor-supplied scripts go.
9482 case "$vendorscript" in
9483 '') dflt=$vendorprefix/script
9484 $test -d $dflt || dflt=$vendorbin ;;
9485 *) dflt="$vendorscript" ;;
9489 The installation process will create a directory for
9490 vendor-supplied scripts.
9494 rp='Pathname for the vendor-supplied scripts directory?'
9497 vendorscriptexp="$ansexp"
9500 prefixvar=vendorscript
9503 : script used to emit important warnings
9506 if test \$# -gt 0; then
9511 echo "*** WARNING:" >&4
9512 sed -e 's/^/*** /' <msg >&4
9514 cat msg >>config.msg
9515 echo " " >>config.msg
9521 : see which of string.h or strings.h is needed
9523 strings=`./findhdr string.h`
9524 if $test "$strings" && $test -r "$strings"; then
9525 echo "Using <string.h> instead of <strings.h>." >&4
9529 strings=`./findhdr strings.h`
9530 if $test "$strings" && $test -r "$strings"; then
9531 echo "Using <strings.h> instead of <string.h>." >&4
9533 ./warn "No string header found -- You'll surely have problems."
9539 "$undef") strings=`./findhdr strings.h`;;
9540 *) strings=`./findhdr string.h`;;
9543 : see if qgcvt exists
9547 : Check print/scan long double stuff
9550 if $test X"$d_longdbl" = X"$define"; then
9552 echo "Checking how to print long doubles..." >&4
9554 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9555 $cat >try.c <<'EOCP'
9556 #include <sys/types.h>
9560 printf("%.3f\n", d);
9564 if eval $compile; then
9568 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9569 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9570 echo "We will use %f."
9576 if $test X"$sPRIfldbl" = X; then
9577 $cat >try.c <<'EOCP'
9578 #include <sys/types.h>
9581 long double d = 123.456;
9582 printf("%.3Lf\n", d);
9586 if eval $compile; then
9590 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9591 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9592 echo "We will use %Lf."
9598 if $test X"$sPRIfldbl" = X; then
9599 $cat >try.c <<'EOCP'
9600 #include <sys/types.h>
9603 long double d = 123.456;
9604 printf("%.3llf\n", d);
9608 if eval $compile; then
9612 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9613 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9614 echo "We will use %llf."
9620 if $test X"$sPRIfldbl" = X; then
9621 $cat >try.c <<'EOCP'
9622 #include <sys/types.h>
9625 long double d = 123.456;
9626 printf("%.3lf\n", d);
9630 if eval $compile; then
9634 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9635 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9636 echo "We will use %lf."
9642 if $test X"$sPRIfldbl" = X; then
9643 echo "Cannot figure out how to print long doubles." >&4
9645 sSCNfldbl=$sPRIfldbl # expect consistency
9652 case "$sPRIfldbl" in
9653 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9654 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9655 d_SCNfldbl="$undef";
9657 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9658 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9659 d_SCNfldbl="$define";
9663 : Check how to convert floats to strings.
9665 if test "X$d_Gconvert" = X; then
9668 echo "Checking for an efficient way to convert floats to strings."
9670 case "$uselongdouble" in
9671 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9673 case "$d_longdbl" in
9674 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9676 case "$d_PRIgldbl" in
9677 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9681 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9682 char *myname = "gconvert";
9685 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9686 char *myname = "gcvt";
9689 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9690 char *myname = "qgcvt";
9691 #define DOUBLETYPE long double
9694 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9696 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9698 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9701 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9703 char *myname = "sprintf";
9707 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9708 #define DOUBLETYPE long double
9710 #define DOUBLETYPE double
9722 # include <string.h>
9724 # include <strings.h>
9727 int checkit(char *expect, char *got)
9729 if (strcmp(expect, got)) {
9730 printf("%s oddity: Expected %s, got %s\n",
9731 myname, expect, got);
9741 /* This must be 1st test on (which?) platform */
9742 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9743 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9744 checkit("0.1", buf);
9746 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9747 checkit("0.01", buf);
9749 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9750 checkit("0.001", buf);
9752 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9753 checkit("0.0001", buf);
9755 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9756 if (strlen(buf) > 5)
9757 checkit("9e-005", buf); /* for Microsoft ?? */
9759 checkit("9e-05", buf);
9761 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9764 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9765 checkit("1.1", buf);
9767 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9768 checkit("1.01", buf);
9770 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9771 checkit("1.001", buf);
9773 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9774 checkit("1.0001", buf);
9776 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9777 checkit("1.00001", buf);
9779 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9780 checkit("1.000001", buf);
9782 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9785 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9788 /* Some Linux gcvt's give 1.e+5 here. */
9789 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9790 checkit("100000", buf);
9792 /* Some Linux gcvt's give -1.e+5 here. */
9793 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9794 checkit("-100000", buf);
9796 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9797 checkit("123.456", buf);
9799 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9800 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9801 /* 34 should be enough to scare even long double
9802 * places into using the e notation. */
9803 if (strlen(buf) > 5)
9804 checkit("1e+034", buf); /* for Microsoft */
9806 checkit("1e+34", buf);
9808 /* For Perl, if you add additional tests here, also add them to
9809 * t/base/num.t for benefit of platforms not using Configure or
9810 * overriding d_Gconvert */
9815 : first add preferred functions to our list
9817 for xxx_convert in $gconvert_preference; do
9818 case $xxx_convert in
9819 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9820 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9823 : then add any others
9824 for xxx_convert in gconvert gcvt sprintf; do
9827 *) xxx_list="$xxx_list $xxx_convert" ;;
9831 case "$d_longdbl$uselongdouble" in
9833 : again, add prefered functions to our list first
9835 for xxx_convert in $gconvert_ld_preference; do
9836 case $xxx_convert in
9837 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9838 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9841 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9842 for xxx_convert in qgcvt sprintf $xxx_list; do
9843 case "$xxx_ld_list" in
9844 $xxx_convert*|*" $xxx_convert"*) ;;
9845 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9848 : if sprintf cannot do long doubles, move it to the end
9849 if test "$d_PRIgldbl" != "$define"; then
9850 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9852 : if no qgcvt, remove it
9853 if test "$d_qgcvt" != "$define"; then
9854 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9857 xxx_list="$xxx_ld_list"
9861 for xxx_convert in $xxx_list; do
9862 echo "Trying $xxx_convert..."
9863 $rm -f try try$_o core
9864 set try -DTRY_$xxx_convert
9865 if eval $compile; then
9866 echo "$xxx_convert() found." >&4
9868 echo "I'll use $xxx_convert to convert floats into a string." >&4
9871 echo "...But $xxx_convert didn't work as I expected."
9875 echo "$xxx_convert NOT found." >&4
9879 if test X$xxx_convert = X; then
9880 echo "*** WHOA THERE!!! ***" >&4
9881 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9885 case "$xxx_convert" in
9886 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9887 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9888 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9889 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9890 "$define$define$define")
9891 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9892 "$define$define$undef")
9893 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9894 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9902 : see if _fwalk exists
9906 : Initialize h_fcntl
9909 : Initialize h_sysfile
9912 : access call always available on UNIX
9916 : locate the flags for 'access()'
9920 $cat >access.c <<EOCP
9921 #include <sys/types.h>
9926 #include <sys/file.h>
9939 : check sys/file.h first, no particular reason here
9940 if $test `./findhdr sys/file.h` && \
9941 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9943 echo "<sys/file.h> defines the *_OK access constants." >&4
9944 elif $test `./findhdr fcntl.h` && \
9945 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9947 echo "<fcntl.h> defines the *_OK access constants." >&4
9948 elif $test `./findhdr unistd.h` && \
9949 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9950 echo "<unistd.h> defines the *_OK access constants." >&4
9952 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9958 : see if accessx exists
9959 set accessx d_accessx
9962 : see if aintl exists
9966 : see if alarm exists
9970 : see if 64bit time functions exists
9972 set ctime64 d_ctime64
9975 set localtime64 d_localtime64
9978 set gmtime64 d_gmtime64
9981 set mktime64 d_mktime64
9984 set difftime64 d_difftime64
9987 set asctime64 d_asctime64
9990 : see if POSIX threads are available
9991 set pthread.h i_pthread
9994 : define a fucntion to check prototypes
9995 $cat > protochk <<EOSH
9998 optimize="$optimize"
10000 prototype="$prototype"
10003 usethreads=$usethreads
10004 i_pthread=$i_pthread
10005 pthread_h_first=$pthread_h_first
10008 $cat >> protochk <<'EOSH'
10013 while test $# -ge 2; do
10015 $define) echo "#include <$2>" >> try.c ;;
10016 literal) echo "$2" >> try.c ;;
10018 # Extra magic for the benefit of systems that need pthread.h
10019 # to be included early to correctly detect threadsafe functions.
10020 # Such functions must guarantee themselves, though, that the usethreads
10021 # and i_pthread have been defined, before calling protochk.
10022 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
10023 echo "#include <pthread.h>" >> try.c
10028 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
10029 cat >> try.c <<'EOCP'
10030 #ifdef CAN_PROTOTYPE
10031 #define _(args) args
10036 echo "$foo" >> try.c
10037 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
10038 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
10044 $eunicefix protochk
10046 : Define hasproto macro for Configure internal use
10047 hasproto='varname=$1; func=$2; shift; shift;
10048 while $test $# -ge 2; do
10050 $define) echo "#include <$2>";;
10054 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
10055 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
10056 echo "$func() prototype found.";
10059 echo "$func() prototype NOT found.";
10066 : see if sys/types.h has to be included
10067 set sys/types.h i_systypes
10070 : see if sys/select.h has to be included
10071 set sys/select.h i_sysselct
10074 : Define hasfield macro for Configure internal use
10075 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10076 while $test $# -ge 2; do
10078 $define) echo "#include <$2>";;
10082 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10084 if eval $compile; then
10093 : see if we should include time.h, sys/time.h, or both
10095 if test "X$timeincl" = X; then
10096 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10097 $echo $n "I'm now running the test program...$c"
10099 #include <sys/types.h>
10104 #ifdef SYSTIMEKERNEL
10107 #include <sys/time.h>
10110 #include <sys/select.h>
10112 #$i_stdlib I_STDLIB
10114 #include <stdlib.h>
10120 struct timeval bar;
10123 struct timezone tzp;
10125 if (foo.tm_sec == foo.tm_sec)
10128 if (bar.tv_sec == bar.tv_sec)
10135 for s_timezone in '-DS_TIMEZONE' ''; do
10137 for s_timeval in '-DS_TIMEVAL' ''; do
10138 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10139 for i_time in '' '-DI_TIME'; do
10140 for i_systime in '-DI_SYSTIME' ''; do
10143 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10144 if eval $compile; then
10145 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10149 $echo $n "Succeeded with $flags$c"
10161 *SYSTIMEKERNEL*) i_systimek="$define"
10162 timeincl=`./findhdr sys/time.h`
10163 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10164 *) i_systimek="$undef";;
10167 *I_TIME*) i_time="$define"
10168 timeincl=`./findhdr time.h`" $timeincl"
10169 echo "We'll include <time.h>." >&4;;
10170 *) i_time="$undef";;
10173 *I_SYSTIME*) i_systime="$define"
10174 timeincl=`./findhdr sys/time.h`" $timeincl"
10175 echo "We'll include <sys/time.h>." >&4;;
10176 *) i_systime="$undef";;
10180 : see if struct tm knows about tm_zone
10181 case "$i_systime$i_time" in
10184 echo "Checking to see if your struct tm has tm_zone field..." >&4
10185 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10193 case "$d_tm_tm_zone" in
10194 "$define") echo "Yes, it does." ;;
10195 *) echo "No, it doesn't." ;;
10197 : see if struct tm knows about tm_gmtoff
10198 case "$i_systime$i_time" in
10201 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10202 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10210 case "$d_tm_tm_gmtoff" in
10211 "$define") echo "Yes, it does." ;;
10212 *) echo "No, it doesn't." ;;
10215 : see if asctime_r exists
10216 set asctime_r d_asctime_r
10218 case "$d_asctime_r" in
10220 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10221 case "$d_asctime_r_proto:$usethreads" in
10222 ":define") d_asctime_r_proto=define
10223 set d_asctime_r_proto asctime_r $hdrs
10227 case "$d_asctime_r_proto" in
10229 case "$asctime_r_proto" in
10230 ''|0) try='char* asctime_r(const struct tm*, char*);'
10231 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SB ;;
10233 case "$asctime_r_proto" in
10234 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10235 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=B_SBI ;;
10237 case "$asctime_r_proto" in
10238 ''|0) try='int asctime_r(const struct tm*, char*);'
10239 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SB ;;
10241 case "$asctime_r_proto" in
10242 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10243 ./protochk "$extern_C $try" $hdrs && asctime_r_proto=I_SBI ;;
10245 case "$asctime_r_proto" in
10246 ''|0) d_asctime_r=undef
10248 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10249 * ) case "$asctime_r_proto" in
10250 REENTRANT_PROTO*) ;;
10251 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10253 echo "Prototype: $try" ;;
10256 *) case "$usethreads" in
10257 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10264 *) asctime_r_proto=0
10268 : see if atolf exists
10272 : see if atoll exists
10276 : Look for GCC-style attribute format
10277 case "$d_attribute_format" in
10280 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10281 $cat >attrib.c <<'EOCP'
10283 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10285 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10286 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10287 echo "Your C compiler doesn't support __attribute__((format))."
10290 echo "Your C compiler supports __attribute__((format))."
10294 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10298 *) val="$d_attribute_format" ;;
10300 set d_attribute_format
10304 : Look for GCC-style attribute format with null format allowed
10305 case "$d_printf_format_null" in
10306 '') case "$d_attribute_format" in
10309 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10310 $cat >attrib.c <<EOCP
10312 #$i_stdlib I_STDLIB
10314 #include <stdlib.h>
10316 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10317 int null_printf (char* pat,...) { return (int)pat; }
10318 int main () { exit(null_printf(NULL)); }
10320 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10321 : run the executable in case it produces a run-time warning
10322 if $run ./attrib >>attrib.out 2>&1; then
10323 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10324 echo "Your C compiler doesn't allow __printf__ format to be null."
10327 echo "Your C compiler allows __printf__ format to be null."
10331 echo "Your C compiler executable failed with __printf__ format null."
10335 echo "Your C compiler fails with __printf__ format null."
10342 *) val="$d_printf_format_null" ;;
10344 set d_printf_format_null
10348 : Look for GCC-style attribute malloc
10349 case "$d_attribute_malloc" in
10352 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10353 $cat >attrib.c <<'EOCP'
10355 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10357 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10358 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10359 echo "Your C compiler doesn't support __attribute__((malloc))."
10362 echo "Your C compiler supports __attribute__((malloc))."
10366 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10370 *) val="$d_attribute_malloc" ;;
10372 set d_attribute_malloc
10376 : Look for GCC-style attribute nonnull
10377 case "$d_attribute_nonnull" in
10380 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10381 $cat >attrib.c <<'EOCP'
10383 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10385 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10386 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10387 echo "Your C compiler doesn't support __attribute__((nonnull))."
10390 echo "Your C compiler supports __attribute__((nonnull))."
10394 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10398 *) val="$d_attribute_nonnull" ;;
10400 set d_attribute_nonnull
10404 : Look for GCC-style attribute noreturn
10405 case "$d_attribute_noreturn" in
10408 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10409 $cat >attrib.c <<'EOCP'
10411 void fall_over_dead( void ) __attribute__((noreturn));
10413 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10414 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10415 echo "Your C compiler doesn't support __attribute__((noreturn))."
10418 echo "Your C compiler supports __attribute__((noreturn))."
10422 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10426 *) val="$d_attribute_noreturn" ;;
10428 set d_attribute_noreturn
10432 : Look for GCC-style attribute pure
10433 case "$d_attribute_pure" in
10436 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10437 $cat >attrib.c <<'EOCP'
10439 int square( int n ) __attribute__((pure));
10441 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10442 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10443 echo "Your C compiler doesn't support __attribute__((pure))."
10446 echo "Your C compiler supports __attribute__((pure))."
10450 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10454 *) val="$d_attribute_pure" ;;
10456 set d_attribute_pure
10460 : Look for GCC-style attribute unused
10461 case "$d_attribute_unused" in
10464 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10465 $cat >attrib.c <<'EOCP'
10467 int do_something( int dummy __attribute__((unused)), int n );
10469 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10470 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10471 echo "Your C compiler doesn't support __attribute__((unused))."
10474 echo "Your C compiler supports __attribute__((unused))."
10478 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10482 *) val="$d_attribute_unused" ;;
10484 set d_attribute_unused
10488 : Look for GCC-style attribute warn_unused_result
10489 case "$d_attribute_warn_unused_result" in
10492 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10493 $cat >attrib.c <<'EOCP'
10495 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10497 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10498 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10499 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10502 echo "Your C compiler supports __attribute__((warn_unused_result))."
10506 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10510 *) val="$d_attribute_warn_unused_result" ;;
10512 set d_attribute_warn_unused_result
10516 : see if bcmp exists
10520 : see if bcopy exists
10524 : see if getpgrp exists
10525 set getpgrp d_getpgrp
10528 case "$d_getpgrp" in
10531 echo "Checking to see which flavor of getpgrp is in use..."
10533 #$i_unistd I_UNISTD
10534 #include <sys/types.h>
10536 # include <unistd.h>
10538 #$i_stdlib I_STDLIB
10540 #include <stdlib.h>
10544 if (getuid() == 0) {
10545 printf("(I see you are running Configure as super-user...)\n");
10548 #ifdef TRY_BSD_PGRP
10549 if (getpgrp(1) == 0)
10558 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10559 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10561 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10562 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10565 echo "I can't seem to compile and run the test program."
10567 xxx="a USG one, i.e. you use getpgrp()."
10569 # SVR4 systems can appear rather BSD-ish.
10570 case "$i_unistd" in
10572 xxx="a BSD one, i.e. you use getpgrp(pid)."
10576 xxx="probably a USG one, i.e. you use getpgrp()."
10581 echo "Assuming your getpgrp is $xxx" >&4
10590 : see if setpgrp exists
10591 set setpgrp d_setpgrp
10594 case "$d_setpgrp" in
10597 echo "Checking to see which flavor of setpgrp is in use..."
10599 #$i_unistd I_UNISTD
10600 #include <sys/types.h>
10602 # include <unistd.h>
10604 #$i_stdlib I_STDLIB
10606 #include <stdlib.h>
10610 if (getuid() == 0) {
10611 printf("(I see you are running Configure as super-user...)\n");
10614 #ifdef TRY_BSD_PGRP
10615 if (-1 == setpgrp(1, 1))
10618 if (setpgrp() != -1)
10624 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10625 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10627 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10628 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10631 echo "(I can't seem to compile and run the test program.)"
10633 xxx="a USG one, i.e. you use setpgrp()."
10635 # SVR4 systems can appear rather BSD-ish.
10636 case "$i_unistd" in
10638 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10642 xxx="probably a USG one, i.e. you use setpgrp()."
10647 echo "Assuming your setpgrp is $xxx" >&4
10656 : Look for GCC-style __builtin_choose_expr
10657 case "$d_builtin_choose_expr" in
10660 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10661 $cat >try.c <<'EOCP'
10662 #include <assert.h>
10663 #include <stdlib.h>
10666 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10669 assert( SYRINX(1) == 2112 );
10670 assert( SYRINX(1) != 5150 );
10671 assert( SYRINX(0) == 5150 );
10672 assert( SYRINX(0) != 2112 );
10673 puts( "All good!" );
10679 if eval $compile && $run ./try; then
10680 echo "Your C compiler supports __builtin_choose_expr."
10683 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10687 *) val="$d_builtin_choose_expr" ;;
10690 set d_builtin_choose_expr
10694 : Look for GCC-style __builtin_expect
10695 case "$d_builtin_expect" in
10698 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10699 $cat >try.c <<'EOCP'
10702 if ( __builtin_expect(n, 0) ) n = 1;
10703 /* Remember shell exit code truth is 0, C truth is non-zero */
10708 if eval $compile && $run ./try; then
10709 echo "Your C compiler supports __builtin_expect."
10712 echo "Your C compiler doesn't seem to understand __builtin_expect."
10716 *) val="$d_builtin_expect" ;;
10719 set d_builtin_expect
10723 : see if bzero exists
10727 : see if stdarg is available
10729 if $test `./findhdr stdarg.h`; then
10730 echo "<stdarg.h> found." >&4
10733 echo "<stdarg.h> NOT found." >&4
10737 : see if varags is available
10739 if $test `./findhdr varargs.h`; then
10740 echo "<varargs.h> found." >&4
10742 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10745 : set up the varargs testing programs
10746 $cat > varargs.c <<EOP
10748 #include <stdarg.h>
10751 #include <varargs.h>
10755 int f(char *p, ...)
10769 p = va_arg(ap, char *);
10775 $cat > varargs <<EOP
10777 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10786 : now check which varargs header should be included
10791 if `./varargs I_STDARG`; then
10793 elif `./varargs I_VARARGS`; then
10798 if `./varargs I_VARARGS`; then
10805 echo "I could not find the definition for va_dcl... You have problems..." >&4
10806 val="$undef"; set i_stdarg; eval $setvar
10807 val="$undef"; set i_varargs; eval $setvar
10812 case "$i_varhdr" in
10814 val="$define"; set i_stdarg; eval $setvar
10815 val="$undef"; set i_varargs; eval $setvar
10818 val="$undef"; set i_stdarg; eval $setvar
10819 val="$define"; set i_varargs; eval $setvar
10822 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10826 : see if the Compiler supports C99 variadic macros
10827 case "$i_stdarg$i_stdlib" in
10829 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10832 #include <stdarg.h>
10834 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10838 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10844 if eval $compile && $run ./try 2>&1 >/dev/null; then
10845 case "`$run ./try`" in
10847 echo "You have C99 variadic macros." >&4
10848 d_c99_variadic_macros="$define"
10851 echo "You don't have functional C99 variadic macros." >&4
10852 d_c99_variadic_macros="$undef"
10856 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10857 d_c99_variadic_macros="$undef"
10862 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10863 d_c99_variadic_macros="$undef"
10867 : see if signal is declared as pointer to function returning int or void
10869 xxx=`./findhdr signal.h`
10870 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10871 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10872 echo "You have int (*signal())() instead of void." >&4
10874 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10875 echo "You have void (*signal())()." >&4
10877 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10878 echo "You have int (*signal())() instead of void." >&4
10880 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10881 echo "You have void (*signal())()." >&4
10884 case "$d_voidsig" in
10886 echo "I can't determine whether signal handler returns void or int..." >&4
10888 rp="What type does your signal handler return?"
10891 v*) val="$define";;
10895 echo "As you already told me, signal handler returns void." >&4
10898 *) echo "As you already told me, signal handler returns int." >&4
10905 case "$d_voidsig" in
10906 "$define") signal_t="void";;
10907 *) signal_t="int";;
10911 : check for ability to cast large floats to 32-bit ints.
10913 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10914 if $test "$intsize" -ge 4; then
10921 #$i_stdlib I_STDLIB
10923 #include <stdlib.h>
10925 #include <sys/types.h>
10926 #include <signal.h>
10927 $signal_t blech(int s) { exit(3); }
10934 signal(SIGFPE, blech);
10936 /* Don't let compiler optimize the test away. Store the number
10937 in a writable string for gcc to pass to sscanf under HP/UX.
10939 sprintf(str, "2147483647");
10940 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10944 /* x86 processors will probably give 0x8000 0000, which is a
10945 sign change. We don't want that. We want to mimic SPARC
10946 behavior here, which is to preserve the sign and give
10949 if (i32 != ($xxx) f)
10955 if eval $compile_ok; then
10959 echo "(I can't seem to compile the test program--assuming it can't)"
10964 echo "Yup, it can."
10967 echo "Nope, it can't."
10974 : check for ability to cast negative floats to unsigned
10976 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10979 #$i_stdlib I_STDLIB
10981 #include <stdlib.h>
10983 #include <sys/types.h>
10984 #include <signal.h>
10985 $signal_t blech(int s) { exit(7); }
10986 $signal_t blech_in_list(int s) { exit(4); }
10987 unsigned long dummy_long(unsigned long p) { return p; }
10988 unsigned int dummy_int(unsigned int p) { return p; }
10989 unsigned short dummy_short(unsigned short p) { return p; }
10993 unsigned long along;
10995 unsigned short ashort;
10999 /* Frustrate gcc-2.7.2's optimizer which failed this test with
11000 a direct f = -123. assignment. gcc-2.8.0 reportedly
11001 optimized the whole file away
11003 /* Store the number in a writable string for gcc to pass to
11004 sscanf under HP/UX.
11006 sprintf(str, "-123");
11007 sscanf(str, "%lf", &f); /* f = -123.; */
11009 signal(SIGFPE, blech);
11010 along = (unsigned long)f;
11011 aint = (unsigned int)f;
11012 ashort = (unsigned short)f;
11013 if (along != (unsigned long)-123)
11015 if (aint != (unsigned int)-123)
11017 if (ashort != (unsigned short)-123)
11019 sprintf(str, "1073741824.");
11020 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
11023 along = (unsigned long)f;
11024 if (along != 0x80000000)
11028 along = (unsigned long)f;
11029 if (along != 0x7fffffff)
11033 along = (unsigned long)f;
11034 if (along != 0x80000001)
11038 signal(SIGFPE, blech_in_list);
11039 sprintf(str, "123.");
11040 sscanf(str, "%lf", &f); /* f = 123.; */
11041 along = dummy_long((unsigned long)f);
11042 aint = dummy_int((unsigned int)f);
11043 ashort = dummy_short((unsigned short)f);
11044 if (along != (unsigned long)123)
11046 if (aint != (unsigned int)123)
11048 if (ashort != (unsigned short)123)
11055 if eval $compile_ok; then
11059 echo "(I can't seem to compile the test program--assuming it can't)"
11062 case "$castflags" in
11064 echo "Yup, it can."
11067 echo "Nope, it can't."
11074 : see if vprintf exists
11076 if set vprintf val -f d_vprintf; eval $csym; $val; then
11077 echo 'vprintf() found.' >&4
11080 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11081 #$i_varargs I_VARARGS
11083 #$i_stdlib I_STDLIB
11084 #$i_unistd I_UNISTD
11087 # include <stdarg.h>
11088 #else /* I_VARARGS */
11089 # include <varargs.h>
11093 # include <unistd.h>
11097 # include <stdlib.h>
11100 #include <stdio.h> /* vsprintf prototype */
11103 void xxx(int n, ...)
11108 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11110 int main() { xxx(1, "foo"); }
11112 #else /* I_VARARGS */
11120 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11122 int main() { xxx("foo"); }
11128 if eval $compile_ok; then
11129 if $run ./try; then
11130 echo "Your vsprintf() returns (int)." >&4
11133 echo "Your vsprintf() returns (char*)." >&4
11137 echo 'I am unable to compile the vsprintf() test program.' >&4
11138 # We shouldn't get here. If we do, assume the standard signature,
11139 # not the old BSD one.
11140 echo 'Guessing that vsprintf() returns (int).' >&4
11144 echo 'vprintf() NOT found.' >&4
11155 : see if chown exists
11159 : see if chroot exists
11160 set chroot d_chroot
11163 : see if chsize exists
11164 set chsize d_chsize
11167 : see if class exists
11171 : see if clearenv exists
11172 set clearenv d_clearenv
11175 : Define hasstruct macro for Configure internal use
11176 hasstruct='varname=$1; struct=$2; shift; shift;
11177 while $test $# -ge 2; do
11179 $define) echo "#include <$2>";;
11183 echo "int main () { struct $struct foo; }" >> try.c;
11185 if eval $compile; then
11194 : see whether socket exists
11198 $echo $n "Hmm... $c" >&4
11199 if set socket val -f d_socket; eval $csym; $val; then
11200 echo "Looks like you have Berkeley networking support." >&4
11202 if set setsockopt val -f; eval $csym; $val; then
11205 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11206 d_oldsock="$define"
11209 if $contains socklib libc.list >/dev/null 2>&1; then
11210 echo "Looks like you have Berkeley networking support." >&4
11212 : we will have to assume that it supports the 4.2 BSD interface
11215 echo "You don't have Berkeley networking in libc$_a..." >&4
11216 if test "X$d_socket" = "X$define"; then
11217 echo "...but you seem to believe that you have sockets." >&4
11219 for net in net socket
11221 if test -f /usr/lib/lib$net$_a; then
11222 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11223 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11224 if $contains socket libc.list >/dev/null 2>&1; then
11229 echo "...but the Wollongong group seems to have hacked it in." >&4
11230 sockethdr="-I/usr/netinclude"
11233 echo "Found Berkeley sockets interface in lib$net." >&4
11234 if $contains setsockopt libc.list >/dev/null 2>&1; then
11237 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11238 d_oldsock="$define"
11244 if test "X$d_socket" != "X$define"; then
11245 echo "or anywhere else I see." >&4
11253 : see if socketpair exists
11254 set socketpair d_sockpair
11259 echo "Checking the availability of certain socket constants..." >&4
11260 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11261 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11263 #include <sys/types.h>
11264 #include <sys/socket.h>
11270 set try; if eval $compile; then
11273 set d_${enum}; eval $setvar
11277 : see if this is a sys/uio.h system
11278 set sys/uio.h i_sysuio
11281 : Check for cmsghdr support
11283 echo "Checking to see if your system supports struct cmsghdr..." >&4
11284 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11286 case "$d_cmsghdr_s" in
11287 "$define") echo "Yes, it does." ;;
11288 *) echo "No, it doesn't." ;;
11292 : check for const keyword
11294 echo 'Checking to see if your C compiler knows about "const"...' >&4
11295 $cat >const.c <<'EOCP'
11296 typedef struct spug { int drokk; } spug;
11300 const spug y = { 0 };
11303 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11305 echo "Yup, it does."
11308 echo "Nope, it doesn't."
11313 : see if copysignl exists
11314 set copysignl d_copysignl
11317 : see if crypt exists
11322 $define) cryptlib='' ;;
11323 *) if set crypt val -f d_crypt; eval $csym; $val; then
11324 echo 'crypt() found.' >&4
11328 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11329 if $test -z "$cryptlib"; then
11330 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11334 if $test -z "$cryptlib"; then
11335 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11339 if $test -z "$cryptlib"; then
11340 cryptlib=`./loc libcrypt$_a "" $libpth`
11344 if $test -z "$cryptlib"; then
11345 echo 'crypt() NOT found.' >&4
11356 : see if this is a crypt.h system
11357 set crypt.h i_crypt
11360 : see if crypt_r exists
11361 set crypt_r d_crypt_r
11363 case "$d_crypt_r" in
11365 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11366 case "$d_crypt_r_proto:$usethreads" in
11367 ":define") d_crypt_r_proto=define
11368 set d_crypt_r_proto crypt_r $hdrs
11372 case "$d_crypt_r_proto" in
11374 case "$crypt_r_proto" in
11375 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11376 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCS ;;
11378 case "$crypt_r_proto" in
11379 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11380 ./protochk "$extern_C $try" $hdrs && crypt_r_proto=B_CCD ;;
11382 case "$crypt_r_proto" in
11383 ''|0) d_crypt_r=undef
11385 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11386 * ) case "$crypt_r_proto" in
11387 REENTRANT_PROTO*) ;;
11388 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11390 echo "Prototype: $try" ;;
11393 *) case "$usethreads" in
11394 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11405 : get csh whereabouts
11407 'csh') val="$undef" ;;
11408 *) val="$define" ;;
11412 : Respect a hint or command line value for full_csh.
11413 case "$full_csh" in
11414 '') full_csh=$csh ;;
11417 : see if ctermid exists
11418 set ctermid d_ctermid
11421 : see if ctermid_r exists
11422 set ctermid_r d_ctermid_r
11424 case "$d_ctermid_r" in
11426 hdrs="$i_systypes sys/types.h define stdio.h "
11427 case "$d_ctermid_r_proto:$usethreads" in
11428 ":define") d_ctermid_r_proto=define
11429 set d_ctermid_r_proto ctermid_r $hdrs
11433 case "$d_ctermid_r_proto" in
11435 case "$ctermid_r_proto" in
11436 ''|0) try='char* ctermid_r(char*);'
11437 ./protochk "$extern_C $try" $hdrs && ctermid_r_proto=B_B ;;
11439 case "$ctermid_r_proto" in
11440 ''|0) d_ctermid_r=undef
11442 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11443 * ) case "$ctermid_r_proto" in
11444 REENTRANT_PROTO*) ;;
11445 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11447 echo "Prototype: $try" ;;
11450 *) case "$usethreads" in
11451 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11458 *) ctermid_r_proto=0
11462 : see if ctime_r exists
11463 set ctime_r d_ctime_r
11465 case "$d_ctime_r" in
11467 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11468 case "$d_ctime_r_proto:$usethreads" in
11469 ":define") d_ctime_r_proto=define
11470 set d_ctime_r_proto ctime_r $hdrs
11474 case "$d_ctime_r_proto" in
11476 case "$ctime_r_proto" in
11477 ''|0) try='char* ctime_r(const time_t*, char*);'
11478 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SB ;;
11480 case "$ctime_r_proto" in
11481 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11482 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=B_SBI ;;
11484 case "$ctime_r_proto" in
11485 ''|0) try='int ctime_r(const time_t*, char*);'
11486 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SB ;;
11488 case "$ctime_r_proto" in
11489 ''|0) try='int ctime_r(const time_t*, char*, int);'
11490 ./protochk "$extern_C $try" $hdrs && ctime_r_proto=I_SBI ;;
11492 case "$ctime_r_proto" in
11493 ''|0) d_ctime_r=undef
11495 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11496 * ) case "$ctime_r_proto" in
11497 REENTRANT_PROTO*) ;;
11498 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11500 echo "Prototype: $try" ;;
11503 *) case "$usethreads" in
11504 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11515 : see if cuserid exists
11516 set cuserid d_cuserid
11519 : see if this is a limits.h system
11520 set limits.h i_limits
11523 : see if this is a float.h system
11524 set float.h i_float
11527 : See if number of significant digits in a double precision number is known
11529 $cat >dbl_dig.c <<EOM
11530 #$i_limits I_LIMITS
11533 #include <limits.h>
11539 printf("Contains DBL_DIG");
11542 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11543 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11544 echo "DBL_DIG found." >&4
11547 echo "DBL_DIG NOT found." >&4
11554 : see if dbm.h is available
11555 : see if dbmclose exists
11556 set dbmclose d_dbmclose
11559 case "$d_dbmclose" in
11569 *) set rpcsvc/dbm.h i_rpcsvcdbm
11574 *) echo "We won't be including <dbm.h>"
11584 : see if prototype for dbminit is available
11586 set d_dbminitproto dbminit $i_dbm dbm.h
11589 : see if difftime exists
11590 set difftime d_difftime
11593 : see if this is a dirent system
11595 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11597 echo "<dirent.h> found." >&4
11600 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11601 echo "<sys/dir.h> found." >&4
11604 xinc=`./findhdr sys/ndir.h`
11606 echo "<dirent.h> NOT found." >&4
11611 : Look for type of directory structure.
11613 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11615 case "$direntrytype" in
11617 case "$i_dirent" in
11618 $define) guess1='struct dirent' ;;
11619 *) guess1='struct direct' ;;
11622 *) guess1="$direntrytype"
11627 'struct dirent') guess2='struct direct' ;;
11628 *) guess2='struct dirent' ;;
11631 if $contains "$guess1" try.c >/dev/null 2>&1; then
11632 direntrytype="$guess1"
11633 echo "Your directory entries are $direntrytype." >&4
11634 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11635 direntrytype="$guess2"
11636 echo "Your directory entries seem to be $direntrytype." >&4
11638 echo "I don't recognize your system's directory entries." >&4
11639 rp="What type is used for directory entries on this system?"
11642 direntrytype="$ans"
11646 : see if the directory entry stores field length
11648 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11649 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11650 echo "Good, your directory entry keeps length information in d_namlen." >&4
11653 echo "Your directory entry does not know about the d_namlen field." >&4
11660 : Look for DIR.dd_fd
11661 case "$i_dirent" in
11663 echo "Checking to see if DIR has a dd_fd member variable" >&4
11665 #$i_stdlib I_STDLIB
11667 #include <stdlib.h>
11669 #include <dirent.h>
11679 if eval $compile; then
11680 echo "Yes, it does."
11683 echo "No, it does not."
11688 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11696 : see if this is an sysdir system
11697 set sys/dir.h i_sysdir
11700 : see if this is an sysndir system
11701 set sys/ndir.h i_sysndir
11706 $cat >dirfd.c <<EOM
11708 #$i_stdlib I_STDLIB
11710 #include <stdlib.h>
11712 #$i_dirent I_DIRENT /**/
11713 #$i_sysdir I_SYS_DIR /**/
11714 #$i_sysndir I_SYS_NDIR /**/
11715 #$i_systypes I_SYS_TYPES /**/
11716 #if defined(I_SYS_TYPES)
11717 #include <sys/types.h>
11719 #if defined(I_DIRENT)
11720 #include <dirent.h>
11721 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11722 #include <sys/dir.h>
11726 #include <sys/ndir.h>
11730 #include <ndir.h> /* may be wrong in the future */
11732 #include <sys/dir.h>
11738 DIR *dirp = opendir(".");
11739 if (dirfd(dirp) >= 0)
11747 if eval $compile; then
11751 $define) echo "dirfd() found." >&4 ;;
11752 *) echo "dirfd() NOT found." >&4 ;;
11758 : see if dlerror exists
11761 set dlerror d_dlerror
11765 : see if dlfcn is available
11766 set dlfcn.h i_dlfcn
11769 : Check what extension to use for shared libs
11774 On a few systems, the dynamically loaded modules that perl generates and uses
11775 will need a different extension than shared libs. The default will probably
11781 *) dflt="$dlext" ;;
11783 rp='What is the extension of dynamically loaded modules'
11792 : Check if dlsym need a leading underscore
11798 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11799 $cat >dyna.c <<'EOM'
11806 #$i_stdlib I_STDLIB
11808 #include <stdlib.h>
11812 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11814 #include <sys/types.h>
11819 extern int fred() ;
11828 int mode = RTLD_LAZY ;
11830 handle = dlopen("./dyna.$dlext", mode) ;
11831 if (handle == NULL) {
11836 symbol = dlsym(handle, "fred") ;
11837 if (symbol == NULL) {
11838 /* try putting a leading underscore */
11839 symbol = dlsym(handle, "_fred") ;
11840 if (symbol == NULL) {
11853 : Call the object file tmp-dyna.o in case dlext=o.
11854 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11855 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11856 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11857 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11860 1) echo "Test program failed using dlopen." >&4
11861 echo "Perhaps you should not use dynamic loading." >&4;;
11862 2) echo "Test program failed using dlsym." >&4
11863 echo "Perhaps you should not use dynamic loading." >&4;;
11864 3) echo "dlsym needs a leading underscore" >&4
11866 4) echo "dlsym doesn't need a leading underscore." >&4;;
11869 echo "I can't compile and run the test program." >&4
11870 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11875 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11880 : see if drand48_r exists
11881 set drand48_r d_drand48_r
11883 case "$d_drand48_r" in
11885 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11886 case "$d_drand48_r_proto:$usethreads" in
11887 ":define") d_drand48_r_proto=define
11888 set d_drand48_r_proto drand48_r $hdrs
11892 case "$d_drand48_r_proto" in
11894 case "$drand48_r_proto" in
11895 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11896 ./protochk "$extern_C $try" $hdrs && drand48_r_proto=I_ST ;;
11898 case "$drand48_r_proto" in
11899 ''|0) d_drand48_r=undef
11901 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11902 * ) case "$drand48_r_proto" in
11903 REENTRANT_PROTO*) ;;
11904 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11906 echo "Prototype: $try" ;;
11909 *) case "$usethreads" in
11910 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11917 *) drand48_r_proto=0
11921 : see if prototype for drand48 is available
11923 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11926 : see if dup2 exists
11930 : see if eaccess exists
11931 set eaccess d_eaccess
11934 : see if endgrent exists
11935 set endgrent d_endgrent
11938 : see if this is an grp system
11944 xxx=`./findhdr grp.h`
11945 $cppstdin $cppflags $cppminus < $xxx >$$.h
11947 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11959 set d_grpasswd; eval $setvar
11963 : see if endgrent_r exists
11964 set endgrent_r d_endgrent_r
11966 case "$d_endgrent_r" in
11968 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11969 case "$d_endgrent_r_proto:$usethreads" in
11970 ":define") d_endgrent_r_proto=define
11971 set d_endgrent_r_proto endgrent_r $hdrs
11975 case "$d_endgrent_r_proto" in
11977 case "$endgrent_r_proto" in
11978 ''|0) try='int endgrent_r(FILE**);'
11979 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=I_H ;;
11981 case "$endgrent_r_proto" in
11982 ''|0) try='void endgrent_r(FILE**);'
11983 ./protochk "$extern_C $try" $hdrs && endgrent_r_proto=V_H ;;
11985 case "$endgrent_r_proto" in
11986 ''|0) d_endgrent_r=undef
11988 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11989 * ) case "$endgrent_r_proto" in
11990 REENTRANT_PROTO*) ;;
11991 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11993 echo "Prototype: $try" ;;
11996 *) case "$usethreads" in
11997 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
12004 *) endgrent_r_proto=0
12008 : see if endhostent exists
12009 set endhostent d_endhent
12012 : see if this is a netdb.h system
12013 set netdb.h i_netdb
12016 : see if endhostent_r exists
12017 set endhostent_r d_endhostent_r
12019 case "$d_endhostent_r" in
12021 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12022 case "$d_endhostent_r_proto:$usethreads" in
12023 ":define") d_endhostent_r_proto=define
12024 set d_endhostent_r_proto endhostent_r $hdrs
12028 case "$d_endhostent_r_proto" in
12030 case "$endhostent_r_proto" in
12031 ''|0) try='int endhostent_r(struct hostent_data*);'
12032 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=I_D ;;
12034 case "$endhostent_r_proto" in
12035 ''|0) try='void endhostent_r(struct hostent_data*);'
12036 ./protochk "$extern_C $try" $hdrs && endhostent_r_proto=V_D ;;
12038 case "$endhostent_r_proto" in
12039 ''|0) d_endhostent_r=undef
12040 endhostent_r_proto=0
12041 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
12042 * ) case "$endhostent_r_proto" in
12043 REENTRANT_PROTO*) ;;
12044 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
12046 echo "Prototype: $try" ;;
12049 *) case "$usethreads" in
12050 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
12052 d_endhostent_r=undef
12053 endhostent_r_proto=0
12057 *) endhostent_r_proto=0
12061 : see if endnetent exists
12062 set endnetent d_endnent
12065 : see if endnetent_r exists
12066 set endnetent_r d_endnetent_r
12068 case "$d_endnetent_r" in
12070 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12071 case "$d_endnetent_r_proto:$usethreads" in
12072 ":define") d_endnetent_r_proto=define
12073 set d_endnetent_r_proto endnetent_r $hdrs
12077 case "$d_endnetent_r_proto" in
12079 case "$endnetent_r_proto" in
12080 ''|0) try='int endnetent_r(struct netent_data*);'
12081 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=I_D ;;
12083 case "$endnetent_r_proto" in
12084 ''|0) try='void endnetent_r(struct netent_data*);'
12085 ./protochk "$extern_C $try" $hdrs && endnetent_r_proto=V_D ;;
12087 case "$endnetent_r_proto" in
12088 ''|0) d_endnetent_r=undef
12089 endnetent_r_proto=0
12090 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12091 * ) case "$endnetent_r_proto" in
12092 REENTRANT_PROTO*) ;;
12093 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12095 echo "Prototype: $try" ;;
12098 *) case "$usethreads" in
12099 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12101 d_endnetent_r=undef
12102 endnetent_r_proto=0
12106 *) endnetent_r_proto=0
12110 : see if endprotoent exists
12111 set endprotoent d_endpent
12114 : see if endprotoent_r exists
12115 set endprotoent_r d_endprotoent_r
12117 case "$d_endprotoent_r" in
12119 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12120 case "$d_endprotoent_r_proto:$usethreads" in
12121 ":define") d_endprotoent_r_proto=define
12122 set d_endprotoent_r_proto endprotoent_r $hdrs
12126 case "$d_endprotoent_r_proto" in
12128 case "$endprotoent_r_proto" in
12129 ''|0) try='int endprotoent_r(struct protoent_data*);'
12130 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=I_D ;;
12132 case "$endprotoent_r_proto" in
12133 ''|0) try='void endprotoent_r(struct protoent_data*);'
12134 ./protochk "$extern_C $try" $hdrs && endprotoent_r_proto=V_D ;;
12136 case "$endprotoent_r_proto" in
12137 ''|0) d_endprotoent_r=undef
12138 endprotoent_r_proto=0
12139 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12140 * ) case "$endprotoent_r_proto" in
12141 REENTRANT_PROTO*) ;;
12142 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12144 echo "Prototype: $try" ;;
12147 *) case "$usethreads" in
12148 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12150 d_endprotoent_r=undef
12151 endprotoent_r_proto=0
12155 *) endprotoent_r_proto=0
12159 : see if endpwent exists
12160 set endpwent d_endpwent
12163 : see if this is a pwd.h system
12169 xxx=`./findhdr pwd.h`
12170 $cppstdin $cppflags $cppminus < $xxx >$$.h
12172 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12180 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12188 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12196 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12204 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12212 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12220 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12228 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12240 set d_pwquota; eval $setvar
12241 set d_pwage; eval $setvar
12242 set d_pwchange; eval $setvar
12243 set d_pwclass; eval $setvar
12244 set d_pwexpire; eval $setvar
12245 set d_pwcomment; eval $setvar
12246 set d_pwgecos; eval $setvar
12247 set d_pwpasswd; eval $setvar
12251 : see if endpwent_r exists
12252 set endpwent_r d_endpwent_r
12254 case "$d_endpwent_r" in
12256 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12257 case "$d_endpwent_r_proto:$usethreads" in
12258 ":define") d_endpwent_r_proto=define
12259 set d_endpwent_r_proto endpwent_r $hdrs
12263 case "$d_endpwent_r_proto" in
12265 case "$endpwent_r_proto" in
12266 ''|0) try='int endpwent_r(FILE**);'
12267 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=I_H ;;
12269 case "$endpwent_r_proto" in
12270 ''|0) try='void endpwent_r(FILE**);'
12271 ./protochk "$extern_C $try" $hdrs && endpwent_r_proto=V_H ;;
12273 case "$endpwent_r_proto" in
12274 ''|0) d_endpwent_r=undef
12276 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12277 * ) case "$endpwent_r_proto" in
12278 REENTRANT_PROTO*) ;;
12279 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12281 echo "Prototype: $try" ;;
12284 *) case "$usethreads" in
12285 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12292 *) endpwent_r_proto=0
12296 : see if endservent exists
12297 set endservent d_endsent
12300 : see if endservent_r exists
12301 set endservent_r d_endservent_r
12303 case "$d_endservent_r" in
12305 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12306 case "$d_endservent_r_proto:$usethreads" in
12307 ":define") d_endservent_r_proto=define
12308 set d_endservent_r_proto endservent_r $hdrs
12312 case "$d_endservent_r_proto" in
12314 case "$endservent_r_proto" in
12315 ''|0) try='int endservent_r(struct servent_data*);'
12316 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=I_D ;;
12318 case "$endservent_r_proto" in
12319 ''|0) try='void endservent_r(struct servent_data*);'
12320 ./protochk "$extern_C $try" $hdrs && endservent_r_proto=V_D ;;
12322 case "$endservent_r_proto" in
12323 ''|0) d_endservent_r=undef
12324 endservent_r_proto=0
12325 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12326 * ) case "$endservent_r_proto" in
12327 REENTRANT_PROTO*) ;;
12328 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12330 echo "Prototype: $try" ;;
12333 *) case "$usethreads" in
12334 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12336 d_endservent_r=undef
12337 endservent_r_proto=0
12341 *) endservent_r_proto=0
12345 : Locate the flags for 'open()'
12348 #include <sys/types.h>
12353 #include <sys/file.h>
12355 #$i_stdlib I_STDLIB
12357 #include <stdlib.h>
12368 : check sys/file.h first to get FREAD on Sun
12369 if $test `./findhdr sys/file.h` && \
12370 set try -DI_SYS_FILE && eval $compile; then
12372 echo "<sys/file.h> defines the O_* constants..." >&4
12373 if $run ./try; then
12374 echo "and you have the 3 argument form of open()." >&4
12377 echo "but not the 3 argument form of open(). Oh, well." >&4
12380 elif $test `./findhdr fcntl.h` && \
12381 set try -DI_FCNTL && eval $compile; then
12383 echo "<fcntl.h> defines the O_* constants..." >&4
12384 if $run ./try; then
12385 echo "and you have the 3 argument form of open()." >&4
12388 echo "but not the 3 argument form of open(). Oh, well." >&4
12393 echo "I can't find the O_* constant definitions! You got problems." >&4
12399 : see if this is a sys/file.h system
12404 : do we need to include sys/file.h ?
12408 if $h_sysfile; then
12410 echo "We'll be including <sys/file.h>." >&4
12413 echo "We won't be including <sys/file.h>." >&4
12423 : see if fcntl.h is there
12428 : see if we can include fcntl.h
12434 echo "We'll be including <fcntl.h>." >&4
12437 if $h_sysfile; then
12438 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12440 echo "We won't be including <fcntl.h>." >&4
12452 : see if fork exists
12456 : see if pipe exists
12460 : check for non-blocking I/O stuff
12461 case "$h_sysfile" in
12462 true) echo "#include <sys/file.h>" > head.c;;
12465 true) echo "#include <fcntl.h>" > head.c;;
12466 *) echo "#include <sys/fcntl.h>" > head.c;;
12471 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12472 case "$o_nonblock" in
12474 $cat head.c > try.c
12475 $cat >>try.c <<EOCP
12477 #$i_stdlib I_STDLIB
12479 #include <stdlib.h>
12487 printf("O_NONBLOCK\n");
12491 printf("O_NDELAY\n");
12495 printf("FNDELAY\n");
12502 if eval $compile_ok; then
12503 o_nonblock=`$run ./try`
12504 case "$o_nonblock" in
12505 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12506 *) echo "Seems like we can use $o_nonblock.";;
12509 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12512 *) echo "Using $hint value $o_nonblock.";;
12517 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12520 case "$d_fork:$d_pipe" in
12522 $cat head.c > try.c
12523 $cat >>try.c <<EOCP
12525 #include <sys/types.h>
12526 #include <signal.h>
12528 #$i_stdlib I_STDLIB
12530 #include <stdlib.h>
12536 #define MY_O_NONBLOCK $o_nonblock
12537 #ifndef errno /* XXX need better Configure test */
12540 #$i_unistd I_UNISTD
12542 #include <unistd.h>
12544 #$i_string I_STRING
12546 #include <string.h>
12548 #include <strings.h>
12550 $signal_t blech(int x) { exit(3); }
12552 $cat >> try.c <<'EOCP'
12560 pipe(pd); /* Down: child -> parent */
12561 pipe(pu); /* Up: parent -> child */
12564 close(pd[1]); /* Parent reads from pd[0] */
12565 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12567 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12572 signal(SIGALRM, blech);
12574 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12576 sprintf(string, "%d\n", ret);
12577 write(2, string, strlen(string));
12580 if (errno == EAGAIN) {
12581 printf("EAGAIN\n");
12586 if (errno == EWOULDBLOCK)
12587 printf("EWOULDBLOCK\n");
12590 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12591 sleep(2); /* Give it time to close our pipe */
12593 ret = read(pd[0], buf, 1); /* Should read EOF */
12595 sprintf(string, "%d\n", ret);
12596 write(4, string, strlen(string));
12600 close(pd[0]); /* We write to pd[1] */
12601 close(pu[1]); /* We read from pu[0] */
12602 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12603 close(pd[1]); /* Pipe pd is now fully closed! */
12604 exit(0); /* Bye bye, thank you for playing! */
12608 if eval $compile_ok; then
12609 echo "$startsh" >mtry
12610 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12612 ./mtry >/dev/null 2>&1
12614 0) eagain=`$cat try.out`;;
12615 1) echo "Could not perform non-blocking setting!";;
12616 2) echo "I did a successful read() for something that was not there!";;
12617 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12618 4) echo "Could not find F_SETFL!";;
12619 *) echo "Something terribly wrong happened during testing.";;
12621 rd_nodata=`$cat try.ret`
12622 echo "A read() system call with no data present returns $rd_nodata."
12623 case "$rd_nodata" in
12626 echo "(That's peculiar, fixing that to be -1.)"
12632 echo "Forcing errno EAGAIN on read() with no data available."
12636 echo "Your read() sets errno to $eagain when no data is available."
12639 status=`$cat try.err`
12641 0) echo "And it correctly returns 0 to signal EOF.";;
12642 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12643 *) echo "However, your read() returns '$status' on EOF??";;
12646 if test "$status" = "$rd_nodata"; then
12647 echo "WARNING: you can't distinguish between EOF and no data!"
12651 echo "I can't compile the test program--assuming errno EAGAIN will do."
12655 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12664 echo "Using $hint value $eagain."
12665 echo "Your read() returns $rd_nodata when no data is present."
12666 case "$d_eofnblk" in
12667 "$define") echo "And you can see EOF because read() returns 0.";;
12668 "$undef") echo "But you can't see EOF status from read() returned value.";;
12670 echo "(Assuming you can't see EOF status from read anyway.)"
12676 $rm_try head.c mtry
12678 : see if _ptr and _cnt from stdio act std
12681 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12682 echo "(Looks like you have stdio.h from BSD.)"
12683 case "$stdio_ptr" in
12684 '') stdio_ptr='((fp)->_p)'
12687 *) ptr_lval=$d_stdio_ptr_lval;;
12689 case "$stdio_cnt" in
12690 '') stdio_cnt='((fp)->_r)'
12693 *) cnt_lval=$d_stdio_cnt_lval;;
12695 case "$stdio_base" in
12696 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12698 case "$stdio_bufsiz" in
12699 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12701 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12702 echo "(Looks like you have stdio.h from Linux.)"
12703 case "$stdio_ptr" in
12704 '') stdio_ptr='((fp)->_IO_read_ptr)'
12707 *) ptr_lval=$d_stdio_ptr_lval;;
12709 case "$stdio_cnt" in
12710 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12713 *) cnt_lval=$d_stdio_cnt_lval;;
12715 case "$stdio_base" in
12716 '') stdio_base='((fp)->_IO_read_base)';;
12718 case "$stdio_bufsiz" in
12719 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12722 case "$stdio_ptr" in
12723 '') stdio_ptr='((fp)->_ptr)'
12726 *) ptr_lval=$d_stdio_ptr_lval;;
12728 case "$stdio_cnt" in
12729 '') stdio_cnt='((fp)->_cnt)'
12732 *) cnt_lval=$d_stdio_cnt_lval;;
12734 case "$stdio_base" in
12735 '') stdio_base='((fp)->_base)';;
12737 case "$stdio_bufsiz" in
12738 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12742 : test whether _ptr and _cnt really work
12743 echo "Checking how std your stdio is..." >&4
12746 #$i_stdlib I_STDLIB
12748 #include <stdlib.h>
12750 #define FILE_ptr(fp) $stdio_ptr
12751 #define FILE_cnt(fp) $stdio_cnt
12753 FILE *fp = fopen("try.c", "r");
12756 18 <= FILE_cnt(fp) &&
12757 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12765 if eval $compile && $to try.c; then
12766 if $run ./try; then
12767 echo "Your stdio acts pretty std."
12770 echo "Your stdio isn't very std."
12773 echo "Your stdio doesn't appear very std."
12777 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12778 # direct buffer manipulation no longer works. The Configure tests
12779 # should be changed to correctly detect this, but until then,
12780 # the following check should at least let perl compile and run.
12781 # (This quick fix should be updated before 5.8.1.)
12782 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12783 # A. Dougherty, June 3, 2002.
12784 case "$d_gnulibc" in
12786 case "$gnulibc_version" in
12790 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12799 : Can _ptr be used as an lvalue?
12800 case "$d_stdstdio$ptr_lval" in
12801 $define$define) val=$define ;;
12804 set d_stdio_ptr_lval
12807 : Can _cnt be used as an lvalue?
12808 case "$d_stdstdio$cnt_lval" in
12809 $define$define) val=$define ;;
12812 set d_stdio_cnt_lval
12816 : test whether setting _ptr sets _cnt as a side effect
12817 d_stdio_ptr_lval_sets_cnt="$undef"
12818 d_stdio_ptr_lval_nochange_cnt="$undef"
12819 case "$d_stdio_ptr_lval$d_stdstdio" in
12821 echo "Checking to see what happens if we set the stdio ptr..." >&4
12824 /* Can we scream? */
12825 /* Eat dust sed :-) */
12826 /* In the buffer space, no one can hear you scream. */
12827 #$i_stdlib I_STDLIB
12829 #include <stdlib.h>
12831 #define FILE_ptr(fp) $stdio_ptr
12832 #define FILE_cnt(fp) $stdio_cnt
12833 #include <sys/types.h>
12835 FILE *fp = fopen("try.c", "r");
12840 puts("Fail even to read");
12843 c = getc(fp); /* Read away the first # */
12845 puts("Fail even to read");
12849 18 <= FILE_cnt(fp) &&
12850 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12852 puts("Fail even to read");
12855 ptr = (char*) FILE_ptr(fp);
12856 cnt = (size_t)FILE_cnt(fp);
12858 FILE_ptr(fp) += 42;
12860 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12861 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12864 if (FILE_cnt(fp) <= 20) {
12865 printf ("Fail (<20 chars to test)");
12868 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12869 puts("Fail compare");
12872 if (cnt == FILE_cnt(fp)) {
12873 puts("Pass_unchanged");
12876 if (FILE_cnt(fp) == (cnt - 42)) {
12877 puts("Pass_changed");
12880 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12886 if eval $compile && $to try.c; then
12887 case `$run ./try` in
12889 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12890 d_stdio_ptr_lval_sets_cnt="$define" ;;
12892 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12893 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12895 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12897 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12900 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12906 : see if _base is also standard
12908 case "$d_stdstdio" in
12912 #$i_stdlib I_STDLIB
12914 #include <stdlib.h>
12916 #define FILE_base(fp) $stdio_base
12917 #define FILE_bufsiz(fp) $stdio_bufsiz
12919 FILE *fp = fopen("try.c", "r");
12922 19 <= FILE_bufsiz(fp) &&
12923 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12930 if eval $compile && $to try.c; then
12931 if $run ./try; then
12932 echo "And its _base field acts std."
12935 echo "But its _base field isn't std."
12938 echo "However, it seems to be lacking the _base field."
12946 : see if fast_stdio exists
12948 case "$d_stdstdio:$d_stdio_ptr_lval" in
12950 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12952 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12963 : see if fchdir exists
12964 set fchdir d_fchdir
12967 : see if fchmod exists
12968 set fchmod d_fchmod
12971 : see if fchown exists
12972 set fchown d_fchown
12975 : see if this is an fcntl system
12979 : See if fcntl-based locking works.
12982 #$i_stdlib I_STDLIB
12984 #include <stdlib.h>
12986 #include <unistd.h>
12988 #include <signal.h>
12989 $signal_t blech(int x) { exit(3); }
12991 #if defined(F_SETLK) && defined(F_SETLKW)
12992 struct flock flock;
12994 fd = open("try.c", O_RDONLY);
12995 flock.l_type = F_RDLCK;
12996 flock.l_whence = SEEK_SET;
12997 flock.l_start = flock.l_len = 0;
12998 signal(SIGALRM, blech);
13000 retval = fcntl(fd, F_SETLK, &flock);
13002 (retval < 0 ? exit(2) : exit(0));
13008 echo "Checking if fcntl-based file locking works... "
13012 if eval $compile_ok; then
13013 if $run ./try; then
13014 echo "Yes, it seems to work."
13017 echo "Nope, it didn't work."
13022 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
13023 *** This is (almost) impossible.
13024 *** If your NFS lock daemons are not feeling well, something like
13025 *** this may happen, please investigate. Cannot continue, aborting.
13033 echo "I'm unable to compile the test program, so I'll assume not."
13038 echo "Nope, since you don't even have fcntl()."
13041 set d_fcntl_can_lock
13045 : check for fd_set items
13048 Checking to see how well your C compiler handles fd_set and friends ...
13051 #$i_stdlib I_STDLIB
13053 #include <stdlib.h>
13055 #$i_systime I_SYS_TIME
13056 #$i_sysselct I_SYS_SELECT
13057 #$d_socket HAS_SOCKET
13058 #include <sys/types.h>
13060 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13063 #include <sys/time.h>
13065 #ifdef I_SYS_SELECT
13066 #include <sys/select.h>
13075 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13083 if eval $compile; then
13084 d_fds_bits="$define"
13086 echo "Well, your system knows about the normal fd_set typedef..." >&4
13087 if $run ./try; then
13088 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13089 d_fd_macros="$define"
13092 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13094 d_fd_macros="$undef"
13098 Hmm, your compiler has some difficulty with fd_set. Checking further...
13101 if eval $compile; then
13102 d_fds_bits="$undef"
13104 echo "Well, your system has some sort of fd_set available..." >&4
13105 if $run ./try; then
13106 echo "and you have the normal fd_set macros." >&4
13107 d_fd_macros="$define"
13110 but not the normal fd_set macros! Gross! More work for me...
13112 d_fd_macros="$undef"
13115 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13117 d_fds_bits="$undef"
13118 d_fd_macros="$undef"
13123 : see if fgetpos exists
13124 set fgetpos d_fgetpos
13127 : see if finite exists
13128 set finite d_finite
13131 : see if finitel exists
13132 set finitel d_finitel
13135 : see if flock exists
13139 : see if prototype for flock is available
13141 set d_flockproto flock $i_sysfile sys/file.h
13144 : see if fp_class exists
13145 set fp_class d_fp_class
13148 : see if pathconf exists
13149 set pathconf d_pathconf
13152 : see if fpathconf exists
13153 set fpathconf d_fpathconf
13156 : see if fpclass exists
13157 set fpclass d_fpclass
13160 : see if fpclassify exists
13161 set fpclassify d_fpclassify
13164 : see if fpclassl exists
13165 set fpclassl d_fpclassl
13168 : check for fpos64_t
13170 echo "Checking to see if you have fpos64_t..." >&4
13173 int main() { fpos64_t x = 7; }
13176 if eval $compile; then
13178 echo "You have fpos64_t."
13181 echo "You do not have fpos64_t."
13182 case "$fpossize" in
13183 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13190 : see if frexpl exists
13191 set frexpl d_frexpl
13194 : see if this is a sys/param system
13195 set sys/param.h i_sysparam
13198 : see if this is a sys/mount.h system
13199 set sys/mount.h i_sysmount
13202 : Check for fs_data_s
13204 echo "Checking to see if your system supports struct fs_data..." >&4
13205 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13207 case "$d_fs_data_s" in
13208 "$define") echo "Yes, it does." ;;
13209 *) echo "No, it doesn't." ;;
13212 : see if fseeko exists
13213 set fseeko d_fseeko
13215 case "$longsize" in
13216 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13219 : see if fsetpos exists
13220 set fsetpos d_fsetpos
13223 : see if fstatfs exists
13224 set fstatfs d_fstatfs
13227 : see if statvfs exists
13228 set statvfs d_statvfs
13231 : see if fstatvfs exists
13232 set fstatvfs d_fstatvfs
13236 : see if fsync exists
13240 : see if ftello exists
13241 set ftello d_ftello
13243 case "$longsize" in
13244 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13247 : check for a working futimes
13250 echo "Checking if you have a working futimes()" >&4
13253 #include <sys/time.h>
13260 fd = open ("try.c", O_RDWR);
13261 if (-1 == fd) exit (1);
13262 rv = futimes (fd, NULL);
13263 exit (rv == -1 ? errno : 0);
13267 if eval $compile; then
13271 0) echo "Yes, you have" >&4
13272 d_futimes="$define"
13274 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13278 echo "No, it does not (probably harmless)" >&4
13282 : see if getcwd exists
13283 set getcwd d_getcwd
13286 : see if getespwnam exists
13287 set getespwnam d_getespwnam
13290 : see if getfsstat exists
13291 set getfsstat d_getfsstat
13294 : see if getgrent exists
13295 set getgrent d_getgrent
13298 : see if getgrent_r exists
13299 set getgrent_r d_getgrent_r
13301 case "$d_getgrent_r" in
13303 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13304 case "$d_getgrent_r_proto:$usethreads" in
13305 ":define") d_getgrent_r_proto=define
13306 set d_getgrent_r_proto getgrent_r $hdrs
13310 case "$d_getgrent_r_proto" in
13312 case "$getgrent_r_proto" in
13313 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13314 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13316 case "$getgrent_r_proto" in
13317 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13318 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13320 case "$getgrent_r_proto" in
13321 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13322 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBW ;;
13324 case "$getgrent_r_proto" in
13325 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13326 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=S_SBI ;;
13328 case "$getgrent_r_proto" in
13329 ''|0) try='int getgrent_r(struct group*, char*, int);'
13330 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBI ;;
13332 case "$getgrent_r_proto" in
13333 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13334 ./protochk "$extern_C $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13336 case "$getgrent_r_proto" in
13337 ''|0) d_getgrent_r=undef
13339 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13340 * ) case "$getgrent_r_proto" in
13341 REENTRANT_PROTO*) ;;
13342 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13344 echo "Prototype: $try" ;;
13347 *) case "$usethreads" in
13348 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13355 *) getgrent_r_proto=0
13359 : see if getgrgid_r exists
13360 set getgrgid_r d_getgrgid_r
13362 case "$d_getgrgid_r" in
13364 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13365 case "$d_getgrgid_r_proto:$usethreads" in
13366 ":define") d_getgrgid_r_proto=define
13367 set d_getgrgid_r_proto getgrgid_r $hdrs
13371 case "$d_getgrgid_r_proto" in
13373 case "$getgrgid_r_proto" in
13374 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13375 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13377 case "$getgrgid_r_proto" in
13378 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13379 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13381 case "$getgrgid_r_proto" in
13382 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13383 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13385 case "$getgrgid_r_proto" in
13386 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13387 ./protochk "$extern_C $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13389 case "$getgrgid_r_proto" in
13390 ''|0) d_getgrgid_r=undef
13392 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13393 * ) case "$getgrgid_r_proto" in
13394 REENTRANT_PROTO*) ;;
13395 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13397 echo "Prototype: $try" ;;
13400 *) case "$usethreads" in
13401 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13408 *) getgrgid_r_proto=0
13412 : see if getgrnam_r exists
13413 set getgrnam_r d_getgrnam_r
13415 case "$d_getgrnam_r" in
13417 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13418 case "$d_getgrnam_r_proto:$usethreads" in
13419 ":define") d_getgrnam_r_proto=define
13420 set d_getgrnam_r_proto getgrnam_r $hdrs
13424 case "$d_getgrnam_r_proto" in
13426 case "$getgrnam_r_proto" in
13427 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13428 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13430 case "$getgrnam_r_proto" in
13431 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13432 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13434 case "$getgrnam_r_proto" in
13435 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13436 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13438 case "$getgrnam_r_proto" in
13439 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13440 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13442 case "$getgrnam_r_proto" in
13443 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13444 ./protochk "$extern_C $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13446 case "$getgrnam_r_proto" in
13447 ''|0) d_getgrnam_r=undef
13449 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13450 * ) case "$getgrnam_r_proto" in
13451 REENTRANT_PROTO*) ;;
13452 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13454 echo "Prototype: $try" ;;
13457 *) case "$usethreads" in
13458 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13465 *) getgrnam_r_proto=0
13469 : see if gethostbyaddr exists
13470 set gethostbyaddr d_gethbyaddr
13473 : see if gethostbyname exists
13474 set gethostbyname d_gethbyname
13477 : see if gethostent exists
13478 set gethostent d_gethent
13481 : see how we will look up host name
13484 if set gethostname val -f d_gethname; eval $csym; $val; then
13485 echo 'gethostname() found.' >&4
13486 d_gethname="$define"
13489 if set uname val -f d_uname; eval $csym; $val; then
13492 uname() was found, but you're running xenix, and older versions of xenix
13493 have a broken uname(). If you don't really know whether your xenix is old
13494 enough to have a broken system call, use the default answer.
13499 "$define") dflt=n;;
13501 rp='Is your uname() broken?'
13504 n*) d_uname="$define"; call=uname;;
13507 echo 'uname() found.' >&4
13514 case "$d_gethname" in
13515 '') d_gethname="$undef";;
13518 '') d_uname="$undef";;
13520 case "$d_uname$d_gethname" in
13525 Every now and then someone has a $call() that lies about the hostname
13526 but can't be fixed for political or economic reasons. If you wish, I can
13527 pretend $call() isn't there and maybe compute hostname at run-time
13528 thanks to the '$phostname' command.
13531 rp="Shall I ignore $call() from now on?"
13534 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13537 case "$phostname" in
13538 '') aphostname='';;
13539 *) case "$aphostname" in
13541 *) set X $phostname
13545 file=`./loc $file $file $pth`
13546 aphostname=`echo $file $*`
13551 case "$d_uname$d_gethname" in
13554 case "$phostname" in
13556 echo "There will be no way for $package to get your hostname." >&4;;
13558 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13562 case "$d_phostname" in
13563 '') d_phostname="$undef";;
13566 : see if gethostbyaddr_r exists
13567 set gethostbyaddr_r d_gethostbyaddr_r
13569 case "$d_gethostbyaddr_r" in
13571 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13572 case "$d_gethostbyaddr_r_proto:$usethreads" in
13573 ":define") d_gethostbyaddr_r_proto=define
13574 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13578 case "$d_gethostbyaddr_r_proto" in
13580 case "$gethostbyaddr_r_proto" in
13581 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13582 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13584 case "$gethostbyaddr_r_proto" in
13585 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13586 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13588 case "$gethostbyaddr_r_proto" in
13589 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13590 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13592 case "$gethostbyaddr_r_proto" in
13593 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13594 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13596 case "$gethostbyaddr_r_proto" in
13597 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13598 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13600 case "$gethostbyaddr_r_proto" in
13601 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13602 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13604 case "$gethostbyaddr_r_proto" in
13605 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13606 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13608 case "$gethostbyaddr_r_proto" in
13609 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13610 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13612 case "$gethostbyaddr_r_proto" in
13613 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13614 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13616 case "$gethostbyaddr_r_proto" in
13617 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13618 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13620 case "$gethostbyaddr_r_proto" in
13621 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13622 ./protochk "$extern_C $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13624 case "$gethostbyaddr_r_proto" in
13625 ''|0) d_gethostbyaddr_r=undef
13626 gethostbyaddr_r_proto=0
13627 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13628 * ) case "$gethostbyaddr_r_proto" in
13629 REENTRANT_PROTO*) ;;
13630 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13632 echo "Prototype: $try" ;;
13635 *) case "$usethreads" in
13636 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13638 d_gethostbyaddr_r=undef
13639 gethostbyaddr_r_proto=0
13643 *) gethostbyaddr_r_proto=0
13647 : see if gethostbyname_r exists
13648 set gethostbyname_r d_gethostbyname_r
13650 case "$d_gethostbyname_r" in
13652 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13653 case "$d_gethostbyname_r_proto:$usethreads" in
13654 ":define") d_gethostbyname_r_proto=define
13655 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13659 case "$d_gethostbyname_r_proto" in
13661 case "$gethostbyname_r_proto" in
13662 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13663 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13665 case "$gethostbyname_r_proto" in
13666 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13667 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13669 case "$gethostbyname_r_proto" in
13670 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13671 ./protochk "$extern_C $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13673 case "$gethostbyname_r_proto" in
13674 ''|0) d_gethostbyname_r=undef
13675 gethostbyname_r_proto=0
13676 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13677 * ) case "$gethostbyname_r_proto" in
13678 REENTRANT_PROTO*) ;;
13679 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13681 echo "Prototype: $try" ;;
13684 *) case "$usethreads" in
13685 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13687 d_gethostbyname_r=undef
13688 gethostbyname_r_proto=0
13692 *) gethostbyname_r_proto=0
13696 : see if gethostent_r exists
13697 set gethostent_r d_gethostent_r
13699 case "$d_gethostent_r" in
13701 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13702 case "$d_gethostent_r_proto:$usethreads" in
13703 ":define") d_gethostent_r_proto=define
13704 set d_gethostent_r_proto gethostent_r $hdrs
13708 case "$d_gethostent_r_proto" in
13710 case "$gethostent_r_proto" in
13711 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13712 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13714 case "$gethostent_r_proto" in
13715 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13716 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13718 case "$gethostent_r_proto" in
13719 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13720 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13722 case "$gethostent_r_proto" in
13723 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13724 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=S_SBI ;;
13726 case "$gethostent_r_proto" in
13727 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13728 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SBI ;;
13730 case "$gethostent_r_proto" in
13731 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13732 ./protochk "$extern_C $try" $hdrs && gethostent_r_proto=I_SD ;;
13734 case "$gethostent_r_proto" in
13735 ''|0) d_gethostent_r=undef
13736 gethostent_r_proto=0
13737 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13738 * ) case "$gethostent_r_proto" in
13739 REENTRANT_PROTO*) ;;
13740 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13742 echo "Prototype: $try" ;;
13745 *) case "$usethreads" in
13746 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13748 d_gethostent_r=undef
13749 gethostent_r_proto=0
13753 *) gethostent_r_proto=0
13757 : see if prototypes for various gethostxxx netdb.h functions are available
13759 set d_gethostprotos gethostent $i_netdb netdb.h
13762 : see if getitimer exists
13763 set getitimer d_getitimer
13766 : see if getlogin exists
13767 set getlogin d_getlogin
13770 : see if getlogin_r exists
13771 set getlogin_r d_getlogin_r
13773 case "$d_getlogin_r" in
13775 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13776 case "$d_getlogin_r_proto:$usethreads" in
13777 ":define") d_getlogin_r_proto=define
13778 set d_getlogin_r_proto getlogin_r $hdrs
13782 case "$d_getlogin_r_proto" in
13784 case "$getlogin_r_proto" in
13785 ''|0) try='int getlogin_r(char*, size_t);'
13786 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BW ;;
13788 case "$getlogin_r_proto" in
13789 ''|0) try='int getlogin_r(char*, int);'
13790 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=I_BI ;;
13792 case "$getlogin_r_proto" in
13793 ''|0) try='char* getlogin_r(char*, size_t);'
13794 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BW ;;
13796 case "$getlogin_r_proto" in
13797 ''|0) try='char* getlogin_r(char*, int);'
13798 ./protochk "$extern_C $try" $hdrs && getlogin_r_proto=B_BI ;;
13800 case "$getlogin_r_proto" in
13801 ''|0) d_getlogin_r=undef
13803 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13804 * ) case "$getlogin_r_proto" in
13805 REENTRANT_PROTO*) ;;
13806 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13808 echo "Prototype: $try" ;;
13811 *) case "$usethreads" in
13812 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13819 *) getlogin_r_proto=0
13823 : see if getmnt exists
13824 set getmnt d_getmnt
13827 : see if getmntent exists
13828 set getmntent d_getmntent
13831 : see if getnetbyaddr exists
13832 set getnetbyaddr d_getnbyaddr
13835 : see if getnetbyname exists
13836 set getnetbyname d_getnbyname
13839 : see if getnetent exists
13840 set getnetent d_getnent
13843 : see if getnetbyaddr_r exists
13844 set getnetbyaddr_r d_getnetbyaddr_r
13846 case "$d_getnetbyaddr_r" in
13848 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13849 case "$d_getnetbyaddr_r_proto:$usethreads" in
13850 ":define") d_getnetbyaddr_r_proto=define
13851 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13855 case "$d_getnetbyaddr_r_proto" in
13857 case "$getnetbyaddr_r_proto" in
13858 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13859 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13861 case "$getnetbyaddr_r_proto" in
13862 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13863 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13865 case "$getnetbyaddr_r_proto" in
13866 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13867 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13869 case "$getnetbyaddr_r_proto" in
13870 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13871 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13873 case "$getnetbyaddr_r_proto" in
13874 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13875 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13877 case "$getnetbyaddr_r_proto" in
13878 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13879 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13881 case "$getnetbyaddr_r_proto" in
13882 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13883 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13885 case "$getnetbyaddr_r_proto" in
13886 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13887 ./protochk "$extern_C $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13889 case "$getnetbyaddr_r_proto" in
13890 ''|0) d_getnetbyaddr_r=undef
13891 getnetbyaddr_r_proto=0
13892 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13893 * ) case "$getnetbyaddr_r_proto" in
13894 REENTRANT_PROTO*) ;;
13895 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13897 echo "Prototype: $try" ;;
13900 *) case "$usethreads" in
13901 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13903 d_getnetbyaddr_r=undef
13904 getnetbyaddr_r_proto=0
13908 *) getnetbyaddr_r_proto=0
13912 : see if getnetbyname_r exists
13913 set getnetbyname_r d_getnetbyname_r
13915 case "$d_getnetbyname_r" in
13917 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13918 case "$d_getnetbyname_r_proto:$usethreads" in
13919 ":define") d_getnetbyname_r_proto=define
13920 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13924 case "$d_getnetbyname_r_proto" in
13926 case "$getnetbyname_r_proto" in
13927 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13928 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13930 case "$getnetbyname_r_proto" in
13931 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13932 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13934 case "$getnetbyname_r_proto" in
13935 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13936 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13938 case "$getnetbyname_r_proto" in
13939 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13940 ./protochk "$extern_C $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13942 case "$getnetbyname_r_proto" in
13943 ''|0) d_getnetbyname_r=undef
13944 getnetbyname_r_proto=0
13945 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13946 * ) case "$getnetbyname_r_proto" in
13947 REENTRANT_PROTO*) ;;
13948 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13950 echo "Prototype: $try" ;;
13953 *) case "$usethreads" in
13954 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13956 d_getnetbyname_r=undef
13957 getnetbyname_r_proto=0
13961 *) getnetbyname_r_proto=0
13965 : see if getnetent_r exists
13966 set getnetent_r d_getnetent_r
13968 case "$d_getnetent_r" in
13970 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13971 case "$d_getnetent_r_proto:$usethreads" in
13972 ":define") d_getnetent_r_proto=define
13973 set d_getnetent_r_proto getnetent_r $hdrs
13977 case "$d_getnetent_r_proto" in
13979 case "$getnetent_r_proto" in
13980 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13981 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13983 case "$getnetent_r_proto" in
13984 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13985 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13987 case "$getnetent_r_proto" in
13988 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13989 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13991 case "$getnetent_r_proto" in
13992 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13993 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=S_SBI ;;
13995 case "$getnetent_r_proto" in
13996 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13997 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SBI ;;
13999 case "$getnetent_r_proto" in
14000 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
14001 ./protochk "$extern_C $try" $hdrs && getnetent_r_proto=I_SD ;;
14003 case "$getnetent_r_proto" in
14004 ''|0) d_getnetent_r=undef
14005 getnetent_r_proto=0
14006 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
14007 * ) case "$getnetent_r_proto" in
14008 REENTRANT_PROTO*) ;;
14009 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
14011 echo "Prototype: $try" ;;
14014 *) case "$usethreads" in
14015 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
14017 d_getnetent_r=undef
14018 getnetent_r_proto=0
14022 *) getnetent_r_proto=0
14026 : see if prototypes for various getnetxxx netdb.h functions are available
14028 set d_getnetprotos getnetent $i_netdb netdb.h
14031 : see if getpagesize exists
14032 set getpagesize d_getpagsz
14035 : Optional checks for getprotobyname and getprotobynumber
14037 : see if getprotobyname exists
14038 set getprotobyname d_getpbyname
14041 : see if getprotobynumber exists
14042 set getprotobynumber d_getpbynumber
14045 : see if getprotoent exists
14046 set getprotoent d_getpent
14049 : see if getpgid exists
14050 set getpgid d_getpgid
14053 : see if getpgrp2 exists
14054 set getpgrp2 d_getpgrp2
14057 : see if getppid exists
14058 set getppid d_getppid
14061 : see if getpriority exists
14062 set getpriority d_getprior
14065 : see if getprotobyname_r exists
14066 set getprotobyname_r d_getprotobyname_r
14068 case "$d_getprotobyname_r" in
14070 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14071 case "$d_getprotobyname_r_proto:$usethreads" in
14072 ":define") d_getprotobyname_r_proto=define
14073 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14077 case "$d_getprotobyname_r_proto" in
14079 case "$getprotobyname_r_proto" in
14080 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14081 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14083 case "$getprotobyname_r_proto" in
14084 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14085 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14087 case "$getprotobyname_r_proto" in
14088 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14089 ./protochk "$extern_C $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14091 case "$getprotobyname_r_proto" in
14092 ''|0) d_getprotobyname_r=undef
14093 getprotobyname_r_proto=0
14094 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14095 * ) case "$getprotobyname_r_proto" in
14096 REENTRANT_PROTO*) ;;
14097 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14099 echo "Prototype: $try" ;;
14102 *) case "$usethreads" in
14103 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14105 d_getprotobyname_r=undef
14106 getprotobyname_r_proto=0
14110 *) getprotobyname_r_proto=0
14114 : see if getprotobynumber_r exists
14115 set getprotobynumber_r d_getprotobynumber_r
14117 case "$d_getprotobynumber_r" in
14119 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14120 case "$d_getprotobynumber_r_proto:$usethreads" in
14121 ":define") d_getprotobynumber_r_proto=define
14122 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14126 case "$d_getprotobynumber_r_proto" in
14128 case "$getprotobynumber_r_proto" in
14129 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14130 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14132 case "$getprotobynumber_r_proto" in
14133 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14134 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14136 case "$getprotobynumber_r_proto" in
14137 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14138 ./protochk "$extern_C $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14140 case "$getprotobynumber_r_proto" in
14141 ''|0) d_getprotobynumber_r=undef
14142 getprotobynumber_r_proto=0
14143 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14144 * ) case "$getprotobynumber_r_proto" in
14145 REENTRANT_PROTO*) ;;
14146 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14148 echo "Prototype: $try" ;;
14151 *) case "$usethreads" in
14152 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14154 d_getprotobynumber_r=undef
14155 getprotobynumber_r_proto=0
14159 *) getprotobynumber_r_proto=0
14163 : see if getprotoent_r exists
14164 set getprotoent_r d_getprotoent_r
14166 case "$d_getprotoent_r" in
14168 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14169 case "$d_getprotoent_r_proto:$usethreads" in
14170 ":define") d_getprotoent_r_proto=define
14171 set d_getprotoent_r_proto getprotoent_r $hdrs
14175 case "$d_getprotoent_r_proto" in
14177 case "$getprotoent_r_proto" in
14178 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14179 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14181 case "$getprotoent_r_proto" in
14182 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14183 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14185 case "$getprotoent_r_proto" in
14186 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14187 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14189 case "$getprotoent_r_proto" in
14190 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14191 ./protochk "$extern_C $try" $hdrs && getprotoent_r_proto=I_SD ;;
14193 case "$getprotoent_r_proto" in
14194 ''|0) d_getprotoent_r=undef
14195 getprotoent_r_proto=0
14196 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14197 * ) case "$getprotoent_r_proto" in
14198 REENTRANT_PROTO*) ;;
14199 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14201 echo "Prototype: $try" ;;
14204 *) case "$usethreads" in
14205 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14207 d_getprotoent_r=undef
14208 getprotoent_r_proto=0
14212 *) getprotoent_r_proto=0
14216 : see if prototypes for various getprotoxxx netdb.h functions are available
14218 set d_getprotoprotos getprotoent $i_netdb netdb.h
14221 : see if getprpwnam exists
14222 set getprpwnam d_getprpwnam
14225 : see if getpwent exists
14226 set getpwent d_getpwent
14229 : see if getpwent_r exists
14230 set getpwent_r d_getpwent_r
14232 case "$d_getpwent_r" in
14234 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14235 case "$d_getpwent_r_proto:$usethreads" in
14236 ":define") d_getpwent_r_proto=define
14237 set d_getpwent_r_proto getpwent_r $hdrs
14241 case "$d_getpwent_r_proto" in
14243 case "$getpwent_r_proto" in
14244 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14245 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14247 case "$getpwent_r_proto" in
14248 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14249 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14251 case "$getpwent_r_proto" in
14252 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14253 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBW ;;
14255 case "$getpwent_r_proto" in
14256 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14257 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=S_SBI ;;
14259 case "$getpwent_r_proto" in
14260 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14261 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBI ;;
14263 case "$getpwent_r_proto" in
14264 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14265 ./protochk "$extern_C $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14267 case "$getpwent_r_proto" in
14268 ''|0) d_getpwent_r=undef
14270 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14271 * ) case "$getpwent_r_proto" in
14272 REENTRANT_PROTO*) ;;
14273 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14275 echo "Prototype: $try" ;;
14278 *) case "$usethreads" in
14279 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14286 *) getpwent_r_proto=0
14290 : see if getpwnam_r exists
14291 set getpwnam_r d_getpwnam_r
14293 case "$d_getpwnam_r" in
14295 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14296 case "$d_getpwnam_r_proto:$usethreads" in
14297 ":define") d_getpwnam_r_proto=define
14298 set d_getpwnam_r_proto getpwnam_r $hdrs
14302 case "$d_getpwnam_r_proto" in
14304 case "$getpwnam_r_proto" in
14305 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14306 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14308 case "$getpwnam_r_proto" in
14309 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14310 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14312 case "$getpwnam_r_proto" in
14313 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14314 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14316 case "$getpwnam_r_proto" in
14317 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14318 ./protochk "$extern_C $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14320 case "$getpwnam_r_proto" in
14321 ''|0) d_getpwnam_r=undef
14323 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14324 * ) case "$getpwnam_r_proto" in
14325 REENTRANT_PROTO*) ;;
14326 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14328 echo "Prototype: $try" ;;
14331 *) case "$usethreads" in
14332 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14339 *) getpwnam_r_proto=0
14343 : see if getpwuid_r exists
14344 set getpwuid_r d_getpwuid_r
14346 case "$d_getpwuid_r" in
14348 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14349 case "$d_getpwuid_r_proto:$usethreads" in
14350 ":define") d_getpwuid_r_proto=define
14351 set d_getpwuid_r_proto getpwuid_r $hdrs
14355 case "$d_getpwuid_r_proto" in
14357 case "$getpwuid_r_proto" in
14358 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14359 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14361 case "$getpwuid_r_proto" in
14362 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14363 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14365 case "$getpwuid_r_proto" in
14366 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14367 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14369 case "$getpwuid_r_proto" in
14370 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14371 ./protochk "$extern_C $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14373 case "$getpwuid_r_proto" in
14374 ''|0) d_getpwuid_r=undef
14376 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14377 * ) case "$getpwuid_r_proto" in
14378 REENTRANT_PROTO*) ;;
14379 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14381 echo "Prototype: $try" ;;
14384 *) case "$usethreads" in
14385 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14392 *) getpwuid_r_proto=0
14396 : Optional checks for getsbyname and getsbyport
14398 : see if getservbyname exists
14399 set getservbyname d_getsbyname
14402 : see if getservbyport exists
14403 set getservbyport d_getsbyport
14406 : see if getservent exists
14407 set getservent d_getsent
14410 : see if getservbyname_r exists
14411 set getservbyname_r d_getservbyname_r
14413 case "$d_getservbyname_r" in
14415 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14416 case "$d_getservbyname_r_proto:$usethreads" in
14417 ":define") d_getservbyname_r_proto=define
14418 set d_getservbyname_r_proto getservbyname_r $hdrs
14422 case "$d_getservbyname_r_proto" in
14424 case "$getservbyname_r_proto" in
14425 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14426 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14428 case "$getservbyname_r_proto" in
14429 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14430 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14432 case "$getservbyname_r_proto" in
14433 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14434 ./protochk "$extern_C $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14436 case "$getservbyname_r_proto" in
14437 ''|0) d_getservbyname_r=undef
14438 getservbyname_r_proto=0
14439 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14440 * ) case "$getservbyname_r_proto" in
14441 REENTRANT_PROTO*) ;;
14442 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14444 echo "Prototype: $try" ;;
14447 *) case "$usethreads" in
14448 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14450 d_getservbyname_r=undef
14451 getservbyname_r_proto=0
14455 *) getservbyname_r_proto=0
14459 : see if getservbyport_r exists
14460 set getservbyport_r d_getservbyport_r
14462 case "$d_getservbyport_r" in
14464 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14465 case "$d_getservbyport_r_proto:$usethreads" in
14466 ":define") d_getservbyport_r_proto=define
14467 set d_getservbyport_r_proto getservbyport_r $hdrs
14471 case "$d_getservbyport_r_proto" in
14473 case "$getservbyport_r_proto" in
14474 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14475 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14477 case "$getservbyport_r_proto" in
14478 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14479 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14481 case "$getservbyport_r_proto" in
14482 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14483 ./protochk "$extern_C $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14485 case "$getservbyport_r_proto" in
14486 ''|0) d_getservbyport_r=undef
14487 getservbyport_r_proto=0
14488 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14489 * ) case "$getservbyport_r_proto" in
14490 REENTRANT_PROTO*) ;;
14491 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14493 echo "Prototype: $try" ;;
14496 *) case "$usethreads" in
14497 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14499 d_getservbyport_r=undef
14500 getservbyport_r_proto=0
14504 *) getservbyport_r_proto=0
14508 : see if getservent_r exists
14509 set getservent_r d_getservent_r
14511 case "$d_getservent_r" in
14513 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14514 case "$d_getservent_r_proto:$usethreads" in
14515 ":define") d_getservent_r_proto=define
14516 set d_getservent_r_proto getservent_r $hdrs
14520 case "$d_getservent_r_proto" in
14522 case "$getservent_r_proto" in
14523 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14524 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBWR ;;
14526 case "$getservent_r_proto" in
14527 ''|0) try='int getservent_r(struct servent*, char*, int);'
14528 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SBI ;;
14530 case "$getservent_r_proto" in
14531 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14532 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=S_SBI ;;
14534 case "$getservent_r_proto" in
14535 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14536 ./protochk "$extern_C $try" $hdrs && getservent_r_proto=I_SD ;;
14538 case "$getservent_r_proto" in
14539 ''|0) d_getservent_r=undef
14540 getservent_r_proto=0
14541 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14542 * ) case "$getservent_r_proto" in
14543 REENTRANT_PROTO*) ;;
14544 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14546 echo "Prototype: $try" ;;
14549 *) case "$usethreads" in
14550 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14552 d_getservent_r=undef
14553 getservent_r_proto=0
14557 *) getservent_r_proto=0
14561 : see if prototypes for various getservxxx netdb.h functions are available
14563 set d_getservprotos getservent $i_netdb netdb.h
14566 : see if getspnam exists
14567 set getspnam d_getspnam
14570 : see if this is a shadow.h system
14571 set shadow.h i_shadow
14574 : see if getspnam_r exists
14575 set getspnam_r d_getspnam_r
14577 case "$d_getspnam_r" in
14579 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14580 case "$d_getspnam_r_proto:$usethreads" in
14581 ":define") d_getspnam_r_proto=define
14582 set d_getspnam_r_proto getspnam_r $hdrs
14586 case "$d_getspnam_r_proto" in
14588 case "$getspnam_r_proto" in
14589 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14590 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14592 case "$getspnam_r_proto" in
14593 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14594 ./protochk "$extern_C $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14596 case "$getspnam_r_proto" in
14597 ''|0) d_getspnam_r=undef
14599 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14600 * ) case "$getspnam_r_proto" in
14601 REENTRANT_PROTO*) ;;
14602 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14604 echo "Prototype: $try" ;;
14607 *) case "$usethreads" in
14608 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14615 *) getspnam_r_proto=0
14619 : see if gettimeofday or ftime exists
14620 set gettimeofday d_gettimeod
14622 case "$d_gettimeod" in
14628 val="$undef"; set d_ftime; eval $setvar
14631 case "$d_gettimeod$d_ftime" in
14634 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14638 : see if gmtime_r exists
14639 set gmtime_r d_gmtime_r
14641 case "$d_gmtime_r" in
14643 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14644 case "$d_gmtime_r_proto:$usethreads" in
14645 ":define") d_gmtime_r_proto=define
14646 set d_gmtime_r_proto gmtime_r $hdrs
14650 case "$d_gmtime_r_proto" in
14652 case "$gmtime_r_proto" in
14653 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14654 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=S_TS ;;
14656 case "$gmtime_r_proto" in
14657 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14658 ./protochk "$extern_C $try" $hdrs && gmtime_r_proto=I_TS ;;
14660 case "$gmtime_r_proto" in
14661 ''|0) d_gmtime_r=undef
14663 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14664 * ) case "$gmtime_r_proto" in
14665 REENTRANT_PROTO*) ;;
14666 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14668 echo "Prototype: $try" ;;
14671 *) case "$usethreads" in
14672 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14679 *) gmtime_r_proto=0
14683 : see if hasmntopt exists
14684 set hasmntopt d_hasmntopt
14687 : see if this is a netinet/in.h or sys/in.h system
14688 set netinet/in.h i_niin sys/in.h i_sysin
14691 : see if arpa/inet.h has to be included
14692 set arpa/inet.h i_arpainet
14695 : see if htonl --and friends-- exists
14700 : Maybe they are macros.
14703 $cat >htonl.c <<EOM
14705 #include <sys/types.h>
14706 #$i_niin I_NETINET_IN
14708 #$i_arpainet I_ARPA_INET
14709 #ifdef I_NETINET_IN
14710 #include <netinet/in.h>
14713 #include <sys/in.h>
14716 #include <arpa/inet.h>
14719 printf("Defined as a macro.");
14722 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14723 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14725 echo "But it seems to be defined as a macro." >&4
14733 : see if ilogbl exists
14734 set ilogbl d_ilogbl
14739 if set index val -f; eval $csym; $val; then
14740 if set strchr val -f d_strchr; eval $csym; $val; then
14741 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14744 echo "strchr() found." >&4
14748 echo "index() found." >&4
14753 echo "index() found." >&4
14756 if set strchr val -f d_strchr; eval $csym; $val; then
14759 echo "strchr() found." >&4
14761 echo "No index() or strchr() found!" >&4
14766 set d_strchr; eval $setvar
14768 set d_index; eval $setvar
14770 : check whether inet_aton exists
14771 set inet_aton d_inetaton
14776 $cat >isascii.c <<EOCP
14779 #$i_stdlib I_STDLIB
14781 #include <stdlib.h>
14792 if eval $compile; then
14793 echo "isascii() found." >&4
14796 echo "isascii() NOT found." >&4
14803 : see if isfinite exists
14804 set isfinite d_isfinite
14807 : see if isinf exists
14811 : see if isnan exists
14815 : see if isnanl exists
14816 set isnanl d_isnanl
14819 : see if killpg exists
14820 set killpg d_killpg
14823 : see if lchown exists
14825 $cat > try.c <<'EOCP'
14826 /* System header to define __stub macros and hopefully few prototypes,
14827 which can conflict with char lchown(); below. */
14828 #include <assert.h>
14829 /* Override any gcc2 internal prototype to avoid an error. */
14830 /* We use char because int might match the return type of a gcc2
14831 builtin and then its argument prototype would still apply. */
14834 /* The GNU C library defines this for functions which it implements
14835 to always fail with ENOSYS. Some functions are actually named
14836 something starting with __ and the normal name is an alias. */
14837 #if defined (__stub_lchown) || defined (__stub___lchown)
14845 if eval $compile; then
14846 $echo "lchown() found." >&4
14849 $echo "lchown() NOT found." >&4
14855 : See if number of significant digits in a double precision number is known
14857 $cat >ldbl_dig.c <<EOM
14858 #$i_limits I_LIMITS
14861 #include <limits.h>
14867 printf("Contains LDBL_DIG");
14870 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14871 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14872 echo "LDBL_DIG found." >&4
14875 echo "LDBL_DIG NOT found." >&4
14882 : see if this is a math.h system
14886 : check to see if math.h defines _LIB_VERSION
14887 d_libm_lib_version="$undef"
14891 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14893 #include <unistd.h>
14895 int main (int argc, char *argv[])
14897 printf ("%d\n", _LIB_VERSION);
14902 if eval $compile; then
14904 echo "Yes, it does ($foo)" >&4
14905 d_libm_lib_version="$define"
14907 echo "No, it does not (probably harmless)" >&4
14914 : see if link exists
14918 : see if localtime_r exists
14919 set localtime_r d_localtime_r
14921 case "$d_localtime_r" in
14923 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14924 case "$d_localtime_r_proto:$usethreads" in
14925 ":define") d_localtime_r_proto=define
14926 set d_localtime_r_proto localtime_r $hdrs
14930 case "$d_localtime_r_proto" in
14932 case "$localtime_r_proto" in
14933 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14934 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=S_TS ;;
14936 case "$localtime_r_proto" in
14937 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14938 ./protochk "$extern_C $try" $hdrs && localtime_r_proto=I_TS ;;
14940 case "$localtime_r_proto" in
14941 ''|0) d_localtime_r=undef
14942 localtime_r_proto=0
14943 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14944 * ) case "$localtime_r_proto" in
14945 REENTRANT_PROTO*) ;;
14946 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14948 echo "Prototype: $try" ;;
14951 *) case "$usethreads" in
14952 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14954 d_localtime_r=undef
14955 localtime_r_proto=0
14959 *) localtime_r_proto=0
14963 : see if localtime_r calls tzset
14964 case "$localtime_r_proto" in
14967 /* Does our libc's localtime_r call tzset ?
14968 * return 0 if so, 1 otherwise.
14970 #$i_systypes I_SYS_TYPES
14971 #$i_unistd I_UNISTD
14973 #$i_stdlib I_STDLIB
14974 #$i_string I_STRING
14975 #$i_malloc I_MALLOC
14977 # include <sys/types.h>
14980 # include <unistd.h>
14986 #include <stdlib.h>
14989 # include <string.h>
14991 # include <strings.h>
14994 # include <malloc.h>
14998 time_t t = time(0L);
14999 char w_tz[]="TZ" "=GMT+5",
15000 e_tz[]="TZ" "=GMT-5",
15001 *tz_e = (char*)malloc(16),
15002 *tz_w = (char*)malloc(16);
15003 struct tm tm_e, tm_w;
15004 memset(&tm_e,'\0',sizeof(struct tm));
15005 memset(&tm_w,'\0',sizeof(struct tm));
15010 localtime_r(&t, &tm_e);
15013 localtime_r(&t, &tm_w);
15015 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
15021 if eval $compile; then
15022 if $run ./try; then
15023 d_localtime_r_needs_tzset=undef;
15025 d_localtime_r_needs_tzset=define;
15028 d_localtime_r_needs_tzset=undef;
15032 d_localtime_r_needs_tzset=undef;
15037 : see if localeconv exists
15038 set localeconv d_locconv
15041 : see if lockf exists
15045 : see if prototype for lseek is available
15047 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
15050 : see if lstat exists
15054 : see if madvise exists
15055 set madvise d_madvise
15058 : see if malloc_size exists
15059 set malloc_size d_malloc_size
15062 : see if malloc_size_good exists
15063 set malloc_good_size d_malloc_good_size
15066 : see if mblen exists
15070 : see if mbstowcs exists
15071 set mbstowcs d_mbstowcs
15074 : see if mbtowc exists
15075 set mbtowc d_mbtowc
15078 : see if memchr exists
15079 set memchr d_memchr
15082 : see if memcmp exists
15083 set memcmp d_memcmp
15086 : see if memcpy exists
15087 set memcpy d_memcpy
15090 : see if memmove exists
15091 set memmove d_memmove
15094 : see if memset exists
15095 set memset d_memset
15098 : see if mkdir exists
15102 : see if mkdtemp exists
15103 set mkdtemp d_mkdtemp
15106 : see if mkfifo exists
15107 set mkfifo d_mkfifo
15110 : see if mkstemp exists
15111 set mkstemp d_mkstemp
15114 : see if mkstemps exists
15115 set mkstemps d_mkstemps
15118 : see if mktime exists
15119 set mktime d_mktime
15122 : see if this is a sys/mman.h system
15123 set sys/mman.h i_sysmman
15126 : see if mmap exists
15129 : see what shmat returns
15130 : default to something harmless
15132 case "$i_sysmman$d_mmap" in
15134 $cat >mmap.c <<'END'
15135 #include <sys/mman.h>
15138 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15143 echo "and it returns ($mmaptype)." >&4
15149 : see if sqrtl exists
15153 : see if scalbnl exists
15154 set scalbnl d_scalbnl
15157 : see if modfl exists
15161 : see if prototype for modfl is available
15163 set d_modflproto modfl $i_math math.h
15166 d_modfl_pow32_bug="$undef"
15168 case "$d_longdbl$d_modfl" in
15171 Checking to see whether your modfl() is okay for large values...
15177 if $test "X$d_modflproto" != "X$define"; then
15178 $cat >>try.c <<EOCP
15179 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15180 long double modfl (long double, long double *);
15183 $cat >>try.c <<EOCP
15185 long double nv = 4294967303.15;
15191 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15195 case "$osname:$gccversion" in
15196 aix:) saveccflags="$ccflags"
15197 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15200 if eval $compile; then
15203 *" 4294967303.150000 1.150000 4294967302.000000")
15204 echo >&4 "Your modfl() is broken for large values."
15205 d_modfl_pow32_bug="$define"
15207 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15211 *" 4294967303.150000 0.150000 4294967303.000000")
15212 echo >&4 "Your modfl() seems okay for large values."
15214 *) echo >&4 "I don't understand your modfl() at all."
15220 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15223 case "$osname:$gccversion" in
15224 aix:) ccflags="$saveccflags" ;; # restore
15229 if $test "$uselongdouble" = "$define"; then
15231 if $test "$d_sqrtl" != "$define"; then
15232 message="$message sqrtl"
15234 if $test "$d_modfl" != "$define"; then
15235 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15236 echo "You have both aintl and copysignl, so I can emulate modfl."
15238 message="$message modfl"
15241 if $test "$d_frexpl" != "$define"; then
15242 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15243 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15245 message="$message frexpl"
15249 if $test "$message" != ""; then
15252 *** You requested the use of long doubles but you do not seem to have
15253 *** the following mathematical functions needed for long double support:
15255 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15256 *** Cannot continue, aborting.
15264 : see if mprotect exists
15265 set mprotect d_mprotect
15268 : see if msgctl exists
15269 set msgctl d_msgctl
15272 : see if msgget exists
15273 set msgget d_msgget
15276 : see if msgsnd exists
15277 set msgsnd d_msgsnd
15280 : see if msgrcv exists
15281 set msgrcv d_msgrcv
15284 : see how much of the 'msg*(2)' library is present.
15287 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15288 *"$undef"*) h_msg=false;;
15292 case "`ipcs 2>&1`" in
15293 "SVID messages"*"not configured"*)
15294 echo "Your $osname does not have the msg*(2) configured." >&4
15297 set msgctl d_msgctl
15299 set msgget d_msgget
15301 set msgsnd d_msgsnd
15303 set msgrcv d_msgrcv
15309 : we could also check for sys/ipc.h ...
15310 if $h_msg && $test `./findhdr sys/msg.h`; then
15311 echo "You have the full msg*(2) library." >&4
15314 echo "You don't have the full msg*(2) library." >&4
15320 : Check for msghdr_s
15322 echo "Checking to see if your system supports struct msghdr..." >&4
15323 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15325 case "$d_msghdr_s" in
15326 "$define") echo "Yes, it does." ;;
15327 *) echo "No, it doesn't." ;;
15331 : see if msync exists
15335 : see if munmap exists
15336 set munmap d_munmap
15339 : see if nice exists
15343 : see if this is a langinfo.h system
15344 set langinfo.h i_langinfo
15347 : see if nl_langinfo exists
15348 set nl_langinfo d_nl_langinfo
15351 : check for volatile keyword
15353 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15354 $cat >try.c <<'EOCP'
15357 typedef struct _goo_struct goo_struct;
15358 goo_struct * volatile goo = ((goo_struct *)0);
15359 struct _goo_struct {
15364 typedef unsigned short foo_t;
15365 char *volatile foo;
15367 volatile foo_t blech;
15371 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15373 echo "Yup, it does."
15376 echo "Nope, it doesn't."
15382 : Check basic sizes
15384 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15386 case "$use64bitint:$d_quad:$quadtype" in
15389 uvtype="$uquadtype"
15394 uvtype="unsigned long"
15400 case "$uselongdouble:$d_longdbl" in
15402 nvtype="long double"
15403 nvsize=$longdblsize
15410 $echo "(IV will be "$ivtype", $ivsize bytes)"
15411 $echo "(UV will be "$uvtype", $uvsize bytes)"
15412 $echo "(NV will be "$nvtype", $nvsize bytes)"
15415 #$i_inttypes I_INTTYPES
15417 #include <inttypes.h>
15422 int8_t i = INT8_MAX;
15423 uint8_t u = UINT8_MAX;
15424 printf("int8_t\n");
15427 int16_t i = INT16_MAX;
15428 uint16_t i = UINT16_MAX;
15429 printf("int16_t\n");
15432 int32_t i = INT32_MAX;
15433 uint32_t u = UINT32_MAX;
15434 printf("int32_t\n");
15439 i8type="signed char"
15440 u8type="unsigned char"
15445 '') case "$shortsize" in
15447 u16type="unsigned short"
15455 '') set try -DINT16
15456 if eval $compile; then
15457 case "`$run ./try`" in
15469 '') if $test $shortsize -ge 2; then
15471 u16type="unsigned short"
15479 '') case "$longsize" in
15481 u32type="unsigned long"
15485 *) case "$intsize" in
15487 u32type="unsigned int"
15497 '') set try -DINT32
15498 if eval $compile; then
15499 case "`$run ./try`" in
15511 '') if $test $intsize -ge 4; then
15513 u32type="unsigned int"
15521 '') case "$d_quad:$quadtype" in
15523 i64type="$quadtype"
15524 u64type="$uquadtype"
15532 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15533 : volatile so that the compiler has to store it out to memory.
15534 if test X"$d_volatile" = X"$define"; then
15539 #$i_stdlib I_STDLIB
15541 #include <stdlib.h>
15543 #include <sys/types.h>
15544 #include <signal.h>
15546 $volatile int bletched = 0;
15547 $signal_t blech(int s) { bletched = 1; }
15552 int n = 8 * $uvsize;
15555 signal(SIGFPE, blech);
15558 for (i = 0; i < n; i++) {
15559 u = u << 1 | ($uvtype)1;
15561 if (($uvtype)d != u)
15565 d = ($nvtype)(u - 1);
15566 if (($uvtype)d != (u - 1))
15573 printf("%d\n", ((i == n) ? -n : i));
15579 d_nv_preserves_uv="$undef"
15580 if eval $compile; then
15581 nv_preserves_uv_bits="`$run ./try`"
15583 case "$nv_preserves_uv_bits" in
15585 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15586 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15587 d_nv_preserves_uv="$define"
15589 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15590 d_nv_preserves_uv="$undef" ;;
15591 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15592 nv_preserves_uv_bits="0" ;;
15596 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15597 : volatile so that the compiler has to store it out to memory.
15598 if test X"$d_volatile" = X"$define"; then
15604 typedef $nvtype NV;
15611 while(count < 256) {
15612 $volatile NV up = value + 1.0;
15613 $volatile NV negated = -value;
15614 $volatile NV down = negated - 1.0;
15615 $volatile NV got_up = up - value;
15616 int up_good = got_up == 1.0;
15617 int got_down = down - negated;
15618 int down_good = got_down == -1.0;
15620 if (down_good != up_good) {
15622 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15623 up_good, (double) got_up, down_good, (double) got_down,
15624 count, (double) value);
15631 fputs("256.0", stdout);
15634 fputs("2.0", stdout);
15640 fputs("*", stdout);
15646 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15647 count, (double) value);
15653 nv_overflows_integers_at='0'
15654 if eval $compile; then
15660 The largest integer your NVs can preserve is equal to $xxx
15662 nv_overflows_integers_at="$xxx"
15665 Cannot determine the largest integer value your NVs can hold, unexpected output
15672 Cannot determine the largest integer value your NVs can hold
15679 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15680 : volatile so that the compiler has to store it out to memory.
15681 if test X"$d_volatile" = X"$define"; then
15686 #$i_stdlib I_STDLIB
15688 #include <stdlib.h>
15690 #$i_string I_STRING
15692 # include <string.h>
15694 # include <strings.h>
15696 #include <sys/types.h>
15697 #include <signal.h>
15699 $volatile int bletched = 0;
15700 $signal_t blech(int s) { bletched = 1; }
15703 int checkit($nvtype d, char *where) {
15704 unsigned char *p = (char *)&d;
15705 unsigned char *end = p + sizeof(d);
15715 printf("No - %s: 0x", where);
15717 printf ("%02X", *p++);
15722 int main(int argc, char **argv) {
15725 fail += checkit(d, "0.0");
15727 /* The compiler shouldn't be assuming that bletched is 0 */
15730 fail += checkit(d, "bleched");
15733 signal(SIGFPE, blech);
15736 /* Paranoia - the compiler should have no way of knowing that ANSI says
15737 that argv[argc] will always be NULL. Actually, if it did assume this it
15738 would be buggy, as this is C and main() can be called from elsewhere in
15740 d = argv[argc] ? 1 : 0;
15743 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15746 fail += checkit(d, "ternary");
15748 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15751 printf("No - memset doesn't give 0.0\n");
15752 /* This might just blow up: */
15753 printf("(gives %g)\n", d);
15759 printf("No - something bleched\n");
15764 printf("No - %d fail(s)\n", fail);
15773 d_nv_zero_is_allbits_zero="$undef"
15774 if eval $compile; then
15780 0.0 is represented as all bits zero in memory
15782 d_nv_zero_is_allbits_zero="$define"
15785 0.0 is not represented as all bits zero in memory
15787 d_nv_zero_is_allbits_zero="$undef"
15792 0.0 is not represented as all bits zero in memory
15794 d_nv_zero_is_allbits_zero="$undef"
15800 : check for off64_t
15802 echo "Checking to see if you have off64_t..." >&4
15804 #include <sys/types.h>
15805 #include <unistd.h>
15806 int main() { off64_t x = 7; }
15809 if eval $compile; then
15811 echo "You have off64_t."
15814 echo "You do not have off64_t."
15815 case "$lseeksize" in
15816 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15823 : how to create joinable pthreads
15824 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15826 echo "Checking what constant to use for creating joinable pthreads..." >&4
15827 $cat >try.c <<'EOCP'
15828 #include <pthread.h>
15830 int detachstate = JOINABLE;
15833 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15834 if eval $compile; then
15835 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15836 val="$undef" # Yes, undef.
15837 set d_old_pthread_create_joinable
15840 set old_pthread_create_joinable
15843 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15844 if eval $compile; then
15845 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15847 set d_old_pthread_create_joinable
15849 val=PTHREAD_CREATE_UNDETACHED
15850 set old_pthread_create_joinable
15853 set try -DJOINABLE=__UNDETACHED
15854 if eval $compile; then
15855 echo "You seem to use __UNDETACHED." >&4
15857 set d_old_pthread_create_joinable
15860 set old_pthread_create_joinable
15863 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15865 set d_old_pthread_create_joinable
15868 set old_pthread_create_joinable
15875 d_old_pthread_create_joinable="$undef"
15876 old_pthread_create_joinable=""
15879 : see if pause exists
15883 : see if poll exists
15887 : see if readlink exists
15888 set readlink d_readlink
15891 : Check if exe is symlink to abs path of executing program
15895 case "$d_readlink" in
15897 if $issymlink /proc/self/exe ; then
15898 $ls -l /proc/self/exe > reflect
15899 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15900 echo "You have Linux-like /proc/self/exe."
15901 procselfexe='"/proc/self/exe"'
15905 if $issymlink /proc/curproc/file ; then
15906 $ls -l /proc/curproc/file > reflect
15907 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15908 echo "You have BSD-like /proc/curproc/file."
15909 procselfexe='"/proc/curproc/file"'
15919 : backward compatibility for d_hvfork
15920 if test X$d_hvfork != X; then
15921 d_vfork="$d_hvfork"
15924 : see if there is a vfork
15929 d_pseudofork=$undef
15931 : Ok, but do we want to use it. vfork is reportedly unreliable in
15932 : perl on Solaris 2.x, and probably elsewhere.
15936 case "$usevfork" in
15942 Perl can only use a vfork() that doesn't suffer from strict
15943 restrictions on calling functions or modifying global data in
15944 the child. For example, glibc-2.1 contains such a vfork()
15945 that is unsuitable. If your system provides a proper fork()
15946 call, chances are that you do NOT want perl to use vfork().
15949 rp="Do you still want to use vfork()?"
15954 echo "Ok, we won't use vfork()."
15963 $define) usevfork='true';;
15964 *) usevfork='false';;
15967 : see whether the pthread_atfork exists
15969 #include <pthread.h>
15972 #ifdef PTHREAD_ATFORK
15973 pthread_atfork(NULL,NULL,NULL);
15978 : see if pthread_atfork exists
15979 set try -DPTHREAD_ATFORK
15980 if eval $compile; then
15985 case "$usethreads" in
15988 $define) echo 'pthread_atfork found.' >&4 ;;
15989 *) echo 'pthread_atfork NOT found.' >&4 ;;
15992 set d_pthread_atfork
15995 : see if pthread_attr_setscope exists
15996 set pthread_attr_setscope d_pthread_attr_setscope
15999 : see whether the various POSIXish _yields exist
16001 #include <pthread.h>
16007 #ifdef PTHREAD_YIELD
16010 #ifdef PTHREAD_YIELD_NULL
16011 pthread_yield(NULL);
16017 : see if sched_yield exists
16018 set try -DSCHED_YIELD
16019 if eval $compile; then
16021 sched_yield='sched_yield()'
16025 case "$usethreads" in
16028 $define) echo 'sched_yield() found.' >&4 ;;
16029 *) echo 'sched_yield() NOT found.' >&4 ;;
16035 : see if pthread_yield exists
16036 set try -DPTHREAD_YIELD
16037 if eval $compile; then
16039 case "$sched_yield" in
16040 '') sched_yield='pthread_yield()' ;;
16043 set try -DPTHREAD_YIELD_NULL
16044 if eval $compile; then
16046 case "$sched_yield" in
16047 '') sched_yield='pthread_yield(NULL)' ;;
16053 case "$usethreads" in
16056 $define) echo 'pthread_yield() found.' >&4 ;;
16057 *) echo 'pthread_yield() NOT found.' >&4 ;;
16061 set d_pthread_yield
16063 case "$sched_yield" in
16064 '') sched_yield=undef ;;
16068 : see if random_r exists
16069 set random_r d_random_r
16071 case "$d_random_r" in
16073 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16074 case "$d_random_r_proto:$usethreads" in
16075 ":define") d_random_r_proto=define
16076 set d_random_r_proto random_r $hdrs
16080 case "$d_random_r_proto" in
16082 case "$random_r_proto" in
16083 ''|0) try='int random_r(int*, struct random_data*);'
16084 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_iS ;;
16086 case "$random_r_proto" in
16087 ''|0) try='int random_r(long*, struct random_data*);'
16088 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_lS ;;
16090 case "$random_r_proto" in
16091 ''|0) try='int random_r(struct random_data*, int32_t*);'
16092 ./protochk "$extern_C $try" $hdrs && random_r_proto=I_St ;;
16094 case "$random_r_proto" in
16095 ''|0) d_random_r=undef
16097 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16098 * ) case "$random_r_proto" in
16099 REENTRANT_PROTO*) ;;
16100 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16102 echo "Prototype: $try" ;;
16105 *) case "$usethreads" in
16106 define) echo "random_r has no prototype, not using it." >&4 ;;
16113 *) random_r_proto=0
16117 : see if readdir and friends exist
16118 set readdir d_readdir
16120 set seekdir d_seekdir
16122 set telldir d_telldir
16124 set rewinddir d_rewinddir
16127 : see if readdir64_r exists
16128 set readdir64_r d_readdir64_r
16130 case "$d_readdir64_r" in
16132 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16133 case "$d_readdir64_r_proto:$usethreads" in
16134 ":define") d_readdir64_r_proto=define
16135 set d_readdir64_r_proto readdir64_r $hdrs
16139 case "$d_readdir64_r_proto" in
16141 case "$readdir64_r_proto" in
16142 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16143 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TSR ;;
16145 case "$readdir64_r_proto" in
16146 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16147 ./protochk "$extern_C $try" $hdrs && readdir64_r_proto=I_TS ;;
16149 case "$readdir64_r_proto" in
16150 ''|0) d_readdir64_r=undef
16151 readdir64_r_proto=0
16152 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16153 * ) case "$readdir64_r_proto" in
16154 REENTRANT_PROTO*) ;;
16155 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16157 echo "Prototype: $try" ;;
16160 *) case "$usethreads" in
16161 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16163 d_readdir64_r=undef
16164 readdir64_r_proto=0
16168 *) readdir64_r_proto=0
16172 : see if readdir_r exists
16173 set readdir_r d_readdir_r
16175 case "$d_readdir_r" in
16177 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16178 case "$d_readdir_r_proto:$usethreads" in
16179 ":define") d_readdir_r_proto=define
16180 set d_readdir_r_proto readdir_r $hdrs
16184 case "$d_readdir_r_proto" in
16186 case "$readdir_r_proto" in
16187 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16188 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TSR ;;
16190 case "$readdir_r_proto" in
16191 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16192 ./protochk "$extern_C $try" $hdrs && readdir_r_proto=I_TS ;;
16194 case "$readdir_r_proto" in
16195 ''|0) d_readdir_r=undef
16197 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16198 * ) case "$readdir_r_proto" in
16199 REENTRANT_PROTO*) ;;
16200 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16202 echo "Prototype: $try" ;;
16205 *) case "$usethreads" in
16206 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16213 *) readdir_r_proto=0
16217 : see if readv exists
16221 : see if recvmsg exists
16222 set recvmsg d_recvmsg
16225 : see if rename exists
16226 set rename d_rename
16229 : see if rmdir exists
16233 : see if memory.h is available.
16238 : See if it conflicts with string.h
16244 $cppstdin $cppflags $cppminus < $strings > mem.h
16245 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16247 echo "We won't be including <memory.h>."
16257 : can bcopy handle overlapping blocks?
16260 case "$d_memmove" in
16261 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16262 *) case "$d_bcopy" in
16264 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16266 #$i_memory I_MEMORY
16267 #$i_stdlib I_STDLIB
16268 #$i_string I_STRING
16269 #$i_unistd I_UNISTD
16271 $cat >>try.c <<'EOCP'
16274 # include <memory.h>
16277 # include <stdlib.h>
16280 # include <string.h>
16282 # include <strings.h>
16285 # include <unistd.h> /* Needed for NetBSD */
16289 char buf[128], abc[128];
16295 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16296 try to store the string in read-only memory. */
16297 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16299 for (align = 7; align >= 0; align--) {
16300 for (len = 36; len; len--) {
16302 bcopy(abc, b, len);
16303 for (off = 1; off <= len; off++) {
16304 bcopy(b, b+off, len);
16305 bcopy(b+off, b, len);
16306 if (bcmp(b, abc, len))
16315 if eval $compile_ok; then
16316 if $run ./try 2>/dev/null; then
16317 echo "Yes, it can."
16320 echo "It can't, sorry."
16323 echo "(I can't compile the test program, so we'll assume not...)"
16333 : can memcpy handle overlapping blocks?
16336 case "$d_memmove" in
16337 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16338 *) case "$d_memcpy" in
16340 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16342 #$i_memory I_MEMORY
16343 #$i_stdlib I_STDLIB
16344 #$i_string I_STRING
16345 #$i_unistd I_UNISTD
16347 $cat >>try.c <<'EOCP'
16350 # include <memory.h>
16353 # include <stdlib.h>
16356 # include <string.h>
16358 # include <strings.h>
16361 # include <unistd.h> /* Needed for NetBSD */
16365 char buf[128], abc[128];
16371 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16372 try to store the string in read-only memory. */
16373 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16375 for (align = 7; align >= 0; align--) {
16376 for (len = 36; len; len--) {
16378 memcpy(b, abc, len);
16379 for (off = 1; off <= len; off++) {
16380 memcpy(b+off, b, len);
16381 memcpy(b, b+off, len);
16382 if (memcmp(b, abc, len))
16391 if eval $compile_ok; then
16392 if $run ./try 2>/dev/null; then
16393 echo "Yes, it can."
16396 echo "It can't, sorry."
16399 echo "(I can't compile the test program, so we'll assume not...)"
16409 : can memcmp be trusted to compare relative magnitude?
16411 case "$d_memcmp" in
16414 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16416 #$i_memory I_MEMORY
16417 #$i_stdlib I_STDLIB
16418 #$i_string I_STRING
16419 #$i_unistd I_UNISTD
16421 $cat >>try.c <<'EOCP'
16424 # include <memory.h>
16427 # include <stdlib.h>
16430 # include <string.h>
16432 # include <strings.h>
16435 # include <unistd.h> /* Needed for NetBSD */
16441 if ((a < b) && memcmp(&a, &b, 1) < 0)
16447 if eval $compile_ok; then
16448 if $run ./try 2>/dev/null; then
16449 echo "Yes, it can."
16452 echo "No, it can't (it uses signed chars)."
16455 echo "(I can't compile the test program, so we'll assume not...)"
16463 : see if prototype for sbrk is available
16465 set d_sbrkproto sbrk $i_unistd unistd.h
16468 : see if select exists
16469 set select d_select
16472 : see if semctl exists
16473 set semctl d_semctl
16476 : see if semget exists
16477 set semget d_semget
16480 : see if semop exists
16484 : see how much of the 'sem*(2)' library is present.
16487 case "$d_semctl$d_semget$d_semop" in
16488 *"$undef"*) h_sem=false;;
16492 case "`ipcs 2>&1`" in
16493 "SVID messages"*"not configured"*)
16494 echo "Your $osname does not have the sem*(2) configured." >&4
16497 set semctl d_semctl
16499 set semget d_semget
16507 : we could also check for sys/ipc.h ...
16508 if $h_sem && $test `./findhdr sys/sem.h`; then
16509 echo "You have the full sem*(2) library." >&4
16512 echo "You don't have the full sem*(2) library." >&4
16518 : see whether sys/sem.h defines union semun
16520 $cat > try.c <<'END'
16521 #include <sys/types.h>
16522 #include <sys/ipc.h>
16523 #include <sys/sem.h>
16524 int main () { union semun semun; semun.buf = 0; }
16527 if eval $compile; then
16528 echo "You have union semun in <sys/sem.h>." >&4
16531 echo "You do not have union semun in <sys/sem.h>." >&4
16538 : see how to do semctl IPC_STAT
16542 $cat > tryh.h <<END
16545 # define S_IRUSR S_IREAD
16546 # define S_IWUSR S_IWRITE
16547 # define S_IXUSR S_IEXEC
16549 # define S_IRUSR 0400
16550 # define S_IWUSR 0200
16551 # define S_IXUSR 0100
16553 # define S_IRGRP (S_IRUSR>>3)
16554 # define S_IWGRP (S_IWUSR>>3)
16555 # define S_IXGRP (S_IXUSR>>3)
16556 # define S_IROTH (S_IRUSR>>6)
16557 # define S_IWOTH (S_IWUSR>>6)
16558 # define S_IXOTH (S_IXUSR>>6)
16561 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16562 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16563 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16566 : see whether semctl IPC_STAT can use union semun
16567 case "$d_semctl_semun" in
16571 #include <sys/types.h>
16572 #include <sys/ipc.h>
16573 #include <sys/sem.h>
16574 #include <sys/stat.h>
16581 #$d_union_semun HAS_UNION_SEMUN
16584 #ifndef HAS_UNION_SEMUN
16587 struct semid_ds *buf;
16588 unsigned short *array;
16594 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16595 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16597 struct semid_ds argbuf;
16600 st = semctl(sem, 0, IPC_STAT, arg);
16604 # endif /* IPC_STAT */
16605 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16607 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16608 # endif /* IPC_RMID */
16609 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16611 #endif /* IPC_PRIVATE && ... */
16612 printf("semget failed: errno = %d\n", errno);
16617 if eval $compile; then
16620 semun) val="$define" ;;
16628 case "$d_semctl_semun" in
16630 echo "You can use union semun for semctl IPC_STAT." >&4
16633 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16638 : see whether semctl IPC_STAT can use struct semid_ds pointer
16639 case "$d_semctl_semid_ds" in
16642 $cat > try.c <<'END'
16643 #include <sys/types.h>
16644 #include <sys/ipc.h>
16645 #include <sys/sem.h>
16646 #include <sys/stat.h>
16654 struct semid_ds arg;
16657 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16658 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16661 st = semctl(sem, 0, IPC_STAT, &arg);
16663 printf("semid_ds\n");
16665 # endif /* IPC_STAT */
16666 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16668 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16669 # endif /* IPC_RMID */
16670 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16672 #endif /* IPC_PRIVATE && ... */
16673 printf("semget failed: errno = %d\n", errno);
16679 if eval $compile; then
16682 semid_ds) val="$define" ;;
16686 set d_semctl_semid_ds
16690 case "$d_semctl_semid_ds" in
16692 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16694 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16700 # We do not have the full sem*(2) library, so assume we can not
16706 set d_semctl_semid_ds
16712 : see if sendmsg exists
16713 set sendmsg d_sendmsg
16716 : see if setegid exists
16717 set setegid d_setegid
16720 : see if seteuid exists
16721 set seteuid d_seteuid
16724 : see if setgrent exists
16725 set setgrent d_setgrent
16728 : see if setgrent_r exists
16729 set setgrent_r d_setgrent_r
16731 case "$d_setgrent_r" in
16733 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16734 case "$d_setgrent_r_proto:$usethreads" in
16735 ":define") d_setgrent_r_proto=define
16736 set d_setgrent_r_proto setgrent_r $hdrs
16740 case "$d_setgrent_r_proto" in
16742 case "$setgrent_r_proto" in
16743 ''|0) try='int setgrent_r(FILE**);'
16744 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=I_H ;;
16746 case "$setgrent_r_proto" in
16747 ''|0) try='void setgrent_r(FILE**);'
16748 ./protochk "$extern_C $try" $hdrs && setgrent_r_proto=V_H ;;
16750 case "$setgrent_r_proto" in
16751 ''|0) d_setgrent_r=undef
16753 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16754 * ) case "$setgrent_r_proto" in
16755 REENTRANT_PROTO*) ;;
16756 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16758 echo "Prototype: $try" ;;
16761 *) case "$usethreads" in
16762 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16769 *) setgrent_r_proto=0
16773 : see if sethostent exists
16774 set sethostent d_sethent
16777 : see if sethostent_r exists
16778 set sethostent_r d_sethostent_r
16780 case "$d_sethostent_r" in
16782 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16783 case "$d_sethostent_r_proto:$usethreads" in
16784 ":define") d_sethostent_r_proto=define
16785 set d_sethostent_r_proto sethostent_r $hdrs
16789 case "$d_sethostent_r_proto" in
16791 case "$sethostent_r_proto" in
16792 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16793 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=I_ID ;;
16795 case "$sethostent_r_proto" in
16796 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16797 ./protochk "$extern_C $try" $hdrs && sethostent_r_proto=V_ID ;;
16799 case "$sethostent_r_proto" in
16800 ''|0) d_sethostent_r=undef
16801 sethostent_r_proto=0
16802 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16803 * ) case "$sethostent_r_proto" in
16804 REENTRANT_PROTO*) ;;
16805 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16807 echo "Prototype: $try" ;;
16810 *) case "$usethreads" in
16811 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16813 d_sethostent_r=undef
16814 sethostent_r_proto=0
16818 *) sethostent_r_proto=0
16822 : see if setitimer exists
16823 set setitimer d_setitimer
16826 : see if setlinebuf exists
16827 set setlinebuf d_setlinebuf
16830 : see if setlocale exists
16831 set setlocale d_setlocale
16834 : see if locale.h is available
16835 set locale.h i_locale
16838 : see if setlocale_r exists
16839 set setlocale_r d_setlocale_r
16841 case "$d_setlocale_r" in
16843 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16844 case "$d_setlocale_r_proto:$usethreads" in
16845 ":define") d_setlocale_r_proto=define
16846 set d_setlocale_r_proto setlocale_r $hdrs
16850 case "$d_setlocale_r_proto" in
16852 case "$setlocale_r_proto" in
16853 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16854 ./protochk "$extern_C $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16856 case "$setlocale_r_proto" in
16857 ''|0) d_setlocale_r=undef
16858 setlocale_r_proto=0
16859 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16860 * ) case "$setlocale_r_proto" in
16861 REENTRANT_PROTO*) ;;
16862 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16864 echo "Prototype: $try" ;;
16867 *) case "$usethreads" in
16868 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16870 d_setlocale_r=undef
16871 setlocale_r_proto=0
16875 *) setlocale_r_proto=0
16879 : see if setnetent exists
16880 set setnetent d_setnent
16883 : see if setnetent_r exists
16884 set setnetent_r d_setnetent_r
16886 case "$d_setnetent_r" in
16888 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16889 case "$d_setnetent_r_proto:$usethreads" in
16890 ":define") d_setnetent_r_proto=define
16891 set d_setnetent_r_proto setnetent_r $hdrs
16895 case "$d_setnetent_r_proto" in
16897 case "$setnetent_r_proto" in
16898 ''|0) try='int setnetent_r(int, struct netent_data*);'
16899 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=I_ID ;;
16901 case "$setnetent_r_proto" in
16902 ''|0) try='void setnetent_r(int, struct netent_data*);'
16903 ./protochk "$extern_C $try" $hdrs && setnetent_r_proto=V_ID ;;
16905 case "$setnetent_r_proto" in
16906 ''|0) d_setnetent_r=undef
16907 setnetent_r_proto=0
16908 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16909 * ) case "$setnetent_r_proto" in
16910 REENTRANT_PROTO*) ;;
16911 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16913 echo "Prototype: $try" ;;
16916 *) case "$usethreads" in
16917 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16919 d_setnetent_r=undef
16920 setnetent_r_proto=0
16924 *) setnetent_r_proto=0
16928 : see if setprotoent exists
16929 set setprotoent d_setpent
16932 : see if setpgid exists
16933 set setpgid d_setpgid
16936 : see if setpgrp2 exists
16937 set setpgrp2 d_setpgrp2
16940 : see if setpriority exists
16941 set setpriority d_setprior
16944 : see if setproctitle exists
16945 set setproctitle d_setproctitle
16948 : see if setprotoent_r exists
16949 set setprotoent_r d_setprotoent_r
16951 case "$d_setprotoent_r" in
16953 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16954 case "$d_setprotoent_r_proto:$usethreads" in
16955 ":define") d_setprotoent_r_proto=define
16956 set d_setprotoent_r_proto setprotoent_r $hdrs
16960 case "$d_setprotoent_r_proto" in
16962 case "$setprotoent_r_proto" in
16963 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16964 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=I_ID ;;
16966 case "$setprotoent_r_proto" in
16967 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16968 ./protochk "$extern_C $try" $hdrs && setprotoent_r_proto=V_ID ;;
16970 case "$setprotoent_r_proto" in
16971 ''|0) d_setprotoent_r=undef
16972 setprotoent_r_proto=0
16973 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16974 * ) case "$setprotoent_r_proto" in
16975 REENTRANT_PROTO*) ;;
16976 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16978 echo "Prototype: $try" ;;
16981 *) case "$usethreads" in
16982 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16984 d_setprotoent_r=undef
16985 setprotoent_r_proto=0
16989 *) setprotoent_r_proto=0
16993 : see if setpwent exists
16994 set setpwent d_setpwent
16997 : see if setpwent_r exists
16998 set setpwent_r d_setpwent_r
17000 case "$d_setpwent_r" in
17002 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
17003 case "$d_setpwent_r_proto:$usethreads" in
17004 ":define") d_setpwent_r_proto=define
17005 set d_setpwent_r_proto setpwent_r $hdrs
17009 case "$d_setpwent_r_proto" in
17011 case "$setpwent_r_proto" in
17012 ''|0) try='int setpwent_r(FILE**);'
17013 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=I_H ;;
17015 case "$setpwent_r_proto" in
17016 ''|0) try='void setpwent_r(FILE**);'
17017 ./protochk "$extern_C $try" $hdrs && setpwent_r_proto=V_H ;;
17019 case "$setpwent_r_proto" in
17020 ''|0) d_setpwent_r=undef
17022 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
17023 * ) case "$setpwent_r_proto" in
17024 REENTRANT_PROTO*) ;;
17025 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
17027 echo "Prototype: $try" ;;
17030 *) case "$usethreads" in
17031 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
17038 *) setpwent_r_proto=0
17042 : see if setregid exists
17043 set setregid d_setregid
17045 set setresgid d_setresgid
17048 : see if setreuid exists
17049 set setreuid d_setreuid
17051 set setresuid d_setresuid
17054 : see if setrgid exists
17055 set setrgid d_setrgid
17058 : see if setruid exists
17059 set setruid d_setruid
17062 : see if setservent exists
17063 set setservent d_setsent
17066 : see if setservent_r exists
17067 set setservent_r d_setservent_r
17069 case "$d_setservent_r" in
17071 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17072 case "$d_setservent_r_proto:$usethreads" in
17073 ":define") d_setservent_r_proto=define
17074 set d_setservent_r_proto setservent_r $hdrs
17078 case "$d_setservent_r_proto" in
17080 case "$setservent_r_proto" in
17081 ''|0) try='int setservent_r(int, struct servent_data*);'
17082 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=I_ID ;;
17084 case "$setservent_r_proto" in
17085 ''|0) try='void setservent_r(int, struct servent_data*);'
17086 ./protochk "$extern_C $try" $hdrs && setservent_r_proto=V_ID ;;
17088 case "$setservent_r_proto" in
17089 ''|0) d_setservent_r=undef
17090 setservent_r_proto=0
17091 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17092 * ) case "$setservent_r_proto" in
17093 REENTRANT_PROTO*) ;;
17094 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17096 echo "Prototype: $try" ;;
17099 *) case "$usethreads" in
17100 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17102 d_setservent_r=undef
17103 setservent_r_proto=0
17107 *) setservent_r_proto=0
17111 : see if setsid exists
17112 set setsid d_setsid
17115 : see if setvbuf exists
17116 set setvbuf d_setvbuf
17119 : see if sfio.h is available
17123 : see if sfio library is available
17134 : Ok, but do we want to use it.
17138 true|$define|[yY]*) dflt='y';;
17141 echo "$package can use the sfio library, but it is experimental."
17142 case "$useperlio" in
17144 echo "For sfio also the PerlIO abstraction layer is needed."
17145 echo "Earlier you said you wouldn't want that."
17148 rp="You seem to have sfio available, do you want to try using it?"
17151 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17152 useperlio="$define"
17155 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17160 *) case "$usesfio" in
17161 true|$define|[yY]*)
17162 echo "Sorry, cannot find sfio on this machine." >&4
17163 echo "Ignoring your setting of usesfio=$usesfio." >&4
17172 $define) usesfio='true';;
17173 *) usesfio='false';;
17177 *) : Remove sfio from list of libraries to use
17180 echo "Removing unneeded -lsfio from library list" >&4
17181 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17184 echo "libs = $libs" >&4
17191 : see if shmctl exists
17192 set shmctl d_shmctl
17195 : see if shmget exists
17196 set shmget d_shmget
17199 : see if shmat exists
17202 : see what shmat returns
17205 $cat >shmat.c <<'END'
17206 #include <sys/shm.h>
17209 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17214 echo "and it returns ($shmattype)." >&4
17215 : see if a prototype for shmat is available
17216 xxx=`./findhdr sys/shm.h`
17217 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17218 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17229 set d_shmatprototype
17232 : see if shmdt exists
17236 : see how much of the 'shm*(2)' library is present.
17239 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17240 *"$undef"*) h_shm=false;;
17244 case "`ipcs 2>&1`" in
17245 "SVID shared memory"*"not configured"*)
17246 echo "Your $osname does not have the shm*(2) configured." >&4
17249 set shmctl d_shmctl
17251 set shmget d_shmget
17261 : we could also check for sys/ipc.h ...
17262 if $h_shm && $test `./findhdr sys/shm.h`; then
17263 echo "You have the full shm*(2) library." >&4
17266 echo "You don't have the full shm*(2) library." >&4
17272 : see if we have sigaction
17274 if set sigaction val -f d_sigaction; eval $csym; $val; then
17275 echo 'sigaction() found.' >&4
17278 #include <sys/types.h>
17279 #include <signal.h>
17280 #$i_stdlib I_STDLIB
17282 #include <stdlib.h>
17286 struct sigaction act, oact;
17288 oact.sa_handler = 0;
17289 /* so that act and oact are used */
17290 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17294 if eval $compile_ok; then
17297 echo "But you don't seem to have a useable struct sigaction." >&4
17301 echo 'sigaction NOT found.' >&4
17304 set d_sigaction; eval $setvar
17307 : see if this is a sunmath.h system
17308 set sunmath.h i_sunmath
17311 : see if signbit exists
17312 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17315 #$i_sunmath I_SUNMATH
17319 #ifdef I_SUNMATH /* Solaris special math library */
17320 # include <sunmath.h>
17323 int main(int argc, char **argv)
17327 if ((signbit(x) == 0) && (signbit(y) != 0))
17335 if eval $compile; then
17336 if $run ./try; then
17340 $echo "Signbit seems to be available, but doesn't work as I expected."
17341 $echo "I won't use it." >&4
17352 : see if sigprocmask exists
17353 set sigprocmask d_sigprocmask
17356 : see if sigsetjmp exists
17358 case "$d_sigsetjmp" in
17361 #include <setjmp.h>
17362 #$i_stdlib I_STDLIB
17364 #include <stdlib.h>
17370 if (sigsetjmp(env,1))
17373 siglongjmp(env, 1);
17378 if eval $compile; then
17379 if $run ./try >/dev/null 2>&1; then
17380 echo "POSIX sigsetjmp found." >&4
17384 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17390 echo "sigsetjmp not found." >&4
17394 *) val="$d_sigsetjmp"
17395 case "$d_sigsetjmp" in
17396 $define) echo "POSIX sigsetjmp found." >&4;;
17397 $undef) echo "sigsetjmp not found." >&4;;
17405 : see if snprintf exists
17406 set snprintf d_snprintf
17409 : see if vsnprintf exists
17410 set vsnprintf d_vsnprintf
17413 case "$d_snprintf-$d_vsnprintf" in
17416 Checking whether your snprintf() and vsnprintf() work okay...
17418 $cat >try.c <<'EOCP'
17419 /* v?snprintf testing logic courtesy of Russ Allbery.
17420 * According to C99:
17421 * - if the buffer is too short it still must be \0-terminated
17422 * - if the buffer is too short the potentially required length
17423 * must be returned and not -1
17424 * - if the buffer is NULL the potentially required length
17425 * must be returned and not -1 or core dump
17428 #include <stdarg.h>
17432 int test (char *format, ...)
17437 va_start (args, format);
17438 count = vsnprintf (buf, sizeof buf, format, args);
17445 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17446 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17450 if eval $compile; then
17453 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17455 Your snprintf() and snprintf() don't seem to be working okay.
17457 d_snprintf="$undef"
17458 d_vsnprintf="$undef"
17462 echo "(I can't seem to compile the test program--assuming they don't)"
17463 d_snprintf="$undef"
17464 d_vsnprintf="$undef"
17470 : see if sockatmark exists
17471 set sockatmark d_sockatmark
17474 : see if prototype for sockatmark is available
17476 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17479 : see if socks5_init exists
17480 set socks5_init d_socks5_init
17483 : see if sprintf returns the length of the string in the buffer as per ANSI
17484 $echo "Checking whether sprintf returns the length of the string..." >&4
17487 #$i_stdlib I_STDLIB
17489 #include <stdlib.h>
17491 #$i_string I_STRING
17493 # include <string.h>
17495 # include <strings.h>
17504 int check (size_t expect, int test) {
17505 size_t got = strlen(buffer);
17509 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17514 int main(int argc, char **argv) {
17517 check(sprintf(buffer, ""), ++test);
17518 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17519 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17526 if eval $compile; then
17530 sprintf returns the length of the string (as ANSI says it should)
17532 d_sprintf_returns_strlen="$define"
17535 sprintf does not return the length of the string (how old is this system?)
17537 d_sprintf_returns_strlen="$undef"
17541 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17542 d_sprintf_returns_strlen="$undef"
17546 : see if srand48_r exists
17547 set srand48_r d_srand48_r
17549 case "$d_srand48_r" in
17551 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17552 case "$d_srand48_r_proto:$usethreads" in
17553 ":define") d_srand48_r_proto=define
17554 set d_srand48_r_proto srand48_r $hdrs
17558 case "$d_srand48_r_proto" in
17560 case "$srand48_r_proto" in
17561 ''|0) try='int srand48_r(long, struct drand48_data*);'
17562 ./protochk "$extern_C $try" $hdrs && srand48_r_proto=I_LS ;;
17564 case "$srand48_r_proto" in
17565 ''|0) d_srand48_r=undef
17567 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17568 * ) case "$srand48_r_proto" in
17569 REENTRANT_PROTO*) ;;
17570 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17572 echo "Prototype: $try" ;;
17575 *) case "$usethreads" in
17576 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17583 *) srand48_r_proto=0
17587 : see if srandom_r exists
17588 set srandom_r d_srandom_r
17590 case "$d_srandom_r" in
17592 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17593 case "$d_srandom_r_proto:$usethreads" in
17594 ":define") d_srandom_r_proto=define
17595 set d_srandom_r_proto srandom_r $hdrs
17599 case "$d_srandom_r_proto" in
17601 case "$srandom_r_proto" in
17602 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17603 ./protochk "$extern_C $try" $hdrs && srandom_r_proto=I_TS ;;
17605 case "$srandom_r_proto" in
17606 ''|0) d_srandom_r=undef
17608 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17609 * ) case "$srandom_r_proto" in
17610 REENTRANT_PROTO*) ;;
17611 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17613 echo "Prototype: $try" ;;
17616 *) case "$usethreads" in
17617 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17624 *) srandom_r_proto=0
17628 : see if prototype for setresgid is available
17630 set d_sresgproto setresgid $i_unistd unistd.h
17633 : see if prototype for setresuid is available
17635 set d_sresuproto setresuid $i_unistd unistd.h
17638 : see if sys/stat.h is available
17639 set sys/stat.h i_sysstat
17642 : see if stat knows about block sizes
17644 echo "Checking to see if your struct stat has st_blocks field..." >&4
17645 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17648 : see if this is a sys/vfs.h system
17649 set sys/vfs.h i_sysvfs
17652 : see if this is a sys/statfs.h system
17653 set sys/statfs.h i_sysstatfs
17656 : Check for statfs_s
17658 echo "Checking to see if your system supports struct statfs..." >&4
17659 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
17661 case "$d_statfs_s" in
17662 "$define") echo "Yes, it does." ;;
17663 *) echo "No, it doesn't." ;;
17667 : see if struct statfs knows about f_flags
17668 case "$d_statfs_s" in
17671 echo "Checking to see if your struct statfs has f_flags field..." >&4
17672 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
17676 set d_statfs_f_flags
17680 case "$d_statfs_f_flags" in
17681 "$define") echo "Yes, it does." ;;
17682 *) echo "No, it doesn't." ;;
17685 : Check stream access
17687 Checking how to access stdio streams by file descriptor number...
17689 case "$stdio_stream_array" in
17690 '') $cat >try.c <<EOCP
17693 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17697 for s in _iob __iob __sF
17699 set try -DSTDIO_STREAM_ARRAY=$s
17700 if eval $compile; then
17701 case "`$run ./try`" in
17702 yes) stdio_stream_array=$s; break ;;
17708 case "$stdio_stream_array" in
17710 I can't figure out how to access stdio streams by file descriptor number.
17712 d_stdio_stream_array="$undef"
17715 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17717 d_stdio_stream_array="$define"
17721 : see if strcoll exists
17722 set strcoll d_strcoll
17725 : check for structure copying
17727 echo "Checking to see if your C compiler can copy structs..." >&4
17728 $cat >try.c <<'EOCP'
17738 if $cc -c try.c >/dev/null 2>&1 ; then
17740 echo "Yup, it can."
17743 echo "Nope, it can't."
17749 : see if strerror and/or sys_errlist[] exist
17751 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17752 if set strerror val -f d_strerror; eval $csym; $val; then
17753 echo 'strerror() found.' >&4
17754 d_strerror="$define"
17755 d_strerrm='strerror(e)'
17756 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17757 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17758 d_syserrlst="$define"
17760 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17761 d_syserrlst="$undef"
17763 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17764 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17765 echo 'strerror() found in string header.' >&4
17766 d_strerror="$define"
17767 d_strerrm='strerror(e)'
17768 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17769 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17770 d_syserrlst="$define"
17772 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17773 d_syserrlst="$undef"
17775 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17776 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17777 d_strerror="$undef"
17778 d_syserrlst="$define"
17779 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17781 echo 'strerror() and sys_errlist[] NOT found.' >&4
17782 d_strerror="$undef"
17783 d_syserrlst="$undef"
17784 d_strerrm='"unknown"'
17788 : see if strerror_r exists
17789 set strerror_r d_strerror_r
17791 case "$d_strerror_r" in
17793 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17794 case "$d_strerror_r_proto:$usethreads" in
17795 ":define") d_strerror_r_proto=define
17796 set d_strerror_r_proto strerror_r $hdrs
17800 case "$d_strerror_r_proto" in
17802 case "$strerror_r_proto" in
17803 ''|0) try='int strerror_r(int, char*, size_t);'
17804 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBW ;;
17806 case "$strerror_r_proto" in
17807 ''|0) try='int strerror_r(int, char*, int);'
17808 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=I_IBI ;;
17810 case "$strerror_r_proto" in
17811 ''|0) try='char* strerror_r(int, char*, size_t);'
17812 ./protochk "$extern_C $try" $hdrs && strerror_r_proto=B_IBW ;;
17814 case "$strerror_r_proto" in
17815 ''|0) d_strerror_r=undef
17817 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17818 * ) case "$strerror_r_proto" in
17819 REENTRANT_PROTO*) ;;
17820 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17822 echo "Prototype: $try" ;;
17825 *) case "$usethreads" in
17826 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17833 *) strerror_r_proto=0
17837 : see if strftime exists
17838 set strftime d_strftime
17841 : see if strlcat exists
17842 set strlcat d_strlcat
17845 : see if strlcpy exists
17846 set strlcpy d_strlcpy
17849 : see if strtod exists
17850 set strtod d_strtod
17853 : see if strtol exists
17854 set strtol d_strtol
17857 : see if strtold exists
17858 set strtold d_strtold
17861 : see if strtoll exists
17862 set strtoll d_strtoll
17865 case "$d_longlong-$d_strtoll" in
17868 Checking whether your strtoll() works okay...
17870 $cat >try.c <<'EOCP'
17873 #define strtoll __strtoll
17876 #define strtoll _strtoll
17879 extern long long int strtoll(char *s, char **, int);
17880 static int bad = 0;
17881 int check(char *s, long long ell, int een) {
17884 gll = strtoll(s, 0, 10);
17885 if (!((gll == ell) && (errno == een)))
17889 check(" 1", 1LL, 0);
17890 check(" 0", 0LL, 0);
17891 check("-1", -1LL, 0);
17892 check("-9223372036854775808", -9223372036854775808LL, 0);
17893 check("-9223372036854775808", -9223372036854775808LL, 0);
17894 check(" 9223372036854775807", 9223372036854775807LL, 0);
17895 check("-9223372036854775808", -9223372036854775808LL, 0);
17896 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17897 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17903 if eval $compile; then
17906 ok) echo "Your strtoll() seems to be working okay." ;;
17908 Your strtoll() doesn't seem to be working okay.
17914 echo "(I can't seem to compile the test program--assuming it doesn't)"
17920 : see if strtoq exists
17921 set strtoq d_strtoq
17924 : see if strtoul exists
17925 set strtoul d_strtoul
17928 case "$d_strtoul" in
17931 Checking whether your strtoul() works okay...
17933 $cat >try.c <<'EOCP'
17936 extern unsigned long int strtoul(char *s, char **, int);
17937 static int bad = 0;
17938 void check(char *s, unsigned long eul, int een) {
17941 gul = strtoul(s, 0, 10);
17942 if (!((gul == eul) && (errno == een)))
17946 check(" 1", 1L, 0);
17947 check(" 0", 0L, 0);
17949 case "$longsize" in
17951 $cat >>try.c <<'EOCP'
17952 check("18446744073709551615", 18446744073709551615UL, 0);
17953 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17954 #if 0 /* strtoul() for /^-/ strings is undefined. */
17955 check("-1", 18446744073709551615UL, 0);
17956 check("-18446744073709551614", 2, 0);
17957 check("-18446744073709551615", 1, 0);
17958 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17959 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17964 $cat >>try.c <<'EOCP'
17965 check("4294967295", 4294967295UL, 0);
17966 check("4294967296", 4294967295UL, ERANGE);
17967 #if 0 /* strtoul() for /^-/ strings is undefined. */
17968 check("-1", 4294967295UL, 0);
17969 check("-4294967294", 2, 0);
17970 check("-4294967295", 1, 0);
17971 check("-4294967296", 4294967295UL, ERANGE);
17972 check("-4294967297", 4294967295UL, ERANGE);
17977 : Should we write these tests to be more portable by sprintf-ing
17978 : ~0 and then manipulating that char string as input for strtol?
17981 $cat >>try.c <<'EOCP'
17988 if eval $compile; then
17989 case "`$run ./try`" in
17990 ok) echo "Your strtoul() seems to be working okay." ;;
17992 Your strtoul() doesn't seem to be working okay.
17998 echo "(I can't seem to compile the test program--assuming it doesn't)"
18004 : see if strtoull exists
18005 set strtoull d_strtoull
18008 case "$d_longlong-$d_strtoull" in
18011 Checking whether your strtoull() works okay...
18013 $cat >try.c <<'EOCP'
18016 #define strtoull __strtoull
18019 extern unsigned long long int strtoull(char *s, char **, int);
18020 static int bad = 0;
18021 int check(char *s, long long eull, int een) {
18024 gull = strtoull(s, 0, 10);
18025 if (!((gull == eull) && (errno == een)))
18029 check(" 1", 1LL, 0);
18030 check(" 0", 0LL, 0);
18031 check("18446744073709551615", 18446744073709551615ULL, 0);
18032 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18033 #if 0 /* strtoull() for /^-/ strings is undefined. */
18034 check("-1", 18446744073709551615ULL, 0);
18035 check("-18446744073709551614", 2LL, 0);
18036 check("-18446744073709551615", 1LL, 0);
18037 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18038 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18045 if eval $compile; then
18046 case "`$run ./try`" in
18047 ok) echo "Your strtoull() seems to be working okay." ;;
18049 Your strtoull() doesn't seem to be working okay.
18051 d_strtoull="$undef"
18055 echo "(I can't seem to compile the test program--assuming it doesn't)"
18056 d_strtoull="$undef"
18061 : see if strtouq exists
18062 set strtouq d_strtouq
18065 case "$d_strtouq" in
18068 Checking whether your strtouq() works okay...
18070 $cat >try.c <<'EOCP'
18073 extern unsigned long long int strtouq(char *s, char **, int);
18074 static int bad = 0;
18075 void check(char *s, unsigned long long eull, int een) {
18076 unsigned long long gull;
18078 gull = strtouq(s, 0, 10);
18079 if (!((gull == eull) && (errno == een)))
18083 check(" 1", 1LL, 0);
18084 check(" 0", 0LL, 0);
18085 check("18446744073709551615", 18446744073709551615ULL, 0);
18086 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18087 #if 0 /* strtouq() for /^-/ strings is undefined. */
18088 check("-1", 18446744073709551615ULL, 0);
18089 check("-18446744073709551614", 2LL, 0);
18090 check("-18446744073709551615", 1LL, 0);
18091 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18092 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18100 if eval $compile; then
18101 case "`$run ./try`" in
18102 ok) echo "Your strtouq() seems to be working okay." ;;
18104 Your strtouq() doesn't seem to be working okay.
18110 echo "(I can't seem to compile the test program--assuming it doesn't)"
18116 : see if strxfrm exists
18117 set strxfrm d_strxfrm
18120 : see if symlink exists
18121 set symlink d_symlink
18124 : see if syscall exists
18125 set syscall d_syscall
18128 : see if prototype for syscall is available
18130 set d_syscallproto syscall $i_unistd unistd.h
18133 : see if sysconf exists
18134 set sysconf d_sysconf
18137 : see if system exists
18138 set system d_system
18141 : see if tcgetpgrp exists
18142 set tcgetpgrp d_tcgetpgrp
18145 : see if tcsetpgrp exists
18146 set tcsetpgrp d_tcsetpgrp
18149 : see if prototype for telldir is available
18151 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18154 : see if time exists
18156 if test "X$d_time" = X -o X"$timetype" = X; then
18157 if set time val -f d_time; eval $csym; $val; then
18158 echo 'time() found.' >&4
18160 rp="What is the type returned by time() on this system?"
18161 set time_t timetype long stdio.h sys/types.h
18164 echo 'time() not found, hope that will do.' >&4
18172 : see if timegm exists
18173 set timegm d_timegm
18176 : see if this is a sys/times.h system
18177 set sys/times.h i_systimes
18180 : see if times exists
18182 if set times val -f d_times; eval $csym; $val; then
18183 echo 'times() found.' >&4
18186 case "$i_systimes" in
18187 "$define") inc='sys/times.h';;
18189 rp="What is the type returned by times() on this system?"
18190 set clock_t clocktype long stdio.h sys/types.h $inc
18193 echo 'times() NOT found, hope that will do.' >&4
18198 : see if tmpnam_r exists
18199 set tmpnam_r d_tmpnam_r
18201 case "$d_tmpnam_r" in
18203 hdrs="$i_systypes sys/types.h define stdio.h "
18204 case "$d_tmpnam_r_proto:$usethreads" in
18205 ":define") d_tmpnam_r_proto=define
18206 set d_tmpnam_r_proto tmpnam_r $hdrs
18210 case "$d_tmpnam_r_proto" in
18212 case "$tmpnam_r_proto" in
18213 ''|0) try='char* tmpnam_r(char*);'
18214 ./protochk "$extern_C $try" $hdrs && tmpnam_r_proto=B_B ;;
18216 case "$tmpnam_r_proto" in
18217 ''|0) d_tmpnam_r=undef
18219 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18220 * ) case "$tmpnam_r_proto" in
18221 REENTRANT_PROTO*) ;;
18222 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18224 echo "Prototype: $try" ;;
18227 *) case "$usethreads" in
18228 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18235 *) tmpnam_r_proto=0
18239 : see if truncate exists
18240 set truncate d_truncate
18243 : see if ttyname_r exists
18244 set ttyname_r d_ttyname_r
18246 case "$d_ttyname_r" in
18248 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18249 case "$d_ttyname_r_proto:$usethreads" in
18250 ":define") d_ttyname_r_proto=define
18251 set d_ttyname_r_proto ttyname_r $hdrs
18255 case "$d_ttyname_r_proto" in
18257 case "$ttyname_r_proto" in
18258 ''|0) try='int ttyname_r(int, char*, size_t);'
18259 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBW ;;
18261 case "$ttyname_r_proto" in
18262 ''|0) try='int ttyname_r(int, char*, int);'
18263 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=I_IBI ;;
18265 case "$ttyname_r_proto" in
18266 ''|0) try='char* ttyname_r(int, char*, int);'
18267 ./protochk "$extern_C $try" $hdrs && ttyname_r_proto=B_IBI ;;
18269 case "$ttyname_r_proto" in
18270 ''|0) d_ttyname_r=undef
18272 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18273 * ) case "$ttyname_r_proto" in
18274 REENTRANT_PROTO*) ;;
18275 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18277 echo "Prototype: $try" ;;
18280 *) case "$usethreads" in
18281 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18288 *) ttyname_r_proto=0
18292 : see if tzname[] exists
18294 if set tzname val -a d_tzname; eval $csym; $val; then
18296 echo 'tzname[] found.' >&4
18299 echo 'tzname[] NOT found.' >&4
18304 : Check if is a multiplatform env
18306 next|rhapsody|darwin) multiarch="$define" ;;
18308 case "$multiarch" in
18309 ''|[nN]*) multiarch="$undef" ;;
18312 : check for ordering of bytes in a UV
18314 case "$usecrosscompile$multiarch" in
18317 You seem to be either cross-compiling or doing a multiarchitecture build,
18318 skipping the byteorder check.
18324 case "$byteorder" in
18327 In the following, larger digits indicate more significance. A big-endian
18328 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18329 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18330 machines may have weird orders like 3412. A Cray will report 87654321,
18331 an Alpha will report 12345678. If the test program works the default is
18333 I'm now running the test program...
18337 #$i_stdlib I_STDLIB
18339 #include <stdlib.h>
18341 #include <sys/types.h>
18342 typedef $uvtype UV;
18352 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18354 u.l = (UV)0x04030201;
18355 for (i = 0; i < $uvsize; i++)
18356 printf("%c", u.c[i]+'0');
18363 if eval $compile && $run ./try > /dev/null; then
18366 [1-4][1-4][1-4][1-4]|12345678|87654321)
18367 echo "(The test program ran ok.)"
18368 echo "byteorder=$dflt"
18371 ????|????????) echo "(The test program ran ok.)" ;;
18372 *) echo "(The test program didn't run right for some reason.)" ;;
18377 (I can't seem to compile the test program. Guessing big-endian...)
18380 case "$xxx_prompt" in
18382 rp="What is the order of bytes in $uvtype?"
18395 : Checking 32bit aligndness
18398 Checking to see whether you can access character data unalignedly...
18400 case "$d_u32align" in
18401 '') $cat >try.c <<EOCP
18403 #$i_stdlib I_STDLIB
18405 #include <stdlib.h>
18407 #define U32 $u32type
18408 #define BYTEORDER 0x$byteorder
18410 #include <signal.h>
18412 $signal_t bletch(int s) { exit(4); }
18415 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18420 if (sizeof(U32) != 4) {
18421 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18428 signal(SIGBUS, bletch);
18440 for (i = 0; i < 4; i++) {
18441 up = (U32*)(buf + i);
18442 if (! ((*up == 1 << (8*i)) || /* big-endian */
18443 (*up == 1 << (8*(3-i))) /* little-endian */
18447 printf("read failed (%x)\n", *up);
18453 for (i = 0; i < 4; i++) {
18454 up = (U32*)(buf + i);
18456 if (*up != 0xBeef) {
18457 printf("write failed (%x)\n", *up);
18471 if eval $compile_ok; then
18472 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18473 $run ./try 2>&1 >/dev/null
18476 You can access character data pretty unalignedly.
18478 d_u32align="$undef"
18481 It seems that you must access character data in an aligned manner.
18483 d_u32align="$define"
18487 rp='Can you access character data at unaligned addresses?'
18491 [yY]*) d_u32align="$undef" ;;
18492 *) d_u32align="$define" ;;
18499 : see if ualarm exists
18500 set ualarm d_ualarm
18503 : see if umask exists
18507 : see if unordered exists
18508 set unordered d_unordered
18511 : see if unsetenv exists
18512 set unsetenv d_unsetenv
18515 : see if usleep exists
18516 set usleep d_usleep
18519 : see if prototype for usleep is available
18521 set d_usleepproto usleep $i_unistd unistd.h
18524 : see if ustat exists
18528 : see if closedir exists
18529 set closedir d_closedir
18532 case "$d_closedir" in
18535 echo "Checking whether closedir() returns a status..." >&4
18537 #$i_dirent I_DIRENT /**/
18538 #$i_sysdir I_SYS_DIR /**/
18539 #$i_sysndir I_SYS_NDIR /**/
18540 #$i_systypes I_SYS_TYPES /**/
18542 #if defined(I_SYS_TYPES)
18543 #include <sys/types.h>
18545 #if defined(I_DIRENT)
18546 #include <dirent.h>
18547 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18548 #include <sys/dir.h>
18552 #include <sys/ndir.h>
18556 #include <ndir.h> /* may be wrong in the future */
18558 #include <sys/dir.h>
18563 int main() { return closedir(opendir(".")); }
18566 if eval $compile_ok; then
18567 if $run ./try > /dev/null 2>&1 ; then
18568 echo "Yes, it does."
18571 echo "No, it doesn't."
18575 echo "(I can't seem to compile the test program--assuming it doesn't)"
18583 set d_void_closedir
18587 : see if there is a wait4
18591 : see if waitpid exists
18592 set waitpid d_waitpid
18595 : see if wcstombs exists
18596 set wcstombs d_wcstombs
18599 : see if wctomb exists
18600 set wctomb d_wctomb
18603 : see if writev exists
18604 set writev d_writev
18607 : preserve RCS keywords in files with variable substitution, grrr
18612 Revision='$Revision'
18614 : check for alignment requirements
18616 case "$usecrosscompile$multiarch" in
18619 You seem to be either cross-compiling or doing a multiarchitecture build,
18620 skipping the memory alignment check.
18623 case "$alignbytes" in
18624 '') alignbytes=8 ;;
18628 case "$alignbytes" in
18629 '') echo "Checking alignment constraints..." >&4
18630 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18631 $cat >try.c <<'EOCP'
18632 typedef long double NV;
18635 $cat >try.c <<'EOCP'
18639 $cat >>try.c <<'EOCP'
18647 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18652 if eval $compile_ok; then
18656 echo "(I can't seem to compile the test program...)"
18659 *) dflt="$alignbytes"
18662 rp="Doubles must be aligned on a how-many-byte boundary?"
18670 : set the base revision
18673 : how do we concatenate cpp tokens here?
18675 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18676 $cat >cpp_stuff.c <<'EOCP'
18677 #define RCAT(a,b)a/**/b
18678 #define ACAT(a,b)a ## b
18682 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18683 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18684 echo "Oh! Smells like ANSI's been here." >&4
18685 echo "We can catify or stringify, separately or together!"
18687 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18688 echo "Ah, yes! The good old days!" >&4
18689 echo "However, in the good old days we don't know how to stringify and"
18690 echo "catify at the same time."
18694 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18695 You're going to have to edit the values of CAT[2-5] in config.h...
18697 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18701 : see if this is a db.h system
18707 : Check db version.
18709 echo "Checking Berkeley DB version ..." >&4
18715 #include <sys/types.h>
18717 #$i_stdlib I_STDLIB
18719 #include <stdlib.h>
18722 int main(int argc, char *argv[])
18724 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18725 int Major, Minor, Patch ;
18726 unsigned long Version ;
18727 (void)db_version(&Major, &Minor, &Patch) ;
18729 printf("%d %d %d %d %d %d\n",
18730 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18731 Major, Minor, Patch);
18734 printf("You have Berkeley DB Version 2 or greater.\n");
18736 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18737 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18738 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18739 Major, Minor, Patch) ;
18741 /* check that db.h & libdb are compatible */
18742 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18743 printf("db.h and libdb are incompatible.\n") ;
18747 printf("db.h and libdb are compatible.\n") ;
18749 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18750 + DB_VERSION_PATCH ;
18752 /* needs to be >= 2.3.4 */
18753 if (Version < 2003004) {
18754 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18755 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18761 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18766 printf("You have Berkeley DB Version 1.\n");
18767 exit(0); /* DB version < 2: the coast is clear. */
18769 exit(1); /* <db.h> not Berkeley DB? */
18775 if eval $compile_ok && $run ./try; then
18776 echo 'Looks OK.' >&4
18778 db_version_major=$1
18779 db_version_minor=$2
18780 db_version_patch=$3
18782 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18786 : Remove db from list of libraries to use
18787 echo "Removing unusable -ldb from library list" >&4
18788 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18791 echo "libs = $libs" >&4
18801 : Check the return type needed for hash
18803 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18809 #include <sys/types.h>
18812 #ifndef DB_VERSION_MAJOR
18813 u_int32_t hash_cb (ptr, size)
18821 info.hash = hash_cb;
18825 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18826 if $contains warning try.out >>/dev/null 2>&1 ; then
18829 db_hashtype='u_int32_t'
18832 : XXX Maybe we should just give up here.
18833 db_hashtype=u_int32_t
18835 echo "Help: I can't seem to compile the db test program." >&4
18836 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18839 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18841 *) db_hashtype=u_int32_t
18846 : Check the return type needed for prefix
18848 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18854 #include <sys/types.h>
18857 #ifndef DB_VERSION_MAJOR
18858 size_t prefix_cb (key1, key2)
18866 info.prefix = prefix_cb;
18870 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18871 if $contains warning try.out >>/dev/null 2>&1 ; then
18872 db_prefixtype='int'
18874 db_prefixtype='size_t'
18877 db_prefixtype='size_t'
18878 : XXX Maybe we should just give up here.
18880 echo "Help: I can't seem to compile the db test program." >&4
18881 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18884 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18886 *) db_prefixtype='size_t'
18890 : How can we generate normalized random numbers ?
18892 echo "Looking for a random number function..." >&4
18893 case "$randfunc" in
18895 if set drand48 val -f; eval $csym; $val; then
18897 echo "Good, found drand48()." >&4
18898 elif set random val -f; eval $csym; $val; then
18900 echo "OK, found random()." >&4
18903 echo "Yick, looks like I have to use rand()." >&4
18914 *-Dmy_rand=*|*-Dmy_srand=*)
18915 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18916 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18917 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18918 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18922 while $test "$cont"; do
18923 rp="Use which function to generate random numbers?"
18925 if $test "$ans" = "$dflt"; then
18931 if set $ans val -f; eval $csym; $val; then
18935 rp="I cannot find function $ans. Use that name anyway?"
18944 case "$randfunc" in
18946 drand01="drand48()"
18952 case "$randbits" in
18954 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18956 #$i_unistd I_UNISTD
18957 #$i_stdlib I_STDLIB
18960 # include <unistd.h>
18963 # include <stdlib.h>
18968 register unsigned long tmp;
18969 register unsigned long max = 0L;
18971 for (i = 1000; i; i--) {
18972 tmp = (unsigned long) $randfunc();
18973 if (tmp > max) max = tmp;
18975 for (i = 0; max; i++)
18981 if eval $compile_ok; then
18985 echo "(I can't seem to compile the test program...)"
18992 rp="How many bits does your $randfunc() function produce?"
18996 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18997 seedfunc="s$randfunc"
18998 randseedtype=unsigned
19002 rp="How many bits does your $randfunc() function produce?"
19005 seedfunc="s$randfunc"
19006 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
19007 if set $seedfunc val -f; eval $csym; $val; then
19008 echo "(Using $seedfunc() to seed random generator)"
19010 echo "(Warning: no $seedfunc() to seed random generator)"
19013 randseedtype=unsigned
19020 : Determine if this is an EBCDIC system
19022 echo "Determining whether or not we are on an EBCDIC system..." >&4
19023 $cat >try.c <<'EOM'
19026 if ('M'==0xd4) return 0;
19033 if eval $compile_ok; then
19034 if $run ./try; then
19035 echo "You seem to speak EBCDIC." >&4
19038 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
19041 echo "I'm unable to compile the test program." >&4
19042 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
19048 : Check how to flush
19051 Checking how to flush all pending stdio output...
19053 # I only know how to find the first 32 possibly open files on SunOS.
19054 # See also hints/sunos_4_1.sh and util.c --AD
19056 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19058 $cat >>try.c <<EOCP
19060 #$i_stdlib I_STDLIB
19062 #include <stdlib.h>
19064 #$i_unistd I_UNISTD
19066 # include <unistd.h>
19068 #$d_sysconf HAS_SYSCONF
19069 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19070 #ifdef HAS_STDIO_STREAM_ARRAY
19071 # define STDIO_STREAM_ARRAY $stdio_stream_array
19076 p = fopen("try.out", "w");
19080 # ifdef TRY_FPRINTF
19084 #ifdef TRY_FFLUSH_NULL
19087 #ifdef TRY_FFLUSH_ALL
19089 long open_max = -1;
19090 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19091 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19093 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19094 open_max = sysconf(_SC_OPEN_MAX);
19097 open_max = FOPEN_MAX;
19100 open_max = OPEN_MAX;
19109 # ifdef HAS_STDIO_STREAM_ARRAY
19110 if (open_max > 0) {
19112 for (i = 0; i < open_max; i++)
19113 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19114 STDIO_STREAM_ARRAY[i]._file < open_max &&
19115 STDIO_STREAM_ARRAY[i]._flag)
19116 fflush(&STDIO_STREAM_ARRAY[i]);
19124 : first we have to find out how _not_ to flush
19126 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19128 set try -DTRY_FPUTC
19129 if eval $compile; then
19130 $run ./try 2>/dev/null
19133 if $test ! -s try.out -a "X$code" = X42; then
19139 set try -DTRY_FPRINTF
19140 if eval $compile; then
19141 $run ./try 2>/dev/null
19144 if $test ! -s try.out -a "X$code" = X42; then
19145 output=-DTRY_FPRINTF
19151 : check for fflush NULL behaviour
19152 case "$fflushNULL" in
19153 '') set try -DTRY_FFLUSH_NULL $output
19154 if eval $compile; then
19155 $run ./try 2>/dev/null
19158 if $test -s try.out -a "X$code" = X42; then
19159 fflushNULL="`$cat try.out`"
19161 if $test "X$code" != X42; then
19163 (If this test failed, don't worry, we'll try another method shortly.)
19168 $rm -f core try.core core.try.*
19169 case "$fflushNULL" in
19171 Your fflush(NULL) works okay for output streams.
19172 Let's see if it clobbers input pipes...
19174 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19175 # bug that improperly flushes the input end of pipes. So we avoid the
19176 # autoflush on fork/system/exec support for now. :-(
19177 $cat >tryp.c <<EOCP
19180 main(int argc, char **argv)
19186 while ((i = getc(stdin)) != -1
19187 && (*bp++ = i) != '\n'
19188 && bp < &buf[1024])
19191 fprintf(stdout, "%s", buf);
19199 fflushNULL="$define"
19201 if eval $compile; then
19203 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19204 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19206 fflush(NULL) seems to behave okay with input streams.
19208 fflushNULL="$define"
19211 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19213 fflushNULL="$undef"
19216 $rm -f core tryp.c tryp.core core.tryp.*
19219 Your fflush(NULL) isn't working (contrary to ANSI C).
19221 fflushNULL="$undef"
19224 Cannot figure out whether your fflush(NULL) works or not.
19225 I'm assuming it doesn't (contrary to ANSI C).
19227 fflushNULL="$undef"
19231 $define|true|[yY]*)
19232 fflushNULL="$define"
19235 fflushNULL="$undef"
19238 : check explicit looping only if NULL did not work, and if the pipe
19239 : bug does not show up on an explicit flush too
19240 case "$fflushNULL" in
19242 $cat >tryp.c <<EOCP
19245 main(int argc, char **argv)
19251 while ((i = getc(stdin)) != -1
19252 && (*bp++ = i) != '\n'
19253 && bp < &buf[1024])
19256 fprintf(stdout, "%s", buf);
19265 if eval $compile; then
19267 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19268 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19270 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19272 : now check for fflushall behaviour
19273 case "$fflushall" in
19274 '') set try -DTRY_FFLUSH_ALL $output
19275 if eval $compile; then
19277 (Now testing the other method--but note that this also may fail.)
19279 $run ./try 2>/dev/null
19282 if $test -s try.out -a "X$code" = X42; then
19283 fflushall="`$cat try.out`"
19287 case "$fflushall" in
19289 Whew. Flushing explicitly all the stdio streams works.
19291 fflushall="$define"
19294 Sigh. Flushing explicitly all the stdio streams doesn't work.
19299 Cannot figure out whether flushing stdio streams explicitly works or not.
19300 I'm assuming it doesn't.
19306 "$define"|true|[yY]*)
19307 fflushall="$define"
19315 All is futile. Even fflush(stdin) clobbers input pipes!
19322 $rm -f core tryp.c tryp.core core.tryp.*
19324 *) fflushall="$undef"
19328 case "$fflushNULL$fflushall" in
19331 OK, I give up. I cannot figure out how to flush pending stdio output.
19332 We won't be flushing handles at all before fork/exec/popen.
19338 : Store the full pathname to the ar program for use in the C program
19339 : Respect a hint or command line value for full_ar.
19344 : Store the full pathname to the sed program for use in the C program
19347 : see what type gids are declared as in the kernel
19349 echo "Looking for the type for group ids returned by getgid()."
19350 set gid_t gidtype xxx stdio.h sys/types.h
19354 xxx=`./findhdr sys/user.h`
19355 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19357 unsigned) dflt="$1 $2" ;;
19361 *) dflt="$gidtype";;
19364 gid_t) echo "gid_t found." ;;
19365 *) rp="What is the type for group ids returned by getgid()?"
19371 : Check the size of GID
19374 *_t) zzz="$gidtype" ;;
19377 echo "Checking the size of $zzz..." >&4
19379 #include <sys/types.h>
19381 #$i_stdlib I_STDLIB
19383 #include <stdlib.h>
19386 printf("%d\n", (int)sizeof($gidtype));
19391 if eval $compile_ok; then
19395 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19398 echo "Your $zzz is $gidsize bytes long."
19403 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19407 : Check if GID is signed
19410 *_t) zzz="$gidtype" ;;
19413 echo "Checking the sign of $zzz..." >&4
19415 #include <sys/types.h>
19426 if eval $compile; then
19430 echo "(I can't execute the test program--guessing unsigned.)" >&4
19434 1) echo "Your $zzz is unsigned." ;;
19435 -1) echo "Your $zzz is signed." ;;
19441 echo "(I can't compile the test program--guessing unsigned.)" >&4
19445 : Check 64bit sizes
19448 if $test X"$quadtype" != X; then
19450 echo "Checking how to print 64-bit integers..." >&4
19452 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19453 $cat >try.c <<'EOCP'
19454 #include <sys/types.h>
19457 int q = 12345678901;
19458 printf("%ld\n", q);
19462 if eval $compile; then
19466 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19467 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19468 echo "We will use %d."
19474 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19475 $cat >try.c <<'EOCP'
19476 #include <sys/types.h>
19479 long q = 12345678901;
19480 printf("%ld\n", q);
19484 if eval $compile; then
19488 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19489 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19490 echo "We will use %ld."
19496 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19497 $cat >try.c <<'EOCP'
19498 #include <sys/types.h>
19499 #include <inttypes.h>
19502 int64_t q = 12345678901;
19503 printf("%" PRId64 "\n", q);
19507 if eval $compile; then
19511 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19512 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19513 echo "We will use the C9X style."
19519 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19521 #include <sys/types.h>
19524 $quadtype q = 12345678901;
19525 printf("%Ld\n", q);
19529 if eval $compile; then
19533 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19534 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19535 echo "We will use %Ld."
19541 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19542 $cat >try.c <<'EOCP'
19543 #include <sys/types.h>
19546 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19547 printf("%lld\n", q);
19551 if eval $compile; then
19555 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19556 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19557 echo "We will use the %lld style."
19563 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19565 #include <sys/types.h>
19568 $quadtype q = 12345678901;
19569 printf("%qd\n", q);
19573 if eval $compile; then
19577 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19578 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19579 echo "We will use %qd."
19585 if $test X"$sPRId64" = X; then
19586 echo "Cannot figure out how to print 64-bit integers." >&4
19593 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19594 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19596 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19597 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19601 : Check format strings for internal types
19603 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19605 if $test X"$ivsize" = X8; then
19606 ivdformat="$sPRId64"
19607 uvuformat="$sPRIu64"
19608 uvoformat="$sPRIo64"
19609 uvxformat="$sPRIx64"
19610 uvXUformat="$sPRIXU64"
19612 if $test X"$ivsize" = X"$longsize"; then
19619 if $test X"$ivsize" = X"$intsize"; then
19627 if $test X"$ivsize" = X"$shortsize"; then
19638 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19639 nveformat="$sPRIeldbl"
19640 nvfformat="$sPRIfldbl"
19641 nvgformat="$sPRIgldbl"
19642 nvEUformat="$sPRIEUldbl"
19643 nvFUformat="$sPRIFUldbl"
19644 nvGUformat="$sPRIGUldbl"
19654 case "$ivdformat" in
19655 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19660 : Check format string for GID
19663 $echo "Checking the format string to be used for gids..." >&4
19666 -1) if $test X"$gidsize" = X"$ivsize"; then
19667 gidformat="$ivdformat"
19669 if $test X"$gidsize" = X"$longsize"; then
19672 if $test X"$gidsize" = X"$intsize"; then
19675 if $test X"$gidsize" = X"$shortsize"; then
19682 *) if $test X"$gidsize" = X"$uvsize"; then
19683 gidformat="$uvuformat"
19685 if $test X"$gidsize" = X"$longsize"; then
19688 if $test X"$gidsize" = X"$intsize"; then
19691 if $test X"$gidsize" = X"$shortsize"; then
19700 : see if getgroups exists
19701 set getgroups d_getgrps
19704 : see if setgroups exists
19705 set setgroups d_setgrps
19708 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19710 case "$d_getgrps$d_setgrps" in
19712 case "$groupstype" in
19713 '') dflt="$gidtype" ;;
19714 *) dflt="$groupstype" ;;
19717 What type of pointer is the second argument to getgroups() and setgroups()?
19718 Usually this is the same as group ids, $gidtype, but not always.
19721 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19725 *) groupstype="$gidtype";;
19728 : MAD = Misc Attribute Definition
19730 if $test $patchlevel -lt 9; then
19731 : MAD is not available in 5.8.x or earlier.
19735 $define|true|[yY]*) dflt='y' ;;
19740 Would you like to build with Misc Attribute Decoration? This is development
19741 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19742 overhead on the interpreter.
19744 If this doesn't make any sense to you, just accept the default '$dflt'.
19746 rp='Build Perl with MAD?'
19751 madlyh='madly.h madly.act madly.tab'
19753 madlyobj="madly$_o" ;;
19762 : check whether make sets MAKE
19764 echo "Checking if your $make program sets \$(MAKE)..." >&4
19765 case "$make_set_make" in
19767 $sed 's/^X //' > testmake.mak << 'EOF'
19769 X @echo 'maketemp="$(MAKE)"'
19771 case "`$make -f testmake.mak 2>/dev/null`" in
19772 *maketemp=*) make_set_make='#' ;;
19773 *) make_set_make="MAKE=$make" ;;
19775 $rm -f testmake.mak
19778 case "$make_set_make" in
19779 '#') echo "Yup, it does.";;
19780 *) echo "Nope, it doesn't.";;
19783 : see what type is used for mode_t
19784 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19785 set mode_t modetype int stdio.h sys/types.h
19788 : see if we need va_copy
19790 case "$i_stdarg" in
19793 #include <stdarg.h>
19795 #$i_stdlib I_STDLIB
19797 #include <stdlib.h>
19799 #include <signal.h>
19802 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19804 return vfprintf(f, fmt, *valp);
19808 myvfprintf(FILE *f, const char *fmt, va_list val)
19810 return ivfprintf(f, fmt, &val);
19814 myprintf(char *fmt, ...)
19817 va_start(val, fmt);
19818 return myvfprintf(stdout, fmt, val);
19822 main(int ac, char **av)
19824 signal(SIGSEGV, exit);
19826 myprintf("%s%cs all right, then\n", "that", '\'');
19831 if eval $compile && $run ./try 2>&1 >/dev/null; then
19832 case "`$run ./try`" in
19833 "that's all right, then")
19839 yes) echo "It seems that you don't need va_copy()." >&4
19840 need_va_copy="$undef"
19842 *) echo "It seems that va_copy() or similar will be needed." >&4
19843 need_va_copy="$define"
19848 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19852 : see what type is used for size_t
19853 rp="What is the type used for the length parameter for string functions?"
19854 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19857 : check for type of arguments to gethostbyaddr.
19858 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19859 case "$d_gethbyaddr" in
19863 Checking to see what type of arguments are accepted by gethostbyaddr().
19865 hdrs="$define sys/types.h
19866 $d_socket sys/socket.h
19867 $i_niin netinet/in.h
19869 $i_unistd unistd.h"
19870 : The first arg can 'char *' or 'void *'
19871 : The second arg is some of integral type
19872 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19873 for yyy in size_t long int; do
19874 case "$netdb_host_type" in
19875 '') try="$extern_C struct hostent *gethostbyaddr($xxx, $yyy, int);"
19876 if ./protochk "$try" $hdrs; then
19877 echo "Your system accepts $xxx for the first arg."
19878 echo "...and $yyy for the second arg."
19879 netdb_host_type="$xxx"
19880 netdb_hlen_type="$yyy"
19886 : In case none of those worked, prompt the user.
19887 case "$netdb_host_type" in
19888 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19891 netdb_host_type=$ans
19892 rp='What is the type for the 2nd argument to gethostbyaddr?'
19895 netdb_hlen_type=$ans
19899 *) : no gethostbyaddr, so pick harmless defaults
19900 netdb_host_type='char *'
19901 netdb_hlen_type="$sizetype"
19904 # Remove the "const" if needed. -- but then we'll have a
19906 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19909 : check for type of argument to gethostbyname.
19910 if test "X$netdb_name_type" = X ; then
19911 case "$d_gethbyname" in
19915 Checking to see what type of argument is accepted by gethostbyname().
19917 hdrs="$define sys/types.h
19918 $d_socket sys/socket.h
19919 $i_niin netinet/in.h
19921 $i_unistd unistd.h"
19922 for xxx in "const char *" "char *"; do
19923 case "$netdb_name_type" in
19924 '') try="$extern_C struct hostent *gethostbyname($xxx);"
19925 if ./protochk "$try" $hdrs; then
19926 echo "Your system accepts $xxx."
19927 netdb_name_type="$xxx"
19932 : In case none of those worked, prompt the user.
19933 case "$netdb_name_type" in
19934 '') rp='What is the type for the 1st argument to gethostbyname?'
19937 netdb_name_type=$ans
19941 *) : no gethostbyname, so pick harmless default
19942 netdb_name_type='char *'
19947 : check for type of 1st argument to getnetbyaddr.
19948 if test "X$netdb_net_type" = X ; then
19949 case "$d_getnbyaddr" in
19953 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19955 hdrs="$define sys/types.h
19956 $d_socket sys/socket.h
19957 $i_niin netinet/in.h
19959 $i_unistd unistd.h"
19960 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19961 case "$netdb_net_type" in
19962 '') try="$extern_C struct netent *getnetbyaddr($xxx, int);"
19963 if ./protochk "$try" $hdrs; then
19964 echo "Your system accepts $xxx."
19965 netdb_net_type="$xxx"
19970 : In case none of those worked, prompt the user.
19971 case "$netdb_net_type" in
19972 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19975 netdb_net_type=$ans
19979 *) : no getnetbyaddr, so pick harmless default
19980 netdb_net_type='long'
19984 : locate the preferred pager for this system
19991 [a-zA-Z]:/*) dflt=$pg;;
19995 [a-zA-Z]:/*) dflt=$more;;
19999 [a-zA-Z]:/*) dflt=$less;;
20002 '') dflt=/usr/ucb/more;;
20010 rp='What pager is used on your system?'
20014 : see what type pids are declared as in the kernel
20015 rp="What is the type of process ids on this system?"
20016 set pid_t pidtype int stdio.h sys/types.h
20019 : see if ar generates random libraries by itself
20021 echo "Checking how to generate random libraries on your machine..." >&4
20022 echo 'int bar1() { return bar2(); }' > bar1.c
20023 echo 'int bar2() { return 2; }' > bar2.c
20025 #$i_stdlib I_STDLIB
20027 #include <stdlib.h>
20029 int main() { printf("%d\n", bar1()); exit(0); }
20031 $cc $ccflags -c bar1.c >/dev/null 2>&1
20032 $cc $ccflags -c bar2.c >/dev/null 2>&1
20033 $cc $ccflags -c foo.c >/dev/null 2>&1
20034 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
20035 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20036 $run ./foobar >/dev/null 2>&1; then
20037 echo "$ar appears to generate random libraries itself."
20039 if [ "X$ranlib" = "X" ]; then
20042 elif $ar s bar$_a >/dev/null 2>&1 &&
20043 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20044 $run ./foobar >/dev/null 2>&1; then
20045 echo "a table of contents needs to be added with '$ar s'."
20048 elif $ar ts bar$_a >/dev/null 2>&1 &&
20049 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
20050 $run ./foobar >/dev/null 2>&1; then
20051 echo "a table of contents needs to be added with '$ar ts'."
20058 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20059 $test -f $ranlib || ranlib=''
20062 if $test -n "$ranlib"; then
20063 echo "your system has '$ranlib'; we'll use that."
20066 echo "your system doesn't seem to support random libraries"
20067 echo "so we'll use lorder and tsort to order the libraries."
20074 : see if this is a values.h system
20075 set values.h i_values
20078 : Check the max offset that gmtime and localtime accept
20079 echo "Checking max offsets that gmtime () accepts"
20082 define) yyy="#include <values.h>" ;;
20086 case "$sGMTIME_min/$sGMTIME_max" in
20089 #include <sys/types.h>
20098 void gm_check (time_t t, int min_year, int max_year)
20101 if ( tmp == NULL ||
20102 /* Check tm_year overflow */
20103 tmp->tm_year < min_year || tmp->tm_year > max_year)
20114 gm_check (MAXLONG, 69, 0x7fffffff);
20116 if (tmp == NULL || tmp->tm_year < 0) {
20117 for (i = 63; i >= 0; i--) {
20118 time_t x = pt | ((time_t)1 << i);
20119 if (x < 0 || x < pt) continue;
20120 gm_check (x, 69, 0x7fffffff);
20123 printf ("sGMTIME_max=%ld\n", pt);
20132 gm_check (MINLONG, -1900, 70);
20135 for (i = 36; i >= 0; i--) {
20136 time_t x = pt - ((time_t)1 << i);
20137 if (x > 0) continue;
20138 gm_check (x, -1900, 70);
20141 printf ("sGMTIME_min=%ld\n", pt);
20145 int main (int argc, char *argv[])
20147 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20154 if eval $compile; then
20157 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20163 echo "Checking max offsets that localtime () accepts"
20165 case "$sLOCALTIME_min/$sLOCALTIME_max" in
20168 #include <sys/types.h>
20177 void local_check (time_t t, int min_year, int max_year)
20179 if (sizeof (time_t) > 4 && t > 0x7ffffffffffff000LL)
20182 tmp = localtime (&t);
20183 if ( tmp == NULL ||
20184 /* Check tm_year overflow */
20185 tmp->tm_year < min_year || tmp->tm_year > max_year)
20189 } /* local_check */
20196 local_check (MAXLONG, 69, 0x7fffffff);
20198 if (tmp == NULL || tmp->tm_year < 0) {
20199 for (i = 63; i >= 0; i--) {
20200 time_t x = pt | ((time_t)1 << i);
20201 if (x < 0 || x < pt) continue;
20202 local_check (x, 69, 0x7fffffff);
20205 printf ("sLOCALTIME_max=%ld\n", pt);
20214 local_check (MINLONG, -1900, 70);
20217 for (i = 36; i >= 0; i--) {
20218 time_t x = pt - ((time_t)1 << i);
20219 if (x > 0) continue;
20220 local_check (x, -1900, 70);
20223 printf ("sLOCALTIME_min=%ld\n", pt);
20227 int main (int argc, char *argv[])
20235 if eval $compile; then
20238 echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
20244 : check for type of arguments to select.
20245 case "$selecttype" in
20246 '') case "$d_select" in
20250 Checking to see what type of arguments are accepted by select().
20252 hdrs="$define sys/types.h
20253 $i_systime sys/time.h
20254 $i_sysselct sys/select.h
20255 $d_socket sys/socket.h"
20256 : The first arg can be int, unsigned, or size_t
20257 : The last arg may or may not be 'const'
20259 : void pointer has been seen but using that
20260 : breaks the selectminbits test
20261 for xxx in 'fd_set *' 'int *'; do
20262 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20263 for tmo in 'struct timeval *' 'const struct timeval *'; do
20265 '') try="$extern_C select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20266 if ./protochk "$try" $hdrs; then
20267 echo "Your system accepts $xxx."
20276 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20277 case "$d_fd_set" in
20278 $define) dflt="fd_set *" ;;
20287 *) : no select, so pick a harmless default
20294 : check for the select 'width'
20295 case "$selectminbits" in
20296 '') safebits=`expr $ptrsize \* 8`
20297 case "$d_select" in
20301 Checking to see on how many bits at a time your select() operates...
20304 #include <sys/types.h>
20306 #$i_systime I_SYS_TIME
20307 #$i_systimek I_SYS_TIME_KERNEL
20312 # ifdef I_SYS_TIME_KERNEL
20315 # include <sys/time.h>
20316 # ifdef I_SYS_TIME_KERNEL
20320 #$i_sysselct I_SYS_SELECT
20321 #ifdef I_SYS_SELECT
20322 #include <sys/select.h>
20324 #$d_socket HAS_SOCKET
20326 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20329 #$i_stdlib I_STDLIB
20331 #include <stdlib.h>
20334 #define S sizeof(*(b))
20336 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20337 #define NBITS (NBYTES * 8)
20339 char *s = (char *)malloc(NBYTES);
20348 fp = fopen("try.c", "r");
20354 b = ($selecttype)s;
20355 for (i = 0; i < NBITS; i++)
20359 select(fd + 1, b, 0, 0, &t);
20360 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20362 printf("%d\n", i + 1);
20367 if eval $compile_ok; then
20368 selectminbits=`$run ./try`
20369 case "$selectminbits" in
20371 Cannot figure out on how many bits at a time your select() operates.
20372 I'll play safe and guess it is $safebits bits.
20374 selectminbits=$safebits
20375 bits="$safebits bits"
20378 *) bits="$selectminbits bits" ;;
20380 echo "Your select() operates on $bits at a time." >&4
20382 rp='What is the minimum number of bits your select() operates on?'
20383 case "$byteorder" in
20384 12345678) dflt=64 ;;
20390 selectminbits="$val"
20394 *) : no select, so pick a harmless default
20395 selectminbits=$safebits
20401 : Trace out the files included by signal.h, then look for SIGxxx names.
20402 if [ "X$fieldn" = X ]; then
20403 : Just make some guesses. We check them later.
20404 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20406 xxx=`echo '#include <signal.h>' |
20407 $cppstdin $cppminus $cppflags 2>/dev/null |
20408 $grep '^[ ]*#.*include' |
20409 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20410 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20413 for xx in $xxx /dev/null ; do
20414 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20416 case "$xxxfiles" in
20417 '') xxxfiles=`./findhdr signal.h` ;;
20420 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20421 print substr($2, 4, 20)
20423 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20424 print substr($3, 4, 20)
20426 : Append some common names just in case the awk scan failed.
20427 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20428 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20429 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20430 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20431 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20433 : generate a few handy files for later
20434 $cat > signal.c <<EOCP
20435 #include <sys/types.h>
20436 #include <signal.h>
20437 #$i_stdlib I_STDLIB
20439 #include <stdlib.h>
20444 /* Strange style to avoid deeply-nested #if/#else/#endif */
20447 # define NSIG (_NSIG)
20453 # define NSIG (SIGMAX+1)
20459 # define NSIG (SIG_MAX+1)
20465 # define NSIG (_SIG_MAX+1)
20471 # define NSIG (MAXSIG+1)
20477 # define NSIG (MAX_SIG+1)
20482 # ifdef SIGARRAYSIZE
20483 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20489 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20493 /* Default to some arbitrary number that's big enough to get most
20494 of the common signals.
20500 printf("NSIG %d\n", NSIG);
20506 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20508 printf "#ifdef SIG"; printf $1; printf "\n"
20509 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20510 printf $1; printf ");\n"
20514 printf "#endif /* JUST_NSIG */\n";
20515 printf "exit(0);\n}\n";
20518 $cat >signal.awk <<'EOP'
20519 BEGIN { ndups = 0 }
20520 $1 ~ /^NSIG$/ { nsig = $2 }
20521 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20522 if ($2 > maxsig) { maxsig = $2 }
20523 if (sig_name[$2]) {
20524 dup_name[ndups] = $1
20525 dup_num[ndups] = $2
20537 printf("NSIG %d\n", nsig);
20538 for (n = 1; n < nsig; n++) {
20540 printf("%s %d\n", sig_name[n], sig_num[n])
20543 printf("NUM%d %d\n", n, n)
20546 for (n = 0; n < ndups; n++) {
20547 printf("%s %d\n", dup_name[n], dup_num[n])
20551 $cat >signal_cmd <<EOS
20553 if $test -s signal.lst; then
20554 echo "Using your existing signal.lst file"
20559 $cat >>signal_cmd <<'EOS'
20562 if eval $compile_ok; then
20563 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20564 $uniq | $awk -f signal.awk >signal.lst
20566 echo "(I can't seem be able to compile the whole test program)" >&4
20567 echo "(I'll try it in little pieces.)" >&4
20568 set signal -DJUST_NSIG
20569 if eval $compile_ok; then
20570 $run ./signal$_exe > signal.nsg
20573 echo "I can't seem to figure out how many signals you have." >&4
20574 echo "Guessing 50." >&4
20575 echo 'NSIG 50' > signal.nsg
20577 : Now look at all the signal names, one at a time.
20578 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20579 $cat > signal.c <<EOCP
20580 #include <sys/types.h>
20581 #include <signal.h>
20584 printf("$xx %d\n", SIG${xx});
20589 if eval $compile; then
20590 echo "SIG${xx} found."
20591 $run ./signal$_exe >> signal.ls1
20593 echo "SIG${xx} NOT found."
20596 if $test -s signal.ls1; then
20597 $cat signal.nsg signal.ls1 |
20598 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20602 if $test -s signal.lst; then
20605 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20606 echo 'kill -l' >signal
20607 set X `csh -f <signal`
20611 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20613 echo $@ | $tr ' ' $trnl | \
20614 $awk '{ printf "%s %d\n", $1, ++s; }
20615 END { printf "NSIG %d\n", ++s }' >signal.lst
20617 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20619 chmod a+x signal_cmd
20620 $eunicefix signal_cmd
20622 : generate list of signal names
20624 case "$sig_name_init" in
20626 *) case "$sig_num_init" in
20627 ''|*,*) doinit=yes ;;
20632 echo "Generating a list of signal names and numbers..." >&4
20634 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20635 sig_name=`$awk 'BEGIN { printf "ZERO " }
20636 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20637 sig_num=`$awk 'BEGIN { printf "0 " }
20638 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20639 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20640 !/^NSIG/ { printf "\"%s\", ", $1 }
20641 END { printf "0\n" }' signal.lst`
20642 sig_num_init=`$awk 'BEGIN { printf "0, " }
20643 !/^NSIG/ { printf "%d, ", $2}
20644 END { printf "0\n"}' signal.lst`
20647 echo "The following $sig_count signals are available:"
20649 echo $sig_name | $awk \
20650 'BEGIN { linelen = 0 }
20652 for (i = 1; i <= NF; i++) {
20653 name = "SIG" $i " "
20654 linelen = linelen + length(name)
20655 if (linelen > 70) {
20657 linelen = length(name)
20663 sig_size=`echo $sig_name | awk '{print NF}'`
20664 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20666 : Check size of size
20668 case "$sizetype" in
20669 *_t) zzz="$sizetype" ;;
20670 *) zzz="filesize" ;;
20672 echo "Checking the size of $zzz..." >&4
20674 #include <sys/types.h>
20676 #$i_stdlib I_STDLIB
20678 #include <stdlib.h>
20681 printf("%d\n", (int)sizeof($sizetype));
20686 if eval $compile_ok; then
20690 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20693 echo "Your $zzz size is $sizesize bytes."
20698 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20702 : check for socklen_t
20704 echo "Checking to see if you have socklen_t..." >&4
20706 #include <sys/types.h>
20707 #$d_socket HAS_SOCKET
20709 #include <sys/socket.h>
20711 int main() { socklen_t x = 16; }
20714 if eval $compile; then
20716 echo "You have socklen_t."
20719 echo "You do not have socklen_t."
20720 case "$sizetype" in
20721 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20728 : see if this is a socks.h system
20729 set socks.h i_socks
20732 : check for type of the size argument to socket calls
20733 case "$d_socket" in
20737 Checking to see what type is the last argument of accept().
20740 case "$d_socklen_t" in
20741 "$define") yyy="$yyy socklen_t"
20743 yyy="$yyy $sizetype int long unsigned"
20744 for xxx in $yyy; do
20745 case "$socksizetype" in
20746 '') try="$extern_C int accept(int, struct sockaddr *, $xxx *);"
20747 case "$usesocks" in
20749 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20750 echo "Your system accepts '$xxx *' for the last argument of accept()."
20751 socksizetype="$xxx"
20754 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20755 echo "Your system accepts '$xxx *' for the last argument of accept()."
20756 socksizetype="$xxx"
20763 : In case none of those worked, prompt the user.
20764 case "$socksizetype" in
20765 '') rp='What is the type for socket address structure sizes?'
20772 *) : no sockets, so pick relatively harmless default
20777 : see what type is used for signed size_t
20778 set ssize_t ssizetype int stdio.h sys/types.h
20783 #$i_stdlib I_STDLIB
20785 #include <stdlib.h>
20787 #include <sys/types.h>
20788 #define Size_t $sizetype
20789 #define SSize_t $dflt
20792 if (sizeof(Size_t) == sizeof(SSize_t))
20794 else if (sizeof(Size_t) == sizeof(int))
20803 if eval $compile_ok && $run ./try > /dev/null; then
20804 ssizetype=`$run ./try`
20805 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20808 Help! I can't compile and run the ssize_t test program: please enlighten me!
20809 (This is probably a misconfiguration in your system or libraries, and
20810 you really ought to fix it. Still, I'll try anyway.)
20812 I need a type that is the same size as $sizetype, but is guaranteed to
20813 be signed. Common values are ssize_t, int and long.
20816 rp="What signed type is the same size as $sizetype?"
20822 : see what type of char stdio uses.
20824 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20825 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20826 echo "Your stdio uses unsigned chars." >&4
20827 stdchar="unsigned char"
20829 echo "Your stdio uses signed chars." >&4
20834 : see what type uids are declared as in the kernel
20836 echo "Looking for the type for user ids returned by getuid()."
20837 set uid_t uidtype xxx stdio.h sys/types.h
20841 xxx=`./findhdr sys/user.h`
20842 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20844 unsigned) dflt="$1 $2" ;;
20848 *) dflt="$uidtype";;
20851 uid_t) echo "uid_t found." ;;
20852 *) rp="What is the type for user ids returned by getuid()?"
20858 : Check size of UID
20861 *_t) zzz="$uidtype" ;;
20864 echo "Checking the size of $zzz..." >&4
20866 #include <sys/types.h>
20868 #$i_stdlib I_STDLIB
20870 #include <stdlib.h>
20873 printf("%d\n", (int)sizeof($uidtype));
20878 if eval $compile_ok; then
20882 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20885 echo "Your $zzz is $uidsize bytes long."
20890 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20893 : Check if UID is signed
20896 *_t) zzz="$uidtype" ;;
20899 echo "Checking the sign of $zzz..." >&4
20901 #include <sys/types.h>
20912 if eval $compile; then
20916 echo "(I can't execute the test program--guessing unsigned.)" >&4
20920 1) echo "Your $zzz is unsigned." ;;
20921 -1) echo "Your $zzz is signed." ;;
20927 echo "(I can't compile the test program--guessing unsigned.)" >&4
20931 : Check format string for UID
20933 $echo "Checking the format string to be used for uids..." >&4
20936 -1) if $test X"$uidsize" = X"$ivsize"; then
20937 uidformat="$ivdformat"
20939 if $test X"$uidsize" = X"$longsize"; then
20942 if $test X"$uidsize" = X"$intsize"; then
20945 if $test X"$uidsize" = X"$shortsize"; then
20952 *) if $test X"$uidsize" = X"$uvsize"; then
20953 uidformat="$uvuformat"
20955 if $test X"$uidsize" = X"$longsize"; then
20958 if $test X"$uidsize" = X"$intsize"; then
20961 if $test X"$uidsize" = X"$shortsize"; then
20970 : Check if site customization support was requested
20971 case "$usesitecustomize" in
20972 $define|true|[Yy]*)
20973 usesitecustomize="$define"
20976 usesitecustomize="$undef"
20980 : determine compiler compiler
20989 if $test -f "$byacc$_exe"; then
20991 comp="byacc or $comp"
20993 if $test -f "$bison$_exe"; then
20994 comp="$comp or bison -y"
20996 rp="Which compiler compiler ($comp) shall I use?"
21005 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
21011 : see if this is a assert.h system
21012 set assert.h i_assert
21015 : see if this is a fp.h system
21019 : see if this is a fp_class.h system
21020 set fp_class.h i_fp_class
21023 : see if gdbm.h is available
21028 : see if gdbm_open exists
21029 set gdbm_open d_gdbm_open
21031 case "$d_gdbm_open" in
21034 echo "We won't be including <gdbm.h>"
21043 : see if ndbm.h is available
21046 : Compatibility location for RedHat 7.1
21047 set gdbm/ndbm.h i_gdbmndbm
21049 : Compatibility location for Debian 4.0
21050 set gdbm-ndbm.h i_gdbm_ndbm
21053 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
21054 : see if dbm_open exists
21055 set dbm_open d_dbm_open
21057 case "$d_dbm_open" in
21060 i_gdbmndbm="$undef"
21061 i_gdbm_ndbm="$undef"
21062 echo "We won't be including <ndbm.h>"
21072 : see if this is a ieeefp.h system
21073 case "$i_ieeefp" in
21074 '' ) set ieeefp.h i_ieeefp
21079 : see if this is a libutil.h system
21080 set libutil.h i_libutil
21083 : see if mach cthreads are available
21084 if test "X$usethreads" = "X$define"; then
21085 set mach/cthreads.h i_machcthr
21088 i_machcthr="$undef"
21091 : see if this is a mntent.h system
21092 set mntent.h i_mntent
21095 : see if net/errno.h is available
21097 set net/errno.h val
21100 : Unfortunately, it causes problems on some systems. Arrgh.
21103 cat > try.c <<'EOM'
21106 #include <net/errno.h>
21112 if $cc $ccflags -c try.c >/dev/null 2>&1; then
21113 echo "We'll be including <net/errno.h>." >&4
21115 echo "We won't be including <net/errno.h>." >&4
21124 : see if netinet/tcp.h is available
21125 set netinet/tcp.h i_netinettcp
21128 : see if this is a poll.h system
21132 : see if this is a prot.h system
21136 : Preprocessor symbols
21138 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
21139 $cat <<'EOSH' > Cppsym.know
21140 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21141 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21142 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21143 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21144 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21145 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21146 bull c cadmus clipper CMU COFF COMPILER_VERSION
21147 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21148 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21149 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21150 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21152 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21153 H3050R H3050RX hbullx20 hcx host_mips
21154 hp200 hp300 hp700 HP700 hp800 hp9000
21155 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21156 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21157 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21158 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21159 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21160 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21161 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21162 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21163 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21164 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21165 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21166 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21167 MATH_HAS_NO_SIDE_EFFECTS
21168 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21169 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21170 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21171 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21172 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21173 NetBSD news1500 news1700 news1800 news1900 news3700
21174 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21175 ns32016 ns32332 ns32k nsc32000
21176 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21177 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21178 pc532 pdp11 PGC PIC plexus PORTAR posix
21179 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21180 POSIX_C_SOURCE POSIX_SOURCE POWER
21181 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21182 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21183 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21184 sony sony_news sonyrisc sparc sparclite spectrum
21185 stardent stdc STDC_EXT stratos sun sun3 sun386
21186 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21187 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21188 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21189 sysV68 sysV88 Tek4132 Tek4300 titan
21190 TM3200 TM5400 TM5600
21191 tower tower32 tower32_200 tower32_600 tower32_700
21192 tower32_800 tower32_850 tss
21193 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21194 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21195 unix UNIX95 UNIX99 unixpc unos
21196 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21197 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21198 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21200 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21201 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21202 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21205 # Maybe put other stuff here too.
21206 cat <<EOSH >>Cppsym.know
21209 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21210 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21211 $cat Cppsym.know > Cppsym.c
21212 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21213 $rm -f Cppsym.a Cppsym.b Cppsym.c
21214 cat <<EOSH > Cppsym
21216 if $test \$# -gt 0; then
21217 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21218 if $test -s Cppsym.got; then
21225 $tr " " "$trnl" | ./Cppsym.try
21231 cat <<EOSH > Cppsym.try
21233 cat <<'EOCP' > try.c
21236 #define STRINGIFY(a) "a"
21238 #if cpp_stuff == 42
21239 #define StGiFy(a) #a
21240 #define STRINGIFY(a) StGiFy(a)
21242 #if $cpp_stuff != 1 && $cpp_stuff != 42
21243 # include "Bletch: How does this C preprocessor stringify macros?"
21249 cat <<'EOSH' >> Cppsym.try
21251 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21252 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21253 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21254 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21256 echo 'return 0;}' >> try.c
21258 cat <<EOSH >> Cppsym.try
21260 case "$osname-$gccversion" in
21261 irix-) ccflags="\$ccflags -woff 1178" ;;
21262 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21264 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21266 chmod +x Cppsym.try
21267 $eunicefix Cppsym.try
21268 ./Cppsym < Cppsym.know > Cppsym.true
21269 : Add in any linux cpp "predefined macros":
21270 case "$osname::$gccversion" in
21273 rm -f $tHdrH'.h' $tHdrH
21275 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21276 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21277 if [ -s $tHdrH'_cppsym.real' ]; then
21278 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21281 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21284 : now check the C compiler for additional symbols
21285 postprocess_cc_v=''
21287 aix) postprocess_cc_v="|$tr , ' '" ;;
21294 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21297 -D*) echo "\$i" | $sed 's/^-D//';;
21298 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21303 postprocess_cc_v=''
21306 ./ccsym > ccsym1.raw
21307 if $test -s ccsym1.raw; then
21308 $sort ccsym1.raw | $uniq >ccsym.raw
21310 mv ccsym1.raw ccsym.raw
21313 $awk '/\=/ { print $0; next }
21314 { print $0"=1" }' ccsym.raw >ccsym.list
21315 $comm -13 Cppsym.true ccsym.list >ccsym.own
21316 $comm -12 Cppsym.true ccsym.list >ccsym.com
21317 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21319 if $test -z ccsym.raw; then
21320 echo "Your C compiler doesn't seem to define any symbols!" >&4
21322 echo "However, your C preprocessor defines the following symbols:"
21325 cppsymbols=`$cat Cppsym.true`
21326 cppsymbols=`echo $cppsymbols`
21327 cppccsymbols="$cppsymbols"
21329 if $test -s ccsym.com; then
21330 echo "Your C compiler and pre-processor define these symbols:"
21331 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21334 cppccsymbols=`$cat ccsym.com`
21335 cppccsymbols=`echo $cppccsymbols`
21336 $test "$silent" || sleep 1
21338 if $test -s ccsym.cpp; then
21339 $test "$also" && echo " "
21340 echo "Your C pre-processor ${also}defines the following symbols:"
21341 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21343 cppsymbols=`$cat ccsym.cpp`
21344 cppsymbols=`echo $cppsymbols`
21345 $test "$silent" || sleep 1
21347 if $test -s ccsym.own; then
21348 $test "$also" && echo " "
21349 echo "Your C compiler ${also}defines the following cpp symbols:"
21350 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21351 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21352 ccsymbols=`$cat ccsym.own`
21353 ccsymbols=`echo $ccsymbols`
21354 $test "$silent" || sleep 1
21358 : see if this is a termio system
21362 if $test `./findhdr termios.h`; then
21363 set tcsetattr i_termios
21369 "$define") echo "You have POSIX termios.h... good!" >&4;;
21370 *) if ./Cppsym pyr; then
21371 case "`/bin/universe`" in
21372 ucb) if $test `./findhdr sgtty.h`; then
21374 echo "<sgtty.h> found." >&4
21376 echo "System is pyramid with BSD universe."
21377 ./warn "<sgtty.h> not found--you could have problems."
21379 *) if $test `./findhdr termio.h`; then
21381 echo "<termio.h> found." >&4
21383 echo "System is pyramid with USG universe."
21384 ./warn "<termio.h> not found--you could have problems."
21388 if $test `./findhdr termio.h`; then
21389 echo "<termio.h> found." >&4
21391 elif $test `./findhdr sgtty.h`; then
21392 echo "<sgtty.h> found." >&4
21395 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21398 if $test `./findhdr sgtty.h`; then
21399 echo "<sgtty.h> found." >&4
21401 elif $test `./findhdr termio.h`; then
21402 echo "<termio.h> found." >&4
21405 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21409 set i_termio; eval $setvar
21410 val=$val2; set i_sgtty; eval $setvar
21411 val=$val3; set i_termios; eval $setvar
21413 : see if stddef is available
21414 set stddef.h i_stddef
21417 : see if sys/access.h is available
21418 set sys/access.h i_sysaccess
21421 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21422 set sys/filio.h i_sysfilio
21425 if $test `./findhdr sys/ioctl.h`; then
21427 echo '<sys/ioctl.h> found.' >&4
21430 if $test $i_sysfilio = "$define"; then
21431 echo '<sys/ioctl.h> NOT found.' >&4
21433 $test $i_sgtty = "$define" && xxx="sgtty.h"
21434 $test $i_termio = "$define" && xxx="termio.h"
21435 $test $i_termios = "$define" && xxx="termios.h"
21436 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21442 : see if socket ioctl defs are in sys/sockio.h
21444 xxx=`./findhdr sys/sockio.h`
21445 if $test "$xxx"; then
21446 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21448 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21451 echo "No socket ioctls found in <sys/sockio.h>." >&4
21456 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21462 : see if this is a syslog.h system
21463 set syslog.h i_syslog
21466 : see if this is a sys/mode.h system
21467 set sys/mode.h i_sysmode
21470 : see if there is a sys/poll.h file
21471 set sys/poll.h i_syspoll
21474 : see if sys/resource.h has to be included
21475 set sys/resource.h i_sysresrc
21478 : see if sys/security.h is available
21479 set sys/security.h i_syssecrt
21482 : see if this is a sys/statvfs.h system
21483 set sys/statvfs.h i_sysstatvfs
21486 : see if this is a sys/un.h system
21487 set sys/un.h i_sysun
21490 : see if this is a sys/utsname.h system
21491 set sys/utsname.h i_sysutsname
21494 : see if this is a syswait system
21495 set sys/wait.h i_syswait
21498 : see if this is a ustat.h system
21499 set ustat.h i_ustat
21502 : see if this is an utime system
21503 set utime.h i_utime
21506 : see if this is a vfork system
21509 set vfork.h i_vfork
21519 echo "Looking for extensions..." >&4
21520 : If we are using the old config.sh, known_extensions may contain
21521 : old or inaccurate or duplicate values.
21522 known_extensions=''
21523 nonxs_extensions=''
21524 : We do not use find because it might not be available.
21525 : We do not just use MANIFEST because the user may have dropped
21526 : some additional extensions into the source tree and expect them
21529 : Function to recursively find available extensions, ignoring DynaLoader
21530 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21534 DynaLoader|dynaload) ;;
21536 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21537 known_extensions="$known_extensions $1$xxx";
21538 elif $test -f $xxx/Makefile.PL; then
21539 nonxs_extensions="$nonxs_extensions $1$xxx";
21541 if $test -d $xxx -a $# -lt 10; then
21544 eval $find_extensions;
21556 eval $find_extensions
21557 # Special case: Add in modules that nest beyond the first level.
21558 # Currently threads/shared and Hash/Util/FieldHash, since they are
21559 # not picked up by the recursive find above (and adding in general
21560 # recursive finding breaks SDBM_File/sdbm).
21561 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21562 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21563 set X $known_extensions
21565 known_extensions="$*"
21566 set X $nonxs_extensions
21568 nonxs_extensions="$*"
21571 : Now see which are supported on this system.
21573 for xxx in $known_extensions ; do
21577 $define) avail_ext="$avail_ext $xxx" ;;
21580 GDBM_File|gdbm_fil)
21582 $define) avail_ext="$avail_ext $xxx" ;;
21585 I18N/Langinfo|i18n_lan)
21586 case "$i_langinfo$d_nl_langinfo" in
21587 $define$define) avail_ext="$avail_ext $xxx" ;;
21591 : XXX Do we need a useipcsysv variable here
21592 case "${d_msg}${d_sem}${d_shm}" in
21593 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21596 NDBM_File|ndbm_fil)
21599 case "$osname-$use64bitint" in
21602 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21605 *) avail_ext="$avail_ext $xxx" ;;
21610 ODBM_File|odbm_fil)
21611 case "${i_dbm}${i_rpcsvcdbm}" in
21613 case "$d_cplusplus" in
21614 define) ;; # delete as a function name will not work
21615 *) case "$osname-$use64bitint" in
21618 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21621 *) avail_ext="$avail_ext $xxx" ;;
21629 case "$useopcode" in
21630 true|define|y) avail_ext="$avail_ext $xxx" ;;
21634 case "$useposix" in
21635 true|define|y) avail_ext="$avail_ext $xxx" ;;
21639 case "$d_socket" in
21642 beos) ;; # not unless BONE
21643 *) avail_ext="$avail_ext $xxx" ;;
21648 Sys/Syslog|sys/syslog)
21649 : XXX syslog requires socket
21650 case "$d_socket" in
21651 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21655 case "$usethreads" in
21657 case "$use5005threads" in
21658 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21662 threads|threads/shared)
21663 # threads and threads::shared are special cases.
21664 # To stop people from asking "Perl 5.8.0 was supposed
21665 # to have this new fancy threads implementation but my
21666 # perl doesn't have it" and from people trying to
21667 # (re)install the threads module using CPAN.pm and
21668 # CPAN.pm then offering to reinstall Perl 5.8.0,
21669 # the threads.pm and threads/shared.pm will always be
21670 # there, croaking informatively ("you need to rebuild
21671 # all of Perl with threads, sorry") when threads haven't
21672 # been compiled in.
21674 avail_ext="$avail_ext $xxx"
21678 cygwin) avail_ext="$avail_ext $xxx" ;;
21681 XS/APItest|xs/apitest)
21682 # This is just for testing. Skip it unless we have dynamic loading.
21685 $define) avail_ext="$avail_ext $xxx" ;;
21688 XS/Typemap|xs/typemap)
21689 # This is just for testing. Skip it unless we have dynamic loading.
21691 $define) avail_ext="$avail_ext $xxx" ;;
21694 *) avail_ext="$avail_ext $xxx"
21703 case "$onlyextensions" in
21705 *) keepextensions=''
21706 echo "You have requested that only certains extensions be included..." >&4
21707 for i in $onlyextensions; do
21708 case " $avail_ext " in
21710 echo "Keeping extension $i."
21711 keepextensions="$keepextensions $i"
21713 *) echo "Ignoring extension $i." ;;
21716 avail_ext="$keepextensions"
21720 case "$noextensions" in
21722 *) keepextensions=''
21723 echo "You have requested that certain extensions be ignored..." >&4
21724 for i in $avail_ext; do
21725 case " $noextensions " in
21726 *" $i "*) echo "Ignoring extension $i." ;;
21727 *) echo "Keeping extension $i.";
21728 keepextensions="$keepextensions $i"
21732 avail_ext="$keepextensions"
21736 : Now see which nonxs extensions are supported on this system.
21737 : For now assume all are.
21739 for xxx in $nonxs_extensions ; do
21741 *) nonxs_ext="$nonxs_ext $xxx"
21753 A number of extensions are supplied with $package. You may choose to
21754 compile these extensions for dynamic loading (the default), compile
21755 them into the $package executable (static loading), or not include
21756 them at all. Answer "none" to include no extensions.
21757 Note that DynaLoader is always built and need not be mentioned here.
21760 case "$dynamic_ext" in
21762 : Exclude those listed in static_ext
21764 for xxx in $avail_ext; do
21765 case " $static_ext " in
21767 *) dflt="$dflt $xxx" ;;
21774 *) dflt="$dynamic_ext"
21775 # Perhaps we are reusing an old out-of-date config.sh.
21778 if test X"$dynamic_ext" != X"$avail_ext"; then
21780 NOTICE: Your previous config.sh list may be incorrect.
21781 The extensions now available to you are
21783 but the default list from your previous config.sh is
21795 rp="What extensions do you wish to load dynamically?"
21798 none) dynamic_ext=' ' ;;
21799 *) dynamic_ext="$ans" ;;
21802 case "$static_ext" in
21804 : Exclude those already listed in dynamic linking
21806 for xxx in $avail_ext; do
21807 case " $dynamic_ext " in
21809 *) dflt="$dflt $xxx" ;;
21816 *) dflt="$static_ext"
21823 rp="What extensions do you wish to load statically?"
21826 none) static_ext=' ' ;;
21827 *) static_ext="$ans" ;;
21832 A number of extensions are supplied with $package. Answer "none"
21833 to include no extensions.
21834 Note that DynaLoader is always built and need not be mentioned here.
21837 case "$static_ext" in
21838 '') dflt="$avail_ext" ;;
21839 *) dflt="$static_ext"
21840 # Perhaps we are reusing an old out-of-date config.sh.
21843 if test X"$static_ext" != X"$avail_ext"; then
21845 NOTICE: Your previous config.sh list may be incorrect.
21846 The extensions now available to you are
21848 but the default list from your previous config.sh is
21857 : Exclude those that are not xs extensions
21861 rp="What extensions do you wish to include?"
21864 none) static_ext=' ' ;;
21865 *) static_ext="$ans" ;;
21870 # Encode is a special case. If we are building Encode as a static
21871 # extension, we need to explicitly list its subextensions as well.
21872 # For other nested extensions, this is handled automatically by
21873 # the appropriate Makefile.PL.
21874 case " $static_ext " in
21875 *" Encode "*) # Add the subextensions of Encode
21877 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21878 static_ext="$static_ext Encode/$xxx"
21884 set X $dynamic_ext $static_ext $nonxs_ext
21888 # Sanity check: We require an extension suitable for use with
21889 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21890 # should show up as failures in the test suite, but it's helpful to
21891 # catch them now.) The 'extensions' list is normally sorted
21892 # alphabetically, so we need to accept either
21893 # DB_File ... Fcntl ... IO ....
21894 # or something like
21895 # Fcntl ... NDBM_File ... IO ....
21896 case " $extensions" in
21897 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21898 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21899 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21900 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21901 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21905 : Remove libraries needed only for extensions
21906 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21907 : The exception is SunOS 4.x, which needs them.
21908 case "${osname}X${osvers}" in
21912 *) case "$usedl" in
21913 $define|true|[yY]*)
21914 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21918 *) perllibs="$libs"
21924 : Remove build directory name from cppstdin so it can be used from
21925 : either the present location or the final installed location.
21927 : Get out of the UU directory to get correct path name.
21929 case "$cppstdin" in
21931 echo "Stripping down cppstdin path name"
21937 : end of configuration questions
21939 echo "End of configuration questions."
21942 : back to where it started
21943 if test -d ../UU; then
21947 : configuration may be unconditionally patched via a 'config.arch' file
21948 if $test -f config.arch; then
21949 echo "I see a config.arch file, loading it." >&4
21953 : configuration may be patched via a 'config.over' file
21954 if $test -f config.over; then
21957 rp='I see a config.over file. Do you wish to load it?'
21960 n*) echo "OK, I'll ignore it.";;
21962 echo "Configuration override changes have been loaded."
21967 : in case they want portability, strip down executable paths
21968 case "$d_portable" in
21971 echo "Stripping down executable paths..." >&4
21972 for file in $loclist $trylist; do
21974 eval $file=`basename $temp`
21979 : create config.sh file
21981 echo "Creating config.sh..." >&4
21982 $spitshell <<EOT >config.sh
21985 # This file was produced by running the Configure script. It holds all the
21986 # definitions figured out by Configure. Should you modify one of these values,
21987 # do not forget to propagate your changes by running "Configure -der". You may
21988 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21991 # Package name : $package
21992 # Source directory : $src
21993 # Configuration time: $cf_time
21994 # Configured by : $cf_by
21995 # Target system : $myuname
21998 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21999 $spitshell <<EOT >>config.sh
22008 Revision='$Revision'
22016 alignbytes='$alignbytes'
22017 ansi2knr='$ansi2knr'
22018 aphostname='$aphostname'
22019 api_revision='$api_revision'
22020 api_subversion='$api_subversion'
22021 api_version='$api_version'
22022 api_versionstring='$api_versionstring'
22025 archlibexp='$archlibexp'
22026 archname64='$archname64'
22027 archname='$archname'
22028 archobjs='$archobjs'
22029 asctime_r_proto='$asctime_r_proto'
22037 byteorder='$byteorder'
22039 castflags='$castflags'
22042 cccdlflags='$cccdlflags'
22043 ccdlflags='$ccdlflags'
22045 ccflags_uselargefiles='$ccflags_uselargefiles'
22047 ccsymbols='$ccsymbols'
22048 ccversion='$ccversion'
22050 cf_email='$cf_email'
22055 clocktype='$clocktype'
22057 compress='$compress'
22058 contains='$contains'
22062 cpp_stuff='$cpp_stuff'
22063 cppccsymbols='$cppccsymbols'
22064 cppflags='$cppflags'
22066 cppminus='$cppminus'
22068 cppstdin='$cppstdin'
22069 cppsymbols='$cppsymbols'
22070 crypt_r_proto='$crypt_r_proto'
22071 cryptlib='$cryptlib'
22073 ctermid_r_proto='$ctermid_r_proto'
22074 ctime_r_proto='$ctime_r_proto'
22075 d_Gconvert='$d_Gconvert'
22076 d_PRIEUldbl='$d_PRIEUldbl'
22077 d_PRIFUldbl='$d_PRIFUldbl'
22078 d_PRIGUldbl='$d_PRIGUldbl'
22079 d_PRIXU64='$d_PRIXU64'
22080 d_PRId64='$d_PRId64'
22081 d_PRIeldbl='$d_PRIeldbl'
22082 d_PRIfldbl='$d_PRIfldbl'
22083 d_PRIgldbl='$d_PRIgldbl'
22084 d_PRIi64='$d_PRIi64'
22085 d_PRIo64='$d_PRIo64'
22086 d_PRIu64='$d_PRIu64'
22087 d_PRIx64='$d_PRIx64'
22088 d_SCNfldbl='$d_SCNfldbl'
22089 d__fwalk='$d__fwalk'
22090 d_access='$d_access'
22091 d_accessx='$d_accessx'
22094 d_archlib='$d_archlib'
22095 d_asctime64='$d_asctime64'
22096 d_asctime_r='$d_asctime_r'
22099 d_attribute_format='$d_attribute_format'
22100 d_attribute_malloc='$d_attribute_malloc'
22101 d_attribute_nonnull='$d_attribute_nonnull'
22102 d_attribute_noreturn='$d_attribute_noreturn'
22103 d_attribute_pure='$d_attribute_pure'
22104 d_attribute_unused='$d_attribute_unused'
22105 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
22109 d_bsdgetpgrp='$d_bsdgetpgrp'
22110 d_bsdsetpgrp='$d_bsdsetpgrp'
22111 d_builtin_choose_expr='$d_builtin_choose_expr'
22112 d_builtin_expect='$d_builtin_expect'
22114 d_c99_variadic_macros='$d_c99_variadic_macros'
22115 d_casti32='$d_casti32'
22116 d_castneg='$d_castneg'
22117 d_charvspr='$d_charvspr'
22119 d_chroot='$d_chroot'
22120 d_chsize='$d_chsize'
22122 d_clearenv='$d_clearenv'
22123 d_closedir='$d_closedir'
22124 d_cmsghdr_s='$d_cmsghdr_s'
22126 d_copysignl='$d_copysignl'
22127 d_cplusplus='$d_cplusplus'
22129 d_crypt_r='$d_crypt_r'
22131 d_ctermid='$d_ctermid'
22132 d_ctermid_r='$d_ctermid_r'
22133 d_ctime64='$d_ctime64'
22134 d_ctime_r='$d_ctime_r'
22135 d_cuserid='$d_cuserid'
22136 d_dbl_dig='$d_dbl_dig'
22137 d_dbminitproto='$d_dbminitproto'
22138 d_difftime64='$d_difftime64'
22139 d_difftime='$d_difftime'
22140 d_dir_dd_fd='$d_dir_dd_fd'
22142 d_dirnamlen='$d_dirnamlen'
22143 d_dlerror='$d_dlerror'
22144 d_dlopen='$d_dlopen'
22145 d_dlsymun='$d_dlsymun'
22146 d_dosuid='$d_dosuid'
22147 d_drand48_r='$d_drand48_r'
22148 d_drand48proto='$d_drand48proto'
22150 d_eaccess='$d_eaccess'
22151 d_endgrent='$d_endgrent'
22152 d_endgrent_r='$d_endgrent_r'
22153 d_endhent='$d_endhent'
22154 d_endhostent_r='$d_endhostent_r'
22155 d_endnent='$d_endnent'
22156 d_endnetent_r='$d_endnetent_r'
22157 d_endpent='$d_endpent'
22158 d_endprotoent_r='$d_endprotoent_r'
22159 d_endpwent='$d_endpwent'
22160 d_endpwent_r='$d_endpwent_r'
22161 d_endsent='$d_endsent'
22162 d_endservent_r='$d_endservent_r'
22163 d_eofnblk='$d_eofnblk'
22164 d_eunice='$d_eunice'
22165 d_faststdio='$d_faststdio'
22166 d_fchdir='$d_fchdir'
22167 d_fchmod='$d_fchmod'
22168 d_fchown='$d_fchown'
22170 d_fcntl_can_lock='$d_fcntl_can_lock'
22171 d_fd_macros='$d_fd_macros'
22172 d_fd_set='$d_fd_set'
22173 d_fds_bits='$d_fds_bits'
22174 d_fgetpos='$d_fgetpos'
22175 d_finite='$d_finite'
22176 d_finitel='$d_finitel'
22177 d_flexfnam='$d_flexfnam'
22179 d_flockproto='$d_flockproto'
22181 d_fp_class='$d_fp_class'
22182 d_fpathconf='$d_fpathconf'
22183 d_fpclass='$d_fpclass'
22184 d_fpclassify='$d_fpclassify'
22185 d_fpclassl='$d_fpclassl'
22186 d_fpos64_t='$d_fpos64_t'
22187 d_frexpl='$d_frexpl'
22188 d_fs_data_s='$d_fs_data_s'
22189 d_fseeko='$d_fseeko'
22190 d_fsetpos='$d_fsetpos'
22191 d_fstatfs='$d_fstatfs'
22192 d_fstatvfs='$d_fstatvfs'
22194 d_ftello='$d_ftello'
22196 d_futimes='$d_futimes'
22197 d_getcwd='$d_getcwd'
22198 d_getespwnam='$d_getespwnam'
22199 d_getfsstat='$d_getfsstat'
22200 d_getgrent='$d_getgrent'
22201 d_getgrent_r='$d_getgrent_r'
22202 d_getgrgid_r='$d_getgrgid_r'
22203 d_getgrnam_r='$d_getgrnam_r'
22204 d_getgrps='$d_getgrps'
22205 d_gethbyaddr='$d_gethbyaddr'
22206 d_gethbyname='$d_gethbyname'
22207 d_gethent='$d_gethent'
22208 d_gethname='$d_gethname'
22209 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22210 d_gethostbyname_r='$d_gethostbyname_r'
22211 d_gethostent_r='$d_gethostent_r'
22212 d_gethostprotos='$d_gethostprotos'
22213 d_getitimer='$d_getitimer'
22214 d_getlogin='$d_getlogin'
22215 d_getlogin_r='$d_getlogin_r'
22216 d_getmnt='$d_getmnt'
22217 d_getmntent='$d_getmntent'
22218 d_getnbyaddr='$d_getnbyaddr'
22219 d_getnbyname='$d_getnbyname'
22220 d_getnent='$d_getnent'
22221 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22222 d_getnetbyname_r='$d_getnetbyname_r'
22223 d_getnetent_r='$d_getnetent_r'
22224 d_getnetprotos='$d_getnetprotos'
22225 d_getpagsz='$d_getpagsz'
22226 d_getpbyname='$d_getpbyname'
22227 d_getpbynumber='$d_getpbynumber'
22228 d_getpent='$d_getpent'
22229 d_getpgid='$d_getpgid'
22230 d_getpgrp2='$d_getpgrp2'
22231 d_getpgrp='$d_getpgrp'
22232 d_getppid='$d_getppid'
22233 d_getprior='$d_getprior'
22234 d_getprotobyname_r='$d_getprotobyname_r'
22235 d_getprotobynumber_r='$d_getprotobynumber_r'
22236 d_getprotoent_r='$d_getprotoent_r'
22237 d_getprotoprotos='$d_getprotoprotos'
22238 d_getprpwnam='$d_getprpwnam'
22239 d_getpwent='$d_getpwent'
22240 d_getpwent_r='$d_getpwent_r'
22241 d_getpwnam_r='$d_getpwnam_r'
22242 d_getpwuid_r='$d_getpwuid_r'
22243 d_getsbyname='$d_getsbyname'
22244 d_getsbyport='$d_getsbyport'
22245 d_getsent='$d_getsent'
22246 d_getservbyname_r='$d_getservbyname_r'
22247 d_getservbyport_r='$d_getservbyport_r'
22248 d_getservent_r='$d_getservent_r'
22249 d_getservprotos='$d_getservprotos'
22250 d_getspnam='$d_getspnam'
22251 d_getspnam_r='$d_getspnam_r'
22252 d_gettimeod='$d_gettimeod'
22253 d_gmtime64='$d_gmtime64'
22254 d_gmtime_r='$d_gmtime_r'
22255 d_gnulibc='$d_gnulibc'
22256 d_grpasswd='$d_grpasswd'
22257 d_hasmntopt='$d_hasmntopt'
22259 d_ilogbl='$d_ilogbl'
22260 d_inc_version_list='$d_inc_version_list'
22262 d_inetaton='$d_inetaton'
22263 d_int64_t='$d_int64_t'
22264 d_isascii='$d_isascii'
22265 d_isfinite='$d_isfinite'
22268 d_isnanl='$d_isnanl'
22269 d_killpg='$d_killpg'
22270 d_lchown='$d_lchown'
22271 d_ldbl_dig='$d_ldbl_dig'
22272 d_libm_lib_version='$d_libm_lib_version'
22274 d_localtime64='$d_localtime64'
22275 d_localtime_r='$d_localtime_r'
22276 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22277 d_locconv='$d_locconv'
22279 d_longdbl='$d_longdbl'
22280 d_longlong='$d_longlong'
22281 d_lseekproto='$d_lseekproto'
22283 d_madvise='$d_madvise'
22284 d_malloc_good_size='$d_malloc_good_size'
22285 d_malloc_size='$d_malloc_size'
22287 d_mbstowcs='$d_mbstowcs'
22288 d_mbtowc='$d_mbtowc'
22289 d_memchr='$d_memchr'
22290 d_memcmp='$d_memcmp'
22291 d_memcpy='$d_memcpy'
22292 d_memmove='$d_memmove'
22293 d_memset='$d_memset'
22295 d_mkdtemp='$d_mkdtemp'
22296 d_mkfifo='$d_mkfifo'
22297 d_mkstemp='$d_mkstemp'
22298 d_mkstemps='$d_mkstemps'
22299 d_mktime64='$d_mktime64'
22300 d_mktime='$d_mktime'
22303 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22304 d_modflproto='$d_modflproto'
22305 d_mprotect='$d_mprotect'
22307 d_msg_ctrunc='$d_msg_ctrunc'
22308 d_msg_dontroute='$d_msg_dontroute'
22309 d_msg_oob='$d_msg_oob'
22310 d_msg_peek='$d_msg_peek'
22311 d_msg_proxy='$d_msg_proxy'
22312 d_msgctl='$d_msgctl'
22313 d_msgget='$d_msgget'
22314 d_msghdr_s='$d_msghdr_s'
22315 d_msgrcv='$d_msgrcv'
22316 d_msgsnd='$d_msgsnd'
22318 d_munmap='$d_munmap'
22319 d_mymalloc='$d_mymalloc'
22322 d_nl_langinfo='$d_nl_langinfo'
22323 d_nv_preserves_uv='$d_nv_preserves_uv'
22324 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22325 d_off64_t='$d_off64_t'
22326 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22327 d_oldpthreads='$d_oldpthreads'
22328 d_oldsock='$d_oldsock'
22330 d_pathconf='$d_pathconf'
22332 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22333 d_phostname='$d_phostname'
22336 d_portable='$d_portable'
22337 d_printf_format_null='$d_printf_format_null'
22338 d_procselfexe='$d_procselfexe'
22339 d_pseudofork='$d_pseudofork'
22340 d_pthread_atfork='$d_pthread_atfork'
22341 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22342 d_pthread_yield='$d_pthread_yield'
22344 d_pwchange='$d_pwchange'
22345 d_pwclass='$d_pwclass'
22346 d_pwcomment='$d_pwcomment'
22347 d_pwexpire='$d_pwexpire'
22348 d_pwgecos='$d_pwgecos'
22349 d_pwpasswd='$d_pwpasswd'
22350 d_pwquota='$d_pwquota'
22353 d_random_r='$d_random_r'
22354 d_readdir64_r='$d_readdir64_r'
22355 d_readdir='$d_readdir'
22356 d_readdir_r='$d_readdir_r'
22357 d_readlink='$d_readlink'
22359 d_recvmsg='$d_recvmsg'
22360 d_rename='$d_rename'
22361 d_rewinddir='$d_rewinddir'
22363 d_safebcpy='$d_safebcpy'
22364 d_safemcpy='$d_safemcpy'
22365 d_sanemcmp='$d_sanemcmp'
22366 d_sbrkproto='$d_sbrkproto'
22367 d_scalbnl='$d_scalbnl'
22368 d_sched_yield='$d_sched_yield'
22369 d_scm_rights='$d_scm_rights'
22370 d_seekdir='$d_seekdir'
22371 d_select='$d_select'
22373 d_semctl='$d_semctl'
22374 d_semctl_semid_ds='$d_semctl_semid_ds'
22375 d_semctl_semun='$d_semctl_semun'
22376 d_semget='$d_semget'
22378 d_sendmsg='$d_sendmsg'
22379 d_setegid='$d_setegid'
22380 d_seteuid='$d_seteuid'
22381 d_setgrent='$d_setgrent'
22382 d_setgrent_r='$d_setgrent_r'
22383 d_setgrps='$d_setgrps'
22384 d_sethent='$d_sethent'
22385 d_sethostent_r='$d_sethostent_r'
22386 d_setitimer='$d_setitimer'
22387 d_setlinebuf='$d_setlinebuf'
22388 d_setlocale='$d_setlocale'
22389 d_setlocale_r='$d_setlocale_r'
22390 d_setnent='$d_setnent'
22391 d_setnetent_r='$d_setnetent_r'
22392 d_setpent='$d_setpent'
22393 d_setpgid='$d_setpgid'
22394 d_setpgrp2='$d_setpgrp2'
22395 d_setpgrp='$d_setpgrp'
22396 d_setprior='$d_setprior'
22397 d_setproctitle='$d_setproctitle'
22398 d_setprotoent_r='$d_setprotoent_r'
22399 d_setpwent='$d_setpwent'
22400 d_setpwent_r='$d_setpwent_r'
22401 d_setregid='$d_setregid'
22402 d_setresgid='$d_setresgid'
22403 d_setresuid='$d_setresuid'
22404 d_setreuid='$d_setreuid'
22405 d_setrgid='$d_setrgid'
22406 d_setruid='$d_setruid'
22407 d_setsent='$d_setsent'
22408 d_setservent_r='$d_setservent_r'
22409 d_setsid='$d_setsid'
22410 d_setvbuf='$d_setvbuf'
22414 d_shmatprototype='$d_shmatprototype'
22415 d_shmctl='$d_shmctl'
22417 d_shmget='$d_shmget'
22418 d_sigaction='$d_sigaction'
22419 d_signbit='$d_signbit'
22420 d_sigprocmask='$d_sigprocmask'
22421 d_sigsetjmp='$d_sigsetjmp'
22422 d_sitearch='$d_sitearch'
22423 d_snprintf='$d_snprintf'
22424 d_sockatmark='$d_sockatmark'
22425 d_sockatmarkproto='$d_sockatmarkproto'
22426 d_socket='$d_socket'
22427 d_socklen_t='$d_socklen_t'
22428 d_sockpair='$d_sockpair'
22429 d_socks5_init='$d_socks5_init'
22430 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22432 d_srand48_r='$d_srand48_r'
22433 d_srandom_r='$d_srandom_r'
22434 d_sresgproto='$d_sresgproto'
22435 d_sresuproto='$d_sresuproto'
22436 d_statblks='$d_statblks'
22437 d_statfs_f_flags='$d_statfs_f_flags'
22438 d_statfs_s='$d_statfs_s'
22439 d_statvfs='$d_statvfs'
22440 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22441 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22442 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22443 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22444 d_stdio_stream_array='$d_stdio_stream_array'
22445 d_stdiobase='$d_stdiobase'
22446 d_stdstdio='$d_stdstdio'
22447 d_strchr='$d_strchr'
22448 d_strcoll='$d_strcoll'
22449 d_strctcpy='$d_strctcpy'
22450 d_strerrm='$d_strerrm'
22451 d_strerror='$d_strerror'
22452 d_strerror_r='$d_strerror_r'
22453 d_strftime='$d_strftime'
22454 d_strlcat='$d_strlcat'
22455 d_strlcpy='$d_strlcpy'
22456 d_strtod='$d_strtod'
22457 d_strtol='$d_strtol'
22458 d_strtold='$d_strtold'
22459 d_strtoll='$d_strtoll'
22460 d_strtoq='$d_strtoq'
22461 d_strtoul='$d_strtoul'
22462 d_strtoull='$d_strtoull'
22463 d_strtouq='$d_strtouq'
22464 d_strxfrm='$d_strxfrm'
22465 d_suidsafe='$d_suidsafe'
22466 d_symlink='$d_symlink'
22467 d_syscall='$d_syscall'
22468 d_syscallproto='$d_syscallproto'
22469 d_sysconf='$d_sysconf'
22470 d_sysernlst='$d_sysernlst'
22471 d_syserrlst='$d_syserrlst'
22472 d_system='$d_system'
22473 d_tcgetpgrp='$d_tcgetpgrp'
22474 d_tcsetpgrp='$d_tcsetpgrp'
22475 d_telldir='$d_telldir'
22476 d_telldirproto='$d_telldirproto'
22478 d_timegm='$d_timegm'
22480 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22481 d_tm_tm_zone='$d_tm_tm_zone'
22482 d_tmpnam_r='$d_tmpnam_r'
22483 d_truncate='$d_truncate'
22484 d_ttyname_r='$d_ttyname_r'
22485 d_tzname='$d_tzname'
22486 d_u32align='$d_u32align'
22487 d_ualarm='$d_ualarm'
22490 d_union_semun='$d_union_semun'
22491 d_unordered='$d_unordered'
22492 d_unsetenv='$d_unsetenv'
22493 d_usleep='$d_usleep'
22494 d_usleepproto='$d_usleepproto'
22496 d_vendorarch='$d_vendorarch'
22497 d_vendorbin='$d_vendorbin'
22498 d_vendorlib='$d_vendorlib'
22499 d_vendorscript='$d_vendorscript'
22501 d_void_closedir='$d_void_closedir'
22502 d_voidsig='$d_voidsig'
22503 d_voidtty='$d_voidtty'
22504 d_volatile='$d_volatile'
22505 d_vprintf='$d_vprintf'
22506 d_vsnprintf='$d_vsnprintf'
22508 d_waitpid='$d_waitpid'
22509 d_wcstombs='$d_wcstombs'
22510 d_wctomb='$d_wctomb'
22511 d_writev='$d_writev'
22514 db_hashtype='$db_hashtype'
22515 db_prefixtype='$db_prefixtype'
22516 db_version_major='$db_version_major'
22517 db_version_minor='$db_version_minor'
22518 db_version_patch='$db_version_patch'
22519 defvoidused='$defvoidused'
22520 direntrytype='$direntrytype'
22523 doublesize='$doublesize'
22525 drand48_r_proto='$drand48_r_proto'
22527 dynamic_ext='$dynamic_ext'
22533 endgrent_r_proto='$endgrent_r_proto'
22534 endhostent_r_proto='$endhostent_r_proto'
22535 endnetent_r_proto='$endnetent_r_proto'
22536 endprotoent_r_proto='$endprotoent_r_proto'
22537 endpwent_r_proto='$endpwent_r_proto'
22538 endservent_r_proto='$endservent_r_proto'
22539 eunicefix='$eunicefix'
22542 extensions='$extensions'
22543 extern_C='$extern_C'
22545 fflushNULL='$fflushNULL'
22546 fflushall='$fflushall'
22548 firstmakefile='$firstmakefile'
22550 fpossize='$fpossize'
22551 fpostype='$fpostype'
22552 freetype='$freetype'
22555 full_csh='$full_csh'
22556 full_sed='$full_sed'
22557 gccansipedantic='$gccansipedantic'
22558 gccosandvers='$gccosandvers'
22559 gccversion='$gccversion'
22560 getgrent_r_proto='$getgrent_r_proto'
22561 getgrgid_r_proto='$getgrgid_r_proto'
22562 getgrnam_r_proto='$getgrnam_r_proto'
22563 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22564 gethostbyname_r_proto='$gethostbyname_r_proto'
22565 gethostent_r_proto='$gethostent_r_proto'
22566 getlogin_r_proto='$getlogin_r_proto'
22567 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22568 getnetbyname_r_proto='$getnetbyname_r_proto'
22569 getnetent_r_proto='$getnetent_r_proto'
22570 getprotobyname_r_proto='$getprotobyname_r_proto'
22571 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22572 getprotoent_r_proto='$getprotoent_r_proto'
22573 getpwent_r_proto='$getpwent_r_proto'
22574 getpwnam_r_proto='$getpwnam_r_proto'
22575 getpwuid_r_proto='$getpwuid_r_proto'
22576 getservbyname_r_proto='$getservbyname_r_proto'
22577 getservbyport_r_proto='$getservbyport_r_proto'
22578 getservent_r_proto='$getservent_r_proto'
22579 getspnam_r_proto='$getspnam_r_proto'
22580 gidformat='$gidformat'
22586 gmtime_r_proto='$gmtime_r_proto'
22587 gnulibc_version='$gnulibc_version'
22589 groupcat='$groupcat'
22590 groupstype='$groupstype'
22593 h_sysfile='$h_sysfile'
22596 html1dir='$html1dir'
22597 html1direxp='$html1direxp'
22598 html3dir='$html3dir'
22599 html3direxp='$html3direxp'
22608 i_arpainet='$i_arpainet'
22609 i_assert='$i_assert'
22610 i_bsdioctl='$i_bsdioctl'
22614 i_dirent='$i_dirent'
22620 i_fp_class='$i_fp_class'
22622 i_gdbm_ndbm='$i_gdbm_ndbm'
22623 i_gdbmndbm='$i_gdbmndbm'
22625 i_ieeefp='$i_ieeefp'
22626 i_inttypes='$i_inttypes'
22627 i_langinfo='$i_langinfo'
22628 i_libutil='$i_libutil'
22629 i_limits='$i_limits'
22630 i_locale='$i_locale'
22631 i_machcthr='$i_machcthr'
22632 i_malloc='$i_malloc'
22633 i_mallocmalloc='$i_mallocmalloc'
22635 i_memory='$i_memory'
22636 i_mntent='$i_mntent'
22639 i_neterrno='$i_neterrno'
22640 i_netinettcp='$i_netinettcp'
22644 i_pthread='$i_pthread'
22646 i_rpcsvcdbm='$i_rpcsvcdbm'
22649 i_shadow='$i_shadow'
22651 i_stdarg='$i_stdarg'
22652 i_stddef='$i_stddef'
22653 i_stdlib='$i_stdlib'
22654 i_string='$i_string'
22655 i_sunmath='$i_sunmath'
22656 i_sysaccess='$i_sysaccess'
22657 i_sysdir='$i_sysdir'
22658 i_sysfile='$i_sysfile'
22659 i_sysfilio='$i_sysfilio'
22661 i_sysioctl='$i_sysioctl'
22662 i_syslog='$i_syslog'
22663 i_sysmman='$i_sysmman'
22664 i_sysmode='$i_sysmode'
22665 i_sysmount='$i_sysmount'
22666 i_sysndir='$i_sysndir'
22667 i_sysparam='$i_sysparam'
22668 i_syspoll='$i_syspoll'
22669 i_sysresrc='$i_sysresrc'
22670 i_syssecrt='$i_syssecrt'
22671 i_sysselct='$i_sysselct'
22672 i_syssockio='$i_syssockio'
22673 i_sysstat='$i_sysstat'
22674 i_sysstatfs='$i_sysstatfs'
22675 i_sysstatvfs='$i_sysstatvfs'
22676 i_systime='$i_systime'
22677 i_systimek='$i_systimek'
22678 i_systimes='$i_systimes'
22679 i_systypes='$i_systypes'
22680 i_sysuio='$i_sysuio'
22682 i_sysutsname='$i_sysutsname'
22683 i_sysvfs='$i_sysvfs'
22684 i_syswait='$i_syswait'
22685 i_termio='$i_termio'
22686 i_termios='$i_termios'
22688 i_unistd='$i_unistd'
22691 i_values='$i_values'
22692 i_varargs='$i_varargs'
22693 i_varhdr='$i_varhdr'
22695 ignore_versioned_solibs='$ignore_versioned_solibs'
22696 inc_version_list='$inc_version_list'
22697 inc_version_list_init='$inc_version_list_init'
22700 initialinstalllocation='$initialinstalllocation'
22701 installarchlib='$installarchlib'
22702 installbin='$installbin'
22703 installhtml1dir='$installhtml1dir'
22704 installhtml3dir='$installhtml3dir'
22705 installman1dir='$installman1dir'
22706 installman3dir='$installman3dir'
22707 installprefix='$installprefix'
22708 installprefixexp='$installprefixexp'
22709 installprivlib='$installprivlib'
22710 installscript='$installscript'
22711 installsitearch='$installsitearch'
22712 installsitebin='$installsitebin'
22713 installsitehtml1dir='$installsitehtml1dir'
22714 installsitehtml3dir='$installsitehtml3dir'
22715 installsitelib='$installsitelib'
22716 installsiteman1dir='$installsiteman1dir'
22717 installsiteman3dir='$installsiteman3dir'
22718 installsitescript='$installsitescript'
22719 installstyle='$installstyle'
22720 installusrbinperl='$installusrbinperl'
22721 installvendorarch='$installvendorarch'
22722 installvendorbin='$installvendorbin'
22723 installvendorhtml1dir='$installvendorhtml1dir'
22724 installvendorhtml3dir='$installvendorhtml3dir'
22725 installvendorlib='$installvendorlib'
22726 installvendorman1dir='$installvendorman1dir'
22727 installvendorman3dir='$installvendorman3dir'
22728 installvendorscript='$installvendorscript'
22730 issymlink='$issymlink'
22731 ivdformat='$ivdformat'
22734 known_extensions='$known_extensions'
22737 lddlflags='$lddlflags'
22739 ldflags_uselargefiles='$ldflags_uselargefiles'
22740 ldlibpthname='$ldlibpthname'
22747 libsdirs='$libsdirs'
22748 libsfiles='$libsfiles'
22749 libsfound='$libsfound'
22750 libspath='$libspath'
22751 libswanted='$libswanted'
22752 libswanted_uselargefiles='$libswanted_uselargefiles'
22758 localtime_r_proto='$localtime_r_proto'
22759 locincpth='$locincpth'
22760 loclibpth='$loclibpth'
22761 longdblsize='$longdblsize'
22762 longlongsize='$longlongsize'
22763 longsize='$longsize'
22767 lseeksize='$lseeksize'
22768 lseektype='$lseektype'
22771 madlyobj='$madlyobj'
22772 madlysrc='$madlysrc'
22776 make_set_make='$make_set_make'
22777 mallocobj='$mallocobj'
22778 mallocsrc='$mallocsrc'
22779 malloctype='$malloctype'
22781 man1direxp='$man1direxp'
22784 man3direxp='$man3direxp'
22786 mips_type='$mips_type'
22787 mistrustnm='$mistrustnm'
22789 mmaptype='$mmaptype'
22790 modetype='$modetype'
22792 multiarch='$multiarch'
22794 myarchname='$myarchname'
22795 mydomain='$mydomain'
22796 myhostname='$myhostname'
22799 need_va_copy='$need_va_copy'
22800 netdb_hlen_type='$netdb_hlen_type'
22801 netdb_host_type='$netdb_host_type'
22802 netdb_name_type='$netdb_name_type'
22803 netdb_net_type='$netdb_net_type'
22806 nm_so_opt='$nm_so_opt'
22807 nonxs_ext='$nonxs_ext'
22809 nvEUformat='$nvEUformat'
22810 nvFUformat='$nvFUformat'
22811 nvGUformat='$nvGUformat'
22812 nv_overflows_integers_at='$nv_overflows_integers_at'
22813 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22814 nveformat='$nveformat'
22815 nvfformat='$nvfformat'
22816 nvgformat='$nvgformat'
22819 o_nonblock='$o_nonblock'
22821 old_pthread_create_joinable='$old_pthread_create_joinable'
22822 optimize='$optimize'
22823 orderlib='$orderlib'
22826 otherlibdirs='$otherlibdirs'
22830 patchlevel='$patchlevel'
22831 path_sep='$path_sep'
22834 perl_patchlevel='$perl_patchlevel'
22835 perladmin='$perladmin'
22836 perllibs='$perllibs'
22837 perlpath='$perlpath'
22839 phostname='$phostname'
22845 prefixexp='$prefixexp'
22847 privlibexp='$privlibexp'
22848 procselfexe='$procselfexe'
22849 prototype='$prototype'
22851 quadkind='$quadkind'
22852 quadtype='$quadtype'
22853 randbits='$randbits'
22854 randfunc='$randfunc'
22855 random_r_proto='$random_r_proto'
22856 randseedtype='$randseedtype'
22858 rd_nodata='$rd_nodata'
22859 readdir64_r_proto='$readdir64_r_proto'
22860 readdir_r_proto='$readdir_r_proto'
22861 revision='$revision'
22867 sGMTIME_max='$sGMTIME_max'
22868 sGMTIME_min='$sGMTIME_min'
22869 sLOCALTIME_max='$sLOCALTIME_max'
22870 sLOCALTIME_min='$sLOCALTIME_min'
22871 sPRIEUldbl='$sPRIEUldbl'
22872 sPRIFUldbl='$sPRIFUldbl'
22873 sPRIGUldbl='$sPRIGUldbl'
22874 sPRIXU64='$sPRIXU64'
22876 sPRIeldbl='$sPRIeldbl'
22877 sPRIfldbl='$sPRIfldbl'
22878 sPRIgldbl='$sPRIgldbl'
22883 sSCNfldbl='$sSCNfldbl'
22884 sched_yield='$sched_yield'
22885 scriptdir='$scriptdir'
22886 scriptdirexp='$scriptdirexp'
22888 seedfunc='$seedfunc'
22889 selectminbits='$selectminbits'
22890 selecttype='$selecttype'
22891 sendmail='$sendmail'
22892 setgrent_r_proto='$setgrent_r_proto'
22893 sethostent_r_proto='$sethostent_r_proto'
22894 setlocale_r_proto='$setlocale_r_proto'
22895 setnetent_r_proto='$setnetent_r_proto'
22896 setprotoent_r_proto='$setprotoent_r_proto'
22897 setpwent_r_proto='$setpwent_r_proto'
22898 setservent_r_proto='$setservent_r_proto'
22901 sharpbang='$sharpbang'
22902 shmattype='$shmattype'
22903 shortsize='$shortsize'
22906 sig_count='$sig_count'
22907 sig_name='$sig_name'
22908 sig_name_init='$sig_name_init'
22910 sig_num_init='$sig_num_init'
22911 sig_size='$sig_size'
22912 signal_t='$signal_t'
22913 sitearch='$sitearch'
22914 sitearchexp='$sitearchexp'
22916 sitebinexp='$sitebinexp'
22917 sitehtml1dir='$sitehtml1dir'
22918 sitehtml1direxp='$sitehtml1direxp'
22919 sitehtml3dir='$sitehtml3dir'
22920 sitehtml3direxp='$sitehtml3direxp'
22922 sitelib_stem='$sitelib_stem'
22923 sitelibexp='$sitelibexp'
22924 siteman1dir='$siteman1dir'
22925 siteman1direxp='$siteman1direxp'
22926 siteman3dir='$siteman3dir'
22927 siteman3direxp='$siteman3direxp'
22928 siteprefix='$siteprefix'
22929 siteprefixexp='$siteprefixexp'
22930 sitescript='$sitescript'
22931 sitescriptexp='$sitescriptexp'
22932 sizesize='$sizesize'
22933 sizetype='$sizetype'
22937 sockethdr='$sockethdr'
22938 socketlib='$socketlib'
22939 socksizetype='$socksizetype'
22941 spackage='$spackage'
22942 spitshell='$spitshell'
22943 srand48_r_proto='$srand48_r_proto'
22944 srandom_r_proto='$srandom_r_proto'
22946 ssizetype='$ssizetype'
22947 startperl='$startperl'
22949 static_ext='$static_ext'
22951 stdio_base='$stdio_base'
22952 stdio_bufsiz='$stdio_bufsiz'
22953 stdio_cnt='$stdio_cnt'
22954 stdio_filbuf='$stdio_filbuf'
22955 stdio_ptr='$stdio_ptr'
22956 stdio_stream_array='$stdio_stream_array'
22957 strerror_r_proto='$strerror_r_proto'
22960 subversion='$subversion'
22964 targetarch='$targetarch'
22968 timeincl='$timeincl'
22969 timetype='$timetype'
22970 tmpnam_r_proto='$tmpnam_r_proto'
22976 ttyname_r_proto='$ttyname_r_proto'
22985 uidformat='$uidformat'
22991 uquadtype='$uquadtype'
22992 use5005threads='$use5005threads'
22993 use64bitall='$use64bitall'
22994 use64bitint='$use64bitint'
22995 usecrosscompile='$usecrosscompile'
22997 usedtrace='$usedtrace'
22998 usefaststdio='$usefaststdio'
22999 useithreads='$useithreads'
23000 uselargefiles='$uselargefiles'
23001 uselongdouble='$uselongdouble'
23002 usemallocwrap='$usemallocwrap'
23003 usemorebits='$usemorebits'
23004 usemultiplicity='$usemultiplicity'
23005 usemymalloc='$usemymalloc'
23007 useopcode='$useopcode'
23008 useperlio='$useperlio'
23009 useposix='$useposix'
23010 usereentrant='$usereentrant'
23011 userelocatableinc='$userelocatableinc'
23013 useshrplib='$useshrplib'
23014 usesitecustomize='$usesitecustomize'
23015 usesocks='$usesocks'
23016 usethreads='$usethreads'
23017 usevendorprefix='$usevendorprefix'
23018 usevfork='$usevfork'
23021 uvXUformat='$uvXUformat'
23022 uvoformat='$uvoformat'
23025 uvuformat='$uvuformat'
23026 uvxformat='$uvxformat'
23027 vendorarch='$vendorarch'
23028 vendorarchexp='$vendorarchexp'
23029 vendorbin='$vendorbin'
23030 vendorbinexp='$vendorbinexp'
23031 vendorhtml1dir='$vendorhtml1dir'
23032 vendorhtml1direxp='$vendorhtml1direxp'
23033 vendorhtml3dir='$vendorhtml3dir'
23034 vendorhtml3direxp='$vendorhtml3direxp'
23035 vendorlib='$vendorlib'
23036 vendorlib_stem='$vendorlib_stem'
23037 vendorlibexp='$vendorlibexp'
23038 vendorman1dir='$vendorman1dir'
23039 vendorman1direxp='$vendorman1direxp'
23040 vendorman3dir='$vendorman3dir'
23041 vendorman3direxp='$vendorman3direxp'
23042 vendorprefix='$vendorprefix'
23043 vendorprefixexp='$vendorprefixexp'
23044 vendorscript='$vendorscript'
23045 vendorscriptexp='$vendorscriptexp'
23047 version_patchlevel_string='$version_patchlevel_string'
23048 versiononly='$versiononly'
23050 voidflags='$voidflags'
23053 yaccflags='$yaccflags'
23058 : Add in command line options if available
23059 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
23061 : add special variables
23062 $test -f $src/patchlevel.h && \
23063 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
23064 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
23065 echo "PERL_CONFIG_SH=true" >>config.sh
23067 : propagate old symbols
23068 if $test -f UU/config.sh; then
23069 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
23070 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
23071 config.sh config.sh UU/oldconfig.sh |\
23072 $sort | $uniq -u >UU/oldsyms
23073 set X `cat UU/oldsyms`
23079 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
23081 echo ": Variables propagated from previous config.sh file." >>config.sh
23082 for sym in `cat UU/oldsyms`; do
23083 echo " Propagating $hint variable "'$'"$sym..."
23084 eval 'tmp="$'"${sym}"'"'
23086 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
23092 : Finish up by extracting the .SH files
23096 echo "Extraction done."
23106 If you'd like to make any changes to the config.sh file before I begin
23107 to configure things, do it as a shell escape now (e.g. !vi config.sh).
23110 rp="Press return or use a shell escape to edit config.sh:"
23115 *) : in case they cannot read
23116 sh 1>&4 -c "$ans";;
23121 : if this fails, just run all the .SH files by hand
23130 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
23137 Now you need to generate make dependencies by running "$make depend".
23138 You might prefer to run it in background: "$make depend > makedepend.out &"
23139 It can take a while, so you might not want to run it right now.
23144 rp="Run $make depend now?"
23148 $make depend && echo "Now you must run '$make'."
23151 echo "You must run '$make depend' then '$make'."
23154 elif test -f [Mm]akefile; then
23156 echo "Now you must run a $make."
23158 echo "Configure done."
23161 if $test -f Policy.sh; then
23164 If you compile $package on a different machine or from a different object
23165 directory, copy the Policy.sh file from this object directory to the
23166 new one before you run Configure -- this will help you with most of
23167 the policy defaults.
23171 if $test -f config.msg; then
23172 echo "Hmm. I also noted the following information while running:"
23174 $cat config.msg >&4
23177 $rm -f kit*isdone ark*isdone