3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist package (which contains metaconfig) is available via SVN:
17 # svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
20 # Though this script was generated by metaconfig, it is OK to send
21 # patches against it. It's up to the Configure pumpkin to backport
22 # the patch to the metaunits if it is accepted.
23 # See Porting/pumpkin.pod for more information on metaconfig.
26 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
28 # Generated on Fri Aug 22 17:08:28 CEST 2008 [metaconfig 3.5 PL0]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
335 initialinstalllocation=''
362 d_attribute_format=''
363 d_attribute_malloc=''
364 d_attribute_nonnull=''
365 d_attribute_noreturn=''
367 d_attribute_unused=''
368 d_attribute_warn_unused_result=''
369 d_printf_format_null=''
372 d_builtin_choose_expr=''
375 d_c99_variadic_macros=''
422 endhostent_r_proto=''
428 endprotoent_r_proto=''
434 endservent_r_proto=''
486 gethostbyaddr_r_proto=''
488 gethostbyname_r_proto=''
490 gethostent_r_proto=''
502 getnetbyaddr_r_proto=''
504 getnetbyname_r_proto=''
518 d_getprotobyname_r=''
519 getprotobyname_r_proto=''
520 d_getprotobynumber_r=''
521 getprotobynumber_r_proto=''
523 getprotoent_r_proto=''
535 getservbyname_r_proto=''
537 getservbyport_r_proto=''
539 getservent_r_proto=''
563 d_libm_lib_version=''
566 d_localtime_r_needs_tzset=''
577 d_malloc_good_size=''
619 d_old_pthread_create_joinable=''
620 old_pthread_create_joinable=''
622 d_pthread_attr_setscope=''
661 sethostent_r_proto=''
678 setprotoent_r_proto=''
690 setservent_r_proto=''
724 d_sprintf_returns_strlen=''
739 d_stdio_ptr_lval_nochange_cnt=''
740 d_stdio_ptr_lval_sets_cnt=''
951 d_inc_version_list=''
953 inc_version_list_init=''
972 ignore_versioned_solibs=''
1036 d_perl_otherlibdirs=''
1044 api_versionstring=''
1050 version_patchlevel_string=''
1054 d_nv_preserves_uv=''
1055 d_nv_zero_is_allbits_zero=''
1066 nv_overflows_integers_at=''
1067 nv_preserves_uv_bits=''
1139 installsitehtml1dir=''
1142 installsitehtml3dir=''
1149 installsiteman1dir=''
1152 installsiteman3dir=''
1157 installsitescript=''
1172 d_stdio_stream_array=''
1173 stdio_stream_array=''
1188 ccflags_uselargefiles=''
1189 ldflags_uselargefiles=''
1190 libswanted_uselargefiles=''
1210 installvendorarch=''
1217 installvendorhtml1dir=''
1219 vendorhtml1direxp=''
1220 installvendorhtml3dir=''
1222 vendorhtml3direxp=''
1228 installvendorman1dir=''
1231 installvendorman3dir=''
1238 installvendorscript=''
1251 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1254 : We must find out about Eunice early
1256 if test -f /etc/unixtovms; then
1257 eunicefix=/etc/unixtovms
1259 if test -f /etc/unixtovms.exe; then
1260 eunicefix=/etc/unixtovms.exe
1263 : Set executable suffix now -- needed before hints available
1264 if test -f "/libs/version.library"; then
1267 elif test -f "/system/gnu_library/bin/ar.pm"; then
1270 elif test -n "$DJGPP"; then
1273 elif test -d c:/. -o -n "$is_os2" ; then
1280 : Trailing extension. Override this in a hint file, if needed.
1281 : Extra object files, if any, needed on this platform.
1285 : change the next line if compiling for Xenix/286 on Xenix/386
1286 xlibpth='/usr/lib/386 /lib/386'
1287 : Possible local library directories to search.
1288 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1289 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1291 : general looking path for locating libraries
1292 glibpth="/lib /usr/lib $xlibpth"
1293 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1294 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1295 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1296 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1298 : Private path used by Configure to find libraries. Its value
1299 : is prepended to libpth. This variable takes care of special
1300 : machines, like the mips. Usually, it should be empty.
1303 : default library list
1305 : some systems want to use only the non-versioned libso:s
1306 ignore_versioned_solibs=''
1307 : set usethreads on the Configure command line to enable threads.
1308 usereentrant='undef'
1309 : full support for void wanted by default
1312 : Possible local include directories to search.
1313 : Set locincpth to "" in a hint file to defeat local include searches.
1314 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1315 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1317 : no include file wanted by default
1320 : Enable -DEBUGGING and -DDEBUGGING from the command line
1327 : set useposix=false in your hint file to disable the POSIX extension.
1329 : set useopcode=false in your hint file to disable the Opcode extension.
1332 ccflags_uselargefiles=''
1333 ldflags_uselargefiles=''
1334 libswanted_uselargefiles=''
1335 : set usemultiplicity on the Configure command line to enable multiplicity.
1336 : set usesocks on the Configure command line to enable socks.
1337 : List of libraries we want.
1338 : If anyone needs extra -lxxx, put those in a hint file.
1339 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1340 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1341 : We probably want to search /usr/shlib before most other libraries.
1342 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1343 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1344 glibpth="/usr/shlib $glibpth"
1345 : Do not use vfork unless overridden by a hint file.
1348 : Find the basic shell for Bourne shell scripts
1352 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1355 if test -f "$xxx"; then
1358 : Build up a list and do a single loop so we can 'break' out.
1359 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1360 for xxx in sh bash ksh pdksh ash; do
1362 try="$try ${p}/${xxx}"
1366 if test -f "$xxx"; then
1369 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1372 elif test -f "$xxx.exe"; then
1383 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1385 Usually it's in /bin/sh. How did you even get this far?
1386 Please contact me (Perl Maintainers) at perlbug@perl.org and
1387 we'll try to straighten this all out.
1393 : see if sh knows # comments
1394 if `$sh -c '#' >/dev/null 2>&1`; then
1398 test -f $xcat$_exe || xcat=/usr/bin/cat
1399 if test ! -f $xcat$_exe; then
1400 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1401 if test -f $p/cat$_exe; then
1406 if test ! -f $xcat$_exe; then
1407 echo "Can't find cat anywhere!"
1411 echo "#!$xcat" >sharp
1414 ./sharp > today 2>/dev/null
1415 if test -s today; then
1418 echo "#! $xcat" > sharp
1421 ./sharp > today 2>/dev/null
1422 if test -s today; then
1430 echo "Your $sh doesn't grok # comments--I will strip them later on."
1433 echo "exec grep -v '^[ ]*#'" >spitshell
1435 $eunicefix spitshell
1436 spitshell=`pwd`/spitshell
1438 echo "I presume that if # doesn't work, #! won't work either!"
1443 : figure out how to guarantee sh startup
1445 '') startsh=${sharpbang}${sh} ;;
1457 : echo "Yup, it does."
1459 echo "Hmm... '$startsh' does not guarantee sh startup..."
1460 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1464 : Save command line options in file UU/cmdline.opt for later use in
1465 : generating config.sh.
1466 cat > cmdline.opt <<EOSH
1467 : Configure command line arguments.
1476 cat >>cmdline.opt <<EOSH
1477 config_arg$argn='$arg'
1479 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1482 arg_exp=`cat cmdl.opt`
1483 args_exp="$args_exp$args_sep'$arg_exp'"
1484 argn=`expr $argn + 1`
1489 : produce awk script to parse command line options
1490 cat >options.awk <<'EOF'
1492 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1494 len = length(optstr);
1495 for (i = 1; i <= len; i++) {
1496 c = substr(optstr, i, 1);
1497 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1508 if (substr(str, 1, 1) != "-") {
1509 printf("'%s'\n", str);
1513 for (i = 2; i <= len; i++) {
1514 c = substr(str, i, 1);
1516 printf("-%s\n", substr(str, i));
1522 printf("'%s'\n", substr(str, i + 1));
1535 : process the command line options
1536 set X `for arg in "$@"; do echo "X$arg"; done |
1537 sed -e s/X// | awk -f options.awk`
1542 : set up default values
1552 rm -f optdef.sh posthint.sh
1553 cat >optdef.sh <<EOS
1559 while test $# -gt 0; do
1561 -d) shift; fastread=yes;;
1562 -e) shift; alldone=cont;;
1566 if test -r "$1"; then
1569 echo "$me: cannot read config file $1." >&2
1575 -h) shift; error=true;;
1576 -r) shift; reuseval=true;;
1577 -s) shift; silent=true; realsilent=true;;
1578 -E) shift; alldone=exit;;
1579 -K) shift; knowitall=true;;
1580 -O) shift; override=true;;
1581 -S) shift; silent=true; extractsh=true;;
1586 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1587 echo "$me: ignoring -D $1" >&2
1590 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1591 *) echo "$1='define'" >> optdef.sh;;
1598 *=) echo "$1" >> optdef.sh;;
1600 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1601 echo "$me: ignoring -U $1" >&2
1603 *) echo "$1='undef'" >> optdef.sh;;
1614 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1618 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1619 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1625 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1626 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1627 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1628 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1629 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1630 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1636 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1638 echo "$yyy=''" >> posthint.sh ;;
1643 echo "$yyy='$zzz'" >> posthint.sh ;;
1645 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1647 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1652 echo "$yyy=$zzz" >> posthint.sh ;;
1653 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1657 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
1660 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1668 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1669 [-U symbol] [-U symbol=] [-A command:symbol...]
1670 -d : use defaults for all answers.
1671 -e : go on without questioning past the production of config.sh.
1672 -f : specify an alternate default configuration file.
1673 -h : print this help message and exit (with an error status).
1674 -r : reuse C symbols value if possible (skips costly nm extraction).
1675 -s : silent mode, only echoes questions and essential information.
1676 -D : define symbol to have some value:
1677 -D symbol symbol gets the value 'define'
1678 -D symbol=value symbol gets the value 'value'
1679 common used examples (see INSTALL for more info):
1680 -Duse64bitint use 64bit integers
1681 -Duse64bitall use 64bit integers and pointers
1682 -Dusethreads use thread support
1683 -Dinc_version_list=none do not include older perl trees in @INC
1684 -DEBUGGING=none DEBUGGING options
1685 -Dcc=gcc choose your compiler
1686 -Dprefix=/opt/perl5 choose your destination
1687 -E : stop at the end of questions, after having produced config.sh.
1688 -K : do not use unless you know what you are doing.
1689 -O : let -D and -U override definitions from loaded configuration file.
1690 -S : perform variable substitutions on all .SH files (can mix with -f)
1691 -U : undefine symbol:
1692 -U symbol symbol gets the value 'undef'
1693 -U symbol= symbol gets completely empty
1695 -A : manipulate symbol after the platform specific hints have been applied:
1696 -A append:symbol=value append value to symbol
1697 -A symbol=value like append:, but with a separating space
1698 -A define:symbol=value define symbol to have value
1699 -A clear:symbol define symbol to be ''
1700 -A define:symbol define symbol to be 'define'
1701 -A eval:symbol=value define symbol to be eval of value
1702 -A prepend:symbol=value prepend value to symbol
1703 -A undef:symbol define symbol to be 'undef'
1704 -A undef:symbol= define symbol to be ''
1705 e.g.: -A prepend:libswanted='cl pthread '
1706 -A ccflags=-DSOME_MACRO
1707 -V : print version number and exit (with a zero status).
1714 case "$fastread$alldone" in
1717 case "$extractsh" in
1720 if test ! -t 0; then
1721 echo "Say 'sh Configure', not 'sh <Configure'"
1731 true) exec 1>/dev/null;;
1734 : run the defines and the undefines, if any, but leave the file out there...
1737 : create the posthint manipulation script and leave the file out there...
1742 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1743 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1744 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1745 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1746 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1749 : Some greps do not return status, grrr.
1750 echo "grimblepritz" >grimble
1751 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1753 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1759 : the following should work in any shell
1763 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1764 cat >contains <<'EOSS'
1765 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1770 : Find the path to the source tree
1773 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1777 *) src=`cd ../$src && pwd` ;;
1790 if test -f $rsrc/Configure && \
1791 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
1793 : found it, so we are ok.
1796 for src in . .. ../.. ../../.. ../../../..; do
1797 if test -f ../$src/Configure && \
1798 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1809 Sorry, I can't seem to locate the source dir for $package. Please start
1810 Configure with an explicit path -- i.e. /some/path/Configure.
1818 echo "Sources for $package found in \"$src\"." >&4
1822 : script used to extract .SH files with variable substitutions
1823 cat >extract <<'EOS'
1825 echo "Doing variable substitutions on .SH files..."
1826 if test -f MANIFEST; then
1827 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1829 echo "(Looking for .SH files under the source directory.)"
1830 set x `(cd "$src"; find . -name "*.SH" -print)`
1834 0) set x `(cd "$src"; echo *.SH)`; shift;;
1836 if test ! -f "$src/$1"; then
1842 while test $name; do
1843 if test ! -d "$name"; then
1844 create="$name $create";
1845 name=`echo $name | sed -e "s|^[^/]*$||"`;
1846 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1851 for file in $create; do
1860 dir=`expr X$file : 'X\(.*\)/'`
1861 file=`expr X$file : 'X.*/\(.*\)'`
1862 (cd "$dir" && . ./$file)
1872 dir=`expr X$file : 'X\(.*\)/'`
1873 file=`expr X$file : 'X.*/\(.*\)'`
1874 (set x $dir; shift; eval $mkdir_p)
1875 sh <"$src/$dir/$file"
1884 if test -f "$src/config_h.SH"; then
1885 if test ! -f config.h; then
1886 : oops, they left it out of MANIFEST, probably, so do it anyway.
1887 . "$src/config_h.SH"
1892 : extract files and exit if asked to do so
1893 case "$extractsh" in
1895 case "$realsilent" in
1899 case "$config_sh" in
1900 '') config_sh='config.sh';;
1903 echo "Fetching answers from $config_sh..."
1906 test "$override" && . ./optdef.sh
1910 echo "Extraction done."
1915 : Eunice requires " " instead of "", can you believe it
1918 echo "Beginning of configuration questions for $package."
1920 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1922 : first determine how to suppress newline on echo command
1924 echo "Checking echo to see how to suppress newlines..."
1925 (echo "hi there\c" ; echo " ") >.echotmp
1926 if $contains c .echotmp >/dev/null 2>&1 ; then
1937 echo $n "The star should be here-->$c"
1941 : Now test for existence of everything in MANIFEST
1943 if test -f "$rsrc/MANIFEST"; then
1944 echo "First let's make sure your kit is complete. Checking..." >&4
1945 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
1946 (split -l 50 2>/dev/null || split -50)
1949 for filelist in x??; do
1950 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1951 >/dev/null 2>>"$tmppwd/missing")
1953 if test -s missing; then
1957 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1959 You have the option of continuing the configuration process, despite the
1960 distinct possibility that your kit is damaged, by typing 'y'es. If you
1961 do, don't blame me if something goes wrong. I advise you to type 'n'o
1962 and contact the author (perlbug@perl.org).
1965 echo $n "Continue? [n] $c" >&4
1969 echo "Continuing..." >&4
1973 echo "ABORTING..." >&4
1978 echo "Looks good..."
1981 echo "There is no MANIFEST file. I hope your kit is complete !"
1985 : Find the appropriate value for a newline for tr
1987 if test -n "$DJGPP"; then
1990 if test X"$trnl" = X; then
1991 case "`echo foo|tr '\n' x 2>/dev/null`" in
1995 if test X"$trnl" = X; then
1996 case "`echo foo|tr '\012' x 2>/dev/null`" in
1997 foox) trnl='\012' ;;
2000 if test X"$trnl" = X; then
2001 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2002 fooxy) trnl='\n\r' ;;
2005 if test X"$trnl" = X; then
2008 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2014 : compute the number of columns on the terminal for proper question formatting
2019 : set up the echo used in my read
2020 myecho="case \"\$xxxm\" in
2021 '') echo $n \"\$rp $c\" >&4;;
2023 '') echo $n \"[\$xxxm] $c\";;
2025 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2027 echo $n \"[\$xxxm] $c\" >&4
2029 echo $n \"\$rp [\$xxxm] $c\" >&4
2035 : now set up to do reads with possible shell escape and default assignment
2041 case "\$fastread" in
2042 yes) case "\$dflt" in
2045 case "\$silent-\$rp" in
2050 *) case "\$silent" in
2051 true) case "\$rp" in
2056 while expr "X\$ans" : "X!" >/dev/null; do
2060 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2068 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2077 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2082 echo "(OK, I'll run with -d after this question.)" >&4
2085 echo "*** Sorry, \$1 not supported yet." >&4
2095 echo "*** Substitution done -- please confirm."
2097 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2102 echo "*** Error -- try again."
2109 case "\$ans\$xxxm\$nostick" in
2121 : create .config dir to save info across Configure sessions
2122 test -d ../.config || mkdir ../.config
2123 cat >../.config/README <<EOF
2124 This directory created by Configure to save information that should
2125 persist across sessions for $package.
2127 You may safely delete it if you wish.
2130 : See if we are using a devel version and want that
2131 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2133 $define|true|[yY]*) ;;
2134 *) case "$xversion" in
2137 *** WHOA THERE!!! ***
2139 This is an UNSTABLE DEVELOPMENT release.
2140 The version of this $package distribution is $xversion, that is, odd,
2141 (as opposed to even) and that signifies a development release.
2142 If you want a maintenance release, you want an even-numbered version.
2144 Do ***NOT*** install this into production use.
2145 Data corruption and crashes are possible.
2147 It is most seriously suggested that you do not continue any further
2148 unless you want to help in developing and debugging Perl.
2150 If you *still* want to build perl, you can answer 'y' now,
2151 or pass -Dusedevel to Configure.
2154 rp='Do you really want to continue?'
2158 [yY]) echo >&4 "Okay, continuing."
2159 usedevel="$define" ;;
2160 *) echo >&4 "Okay, bye."
2170 case "$versiononly" in
2171 '') versiononly="$define" ;;
2173 case "$installusrbinperl" in
2174 '') installusrbinperl="$undef" ;;
2179 : general instructions
2182 user=`(logname) 2>/dev/null`
2184 '') user=`whoami 2>&1`;;
2186 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2189 rp='Would you like to see the instructions?'
2200 This installation shell script will examine your system and ask you questions
2201 to determine how the perl5 package should be installed. If you get
2202 stuck on a question, you may use a ! shell escape to start a subshell or
2203 execute a command. Many of the questions will have default answers in square
2204 brackets; typing carriage return will give you the default.
2206 On some of the questions which ask for file or directory names you are allowed
2207 to use the ~name construct to specify the login directory belonging to "name",
2208 even if you don't have a shell which knows about that. Questions where this is
2209 allowed will be marked "(~name ok)".
2213 dflt='Type carriage return to continue'
2217 The prompter used in this script allows you to use shell variables and
2218 backticks in your answers. You may use $1, $2, etc... to refer to the words
2219 in the default answer, as if the default line was a set of arguments given to a
2220 script shell. This means you may also use $* to repeat the whole default line,
2221 so you do not have to re-type everything to add something to the default.
2223 Everytime there is a substitution, you will have to confirm. If there is an
2224 error (e.g. an unmatched backtick), the default answer will remain unchanged
2225 and you will be prompted again.
2227 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2228 the questions and use the computed defaults (or the previous answers if there
2229 was already a config.sh file). Type 'Configure -h' for a list of options.
2230 You may also start interactively and then answer '& -d' at any prompt to turn
2231 on the non-interactive behaviour for the remainder of the execution.
2237 Much effort has been expended to ensure that this shell script will run on any
2238 Unix system. If despite that it blows up on yours, your best bet is to edit
2239 Configure and run it again. If you can't run Configure for some reason,
2240 you'll have to generate a config.sh file by hand. Whatever problems you
2241 have, let me (perlbug@perl.org) know how I blew it.
2243 This installation script affects things in two ways:
2245 1) it may do direct variable substitutions on some of the files included
2247 2) it builds a config.h file for inclusion in C programs. You may edit
2248 any of these files as the need arises after running this script.
2250 If you make a mistake on a question, there is no easy way to back up to it
2251 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2252 files. Configure will offer to let you do this before it runs the SH files.
2255 dflt='Type carriage return to continue'
2257 case "$firsttime" in
2258 true) echo $user >>../.config/instruct;;
2262 : find out where common programs are
2264 echo "Locating common programs..." >&4
2277 if test -d \$dir/\$thing; then
2283 for thisthing in \$dir/\$thing; do
2284 : just loop through to pick last item
2286 if test -f \$thisthing; then
2289 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2292 elif test -f \$dir/\$thing.exe; then
2293 if test -n "$DJGPP"; then
2294 echo \$dir/\$thing.exe
2295 elif test "$eunicefix" != ":"; then
2296 : on Eunice apparently
2348 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2349 pth="$pth /lib /usr/lib"
2350 for file in $loclist; do
2354 if test -f "$xxx"; then
2357 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2358 xxx=`./loc $file $file $pth`
2361 '') xxx=`./loc $file $file $pth`;;
2362 *) xxx=`./loc $xxx $xxx $pth`;;
2364 eval $file=$xxx$_exe
2368 echo $file is in $xxx.
2371 echo $file is in $xxx.
2374 echo "I don't know where '$file' is, and my life depends on it." >&4
2375 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2381 echo "Don't worry if any of the following aren't found..."
2383 for file in $trylist; do
2387 if test -f "$xxx"; then
2390 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2391 xxx=`./loc $file $file $pth`
2394 '') xxx=`./loc $file $file $pth`;;
2395 *) xxx=`./loc $xxx $xxx $pth`;;
2397 eval $file=$xxx$_exe
2401 echo $file is in $xxx.
2404 echo $file is in $xxx.
2407 echo "I don't see $file out there, $say."
2414 echo "Substituting grep for egrep."
2421 echo "Substituting cp for ln."
2430 echo "I can't find make or gmake, and my life depends on it." >&4
2431 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2439 *) # We can't have osname yet.
2440 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2441 # Assume that gmake, if found, is definitely GNU make
2442 # and prefer it over the system make.
2443 echo "Substituting gmake for make."
2451 echo "Hopefully test is built into your sh."
2454 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2455 echo "Using the test built into your sh."
2463 echo "Hopefully echo is built into your sh."
2468 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2469 $echo $n "hi there$c" >foo1
2470 echo $n "hi there$c" >foo2
2471 if cmp foo1 foo2 >/dev/null 2>&1; then
2472 echo "They are compatible. In fact, they may be identical."
2479 They are not compatible! You are probably running ksh on a non-USG system.
2480 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2481 have echo built in and we may have to run some Bourne shell scripts. That
2482 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2485 $echo $n "The star should be here-->$c"
2492 # This question was auctioned at YAPC::Europe-2007 in Vienna
2493 # I never promised you could answer it. I only auctioned the question.
2495 The following message is sponsored by
2497 Dresden.pm<--The stars should be here.
2499 Dear Perl user, system administrator or package
2500 maintainer, the Perl community sends greetings to
2501 you. Do you (emblematical) greet back [Y/n]? n
2505 : Check what type of C compiler we use
2509 cat <<'EOSC' >>trygcc
2514 int main(int argc, char *argv[]) {
2518 if $cc -o try $ccflags $ldflags try.c; then
2521 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2527 # Skip this test because it gives a false match on output like:
2528 # ./trygcc: line 23: cc: command not found
2529 # case "`$cc -v -c try.c 2>&1`" in
2530 # *gcc*) trygcc=no ;;
2532 if $test X"$trygcc" = Xyes; then
2533 if gcc -o try -c try.c; then
2535 echo "You seem to have a working gcc, though." >&4
2536 # Switching compilers may undo the work of hints files.
2537 # The most common problem is -D_REENTRANT for threads.
2538 # This heuristic catches that case, but gets false positives
2539 # if -Dusethreads was not actually specified. Better to
2540 # bail out here with a useful message than fail
2541 # mysteriously later. Should we perhaps just try to
2542 # re-invoke Configure -Dcc=gcc config_args ?
2543 if $test -f usethreads.cbu; then
2546 *** However, any setting of the C compiler flags (e.g. for thread support)
2547 *** will be lost. It may be necessary for you to restart Configure and
2548 *** add -Dcc=gcc to your Configure command line.
2551 rp="Would you like to go ahead and try gcc anyway?"
2554 rp="Would you like to use it?"
2557 if $test -f myread; then
2560 if $test -f UU/myread; then
2563 echo "Cannot find myread, sorry. Aborting." >&2
2568 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2581 cat <<'EOSC' >>checkcc
2586 int main(int argc, char *argv[]) {
2590 if $cc -o try $ccflags $ldflags try.c; then
2593 if $test X"$despair" = Xyes; then
2594 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2597 You need to find a working C compiler.
2598 Either (purchase and) install the C compiler supplied by your OS vendor,
2599 or for a free C compiler try http://gcc.gnu.org/
2600 I cannot continue any further, aborting.
2609 : determine whether symbolic links are supported
2612 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2613 echo "Symbolic links are supported." >&4
2616 echo "Symbolic links are NOT supported." >&4
2621 : determine whether symbolic links are supported
2625 echo "Checking how to test for symbolic links..." >&4
2627 if $test "X$issymlink" = X; then
2629 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2630 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2632 if test $? = 0; then
2635 echo "Your builtin 'test -h' may be broken." >&4
2638 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2641 if test -f "$p/$test"; then
2650 echo "Trying external '$test -h'." >&4
2651 issymlink="$test -h"
2652 if $test ! -h sym >/dev/null 2>&1; then
2653 echo "External '$test -h' is broken, too." >&4
2661 if $test "X$issymlink" = X; then
2662 if $test -L sym 2>/dev/null; then
2663 issymlink="$test -L"
2664 echo "The builtin '$test -L' worked." >&4
2667 if $test "X$issymlink" != X; then
2668 echo "You can test for symbolic links with '$issymlink'." >&4
2670 echo "I do not know how you can test for symbolic links." >&4
2674 *) echo "No symbolic links, so not testing for their testing..." >&4
2679 : Make symlinks util
2680 case "$mksymlinks" in
2683 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2686 *) case "$lns:$issymlink" in
2687 *"ln"*" -s:"*"test -"?)
2688 echo "Creating the symbolic links..." >&4
2689 echo "(First creating the subdirectories...)" >&4
2691 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2693 test -z "$directory" && break
2697 if test ! -d t/base; then
2698 echo "Failed to create the subdirectories. Aborting." >&4
2701 echo "(Then creating the symlinks...)" >&4
2702 awk '{print $1}' $src/MANIFEST | while true; do
2704 test -z "$filename" && break
2705 if test -f $filename; then
2706 if $issymlink $filename; then
2710 if test -f $filename; then
2711 echo "$filename already exists, not symlinking."
2713 ln -s $src/$filename $filename
2717 if test ! -f t/base/lex.t; then
2718 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2723 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2731 : Check for Cross-Compilation
2732 case "$usecrosscompile" in
2734 $echo "Cross-compiling..."
2737 *-*-gcc) # A cross-compiling gcc, probably.
2738 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2740 # leave out ld, choosing it is more complex
2742 ranlib=$targetarch-ranlib
2743 $echo 'extern int foo;' > try.c
2744 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2746 if $test $# -gt 0; then
2748 incpth="`$echo $incpth|$sed 's/^ //'`"
2749 echo "Guessing incpth '$incpth'." >&4
2751 j="`$echo $i|$sed 's,/include$,/lib,'`"
2752 if $test -d $j; then
2756 libpth="`$echo $libpth|$sed 's/^ //'`"
2757 echo "Guessing libpth '$libpth'." >&4
2762 case "$targetarch" in
2763 '') echo "Targetarch not defined." >&4; croak=y ;;
2764 *) echo "Using targetarch $targetarch." >&4 ;;
2767 '') echo "Incpth not defined." >&4; croak=y ;;
2768 *) echo "Using incpth '$incpth'." >&4 ;;
2771 '') echo "Libpth not defined." >&4; croak=y ;;
2772 *) echo "Using libpth '$libpth'." >&4 ;;
2775 '') for i in $incpth; do
2776 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2778 echo "Guessing usrinc $usrinc." >&4
2783 '') echo "Usrinc not defined." >&4; croak=y ;;
2786 *) echo "Using usrinc $usrinc." >&4 ;;
2788 case "$targethost" in
2789 '') echo "Targethost not defined." >&4; croak=y ;;
2790 *) echo "Using targethost $targethost." >&4
2795 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2798 /*) run=$src/Cross/run
2799 targetmkdir=$src/Cross/mkdir
2801 from=$src/Cross/from
2803 *) pwd=`$test -f ../Configure & cd ..; pwd`
2805 targetmkdir=$pwd/Cross/mkdir
2807 from=$pwd/Cross/from
2810 case "$targetrun" in
2811 '') targetrun=ssh ;;
2816 case "$targetfrom" in
2817 '') targetfrom=scp ;;
2821 from=$from-$targetfrom
2822 case "$targetdir" in
2824 echo "Guessing targetdir $targetdir." >&4
2827 case "$targetuser" in
2829 echo "Guessing targetuser $targetuser." >&4
2832 case "$targetfrom" in
2836 case "$targetrun" in
2848 '') cwd=$targetdir ;;
2852 if $test ! -f \$exe.xok; then
2856 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2859 *) echo "Unknown targetrun '$targetrun'" >&4
2863 case "$targetmkdir" in
2865 cat >$targetmkdir <<EOF
2867 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2869 $chmod a+rx $targetmkdir
2871 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2883 $targetmkdir \`dirname \$f\`
2884 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2887 $targetmkdir $targetdir/\`dirname \$f\`
2888 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2901 $mkdir -p $targetdir/\`dirname \$f\`
2902 $cp \$f $targetdir/\$f || exit 1
2905 $targetmkdir $targetdir/\`dirname \$f\`
2906 $cp \$f $targetdir/\$f || exit 1
2913 *) echo "Unknown targetto '$targetto'" >&4
2917 case "$targetfrom" in
2924 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2929 cp) cat >$from <<EOF
2934 cp $targetdir/\$f . || exit 1
2939 *) echo "Unknown targetfrom '$targetfrom'" >&4
2943 if $test ! -f $run; then
2944 echo "Target 'run' script '$run' not found." >&4
2948 if $test ! -f $to; then
2949 echo "Target 'to' script '$to' not found." >&4
2953 if $test ! -f $from; then
2954 echo "Target 'from' script '$from' not found." >&4
2958 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2962 Using '$run' for remote execution,
2963 and '$from' and '$to'
2964 for remote file transfer.
2970 usecrosscompile='undef'
2975 : see whether [:lower:] and [:upper:] are supported character classes
2977 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2979 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2983 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2984 # (0xd9 and 0xe2), therefore that is a nice testing point.
2985 if test "X$up" = X -o "X$low" = X; then
2986 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2992 if test "X$up" = X -o "X$low" = X; then
2993 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2999 if test "X$up" = X -o "X$low" = X; then
3000 case "`echo RS | od -x 2>/dev/null`" in
3002 echo "Hey, this might be EBCDIC." >&4
3003 if test "X$up" = X -o "X$low" = X; then
3004 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3005 rs) up='[A-IJ-RS-Z]'
3010 if test "X$up" = X -o "X$low" = X; then
3011 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3021 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3023 echo "Using $up and $low to convert case." >&4
3026 echo "I don't know how to translate letters from upper to lower case." >&4
3027 echo "Your tr is not acting any way I know of." >&4
3031 : set up the translation script tr, must be called with ./tr of course
3035 '[A-Z][a-z]') exec $tr '$up' '$low';;
3036 '[a-z][A-Z]') exec $tr '$low' '$up';;
3043 : Try to determine whether config.sh was made on this system
3044 case "$config_sh" in
3046 myuname=`$uname -a 2>/dev/null`
3047 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3048 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3049 # because the A-Z/a-z are not consecutive.
3050 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3051 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3052 newmyuname="$myuname"
3054 case "$knowitall" in
3056 if test -f ../config.sh; then
3057 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3058 eval "`grep myuname= ../config.sh`"
3060 if test "X$myuname" = "X$newmyuname"; then
3068 : Get old answers from old config file if Configure was run on the
3069 : same system, otherwise use the hints.
3072 if test -f config.sh; then
3074 rp="I see a config.sh file. Shall I use it to set the defaults?"
3077 n*|N*) echo "OK, I'll ignore it."
3078 mv config.sh config.sh.old
3079 myuname="$newmyuname"
3081 *) echo "Fetching default answers from your old config.sh file..." >&4
3089 : Older versions did not always set $sh. Catch re-use of such
3099 if test ! -f config.sh; then
3102 First time through, eh? I have some defaults handy for some systems
3103 that need some extra help getting the Configure answers right:
3106 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3108 : Half the following guesses are probably wrong... If you have better
3109 : tests or hints, please send them to perlbug@perl.org
3110 : The metaconfig authors would also appreciate a copy...
3111 $test -f /irix && osname=irix
3112 $test -f /xenix && osname=sco_xenix
3113 $test -f /dynix && osname=dynix
3114 $test -f /dnix && osname=dnix
3115 $test -f /lynx.os && osname=lynxos
3116 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3117 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3118 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3119 $test -f /bin/mips && /bin/mips && osname=mips
3120 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3121 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3122 $test -d /usr/apollo/bin && osname=apollo
3123 $test -f /etc/saf/_sactab && osname=svr4
3124 $test -d /usr/include/minix && osname=minix
3125 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3126 if $test -d /MachTen -o -d /MachTen_Folder; then
3128 if $test -x /sbin/version; then
3129 osvers=`/sbin/version | $awk '{print $2}' |
3130 $sed -e 's/[A-Za-z]$//'`
3131 elif $test -x /usr/etc/version; then
3132 osvers=`/usr/etc/version | $awk '{print $2}' |
3133 $sed -e 's/[A-Za-z]$//'`
3139 $test -f /sys/posix.dll &&
3140 $test -f /usr/bin/what &&
3141 set X `/usr/bin/what /sys/posix.dll` &&
3142 $test "$3" = UWIN &&
3146 if $test -f $uname; then
3154 umips) osname=umips ;;
3157 [23]100) osname=mips ;;
3158 next*) osname=next ;;
3160 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3161 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3164 elif $test -f /etc/kconfig; then
3166 if test "$lns" = "$ln -s"; then
3168 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3170 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3177 if test -n "$DJGPP"; then
3186 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3188 # oslevel can fail with:
3189 # oslevel: Unable to acquire lock.
3190 *not\ found) osvers="$4"."$3" ;;
3191 '<3240'|'<>3240') osvers=3.2.0 ;;
3192 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3193 '=3250'|'>3250') osvers=3.2.5 ;;
3197 bsd386) osname=bsd386
3200 cygwin*) osname=cygwin
3203 *dc.osx) osname=dcosx
3209 domainos) osname=apollo
3215 dragonfly) osname=dragonfly
3218 dynixptx*) osname=dynixptx
3219 osvers=`echo "$4"|sed 's/^v//'`
3221 freebsd) osname=freebsd
3223 genix) osname=genix ;;
3227 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3243 netbsd*) osname=netbsd
3246 news-os) osvers="$3"
3248 4*) osname=newsos4 ;;
3252 next*) osname=next ;;
3253 nonstop-ux) osname=nonstopux ;;
3254 openbsd) osname=openbsd
3260 POSIX-BC | posix-bc ) osname=posix-bc
3263 powerux | power_ux | powermax_os | powermaxos | \
3264 powerunix | power_unix) osname=powerux
3270 solaris) osname=solaris
3272 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3279 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3283 titanos) osname=titanos
3292 ultrix) osname=ultrix
3295 osf1|mls+) case "$5" in
3298 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3301 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3304 hp*) osname=hp_osf1 ;;
3305 mips) osname=mips_osf1 ;;
3308 # UnixWare 7.1.2 is known as Open UNIX 8
3309 openunix|unixware) osname=svr5
3317 $2) case "$osname" in
3321 : svr4.x or possibly later
3331 if test -f /stand/boot ; then
3332 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3333 if test -n "$INITPROG" -a -f "$INITPROG"; then
3334 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3335 if test -n "$isesix"; then
3343 *) if test -f /etc/systemid; then
3345 set `echo $3 | $sed 's/\./ /g'` $4
3346 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3348 elif $test -f $src/hints/sco_$1_$2.sh; then
3350 elif $test -f $src/hints/sco_$1.sh; then
3355 '') : Still unknown. Probably a generic Sys V.
3364 *) case "$osname" in
3365 '') : Still unknown. Probably a generic BSD.
3373 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3374 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3375 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3378 $rm -f UU/kernel.what
3379 elif test -d c:/. -o -n "$is_os2" ; then
3386 case "$targetarch" in
3389 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3394 : Now look for a hint file osname_osvers, unless one has been
3395 : specified already.
3398 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3399 : Also try without trailing minor version numbers.
3400 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3401 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3402 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3403 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3406 *) case "$osvers" in
3409 *) if $test -f $src/hints/$file.sh ; then
3411 elif $test -f $src/hints/$xfile.sh ; then
3413 elif $test -f $src/hints/$xxfile.sh ; then
3415 elif $test -f $src/hints/$xxxfile.sh ; then
3417 elif $test -f $src/hints/$xxxxfile.sh ; then
3419 elif $test -f "$src/hints/${osname}.sh" ; then
3428 if $test -f Policy.sh ; then
3431 none) dflt="Policy" ;;
3432 *) dflt="Policy $dflt" ;;
3437 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3441 if $test -f Policy.sh ; then
3444 There's also a Policy hint file available, which should make the
3445 site-specific (policy) questions easier to answer.
3452 You may give one or more space-separated answers, or "none" if appropriate.
3453 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3454 previous run of Configure, you may specify it as well as or instead of
3455 OS-specific hints. If hints are provided for your OS, you should use them:
3456 although Perl can probably be built without hints on many platforms, using
3457 hints often improve performance and may enable features that Configure can't
3458 set up on its own. If there are no hints that match your OS, specify "none";
3459 DO NOT give a wrong version or a wrong OS.
3463 rp="Which of these apply, if any?"
3466 for file in $tans; do
3467 if $test X$file = XPolicy -a -f Policy.sh; then
3469 $cat Policy.sh >> UU/config.sh
3470 elif $test -f $src/hints/$file.sh; then
3471 . $src/hints/$file.sh
3472 $cat $src/hints/$file.sh >> UU/config.sh
3473 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3476 : Give one chance to correct a possible typo.
3477 echo "$file.sh does not exist"
3479 rp="hint to use instead?"
3481 for file in $ans; do
3482 if $test -f "$src/hints/$file.sh"; then
3483 . $src/hints/$file.sh
3484 $cat $src/hints/$file.sh >> UU/config.sh
3485 elif $test X$ans = X -o X$ans = Xnone ; then
3488 echo "$file.sh does not exist -- ignored."
3495 : Remember our hint file for later.
3496 if $test -f "$src/hints/$file.sh" ; then
3506 echo "Fetching default answers from $config_sh..." >&4
3510 cp $config_sh config.sh 2>/dev/null
3520 test "$override" && . ./optdef.sh
3522 : Restore computed paths
3523 for file in $loclist $trylist; do
3524 eval $file="\$_$file"
3529 Configure uses the operating system name and version to set some defaults.
3530 The default value is probably right if the name rings a bell. Otherwise,
3531 since spelling matters for me, either accept the default or answer "none"
3538 ''|' '|none) dflt=none ;;
3539 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3542 *) dflt="$osname" ;;
3544 rp="Operating system name?"
3548 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3554 ''|' '|none) dflt=none ;;
3555 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3556 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3558 ''|' ') dflt=none ;;
3563 *) dflt="$osvers" ;;
3565 rp="Operating system version?"
3575 : who configured the system
3576 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3579 cf_by=`(logname) 2>/dev/null`
3582 cf_by=`(whoami) 2>/dev/null`
3584 "") cf_by=unknown ;;
3589 : decide how portable to be. Allow command line overrides.
3590 case "$d_portable" in
3592 *) d_portable="$define" ;;
3595 : set up shell script to do ~ expansion
3601 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3604 if $test -f /bin/csh; then
3605 /bin/csh -f -c "glob \$1"
3610 name=\`$expr x\$1 : '..\([^/]*\)'\`
3611 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3612 if $test ! -d "\$dir"; then
3614 echo "\$me: can't locate home directory for: \$name" >&2
3619 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3635 : now set up to get a file name
3639 cat <<'EOSC' >>getfile
3655 : getfile will accept an answer from the comma-separated list
3656 : enclosed in parentheses even if it does not meet other criteria.
3657 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3658 fn=`echo $fn | sed 's/(.*)//'`
3664 loc_file=`expr $fn : '.*:\(.*\)'`
3665 fn=`expr $fn : '\(.*\):.*'`
3673 */*) fullpath=true;;
3682 *e*) exp_file=true;;
3685 *p*) nopath_ok=true;;
3690 *d*) type='Directory';;
3691 *l*) type='Locate';;
3696 Locate) what='File';;
3701 case "$d_portable" in
3709 while test "$type"; do
3714 true) rp="$rp (~name ok)";;
3717 if test -f UU/getfile.ok && \
3718 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3737 value=`UU/filexp $ans`
3740 if test "$ans" != "$value"; then
3741 echo "(That expands to $value on this system.)"
3755 /*) value="$ansexp" ;;
3756 [a-zA-Z]:/*) value="$ansexp" ;;
3761 echo "I shall only accept a full path name, as in /bin/ls." >&4
3762 echo "Use a ! shell escape if you wish to check pathnames." >&4
3765 echo "Please give a full path name, starting with slash." >&4
3768 echo "Note that using ~name is ok provided it expands well." >&4
3781 for fp in $gfpth; do
3782 if test "X$fp" = X.; then
3787 if test -f "$pf"; then
3789 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3791 echo "($value is not a plain file, but that's ok.)"
3794 if test X"$type" = X; then
3801 for fp in $gfpth; do
3802 if test "X$fp" = X.; then
3807 direxp="$fp/$ansexp"
3809 if test -d "$direxp"; then
3817 if test -d "$ansexp"; then
3818 echo "(Looking for $loc_file in directory $value.)"
3819 value="$value/$loc_file"
3820 ansexp="$ansexp/$loc_file"
3822 if test -f "$ansexp"; then
3825 case "$nopath_ok" in
3826 true) case "$value" in
3828 *) echo "Assuming $value will be in people's path."
3844 if test "$fastread" = yes; then
3849 rp="$what $value doesn't exist. Use that name anyway?"
3868 test "X$gfpthkeep" != Xy && gfpth=""
3871 : determine root of directory hierarchy where package will be installed.
3874 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3877 dflt=`echo "$prefix" | sed 's/.$//'`
3885 By default, $package will be installed in $dflt/bin, manual pages
3886 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3887 installation directories. Typically this is something like /usr/local.
3888 If you wish to have binaries under /usr/bin but other parts of the
3889 installation under /usr/local, that's ok: you will be prompted
3890 separately for each of the installation directories, the prefix being
3891 only used to set the defaults.
3895 rp='Installation prefix to use?'
3903 *) oldprefix="$prefix";;
3910 : allow them to override the AFS root
3913 *) afsroot=$afsroot ;;
3919 $define|true) afs=true ;;
3920 $undef|false) afs=false ;;
3921 *) if $test -d $afsroot; then
3929 echo "AFS may be running... I'll be extra cautious then..." >&4
3931 echo "AFS does not seem to be running..." >&4
3934 : determine installation prefix for where package is to be installed.
3938 Since you are running AFS, I need to distinguish the directory in which
3939 files will reside from the directory in which they are installed (and from
3940 which they are presumably copied to the former directory by occult means).
3943 case "$installprefix" in
3944 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3945 *) dflt="$installprefix";;
3950 In some special cases, particularly when building $package for distribution,
3951 it is convenient to distinguish the directory in which files should be
3952 installed from the directory ($prefix) in which they will
3953 eventually reside. For most users, these two directories are the same.
3956 case "$installprefix" in
3958 *) dflt=$installprefix;;
3962 rp='What installation prefix should I use for installing files?'
3964 installprefix="$ans"
3965 installprefixexp="$ansexp"
3967 : Perform the prefixexp/installprefixexp correction if necessary
3968 cat <<EOS >installprefix
3971 cat <<'EOSC' >>installprefix
3972 : Change installation prefix, if necessary.
3973 if $test X"$prefix" != X"$installprefix"; then
3974 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3976 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3979 chmod +x installprefix
3980 $eunicefix installprefix
3982 : Set variables such as privlib and privlibexp from the output of ./getfile
3983 : performing the prefixexp/installprefixexp correction if necessary.
3984 cat <<EOS >setprefixvar
3987 cat <<'EOSC' >>setprefixvar
3988 eval "${prefixvar}=\"\$ans\""
3989 eval "${prefixvar}exp=\"\$ansexp\""
3992 chmod +x setprefixvar
3993 $eunicefix setprefixvar
3995 : set up the script used to warn in case of inconsistency
4004 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4006 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4007 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4012 echo "*** WHOA THERE!!! ***" >&4
4013 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4016 rp=" Keep the $hint value?"
4019 y) td=$was; tu=$was;;
4023 : function used to set '$1' to '$val'
4024 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4026 $define$undef) . ./whoa; eval "$var=\$td";;
4027 $undef$define) . ./whoa; eval "$var=\$tu";;
4028 *) eval "$var=$val";;
4031 : Check is we will use socks
4033 $define|true|[yY]*) dflt='y';;
4038 Perl can be built to use the SOCKS proxy protocol library. To do so,
4039 Configure must be run with -Dusesocks. If you use SOCKS you also need
4040 to use the PerlIO abstraction layer, this will be implicitly selected.
4042 If this doesn't make any sense to you, just accept the default '$dflt'.
4044 rp='Build Perl for SOCKS?'
4047 y|Y) val="$define" ;;
4054 $define|true|[yY]*) useperlio="$define";;
4057 : Check if we want perlio
4058 case "$useperlio" in
4059 $define|true|[yY]*|'') dflt='y';;
4064 Previous version of $package used the standard IO mechanisms as
4065 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4066 alternate IO mechanisms via the PerlIO abstraction layer, but the
4067 stdio mechanism is still available if needed. The abstraction layer
4068 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4069 Using PerlIO with sfio may cause problems with some extension modules.
4071 If this doesn't make any sense to you, just accept the default '$dflt'.
4073 rp='Use the PerlIO abstraction layer?'
4080 echo "Ok, doing things the stdio way."
4089 case "$useperlio" in
4090 $define|true|[yY]*) ;;
4093 You are using the SOCKS proxy protocol library which means that you
4094 should also use the PerlIO layer. You may be headed for trouble.
4102 : get the patchlevel
4104 echo "Getting the current patchlevel..." >&4
4105 if $test -r $rsrc/patchlevel.h;then
4106 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4107 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4108 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4109 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4110 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4111 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4112 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4121 $echo "(You do not have patchlevel.h. Eek.)"
4123 if $test -r $rsrc/.patch ; then
4124 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4125 perl_patchlevel=`cat $rsrc/.patch`
4128 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4129 version_patchlevel_string="version $patchlevel subversion $subversion"
4130 case "$perl_patchlevel" in
4132 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4135 $echo "(You have $package $version_patchlevel_string.)"
4139 : XXX Should be a Configure test for double-dots in filenames.
4140 version=`echo $revision $patchlevel $subversion | \
4141 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4142 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4143 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4146 version=`echo $revision $patchlevel $subversion | \
4147 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4148 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4149 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4152 : Special case the 5.005_xx maintenance series, which used 5.005
4153 : without any subversion label as a subdirectory in $sitelib
4154 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4155 api_versionstring='5.005'
4158 : Do we want threads support and if so, what type
4159 case "$usethreads" in
4160 $define|true|[yY]*) dflt='y';;
4161 *) # Catch case where user specified ithreads or 5005threads but
4162 # forgot -Dusethreads (A.D. 4/2002)
4163 case "$useithreads$use5005threads" in
4165 case "$useperlio" in
4166 "$define") dflt='y' ;;
4176 Perl can be built to take advantage of threads on some systems.
4177 To do so, Configure can be run with -Dusethreads.
4179 Note that Perl built with threading support runs slightly slower
4180 and uses more memory than plain Perl. The current implementation
4181 is believed to be stable, but it is fairly new, and so should be
4182 treated with caution.
4184 If this doesn't make any sense to you, just accept the default '$dflt'.
4186 rp='Build a threading Perl?'
4189 y|Y) val="$define" ;;
4195 if $test $patchlevel -lt 9; then
4196 case "$usethreads" in
4200 Since release 5.6, Perl has had two different threading implementations,
4201 the newer interpreter-based version (ithreads) with one interpreter per
4202 thread, and the older 5.005 version (5005threads).
4203 The 5005threads version is effectively unmaintained and will probably be
4204 removed in Perl 5.10, so there should be no need to build a Perl using it
4205 unless needed for backwards compatibility with some existing 5.005threads
4209 : Default to ithreads unless overridden on command line or with
4212 case "$use5005threads" in
4213 $define|true|[yY]*) dflt='n';;
4215 case "$useithreads" in
4216 $undef|false|[nN]*) dflt='n';;
4218 rp='Use the newer interpreter-based ithreads?'
4221 y|Y) val="$define" ;;
4226 : Now set use5005threads to the opposite value.
4227 case "$useithreads" in
4228 $define) val="$undef" ;;
4235 useithreads="$undef"
4236 use5005threads="$undef"
4240 case "$useithreads$use5005threads" in
4244 You cannot have both the ithreads and the 5.005 threads enabled
4245 at the same time. Disabling the 5.005 threads since they are
4246 much less stable than the ithreads.
4249 use5005threads="$undef"
4254 : perl-5.9.x and later
4256 if test X"$usethreads" = "X$define"; then
4257 case "$use5005threads" in
4261 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4268 use5005threads="$undef"
4269 useithreads="$usethreads"
4272 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4275 *** To build with ithreads you must also use the PerlIO layer.
4276 *** Cannot continue, aborting.
4282 case "$d_oldpthreads" in
4283 '') : Configure tests would be welcome here. For now, assume undef.
4285 *) val="$d_oldpthreads" ;;
4291 : Look for a hint-file generated 'call-back-unit'. If the
4292 : user has specified that a threading perl is to be built,
4293 : we may need to set or change some other defaults.
4294 if $test -f usethreads.cbu; then
4295 echo "Your platform has some specific hints regarding threaded builds, using them..."
4298 case "$usethreads" in
4299 "$define"|true|[yY]*)
4301 (Your platform does not have any specific hints for threaded builds.
4302 Assuming POSIX threads, then.)
4308 : Check if multiplicity is required
4311 Perl can be built so that multiple Perl interpreters can coexist
4312 within the same Perl executable.
4315 case "$useithreads" in
4318 This multiple interpreter support is required for interpreter-based threads.
4322 *) case "$usemultiplicity" in
4323 $define|true|[yY]*) dflt='y';;
4327 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4328 rp='Build Perl for multiplicity?'
4331 y|Y) val="$define" ;;
4339 : Check if morebits is requested
4340 case "$usemorebits" in
4341 "$define"|true|[yY]*)
4342 use64bitint="$define"
4343 uselongdouble="$define"
4344 usemorebits="$define"
4346 *) usemorebits="$undef"
4350 : Determine the C compiler to be used
4356 rp="Use which C compiler?"
4360 : See whether they have no cc but they do have gcc
4362 if $test -f cc.cbu; then
4367 : make some quick guesses about what we are up against
4369 $echo $n "Hmm... $c"
4379 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4380 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4382 echo "Looks kind of like an OSF/1 system, but we'll see..."
4384 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4385 xxx=`./loc addbib blurfl $pth`
4386 if $test -f $xxx; then
4387 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4391 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4392 echo "Looks kind of like an extended USG system, but we'll see..."
4394 echo "Looks kind of like a USG system, but we'll see..."
4398 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4399 echo "Looks kind of like a BSD system, but we'll see..."
4403 echo "Looks kind of like a Version 7 system, but we'll see..."
4406 case "$eunicefix" in
4409 There is, however, a strange, musty smell in the air that reminds me of
4410 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4414 : it so happens the Eunice I know will not run shell scripts in Unix format
4418 echo "Congratulations. You aren't running Eunice."
4422 : Detect OS2. The p_ variable is set above in the Head.U unit.
4423 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4424 : semicolon as a patch separator
4429 I have the feeling something is not exactly right, however...don't tell me...
4430 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4431 (Or you may be running DOS with DJGPP.)
4436 if test -f /xenix; then
4437 echo "Actually, this looks more like a XENIX system..."
4442 echo "It's not Xenix..."
4447 if test -f /venix; then
4448 echo "Actually, this looks more like a VENIX system..."
4455 echo "Nor is it Venix..."
4458 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4459 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4462 : Check if we are using GNU gcc and what its version is
4464 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4468 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4470 printf("%s\n", __VERSION__);
4472 printf("%s\n", "1");
4478 if $cc -o try $ccflags $ldflags try.c; then
4479 gccversion=`$run ./try`
4480 case "$gccversion" in
4481 '') echo "You are not using GNU cc." ;;
4482 *) echo "You are using GNU cc $gccversion."
4488 echo "*** WHOA THERE!!! ***" >&4
4489 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4490 case "$knowitall" in
4492 echo " You'd better start hunting for one and let me know about it." >&4
4498 case "$gccversion" in
4499 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4501 case "$gccversion" in
4502 '') gccosandvers='' ;;
4503 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4504 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4506 case "$gccosandvers" in
4507 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4508 $osname$osvers) ;; # looking good
4509 $osname*) cat <<EOM >&4
4511 *** WHOA THERE!!! ***
4513 Your gcc has not been compiled for the exact release of
4514 your operating system ($gccosandvers versus $osname$osvers).
4516 In general it is a good idea to keep gcc synchronized with
4517 the operating system because otherwise serious problems
4518 may ensue when trying to compile software, like Perl.
4520 I'm trying to be optimistic here, though, and will continue.
4521 If later during the configuration and build icky compilation
4522 problems appear (headerfile conflicts being the most common
4523 manifestation), I suggest reinstalling the gcc to match
4524 your operating system release.
4528 *) gccosandvers='' ;; # failed to parse, better be silent
4536 # gcc 3.* complain about adding -Idirectories that they already know about,
4537 # so we will take those off from locincpth.
4538 case "$gccversion" in
4540 echo "main(){}">try.c
4541 for incdir in $locincpth; do
4542 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4543 grep '^c[cp]p*[01]: warning: changing search order '`
4544 if test "X$warn" != X; then
4545 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4551 : What should the include directory be ?
4553 $echo $n "Hmm... $c"
4557 if $test -f /bin/mips && /bin/mips; then
4558 echo "Looks like a MIPS system..."
4559 $cat >usr.c <<'EOCP'
4560 #ifdef SYSTYPE_BSD43
4564 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4565 dflt='/bsd43/usr/include'
4569 mips_type='System V'
4571 $rm -f usr.c usr.out
4572 echo "and you're compiling with the $mips_type compiler and libraries."
4576 echo "Doesn't look like a MIPS system."
4586 case "$xxx_prompt" in
4589 rp='Where are the include files you want to use?'
4597 : see how we invoke the C preprocessor
4599 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4600 cat <<'EOT' >testcpp.c
4606 if test ! -f cppstdin; then
4607 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4608 # AIX cc -E doesn't show the absolute headerfile
4609 # locations but we'll cheat by using the -M flag.
4610 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
4612 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4615 echo "Keeping your $hint cppstdin wrapper."
4618 wrapper=`pwd`/cppstdin
4622 if $test "X$cppstdin" != "X" && \
4623 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4624 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4626 echo "You used to use $cppstdin $cppminus so we'll use that again."
4628 '') echo "But let's see if we can live without a wrapper..." ;;
4630 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4631 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4633 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4636 echo "(However, $cpprun $cpplast does not work, let's see...)"
4644 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4651 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4652 $cc -E <testcpp.c >testcpp.out 2>&1; \
4653 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4654 echo "Yup, it does."
4657 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4658 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4659 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4660 echo "Yup, it does."
4663 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4664 $cc -P <testcpp.c >testcpp.out 2>&1; \
4665 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4666 echo "Yipee, that works!"
4669 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4670 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4671 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4672 echo "At long last!"
4675 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4676 $cpp <testcpp.c >testcpp.out 2>&1; \
4677 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4681 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4682 $cpp - <testcpp.c >testcpp.out 2>&1; \
4683 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4684 echo "Hooray, it works! I was beginning to wonder."
4687 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4688 $wrapper <testcpp.c >testcpp.out 2>&1; \
4689 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4695 rp="No dice. I can't find a C preprocessor. Name one:"
4699 $x_cpp <testcpp.c >testcpp.out 2>&1
4700 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4701 echo "OK, that will do." >&4
4703 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4718 echo "Perhaps can we force $cc -E using a wrapper..."
4719 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4720 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4726 echo "Nope, we'll have to live without it..."
4740 "$wrapper"|'cppstdin') ;;
4741 *) $rm -f $wrapper;;
4743 $rm -f testcpp.c testcpp.out
4745 : Set private lib path
4748 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4753 '') dlist="$loclibpth $plibpth $glibpth";;
4754 *) dlist="$libpth";;
4757 : Now check and see which directories actually exist, avoiding duplicates
4761 if $test -d $xxx; then
4764 *) libpth="$libpth $xxx";;
4770 Some systems have incompatible or broken versions of libraries. Among
4771 the directories listed in the question below, please remove any you
4772 know not to be holding relevant libraries, and add any that are needed.
4773 Say "none" for none.
4784 rp="Directories to use for library searches?"
4791 : compute shared library extension
4794 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4804 On some systems, shared libraries may be available. Answer 'none' if
4805 you want to suppress searching of shared libraries for the remainder
4806 of this configuration.
4809 rp='What is the file extension used for shared libraries?'
4813 : Define several unixisms.
4814 : Hints files or command line option can be used to override them.
4815 : The convoluted testing is in case hints files set either the old
4818 '') case "$exe_ext" in
4820 *) _exe="$exe_ext" ;;
4825 '') case "$lib_ext" in
4832 '') case "$obj_ext" in
4839 '') case "$path_sep" in
4850 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4852 : Which makefile gets called first. This is used by make depend.
4853 case "$firstmakefile" in
4854 '') firstmakefile='makefile';;
4857 : Check for uselongdouble support
4859 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4862 case "$uselongdouble" in
4863 $define|true|[yY]*) dflt='y';;
4868 Perl can be built to take advantage of long doubles which
4869 (if available) may give more accuracy and range for floating point numbers.
4871 If this doesn't make any sense to you, just accept the default '$dflt'.
4873 rp='Try to use long doubles if available?'
4876 y|Y) val="$define" ;;
4882 case "$uselongdouble" in
4883 true|[yY]*) uselongdouble="$define" ;;
4886 : Look for a hint-file generated 'call-back-unit'. If the
4887 : user has specified that long doubles should be used,
4888 : we may need to set or change some other defaults.
4889 if $test -f uselongdouble.cbu; then
4890 echo "Your platform has some specific hints regarding long doubles, using them..."
4891 . ./uselongdouble.cbu
4893 case "$uselongdouble" in
4896 (Your platform does not have any specific hints for long doubles.)
4902 : Looking for optional libraries
4904 echo "Checking for optional libraries..." >&4
4909 case "$libswanted" in
4910 '') libswanted='c_s';;
4913 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4919 for thisdir in $libpth $xlibpth; do
4920 test -d $thisdir && libspath="$libspath $thisdir"
4922 for thislib in $libswanted; do
4923 for thisdir in $libspath; do
4925 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4926 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4927 $test -f "$xxx" && eval $libscheck
4928 $test -f "$xxx" && libstyle=shared
4930 if test ! -f "$xxx"; then
4931 xxx=$thisdir/lib$thislib.$so
4932 $test -f "$xxx" && eval $libscheck
4933 $test -f "$xxx" && libstyle=shared
4935 if test ! -f "$xxx"; then
4936 xxx=$thisdir/lib$thislib$_a
4937 $test -f "$xxx" && eval $libscheck
4938 $test -f "$xxx" && libstyle=static
4940 if test ! -f "$xxx"; then
4941 xxx=$thisdir/$thislib$_a
4942 $test -f "$xxx" && eval $libscheck
4943 $test -f "$xxx" && libstyle=static
4945 if test ! -f "$xxx"; then
4946 xxx=$thisdir/lib${thislib}_s$_a
4947 $test -f "$xxx" && eval $libscheck
4948 $test -f "$xxx" && libstyle=static
4949 $test -f "$xxx" && thislib=${thislib}_s
4951 if test ! -f "$xxx"; then
4952 xxx=$thisdir/Slib$thislib$_a
4953 $test -f "$xxx" && eval $libscheck
4954 $test -f "$xxx" && libstyle=static
4956 if $test -f "$xxx"; then
4958 shared) echo "Found -l$thislib (shared)." ;;
4959 static) echo "Found -l$thislib." ;;
4960 *) echo "Found -l$thislib ($libstyle)." ;;
4964 *) dflt="$dflt -l$thislib"
4965 libsfound="$libsfound $xxx"
4967 libsfiles="$libsfiles $yyy"
4968 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4969 case " $libsdirs " in
4971 *) libsdirs="$libsdirs $yyy" ;;
4978 if $test ! -f "$xxx"; then
4979 echo "No -l$thislib."
4990 ' '|'') dflt='none';;
4995 In order to compile $package on your machine, a number of libraries
4996 are usually needed. Include any other special libraries here as well.
4997 Say "none" for none. The default list is almost always right.
5001 rp="What libraries to use?"
5008 : determine optimization, if desired, or use for debug flag also
5010 ' '|$undef) dflt='none';;
5012 *) dflt="$optimize";;
5016 By default, $package compiles with the -O flag to use the optimizer.
5017 Alternately, you might want to use the symbolic debugger, which uses
5018 the -g flag (on traditional Unix systems). Either flag can be
5019 specified here. To use neither flag, specify the word "none".
5022 rp="What optimizer/debugger flag should be used?"
5026 'none') optimize=" ";;
5029 : Check what DEBUGGING is required from the command line
5030 : -DEBUGGING or -DDEBUGGING or
5031 : -DEBUGGING=both = -g + -DDEBUGGING
5032 : -DEBUGGING=-g or -Doptimize=-g = -g
5033 : -DEBUGGING=none or -UDEBUGGING =
5034 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5037 *) DEBUGGING=$EBUGGING ;;
5040 case "$DEBUGGING" in
5044 *) optimize="$optimize -g" ;;
5048 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5056 case "$DEBUGGING" in
5057 both|$define) dflt='-DDEBUGGING'
5060 : argument order is deliberate, as the flag will start with - which set could
5061 : think is an option
5062 checkccflag='check=$1; flag=$2; callback=$3;
5064 echo "Checking if your compiler accepts $flag" 2>&1;
5065 echo "int main(void) { return 0; }" > gcctest.c;
5066 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5067 echo "Yes, it does." 2>&1;
5068 if $test -s gcctest.out ; then
5069 echo "But your platform does not like it:";
5074 echo "Leaving current flags $ccflags alone." 2>&1
5076 *) dflt="$dflt $flag";
5082 echo "Nope, it does not, but that is ok." 2>&1;
5086 : We will not override a previous value, but we might want to
5087 : augment a hint file
5089 default|recommended)
5090 case "$gccversion" in
5091 1*) dflt="$dflt -fpcc-struct-return" ;;
5093 case "$optimize:$DEBUGGING" in
5094 *-g*:old) dflt="$dflt -DDEBUGGING";;
5096 case "$gccversion" in
5097 2*) if $test -d /etc/conf/kconfig.d &&
5098 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5100 # Interactive Systems (ISC) POSIX mode.
5105 case "$gccversion" in
5108 ?*) set strict-aliasing -fno-strict-aliasing
5112 # For gcc, adding -pipe speeds up compilations for some, but apparently
5113 # some assemblers can't read from stdin. (It also slows down compilations
5114 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5115 case "$gccversion" in
5121 # on x86_64 (at least) we require an extra library (libssp) in the
5122 # link command line. This library is not named, so I infer that it is
5123 # an implementation detail that may change. Hence the safest approach
5124 # is to add the flag to the flags passed to the compiler at link time,
5125 # as that way the compiler can do the right implementation dependant
5127 case "$gccversion" in
5128 ?*) set stack-protector -fstack-protector
5135 case "$mips_type" in
5136 *BSD*|'') inclwanted="$locincpth $usrinc";;
5137 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5139 for thisincl in $inclwanted; do
5140 if $test -d $thisincl; then
5141 if $test x$thisincl != x$usrinc; then
5143 *" -I$thisincl "*);;
5144 *) dflt="$dflt -I$thisincl ";;
5150 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5152 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5160 *) dflt="$dflt -D$2";;
5164 set signal.h LANGUAGE_C; eval $inctest
5168 ccflags="$ccflags -DSOCKS"
5173 default|recommended) dflt="$ccflags $dflt" ;;
5174 *) dflt="$ccflags";;
5183 Your C compiler may want other flags. For this question you should include
5184 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5185 but you should NOT include libraries or ld flags like -lwhatever. If you
5186 want $package to honor its debug switch, you should include -DDEBUGGING here.
5187 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5189 To use no flags, specify the word "none".
5195 rp="Any additional cc flags?"
5202 : the following weeds options from ccflags that are of no interest to cpp
5204 '') cppflags="$ccflags" ;;
5205 *) cppflags="$cppflags $ccflags" ;;
5207 case "$gccversion" in
5208 1*) cppflags="$cppflags -D__GNUC__"
5210 case "$mips_type" in
5212 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5218 echo "Let me guess what the preprocessor flags are..." >&4
5232 *) ftry="$previous $flag";;
5234 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5235 >cpp1.out 2>/dev/null && \
5236 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5237 >cpp2.out 2>/dev/null && \
5238 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5239 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5241 cppflags="$cppflags $ftry"
5251 *-*) echo "They appear to be: $cppflags";;
5253 $rm -f cpp.c cpp?.out
5257 : flags used in final linking phase
5259 '') if ./venix; then
5265 *-posix*) dflt="$dflt -posix" ;;
5268 *) dflt="$ldflags";;
5270 # See note above about -fstack-protector
5272 *-fstack-protector*)
5274 *-fstack-protector*) ;; # Don't add it again
5275 *) dflt="$dflt -fstack-protector" ;;
5280 : Try to guess additional flags to pick up local libraries.
5281 for thislibdir in $libpth; do
5282 case " $loclibpth " in
5285 *"-L$thislibdir "*) ;;
5286 *) dflt="$dflt -L$thislibdir" ;;
5298 Your C linker may need flags. For this question you should
5299 include -L/whatever and any other flags used by the C linker, but you
5300 should NOT include libraries like -lwhatever.
5302 Make sure you include the appropriate -L/path flags if your C linker
5303 does not normally search all of the directories you specified above,
5306 To use no flags, specify the word "none".
5310 rp="Any additional ld flags (NOT including libraries)?"
5316 rmlist="$rmlist pdp11"
5320 echo "Checking your choice of C compiler and flags for coherency..." >&4
5321 $cat > try.c <<'EOF'
5323 int main() { printf("Ok\n"); return(0); }
5325 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5327 $cat >try.msg <<'EOM'
5328 I've tried to compile and run the following simple program:
5331 $cat try.c >> try.msg
5333 $cat >> try.msg <<EOM
5340 and I got the following output:
5344 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5345 if $sh -c "$run ./try " >>try.msg 2>&1; then
5349 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5352 cat >> try.msg <<'EOQS'
5353 If $libs contains -lsfio, and sfio is mis-configured, then it
5354 sometimes (apparently) runs and exits with a 0 status, but with no
5355 output! It may have to do with sfio's use of _exit vs. exit.
5358 rp="You have a big problem. Shall I abort Configure"
5365 echo "The program compiled OK, but exited with status $?." >>try.msg
5366 rp="You have a problem. Shall I abort Configure"
5370 echo "I can't compile the test program." >>try.msg
5371 rp="You have a BIG problem. Shall I abort Configure"
5377 case "$knowitall" in
5379 echo "(The supplied flags or libraries might be incorrect.)"
5387 *) echo "Ok. Stopping Configure." >&4
5392 n) echo "OK, that should do.";;
5394 $rm_try gcctest gcctest.out
5396 : define a shorthand compile call
5400 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5401 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5405 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5406 : define a shorthand compile call for compilations that should be ok.
5410 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5412 : determine filename position in cpp output
5414 echo "Computing filename position in cpp output for #include directives..." >&4
5416 vos) testaccess=-e ;;
5419 echo '#include <stdio.h>' > foo.c
5422 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5423 $grep '^[ ]*#.*stdio\.h' | \
5424 while read cline; do
5427 while $test \$# -gt 0; do
5428 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5433 pos=\`expr \$pos + 1\`
5445 *) pos="${fieldn}th";;
5447 echo "Your cpp writes the filename in the $pos field of the line."
5450 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5451 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5454 : locate header file
5459 for usrincdir in $usrinc
5461 if test -f \$usrincdir/\$wanted; then
5462 echo "\$usrincdir/\$wanted"
5466 awkprg='{ print \$$fieldn }'
5467 echo "#include <\$wanted>" > foo\$\$.c
5468 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5469 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5470 while read cline; do
5471 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5473 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5474 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5479 # status = 0: grep returned 0 lines, case statement not executed
5480 # status = 1: headerfile found
5481 # status = 2: while loop executed, no headerfile found
5485 if test \$status -eq 1; then
5492 : define an alternate in-header-list? function
5493 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5494 cont=true; xxf="echo \"<\$1> found.\" >&4";
5495 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5496 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5498 case $# in 4) instead=instead;; *) instead="at last";; esac;
5499 while $test "$cont"; do
5501 var=$2; eval "was=\$$2";
5502 if $test "$xxx" && $test -r "$xxx";
5504 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5507 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5508 set $yyy; shift; shift; yyy=$@;
5509 case $# in 0) cont="";;
5510 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5511 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5512 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5513 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5517 do set $yyy; var=$2; eval "was=\$$2";
5518 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5519 set $yyy; shift; shift; yyy=$@;
5522 : see if stdlib is available
5523 set stdlib.h i_stdlib
5526 : check for lengths of integral types
5530 echo "Checking to see how big your integers are..." >&4
5539 printf("intsize=%d;\n", (int)sizeof(int));
5540 printf("longsize=%d;\n", (int)sizeof(long));
5541 printf("shortsize=%d;\n", (int)sizeof(short));
5546 if eval $compile_ok && $run ./try > /dev/null; then
5548 echo "Your integers are $intsize bytes long."
5549 echo "Your long integers are $longsize bytes long."
5550 echo "Your short integers are $shortsize bytes long."
5554 Help! I can't compile and run the intsize test program: please enlighten me!
5555 (This is probably a misconfiguration in your system or libraries, and
5556 you really ought to fix it. Still, I'll try anyway.)
5560 rp="What is the size of an integer (in bytes)?"
5564 rp="What is the size of a long integer (in bytes)?"
5568 rp="What is the size of a short integer (in bytes)?"
5576 : check for long long
5578 echo "Checking to see if you have long long..." >&4
5579 echo 'int main() { long long x = 7; return 0; }' > try.c
5581 if eval $compile; then
5583 echo "You have long long."
5586 echo "You do not have long long."
5592 : check for length of long long
5593 case "${d_longlong}${longlongsize}" in
5596 echo "Checking to see how big your long longs are..." >&4
5597 $cat >try.c <<'EOCP'
5601 printf("%d\n", (int)sizeof(long long));
5606 if eval $compile_ok; then
5607 longlongsize=`$run ./try`
5608 echo "Your long longs are $longlongsize bytes long."
5612 echo "(I can't seem to compile the test program. Guessing...)"
5613 rp="What is the size of a long long (in bytes)?"
5617 if $test "X$longsize" = "X$longlongsize"; then
5618 echo "(That isn't any different from an ordinary long.)"
5624 : see if inttypes.h is available
5625 : we want a real compile instead of Inhdr because some systems
5626 : have an inttypes.h which includes non-existent headers
5629 #include <inttypes.h>
5631 static int32_t foo32 = 0x12345678;
5635 if eval $compile; then
5636 echo "<inttypes.h> found." >&4
5639 echo "<inttypes.h> NOT found." >&4
5648 echo "Checking to see if you have int64_t..." >&4
5650 #include <sys/types.h>
5651 #$i_inttypes I_INTTYPES
5653 #include <inttypes.h>
5655 int main() { int64_t x = 7; }
5658 if eval $compile; then
5660 echo "You have int64_t."
5663 echo "You do not have int64_t."
5669 : Check if 64bit ints have a quad type
5671 echo "Checking which 64-bit integer type we could use..." >&4
5677 val='"unsigned int"'
5682 *) case "$longsize" in
5686 val='"unsigned long"'
5691 *) case "$d_longlong:$longlongsize" in
5696 val='"unsigned long long"'
5701 *) case "$d_int64_t" in
5720 '') echo "Alas, no 64-bit integer types in sight." >&4
5723 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5728 : Do we want 64bit support
5729 case "$uselonglong" in
5730 "$define"|true|[yY]*)
5733 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5735 use64bitint="$define"
5738 case "$use64bits" in
5739 "$define"|true|[yY]*)
5742 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5744 use64bitint="$define"
5747 case "$use64bitints" in
5748 "$define"|true|[yY]*)
5751 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5753 use64bitint="$define"
5756 case "$use64bitsint" in
5757 "$define"|true|[yY]*)
5760 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5762 use64bitint="$define"
5765 case "$uselonglongs" in
5766 "$define"|true|[yY]*)
5769 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5771 use64bitint="$define"
5774 case "$use64bitsall" in
5775 "$define"|true|[yY]*)
5778 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5780 use64bitall="$define"
5785 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5787 case "$use64bitall" in
5788 "$define"|true|[yY]*) use64bitint="$define" ;;
5794 You have natively 64-bit long integers.
5798 *) case "$use64bitint" in
5799 "$define"|true|[yY]*) dflt='y';;
5808 Perl can be built to take advantage of 64-bit integer types
5809 on some systems. To do so, Configure can be run with -Duse64bitint.
5810 Choosing this option will most probably introduce binary incompatibilities.
5812 If this doesn't make any sense to you, just accept the default '$dflt'.
5813 (The default has been chosen based on your configuration.)
5815 rp='Try to use 64-bit integers, if available?'
5818 [yY]*) val="$define" ;;
5826 case "$use64bitall" in
5827 "$define"|true|[yY]*) dflt='y' ;;
5828 *) case "$longsize" in
5836 You may also choose to try maximal 64-bitness. It means using as much
5837 64-bitness as possible on the platform. This in turn means even more
5838 binary incompatibilities. On the other hand, your platform may not
5839 have any more 64-bitness available than what you already have chosen.
5841 If this doesn't make any sense to you, just accept the default '$dflt'.
5842 (The default has been chosen based on your configuration.)
5844 rp='Try to use maximal 64-bit support, if available?'
5847 [yY]*) val="$define" ;;
5852 case "$use64bitall" in
5854 case "$use64bitint" in
5858 Since you have chosen a maximally 64-bit build, I'm also turning on
5859 the use of 64-bit integers.
5861 use64bitint="$define" ;;
5866 : Look for a hint-file generated 'call-back-unit'. If the
5867 : user has specified that a 64-bit perl is to be built,
5868 : we may need to set or change some other defaults.
5869 if $test -f use64bitint.cbu; then
5870 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5873 case "$use64bitint" in
5874 "$define"|true|[yY]*)
5876 4) case "$archname64" in
5877 '') archname64=64int ;;
5884 : Look for a hint-file generated 'call-back-unit'. If the
5885 : user has specified that a maximally 64-bit perl is to be built,
5886 : we may need to set or change some other defaults.
5887 if $test -f use64bitall.cbu; then
5888 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5891 case "$use64bitall" in
5892 "$define"|true|[yY]*)
5894 4) case "$archname64" in
5895 ''|64int) archname64=64all ;;
5902 case "$d_quad:$use64bitint" in
5906 *** You have chosen to use 64-bit integers,
5907 *** but none can be found.
5908 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5909 *** Cannot continue, aborting.
5916 : check for length of double
5918 case "$doublesize" in
5920 echo "Checking to see how big your double precision numbers are..." >&4
5929 printf("%d\n", (int)sizeof(double));
5934 if eval $compile_ok; then
5935 doublesize=`$run ./try`
5936 echo "Your double is $doublesize bytes long."
5939 echo "(I can't seem to compile the test program. Guessing...)"
5940 rp="What is the size of a double precision number (in bytes)?"
5948 : check for long doubles
5950 echo "Checking to see if you have long double..." >&4
5951 echo 'int main() { long double x = 7.0; }' > try.c
5953 if eval $compile; then
5955 echo "You have long double."
5958 echo "You do not have long double."
5964 : check for length of long double
5965 case "${d_longdbl}${longdblsize}" in
5968 echo "Checking to see how big your long doubles are..." >&4
5969 $cat >try.c <<'EOCP'
5973 printf("%d\n", sizeof(long double));
5978 if eval $compile; then
5979 longdblsize=`$run ./try`
5980 echo "Your long doubles are $longdblsize bytes long."
5984 echo "(I can't seem to compile the test program. Guessing...)" >&4
5985 rp="What is the size of a long double (in bytes)?"
5989 if $test "X$doublesize" = "X$longdblsize"; then
5990 echo "That isn't any different from an ordinary double."
5991 echo "I'll keep your setting anyway, but you may see some"
5992 echo "harmless compilation warnings."
5998 : determine the architecture name
6000 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6001 tarch=`arch`"-$osname"
6002 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6003 if uname -m > tmparch 2>&1 ; then
6004 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6005 -e 's/$/'"-$osname/" tmparch`
6013 case "$myarchname" in
6016 echo "(Your architecture name used to be $myarchname.)"
6020 case "$targetarch" in
6022 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6027 *) dflt="$archname";;
6029 rp='What is your architecture name'
6032 case "$usethreads" in
6034 echo "Threads selected." >&4
6036 *-thread*) echo "...and architecture name already has -thread." >&4
6038 *) archname="$archname-thread"
6039 echo "...setting architecture name to $archname." >&4
6044 case "$usemultiplicity" in
6046 echo "Multiplicity selected." >&4
6048 *-multi*) echo "...and architecture name already has -multi." >&4
6050 *) archname="$archname-multi"
6051 echo "...setting architecture name to $archname." >&4
6056 case "$use64bitint$use64bitall" in
6058 case "$archname64" in
6060 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6063 case "$use64bitint" in
6064 "$define") echo "64 bit integers selected." >&4 ;;
6066 case "$use64bitall" in
6067 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6070 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6072 *) archname="$archname-$archname64"
6073 echo "...setting architecture name to $archname." >&4
6079 case "$uselongdouble" in
6081 echo "Long doubles selected." >&4
6082 case "$longdblsize" in
6084 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6088 *-ld*) echo "...and architecture name already has -ld." >&4
6090 *) archname="$archname-ld"
6091 echo "...setting architecture name to $archname." >&4
6098 case "$useperlio" in
6100 echo "Perlio selected." >&4
6103 echo "Perlio not selected, using stdio." >&4
6105 *-stdio*) echo "...and architecture name already has -stdio." >&4
6107 *) archname="$archname-stdio"
6108 echo "...setting architecture name to $archname." >&4
6113 if $test -f archname.cbu; then
6114 echo "Your platform has some specific hints for architecture name, using them..."
6118 : set the prefixit variable, to compute a suitable default value
6119 prefixit='case "$3" in
6121 case "$oldprefix" in
6122 "") eval "$1=\"\$$2\"";;
6129 ""|" ") eval "$1=\"\$$2\"";;
6135 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6137 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6138 /*-$oldprefix/*|\~*-$oldprefix/*)
6139 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6140 *) eval "$1=\"\$$2\"";;
6144 : determine installation style
6145 : For now, try to deduce it from prefix unless it is already set.
6146 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6147 case "$installstyle" in
6148 '') case "$prefix" in
6149 *perl*) dflt='lib';;
6150 *) dflt='lib/perl5' ;;
6153 *) dflt="$installstyle" ;;
6155 : Probably not worth prompting for this since we prompt for all
6156 : the directories individually, and the prompt would be too long and
6160 : determine where public executables go
6165 rp='Pathname where the public executables will reside?'
6167 if $test "X$ansexp" != "X$binexp"; then
6171 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6172 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6173 : this via initialinstalllocation
6176 case "$userelocatableinc" in
6177 $define|true|[yY]*) dflt='y' ;;
6182 Would you like to build Perl so that the installation is relocatable, so that
6183 library paths in @INC are determined relative to the path of the perl binary?
6184 This is not advised for system Perl installs, or if you need to run setid
6185 scripts or scripts under taint mode.
6187 If this doesn't make any sense to you, just accept the default '$dflt'.
6189 rp='Use relocatable @INC?'
6192 y|Y) val="$define" ;;
6195 set userelocatableinc
6198 initialinstalllocation="$binexp"
6199 : Default prefix is now "up one level from where the binaries are"
6200 case "$userelocatableinc" in
6206 installprefixexp=".../.."
6210 : determine where private library files go
6211 : Usual default is /usr/local/lib/perl5/$version.
6212 : Also allow things like /opt/perl/lib/$version, since
6213 : /opt/perl/lib/perl5... would be redundant.
6214 : The default "style" setting is made in installstyle.U
6215 case "$installstyle" in
6216 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6217 *) set dflt privlib lib/$version ;;
6222 There are some auxiliary files for $package that need to be put into a
6223 private library directory that is accessible by everyone.
6228 rp='Pathname where the private library files will reside?'
6233 : set the prefixup variable, to restore leading tilda escape
6234 prefixup='case "$prefixexp" in
6236 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6239 : determine where public architecture dependent libraries go
6242 : privlib default is /usr/local/lib/$package/$version
6243 : archlib default is /usr/local/lib/$package/$version/$archname
6244 : privlib may have an optional trailing /share.
6245 tdflt=`echo $privlib | $sed 's,/share$,,'`
6246 tdflt=$tdflt/$archname
6255 $spackage contains architecture-dependent library files. If you are
6256 sharing libraries in a heterogeneous environment, you might store
6257 these files in a separate location. Otherwise, you can just include
6258 them with the rest of the public library files.
6263 rp='Where do you want to put the public architecture-dependent libraries?'
6267 if $test X"$archlib" = X"$privlib"; then
6273 : see if setuid scripts can be secure
6276 Some kernels have a bug that prevents setuid #! scripts from being
6277 secure. Some sites have disabled setuid #! scripts because of this.
6279 First let's decide if your kernel supports secure setuid #! scripts.
6280 (If setuid #! scripts would be secure but have been disabled anyway,
6281 don't say that they are secure if asked.)
6286 if $test -d /dev/fd; then
6287 echo "#!$ls" >reflect
6288 chmod +x,u+s reflect
6289 ./reflect >flect 2>&1
6290 if $contains "/dev/fd" flect >/dev/null; then
6291 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6295 If you are not sure if they are secure, I can check but I'll need a
6296 username and password different from the one you are using right now.
6297 If you don't have such a username or don't want me to test, simply
6301 rp='Other username to test security of setuid scripts with?'
6306 case "$d_suidsafe" in
6307 '') echo "I'll assume setuid scripts are *not* secure." >&4
6310 echo "Well, the $hint value is *not* secure." >&4
6312 *) echo "Well, the $hint value *is* secure." >&4
6317 $rm -f reflect flect
6318 echo "#!$ls" >reflect
6319 chmod +x,u+s reflect
6322 echo '"su" will (probably) prompt you for '"$ans's password."
6323 su $ans -c './reflect >flect'
6324 if $contains "/dev/fd" flect >/dev/null; then
6325 echo "Okay, it looks like setuid scripts are secure." >&4
6328 echo "I don't think setuid scripts are secure." >&4
6333 rp='Does your kernel have *secure* setuid scripts?'
6336 [yY]*) val="$define";;
6341 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6342 echo "(That's for file descriptors, not floppy disks.)"
6348 $rm -f reflect flect
6350 : now see if they want to do setuid emulation
6353 case "$d_suidsafe" in
6356 echo "No need to emulate SUID scripts since they are secure here." >&4
6360 Some systems have disabled setuid scripts, especially systems where
6361 setuid scripts cannot be secure. On systems where setuid scripts have
6362 been disabled, the setuid/setgid bits on scripts are currently
6363 useless. It is possible for $package to detect those bits and emulate
6364 setuid/setgid in a secure fashion. This emulation will only work if
6365 setuid scripts have been disabled in your kernel.
6369 "$define") dflt=y ;;
6372 rp="Do you want to do setuid/setgid emulation?"
6375 [yY]*) val="$define";;
6383 : Find perl5.005 or later.
6384 echo "Looking for a previously installed perl5.005 or later... "
6386 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6387 : Check if this perl is recent and can load a simple module
6388 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6391 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6401 '') echo "None found. That's ok.";;
6402 *) echo "Using $perl5." ;;
6405 : Set the siteprefix variables
6408 After $package is installed, you may wish to install various
6409 add-on modules and utilities. Typically, these add-ons will
6410 be installed under $prefix with the rest
6411 of this package. However, you may wish to install such add-ons
6412 elsewhere under a different prefix.
6414 If you do not wish to put everything under a single prefix, that's
6415 ok. You will be prompted for the individual locations; this siteprefix
6416 is only used to suggest the defaults.
6418 The default should be fine for most people.
6422 rp='Installation prefix to use for add-on modules and utilities?'
6423 : XXX Here might be another good place for an installstyle setting.
6424 case "$siteprefix" in
6426 *) dflt=$siteprefix ;;
6429 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6431 case "$siteprefix" in
6435 *) oldsiteprefix="$prefix";;
6440 siteprefixexp="$ansexp"
6442 : determine where site specific libraries go.
6443 : Usual default is /usr/local/lib/perl5/site_perl/$version
6444 : The default "style" setting is made in installstyle.U
6445 : XXX No longer works with Prefixit stuff.
6446 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6448 '') case "$installstyle" in
6449 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6450 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6458 The installation process will create a directory for
6459 site-specific extensions and modules. Most users find it convenient
6460 to place all site-specific files in this directory rather than in the
6461 main distribution directory.
6465 rp='Pathname for the site-specific library files?'
6469 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6471 : Determine list of previous versions to include in @INC
6472 $cat > getverlist <<EOPL
6475 \$api_versionstring = "$api_versionstring";
6476 \$version = "$version";
6477 \$stem = "$sitelib_stem";
6478 \$archname = "$archname";
6480 $cat >> getverlist <<'EOPL'
6481 # The list found is store twice for each entry: the original name, and
6482 # the binary broken down version as pack "sss", so sorting is easy and
6483 # unambiguous. This will work for all versions that have a maximum of
6484 # three digit groups, separate by '.'s or '_'s. Names are extended with
6485 # ".0.0" to ensure at least three elements for the pack.
6486 # -- H.Merijn Brand (m)'06 23-10-2006
6488 # Can't have leading @ because metaconfig interprets it as a command!
6489 ;@inc_version_list=();
6490 # XXX Redo to do opendir/readdir?
6493 ;@candidates = map {
6494 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6500 ($pversion, $aversion, $vsn5005) = map {
6501 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6502 foreach $d (@candidates) {
6503 if ($d->[1] lt $pversion) {
6504 if ($d->[1] ge $aversion) {
6505 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6507 elsif ($d->[1] ge $vsn5005) {
6508 unshift(@inc_version_list, grep { -d } $d->[0]);
6512 # Skip newer version. I.e. don't look in
6513 # 5.7.0 if we're installing 5.6.1.
6517 if (@inc_version_list) {
6518 print join(' ', @inc_version_list);
6521 # Blank space to preserve value for next Configure run.
6526 case "$inc_version_list" in
6527 '') if test -x "$perl5$exe_ext"; then
6528 dflt=`$perl5 getverlist`
6533 $undef) dflt='none' ;;
6534 *) eval dflt=\"$inc_version_list\" ;;
6537 ''|' ') dflt=none ;;
6544 In order to ease the process of upgrading, this version of perl
6545 can be configured to use modules built and installed with earlier
6546 versions of perl that were installed under $prefix. Specify here
6547 the list of earlier versions that this version of perl should check.
6548 If Configure detected no earlier versions of perl installed under
6549 $prefix, then the list will be empty. Answer 'none' to tell perl
6550 to not search earlier versions.
6552 The default should almost always be sensible, so if you're not sure,
6553 just accept the default.
6556 rp='List of earlier versions to include in @INC?'
6559 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6560 *) inc_version_list="$ans" ;;
6562 case "$inc_version_list" in
6564 inc_version_list_init='0'
6565 d_inc_version_list="$undef"
6567 *) inc_version_list_init=`echo $inc_version_list |
6568 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6569 d_inc_version_list="$define"
6574 : see if malloc/malloc.h has to be included
6575 set malloc/malloc.h i_mallocmalloc
6578 : see if this is a malloc.h system
6579 : we want a real compile instead of Inhdr because some systems have a
6580 : malloc.h that just gives a compile error saying to use stdlib.h instead
6585 #$i_mallocmalloc I_MALLOCMALLOC
6586 #ifdef I_MALLOCMALLOC
6587 # include <malloc/malloc.h>
6590 int main () { return 0; }
6593 if eval $compile; then
6594 echo "<malloc.h> found." >&4
6597 echo "<malloc.h> NOT found." >&4
6604 : check for void type
6606 echo "Checking to see how well your C compiler groks the void type..." >&4
6607 case "$voidflags" in
6619 extern void moo(); /* function returning void */
6620 void (*goo)(); /* ptr to func returning void */
6622 void *hue; /* generic ptr */
6635 int main() { sub(); }
6637 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6638 voidflags=$defvoidused
6639 echo "Good. It appears to support void to the level $package wants.">&4
6640 if $contains warning .out >/dev/null 2>&1; then
6641 echo "However, you might get some warnings that look like this:"
6645 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6646 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6647 echo "It supports 1..."
6648 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6649 echo "It also supports 2..."
6650 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6652 echo "And it supports 4 but not 8 definitely."
6654 echo "It doesn't support 4..."
6655 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6657 echo "But it supports 8."
6660 echo "Neither does it support 8."
6664 echo "It does not support 2..."
6665 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6667 echo "But it supports 4 and 8."
6669 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6671 echo "And it supports 4 but has not heard about 8."
6673 echo "However it supports 8 but not 4."
6678 echo "There is no support at all for void."
6683 case "$voidflags" in
6686 Support flag bits are:
6687 1: basic void declarations.
6688 2: arrays of pointers to functions returning void.
6689 4: operations between pointers to and addresses of void functions.
6690 8: generic void pointers.
6693 rp="Your void support flags add up to what?"
6700 : check for length of pointer
6704 echo "Checking to see how big your pointers are..." >&4
6705 if test "$voidflags" -gt 7; then
6706 echo '#define VOID_PTR char *' > try.c
6708 echo '#define VOID_PTR void *' > try.c
6718 printf("%d\n", (int)sizeof(VOID_PTR));
6723 if eval $compile_ok; then
6724 ptrsize=`$run ./try`
6725 echo "Your pointers are $ptrsize bytes long."
6728 echo "(I can't seem to compile the test program. Guessing...)" >&4
6729 rp="What is the size of a pointer (in bytes)?"
6736 case "$use64bitall" in
6737 "$define"|true|[yY]*)
6741 *** You have chosen a maximally 64-bit build,
6742 *** but your pointers are only 4 bytes wide.
6743 *** Please rerun Configure without -Duse64bitall.
6748 *** Since you have quads, you could possibly try with -Duse64bitint.
6753 *** Cannot continue, aborting.
6764 : determine whether to use malloc wrapping
6766 case "$usemallocwrap" in
6767 [yY]*|true|$define) dflt='y' ;;
6768 [nN]*|false|$undef) dflt='n' ;;
6769 *) case "$usedevel" in
6770 [yY]*|true|$define) dflt='y' ;;
6775 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6777 usemallocwrap="$ans"
6780 usemallocwrap="$define" ;;
6782 usemallocwrap="$undef" ;;
6785 : determine which malloc to compile in
6787 case "$usemymalloc" in
6788 [yY]*|true|$define) dflt='y' ;;
6789 [nN]*|false|$undef) dflt='n' ;;
6790 *) case "$ptrsize" in
6796 rp="Do you wish to attempt to use the malloc that comes with $package?"
6802 mallocsrc='malloc.c'
6803 mallocobj="malloc$_o"
6804 d_mymalloc="$define"
6807 : Remove malloc from list of libraries to use
6808 echo "Removing unneeded -lmalloc from library list" >&4
6809 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6812 echo "libs = $libs" >&4
6824 : compute the return types of malloc and free
6826 $cat >malloc.c <<END
6830 #include <sys/types.h>
6844 case "$malloctype" in
6846 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6853 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6857 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6864 echo "Your system uses $freetype free(), it would seem." >&4
6866 : determine where site specific architecture-dependent libraries go.
6867 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6868 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6869 : sitelib may have an optional trailing /share.
6871 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6872 dflt="$dflt/$archname"
6877 set sitearch sitearch none
6881 The installation process will also create a directory for
6882 architecture-dependent site-specific extensions and modules.
6886 rp='Pathname for the site-specific architecture-dependent library files?'
6890 if $test X"$sitearch" = X"$sitelib"; then
6893 d_sitearch="$define"
6896 : Set the vendorprefix variables
6899 The installation process will also create a directory for
6900 vendor-supplied add-ons. Vendors who supply perl with their system
6901 may find it convenient to place all vendor-supplied files in this
6902 directory rather than in the main distribution directory. This will
6903 ease upgrades between binary-compatible maintenance versions of perl.
6905 Of course you may also use these directories in whatever way you see
6906 fit. For example, you might use them to access modules shared over a
6907 company-wide network.
6909 The default answer should be fine for most people.
6910 This causes further questions about vendor add-ons to be skipped
6911 and no vendor-specific directories will be configured for perl.
6914 rp='Do you want to configure vendor-specific add-on directories?'
6915 case "$usevendorprefix" in
6916 define|true|[yY]*) dflt=y ;;
6917 *) : User may have set vendorprefix directly on Configure command line.
6918 case "$vendorprefix" in
6927 rp='Installation prefix to use for vendor-supplied add-ons?'
6928 case "$vendorprefix" in
6930 *) dflt=$vendorprefix ;;
6933 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6935 case "$vendorprefix" in
6939 *) oldvendorprefix="$prefix";;
6943 usevendorprefix="$define"
6945 vendorprefixexp="$ansexp"
6947 *) usevendorprefix="$undef"
6953 : Set the vendorlib variables
6954 case "$vendorprefix" in
6955 '') d_vendorlib="$undef"
6959 *) d_vendorlib="$define"
6960 : determine where vendor-supplied modules go.
6961 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6962 case "$vendorlib" in
6964 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6965 case "$installstyle" in
6966 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6967 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6970 *) dflt="$vendorlib"
6974 rp='Pathname for the vendor-supplied library files?'
6977 vendorlibexp="$ansexp"
6980 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6984 : Set the vendorarch variables
6985 case "$vendorprefix" in
6986 '') d_vendorarch="$undef"
6990 *) d_vendorarch="$define"
6991 : determine where vendor-supplied architecture-dependent libraries go.
6992 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6993 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6994 : vendorlib may have an optional trailing /share.
6995 case "$vendorarch" in
6996 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6997 dflt="$dflt/$archname"
6999 *) dflt="$vendorarch" ;;
7002 rp='Pathname for vendor-supplied architecture-dependent files?'
7005 vendorarchexp="$ansexp"
7008 prefixvar=vendorarch
7011 : Final catch-all directories to search
7014 Lastly, you can have perl look in other directories for extensions and
7015 modules in addition to those already specified.
7016 These directories will be searched after
7020 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7021 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7023 case "$otherlibdirs" in
7024 ''|' ') dflt='none' ;;
7025 *) dflt="$otherlibdirs" ;;
7028 Enter a colon-separated set of extra paths to include in perl's @INC
7029 search path, or enter 'none' for no extra paths.
7033 rp='Colon-separated list of additional directories for perl to search?'
7036 ' '|''|none) otherlibdirs=' ' ;;
7037 *) otherlibdirs="$ans" ;;
7039 case "$otherlibdirs" in
7043 set d_perl_otherlibdirs
7046 : Cruising for prototypes
7048 echo "Checking out function prototypes..." >&4
7049 $cat >prototype.c <<EOCP
7054 int main(int argc, char *argv[]) {
7057 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7058 echo "Your C compiler appears to support function prototypes."
7061 echo "Your C compiler doesn't seem to understand function prototypes."
7068 : Check if ansi2knr is required
7069 case "$prototype" in
7071 *) ansi2knr='ansi2knr'
7076 This version of $package can only be compiled by a compiler that
7077 understands function prototypes. Unfortunately, your C compiler
7079 doesn't seem to understand them. Sorry about that.
7081 If GNU cc is available for your system, perhaps you could try that instead.
7083 Eventually, we hope to support building Perl with pre-ANSI compilers.
7084 If you would like to help in that effort, please contact <perlbug@perl.org>.
7086 Aborting Configure now.
7093 dflt_dtrace='/usr/sbin/dtrace'
7096 Perl can be built to support DTrace on platforms that support it.
7097 DTrace is a diagnosis and performance analysis tool from Sun.
7099 If this doesn't make any sense to you, just accept the default '$dflt'.
7103 case "$usedtrace" in
7109 dflt_dtrace=$usedtrace
7116 rp='Support DTrace if available?'
7119 y|Y) val="$define" ;;
7125 test "X$usedtrace" != "X$define" && break
7128 rp='Where is the dtrace executable?'
7137 if $dtrace -h -s ../perldtrace.d \
7138 -o perldtrace.tmp >/dev/null 2>&1 \
7139 && rm -f perldtrace.tmp
7142 echo "Good: your $dtrace knows about the -h flag."
7146 *** $me: Fatal Error: $dtrace doesn't support -h flag
7148 *** Your installed dtrace doesn't support the -h switch to compile a D
7149 *** program into a C header. Can't continue.
7161 *** $me: Fatal Error: $dtrace not found.
7168 echo "*** $dtrace was not found."
7174 : See if we want extra modules installed
7181 Perl can be built with extra modules or bundles of modules which
7182 will be fetched from the CPAN and installed alongside Perl.
7184 Notice that you will need access to the CPAN; either via the Internet,
7185 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7186 be asked later to configure the CPAN.pm module which will in turn do
7187 the installation of the rest of the extra modules or bundles.)
7189 Notice also that if the modules require any external software such as
7190 libraries and headers (the libz library and the zlib.h header for the
7191 Compress::Zlib module, for example) you MUST have any such software
7192 already installed, this configuration process will NOT install such
7195 If this doesn't make any sense to you, just accept the default '$dflt'.
7197 rp='Install any extra modules (y or n)?'
7203 Please list any extra modules or bundles to be installed from CPAN,
7204 with spaces between the names. The names can be in any format the
7205 'install' command of CPAN.pm will understand. (Answer 'none',
7206 without the quotes, to install no extra modules or bundles.)
7216 $rm -f ../extras.lst
7218 *) echo "(Saving the list of extras for later...)"
7219 echo "$extras" > ../extras.lst
7227 : determine where html pages for programs go
7228 set html1dir html1dir none
7232 If you wish to install html files for programs in $spackage, indicate
7233 the appropriate directory here. To skip installing html files,
7237 ''|none|$undef|' ') dflt=none ;;
7238 *) dflt=$html1dir ;;
7241 rp="Directory for the main $spackage html pages?"
7245 : Use ' ' for none so value is preserved next time through Configure
7246 $test X"$html1dir" = "X" && html1dir=' '
7248 : determine where html pages for libraries and modules go
7249 set html3dir html3dir none
7253 If you wish to install html files for modules associated with $spackage,
7254 indicate the appropriate directory here. To skip installing html files,
7257 : There is no obvious default. If they have specified html1dir, then
7258 : try to key off that, possibly changing .../html1 into .../html3.
7260 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7261 *) dflt=$html3dir ;;
7264 rp="Directory for the $spackage module html pages?"
7268 : Use ' ' for none so value is preserved next time through Configure
7269 $test X"$html3dir" = "X" && html3dir=' '
7271 : determine whether to install perl also as /usr/bin/perl
7274 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7276 Many scripts expect perl to be installed as /usr/bin/perl.
7278 If you want to, I can install the perl you are about to compile
7279 as /usr/bin/perl (in addition to $bin/perl).
7281 if test -f /usr/bin/perl; then
7284 However, please note that because you already have a /usr/bin/perl,
7285 overwriting that with a new Perl would very probably cause problems.
7286 Therefore I'm assuming you don't want to do that (unless you insist).
7289 case "$installusrbinperl" in
7290 "$define"|[yY]*) dflt='y';;
7296 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7299 case "$installusrbinperl" in
7300 "$undef"|[nN]*) dflt='n';;
7304 rp="Do you want to install perl as /usr/bin/perl?"
7307 [yY]*) val="$define";;
7313 set installusrbinperl
7316 : Check if we are using the GNU C library
7318 echo "Checking for GNU C Library..." >&4
7320 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7321 alone are insufficient to distinguish different versions, such as
7322 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7323 libc version 2.1.0. A. Dougherty, June 3, 2002.
7329 # ifdef __GLIBC_MINOR__
7330 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7331 # include <gnu/libc-version.h>
7332 printf("%s\n", gnu_get_libc_version());
7334 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7337 printf("%d\n", __GLIBC__);
7346 if eval $compile_ok && $run ./try > glibc.ver; then
7348 gnulibc_version=`$cat glibc.ver`
7349 echo "You are using the GNU C Library version $gnulibc_version"
7353 echo "You are not using the GNU C Library"
7359 : see if nm is to be used to determine whether a symbol is defined or not
7363 case "$d_gnulibc" in
7366 echo "nm probably won't work on the GNU C Library." >&4
7372 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7374 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7375 echo "'nm' won't be sufficient on this sytem." >&4
7381 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7382 if $test $dflt -gt 20; then
7392 true|$define) dflt=y;;
7399 I can use $nm to extract the symbols from your C libraries. This
7400 is a time consuming task which may generate huge output on the disk (up
7401 to 3 megabytes) but that should make the symbols extraction faster. The
7402 alternative is to skip the 'nm' extraction part and to compile a small
7403 test program instead to determine whether each symbol is present. If
7404 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7405 this may be the best solution.
7407 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7410 rp="Shall I use $nm to extract C symbols from the libraries?"
7413 [Nn]*) usenm=false;;
7422 : nm options which may be necessary
7424 '') if $test -f /mach_boot; then
7426 elif $test -d /usr/ccs/lib; then
7427 nm_opt='-p' # Solaris (and SunOS?)
7428 elif $test -f /dgux; then
7430 elif $test -f /lib64/rld; then
7431 nm_opt='-p' # 64-bit Irix
7437 : nm options which may be necessary for shared libraries but illegal
7438 : for archive libraries. Thank you, Linux.
7439 case "$nm_so_opt" in
7440 '') case "$myuname" in
7442 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7443 nm_so_opt='--dynamic'
7450 : Figure out where the libc is located
7453 : get list of predefined functions in a handy place
7458 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7464 *) for thislib in $libs; do
7467 : Handle C library specially below.
7470 thislib=`echo $thislib | $sed -e 's/^-l//'`
7471 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7473 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7475 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7477 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7479 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7481 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7483 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7488 libnames="$libnames $try"
7490 *) libnames="$libnames $thislib" ;;
7499 for xxx in $libpth; do
7500 $test -r $1 || set $xxx/libc.$so
7501 : The messy sed command sorts on library version numbers.
7503 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7504 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7506 s/[0-9][0-9]*/0000&/g
7507 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7510 $sort | $sed -e 's/^.* //'`
7513 $test -r $1 || set /usr/ccs/lib/libc.$so
7514 $test -r $1 || set /lib/libsys_s$_a
7520 if $test -r "$1"; then
7521 echo "Your (shared) C library seems to be in $1."
7523 elif $test -r /lib/libc && $test -r /lib/clib; then
7524 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7526 libc='/lib/clib /lib/libc'
7527 if $test -r /lib/syslib; then
7528 echo "(Your math library is in /lib/syslib.)"
7529 libc="$libc /lib/syslib"
7531 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7532 echo "Your C library seems to be in $libc, as you said before."
7533 elif $test -r $incpath/usr/lib/libc$_a; then
7534 libc=$incpath/usr/lib/libc$_a;
7535 echo "Your C library seems to be in $libc. That's fine."
7536 elif $test -r /lib/libc$_a; then
7538 echo "Your C library seems to be in $libc. You're normal."
7540 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7542 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7543 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7544 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7546 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7548 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7551 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7553 if $test -r "$tans"; then
7554 echo "Your C library seems to be in $tans, of all places."
7560 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7564 If the guess above is wrong (which it might be if you're using a strange
7565 compiler, or your machine supports multiple models), you can override it here.
7570 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7572 I can't seem to find your C library. I've looked in the following places:
7575 $sed 's/^/ /' libpath
7578 None of these seems to contain your C library. I need to get its name...
7583 rp='Where is your C library?'
7588 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7589 set X `cat libnames`
7592 case $# in 1) xxx=file; esac
7593 echo "Extracting names from the following $xxx for later perusal:" >&4
7595 $sed 's/^/ /' libnames >&4
7597 $echo $n "This may take a while...$c" >&4
7601 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7602 *) $nm $nm_opt $file 2>/dev/null;;
7607 $grep fprintf libc.tmp > libc.ptf
7608 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7609 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7611 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7615 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7619 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7623 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7625 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7627 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7629 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7631 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7633 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7635 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7636 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7640 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7644 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7648 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7652 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7656 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7658 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7660 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7662 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7664 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7666 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7669 $nm -p $* 2>/dev/null >libc.tmp
7670 $grep fprintf libc.tmp > libc.ptf
7671 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7672 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7678 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7680 if $ar t $libc > libc.tmp && \
7681 $contains '^fprintf$' libc.tmp >/dev/null 2>&1
7683 for thisname in $libnames $libc; do
7684 $ar t $thisname >>libc.tmp
7686 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7688 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7689 for thisname in $libnames $libc; do
7690 $ar tv $thisname >>libc.tmp
7691 emximp -o tmp.imp $thisname \
7693 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7694 < tmp.imp >>libc.tmp
7697 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7700 echo "$ar didn't seem to work right." >&4
7701 echo "Maybe this is a Cray...trying bld instead..." >&4
7703 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
7706 for thisname in $libnames; do
7708 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7709 $ar t $thisname >>libc.tmp
7713 echo "That didn't work either. Giving up." >&4
7723 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7724 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7726 *) if $test -f /lib/syscalls.exp; then
7728 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7729 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' \
7730 /lib/syscalls.exp >>libc.list
7736 $rm -f libnames libpath
7738 : see if dld is available
7742 : Check if we are using C++
7744 echo "Checking for C++..." >&4
7745 $cat >try.c <<'EOCP'
7757 if eval $compile_ok && $run ./try; then
7759 echo "You are using a C++ compiler."
7762 echo "You are not using a C++ compiler."
7768 : is a C symbol defined?
7771 -v) tf=libc.tmp; tdc="";;
7772 -a) tf=libc.tmp; tdc="[]";;
7773 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7776 case "$reuseval-$4" in
7778 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7783 case "$d_cplusplus" in
7784 $define) extern_C=\"C\";;
7786 if $test "$runnm" = true; then
7787 if $contains $tlook $tf >/dev/null 2>&1; then
7789 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7790 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7791 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7792 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7796 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7797 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7803 $define) tval=true;;
7810 : define an is-in-libc? function
7811 inlibc='echo " "; td=$define; tu=$undef;
7812 sym=$1; var=$2; eval "was=\$$2";
7814 case "$reuseval$was" in
7824 echo "$sym() found." >&4;
7825 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7827 echo "$sym() NOT found." >&4;
7828 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7832 $define) echo "$sym() found." >&4;;
7833 *) echo "$sym() NOT found." >&4;;
7837 : see if dlopen exists
7839 xxx_ccflags="$ccflags"
7841 : with g++ one needs -shared to get is-in-libc to work for dlopen
7842 case "$gccversion" in
7844 *) case "$d_cplusplus" in
7845 "$define") ccflags="$ccflags -shared" ;;
7852 ccflags="$xxx_ccflags"
7854 : see if this is a unistd.h system
7855 set unistd.h i_unistd
7858 : determine which dynamic loading, if any, to compile in
7860 dldir="ext/DynaLoader"
7873 $define) dflt='y' ;;
7876 $define) dflt='y' ;;
7878 : Does a dl_xxx.xs file exist for this operating system
7879 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7882 rp="Do you wish to use dynamic loading?"
7889 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7890 dflt="$dldir/dl_${osname}.xs"
7891 elif $test "$d_dlopen" = "$define" ; then
7892 dflt="$dldir/dl_dlopen.xs"
7893 elif $test "$i_dld" = "$define" ; then
7894 dflt="$dldir/dl_dld.xs"
7899 *) dflt="$dldir/$dlsrc"
7902 echo "The following dynamic loading files are available:"
7903 : Can not go over to $dldir because getfile has path hard-coded in.
7904 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7905 rp="Source file to use for dynamic loading"
7911 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7915 Some systems may require passing special flags to $cc -c to
7916 compile modules that will be used to create a shared library.
7917 To use no flags, say "none".
7920 case "$cccdlflags" in
7921 '') case "$gccversion" in
7922 '') case "$osname" in
7924 next) dflt='none' ;;
7925 irix*) dflt='-KPIC' ;;
7926 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7927 sunos) dflt='-pic' ;;
7931 *) case "$osname" in
7932 darwin) dflt='none' ;;
7933 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7938 *) dflt="$cccdlflags" ;;
7940 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7943 none) cccdlflags=' ' ;;
7944 *) cccdlflags="$ans" ;;
7949 Some systems use ld to create libraries that can be dynamically loaded,
7950 while other systems (such as those using ELF) use $cc.
7954 '') $cat >try.c <<EOM
7955 /* Test for whether ELF binaries are produced */
7967 int i = open("a.out",O_RDONLY);
7970 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7971 exit(0); /* succeed (yes, it's ELF) */
7976 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7978 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7982 echo "I'll use ld to build dynamic libraries."
7991 rp="What command should be used to create dynamic libraries?"
7997 Some systems may require passing special flags to $ld to create a
7998 library that can be dynamically loaded. If your ld flags include
7999 -L/other/path options to locate libraries outside your loader's normal
8000 search path, you may need to specify those -L options here as well. To
8001 use no flags, say "none".
8004 case "$lddlflags" in
8005 '') case "$osname" in
8006 beos) dflt='-nostart' ;;
8008 case "$gccversion" in
8009 '') dflt="$dflt +vnocompatwarnings" ;;
8012 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8013 next) dflt='none' ;;
8014 solaris) dflt='-G' ;;
8015 sunos) dflt='-assert nodefinitions' ;;
8016 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8020 *) dflt="$lddlflags" ;;
8023 : Try to guess additional flags to pick up local libraries.
8024 : Be careful not to append to a plain 'none'
8028 for thisflag in $ldflags; do
8033 *) dflt="$dflt $thisflag" ;;
8040 ''|' ') dflt='none' ;;
8044 *-fstack-protector*)
8046 *-fstack-protector*) ;; # Don't add it again
8047 *) dflt="$dflt -fstack-protector" ;;
8053 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8056 none) lddlflags=' ' ;;
8057 *) lddlflags="$ans" ;;
8062 Some systems may require passing special flags to $cc to indicate that
8063 the resulting executable will use dynamic linking. To use no flags,
8067 case "$ccdlflags" in
8068 '') case "$osname" in
8069 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8070 next|sunos) dflt='none' ;;
8074 *) dflt="$ccdlflags" ;;
8076 rp="Any special flags to pass to $cc to use dynamic linking?"
8079 none) ccdlflags=' ' ;;
8080 *) ccdlflags="$ans" ;;
8091 : Do we want a shared libperl?
8095 # No dynamic loading being used, so don't bother even to prompt.
8098 *) case "$useshrplib" in
8099 '') case "$osname" in
8100 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8102 also='Building a shared libperl is required for dynamic loading to work on your system.'
8107 also='Building a shared libperl is needed for MAB support.'
8125 The perl executable is normally obtained by linking perlmain.c with
8126 libperl${_a}, any static extensions (usually just DynaLoader), and
8127 any other libraries needed on this system (such as -lm, etc.). Since
8128 your system supports dynamic loading, it is probably possible to build
8129 a shared libperl.$so. If you will have more than one executable linked
8130 to libperl.$so, this will significantly reduce the size of each
8131 executable, but it may have a noticeable effect on performance. The
8132 default is probably sensible for your system.
8136 rp="Build a shared libperl.$so (y/n)"
8140 useshrplib='true' ;;
8141 *) useshrplib='false' ;;
8146 case "$useshrplib" in
8150 # Figure out a good name for libperl.so. Since it gets stored in
8151 # a version-specific architecture-dependent library, the version
8152 # number isn't really that important, except for making cc/ld happy.
8154 # A name such as libperl.so.10.1
8155 majmin="libperl.$so.$patchlevel.$subversion"
8156 # A name such as libperl.so.100
8157 majonly=`echo $patchlevel $subversion |
8158 $awk '{printf "%d%02d", $1, $2}'`
8159 majonly=libperl.$so.$majonly
8160 # I'd prefer to keep the os-specific stuff here to a minimum, and
8161 # rely on figuring it out from the naming of libc.
8162 case "${osname}${osvers}" in
8165 # XXX How handle the --version stuff for MAB?
8167 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8170 cygwin*) # ld links now against the dll directly
8171 majmin="cygperl5_${patchlevel}_${subversion}.${so}"
8172 majonly=`echo $patchlevel $subversion |
8173 $awk '{printf "%03d%03d", $1, $2}'`
8174 majonly=cygperl5.$majonly.$so
8177 *) # Try to guess based on whether libc has major.minor.
8179 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8180 *libc.$so.[0-9]*) dflt=$majonly ;;
8181 *) dflt=libperl.$so ;;
8191 I need to select a good name for the shared libperl. If your system uses
8192 library names with major and minor numbers, then you might want something
8193 like $majmin. Alternatively, if your system uses a single version
8194 number for shared libraries, then you might want to use $majonly.
8195 Or, your system might be quite happy with a simple libperl.$so.
8197 Since the shared libperl will get installed into a version-specific
8198 architecture-dependent directory, the version number of the shared perl
8199 library probably isn't important, so the default should be o.k.
8202 rp='What name do you want to give to the shared libperl?'
8205 echo "Ok, I'll use $libperl"
8208 libperl="libperl${_a}"
8212 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8216 WARNING: Use of the shrpdir variable for the installation location of
8217 the shared $libperl is not supported. It was never documented and
8218 will not work in this version. Let me (perlbug@perl.org)
8219 know of any problems this may cause.
8225 But your current setting of $shrpdir is
8226 the default anyway, so it's harmless.
8231 Further, your current attempted setting of $shrpdir
8232 conflicts with the value of $archlibexp/CORE
8233 that installperl will use.
8240 # How will the perl executable find the installed shared $libperl?
8241 # Add $xxx to ccdlflags.
8242 # If we can't figure out a command-line option, use $shrpenv to
8243 # set env LD_RUN_PATH. The main perl makefile uses this.
8244 shrpdir=$archlibexp/CORE
8247 if "$useshrplib"; then
8250 # We'll set it in Makefile.SH...
8255 freebsd|netbsd|openbsd|interix|dragonfly)
8256 xxx="-Wl,-R$shrpdir"
8258 bsdos|linux|irix*|dec_osf|gnu*)
8259 xxx="-Wl,-rpath,$shrpdir"
8262 # next doesn't like the default...
8265 # beos doesn't like the default, either.
8268 # hpux doesn't like the default, either.
8269 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8272 # cygwin needs only ldlibpth
8275 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8281 # Only add $xxx if it isn't already in ccdlflags.
8282 case " $ccdlflags " in
8284 *) ccdlflags="$ccdlflags $xxx"
8287 Adding $xxx to the flags
8288 passed to $ld so that the perl executable will find the
8289 installed shared $libperl.
8297 # Fix ccdlflags in AIX for building external extensions.
8298 # (For building Perl itself bare -bE:perl.exp is needed,
8299 # Makefile.SH takes care of this.)
8301 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8303 # Respect a hint or command-line value.
8305 '') shrpenv="$tmp_shrpenv" ;;
8307 case "$ldlibpthname" in
8308 '') ldlibpthname=LD_LIBRARY_PATH ;;
8309 none) ldlibpthname='' ;;
8312 : determine where manual pages are on this system
8316 syspath='/usr/share/man/man1 /usr/man/man1'
8317 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8318 syspath="$syspath /usr/man/u_man/man1"
8319 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8320 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8321 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8322 sysman=`./loc . /usr/man/man1 $syspath`
8325 if $test -d "$sysman"; then
8326 echo "System manual is in $sysman." >&4
8328 echo "Could not find manual pages in source form." >&4
8331 : determine where manual pages go
8332 set man1dir man1dir none
8336 $spackage has manual pages available in source form.
8340 echo "However, you don't have nroff, so they're probably useless to you."
8342 '') man1dir="none";;
8345 echo "If you don't want the manual sources installed, answer 'none'."
8350 lookpath="$prefixexp/share/man/man1"
8351 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8352 lookpath="$lookpath $prefixexp/man/p_man/man1"
8353 lookpath="$lookpath $prefixexp/man/u_man/man1"
8354 lookpath="$lookpath $prefixexp/man/man.1"
8356 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8357 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8367 rp="Where do the main $spackage manual pages (source) go?"
8369 if $test "X$man1direxp" != "X$ansexp"; then
8380 : What suffix to use on installed man pages
8387 rp="What suffix should be used for the main $spackage man pages?"
8389 '') case "$man1dir" in
8403 *) dflt="$man1ext";;
8410 : see if we can have long filenames
8412 first=123456789abcdef
8414 if (echo hi >$first) 2>/dev/null; then
8415 if $test -f 123456789abcde; then
8416 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8419 echo 'You can have filenames longer than 14 characters.'>&4
8424 You can't have filenames longer than 14 chars.
8425 You can't even think about them!
8431 $rm -rf 123456789abcde*
8433 : determine where library module manual pages go
8434 set man3dir man3dir none
8438 $spackage has manual pages for many of the library modules.
8444 However, you don't have nroff, so they're probably useless to you.
8447 '') man3dir="none";;
8451 case "$d_flexfnam" in
8454 However, your system can't handle the long file names like File::Basename.3.
8457 '') man3dir="none";;
8461 echo "If you don't want the manual sources installed, answer 'none'."
8462 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8464 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8465 if $test -d "$privlib/man/man3"; then
8468 WARNING: Previous versions of perl installed man3 pages into
8469 $privlib/man/man3. This version will suggest a
8470 new default of $dflt.
8474 rp='Do you wish to preserve the old behavior?(y/n)'
8477 y*) dflt="$privlib/man/man3" ;;
8482 *) dflt="$man3dir" ;;
8489 rp="Where do the $package library man pages (source) go?"
8499 : What suffix to use on installed man pages
8505 rp="What suffix should be used for the $package library man pages?"
8507 '') case "$man3dir" in
8521 *) dflt="$man3ext";;
8528 : see if we have to deal with yellow pages, now NIS.
8529 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8530 if $test -f /usr/etc/nibindd; then
8532 echo "I'm fairly confident you're on a NeXT."
8534 rp='Do you get the hosts file via NetInfo?'
8543 y*) hostcat='nidump hosts .';;
8544 *) case "$hostcat" in
8545 nidump*) hostcat='';;
8555 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8563 rp='Are you getting the hosts file via yellow pages?'
8566 y*) hostcat='ypcat hosts';;
8567 *) hostcat='cat /etc/hosts';;
8573 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8576 '') test -f /etc/group && groupcat='cat /etc/group';;
8579 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8582 : now get the host name
8584 echo "Figuring out host name..." >&4
8585 case "$myhostname" in
8587 echo 'Maybe "hostname" will work...'
8588 if tans=`sh -c hostname 2>&1` ; then
8596 if $test "$cont"; then
8598 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8599 if tans=`cat /etc/systemid 2>&1` ; then
8601 phostname='cat /etc/systemid'
8602 echo "Whadyaknow. Xenix always was a bit strange..."
8605 elif $test -r /etc/systemid; then
8606 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8609 if $test "$cont"; then
8610 echo 'No, maybe "uuname -l" will work...'
8611 if tans=`sh -c 'uuname -l' 2>&1` ; then
8613 phostname='uuname -l'
8615 echo 'Strange. Maybe "uname -n" will work...'
8616 if tans=`sh -c 'uname -n' 2>&1` ; then
8618 phostname='uname -n'
8620 echo 'Oh well, maybe I can mine it out of whoami.h...'
8621 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8622 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8623 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8625 case "$myhostname" in
8626 '') echo "Does this machine have an identity crisis or something?"
8629 echo "Well, you said $myhostname before..."
8630 phostname='echo $myhostname';;
8636 case "$myhostname" in
8637 '') myhostname=noname ;;
8639 : you do not want to know about this
8644 if $test "$myhostname" ; then
8646 rp='Your host name appears to be "'$myhostname'".'" Right?"
8654 : bad guess or no guess
8655 while $test "X$myhostname" = X ; do
8657 rp="Please type the (one word) name of your host:"
8662 : translate upper to lower if necessary
8663 case "$myhostname" in
8665 echo "(Normalizing case in your host name)"
8666 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8670 case "$myhostname" in
8672 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8673 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8674 echo "(Trimming domain name from host name--host name is now $myhostname)"
8676 *) case "$mydomain" in
8679 test "X$hostcat" = "Xypcat hosts" &&
8680 ypmatch "$myhostname" hosts 2>/dev/null |\
8681 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8684 test "X$hostcat" != "X" &&
8685 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8686 /[ ]$myhostname[ . ]/p" > hosts
8689 if $test -f hosts; then
8690 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8691 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8692 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8693 hosts | $sort | $uniq | \
8694 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8695 case `$echo X$dflt` in
8696 X*\ *) echo "(Several hosts in the database matched hostname)"
8699 X.) echo "(You do not have fully-qualified names in the hosts database)"
8703 echo "(I cannot locate a hosts database anywhere)"
8708 tans=`./loc resolv.conf X /etc /usr/etc`
8709 if $test -f "$tans"; then
8710 echo "(Attempting domain name extraction from $tans)"
8711 dflt=.`$sed -n -e 's/ / /g' \
8712 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8715 .) dflt=.`$sed -n -e 's/ / /g' \
8716 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8724 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8725 dflt=.`sh -c domainname 2>/dev/null`
8728 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8732 case "$dflt$osname" in
8733 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8734 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8738 .) echo "(Lost all hope -- silly guess then)"
8744 *) dflt="$mydomain";;
8748 rp="What is your domain name?"
8758 : translate upper to lower if necessary
8761 echo "(Normalizing case in your domain name)"
8762 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8766 : a little sanity check here
8767 case "$phostname" in
8770 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8771 $myhostname$mydomain|$myhostname) ;;
8773 case "$phostname" in
8775 echo "(That doesn't agree with your whoami.h file, by the way.)"
8778 echo "(That doesn't agree with your $phostname command, by the way.)"
8786 : determine the e-mail address of the user who is running us
8789 I need to get your e-mail address in Internet format if possible, i.e.
8790 something like user@host.domain. Please answer accurately since I have
8791 no easy means to double check it. The default value provided below
8792 is most probably close to reality but may not be valid from outside
8793 your organization...
8797 while test "$cont"; do
8799 '') dflt="$cf_by@$myhostname$mydomain";;
8800 *) dflt="$cf_email";;
8802 rp='What is your e-mail address?'
8808 rp='Address does not look like an Internet one. Use it anyway?'
8822 : Ask e-mail of administrator
8825 If you or somebody else will be maintaining perl at your site, please
8826 fill in the correct e-mail address here so that they may be contacted
8827 if necessary. Currently, the "perlbug" program included with perl
8828 will send mail to this address in addition to perlbug@perl.org. You may
8829 enter "none" for no administrator.
8832 case "$perladmin" in
8833 '') dflt="$cf_email";;
8834 *) dflt="$perladmin";;
8836 rp='Perl administrator e-mail address'
8840 : determine whether to only install version-specific parts.
8843 Do you want to install only the version-specific parts of the perl
8844 distribution? Usually you do *not* want to do this.
8846 case "$versiononly" in
8847 "$define"|[Yy]*|true) dflt='y' ;;
8850 rp="Do you want to install only the version-specific parts of perl?"
8853 [yY]*) val="$define";;
8859 case "$versiononly" in
8860 "$define") inc_version_list=''
8861 inc_version_list_init=0
8865 : figure out how to guarantee perl startup
8866 : XXX Note that this currently takes advantage of the bug that binexp ignores
8867 : the Configure -Dinstallprefix setting, which in turn means that under
8868 : relocatable @INC, initialinstalllocation is what binexp started as.
8869 case "$startperl" in
8871 case "$sharpbang" in
8875 I can use the #! construct to start perl on your system. This will
8876 make startup of perl scripts faster, but may cause problems if you
8877 want to share those scripts and perl is not in a standard place
8878 ($initialinstalllocation/perl) on all your platforms. The alternative
8879 is to force a shell by starting the script with a single ':' character.
8882 case "$versiononly" in
8883 "$define") dflt="$initialinstalllocation/perl$version";;
8884 *) dflt="$initialinstalllocation/perl";;
8886 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8889 none) startperl=": # use perl";;
8890 *) startperl="#!$ans"
8891 if $test 30 -lt `echo "$ans" | wc -c`; then
8894 WARNING: Some systems limit the #! command to 32 characters.
8895 If you experience difficulty running Perl scripts with #!, try
8896 installing Perl in a directory with a shorter pathname.
8902 *) startperl=": # use perl"
8907 echo "I'll use $startperl to start perl scripts."
8909 : figure best path for perl in scripts
8912 case "$versiononly" in
8913 "$define") perlpath="$initialinstalllocation/perl$version";;
8914 *) perlpath="$initialinstalllocation/perl";;
8916 case "$startperl" in
8921 I will use the "eval 'exec'" idiom to start Perl on your system.
8922 I can use the full path of your Perl binary for this purpose, but
8923 doing so may cause problems if you want to share those scripts and
8924 Perl is not always in a standard place ($initialinstalllocation/perl).
8927 dflt="$initialinstalllocation/perl"
8928 rp="What path shall I use in \"eval 'exec'\"?"
8935 case "$startperl" in
8937 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8940 : determine where public executable scripts go
8941 set scriptdir scriptdir
8943 case "$scriptdir" in
8946 : guess some guesses
8947 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8948 $test -d /usr/share/bin && dflt=/usr/share/bin
8949 $test -d /usr/local/script && dflt=/usr/local/script
8950 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8951 $test -d $prefixexp/script && dflt=$prefixexp/script
8955 *) dflt="$scriptdir"
8960 Some installations have a separate directory just for executable scripts so
8961 that they can mount it across multiple architectures but keep the scripts in
8962 one spot. You might, for example, have a subdirectory of /usr/share for this.
8963 Or you might just lump your scripts in with all your other executables.
8967 rp='Where do you keep publicly executable scripts?'
8969 if $test "X$ansexp" != "X$scriptdirexp"; then
8975 : A little fix up for an irregularly named variable.
8976 installscript="$installscriptdir"
8978 : determine where add-on public executables go
8980 '') dflt=$siteprefix/bin ;;
8984 rp='Pathname where the add-on public executables should be installed?'
8989 : determine where add-on html pages go
8990 : There is no standard location, so try to copy the previously-selected
8991 : directory structure for the core html pages.
8992 case "$sitehtml1dir" in
8993 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8994 *) dflt=$sitehtml1dir ;;
8997 ''|' ') dflt=none ;;
9000 rp='Pathname where the site-specific html pages should be installed?'
9002 prefixvar=sitehtml1dir
9005 : determine where add-on library html pages go
9006 : There is no standard location, so try to copy the previously-selected
9007 : directory structure for the core html pages.
9008 case "$sitehtml3dir" in
9009 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
9010 *) dflt=$sitehtml3dir ;;
9013 ''|' ') dflt=none ;;
9016 rp='Pathname where the site-specific library html pages should be installed?'
9018 prefixvar=sitehtml3dir
9021 : determine where add-on manual pages go
9022 case "$siteman1dir" in
9023 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9024 *) dflt=$siteman1dir ;;
9027 ''|' ') dflt=none ;;
9030 rp='Pathname where the site-specific manual pages should be installed?'
9032 prefixvar=siteman1dir
9035 : determine where add-on library man pages go
9036 case "$siteman3dir" in
9037 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9038 *) dflt=$siteman3dir ;;
9041 ''|' ') dflt=none ;;
9044 rp='Pathname where the site-specific library manual pages should be installed?'
9046 prefixvar=siteman3dir
9049 : determine where add-on public executable scripts go
9050 case "$sitescript" in
9051 '') dflt=$siteprefix/script
9052 $test -d $dflt || dflt=$sitebin ;;
9053 *) dflt="$sitescript" ;;
9056 rp='Pathname where add-on public executable scripts should be installed?'
9058 prefixvar=sitescript
9061 : Check if faststdio is requested and available
9062 case "$usefaststdio" in
9063 $define|true|[yY]*|'')
9064 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9074 Perl can be built to use 'fast stdio', which means using the stdio
9075 library but also directly manipulating the stdio buffers to enable
9076 faster I/O. Using stdio is better for backward compatibility (especially
9077 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9078 interface has been preferred instead of stdio.
9080 If this doesn't make any sense to you, just accept the default '$dflt'.
9082 rp='Use the "fast stdio" if available?'
9085 y|Y) val="$define" ;;
9092 : define an is-a-typedef? function
9093 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9095 "") inclist="sys/types.h";;
9097 eval "varval=\$$var";
9101 for inc in $inclist; do
9102 echo "#include <$inc>" >>temp.c;
9104 echo "#ifdef $type" >> temp.c;
9105 echo "printf(\"We have $type\");" >> temp.c;
9106 echo "#endif" >> temp.c;
9107 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9108 if $contains $type temp.E >/dev/null 2>&1; then
9114 *) eval "$var=\$varval";;
9117 : define an is-a-typedef? function that prompts if the type is not available.
9118 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9120 "") inclist="sys/types.h";;
9122 eval "varval=\$$var";
9126 for inc in $inclist; do
9127 echo "#include <$inc>" >>temp.c;
9129 echo "#ifdef $type" >> temp.c;
9130 echo "printf(\"We have $type\");" >> temp.c;
9131 echo "#endif" >> temp.c;
9132 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9134 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9135 if $contains $type temp.E >/dev/null 2>&1; then
9136 echo "$type found." >&4;
9139 echo "$type NOT found." >&4;
9145 *) eval "$var=\$varval";;
9148 : see what type lseek is declared as in the kernel
9149 rp="What is the type used for lseek's offset on this system?"
9150 set off_t lseektype long stdio.h sys/types.h
9154 echo "Checking to see how big your file offsets are..." >&4
9156 #include <sys/types.h>
9160 printf("%d\n", (int)sizeof($lseektype));
9165 if eval $compile_ok; then
9166 lseeksize=`$run ./try`
9167 echo "Your file offsets are $lseeksize bytes long."
9171 echo "(I can't seem to compile the test program. Guessing...)"
9172 rp="What is the size of your file offsets (in bytes)?"
9178 : see what type file positions are declared as in the library
9179 rp="What is the type for file position used by fsetpos()?"
9180 set fpos_t fpostype long stdio.h sys/types.h
9183 : Check size for Fpos_t
9186 *_t) zzz="$fpostype" ;;
9189 echo "Checking the size of $zzz..." >&4
9191 #include <sys/types.h>
9198 printf("%d\n", (int)sizeof($fpostype));
9203 if eval $compile_ok; then
9207 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9210 echo "Your $zzz is $fpossize bytes long."
9216 echo "(I can't compile the test program. Guessing...)" >&4
9217 rp="What is the size of your file positions (in bytes)?"
9222 : Check for large file support
9223 # Backward compatibility (uselfs is deprecated).
9225 "$define"|true|[yY]*)
9228 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9230 uselargefiles="$define"
9234 case "$lseeksize:$fpossize" in
9237 You can have files larger than 2 gigabytes.
9240 *) case "$uselargefiles" in
9241 "$undef"|false|[nN]*) dflt='n' ;;
9246 Perl can be built to understand large files (files larger than 2 gigabytes)
9247 on some systems. To do so, Configure can be run with -Duselargefiles.
9249 If this doesn't make any sense to you, just accept the default '$dflt'.
9251 rp='Try to understand large files, if available?'
9254 y|Y) val="$define" ;;
9261 : Look for a hint-file generated 'call-back-unit'. If the
9262 : user has specified that a large files perl is to be built,
9263 : we may need to set or change some other defaults.
9264 if $test -f uselargefiles.cbu; then
9265 echo "Your platform has some specific hints regarding large file builds, using them..."
9266 . ./uselargefiles.cbu
9268 case "$uselargefiles" in
9270 if $test -f uselargefiles.cbu; then
9272 echo "Rechecking to see how big your file offsets are..." >&4
9274 #include <sys/types.h>
9278 printf("%d\n", (int)sizeof($lseektype));
9283 if eval $compile_ok; then
9284 lseeksize=`$run ./try`
9285 $echo "Your file offsets are now $lseeksize bytes long."
9289 echo "(I can't seem to compile the test program. Guessing...)"
9290 rp="What is the size of your file offsets (in bytes)?"
9295 *_t) zzz="$fpostype" ;;
9298 $echo $n "Rechecking the size of $zzz...$c" >&4
9300 #include <sys/types.h>
9307 printf("%d\n", (int)sizeof($fpostype));
9312 if eval $compile_ok; then
9317 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9320 echo " $fpossize bytes." >&4
9326 echo "(I can't compile the test program. Guessing...)" >&4
9327 rp="What is the size of your file positions (in bytes)?"
9336 : Set the vendorbin variables
9337 case "$vendorprefix" in
9338 '') d_vendorbin="$undef"
9342 *) d_vendorbin="$define"
9343 : determine where vendor-supplied executables go.
9344 case "$vendorbin" in
9345 '') dflt=$vendorprefix/bin ;;
9346 *) dflt="$vendorbin" ;;
9349 rp='Pathname for the vendor-supplied executables directory?'
9352 vendorbinexp="$ansexp"
9358 : Set the vendorhtml1dir variables
9359 case "$vendorprefix" in
9360 '') vendorhtml1dir=''
9361 vendorhtml1direxp=''
9363 *) : determine where vendor-supplied html pages go.
9364 : There is no standard location, so try to copy the previously-selected
9365 : directory structure for the core html pages.
9366 : XXX Better default suggestions would be welcome.
9367 case "$vendorhtml1dir" in
9368 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9369 *) dflt=$vendorhtml1dir ;;
9372 ''|' ') dflt=none ;;
9375 rp='Pathname for the vendor-supplied html pages?'
9377 vendorhtml1dir="$ans"
9378 vendorhtml1direxp="$ansexp"
9381 : Use ' ' for none so value is preserved next time through Configure
9382 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9383 prefixvar=vendorhtml1dir
9386 : Set the vendorhtml3dir variables
9387 case "$vendorprefix" in
9388 '') vendorhtml3dir=''
9389 vendorhtml3direxp=''
9391 *) : determine where vendor-supplied module html pages go.
9392 : There is no standard location, so try to copy the previously-selected
9393 : directory structure for the core html pages.
9394 : XXX Better default suggestions would be welcome.
9395 case "$vendorhtml3dir" in
9396 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9397 *) dflt=$vendorhtml3dir ;;
9400 ''|' ') dflt=none ;;
9403 rp='Pathname for the vendor-supplied html pages?'
9405 vendorhtml3dir="$ans"
9406 vendorhtml3direxp="$ansexp"
9409 : Use ' ' for none so value is preserved next time through Configure
9410 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9411 prefixvar=vendorhtml3dir
9414 : Set the vendorman1dir variables
9415 case "$vendorprefix" in
9416 '') vendorman1dir=''
9419 *) : determine where vendor-supplied manual pages go.
9420 case "$vendorman1dir" in
9421 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9422 *) dflt=$vendorman1dir ;;
9425 ''|' ') dflt=none ;;
9428 rp='Pathname for the vendor-supplied manual section 1 pages?'
9430 vendorman1dir="$ans"
9431 vendorman1direxp="$ansexp"
9434 : Use ' ' for none so value is preserved next time through Configure
9435 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9436 prefixvar=vendorman1dir
9439 : Set the vendorman3dir variables
9440 case "$vendorprefix" in
9441 '') vendorman3dir=''
9444 *) : determine where vendor-supplied module manual pages go.
9445 case "$vendorman3dir" in
9446 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9447 *) dflt=$vendorman3dir ;;
9450 ''|' ') dflt=none ;;
9453 rp='Pathname for the vendor-supplied manual section 3 pages?'
9455 vendorman3dir="$ans"
9456 vendorman3direxp="$ansexp"
9459 : Use ' ' for none so value is preserved next time through Configure
9460 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9461 prefixvar=vendorman3dir
9464 : Set the vendorscript variables
9465 case "$vendorprefix" in
9466 '') d_vendorscript="$undef"
9470 *) d_vendorscript="$define"
9471 : determine where vendor-supplied scripts go.
9472 case "$vendorscript" in
9473 '') dflt=$vendorprefix/script
9474 $test -d $dflt || dflt=$vendorbin ;;
9475 *) dflt="$vendorscript" ;;
9479 The installation process will create a directory for
9480 vendor-supplied scripts.
9484 rp='Pathname for the vendor-supplied scripts directory?'
9487 vendorscriptexp="$ansexp"
9490 prefixvar=vendorscript
9493 : see if qgcvt exists
9497 : Check print/scan long double stuff
9500 if $test X"$d_longdbl" = X"$define"; then
9502 echo "Checking how to print long doubles..." >&4
9504 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9505 $cat >try.c <<'EOCP'
9506 #include <sys/types.h>
9510 printf("%.3f\n", d);
9514 if eval $compile; then
9518 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9519 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9520 echo "We will use %f."
9526 if $test X"$sPRIfldbl" = X; then
9527 $cat >try.c <<'EOCP'
9528 #include <sys/types.h>
9531 long double d = 123.456;
9532 printf("%.3Lf\n", d);
9536 if eval $compile; then
9540 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9541 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9542 echo "We will use %Lf."
9548 if $test X"$sPRIfldbl" = X; then
9549 $cat >try.c <<'EOCP'
9550 #include <sys/types.h>
9553 long double d = 123.456;
9554 printf("%.3llf\n", d);
9558 if eval $compile; then
9562 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9563 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9564 echo "We will use %llf."
9570 if $test X"$sPRIfldbl" = X; then
9571 $cat >try.c <<'EOCP'
9572 #include <sys/types.h>
9575 long double d = 123.456;
9576 printf("%.3lf\n", d);
9580 if eval $compile; then
9584 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9585 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9586 echo "We will use %lf."
9592 if $test X"$sPRIfldbl" = X; then
9593 echo "Cannot figure out how to print long doubles." >&4
9595 sSCNfldbl=$sPRIfldbl # expect consistency
9602 case "$sPRIfldbl" in
9603 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9604 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9605 d_SCNfldbl="$undef";
9607 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9608 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9609 d_SCNfldbl="$define";
9613 : Check how to convert floats to strings.
9615 if test "X$d_Gconvert" = X; then
9618 echo "Checking for an efficient way to convert floats to strings."
9620 case "$uselongdouble" in
9621 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9623 case "$d_longdbl" in
9624 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9626 case "$d_PRIgldbl" in
9627 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9631 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9632 char *myname = "gconvert";
9635 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9636 char *myname = "gcvt";
9639 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9640 char *myname = "qgcvt";
9641 #define DOUBLETYPE long double
9644 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9646 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9648 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9651 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9653 char *myname = "sprintf";
9657 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9658 #define DOUBLETYPE long double
9660 #define DOUBLETYPE double
9666 #define I_STDLIB $i_stdlib
9672 checkit(expect, got)
9676 if (strcmp(expect, got)) {
9677 printf("%s oddity: Expected %s, got %s\n",
9678 myname, expect, got);
9688 /* This must be 1st test on (which?) platform */
9689 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9690 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9691 checkit("0.1", buf);
9693 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9694 checkit("0.01", buf);
9696 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9697 checkit("0.001", buf);
9699 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9700 checkit("0.0001", buf);
9702 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9703 if (strlen(buf) > 5)
9704 checkit("9e-005", buf); /* for Microsoft ?? */
9706 checkit("9e-05", buf);
9708 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9711 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9712 checkit("1.1", buf);
9714 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9715 checkit("1.01", buf);
9717 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9718 checkit("1.001", buf);
9720 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9721 checkit("1.0001", buf);
9723 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9724 checkit("1.00001", buf);
9726 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9727 checkit("1.000001", buf);
9729 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9732 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9735 /* Some Linux gcvt's give 1.e+5 here. */
9736 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9737 checkit("100000", buf);
9739 /* Some Linux gcvt's give -1.e+5 here. */
9740 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9741 checkit("-100000", buf);
9743 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9744 checkit("123.456", buf);
9746 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9747 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9748 /* 34 should be enough to scare even long double
9749 * places into using the e notation. */
9750 if (strlen(buf) > 5)
9751 checkit("1e+034", buf); /* for Microsoft */
9753 checkit("1e+34", buf);
9755 /* For Perl, if you add additional tests here, also add them to
9756 * t/base/num.t for benefit of platforms not using Configure or
9757 * overriding d_Gconvert */
9762 : first add preferred functions to our list
9764 for xxx_convert in $gconvert_preference; do
9765 case $xxx_convert in
9766 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9767 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9770 : then add any others
9771 for xxx_convert in gconvert gcvt sprintf; do
9774 *) xxx_list="$xxx_list $xxx_convert" ;;
9778 case "$d_longdbl$uselongdouble" in
9780 : again, add prefered functions to our list first
9782 for xxx_convert in $gconvert_ld_preference; do
9783 case $xxx_convert in
9784 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9785 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9788 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9789 for xxx_convert in qgcvt sprintf $xxx_list; do
9790 case "$xxx_ld_list" in
9791 $xxx_convert*|*" $xxx_convert"*) ;;
9792 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9795 : if sprintf cannot do long doubles, move it to the end
9796 if test "$d_PRIgldbl" != "$define"; then
9797 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9799 : if no qgcvt, remove it
9800 if test "$d_qgcvt" != "$define"; then
9801 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9804 xxx_list="$xxx_ld_list"
9808 for xxx_convert in $xxx_list; do
9809 echo "Trying $xxx_convert..."
9810 $rm -f try try$_o core
9811 set try -DTRY_$xxx_convert
9812 if eval $compile; then
9813 echo "$xxx_convert() found." >&4
9815 echo "I'll use $xxx_convert to convert floats into a string." >&4
9818 echo "...But $xxx_convert didn't work as I expected."
9822 echo "$xxx_convert NOT found." >&4
9826 if test X$xxx_convert = X; then
9827 echo "*** WHOA THERE!!! ***" >&4
9828 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9832 case "$xxx_convert" in
9833 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9834 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9835 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9836 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9837 "$define$define$define")
9838 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9839 "$define$define$undef")
9840 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9841 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9849 : see if _fwalk exists
9853 : Initialize h_fcntl
9856 : Initialize h_sysfile
9859 : access call always available on UNIX
9863 : locate the flags for 'access()'
9867 $cat >access.c <<EOCP
9868 #include <sys/types.h>
9873 #include <sys/file.h>
9886 : check sys/file.h first, no particular reason here
9887 if $test `./findhdr sys/file.h` && \
9888 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9890 echo "<sys/file.h> defines the *_OK access constants." >&4
9891 elif $test `./findhdr fcntl.h` && \
9892 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9894 echo "<fcntl.h> defines the *_OK access constants." >&4
9895 elif $test `./findhdr unistd.h` && \
9896 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9897 echo "<unistd.h> defines the *_OK access constants." >&4
9899 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9905 : see if accessx exists
9906 set accessx d_accessx
9909 : see if aintl exists
9913 : see if alarm exists
9917 : see if POSIX threads are available
9918 set pthread.h i_pthread
9921 : define a fucntion to check prototypes
9922 $cat > protochk <<EOSH
9925 optimize="$optimize"
9927 prototype="$prototype"
9930 usethreads=$usethreads
9931 i_pthread=$i_pthread
9932 pthread_h_first=$pthread_h_first
9935 $cat >> protochk <<'EOSH'
9940 while test $# -ge 2; do
9942 $define) echo "#include <$2>" >> try.c ;;
9943 literal) echo "$2" >> try.c ;;
9945 # Extra magic for the benefit of systems that need pthread.h
9946 # to be included early to correctly detect threadsafe functions.
9947 # Such functions must guarantee themselves, though, that the usethreads
9948 # and i_pthread have been defined, before calling protochk.
9949 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9950 echo "#include <pthread.h>" >> try.c
9955 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9956 cat >> try.c <<'EOCP'
9957 #ifdef CAN_PROTOTYPE
9958 #define _(args) args
9963 echo "$foo" >> try.c
9964 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9965 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9973 : Define hasproto macro for Configure internal use
9974 hasproto='varname=$1; func=$2; shift; shift;
9975 while $test $# -ge 2; do
9977 $define) echo "#include <$2>";;
9981 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9982 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9983 echo "$func() prototype found.";
9986 echo "$func() prototype NOT found.";
9993 : see if sys/types.h has to be included
9994 set sys/types.h i_systypes
9997 : see if sys/select.h has to be included
9998 set sys/select.h i_sysselct
10001 : Define hasfield macro for Configure internal use
10002 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
10003 while $test $# -ge 2; do
10005 $define) echo "#include <$2>";;
10009 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
10011 if eval $compile; then
10020 : see if we should include time.h, sys/time.h, or both
10022 if test "X$timeincl" = X; then
10023 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10024 $echo $n "I'm now running the test program...$c"
10026 #include <sys/types.h>
10031 #ifdef SYSTIMEKERNEL
10034 #include <sys/time.h>
10037 #include <sys/select.h>
10039 #$i_stdlib I_STDLIB
10041 #include <stdlib.h>
10047 struct timeval bar;
10050 struct timezone tzp;
10052 if (foo.tm_sec == foo.tm_sec)
10055 if (bar.tv_sec == bar.tv_sec)
10062 for s_timezone in '-DS_TIMEZONE' ''; do
10064 for s_timeval in '-DS_TIMEVAL' ''; do
10065 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10066 for i_time in '' '-DI_TIME'; do
10067 for i_systime in '-DI_SYSTIME' ''; do
10070 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10071 if eval $compile; then
10072 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10076 $echo $n "Succeeded with $flags$c"
10088 *SYSTIMEKERNEL*) i_systimek="$define"
10089 timeincl=`./findhdr sys/time.h`
10090 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10091 *) i_systimek="$undef";;
10094 *I_TIME*) i_time="$define"
10095 timeincl=`./findhdr time.h`" $timeincl"
10096 echo "We'll include <time.h>." >&4;;
10097 *) i_time="$undef";;
10100 *I_SYSTIME*) i_systime="$define"
10101 timeincl=`./findhdr sys/time.h`" $timeincl"
10102 echo "We'll include <sys/time.h>." >&4;;
10103 *) i_systime="$undef";;
10107 : see if struct tm knows about tm_zone
10108 case "$i_systime$i_time" in
10111 echo "Checking to see if your struct tm has tm_zone field..." >&4
10112 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10120 case "$d_tm_tm_zone" in
10121 "$define") echo "Yes, it does." ;;
10122 *) echo "No, it doesn't." ;;
10124 : see if struct tm knows about tm_gmtoff
10125 case "$i_systime$i_time" in
10128 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10129 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10137 case "$d_tm_tm_gmtoff" in
10138 "$define") echo "Yes, it does." ;;
10139 *) echo "No, it doesn't." ;;
10142 : see if asctime_r exists
10143 set asctime_r d_asctime_r
10145 case "$d_asctime_r" in
10147 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10148 case "$d_asctime_r_proto:$usethreads" in
10149 ":define") d_asctime_r_proto=define
10150 set d_asctime_r_proto asctime_r $hdrs
10154 case "$d_asctime_r_proto" in
10156 case "$asctime_r_proto" in
10157 ''|0) try='char* asctime_r(const struct tm*, char*);'
10158 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10160 case "$asctime_r_proto" in
10161 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10162 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10164 case "$asctime_r_proto" in
10165 ''|0) try='int asctime_r(const struct tm*, char*);'
10166 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10168 case "$asctime_r_proto" in
10169 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10170 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10172 case "$asctime_r_proto" in
10173 ''|0) d_asctime_r=undef
10175 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10176 * ) case "$asctime_r_proto" in
10177 REENTRANT_PROTO*) ;;
10178 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10180 echo "Prototype: $try" ;;
10183 *) case "$usethreads" in
10184 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10191 *) asctime_r_proto=0
10195 : see if atolf exists
10199 : see if atoll exists
10203 : Look for GCC-style attribute format
10204 case "$d_attribute_format" in
10207 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10208 $cat >attrib.c <<'EOCP'
10210 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10212 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10213 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10214 echo "Your C compiler doesn't support __attribute__((format))."
10217 echo "Your C compiler supports __attribute__((format))."
10221 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10225 *) val="$d_attribute_format" ;;
10227 set d_attribute_format
10231 : Look for GCC-style attribute format with null format allowed
10232 case "$d_printf_format_null" in
10233 '') case "$d_attribute_format" in
10236 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10237 $cat >attrib.c <<EOCP
10239 #$i_stdlib I_STDLIB
10241 #include <stdlib.h>
10243 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10244 int null_printf (char* pat,...) { return (int)pat; }
10245 int main () { exit(null_printf(NULL)); }
10247 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10248 : run the executable in case it produces a run-time warning
10249 if $run ./attrib >>attrib.out 2>&1; then
10250 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10251 echo "Your C compiler doesn't allow __printf__ format to be null."
10254 echo "Your C compiler allows __printf__ format to be null."
10258 echo "Your C compiler executable failed with __printf__ format null."
10262 echo "Your C compiler fails with __printf__ format null."
10269 *) val="$d_printf_format_null" ;;
10271 set d_printf_format_null
10275 : Look for GCC-style attribute malloc
10276 case "$d_attribute_malloc" in
10279 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10280 $cat >attrib.c <<'EOCP'
10282 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10284 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10285 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10286 echo "Your C compiler doesn't support __attribute__((malloc))."
10289 echo "Your C compiler supports __attribute__((malloc))."
10293 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10297 *) val="$d_attribute_malloc" ;;
10299 set d_attribute_malloc
10303 : Look for GCC-style attribute nonnull
10304 case "$d_attribute_nonnull" in
10307 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10308 $cat >attrib.c <<'EOCP'
10310 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10312 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10313 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10314 echo "Your C compiler doesn't support __attribute__((nonnull))."
10317 echo "Your C compiler supports __attribute__((nonnull))."
10321 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10325 *) val="$d_attribute_nonnull" ;;
10327 set d_attribute_nonnull
10331 : Look for GCC-style attribute noreturn
10332 case "$d_attribute_noreturn" in
10335 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10336 $cat >attrib.c <<'EOCP'
10338 void fall_over_dead( void ) __attribute__((noreturn));
10340 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10341 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10342 echo "Your C compiler doesn't support __attribute__((noreturn))."
10345 echo "Your C compiler supports __attribute__((noreturn))."
10349 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10353 *) val="$d_attribute_noreturn" ;;
10355 set d_attribute_noreturn
10359 : Look for GCC-style attribute pure
10360 case "$d_attribute_pure" in
10363 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10364 $cat >attrib.c <<'EOCP'
10366 int square( int n ) __attribute__((pure));
10368 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10369 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10370 echo "Your C compiler doesn't support __attribute__((pure))."
10373 echo "Your C compiler supports __attribute__((pure))."
10377 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10381 *) val="$d_attribute_pure" ;;
10383 set d_attribute_pure
10387 : Look for GCC-style attribute unused
10388 case "$d_attribute_unused" in
10391 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10392 $cat >attrib.c <<'EOCP'
10394 int do_something( int dummy __attribute__((unused)), int n );
10396 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10397 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10398 echo "Your C compiler doesn't support __attribute__((unused))."
10401 echo "Your C compiler supports __attribute__((unused))."
10405 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10409 *) val="$d_attribute_unused" ;;
10411 set d_attribute_unused
10415 : Look for GCC-style attribute warn_unused_result
10416 case "$d_attribute_warn_unused_result" in
10419 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10420 $cat >attrib.c <<'EOCP'
10422 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10424 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10425 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10426 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10429 echo "Your C compiler supports __attribute__((warn_unused_result))."
10433 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10437 *) val="$d_attribute_warn_unused_result" ;;
10439 set d_attribute_warn_unused_result
10443 : see if bcmp exists
10447 : see if bcopy exists
10451 : see if getpgrp exists
10452 set getpgrp d_getpgrp
10455 case "$d_getpgrp" in
10458 echo "Checking to see which flavor of getpgrp is in use..."
10460 #$i_unistd I_UNISTD
10461 #include <sys/types.h>
10463 # include <unistd.h>
10465 #$i_stdlib I_STDLIB
10467 #include <stdlib.h>
10471 if (getuid() == 0) {
10472 printf("(I see you are running Configure as super-user...)\n");
10475 #ifdef TRY_BSD_PGRP
10476 if (getpgrp(1) == 0)
10485 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10486 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10488 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10489 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10492 echo "I can't seem to compile and run the test program."
10494 xxx="a USG one, i.e. you use getpgrp()."
10496 # SVR4 systems can appear rather BSD-ish.
10497 case "$i_unistd" in
10499 xxx="a BSD one, i.e. you use getpgrp(pid)."
10503 xxx="probably a USG one, i.e. you use getpgrp()."
10508 echo "Assuming your getpgrp is $xxx" >&4
10517 : see if setpgrp exists
10518 set setpgrp d_setpgrp
10521 case "$d_setpgrp" in
10524 echo "Checking to see which flavor of setpgrp is in use..."
10526 #$i_unistd I_UNISTD
10527 #include <sys/types.h>
10529 # include <unistd.h>
10531 #$i_stdlib I_STDLIB
10533 #include <stdlib.h>
10537 if (getuid() == 0) {
10538 printf("(I see you are running Configure as super-user...)\n");
10541 #ifdef TRY_BSD_PGRP
10542 if (-1 == setpgrp(1, 1))
10545 if (setpgrp() != -1)
10551 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10552 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10554 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10555 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10558 echo "(I can't seem to compile and run the test program.)"
10560 xxx="a USG one, i.e. you use setpgrp()."
10562 # SVR4 systems can appear rather BSD-ish.
10563 case "$i_unistd" in
10565 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10569 xxx="probably a USG one, i.e. you use setpgrp()."
10574 echo "Assuming your setpgrp is $xxx" >&4
10583 : Look for GCC-style __builtin_choose_expr
10584 case "$d_builtin_choose_expr" in
10587 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10588 $cat >try.c <<'EOCP'
10589 #include <assert.h>
10590 #include <stdlib.h>
10593 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10596 assert( SYRINX(1) == 2112 );
10597 assert( SYRINX(1) != 5150 );
10598 assert( SYRINX(0) == 5150 );
10599 assert( SYRINX(0) != 2112 );
10600 puts( "All good!" );
10606 if eval $compile && $run ./try; then
10607 echo "Your C compiler supports __builtin_choose_expr."
10610 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10614 *) val="$d_builtin_choose_expr" ;;
10617 set d_builtin_choose_expr
10621 : Look for GCC-style __builtin_expect
10622 case "$d_builtin_expect" in
10625 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10626 $cat >try.c <<'EOCP'
10629 if ( __builtin_expect(n, 0) ) n = 1;
10630 /* Remember shell exit code truth is 0, C truth is non-zero */
10635 if eval $compile && $run ./try; then
10636 echo "Your C compiler supports __builtin_expect."
10639 echo "Your C compiler doesn't seem to understand __builtin_expect."
10643 *) val="$d_builtin_expect" ;;
10646 set d_builtin_expect
10650 : see if bzero exists
10654 : see if stdarg is available
10656 if $test `./findhdr stdarg.h`; then
10657 echo "<stdarg.h> found." >&4
10660 echo "<stdarg.h> NOT found." >&4
10664 : see if varags is available
10666 if $test `./findhdr varargs.h`; then
10667 echo "<varargs.h> found." >&4
10669 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10672 : set up the varargs testing programs
10673 $cat > varargs.c <<EOP
10675 #include <stdarg.h>
10678 #include <varargs.h>
10682 int f(char *p, ...)
10696 p = va_arg(ap, char *);
10702 $cat > varargs <<EOP
10704 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10713 : now check which varargs header should be included
10718 if `./varargs I_STDARG`; then
10720 elif `./varargs I_VARARGS`; then
10725 if `./varargs I_VARARGS`; then
10732 echo "I could not find the definition for va_dcl... You have problems..." >&4
10733 val="$undef"; set i_stdarg; eval $setvar
10734 val="$undef"; set i_varargs; eval $setvar
10739 case "$i_varhdr" in
10741 val="$define"; set i_stdarg; eval $setvar
10742 val="$undef"; set i_varargs; eval $setvar
10745 val="$undef"; set i_stdarg; eval $setvar
10746 val="$define"; set i_varargs; eval $setvar
10749 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10753 : see if the Compiler supports C99 variadic macros
10754 case "$i_stdarg$i_stdlib" in
10756 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10759 #include <stdarg.h>
10761 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10765 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10771 if eval $compile && $run ./try 2>&1 >/dev/null; then
10772 case "`$run ./try`" in
10774 echo "You have C99 variadic macros." >&4
10775 d_c99_variadic_macros="$define"
10778 echo "You don't have functional C99 variadic macros." >&4
10779 d_c99_variadic_macros="$undef"
10783 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10784 d_c99_variadic_macros="$undef"
10789 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10790 d_c99_variadic_macros="$undef"
10794 : see if signal is declared as pointer to function returning int or void
10796 xxx=`./findhdr signal.h`
10797 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10798 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10799 echo "You have int (*signal())() instead of void." >&4
10801 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10802 echo "You have void (*signal())()." >&4
10804 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10805 echo "You have int (*signal())() instead of void." >&4
10807 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10808 echo "You have void (*signal())()." >&4
10811 case "$d_voidsig" in
10813 echo "I can't determine whether signal handler returns void or int..." >&4
10815 rp="What type does your signal handler return?"
10818 v*) val="$define";;
10822 echo "As you already told me, signal handler returns void." >&4
10825 *) echo "As you already told me, signal handler returns int." >&4
10832 case "$d_voidsig" in
10833 "$define") signal_t="void";;
10834 *) signal_t="int";;
10838 : check for ability to cast large floats to 32-bit ints.
10840 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10841 if $test "$intsize" -ge 4; then
10848 #$i_stdlib I_STDLIB
10850 #include <stdlib.h>
10852 #include <sys/types.h>
10853 #include <signal.h>
10854 $signal_t blech(int s) { exit(3); }
10861 signal(SIGFPE, blech);
10863 /* Don't let compiler optimize the test away. Store the number
10864 in a writable string for gcc to pass to sscanf under HP/UX.
10866 sprintf(str, "2147483647");
10867 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10871 /* x86 processors will probably give 0x8000 0000, which is a
10872 sign change. We don't want that. We want to mimic SPARC
10873 behavior here, which is to preserve the sign and give
10876 if (i32 != ($xxx) f)
10882 if eval $compile_ok; then
10886 echo "(I can't seem to compile the test program--assuming it can't)"
10891 echo "Yup, it can."
10894 echo "Nope, it can't."
10901 : check for ability to cast negative floats to unsigned
10903 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10906 #$i_stdlib I_STDLIB
10908 #include <stdlib.h>
10910 #include <sys/types.h>
10911 #include <signal.h>
10912 $signal_t blech(int s) { exit(7); }
10913 $signal_t blech_in_list(int s) { exit(4); }
10914 unsigned long dummy_long(unsigned long p) { return p; }
10915 unsigned int dummy_int(unsigned int p) { return p; }
10916 unsigned short dummy_short(unsigned short p) { return p; }
10920 unsigned long along;
10922 unsigned short ashort;
10926 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10927 a direct f = -123. assignment. gcc-2.8.0 reportedly
10928 optimized the whole file away
10930 /* Store the number in a writable string for gcc to pass to
10931 sscanf under HP/UX.
10933 sprintf(str, "-123");
10934 sscanf(str, "%lf", &f); /* f = -123.; */
10936 signal(SIGFPE, blech);
10937 along = (unsigned long)f;
10938 aint = (unsigned int)f;
10939 ashort = (unsigned short)f;
10940 if (along != (unsigned long)-123)
10942 if (aint != (unsigned int)-123)
10944 if (ashort != (unsigned short)-123)
10946 sprintf(str, "1073741824.");
10947 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10950 along = (unsigned long)f;
10951 if (along != 0x80000000)
10955 along = (unsigned long)f;
10956 if (along != 0x7fffffff)
10960 along = (unsigned long)f;
10961 if (along != 0x80000001)
10965 signal(SIGFPE, blech_in_list);
10966 sprintf(str, "123.");
10967 sscanf(str, "%lf", &f); /* f = 123.; */
10968 along = dummy_long((unsigned long)f);
10969 aint = dummy_int((unsigned int)f);
10970 ashort = dummy_short((unsigned short)f);
10971 if (along != (unsigned long)123)
10973 if (aint != (unsigned int)123)
10975 if (ashort != (unsigned short)123)
10982 if eval $compile_ok; then
10986 echo "(I can't seem to compile the test program--assuming it can't)"
10989 case "$castflags" in
10991 echo "Yup, it can."
10994 echo "Nope, it can't."
11001 : see if vprintf exists
11003 if set vprintf val -f d_vprintf; eval $csym; $val; then
11004 echo 'vprintf() found.' >&4
11007 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
11008 #$i_varargs I_VARARGS
11010 #$i_stdlib I_STDLIB
11011 #$i_unistd I_UNISTD
11014 # include <stdarg.h>
11015 #else /* I_VARARGS */
11016 # include <varargs.h>
11020 # include <unistd.h>
11024 # include <stdlib.h>
11027 #include <stdio.h> /* vsprintf prototype */
11030 void xxx(int n, ...)
11035 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11037 int main() { xxx(1, "foo"); }
11039 #else /* I_VARARGS */
11047 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11049 int main() { xxx("foo"); }
11055 if eval $compile_ok; then
11056 if $run ./try; then
11057 echo "Your vsprintf() returns (int)." >&4
11060 echo "Your vsprintf() returns (char*)." >&4
11064 echo 'I am unable to compile the vsprintf() test program.' >&4
11065 # We shouldn't get here. If we do, assume the standard signature,
11066 # not the old BSD one.
11067 echo 'Guessing that vsprintf() returns (int).' >&4
11071 echo 'vprintf() NOT found.' >&4
11082 : see if chown exists
11086 : see if chroot exists
11087 set chroot d_chroot
11090 : see if chsize exists
11091 set chsize d_chsize
11094 : see if class exists
11098 : see if clearenv exists
11099 set clearenv d_clearenv
11102 : Define hasstruct macro for Configure internal use
11103 hasstruct='varname=$1; struct=$2; shift; shift;
11104 while $test $# -ge 2; do
11106 $define) echo "#include <$2>";;
11110 echo "int main () { struct $struct foo; }" >> try.c;
11112 if eval $compile; then
11121 : see whether socket exists
11125 $echo $n "Hmm... $c" >&4
11126 if set socket val -f d_socket; eval $csym; $val; then
11127 echo "Looks like you have Berkeley networking support." >&4
11129 if set setsockopt val -f; eval $csym; $val; then
11132 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11133 d_oldsock="$define"
11136 if $contains socklib libc.list >/dev/null 2>&1; then
11137 echo "Looks like you have Berkeley networking support." >&4
11139 : we will have to assume that it supports the 4.2 BSD interface
11142 echo "You don't have Berkeley networking in libc$_a..." >&4
11143 if test "X$d_socket" = "X$define"; then
11144 echo "...but you seem to believe that you have sockets." >&4
11146 for net in net socket
11148 if test -f /usr/lib/lib$net$_a; then
11149 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11150 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11151 if $contains socket libc.list >/dev/null 2>&1; then
11156 echo "...but the Wollongong group seems to have hacked it in." >&4
11157 sockethdr="-I/usr/netinclude"
11160 echo "Found Berkeley sockets interface in lib$net." >&4
11161 if $contains setsockopt libc.list >/dev/null 2>&1; then
11164 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11165 d_oldsock="$define"
11171 if test "X$d_socket" != "X$define"; then
11172 echo "or anywhere else I see." >&4
11180 : see if socketpair exists
11181 set socketpair d_sockpair
11186 echo "Checking the availability of certain socket constants..." >&4
11187 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11188 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11190 #include <sys/types.h>
11191 #include <sys/socket.h>
11197 set try; if eval $compile; then
11200 set d_${enum}; eval $setvar
11204 : see if this is a sys/uio.h system
11205 set sys/uio.h i_sysuio
11208 : Check for cmsghdr support
11210 echo "Checking to see if your system supports struct cmsghdr..." >&4
11211 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11213 case "$d_cmsghdr_s" in
11214 "$define") echo "Yes, it does." ;;
11215 *) echo "No, it doesn't." ;;
11219 : check for const keyword
11221 echo 'Checking to see if your C compiler knows about "const"...' >&4
11222 $cat >const.c <<'EOCP'
11223 typedef struct spug { int drokk; } spug;
11227 const spug y = { 0 };
11230 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11232 echo "Yup, it does."
11235 echo "Nope, it doesn't."
11240 : see if copysignl exists
11241 set copysignl d_copysignl
11244 : see if crypt exists
11249 $define) cryptlib='' ;;
11250 *) if set crypt val -f d_crypt; eval $csym; $val; then
11251 echo 'crypt() found.' >&4
11255 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11256 if $test -z "$cryptlib"; then
11257 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11261 if $test -z "$cryptlib"; then
11262 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11266 if $test -z "$cryptlib"; then
11267 cryptlib=`./loc libcrypt$_a "" $libpth`
11271 if $test -z "$cryptlib"; then
11272 echo 'crypt() NOT found.' >&4
11283 : see if this is a crypt.h system
11284 set crypt.h i_crypt
11287 : see if crypt_r exists
11288 set crypt_r d_crypt_r
11290 case "$d_crypt_r" in
11292 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11293 case "$d_crypt_r_proto:$usethreads" in
11294 ":define") d_crypt_r_proto=define
11295 set d_crypt_r_proto crypt_r $hdrs
11299 case "$d_crypt_r_proto" in
11301 case "$crypt_r_proto" in
11302 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11303 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11305 case "$crypt_r_proto" in
11306 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11307 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11309 case "$crypt_r_proto" in
11310 ''|0) d_crypt_r=undef
11312 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11313 * ) case "$crypt_r_proto" in
11314 REENTRANT_PROTO*) ;;
11315 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11317 echo "Prototype: $try" ;;
11320 *) case "$usethreads" in
11321 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11332 : get csh whereabouts
11334 'csh') val="$undef" ;;
11335 *) val="$define" ;;
11339 : Respect a hint or command line value for full_csh.
11340 case "$full_csh" in
11341 '') full_csh=$csh ;;
11344 : see if ctermid exists
11345 set ctermid d_ctermid
11348 : see if ctermid_r exists
11349 set ctermid_r d_ctermid_r
11351 case "$d_ctermid_r" in
11353 hdrs="$i_systypes sys/types.h define stdio.h "
11354 case "$d_ctermid_r_proto:$usethreads" in
11355 ":define") d_ctermid_r_proto=define
11356 set d_ctermid_r_proto ctermid_r $hdrs
11360 case "$d_ctermid_r_proto" in
11362 case "$ctermid_r_proto" in
11363 ''|0) try='char* ctermid_r(char*);'
11364 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11366 case "$ctermid_r_proto" in
11367 ''|0) d_ctermid_r=undef
11369 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11370 * ) case "$ctermid_r_proto" in
11371 REENTRANT_PROTO*) ;;
11372 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11374 echo "Prototype: $try" ;;
11377 *) case "$usethreads" in
11378 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11385 *) ctermid_r_proto=0
11389 : see if ctime_r exists
11390 set ctime_r d_ctime_r
11392 case "$d_ctime_r" in
11394 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11395 case "$d_ctime_r_proto:$usethreads" in
11396 ":define") d_ctime_r_proto=define
11397 set d_ctime_r_proto ctime_r $hdrs
11401 case "$d_ctime_r_proto" in
11403 case "$ctime_r_proto" in
11404 ''|0) try='char* ctime_r(const time_t*, char*);'
11405 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11407 case "$ctime_r_proto" in
11408 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11409 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11411 case "$ctime_r_proto" in
11412 ''|0) try='int ctime_r(const time_t*, char*);'
11413 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11415 case "$ctime_r_proto" in
11416 ''|0) try='int ctime_r(const time_t*, char*, int);'
11417 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11419 case "$ctime_r_proto" in
11420 ''|0) d_ctime_r=undef
11422 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11423 * ) case "$ctime_r_proto" in
11424 REENTRANT_PROTO*) ;;
11425 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11427 echo "Prototype: $try" ;;
11430 *) case "$usethreads" in
11431 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11442 : see if cuserid exists
11443 set cuserid d_cuserid
11446 : see if this is a limits.h system
11447 set limits.h i_limits
11450 : see if this is a float.h system
11451 set float.h i_float
11454 : See if number of significant digits in a double precision number is known
11456 $cat >dbl_dig.c <<EOM
11457 #$i_limits I_LIMITS
11460 #include <limits.h>
11466 printf("Contains DBL_DIG");
11469 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11470 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11471 echo "DBL_DIG found." >&4
11474 echo "DBL_DIG NOT found." >&4
11481 : see if dbm.h is available
11482 : see if dbmclose exists
11483 set dbmclose d_dbmclose
11486 case "$d_dbmclose" in
11496 *) set rpcsvc/dbm.h i_rpcsvcdbm
11501 *) echo "We won't be including <dbm.h>"
11511 : see if prototype for dbminit is available
11513 set d_dbminitproto dbminit $i_dbm dbm.h
11516 : see if difftime exists
11517 set difftime d_difftime
11520 : see if this is a dirent system
11522 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11524 echo "<dirent.h> found." >&4
11527 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11528 echo "<sys/dir.h> found." >&4
11531 xinc=`./findhdr sys/ndir.h`
11533 echo "<dirent.h> NOT found." >&4
11538 : Look for type of directory structure.
11540 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11542 case "$direntrytype" in
11544 case "$i_dirent" in
11545 $define) guess1='struct dirent' ;;
11546 *) guess1='struct direct' ;;
11549 *) guess1="$direntrytype"
11554 'struct dirent') guess2='struct direct' ;;
11555 *) guess2='struct dirent' ;;
11558 if $contains "$guess1" try.c >/dev/null 2>&1; then
11559 direntrytype="$guess1"
11560 echo "Your directory entries are $direntrytype." >&4
11561 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11562 direntrytype="$guess2"
11563 echo "Your directory entries seem to be $direntrytype." >&4
11565 echo "I don't recognize your system's directory entries." >&4
11566 rp="What type is used for directory entries on this system?"
11569 direntrytype="$ans"
11573 : see if the directory entry stores field length
11575 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11576 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11577 echo "Good, your directory entry keeps length information in d_namlen." >&4
11580 echo "Your directory entry does not know about the d_namlen field." >&4
11587 : Look for DIR.dd_fd
11588 case "$i_dirent" in
11590 echo "Checking to see if DIR has a dd_fd member variable" >&4
11592 #$i_stdlib I_STDLIB
11594 #include <stdlib.h>
11596 #include <dirent.h>
11606 if eval $compile; then
11607 echo "Yes, it does."
11610 echo "No, it does not."
11615 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11623 : see if this is an sysdir system
11624 set sys/dir.h i_sysdir
11627 : see if this is an sysndir system
11628 set sys/ndir.h i_sysndir
11633 $cat >dirfd.c <<EOM
11635 #$i_stdlib I_STDLIB
11637 #include <stdlib.h>
11639 #$i_dirent I_DIRENT /**/
11640 #$i_sysdir I_SYS_DIR /**/
11641 #$i_sysndir I_SYS_NDIR /**/
11642 #$i_systypes I_SYS_TYPES /**/
11643 #if defined(I_SYS_TYPES)
11644 #include <sys/types.h>
11646 #if defined(I_DIRENT)
11647 #include <dirent.h>
11648 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11649 #include <sys/dir.h>
11653 #include <sys/ndir.h>
11657 #include <ndir.h> /* may be wrong in the future */
11659 #include <sys/dir.h>
11665 DIR *dirp = opendir(".");
11666 if (dirfd(dirp) >= 0)
11674 if eval $compile; then
11678 $define) echo "dirfd() found." >&4 ;;
11679 *) echo "dirfd() NOT found." >&4 ;;
11685 : see if dlerror exists
11688 set dlerror d_dlerror
11692 : see if dlfcn is available
11693 set dlfcn.h i_dlfcn
11696 : Check what extension to use for shared libs
11701 On a few systems, the dynamically loaded modules that perl generates and uses
11702 will need a different extension than shared libs. The default will probably
11708 *) dflt="$dlext" ;;
11710 rp='What is the extension of dynamically loaded modules'
11719 : Check if dlsym need a leading underscore
11725 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11726 $cat >dyna.c <<'EOM'
11733 #$i_stdlib I_STDLIB
11735 #include <stdlib.h>
11739 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11741 #include <sys/types.h>
11746 extern int fred() ;
11755 int mode = RTLD_LAZY ;
11757 handle = dlopen("./dyna.$dlext", mode) ;
11758 if (handle == NULL) {
11763 symbol = dlsym(handle, "fred") ;
11764 if (symbol == NULL) {
11765 /* try putting a leading underscore */
11766 symbol = dlsym(handle, "_fred") ;
11767 if (symbol == NULL) {
11780 : Call the object file tmp-dyna.o in case dlext=o.
11781 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11782 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11783 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11784 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11787 1) echo "Test program failed using dlopen." >&4
11788 echo "Perhaps you should not use dynamic loading." >&4;;
11789 2) echo "Test program failed using dlsym." >&4
11790 echo "Perhaps you should not use dynamic loading." >&4;;
11791 3) echo "dlsym needs a leading underscore" >&4
11793 4) echo "dlsym doesn't need a leading underscore." >&4;;
11796 echo "I can't compile and run the test program." >&4
11797 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11802 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11807 : see if drand48_r exists
11808 set drand48_r d_drand48_r
11810 case "$d_drand48_r" in
11812 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11813 case "$d_drand48_r_proto:$usethreads" in
11814 ":define") d_drand48_r_proto=define
11815 set d_drand48_r_proto drand48_r $hdrs
11819 case "$d_drand48_r_proto" in
11821 case "$drand48_r_proto" in
11822 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11823 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11825 case "$drand48_r_proto" in
11826 ''|0) d_drand48_r=undef
11828 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11829 * ) case "$drand48_r_proto" in
11830 REENTRANT_PROTO*) ;;
11831 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11833 echo "Prototype: $try" ;;
11836 *) case "$usethreads" in
11837 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11844 *) drand48_r_proto=0
11848 : see if prototype for drand48 is available
11850 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11853 : see if dup2 exists
11857 : see if eaccess exists
11858 set eaccess d_eaccess
11861 : see if endgrent exists
11862 set endgrent d_endgrent
11865 : see if this is an grp system
11871 xxx=`./findhdr grp.h`
11872 $cppstdin $cppflags $cppminus < $xxx >$$.h
11874 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11886 set d_grpasswd; eval $setvar
11890 : see if endgrent_r exists
11891 set endgrent_r d_endgrent_r
11893 case "$d_endgrent_r" in
11895 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11896 case "$d_endgrent_r_proto:$usethreads" in
11897 ":define") d_endgrent_r_proto=define
11898 set d_endgrent_r_proto endgrent_r $hdrs
11902 case "$d_endgrent_r_proto" in
11904 case "$endgrent_r_proto" in
11905 ''|0) try='int endgrent_r(FILE**);'
11906 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11908 case "$endgrent_r_proto" in
11909 ''|0) try='void endgrent_r(FILE**);'
11910 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11912 case "$endgrent_r_proto" in
11913 ''|0) d_endgrent_r=undef
11915 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11916 * ) case "$endgrent_r_proto" in
11917 REENTRANT_PROTO*) ;;
11918 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11920 echo "Prototype: $try" ;;
11923 *) case "$usethreads" in
11924 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11931 *) endgrent_r_proto=0
11935 : see if endhostent exists
11936 set endhostent d_endhent
11939 : see if this is a netdb.h system
11940 set netdb.h i_netdb
11943 : see if endhostent_r exists
11944 set endhostent_r d_endhostent_r
11946 case "$d_endhostent_r" in
11948 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11949 case "$d_endhostent_r_proto:$usethreads" in
11950 ":define") d_endhostent_r_proto=define
11951 set d_endhostent_r_proto endhostent_r $hdrs
11955 case "$d_endhostent_r_proto" in
11957 case "$endhostent_r_proto" in
11958 ''|0) try='int endhostent_r(struct hostent_data*);'
11959 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11961 case "$endhostent_r_proto" in
11962 ''|0) try='void endhostent_r(struct hostent_data*);'
11963 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11965 case "$endhostent_r_proto" in
11966 ''|0) d_endhostent_r=undef
11967 endhostent_r_proto=0
11968 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11969 * ) case "$endhostent_r_proto" in
11970 REENTRANT_PROTO*) ;;
11971 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11973 echo "Prototype: $try" ;;
11976 *) case "$usethreads" in
11977 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11979 d_endhostent_r=undef
11980 endhostent_r_proto=0
11984 *) endhostent_r_proto=0
11988 : see if endnetent exists
11989 set endnetent d_endnent
11992 : see if endnetent_r exists
11993 set endnetent_r d_endnetent_r
11995 case "$d_endnetent_r" in
11997 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11998 case "$d_endnetent_r_proto:$usethreads" in
11999 ":define") d_endnetent_r_proto=define
12000 set d_endnetent_r_proto endnetent_r $hdrs
12004 case "$d_endnetent_r_proto" in
12006 case "$endnetent_r_proto" in
12007 ''|0) try='int endnetent_r(struct netent_data*);'
12008 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
12010 case "$endnetent_r_proto" in
12011 ''|0) try='void endnetent_r(struct netent_data*);'
12012 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
12014 case "$endnetent_r_proto" in
12015 ''|0) d_endnetent_r=undef
12016 endnetent_r_proto=0
12017 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
12018 * ) case "$endnetent_r_proto" in
12019 REENTRANT_PROTO*) ;;
12020 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12022 echo "Prototype: $try" ;;
12025 *) case "$usethreads" in
12026 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12028 d_endnetent_r=undef
12029 endnetent_r_proto=0
12033 *) endnetent_r_proto=0
12037 : see if endprotoent exists
12038 set endprotoent d_endpent
12041 : see if endprotoent_r exists
12042 set endprotoent_r d_endprotoent_r
12044 case "$d_endprotoent_r" in
12046 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12047 case "$d_endprotoent_r_proto:$usethreads" in
12048 ":define") d_endprotoent_r_proto=define
12049 set d_endprotoent_r_proto endprotoent_r $hdrs
12053 case "$d_endprotoent_r_proto" in
12055 case "$endprotoent_r_proto" in
12056 ''|0) try='int endprotoent_r(struct protoent_data*);'
12057 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12059 case "$endprotoent_r_proto" in
12060 ''|0) try='void endprotoent_r(struct protoent_data*);'
12061 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12063 case "$endprotoent_r_proto" in
12064 ''|0) d_endprotoent_r=undef
12065 endprotoent_r_proto=0
12066 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12067 * ) case "$endprotoent_r_proto" in
12068 REENTRANT_PROTO*) ;;
12069 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12071 echo "Prototype: $try" ;;
12074 *) case "$usethreads" in
12075 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12077 d_endprotoent_r=undef
12078 endprotoent_r_proto=0
12082 *) endprotoent_r_proto=0
12086 : see if endpwent exists
12087 set endpwent d_endpwent
12090 : see if this is a pwd.h system
12096 xxx=`./findhdr pwd.h`
12097 $cppstdin $cppflags $cppminus < $xxx >$$.h
12099 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12107 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12115 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12123 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12131 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12139 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12147 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12155 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12167 set d_pwquota; eval $setvar
12168 set d_pwage; eval $setvar
12169 set d_pwchange; eval $setvar
12170 set d_pwclass; eval $setvar
12171 set d_pwexpire; eval $setvar
12172 set d_pwcomment; eval $setvar
12173 set d_pwgecos; eval $setvar
12174 set d_pwpasswd; eval $setvar
12178 : see if endpwent_r exists
12179 set endpwent_r d_endpwent_r
12181 case "$d_endpwent_r" in
12183 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12184 case "$d_endpwent_r_proto:$usethreads" in
12185 ":define") d_endpwent_r_proto=define
12186 set d_endpwent_r_proto endpwent_r $hdrs
12190 case "$d_endpwent_r_proto" in
12192 case "$endpwent_r_proto" in
12193 ''|0) try='int endpwent_r(FILE**);'
12194 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12196 case "$endpwent_r_proto" in
12197 ''|0) try='void endpwent_r(FILE**);'
12198 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12200 case "$endpwent_r_proto" in
12201 ''|0) d_endpwent_r=undef
12203 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12204 * ) case "$endpwent_r_proto" in
12205 REENTRANT_PROTO*) ;;
12206 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12208 echo "Prototype: $try" ;;
12211 *) case "$usethreads" in
12212 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12219 *) endpwent_r_proto=0
12223 : see if endservent exists
12224 set endservent d_endsent
12227 : see if endservent_r exists
12228 set endservent_r d_endservent_r
12230 case "$d_endservent_r" in
12232 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12233 case "$d_endservent_r_proto:$usethreads" in
12234 ":define") d_endservent_r_proto=define
12235 set d_endservent_r_proto endservent_r $hdrs
12239 case "$d_endservent_r_proto" in
12241 case "$endservent_r_proto" in
12242 ''|0) try='int endservent_r(struct servent_data*);'
12243 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12245 case "$endservent_r_proto" in
12246 ''|0) try='void endservent_r(struct servent_data*);'
12247 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12249 case "$endservent_r_proto" in
12250 ''|0) d_endservent_r=undef
12251 endservent_r_proto=0
12252 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12253 * ) case "$endservent_r_proto" in
12254 REENTRANT_PROTO*) ;;
12255 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12257 echo "Prototype: $try" ;;
12260 *) case "$usethreads" in
12261 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12263 d_endservent_r=undef
12264 endservent_r_proto=0
12268 *) endservent_r_proto=0
12272 : Locate the flags for 'open()'
12275 #include <sys/types.h>
12280 #include <sys/file.h>
12282 #$i_stdlib I_STDLIB
12284 #include <stdlib.h>
12295 : check sys/file.h first to get FREAD on Sun
12296 if $test `./findhdr sys/file.h` && \
12297 set try -DI_SYS_FILE && eval $compile; then
12299 echo "<sys/file.h> defines the O_* constants..." >&4
12300 if $run ./try; then
12301 echo "and you have the 3 argument form of open()." >&4
12304 echo "but not the 3 argument form of open(). Oh, well." >&4
12307 elif $test `./findhdr fcntl.h` && \
12308 set try -DI_FCNTL && eval $compile; then
12310 echo "<fcntl.h> defines the O_* constants..." >&4
12311 if $run ./try; then
12312 echo "and you have the 3 argument form of open()." >&4
12315 echo "but not the 3 argument form of open(). Oh, well." >&4
12320 echo "I can't find the O_* constant definitions! You got problems." >&4
12326 : script used to emit important warnings
12329 if test \$# -gt 0; then
12334 echo "*** WARNING:" >&4
12335 sed -e 's/^/*** /' <msg >&4
12337 cat msg >>config.msg
12338 echo " " >>config.msg
12344 : see which of string.h or strings.h is needed
12346 strings=`./findhdr string.h`
12347 if $test "$strings" && $test -r "$strings"; then
12348 echo "Using <string.h> instead of <strings.h>." >&4
12352 strings=`./findhdr strings.h`
12353 if $test "$strings" && $test -r "$strings"; then
12354 echo "Using <strings.h> instead of <string.h>." >&4
12356 ./warn "No string header found -- You'll surely have problems."
12361 case "$i_string" in
12362 "$undef") strings=`./findhdr strings.h`;;
12363 *) strings=`./findhdr string.h`;;
12366 : see if this is a sys/file.h system
12371 : do we need to include sys/file.h ?
12375 if $h_sysfile; then
12377 echo "We'll be including <sys/file.h>." >&4
12380 echo "We won't be including <sys/file.h>." >&4
12390 : see if fcntl.h is there
12395 : see if we can include fcntl.h
12401 echo "We'll be including <fcntl.h>." >&4
12404 if $h_sysfile; then
12405 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12407 echo "We won't be including <fcntl.h>." >&4
12419 : see if fork exists
12423 : see if pipe exists
12427 : check for non-blocking I/O stuff
12428 case "$h_sysfile" in
12429 true) echo "#include <sys/file.h>" > head.c;;
12432 true) echo "#include <fcntl.h>" > head.c;;
12433 *) echo "#include <sys/fcntl.h>" > head.c;;
12438 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12439 case "$o_nonblock" in
12441 $cat head.c > try.c
12442 $cat >>try.c <<EOCP
12444 #$i_stdlib I_STDLIB
12446 #include <stdlib.h>
12454 printf("O_NONBLOCK\n");
12458 printf("O_NDELAY\n");
12462 printf("FNDELAY\n");
12469 if eval $compile_ok; then
12470 o_nonblock=`$run ./try`
12471 case "$o_nonblock" in
12472 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12473 *) echo "Seems like we can use $o_nonblock.";;
12476 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12479 *) echo "Using $hint value $o_nonblock.";;
12484 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12487 case "$d_fork:$d_pipe" in
12489 $cat head.c > try.c
12490 $cat >>try.c <<EOCP
12492 #include <sys/types.h>
12493 #include <signal.h>
12495 #$i_stdlib I_STDLIB
12497 #include <stdlib.h>
12503 #define MY_O_NONBLOCK $o_nonblock
12504 #ifndef errno /* XXX need better Configure test */
12507 #$i_unistd I_UNISTD
12509 #include <unistd.h>
12511 #$i_string I_STRING
12513 #include <string.h>
12515 #include <strings.h>
12517 $signal_t blech(int x) { exit(3); }
12519 $cat >> try.c <<'EOCP'
12527 pipe(pd); /* Down: child -> parent */
12528 pipe(pu); /* Up: parent -> child */
12531 close(pd[1]); /* Parent reads from pd[0] */
12532 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12534 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12539 signal(SIGALRM, blech);
12541 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12543 sprintf(string, "%d\n", ret);
12544 write(2, string, strlen(string));
12547 if (errno == EAGAIN) {
12548 printf("EAGAIN\n");
12553 if (errno == EWOULDBLOCK)
12554 printf("EWOULDBLOCK\n");
12557 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12558 sleep(2); /* Give it time to close our pipe */
12560 ret = read(pd[0], buf, 1); /* Should read EOF */
12562 sprintf(string, "%d\n", ret);
12563 write(4, string, strlen(string));
12567 close(pd[0]); /* We write to pd[1] */
12568 close(pu[1]); /* We read from pu[0] */
12569 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12570 close(pd[1]); /* Pipe pd is now fully closed! */
12571 exit(0); /* Bye bye, thank you for playing! */
12575 if eval $compile_ok; then
12576 echo "$startsh" >mtry
12577 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12579 ./mtry >/dev/null 2>&1
12581 0) eagain=`$cat try.out`;;
12582 1) echo "Could not perform non-blocking setting!";;
12583 2) echo "I did a successful read() for something that was not there!";;
12584 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12585 4) echo "Could not find F_SETFL!";;
12586 *) echo "Something terribly wrong happened during testing.";;
12588 rd_nodata=`$cat try.ret`
12589 echo "A read() system call with no data present returns $rd_nodata."
12590 case "$rd_nodata" in
12593 echo "(That's peculiar, fixing that to be -1.)"
12599 echo "Forcing errno EAGAIN on read() with no data available."
12603 echo "Your read() sets errno to $eagain when no data is available."
12606 status=`$cat try.err`
12608 0) echo "And it correctly returns 0 to signal EOF.";;
12609 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12610 *) echo "However, your read() returns '$status' on EOF??";;
12613 if test "$status" = "$rd_nodata"; then
12614 echo "WARNING: you can't distinguish between EOF and no data!"
12618 echo "I can't compile the test program--assuming errno EAGAIN will do."
12622 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12631 echo "Using $hint value $eagain."
12632 echo "Your read() returns $rd_nodata when no data is present."
12633 case "$d_eofnblk" in
12634 "$define") echo "And you can see EOF because read() returns 0.";;
12635 "$undef") echo "But you can't see EOF status from read() returned value.";;
12637 echo "(Assuming you can't see EOF status from read anyway.)"
12643 $rm_try head.c mtry
12645 : see if _ptr and _cnt from stdio act std
12648 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12649 echo "(Looks like you have stdio.h from BSD.)"
12650 case "$stdio_ptr" in
12651 '') stdio_ptr='((fp)->_p)'
12654 *) ptr_lval=$d_stdio_ptr_lval;;
12656 case "$stdio_cnt" in
12657 '') stdio_cnt='((fp)->_r)'
12660 *) cnt_lval=$d_stdio_cnt_lval;;
12662 case "$stdio_base" in
12663 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12665 case "$stdio_bufsiz" in
12666 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12668 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12669 echo "(Looks like you have stdio.h from Linux.)"
12670 case "$stdio_ptr" in
12671 '') stdio_ptr='((fp)->_IO_read_ptr)'
12674 *) ptr_lval=$d_stdio_ptr_lval;;
12676 case "$stdio_cnt" in
12677 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12680 *) cnt_lval=$d_stdio_cnt_lval;;
12682 case "$stdio_base" in
12683 '') stdio_base='((fp)->_IO_read_base)';;
12685 case "$stdio_bufsiz" in
12686 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12689 case "$stdio_ptr" in
12690 '') stdio_ptr='((fp)->_ptr)'
12693 *) ptr_lval=$d_stdio_ptr_lval;;
12695 case "$stdio_cnt" in
12696 '') stdio_cnt='((fp)->_cnt)'
12699 *) cnt_lval=$d_stdio_cnt_lval;;
12701 case "$stdio_base" in
12702 '') stdio_base='((fp)->_base)';;
12704 case "$stdio_bufsiz" in
12705 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12709 : test whether _ptr and _cnt really work
12710 echo "Checking how std your stdio is..." >&4
12713 #$i_stdlib I_STDLIB
12715 #include <stdlib.h>
12717 #define FILE_ptr(fp) $stdio_ptr
12718 #define FILE_cnt(fp) $stdio_cnt
12720 FILE *fp = fopen("try.c", "r");
12723 18 <= FILE_cnt(fp) &&
12724 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12732 if eval $compile && $to try.c; then
12733 if $run ./try; then
12734 echo "Your stdio acts pretty std."
12737 echo "Your stdio isn't very std."
12740 echo "Your stdio doesn't appear very std."
12744 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12745 # direct buffer manipulation no longer works. The Configure tests
12746 # should be changed to correctly detect this, but until then,
12747 # the following check should at least let perl compile and run.
12748 # (This quick fix should be updated before 5.8.1.)
12749 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12750 # A. Dougherty, June 3, 2002.
12751 case "$d_gnulibc" in
12753 case "$gnulibc_version" in
12757 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12766 : Can _ptr be used as an lvalue?
12767 case "$d_stdstdio$ptr_lval" in
12768 $define$define) val=$define ;;
12771 set d_stdio_ptr_lval
12774 : Can _cnt be used as an lvalue?
12775 case "$d_stdstdio$cnt_lval" in
12776 $define$define) val=$define ;;
12779 set d_stdio_cnt_lval
12783 : test whether setting _ptr sets _cnt as a side effect
12784 d_stdio_ptr_lval_sets_cnt="$undef"
12785 d_stdio_ptr_lval_nochange_cnt="$undef"
12786 case "$d_stdio_ptr_lval$d_stdstdio" in
12788 echo "Checking to see what happens if we set the stdio ptr..." >&4
12791 /* Can we scream? */
12792 /* Eat dust sed :-) */
12793 /* In the buffer space, no one can hear you scream. */
12794 #$i_stdlib I_STDLIB
12796 #include <stdlib.h>
12798 #define FILE_ptr(fp) $stdio_ptr
12799 #define FILE_cnt(fp) $stdio_cnt
12800 #include <sys/types.h>
12802 FILE *fp = fopen("try.c", "r");
12807 puts("Fail even to read");
12810 c = getc(fp); /* Read away the first # */
12812 puts("Fail even to read");
12816 18 <= FILE_cnt(fp) &&
12817 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12819 puts("Fail even to read");
12822 ptr = (char*) FILE_ptr(fp);
12823 cnt = (size_t)FILE_cnt(fp);
12825 FILE_ptr(fp) += 42;
12827 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12828 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12831 if (FILE_cnt(fp) <= 20) {
12832 printf ("Fail (<20 chars to test)");
12835 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12836 puts("Fail compare");
12839 if (cnt == FILE_cnt(fp)) {
12840 puts("Pass_unchanged");
12843 if (FILE_cnt(fp) == (cnt - 42)) {
12844 puts("Pass_changed");
12847 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12853 if eval $compile && $to try.c; then
12854 case `$run ./try` in
12856 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12857 d_stdio_ptr_lval_sets_cnt="$define" ;;
12859 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12860 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12862 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12864 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12867 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12873 : see if _base is also standard
12875 case "$d_stdstdio" in
12879 #$i_stdlib I_STDLIB
12881 #include <stdlib.h>
12883 #define FILE_base(fp) $stdio_base
12884 #define FILE_bufsiz(fp) $stdio_bufsiz
12886 FILE *fp = fopen("try.c", "r");
12889 19 <= FILE_bufsiz(fp) &&
12890 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12897 if eval $compile && $to try.c; then
12898 if $run ./try; then
12899 echo "And its _base field acts std."
12902 echo "But its _base field isn't std."
12905 echo "However, it seems to be lacking the _base field."
12913 : see if fast_stdio exists
12915 case "$d_stdstdio:$d_stdio_ptr_lval" in
12917 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12919 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12930 : see if fchdir exists
12931 set fchdir d_fchdir
12934 : see if fchmod exists
12935 set fchmod d_fchmod
12938 : see if fchown exists
12939 set fchown d_fchown
12942 : see if this is an fcntl system
12946 : See if fcntl-based locking works.
12949 #$i_stdlib I_STDLIB
12951 #include <stdlib.h>
12953 #include <unistd.h>
12955 #include <signal.h>
12956 $signal_t blech(int x) { exit(3); }
12958 #if defined(F_SETLK) && defined(F_SETLKW)
12959 struct flock flock;
12961 fd = open("try.c", O_RDONLY);
12962 flock.l_type = F_RDLCK;
12963 flock.l_whence = SEEK_SET;
12964 flock.l_start = flock.l_len = 0;
12965 signal(SIGALRM, blech);
12967 retval = fcntl(fd, F_SETLK, &flock);
12969 (retval < 0 ? exit(2) : exit(0));
12975 echo "Checking if fcntl-based file locking works... "
12979 if eval $compile_ok; then
12980 if $run ./try; then
12981 echo "Yes, it seems to work."
12984 echo "Nope, it didn't work."
12989 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12990 *** This is (almost) impossible.
12991 *** If your NFS lock daemons are not feeling well, something like
12992 *** this may happen, please investigate. Cannot continue, aborting.
13000 echo "I'm unable to compile the test program, so I'll assume not."
13005 echo "Nope, since you don't even have fcntl()."
13008 set d_fcntl_can_lock
13012 : check for fd_set items
13015 Checking to see how well your C compiler handles fd_set and friends ...
13018 #$i_stdlib I_STDLIB
13020 #include <stdlib.h>
13022 #$i_systime I_SYS_TIME
13023 #$i_sysselct I_SYS_SELECT
13024 #$d_socket HAS_SOCKET
13025 #include <sys/types.h>
13027 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13030 #include <sys/time.h>
13032 #ifdef I_SYS_SELECT
13033 #include <sys/select.h>
13042 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13050 if eval $compile; then
13051 d_fds_bits="$define"
13053 echo "Well, your system knows about the normal fd_set typedef..." >&4
13054 if $run ./try; then
13055 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13056 d_fd_macros="$define"
13059 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13061 d_fd_macros="$undef"
13065 Hmm, your compiler has some difficulty with fd_set. Checking further...
13068 if eval $compile; then
13069 d_fds_bits="$undef"
13071 echo "Well, your system has some sort of fd_set available..." >&4
13072 if $run ./try; then
13073 echo "and you have the normal fd_set macros." >&4
13074 d_fd_macros="$define"
13077 but not the normal fd_set macros! Gross! More work for me...
13079 d_fd_macros="$undef"
13082 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13084 d_fds_bits="$undef"
13085 d_fd_macros="$undef"
13090 : see if fgetpos exists
13091 set fgetpos d_fgetpos
13094 : see if finite exists
13095 set finite d_finite
13098 : see if finitel exists
13099 set finitel d_finitel
13102 : see if flock exists
13106 : see if prototype for flock is available
13108 set d_flockproto flock $i_sysfile sys/file.h
13111 : see if fp_class exists
13112 set fp_class d_fp_class
13115 : see if pathconf exists
13116 set pathconf d_pathconf
13119 : see if fpathconf exists
13120 set fpathconf d_fpathconf
13123 : see if fpclass exists
13124 set fpclass d_fpclass
13127 : see if fpclassify exists
13128 set fpclassify d_fpclassify
13131 : see if fpclassl exists
13132 set fpclassl d_fpclassl
13135 : check for fpos64_t
13137 echo "Checking to see if you have fpos64_t..." >&4
13140 int main() { fpos64_t x = 7; }
13143 if eval $compile; then
13145 echo "You have fpos64_t."
13148 echo "You do not have fpos64_t."
13149 case "$fpossize" in
13150 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13157 : see if frexpl exists
13158 set frexpl d_frexpl
13161 : see if this is a sys/param system
13162 set sys/param.h i_sysparam
13165 : see if this is a sys/mount.h system
13166 set sys/mount.h i_sysmount
13169 : Check for fs_data_s
13171 echo "Checking to see if your system supports struct fs_data..." >&4
13172 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13174 case "$d_fs_data_s" in
13175 "$define") echo "Yes, it does." ;;
13176 *) echo "No, it doesn't." ;;
13179 : see if fseeko exists
13180 set fseeko d_fseeko
13182 case "$longsize" in
13183 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13186 : see if fsetpos exists
13187 set fsetpos d_fsetpos
13190 : see if fstatfs exists
13191 set fstatfs d_fstatfs
13194 : see if statvfs exists
13195 set statvfs d_statvfs
13198 : see if fstatvfs exists
13199 set fstatvfs d_fstatvfs
13203 : see if fsync exists
13207 : see if ftello exists
13208 set ftello d_ftello
13210 case "$longsize" in
13211 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13214 : check for a working futimes
13217 echo "Checking if you have a working futimes()" >&4
13220 #include <sys/time.h>
13227 fd = open ("try.c", O_RDWR);
13228 if (-1 == fd) exit (1);
13229 rv = futimes (fd, NULL);
13230 exit (rv == -1 ? errno : 0);
13234 if eval $compile; then
13238 0) echo "Yes, you have" >&4
13239 d_futimes="$define"
13241 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13245 echo "No, it does not (probably harmless)" >&4
13249 : see if getcwd exists
13250 set getcwd d_getcwd
13253 : see if getespwnam exists
13254 set getespwnam d_getespwnam
13257 : see if getfsstat exists
13258 set getfsstat d_getfsstat
13261 : see if getgrent exists
13262 set getgrent d_getgrent
13265 : see if getgrent_r exists
13266 set getgrent_r d_getgrent_r
13268 case "$d_getgrent_r" in
13270 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13271 case "$d_getgrent_r_proto:$usethreads" in
13272 ":define") d_getgrent_r_proto=define
13273 set d_getgrent_r_proto getgrent_r $hdrs
13277 case "$d_getgrent_r_proto" in
13279 case "$getgrent_r_proto" in
13280 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13281 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13283 case "$getgrent_r_proto" in
13284 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13285 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13287 case "$getgrent_r_proto" in
13288 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13289 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13291 case "$getgrent_r_proto" in
13292 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13293 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13295 case "$getgrent_r_proto" in
13296 ''|0) try='int getgrent_r(struct group*, char*, int);'
13297 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13299 case "$getgrent_r_proto" in
13300 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13301 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13303 case "$getgrent_r_proto" in
13304 ''|0) d_getgrent_r=undef
13306 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13307 * ) case "$getgrent_r_proto" in
13308 REENTRANT_PROTO*) ;;
13309 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13311 echo "Prototype: $try" ;;
13314 *) case "$usethreads" in
13315 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13322 *) getgrent_r_proto=0
13326 : see if getgrgid_r exists
13327 set getgrgid_r d_getgrgid_r
13329 case "$d_getgrgid_r" in
13331 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13332 case "$d_getgrgid_r_proto:$usethreads" in
13333 ":define") d_getgrgid_r_proto=define
13334 set d_getgrgid_r_proto getgrgid_r $hdrs
13338 case "$d_getgrgid_r_proto" in
13340 case "$getgrgid_r_proto" in
13341 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13342 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13344 case "$getgrgid_r_proto" in
13345 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13346 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13348 case "$getgrgid_r_proto" in
13349 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13350 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13352 case "$getgrgid_r_proto" in
13353 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13354 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13356 case "$getgrgid_r_proto" in
13357 ''|0) d_getgrgid_r=undef
13359 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13360 * ) case "$getgrgid_r_proto" in
13361 REENTRANT_PROTO*) ;;
13362 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13364 echo "Prototype: $try" ;;
13367 *) case "$usethreads" in
13368 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13375 *) getgrgid_r_proto=0
13379 : see if getgrnam_r exists
13380 set getgrnam_r d_getgrnam_r
13382 case "$d_getgrnam_r" in
13384 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13385 case "$d_getgrnam_r_proto:$usethreads" in
13386 ":define") d_getgrnam_r_proto=define
13387 set d_getgrnam_r_proto getgrnam_r $hdrs
13391 case "$d_getgrnam_r_proto" in
13393 case "$getgrnam_r_proto" in
13394 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13395 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13397 case "$getgrnam_r_proto" in
13398 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13399 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13401 case "$getgrnam_r_proto" in
13402 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13403 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13405 case "$getgrnam_r_proto" in
13406 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13407 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13409 case "$getgrnam_r_proto" in
13410 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13411 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13413 case "$getgrnam_r_proto" in
13414 ''|0) d_getgrnam_r=undef
13416 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13417 * ) case "$getgrnam_r_proto" in
13418 REENTRANT_PROTO*) ;;
13419 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13421 echo "Prototype: $try" ;;
13424 *) case "$usethreads" in
13425 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13432 *) getgrnam_r_proto=0
13436 : see if gethostbyaddr exists
13437 set gethostbyaddr d_gethbyaddr
13440 : see if gethostbyname exists
13441 set gethostbyname d_gethbyname
13444 : see if gethostent exists
13445 set gethostent d_gethent
13448 : see how we will look up host name
13451 if set gethostname val -f d_gethname; eval $csym; $val; then
13452 echo 'gethostname() found.' >&4
13453 d_gethname="$define"
13456 if set uname val -f d_uname; eval $csym; $val; then
13459 uname() was found, but you're running xenix, and older versions of xenix
13460 have a broken uname(). If you don't really know whether your xenix is old
13461 enough to have a broken system call, use the default answer.
13466 "$define") dflt=n;;
13468 rp='Is your uname() broken?'
13471 n*) d_uname="$define"; call=uname;;
13474 echo 'uname() found.' >&4
13481 case "$d_gethname" in
13482 '') d_gethname="$undef";;
13485 '') d_uname="$undef";;
13487 case "$d_uname$d_gethname" in
13492 Every now and then someone has a $call() that lies about the hostname
13493 but can't be fixed for political or economic reasons. If you wish, I can
13494 pretend $call() isn't there and maybe compute hostname at run-time
13495 thanks to the '$phostname' command.
13498 rp="Shall I ignore $call() from now on?"
13501 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13504 case "$phostname" in
13505 '') aphostname='';;
13506 *) case "$aphostname" in
13508 *) set X $phostname
13512 file=`./loc $file $file $pth`
13513 aphostname=`echo $file $*`
13518 case "$d_uname$d_gethname" in
13521 case "$phostname" in
13523 echo "There will be no way for $package to get your hostname." >&4;;
13525 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13529 case "$d_phostname" in
13530 '') d_phostname="$undef";;
13533 : see if gethostbyaddr_r exists
13534 set gethostbyaddr_r d_gethostbyaddr_r
13536 case "$d_gethostbyaddr_r" in
13538 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13539 case "$d_gethostbyaddr_r_proto:$usethreads" in
13540 ":define") d_gethostbyaddr_r_proto=define
13541 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13545 case "$d_gethostbyaddr_r_proto" in
13547 case "$gethostbyaddr_r_proto" in
13548 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13549 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13551 case "$gethostbyaddr_r_proto" in
13552 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13553 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13555 case "$gethostbyaddr_r_proto" in
13556 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13557 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13559 case "$gethostbyaddr_r_proto" in
13560 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13561 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13563 case "$gethostbyaddr_r_proto" in
13564 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13565 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13567 case "$gethostbyaddr_r_proto" in
13568 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13569 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13571 case "$gethostbyaddr_r_proto" in
13572 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13573 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13575 case "$gethostbyaddr_r_proto" in
13576 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13577 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13579 case "$gethostbyaddr_r_proto" in
13580 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13581 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13583 case "$gethostbyaddr_r_proto" in
13584 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13585 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13587 case "$gethostbyaddr_r_proto" in
13588 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13589 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13591 case "$gethostbyaddr_r_proto" in
13592 ''|0) d_gethostbyaddr_r=undef
13593 gethostbyaddr_r_proto=0
13594 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13595 * ) case "$gethostbyaddr_r_proto" in
13596 REENTRANT_PROTO*) ;;
13597 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13599 echo "Prototype: $try" ;;
13602 *) case "$usethreads" in
13603 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13605 d_gethostbyaddr_r=undef
13606 gethostbyaddr_r_proto=0
13610 *) gethostbyaddr_r_proto=0
13614 : see if gethostbyname_r exists
13615 set gethostbyname_r d_gethostbyname_r
13617 case "$d_gethostbyname_r" in
13619 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13620 case "$d_gethostbyname_r_proto:$usethreads" in
13621 ":define") d_gethostbyname_r_proto=define
13622 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13626 case "$d_gethostbyname_r_proto" in
13628 case "$gethostbyname_r_proto" in
13629 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13630 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13632 case "$gethostbyname_r_proto" in
13633 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13634 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13636 case "$gethostbyname_r_proto" in
13637 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13638 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13640 case "$gethostbyname_r_proto" in
13641 ''|0) d_gethostbyname_r=undef
13642 gethostbyname_r_proto=0
13643 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13644 * ) case "$gethostbyname_r_proto" in
13645 REENTRANT_PROTO*) ;;
13646 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13648 echo "Prototype: $try" ;;
13651 *) case "$usethreads" in
13652 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13654 d_gethostbyname_r=undef
13655 gethostbyname_r_proto=0
13659 *) gethostbyname_r_proto=0
13663 : see if gethostent_r exists
13664 set gethostent_r d_gethostent_r
13666 case "$d_gethostent_r" in
13668 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13669 case "$d_gethostent_r_proto:$usethreads" in
13670 ":define") d_gethostent_r_proto=define
13671 set d_gethostent_r_proto gethostent_r $hdrs
13675 case "$d_gethostent_r_proto" in
13677 case "$gethostent_r_proto" in
13678 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13679 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13681 case "$gethostent_r_proto" in
13682 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13683 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13685 case "$gethostent_r_proto" in
13686 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13687 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13689 case "$gethostent_r_proto" in
13690 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13691 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13693 case "$gethostent_r_proto" in
13694 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13695 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13697 case "$gethostent_r_proto" in
13698 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13699 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13701 case "$gethostent_r_proto" in
13702 ''|0) d_gethostent_r=undef
13703 gethostent_r_proto=0
13704 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13705 * ) case "$gethostent_r_proto" in
13706 REENTRANT_PROTO*) ;;
13707 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13709 echo "Prototype: $try" ;;
13712 *) case "$usethreads" in
13713 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13715 d_gethostent_r=undef
13716 gethostent_r_proto=0
13720 *) gethostent_r_proto=0
13724 : see if prototypes for various gethostxxx netdb.h functions are available
13726 set d_gethostprotos gethostent $i_netdb netdb.h
13729 : see if getitimer exists
13730 set getitimer d_getitimer
13733 : see if getlogin exists
13734 set getlogin d_getlogin
13737 : see if getlogin_r exists
13738 set getlogin_r d_getlogin_r
13740 case "$d_getlogin_r" in
13742 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13743 case "$d_getlogin_r_proto:$usethreads" in
13744 ":define") d_getlogin_r_proto=define
13745 set d_getlogin_r_proto getlogin_r $hdrs
13749 case "$d_getlogin_r_proto" in
13751 case "$getlogin_r_proto" in
13752 ''|0) try='int getlogin_r(char*, size_t);'
13753 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13755 case "$getlogin_r_proto" in
13756 ''|0) try='int getlogin_r(char*, int);'
13757 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13759 case "$getlogin_r_proto" in
13760 ''|0) try='char* getlogin_r(char*, size_t);'
13761 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13763 case "$getlogin_r_proto" in
13764 ''|0) try='char* getlogin_r(char*, int);'
13765 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13767 case "$getlogin_r_proto" in
13768 ''|0) d_getlogin_r=undef
13770 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13771 * ) case "$getlogin_r_proto" in
13772 REENTRANT_PROTO*) ;;
13773 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13775 echo "Prototype: $try" ;;
13778 *) case "$usethreads" in
13779 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13786 *) getlogin_r_proto=0
13790 : see if getmnt exists
13791 set getmnt d_getmnt
13794 : see if getmntent exists
13795 set getmntent d_getmntent
13798 : see if getnetbyaddr exists
13799 set getnetbyaddr d_getnbyaddr
13802 : see if getnetbyname exists
13803 set getnetbyname d_getnbyname
13806 : see if getnetent exists
13807 set getnetent d_getnent
13810 : see if getnetbyaddr_r exists
13811 set getnetbyaddr_r d_getnetbyaddr_r
13813 case "$d_getnetbyaddr_r" in
13815 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13816 case "$d_getnetbyaddr_r_proto:$usethreads" in
13817 ":define") d_getnetbyaddr_r_proto=define
13818 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13822 case "$d_getnetbyaddr_r_proto" in
13824 case "$getnetbyaddr_r_proto" in
13825 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13826 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13828 case "$getnetbyaddr_r_proto" in
13829 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13830 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13832 case "$getnetbyaddr_r_proto" in
13833 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13834 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13836 case "$getnetbyaddr_r_proto" in
13837 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13838 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13840 case "$getnetbyaddr_r_proto" in
13841 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13842 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13844 case "$getnetbyaddr_r_proto" in
13845 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13846 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13848 case "$getnetbyaddr_r_proto" in
13849 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13850 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13852 case "$getnetbyaddr_r_proto" in
13853 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13854 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13856 case "$getnetbyaddr_r_proto" in
13857 ''|0) d_getnetbyaddr_r=undef
13858 getnetbyaddr_r_proto=0
13859 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13860 * ) case "$getnetbyaddr_r_proto" in
13861 REENTRANT_PROTO*) ;;
13862 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13864 echo "Prototype: $try" ;;
13867 *) case "$usethreads" in
13868 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13870 d_getnetbyaddr_r=undef
13871 getnetbyaddr_r_proto=0
13875 *) getnetbyaddr_r_proto=0
13879 : see if getnetbyname_r exists
13880 set getnetbyname_r d_getnetbyname_r
13882 case "$d_getnetbyname_r" in
13884 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13885 case "$d_getnetbyname_r_proto:$usethreads" in
13886 ":define") d_getnetbyname_r_proto=define
13887 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13891 case "$d_getnetbyname_r_proto" in
13893 case "$getnetbyname_r_proto" in
13894 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13895 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13897 case "$getnetbyname_r_proto" in
13898 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13899 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13901 case "$getnetbyname_r_proto" in
13902 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13903 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13905 case "$getnetbyname_r_proto" in
13906 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13907 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13909 case "$getnetbyname_r_proto" in
13910 ''|0) d_getnetbyname_r=undef
13911 getnetbyname_r_proto=0
13912 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13913 * ) case "$getnetbyname_r_proto" in
13914 REENTRANT_PROTO*) ;;
13915 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13917 echo "Prototype: $try" ;;
13920 *) case "$usethreads" in
13921 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13923 d_getnetbyname_r=undef
13924 getnetbyname_r_proto=0
13928 *) getnetbyname_r_proto=0
13932 : see if getnetent_r exists
13933 set getnetent_r d_getnetent_r
13935 case "$d_getnetent_r" in
13937 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13938 case "$d_getnetent_r_proto:$usethreads" in
13939 ":define") d_getnetent_r_proto=define
13940 set d_getnetent_r_proto getnetent_r $hdrs
13944 case "$d_getnetent_r_proto" in
13946 case "$getnetent_r_proto" in
13947 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13948 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13950 case "$getnetent_r_proto" in
13951 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13952 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13954 case "$getnetent_r_proto" in
13955 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13956 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13958 case "$getnetent_r_proto" in
13959 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13960 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13962 case "$getnetent_r_proto" in
13963 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13964 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13966 case "$getnetent_r_proto" in
13967 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13968 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13970 case "$getnetent_r_proto" in
13971 ''|0) d_getnetent_r=undef
13972 getnetent_r_proto=0
13973 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13974 * ) case "$getnetent_r_proto" in
13975 REENTRANT_PROTO*) ;;
13976 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13978 echo "Prototype: $try" ;;
13981 *) case "$usethreads" in
13982 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13984 d_getnetent_r=undef
13985 getnetent_r_proto=0
13989 *) getnetent_r_proto=0
13993 : see if prototypes for various getnetxxx netdb.h functions are available
13995 set d_getnetprotos getnetent $i_netdb netdb.h
13998 : see if getpagesize exists
13999 set getpagesize d_getpagsz
14002 : Optional checks for getprotobyname and getprotobynumber
14004 : see if getprotobyname exists
14005 set getprotobyname d_getpbyname
14008 : see if getprotobynumber exists
14009 set getprotobynumber d_getpbynumber
14012 : see if getprotoent exists
14013 set getprotoent d_getpent
14016 : see if getpgid exists
14017 set getpgid d_getpgid
14020 : see if getpgrp2 exists
14021 set getpgrp2 d_getpgrp2
14024 : see if getppid exists
14025 set getppid d_getppid
14028 : see if getpriority exists
14029 set getpriority d_getprior
14032 : see if getprotobyname_r exists
14033 set getprotobyname_r d_getprotobyname_r
14035 case "$d_getprotobyname_r" in
14037 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14038 case "$d_getprotobyname_r_proto:$usethreads" in
14039 ":define") d_getprotobyname_r_proto=define
14040 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14044 case "$d_getprotobyname_r_proto" in
14046 case "$getprotobyname_r_proto" in
14047 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14048 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14050 case "$getprotobyname_r_proto" in
14051 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14052 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14054 case "$getprotobyname_r_proto" in
14055 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14056 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14058 case "$getprotobyname_r_proto" in
14059 ''|0) d_getprotobyname_r=undef
14060 getprotobyname_r_proto=0
14061 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14062 * ) case "$getprotobyname_r_proto" in
14063 REENTRANT_PROTO*) ;;
14064 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14066 echo "Prototype: $try" ;;
14069 *) case "$usethreads" in
14070 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14072 d_getprotobyname_r=undef
14073 getprotobyname_r_proto=0
14077 *) getprotobyname_r_proto=0
14081 : see if getprotobynumber_r exists
14082 set getprotobynumber_r d_getprotobynumber_r
14084 case "$d_getprotobynumber_r" in
14086 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14087 case "$d_getprotobynumber_r_proto:$usethreads" in
14088 ":define") d_getprotobynumber_r_proto=define
14089 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14093 case "$d_getprotobynumber_r_proto" in
14095 case "$getprotobynumber_r_proto" in
14096 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14097 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14099 case "$getprotobynumber_r_proto" in
14100 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14101 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14103 case "$getprotobynumber_r_proto" in
14104 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14105 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14107 case "$getprotobynumber_r_proto" in
14108 ''|0) d_getprotobynumber_r=undef
14109 getprotobynumber_r_proto=0
14110 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14111 * ) case "$getprotobynumber_r_proto" in
14112 REENTRANT_PROTO*) ;;
14113 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14115 echo "Prototype: $try" ;;
14118 *) case "$usethreads" in
14119 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14121 d_getprotobynumber_r=undef
14122 getprotobynumber_r_proto=0
14126 *) getprotobynumber_r_proto=0
14130 : see if getprotoent_r exists
14131 set getprotoent_r d_getprotoent_r
14133 case "$d_getprotoent_r" in
14135 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14136 case "$d_getprotoent_r_proto:$usethreads" in
14137 ":define") d_getprotoent_r_proto=define
14138 set d_getprotoent_r_proto getprotoent_r $hdrs
14142 case "$d_getprotoent_r_proto" in
14144 case "$getprotoent_r_proto" in
14145 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14146 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14148 case "$getprotoent_r_proto" in
14149 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14150 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14152 case "$getprotoent_r_proto" in
14153 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14154 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14156 case "$getprotoent_r_proto" in
14157 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14158 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14160 case "$getprotoent_r_proto" in
14161 ''|0) d_getprotoent_r=undef
14162 getprotoent_r_proto=0
14163 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14164 * ) case "$getprotoent_r_proto" in
14165 REENTRANT_PROTO*) ;;
14166 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14168 echo "Prototype: $try" ;;
14171 *) case "$usethreads" in
14172 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14174 d_getprotoent_r=undef
14175 getprotoent_r_proto=0
14179 *) getprotoent_r_proto=0
14183 : see if prototypes for various getprotoxxx netdb.h functions are available
14185 set d_getprotoprotos getprotoent $i_netdb netdb.h
14188 : see if getprpwnam exists
14189 set getprpwnam d_getprpwnam
14192 : see if getpwent exists
14193 set getpwent d_getpwent
14196 : see if getpwent_r exists
14197 set getpwent_r d_getpwent_r
14199 case "$d_getpwent_r" in
14201 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14202 case "$d_getpwent_r_proto:$usethreads" in
14203 ":define") d_getpwent_r_proto=define
14204 set d_getpwent_r_proto getpwent_r $hdrs
14208 case "$d_getpwent_r_proto" in
14210 case "$getpwent_r_proto" in
14211 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14212 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14214 case "$getpwent_r_proto" in
14215 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14216 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14218 case "$getpwent_r_proto" in
14219 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14220 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14222 case "$getpwent_r_proto" in
14223 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14224 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14226 case "$getpwent_r_proto" in
14227 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14228 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14230 case "$getpwent_r_proto" in
14231 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14232 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14234 case "$getpwent_r_proto" in
14235 ''|0) d_getpwent_r=undef
14237 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14238 * ) case "$getpwent_r_proto" in
14239 REENTRANT_PROTO*) ;;
14240 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14242 echo "Prototype: $try" ;;
14245 *) case "$usethreads" in
14246 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14253 *) getpwent_r_proto=0
14257 : see if getpwnam_r exists
14258 set getpwnam_r d_getpwnam_r
14260 case "$d_getpwnam_r" in
14262 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14263 case "$d_getpwnam_r_proto:$usethreads" in
14264 ":define") d_getpwnam_r_proto=define
14265 set d_getpwnam_r_proto getpwnam_r $hdrs
14269 case "$d_getpwnam_r_proto" in
14271 case "$getpwnam_r_proto" in
14272 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14273 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14275 case "$getpwnam_r_proto" in
14276 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14277 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14279 case "$getpwnam_r_proto" in
14280 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14281 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14283 case "$getpwnam_r_proto" in
14284 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14285 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14287 case "$getpwnam_r_proto" in
14288 ''|0) d_getpwnam_r=undef
14290 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14291 * ) case "$getpwnam_r_proto" in
14292 REENTRANT_PROTO*) ;;
14293 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14295 echo "Prototype: $try" ;;
14298 *) case "$usethreads" in
14299 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14306 *) getpwnam_r_proto=0
14310 : see if getpwuid_r exists
14311 set getpwuid_r d_getpwuid_r
14313 case "$d_getpwuid_r" in
14315 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14316 case "$d_getpwuid_r_proto:$usethreads" in
14317 ":define") d_getpwuid_r_proto=define
14318 set d_getpwuid_r_proto getpwuid_r $hdrs
14322 case "$d_getpwuid_r_proto" in
14324 case "$getpwuid_r_proto" in
14325 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14326 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14328 case "$getpwuid_r_proto" in
14329 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14330 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14332 case "$getpwuid_r_proto" in
14333 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14334 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14336 case "$getpwuid_r_proto" in
14337 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14338 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14340 case "$getpwuid_r_proto" in
14341 ''|0) d_getpwuid_r=undef
14343 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14344 * ) case "$getpwuid_r_proto" in
14345 REENTRANT_PROTO*) ;;
14346 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14348 echo "Prototype: $try" ;;
14351 *) case "$usethreads" in
14352 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14359 *) getpwuid_r_proto=0
14363 : Optional checks for getsbyname and getsbyport
14365 : see if getservbyname exists
14366 set getservbyname d_getsbyname
14369 : see if getservbyport exists
14370 set getservbyport d_getsbyport
14373 : see if getservent exists
14374 set getservent d_getsent
14377 : see if getservbyname_r exists
14378 set getservbyname_r d_getservbyname_r
14380 case "$d_getservbyname_r" in
14382 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14383 case "$d_getservbyname_r_proto:$usethreads" in
14384 ":define") d_getservbyname_r_proto=define
14385 set d_getservbyname_r_proto getservbyname_r $hdrs
14389 case "$d_getservbyname_r_proto" in
14391 case "$getservbyname_r_proto" in
14392 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14393 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14395 case "$getservbyname_r_proto" in
14396 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14397 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14399 case "$getservbyname_r_proto" in
14400 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14401 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14403 case "$getservbyname_r_proto" in
14404 ''|0) d_getservbyname_r=undef
14405 getservbyname_r_proto=0
14406 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14407 * ) case "$getservbyname_r_proto" in
14408 REENTRANT_PROTO*) ;;
14409 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14411 echo "Prototype: $try" ;;
14414 *) case "$usethreads" in
14415 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14417 d_getservbyname_r=undef
14418 getservbyname_r_proto=0
14422 *) getservbyname_r_proto=0
14426 : see if getservbyport_r exists
14427 set getservbyport_r d_getservbyport_r
14429 case "$d_getservbyport_r" in
14431 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14432 case "$d_getservbyport_r_proto:$usethreads" in
14433 ":define") d_getservbyport_r_proto=define
14434 set d_getservbyport_r_proto getservbyport_r $hdrs
14438 case "$d_getservbyport_r_proto" in
14440 case "$getservbyport_r_proto" in
14441 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14442 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14444 case "$getservbyport_r_proto" in
14445 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14446 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14448 case "$getservbyport_r_proto" in
14449 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14450 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14452 case "$getservbyport_r_proto" in
14453 ''|0) d_getservbyport_r=undef
14454 getservbyport_r_proto=0
14455 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14456 * ) case "$getservbyport_r_proto" in
14457 REENTRANT_PROTO*) ;;
14458 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14460 echo "Prototype: $try" ;;
14463 *) case "$usethreads" in
14464 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14466 d_getservbyport_r=undef
14467 getservbyport_r_proto=0
14471 *) getservbyport_r_proto=0
14475 : see if getservent_r exists
14476 set getservent_r d_getservent_r
14478 case "$d_getservent_r" in
14480 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14481 case "$d_getservent_r_proto:$usethreads" in
14482 ":define") d_getservent_r_proto=define
14483 set d_getservent_r_proto getservent_r $hdrs
14487 case "$d_getservent_r_proto" in
14489 case "$getservent_r_proto" in
14490 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14491 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14493 case "$getservent_r_proto" in
14494 ''|0) try='int getservent_r(struct servent*, char*, int);'
14495 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14497 case "$getservent_r_proto" in
14498 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14499 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14501 case "$getservent_r_proto" in
14502 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14503 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14505 case "$getservent_r_proto" in
14506 ''|0) d_getservent_r=undef
14507 getservent_r_proto=0
14508 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14509 * ) case "$getservent_r_proto" in
14510 REENTRANT_PROTO*) ;;
14511 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14513 echo "Prototype: $try" ;;
14516 *) case "$usethreads" in
14517 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14519 d_getservent_r=undef
14520 getservent_r_proto=0
14524 *) getservent_r_proto=0
14528 : see if prototypes for various getservxxx netdb.h functions are available
14530 set d_getservprotos getservent $i_netdb netdb.h
14533 : see if getspnam exists
14534 set getspnam d_getspnam
14537 : see if this is a shadow.h system
14538 set shadow.h i_shadow
14541 : see if getspnam_r exists
14542 set getspnam_r d_getspnam_r
14544 case "$d_getspnam_r" in
14546 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14547 case "$d_getspnam_r_proto:$usethreads" in
14548 ":define") d_getspnam_r_proto=define
14549 set d_getspnam_r_proto getspnam_r $hdrs
14553 case "$d_getspnam_r_proto" in
14555 case "$getspnam_r_proto" in
14556 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14557 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14559 case "$getspnam_r_proto" in
14560 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14561 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14563 case "$getspnam_r_proto" in
14564 ''|0) d_getspnam_r=undef
14566 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14567 * ) case "$getspnam_r_proto" in
14568 REENTRANT_PROTO*) ;;
14569 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14571 echo "Prototype: $try" ;;
14574 *) case "$usethreads" in
14575 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14582 *) getspnam_r_proto=0
14586 : see if gettimeofday or ftime exists
14587 set gettimeofday d_gettimeod
14589 case "$d_gettimeod" in
14595 val="$undef"; set d_ftime; eval $setvar
14598 case "$d_gettimeod$d_ftime" in
14601 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14605 : see if gmtime_r exists
14606 set gmtime_r d_gmtime_r
14608 case "$d_gmtime_r" in
14610 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14611 case "$d_gmtime_r_proto:$usethreads" in
14612 ":define") d_gmtime_r_proto=define
14613 set d_gmtime_r_proto gmtime_r $hdrs
14617 case "$d_gmtime_r_proto" in
14619 case "$gmtime_r_proto" in
14620 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14621 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14623 case "$gmtime_r_proto" in
14624 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14625 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14627 case "$gmtime_r_proto" in
14628 ''|0) d_gmtime_r=undef
14630 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14631 * ) case "$gmtime_r_proto" in
14632 REENTRANT_PROTO*) ;;
14633 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14635 echo "Prototype: $try" ;;
14638 *) case "$usethreads" in
14639 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14646 *) gmtime_r_proto=0
14650 : see if hasmntopt exists
14651 set hasmntopt d_hasmntopt
14654 : see if this is a netinet/in.h or sys/in.h system
14655 set netinet/in.h i_niin sys/in.h i_sysin
14658 : see if arpa/inet.h has to be included
14659 set arpa/inet.h i_arpainet
14662 : see if htonl --and friends-- exists
14667 : Maybe they are macros.
14670 $cat >htonl.c <<EOM
14672 #include <sys/types.h>
14673 #$i_niin I_NETINET_IN
14675 #$i_arpainet I_ARPA_INET
14676 #ifdef I_NETINET_IN
14677 #include <netinet/in.h>
14680 #include <sys/in.h>
14683 #include <arpa/inet.h>
14686 printf("Defined as a macro.");
14689 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14690 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14692 echo "But it seems to be defined as a macro." >&4
14700 : see if ilogbl exists
14701 set ilogbl d_ilogbl
14706 if set index val -f; eval $csym; $val; then
14707 if set strchr val -f d_strchr; eval $csym; $val; then
14708 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14711 echo "strchr() found." >&4
14715 echo "index() found." >&4
14720 echo "index() found." >&4
14723 if set strchr val -f d_strchr; eval $csym; $val; then
14726 echo "strchr() found." >&4
14728 echo "No index() or strchr() found!" >&4
14733 set d_strchr; eval $setvar
14735 set d_index; eval $setvar
14737 : check whether inet_aton exists
14738 set inet_aton d_inetaton
14743 $cat >isascii.c <<EOCP
14746 #$i_stdlib I_STDLIB
14748 #include <stdlib.h>
14759 if eval $compile; then
14760 echo "isascii() found." >&4
14763 echo "isascii() NOT found." >&4
14770 : see if isfinite exists
14771 set isfinite d_isfinite
14774 : see if isinf exists
14778 : see if isnan exists
14782 : see if isnanl exists
14783 set isnanl d_isnanl
14786 : see if killpg exists
14787 set killpg d_killpg
14790 : see if lchown exists
14792 $cat > try.c <<'EOCP'
14793 /* System header to define __stub macros and hopefully few prototypes,
14794 which can conflict with char lchown(); below. */
14795 #include <assert.h>
14796 /* Override any gcc2 internal prototype to avoid an error. */
14797 /* We use char because int might match the return type of a gcc2
14798 builtin and then its argument prototype would still apply. */
14801 /* The GNU C library defines this for functions which it implements
14802 to always fail with ENOSYS. Some functions are actually named
14803 something starting with __ and the normal name is an alias. */
14804 #if defined (__stub_lchown) || defined (__stub___lchown)
14812 if eval $compile; then
14813 $echo "lchown() found." >&4
14816 $echo "lchown() NOT found." >&4
14822 : See if number of significant digits in a double precision number is known
14824 $cat >ldbl_dig.c <<EOM
14825 #$i_limits I_LIMITS
14828 #include <limits.h>
14834 printf("Contains LDBL_DIG");
14837 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14838 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14839 echo "LDBL_DIG found." >&4
14842 echo "LDBL_DIG NOT found." >&4
14849 : see if this is a math.h system
14853 : check to see if math.h defines _LIB_VERSION
14854 d_libm_lib_version="$undef"
14858 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14860 #include <unistd.h>
14862 int main (int argc, char *argv[])
14864 printf ("%d\n", _LIB_VERSION);
14869 if eval $compile; then
14871 echo "Yes, it does ($foo)" >&4
14872 d_libm_lib_version="$define"
14874 echo "No, it does not (probably harmless)" >&4
14881 : see if link exists
14885 : see if localtime_r exists
14886 set localtime_r d_localtime_r
14888 case "$d_localtime_r" in
14890 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14891 case "$d_localtime_r_proto:$usethreads" in
14892 ":define") d_localtime_r_proto=define
14893 set d_localtime_r_proto localtime_r $hdrs
14897 case "$d_localtime_r_proto" in
14899 case "$localtime_r_proto" in
14900 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14901 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14903 case "$localtime_r_proto" in
14904 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14905 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14907 case "$localtime_r_proto" in
14908 ''|0) d_localtime_r=undef
14909 localtime_r_proto=0
14910 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14911 * ) case "$localtime_r_proto" in
14912 REENTRANT_PROTO*) ;;
14913 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14915 echo "Prototype: $try" ;;
14918 *) case "$usethreads" in
14919 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14921 d_localtime_r=undef
14922 localtime_r_proto=0
14926 *) localtime_r_proto=0
14930 : see if localtime_r calls tzset
14931 case "$localtime_r_proto" in
14934 /* Does our libc's localtime_r call tzset ?
14935 * return 0 if so, 1 otherwise.
14937 #include <sys/types.h>
14938 #include <unistd.h>
14940 #include <string.h>
14941 #include <malloc.h>
14944 time_t t = time(0L);
14945 char w_tz[]="TZ" "=GMT+5",
14946 e_tz[]="TZ" "=GMT-5",
14947 *tz_e = (char*)malloc(16),
14948 *tz_w = (char*)malloc(16);
14949 struct tm tm_e, tm_w;
14950 memset(&tm_e,'\0',sizeof(struct tm));
14951 memset(&tm_w,'\0',sizeof(struct tm));
14956 localtime_r(&t, &tm_e);
14959 localtime_r(&t, &tm_w);
14961 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14967 if eval $compile; then
14968 if $run ./try; then
14969 d_localtime_r_needs_tzset=undef;
14971 d_localtime_r_needs_tzset=define;
14974 d_localtime_r_needs_tzset=undef;
14978 d_localtime_r_needs_tzset=undef;
14983 : see if localeconv exists
14984 set localeconv d_locconv
14987 : see if lockf exists
14991 : see if prototype for lseek is available
14993 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14996 : see if lstat exists
15000 : see if madvise exists
15001 set madvise d_madvise
15004 : see if malloc_size exists
15005 set malloc_size d_malloc_size
15008 : see if malloc_size_good exists
15009 set malloc_good_size d_malloc_good_size
15012 : see if mblen exists
15016 : see if mbstowcs exists
15017 set mbstowcs d_mbstowcs
15020 : see if mbtowc exists
15021 set mbtowc d_mbtowc
15024 : see if memchr exists
15025 set memchr d_memchr
15028 : see if memcmp exists
15029 set memcmp d_memcmp
15032 : see if memcpy exists
15033 set memcpy d_memcpy
15036 : see if memmove exists
15037 set memmove d_memmove
15040 : see if memset exists
15041 set memset d_memset
15044 : see if mkdir exists
15048 : see if mkdtemp exists
15049 set mkdtemp d_mkdtemp
15052 : see if mkfifo exists
15053 set mkfifo d_mkfifo
15056 : see if mkstemp exists
15057 set mkstemp d_mkstemp
15060 : see if mkstemps exists
15061 set mkstemps d_mkstemps
15064 : see if mktime exists
15065 set mktime d_mktime
15068 : see if this is a sys/mman.h system
15069 set sys/mman.h i_sysmman
15072 : see if mmap exists
15075 : see what shmat returns
15076 : default to something harmless
15078 case "$i_sysmman$d_mmap" in
15080 $cat >mmap.c <<'END'
15081 #include <sys/mman.h>
15084 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15089 echo "and it returns ($mmaptype)." >&4
15095 : see if sqrtl exists
15099 : see if scalbnl exists
15100 set scalbnl d_scalbnl
15103 : see if modfl exists
15107 : see if prototype for modfl is available
15109 set d_modflproto modfl $i_math math.h
15112 d_modfl_pow32_bug="$undef"
15114 case "$d_longdbl$d_modfl" in
15117 Checking to see whether your modfl() is okay for large values...
15123 if $test "X$d_modflproto" != "X$define"; then
15124 $cat >>try.c <<EOCP
15125 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15126 long double modfl (long double, long double *);
15129 $cat >>try.c <<EOCP
15131 long double nv = 4294967303.15;
15137 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15141 case "$osname:$gccversion" in
15142 aix:) saveccflags="$ccflags"
15143 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15146 if eval $compile; then
15149 *" 4294967303.150000 1.150000 4294967302.000000")
15150 echo >&4 "Your modfl() is broken for large values."
15151 d_modfl_pow32_bug="$define"
15153 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15157 *" 4294967303.150000 0.150000 4294967303.000000")
15158 echo >&4 "Your modfl() seems okay for large values."
15160 *) echo >&4 "I don't understand your modfl() at all."
15166 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15169 case "$osname:$gccversion" in
15170 aix:) ccflags="$saveccflags" ;; # restore
15175 if $test "$uselongdouble" = "$define"; then
15177 if $test "$d_sqrtl" != "$define"; then
15178 message="$message sqrtl"
15180 if $test "$d_modfl" != "$define"; then
15181 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15182 echo "You have both aintl and copysignl, so I can emulate modfl."
15184 message="$message modfl"
15187 if $test "$d_frexpl" != "$define"; then
15188 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15189 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15191 message="$message frexpl"
15195 if $test "$message" != ""; then
15198 *** You requested the use of long doubles but you do not seem to have
15199 *** the following mathematical functions needed for long double support:
15201 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15202 *** Cannot continue, aborting.
15210 : see if mprotect exists
15211 set mprotect d_mprotect
15214 : see if msgctl exists
15215 set msgctl d_msgctl
15218 : see if msgget exists
15219 set msgget d_msgget
15222 : see if msgsnd exists
15223 set msgsnd d_msgsnd
15226 : see if msgrcv exists
15227 set msgrcv d_msgrcv
15230 : see how much of the 'msg*(2)' library is present.
15233 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15234 *"$undef"*) h_msg=false;;
15238 case "`ipcs 2>&1`" in
15239 "SVID messages"*"not configured"*)
15240 echo "Your $osname does not have the msg*(2) configured." >&4
15243 set msgctl d_msgctl
15245 set msgget d_msgget
15247 set msgsnd d_msgsnd
15249 set msgrcv d_msgrcv
15255 : we could also check for sys/ipc.h ...
15256 if $h_msg && $test `./findhdr sys/msg.h`; then
15257 echo "You have the full msg*(2) library." >&4
15260 echo "You don't have the full msg*(2) library." >&4
15266 : Check for msghdr_s
15268 echo "Checking to see if your system supports struct msghdr..." >&4
15269 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15271 case "$d_msghdr_s" in
15272 "$define") echo "Yes, it does." ;;
15273 *) echo "No, it doesn't." ;;
15277 : see if msync exists
15281 : see if munmap exists
15282 set munmap d_munmap
15285 : see if nice exists
15289 : see if this is a langinfo.h system
15290 set langinfo.h i_langinfo
15293 : see if nl_langinfo exists
15294 set nl_langinfo d_nl_langinfo
15297 : check for volatile keyword
15299 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15300 $cat >try.c <<'EOCP'
15303 typedef struct _goo_struct goo_struct;
15304 goo_struct * volatile goo = ((goo_struct *)0);
15305 struct _goo_struct {
15310 typedef unsigned short foo_t;
15311 char *volatile foo;
15313 volatile foo_t blech;
15317 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15319 echo "Yup, it does."
15322 echo "Nope, it doesn't."
15328 : Check basic sizes
15330 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15332 case "$use64bitint:$d_quad:$quadtype" in
15335 uvtype="$uquadtype"
15340 uvtype="unsigned long"
15346 case "$uselongdouble:$d_longdbl" in
15348 nvtype="long double"
15349 nvsize=$longdblsize
15356 $echo "(IV will be "$ivtype", $ivsize bytes)"
15357 $echo "(UV will be "$uvtype", $uvsize bytes)"
15358 $echo "(NV will be "$nvtype", $nvsize bytes)"
15361 #$i_inttypes I_INTTYPES
15363 #include <inttypes.h>
15368 int8_t i = INT8_MAX;
15369 uint8_t u = UINT8_MAX;
15370 printf("int8_t\n");
15373 int16_t i = INT16_MAX;
15374 uint16_t i = UINT16_MAX;
15375 printf("int16_t\n");
15378 int32_t i = INT32_MAX;
15379 uint32_t u = UINT32_MAX;
15380 printf("int32_t\n");
15385 i8type="signed char"
15386 u8type="unsigned char"
15391 '') case "$shortsize" in
15393 u16type="unsigned short"
15401 '') set try -DINT16
15402 if eval $compile; then
15403 case "`$run ./try`" in
15415 '') if $test $shortsize -ge 2; then
15417 u16type="unsigned short"
15425 '') case "$longsize" in
15427 u32type="unsigned long"
15431 *) case "$intsize" in
15433 u32type="unsigned int"
15443 '') set try -DINT32
15444 if eval $compile; then
15445 case "`$run ./try`" in
15457 '') if $test $intsize -ge 4; then
15459 u32type="unsigned int"
15467 '') case "$d_quad:$quadtype" in
15469 i64type="$quadtype"
15470 u64type="$uquadtype"
15478 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15479 : volatile so that the compiler has to store it out to memory.
15480 if test X"$d_volatile" = X"$define"; then
15485 #$i_stdlib I_STDLIB
15487 #include <stdlib.h>
15489 #include <sys/types.h>
15490 #include <signal.h>
15492 $volatile int bletched = 0;
15493 $signal_t blech(int s) { bletched = 1; }
15498 int n = 8 * $uvsize;
15501 signal(SIGFPE, blech);
15504 for (i = 0; i < n; i++) {
15505 u = u << 1 | ($uvtype)1;
15507 if (($uvtype)d != u)
15511 d = ($nvtype)(u - 1);
15512 if (($uvtype)d != (u - 1))
15519 printf("%d\n", ((i == n) ? -n : i));
15525 d_nv_preserves_uv="$undef"
15526 if eval $compile; then
15527 nv_preserves_uv_bits="`$run ./try`"
15529 case "$nv_preserves_uv_bits" in
15531 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15532 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15533 d_nv_preserves_uv="$define"
15535 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15536 d_nv_preserves_uv="$undef" ;;
15537 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15538 nv_preserves_uv_bits="0" ;;
15542 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15543 : volatile so that the compiler has to store it out to memory.
15544 if test X"$d_volatile" = X"$define"; then
15550 typedef $nvtype NV;
15557 while(count < 256) {
15558 $volatile NV up = value + 1.0;
15559 $volatile NV negated = -value;
15560 $volatile NV down = negated - 1.0;
15561 $volatile NV got_up = up - value;
15562 int up_good = got_up == 1.0;
15563 int got_down = down - negated;
15564 int down_good = got_down == -1.0;
15566 if (down_good != up_good) {
15568 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15569 up_good, (double) got_up, down_good, (double) got_down,
15570 count, (double) value);
15577 fputs("256.0", stdout);
15580 fputs("2.0", stdout);
15586 fputs("*", stdout);
15592 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15593 count, (double) value);
15599 nv_overflows_integers_at='0'
15600 if eval $compile; then
15606 The largest integer your NVs can preserve is equal to $xxx
15608 nv_overflows_integers_at="$xxx"
15611 Cannot determine the largest integer value your NVs can hold, unexpected output
15618 Cannot determine the largest integer value your NVs can hold
15625 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15626 : volatile so that the compiler has to store it out to memory.
15627 if test X"$d_volatile" = X"$define"; then
15632 #$i_stdlib I_STDLIB
15634 #include <stdlib.h>
15636 #$i_string I_STRING
15638 # include <string.h>
15640 # include <strings.h>
15642 #include <sys/types.h>
15643 #include <signal.h>
15645 $volatile int bletched = 0;
15646 $signal_t blech(int s) { bletched = 1; }
15649 int checkit($nvtype d, char *where) {
15650 unsigned char *p = (char *)&d;
15651 unsigned char *end = p + sizeof(d);
15661 printf("No - %s: 0x", where);
15663 printf ("%02X", *p++);
15668 int main(int argc, char **argv) {
15671 fail += checkit(d, "0.0");
15673 /* The compiler shouldn't be assuming that bletched is 0 */
15676 fail += checkit(d, "bleched");
15679 signal(SIGFPE, blech);
15682 /* Paranoia - the compiler should have no way of knowing that ANSI says
15683 that argv[argc] will always be NULL. Actually, if it did assume this it
15684 would be buggy, as this is C and main() can be called from elsewhere in
15686 d = argv[argc] ? 1 : 0;
15689 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15692 fail += checkit(d, "ternary");
15694 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15697 printf("No - memset doesn't give 0.0\n");
15698 /* This might just blow up: */
15699 printf("(gives %g)\n", d);
15705 printf("No - something bleched\n");
15710 printf("No - %d fail(s)\n", fail);
15719 d_nv_zero_is_allbits_zero="$undef"
15720 if eval $compile; then
15726 0.0 is represented as all bits zero in memory
15728 d_nv_zero_is_allbits_zero="$define"
15731 0.0 is not represented as all bits zero in memory
15733 d_nv_zero_is_allbits_zero="$undef"
15738 0.0 is not represented as all bits zero in memory
15740 d_nv_zero_is_allbits_zero="$undef"
15746 : check for off64_t
15748 echo "Checking to see if you have off64_t..." >&4
15750 #include <sys/types.h>
15751 #include <unistd.h>
15752 int main() { off64_t x = 7; }
15755 if eval $compile; then
15757 echo "You have off64_t."
15760 echo "You do not have off64_t."
15761 case "$lseeksize" in
15762 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15769 : how to create joinable pthreads
15770 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15772 echo "Checking what constant to use for creating joinable pthreads..." >&4
15773 $cat >try.c <<'EOCP'
15774 #include <pthread.h>
15776 int detachstate = JOINABLE;
15779 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15780 if eval $compile; then
15781 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15782 val="$undef" # Yes, undef.
15783 set d_old_pthread_create_joinable
15786 set old_pthread_create_joinable
15789 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15790 if eval $compile; then
15791 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15793 set d_old_pthread_create_joinable
15795 val=PTHREAD_CREATE_UNDETACHED
15796 set old_pthread_create_joinable
15799 set try -DJOINABLE=__UNDETACHED
15800 if eval $compile; then
15801 echo "You seem to use __UNDETACHED." >&4
15803 set d_old_pthread_create_joinable
15806 set old_pthread_create_joinable
15809 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15811 set d_old_pthread_create_joinable
15814 set old_pthread_create_joinable
15821 d_old_pthread_create_joinable="$undef"
15822 old_pthread_create_joinable=""
15825 : see if pause exists
15829 : see if poll exists
15833 : see if readlink exists
15834 set readlink d_readlink
15837 : Check if exe is symlink to abs path of executing program
15841 case "$d_readlink" in
15843 if $issymlink /proc/self/exe ; then
15844 $ls -l /proc/self/exe > reflect
15845 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15846 echo "You have Linux-like /proc/self/exe."
15847 procselfexe='"/proc/self/exe"'
15851 if $issymlink /proc/curproc/file ; then
15852 $ls -l /proc/curproc/file > reflect
15853 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15854 echo "You have BSD-like /proc/curproc/file."
15855 procselfexe='"/proc/curproc/file"'
15865 : backward compatibility for d_hvfork
15866 if test X$d_hvfork != X; then
15867 d_vfork="$d_hvfork"
15870 : see if there is a vfork
15875 d_pseudofork=$undef
15877 : Ok, but do we want to use it. vfork is reportedly unreliable in
15878 : perl on Solaris 2.x, and probably elsewhere.
15882 case "$usevfork" in
15888 Perl can only use a vfork() that doesn't suffer from strict
15889 restrictions on calling functions or modifying global data in
15890 the child. For example, glibc-2.1 contains such a vfork()
15891 that is unsuitable. If your system provides a proper fork()
15892 call, chances are that you do NOT want perl to use vfork().
15895 rp="Do you still want to use vfork()?"
15900 echo "Ok, we won't use vfork()."
15909 $define) usevfork='true';;
15910 *) usevfork='false';;
15913 : see whether the pthread_atfork exists
15915 #include <pthread.h>
15918 #ifdef PTHREAD_ATFORK
15919 pthread_atfork(NULL,NULL,NULL);
15924 : see if pthread_atfork exists
15925 set try -DPTHREAD_ATFORK
15926 if eval $compile; then
15931 case "$usethreads" in
15934 $define) echo 'pthread_atfork found.' >&4 ;;
15935 *) echo 'pthread_atfork NOT found.' >&4 ;;
15938 set d_pthread_atfork
15941 : see if pthread_attr_setscope exists
15942 set pthread_attr_setscope d_pthread_attr_setscope
15945 : see whether the various POSIXish _yields exist
15947 #include <pthread.h>
15953 #ifdef PTHREAD_YIELD
15956 #ifdef PTHREAD_YIELD_NULL
15957 pthread_yield(NULL);
15963 : see if sched_yield exists
15964 set try -DSCHED_YIELD
15965 if eval $compile; then
15967 sched_yield='sched_yield()'
15971 case "$usethreads" in
15974 $define) echo 'sched_yield() found.' >&4 ;;
15975 *) echo 'sched_yield() NOT found.' >&4 ;;
15981 : see if pthread_yield exists
15982 set try -DPTHREAD_YIELD
15983 if eval $compile; then
15985 case "$sched_yield" in
15986 '') sched_yield='pthread_yield()' ;;
15989 set try -DPTHREAD_YIELD_NULL
15990 if eval $compile; then
15992 case "$sched_yield" in
15993 '') sched_yield='pthread_yield(NULL)' ;;
15999 case "$usethreads" in
16002 $define) echo 'pthread_yield() found.' >&4 ;;
16003 *) echo 'pthread_yield() NOT found.' >&4 ;;
16007 set d_pthread_yield
16009 case "$sched_yield" in
16010 '') sched_yield=undef ;;
16014 : see if random_r exists
16015 set random_r d_random_r
16017 case "$d_random_r" in
16019 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16020 case "$d_random_r_proto:$usethreads" in
16021 ":define") d_random_r_proto=define
16022 set d_random_r_proto random_r $hdrs
16026 case "$d_random_r_proto" in
16028 case "$random_r_proto" in
16029 ''|0) try='int random_r(int*, struct random_data*);'
16030 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
16032 case "$random_r_proto" in
16033 ''|0) try='int random_r(long*, struct random_data*);'
16034 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
16036 case "$random_r_proto" in
16037 ''|0) try='int random_r(struct random_data*, int32_t*);'
16038 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
16040 case "$random_r_proto" in
16041 ''|0) d_random_r=undef
16043 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16044 * ) case "$random_r_proto" in
16045 REENTRANT_PROTO*) ;;
16046 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16048 echo "Prototype: $try" ;;
16051 *) case "$usethreads" in
16052 define) echo "random_r has no prototype, not using it." >&4 ;;
16059 *) random_r_proto=0
16063 : see if readdir and friends exist
16064 set readdir d_readdir
16066 set seekdir d_seekdir
16068 set telldir d_telldir
16070 set rewinddir d_rewinddir
16073 : see if readdir64_r exists
16074 set readdir64_r d_readdir64_r
16076 case "$d_readdir64_r" in
16078 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16079 case "$d_readdir64_r_proto:$usethreads" in
16080 ":define") d_readdir64_r_proto=define
16081 set d_readdir64_r_proto readdir64_r $hdrs
16085 case "$d_readdir64_r_proto" in
16087 case "$readdir64_r_proto" in
16088 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16089 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16091 case "$readdir64_r_proto" in
16092 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16093 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16095 case "$readdir64_r_proto" in
16096 ''|0) d_readdir64_r=undef
16097 readdir64_r_proto=0
16098 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16099 * ) case "$readdir64_r_proto" in
16100 REENTRANT_PROTO*) ;;
16101 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16103 echo "Prototype: $try" ;;
16106 *) case "$usethreads" in
16107 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16109 d_readdir64_r=undef
16110 readdir64_r_proto=0
16114 *) readdir64_r_proto=0
16118 : see if readdir_r exists
16119 set readdir_r d_readdir_r
16121 case "$d_readdir_r" in
16123 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16124 case "$d_readdir_r_proto:$usethreads" in
16125 ":define") d_readdir_r_proto=define
16126 set d_readdir_r_proto readdir_r $hdrs
16130 case "$d_readdir_r_proto" in
16132 case "$readdir_r_proto" in
16133 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16134 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16136 case "$readdir_r_proto" in
16137 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16138 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16140 case "$readdir_r_proto" in
16141 ''|0) d_readdir_r=undef
16143 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16144 * ) case "$readdir_r_proto" in
16145 REENTRANT_PROTO*) ;;
16146 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16148 echo "Prototype: $try" ;;
16151 *) case "$usethreads" in
16152 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16159 *) readdir_r_proto=0
16163 : see if readv exists
16167 : see if recvmsg exists
16168 set recvmsg d_recvmsg
16171 : see if rename exists
16172 set rename d_rename
16175 : see if rmdir exists
16179 : see if memory.h is available.
16184 : See if it conflicts with string.h
16190 $cppstdin $cppflags $cppminus < $strings > mem.h
16191 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16193 echo "We won't be including <memory.h>."
16203 : can bcopy handle overlapping blocks?
16206 case "$d_memmove" in
16207 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16208 *) case "$d_bcopy" in
16210 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16212 #$i_memory I_MEMORY
16213 #$i_stdlib I_STDLIB
16214 #$i_string I_STRING
16215 #$i_unistd I_UNISTD
16217 $cat >>try.c <<'EOCP'
16220 # include <memory.h>
16223 # include <stdlib.h>
16226 # include <string.h>
16228 # include <strings.h>
16231 # include <unistd.h> /* Needed for NetBSD */
16235 char buf[128], abc[128];
16241 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16242 try to store the string in read-only memory. */
16243 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16245 for (align = 7; align >= 0; align--) {
16246 for (len = 36; len; len--) {
16248 bcopy(abc, b, len);
16249 for (off = 1; off <= len; off++) {
16250 bcopy(b, b+off, len);
16251 bcopy(b+off, b, len);
16252 if (bcmp(b, abc, len))
16261 if eval $compile_ok; then
16262 if $run ./try 2>/dev/null; then
16263 echo "Yes, it can."
16266 echo "It can't, sorry."
16269 echo "(I can't compile the test program, so we'll assume not...)"
16279 : can memcpy handle overlapping blocks?
16282 case "$d_memmove" in
16283 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16284 *) case "$d_memcpy" in
16286 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16288 #$i_memory I_MEMORY
16289 #$i_stdlib I_STDLIB
16290 #$i_string I_STRING
16291 #$i_unistd I_UNISTD
16293 $cat >>try.c <<'EOCP'
16296 # include <memory.h>
16299 # include <stdlib.h>
16302 # include <string.h>
16304 # include <strings.h>
16307 # include <unistd.h> /* Needed for NetBSD */
16311 char buf[128], abc[128];
16317 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16318 try to store the string in read-only memory. */
16319 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16321 for (align = 7; align >= 0; align--) {
16322 for (len = 36; len; len--) {
16324 memcpy(b, abc, len);
16325 for (off = 1; off <= len; off++) {
16326 memcpy(b+off, b, len);
16327 memcpy(b, b+off, len);
16328 if (memcmp(b, abc, len))
16337 if eval $compile_ok; then
16338 if $run ./try 2>/dev/null; then
16339 echo "Yes, it can."
16342 echo "It can't, sorry."
16345 echo "(I can't compile the test program, so we'll assume not...)"
16355 : can memcmp be trusted to compare relative magnitude?
16357 case "$d_memcmp" in
16360 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16362 #$i_memory I_MEMORY
16363 #$i_stdlib I_STDLIB
16364 #$i_string I_STRING
16365 #$i_unistd I_UNISTD
16367 $cat >>try.c <<'EOCP'
16370 # include <memory.h>
16373 # include <stdlib.h>
16376 # include <string.h>
16378 # include <strings.h>
16381 # include <unistd.h> /* Needed for NetBSD */
16387 if ((a < b) && memcmp(&a, &b, 1) < 0)
16393 if eval $compile_ok; then
16394 if $run ./try 2>/dev/null; then
16395 echo "Yes, it can."
16398 echo "No, it can't (it uses signed chars)."
16401 echo "(I can't compile the test program, so we'll assume not...)"
16409 : see if prototype for sbrk is available
16411 set d_sbrkproto sbrk $i_unistd unistd.h
16414 : see if select exists
16415 set select d_select
16418 : see if semctl exists
16419 set semctl d_semctl
16422 : see if semget exists
16423 set semget d_semget
16426 : see if semop exists
16430 : see how much of the 'sem*(2)' library is present.
16433 case "$d_semctl$d_semget$d_semop" in
16434 *"$undef"*) h_sem=false;;
16438 case "`ipcs 2>&1`" in
16439 "SVID messages"*"not configured"*)
16440 echo "Your $osname does not have the sem*(2) configured." >&4
16443 set semctl d_semctl
16445 set semget d_semget
16453 : we could also check for sys/ipc.h ...
16454 if $h_sem && $test `./findhdr sys/sem.h`; then
16455 echo "You have the full sem*(2) library." >&4
16458 echo "You don't have the full sem*(2) library." >&4
16464 : see whether sys/sem.h defines union semun
16466 $cat > try.c <<'END'
16467 #include <sys/types.h>
16468 #include <sys/ipc.h>
16469 #include <sys/sem.h>
16470 int main () { union semun semun; semun.buf = 0; }
16473 if eval $compile; then
16474 echo "You have union semun in <sys/sem.h>." >&4
16477 echo "You do not have union semun in <sys/sem.h>." >&4
16484 : see how to do semctl IPC_STAT
16488 $cat > tryh.h <<END
16491 # define S_IRUSR S_IREAD
16492 # define S_IWUSR S_IWRITE
16493 # define S_IXUSR S_IEXEC
16495 # define S_IRUSR 0400
16496 # define S_IWUSR 0200
16497 # define S_IXUSR 0100
16499 # define S_IRGRP (S_IRUSR>>3)
16500 # define S_IWGRP (S_IWUSR>>3)
16501 # define S_IXGRP (S_IXUSR>>3)
16502 # define S_IROTH (S_IRUSR>>6)
16503 # define S_IWOTH (S_IWUSR>>6)
16504 # define S_IXOTH (S_IXUSR>>6)
16507 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16508 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16509 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16512 : see whether semctl IPC_STAT can use union semun
16513 case "$d_semctl_semun" in
16517 #include <sys/types.h>
16518 #include <sys/ipc.h>
16519 #include <sys/sem.h>
16520 #include <sys/stat.h>
16527 #$d_union_semun HAS_UNION_SEMUN
16530 #ifndef HAS_UNION_SEMUN
16533 struct semid_ds *buf;
16534 unsigned short *array;
16540 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16541 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16543 struct semid_ds argbuf;
16546 st = semctl(sem, 0, IPC_STAT, arg);
16550 # endif /* IPC_STAT */
16551 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16553 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16554 # endif /* IPC_RMID */
16555 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16557 #endif /* IPC_PRIVATE && ... */
16558 printf("semget failed: errno = %d\n", errno);
16563 if eval $compile; then
16566 semun) val="$define" ;;
16574 case "$d_semctl_semun" in
16576 echo "You can use union semun for semctl IPC_STAT." >&4
16579 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16584 : see whether semctl IPC_STAT can use struct semid_ds pointer
16585 case "$d_semctl_semid_ds" in
16588 $cat > try.c <<'END'
16589 #include <sys/types.h>
16590 #include <sys/ipc.h>
16591 #include <sys/sem.h>
16592 #include <sys/stat.h>
16600 struct semid_ds arg;
16603 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16604 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16607 st = semctl(sem, 0, IPC_STAT, &arg);
16609 printf("semid_ds\n");
16611 # endif /* IPC_STAT */
16612 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16614 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16615 # endif /* IPC_RMID */
16616 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16618 #endif /* IPC_PRIVATE && ... */
16619 printf("semget failed: errno = %d\n", errno);
16625 if eval $compile; then
16628 semid_ds) val="$define" ;;
16632 set d_semctl_semid_ds
16636 case "$d_semctl_semid_ds" in
16638 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16640 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16646 # We do not have the full sem*(2) library, so assume we can not
16652 set d_semctl_semid_ds
16658 : see if sendmsg exists
16659 set sendmsg d_sendmsg
16662 : see if setegid exists
16663 set setegid d_setegid
16666 : see if seteuid exists
16667 set seteuid d_seteuid
16670 : see if setgrent exists
16671 set setgrent d_setgrent
16674 : see if setgrent_r exists
16675 set setgrent_r d_setgrent_r
16677 case "$d_setgrent_r" in
16679 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16680 case "$d_setgrent_r_proto:$usethreads" in
16681 ":define") d_setgrent_r_proto=define
16682 set d_setgrent_r_proto setgrent_r $hdrs
16686 case "$d_setgrent_r_proto" in
16688 case "$setgrent_r_proto" in
16689 ''|0) try='int setgrent_r(FILE**);'
16690 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16692 case "$setgrent_r_proto" in
16693 ''|0) try='void setgrent_r(FILE**);'
16694 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16696 case "$setgrent_r_proto" in
16697 ''|0) d_setgrent_r=undef
16699 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16700 * ) case "$setgrent_r_proto" in
16701 REENTRANT_PROTO*) ;;
16702 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16704 echo "Prototype: $try" ;;
16707 *) case "$usethreads" in
16708 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16715 *) setgrent_r_proto=0
16719 : see if sethostent exists
16720 set sethostent d_sethent
16723 : see if sethostent_r exists
16724 set sethostent_r d_sethostent_r
16726 case "$d_sethostent_r" in
16728 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16729 case "$d_sethostent_r_proto:$usethreads" in
16730 ":define") d_sethostent_r_proto=define
16731 set d_sethostent_r_proto sethostent_r $hdrs
16735 case "$d_sethostent_r_proto" in
16737 case "$sethostent_r_proto" in
16738 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16739 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16741 case "$sethostent_r_proto" in
16742 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16743 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16745 case "$sethostent_r_proto" in
16746 ''|0) d_sethostent_r=undef
16747 sethostent_r_proto=0
16748 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16749 * ) case "$sethostent_r_proto" in
16750 REENTRANT_PROTO*) ;;
16751 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16753 echo "Prototype: $try" ;;
16756 *) case "$usethreads" in
16757 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16759 d_sethostent_r=undef
16760 sethostent_r_proto=0
16764 *) sethostent_r_proto=0
16768 : see if setitimer exists
16769 set setitimer d_setitimer
16772 : see if setlinebuf exists
16773 set setlinebuf d_setlinebuf
16776 : see if setlocale exists
16777 set setlocale d_setlocale
16780 : see if locale.h is available
16781 set locale.h i_locale
16784 : see if setlocale_r exists
16785 set setlocale_r d_setlocale_r
16787 case "$d_setlocale_r" in
16789 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16790 case "$d_setlocale_r_proto:$usethreads" in
16791 ":define") d_setlocale_r_proto=define
16792 set d_setlocale_r_proto setlocale_r $hdrs
16796 case "$d_setlocale_r_proto" in
16798 case "$setlocale_r_proto" in
16799 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16800 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16802 case "$setlocale_r_proto" in
16803 ''|0) d_setlocale_r=undef
16804 setlocale_r_proto=0
16805 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16806 * ) case "$setlocale_r_proto" in
16807 REENTRANT_PROTO*) ;;
16808 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16810 echo "Prototype: $try" ;;
16813 *) case "$usethreads" in
16814 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16816 d_setlocale_r=undef
16817 setlocale_r_proto=0
16821 *) setlocale_r_proto=0
16825 : see if setnetent exists
16826 set setnetent d_setnent
16829 : see if setnetent_r exists
16830 set setnetent_r d_setnetent_r
16832 case "$d_setnetent_r" in
16834 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16835 case "$d_setnetent_r_proto:$usethreads" in
16836 ":define") d_setnetent_r_proto=define
16837 set d_setnetent_r_proto setnetent_r $hdrs
16841 case "$d_setnetent_r_proto" in
16843 case "$setnetent_r_proto" in
16844 ''|0) try='int setnetent_r(int, struct netent_data*);'
16845 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16847 case "$setnetent_r_proto" in
16848 ''|0) try='void setnetent_r(int, struct netent_data*);'
16849 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16851 case "$setnetent_r_proto" in
16852 ''|0) d_setnetent_r=undef
16853 setnetent_r_proto=0
16854 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16855 * ) case "$setnetent_r_proto" in
16856 REENTRANT_PROTO*) ;;
16857 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16859 echo "Prototype: $try" ;;
16862 *) case "$usethreads" in
16863 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16865 d_setnetent_r=undef
16866 setnetent_r_proto=0
16870 *) setnetent_r_proto=0
16874 : see if setprotoent exists
16875 set setprotoent d_setpent
16878 : see if setpgid exists
16879 set setpgid d_setpgid
16882 : see if setpgrp2 exists
16883 set setpgrp2 d_setpgrp2
16886 : see if setpriority exists
16887 set setpriority d_setprior
16890 : see if setproctitle exists
16891 set setproctitle d_setproctitle
16894 : see if setprotoent_r exists
16895 set setprotoent_r d_setprotoent_r
16897 case "$d_setprotoent_r" in
16899 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16900 case "$d_setprotoent_r_proto:$usethreads" in
16901 ":define") d_setprotoent_r_proto=define
16902 set d_setprotoent_r_proto setprotoent_r $hdrs
16906 case "$d_setprotoent_r_proto" in
16908 case "$setprotoent_r_proto" in
16909 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16910 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16912 case "$setprotoent_r_proto" in
16913 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16914 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16916 case "$setprotoent_r_proto" in
16917 ''|0) d_setprotoent_r=undef
16918 setprotoent_r_proto=0
16919 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16920 * ) case "$setprotoent_r_proto" in
16921 REENTRANT_PROTO*) ;;
16922 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16924 echo "Prototype: $try" ;;
16927 *) case "$usethreads" in
16928 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16930 d_setprotoent_r=undef
16931 setprotoent_r_proto=0
16935 *) setprotoent_r_proto=0
16939 : see if setpwent exists
16940 set setpwent d_setpwent
16943 : see if setpwent_r exists
16944 set setpwent_r d_setpwent_r
16946 case "$d_setpwent_r" in
16948 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16949 case "$d_setpwent_r_proto:$usethreads" in
16950 ":define") d_setpwent_r_proto=define
16951 set d_setpwent_r_proto setpwent_r $hdrs
16955 case "$d_setpwent_r_proto" in
16957 case "$setpwent_r_proto" in
16958 ''|0) try='int setpwent_r(FILE**);'
16959 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16961 case "$setpwent_r_proto" in
16962 ''|0) try='void setpwent_r(FILE**);'
16963 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16965 case "$setpwent_r_proto" in
16966 ''|0) d_setpwent_r=undef
16968 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16969 * ) case "$setpwent_r_proto" in
16970 REENTRANT_PROTO*) ;;
16971 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16973 echo "Prototype: $try" ;;
16976 *) case "$usethreads" in
16977 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16984 *) setpwent_r_proto=0
16988 : see if setregid exists
16989 set setregid d_setregid
16991 set setresgid d_setresgid
16994 : see if setreuid exists
16995 set setreuid d_setreuid
16997 set setresuid d_setresuid
17000 : see if setrgid exists
17001 set setrgid d_setrgid
17004 : see if setruid exists
17005 set setruid d_setruid
17008 : see if setservent exists
17009 set setservent d_setsent
17012 : see if setservent_r exists
17013 set setservent_r d_setservent_r
17015 case "$d_setservent_r" in
17017 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
17018 case "$d_setservent_r_proto:$usethreads" in
17019 ":define") d_setservent_r_proto=define
17020 set d_setservent_r_proto setservent_r $hdrs
17024 case "$d_setservent_r_proto" in
17026 case "$setservent_r_proto" in
17027 ''|0) try='int setservent_r(int, struct servent_data*);'
17028 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
17030 case "$setservent_r_proto" in
17031 ''|0) try='void setservent_r(int, struct servent_data*);'
17032 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
17034 case "$setservent_r_proto" in
17035 ''|0) d_setservent_r=undef
17036 setservent_r_proto=0
17037 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17038 * ) case "$setservent_r_proto" in
17039 REENTRANT_PROTO*) ;;
17040 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17042 echo "Prototype: $try" ;;
17045 *) case "$usethreads" in
17046 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17048 d_setservent_r=undef
17049 setservent_r_proto=0
17053 *) setservent_r_proto=0
17057 : see if setsid exists
17058 set setsid d_setsid
17061 : see if setvbuf exists
17062 set setvbuf d_setvbuf
17065 : see if sfio.h is available
17069 : see if sfio library is available
17080 : Ok, but do we want to use it.
17084 true|$define|[yY]*) dflt='y';;
17087 echo "$package can use the sfio library, but it is experimental."
17088 case "$useperlio" in
17090 echo "For sfio also the PerlIO abstraction layer is needed."
17091 echo "Earlier you said you wouldn't want that."
17094 rp="You seem to have sfio available, do you want to try using it?"
17097 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17098 useperlio="$define"
17101 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17106 *) case "$usesfio" in
17107 true|$define|[yY]*)
17108 echo "Sorry, cannot find sfio on this machine." >&4
17109 echo "Ignoring your setting of usesfio=$usesfio." >&4
17118 $define) usesfio='true';;
17119 *) usesfio='false';;
17123 *) : Remove sfio from list of libraries to use
17126 echo "Removing unneeded -lsfio from library list" >&4
17127 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17130 echo "libs = $libs" >&4
17137 : see if shmctl exists
17138 set shmctl d_shmctl
17141 : see if shmget exists
17142 set shmget d_shmget
17145 : see if shmat exists
17148 : see what shmat returns
17151 $cat >shmat.c <<'END'
17152 #include <sys/shm.h>
17155 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17160 echo "and it returns ($shmattype)." >&4
17161 : see if a prototype for shmat is available
17162 xxx=`./findhdr sys/shm.h`
17163 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17164 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17175 set d_shmatprototype
17178 : see if shmdt exists
17182 : see how much of the 'shm*(2)' library is present.
17185 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17186 *"$undef"*) h_shm=false;;
17190 case "`ipcs 2>&1`" in
17191 "SVID shared memory"*"not configured"*)
17192 echo "Your $osname does not have the shm*(2) configured." >&4
17195 set shmctl d_shmctl
17197 set shmget d_shmget
17207 : we could also check for sys/ipc.h ...
17208 if $h_shm && $test `./findhdr sys/shm.h`; then
17209 echo "You have the full shm*(2) library." >&4
17212 echo "You don't have the full shm*(2) library." >&4
17218 : see if we have sigaction
17220 if set sigaction val -f d_sigaction; eval $csym; $val; then
17221 echo 'sigaction() found.' >&4
17224 #include <sys/types.h>
17225 #include <signal.h>
17226 #$i_stdlib I_STDLIB
17228 #include <stdlib.h>
17232 struct sigaction act, oact;
17234 oact.sa_handler = 0;
17235 /* so that act and oact are used */
17236 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17240 if eval $compile_ok; then
17243 echo "But you don't seem to have a useable struct sigaction." >&4
17247 echo 'sigaction NOT found.' >&4
17250 set d_sigaction; eval $setvar
17253 : see if this is a sunmath.h system
17254 set sunmath.h i_sunmath
17257 : see if signbit exists
17258 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17261 #$i_sunmath I_SUNMATH
17265 #ifdef I_SUNMATH /* Solaris special math library */
17266 # include <sunmath.h>
17269 int main(int argc, char **argv)
17273 if ((signbit(x) == 0) && (signbit(y) != 0))
17281 if eval $compile; then
17282 if $run ./try; then
17286 $echo "Signbit seems to be available, but doesn't work as I expected."
17287 $echo "I won't use it." >&4
17298 : see if sigprocmask exists
17299 set sigprocmask d_sigprocmask
17302 : see if sigsetjmp exists
17304 case "$d_sigsetjmp" in
17307 #include <setjmp.h>
17308 #$i_stdlib I_STDLIB
17310 #include <stdlib.h>
17316 if (sigsetjmp(env,1))
17319 siglongjmp(env, 1);
17324 if eval $compile; then
17325 if $run ./try >/dev/null 2>&1; then
17326 echo "POSIX sigsetjmp found." >&4
17330 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17336 echo "sigsetjmp not found." >&4
17340 *) val="$d_sigsetjmp"
17341 case "$d_sigsetjmp" in
17342 $define) echo "POSIX sigsetjmp found." >&4;;
17343 $undef) echo "sigsetjmp not found." >&4;;
17351 : see if snprintf exists
17352 set snprintf d_snprintf
17355 : see if vsnprintf exists
17356 set vsnprintf d_vsnprintf
17359 case "$d_snprintf-$d_vsnprintf" in
17362 Checking whether your snprintf() and vsnprintf() work okay...
17364 $cat >try.c <<'EOCP'
17365 /* v?snprintf testing logic courtesy of Russ Allbery.
17366 * According to C99:
17367 * - if the buffer is too short it still must be \0-terminated
17368 * - if the buffer is too short the potentially required length
17369 * must be returned and not -1
17370 * - if the buffer is NULL the potentially required length
17371 * must be returned and not -1 or core dump
17374 #include <stdarg.h>
17378 int test (char *format, ...)
17383 va_start (args, format);
17384 count = vsnprintf (buf, sizeof buf, format, args);
17391 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17392 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17396 if eval $compile; then
17399 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17401 Your snprintf() and snprintf() don't seem to be working okay.
17403 d_snprintf="$undef"
17404 d_vsnprintf="$undef"
17408 echo "(I can't seem to compile the test program--assuming they don't)"
17409 d_snprintf="$undef"
17410 d_vsnprintf="$undef"
17416 : see if sockatmark exists
17417 set sockatmark d_sockatmark
17420 : see if prototype for sockatmark is available
17422 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17425 : see if socks5_init exists
17426 set socks5_init d_socks5_init
17429 : see if sprintf returns the length of the string in the buffer as per ANSI
17430 $echo "Checking whether sprintf returns the length of the string..." >&4
17433 #$i_stdlib I_STDLIB
17435 #include <stdlib.h>
17437 #$i_string I_STRING
17439 # include <string.h>
17441 # include <strings.h>
17450 int check (size_t expect, int test) {
17451 size_t got = strlen(buffer);
17455 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17460 int main(int argc, char **argv) {
17463 check(sprintf(buffer, ""), ++test);
17464 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17465 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17472 if eval $compile; then
17476 sprintf returns the length of the string (as ANSI says it should)
17478 d_sprintf_returns_strlen="$define"
17481 sprintf does not return the length of the string (how old is this system?)
17483 d_sprintf_returns_strlen="$undef"
17487 echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
17488 d_sprintf_returns_strlen="$undef"
17492 : see if srand48_r exists
17493 set srand48_r d_srand48_r
17495 case "$d_srand48_r" in
17497 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17498 case "$d_srand48_r_proto:$usethreads" in
17499 ":define") d_srand48_r_proto=define
17500 set d_srand48_r_proto srand48_r $hdrs
17504 case "$d_srand48_r_proto" in
17506 case "$srand48_r_proto" in
17507 ''|0) try='int srand48_r(long, struct drand48_data*);'
17508 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17510 case "$srand48_r_proto" in
17511 ''|0) d_srand48_r=undef
17513 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17514 * ) case "$srand48_r_proto" in
17515 REENTRANT_PROTO*) ;;
17516 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17518 echo "Prototype: $try" ;;
17521 *) case "$usethreads" in
17522 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17529 *) srand48_r_proto=0
17533 : see if srandom_r exists
17534 set srandom_r d_srandom_r
17536 case "$d_srandom_r" in
17538 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17539 case "$d_srandom_r_proto:$usethreads" in
17540 ":define") d_srandom_r_proto=define
17541 set d_srandom_r_proto srandom_r $hdrs
17545 case "$d_srandom_r_proto" in
17547 case "$srandom_r_proto" in
17548 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17549 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17551 case "$srandom_r_proto" in
17552 ''|0) d_srandom_r=undef
17554 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17555 * ) case "$srandom_r_proto" in
17556 REENTRANT_PROTO*) ;;
17557 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17559 echo "Prototype: $try" ;;
17562 *) case "$usethreads" in
17563 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17570 *) srandom_r_proto=0
17574 : see if prototype for setresgid is available
17576 set d_sresgproto setresgid $i_unistd unistd.h
17579 : see if prototype for setresuid is available
17581 set d_sresuproto setresuid $i_unistd unistd.h
17584 : see if sys/stat.h is available
17585 set sys/stat.h i_sysstat
17588 : see if stat knows about block sizes
17590 echo "Checking to see if your struct stat has st_blocks field..." >&4
17591 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17594 : see if this is a sys/vfs.h system
17595 set sys/vfs.h i_sysvfs
17598 : see if this is a sys/statfs.h system
17599 set sys/statfs.h i_sysstatfs
17602 : Check for statfs_s
17604 echo "Checking to see if your system supports struct statfs..." >&4
17605 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
17607 case "$d_statfs_s" in
17608 "$define") echo "Yes, it does." ;;
17609 *) echo "No, it doesn't." ;;
17613 : see if struct statfs knows about f_flags
17614 case "$d_statfs_s" in
17617 echo "Checking to see if your struct statfs has f_flags field..." >&4
17618 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
17622 set d_statfs_f_flags
17626 case "$d_statfs_f_flags" in
17627 "$define") echo "Yes, it does." ;;
17628 *) echo "No, it doesn't." ;;
17631 : Check stream access
17633 Checking how to access stdio streams by file descriptor number...
17635 case "$stdio_stream_array" in
17636 '') $cat >try.c <<EOCP
17639 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17643 for s in _iob __iob __sF
17645 set try -DSTDIO_STREAM_ARRAY=$s
17646 if eval $compile; then
17647 case "`$run ./try`" in
17648 yes) stdio_stream_array=$s; break ;;
17654 case "$stdio_stream_array" in
17656 I can't figure out how to access stdio streams by file descriptor number.
17658 d_stdio_stream_array="$undef"
17661 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17663 d_stdio_stream_array="$define"
17667 : see if strcoll exists
17668 set strcoll d_strcoll
17671 : check for structure copying
17673 echo "Checking to see if your C compiler can copy structs..." >&4
17674 $cat >try.c <<'EOCP'
17684 if $cc -c try.c >/dev/null 2>&1 ; then
17686 echo "Yup, it can."
17689 echo "Nope, it can't."
17695 : see if strerror and/or sys_errlist[] exist
17697 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17698 if set strerror val -f d_strerror; eval $csym; $val; then
17699 echo 'strerror() found.' >&4
17700 d_strerror="$define"
17701 d_strerrm='strerror(e)'
17702 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17703 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17704 d_syserrlst="$define"
17706 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17707 d_syserrlst="$undef"
17709 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17710 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17711 echo 'strerror() found in string header.' >&4
17712 d_strerror="$define"
17713 d_strerrm='strerror(e)'
17714 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17715 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17716 d_syserrlst="$define"
17718 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17719 d_syserrlst="$undef"
17721 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17722 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17723 d_strerror="$undef"
17724 d_syserrlst="$define"
17725 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17727 echo 'strerror() and sys_errlist[] NOT found.' >&4
17728 d_strerror="$undef"
17729 d_syserrlst="$undef"
17730 d_strerrm='"unknown"'
17734 : see if strerror_r exists
17735 set strerror_r d_strerror_r
17737 case "$d_strerror_r" in
17739 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17740 case "$d_strerror_r_proto:$usethreads" in
17741 ":define") d_strerror_r_proto=define
17742 set d_strerror_r_proto strerror_r $hdrs
17746 case "$d_strerror_r_proto" in
17748 case "$strerror_r_proto" in
17749 ''|0) try='int strerror_r(int, char*, size_t);'
17750 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17752 case "$strerror_r_proto" in
17753 ''|0) try='int strerror_r(int, char*, int);'
17754 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17756 case "$strerror_r_proto" in
17757 ''|0) try='char* strerror_r(int, char*, size_t);'
17758 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17760 case "$strerror_r_proto" in
17761 ''|0) d_strerror_r=undef
17763 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17764 * ) case "$strerror_r_proto" in
17765 REENTRANT_PROTO*) ;;
17766 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17768 echo "Prototype: $try" ;;
17771 *) case "$usethreads" in
17772 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17779 *) strerror_r_proto=0
17783 : see if strftime exists
17784 set strftime d_strftime
17787 : see if strlcat exists
17788 set strlcat d_strlcat
17791 : see if strlcpy exists
17792 set strlcpy d_strlcpy
17795 : see if strtod exists
17796 set strtod d_strtod
17799 : see if strtol exists
17800 set strtol d_strtol
17803 : see if strtold exists
17804 set strtold d_strtold
17807 : see if strtoll exists
17808 set strtoll d_strtoll
17811 case "$d_longlong-$d_strtoll" in
17814 Checking whether your strtoll() works okay...
17816 $cat >try.c <<'EOCP'
17819 #define strtoll __strtoll
17822 #define strtoll _strtoll
17825 extern long long int strtoll(char *s, char **, int);
17826 static int bad = 0;
17827 int check(char *s, long long ell, int een) {
17830 gll = strtoll(s, 0, 10);
17831 if (!((gll == ell) && (errno == een)))
17835 check(" 1", 1LL, 0);
17836 check(" 0", 0LL, 0);
17837 check("-1", -1LL, 0);
17838 check("-9223372036854775808", -9223372036854775808LL, 0);
17839 check("-9223372036854775808", -9223372036854775808LL, 0);
17840 check(" 9223372036854775807", 9223372036854775807LL, 0);
17841 check("-9223372036854775808", -9223372036854775808LL, 0);
17842 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17843 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17849 if eval $compile; then
17852 ok) echo "Your strtoll() seems to be working okay." ;;
17854 Your strtoll() doesn't seem to be working okay.
17860 echo "(I can't seem to compile the test program--assuming it doesn't)"
17866 : see if strtoq exists
17867 set strtoq d_strtoq
17870 : see if strtoul exists
17871 set strtoul d_strtoul
17874 case "$d_strtoul" in
17877 Checking whether your strtoul() works okay...
17879 $cat >try.c <<'EOCP'
17882 extern unsigned long int strtoul(char *s, char **, int);
17883 static int bad = 0;
17884 void check(char *s, unsigned long eul, int een) {
17887 gul = strtoul(s, 0, 10);
17888 if (!((gul == eul) && (errno == een)))
17892 check(" 1", 1L, 0);
17893 check(" 0", 0L, 0);
17895 case "$longsize" in
17897 $cat >>try.c <<'EOCP'
17898 check("18446744073709551615", 18446744073709551615UL, 0);
17899 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17900 #if 0 /* strtoul() for /^-/ strings is undefined. */
17901 check("-1", 18446744073709551615UL, 0);
17902 check("-18446744073709551614", 2, 0);
17903 check("-18446744073709551615", 1, 0);
17904 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17905 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17910 $cat >>try.c <<'EOCP'
17911 check("4294967295", 4294967295UL, 0);
17912 check("4294967296", 4294967295UL, ERANGE);
17913 #if 0 /* strtoul() for /^-/ strings is undefined. */
17914 check("-1", 4294967295UL, 0);
17915 check("-4294967294", 2, 0);
17916 check("-4294967295", 1, 0);
17917 check("-4294967296", 4294967295UL, ERANGE);
17918 check("-4294967297", 4294967295UL, ERANGE);
17923 : Should we write these tests to be more portable by sprintf-ing
17924 : ~0 and then manipulating that char string as input for strtol?
17927 $cat >>try.c <<'EOCP'
17934 if eval $compile; then
17935 case "`$run ./try`" in
17936 ok) echo "Your strtoul() seems to be working okay." ;;
17938 Your strtoul() doesn't seem to be working okay.
17944 echo "(I can't seem to compile the test program--assuming it doesn't)"
17950 : see if strtoull exists
17951 set strtoull d_strtoull
17954 case "$d_longlong-$d_strtoull" in
17957 Checking whether your strtoull() works okay...
17959 $cat >try.c <<'EOCP'
17962 #define strtoull __strtoull
17965 extern unsigned long long int strtoull(char *s, char **, int);
17966 static int bad = 0;
17967 int check(char *s, long long eull, int een) {
17970 gull = strtoull(s, 0, 10);
17971 if (!((gull == eull) && (errno == een)))
17975 check(" 1", 1LL, 0);
17976 check(" 0", 0LL, 0);
17977 check("18446744073709551615", 18446744073709551615ULL, 0);
17978 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17979 #if 0 /* strtoull() for /^-/ strings is undefined. */
17980 check("-1", 18446744073709551615ULL, 0);
17981 check("-18446744073709551614", 2LL, 0);
17982 check("-18446744073709551615", 1LL, 0);
17983 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17984 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17991 if eval $compile; then
17992 case "`$run ./try`" in
17993 ok) echo "Your strtoull() seems to be working okay." ;;
17995 Your strtoull() doesn't seem to be working okay.
17997 d_strtoull="$undef"
18001 echo "(I can't seem to compile the test program--assuming it doesn't)"
18002 d_strtoull="$undef"
18007 : see if strtouq exists
18008 set strtouq d_strtouq
18011 case "$d_strtouq" in
18014 Checking whether your strtouq() works okay...
18016 $cat >try.c <<'EOCP'
18019 extern unsigned long long int strtouq(char *s, char **, int);
18020 static int bad = 0;
18021 void check(char *s, unsigned long long eull, int een) {
18022 unsigned long long gull;
18024 gull = strtouq(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 /* strtouq() 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);
18046 if eval $compile; then
18047 case "`$run ./try`" in
18048 ok) echo "Your strtouq() seems to be working okay." ;;
18050 Your strtouq() doesn't seem to be working okay.
18056 echo "(I can't seem to compile the test program--assuming it doesn't)"
18062 : see if strxfrm exists
18063 set strxfrm d_strxfrm
18066 : see if symlink exists
18067 set symlink d_symlink
18070 : see if syscall exists
18071 set syscall d_syscall
18074 : see if prototype for syscall is available
18076 set d_syscallproto syscall $i_unistd unistd.h
18079 : see if sysconf exists
18080 set sysconf d_sysconf
18083 : see if system exists
18084 set system d_system
18087 : see if tcgetpgrp exists
18088 set tcgetpgrp d_tcgetpgrp
18091 : see if tcsetpgrp exists
18092 set tcsetpgrp d_tcsetpgrp
18095 : see if prototype for telldir is available
18097 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18100 : see if time exists
18102 if test "X$d_time" = X -o X"$timetype" = X; then
18103 if set time val -f d_time; eval $csym; $val; then
18104 echo 'time() found.' >&4
18106 rp="What is the type returned by time() on this system?"
18107 set time_t timetype long stdio.h sys/types.h
18110 echo 'time() not found, hope that will do.' >&4
18118 : see if timegm exists
18119 set timegm d_timegm
18122 : see if this is a sys/times.h system
18123 set sys/times.h i_systimes
18126 : see if times exists
18128 if set times val -f d_times; eval $csym; $val; then
18129 echo 'times() found.' >&4
18132 case "$i_systimes" in
18133 "$define") inc='sys/times.h';;
18135 rp="What is the type returned by times() on this system?"
18136 set clock_t clocktype long stdio.h sys/types.h $inc
18139 echo 'times() NOT found, hope that will do.' >&4
18144 : see if tmpnam_r exists
18145 set tmpnam_r d_tmpnam_r
18147 case "$d_tmpnam_r" in
18149 hdrs="$i_systypes sys/types.h define stdio.h "
18150 case "$d_tmpnam_r_proto:$usethreads" in
18151 ":define") d_tmpnam_r_proto=define
18152 set d_tmpnam_r_proto tmpnam_r $hdrs
18156 case "$d_tmpnam_r_proto" in
18158 case "$tmpnam_r_proto" in
18159 ''|0) try='char* tmpnam_r(char*);'
18160 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18162 case "$tmpnam_r_proto" in
18163 ''|0) d_tmpnam_r=undef
18165 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18166 * ) case "$tmpnam_r_proto" in
18167 REENTRANT_PROTO*) ;;
18168 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18170 echo "Prototype: $try" ;;
18173 *) case "$usethreads" in
18174 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18181 *) tmpnam_r_proto=0
18185 : see if truncate exists
18186 set truncate d_truncate
18189 : see if ttyname_r exists
18190 set ttyname_r d_ttyname_r
18192 case "$d_ttyname_r" in
18194 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18195 case "$d_ttyname_r_proto:$usethreads" in
18196 ":define") d_ttyname_r_proto=define
18197 set d_ttyname_r_proto ttyname_r $hdrs
18201 case "$d_ttyname_r_proto" in
18203 case "$ttyname_r_proto" in
18204 ''|0) try='int ttyname_r(int, char*, size_t);'
18205 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18207 case "$ttyname_r_proto" in
18208 ''|0) try='int ttyname_r(int, char*, int);'
18209 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18211 case "$ttyname_r_proto" in
18212 ''|0) try='char* ttyname_r(int, char*, int);'
18213 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18215 case "$ttyname_r_proto" in
18216 ''|0) d_ttyname_r=undef
18218 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18219 * ) case "$ttyname_r_proto" in
18220 REENTRANT_PROTO*) ;;
18221 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18223 echo "Prototype: $try" ;;
18226 *) case "$usethreads" in
18227 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18234 *) ttyname_r_proto=0
18238 : see if tzname[] exists
18240 if set tzname val -a d_tzname; eval $csym; $val; then
18242 echo 'tzname[] found.' >&4
18245 echo 'tzname[] NOT found.' >&4
18250 : Check if is a multiplatform env
18252 next|rhapsody|darwin) multiarch="$define" ;;
18254 case "$multiarch" in
18255 ''|[nN]*) multiarch="$undef" ;;
18258 : check for ordering of bytes in a UV
18260 case "$usecrosscompile$multiarch" in
18263 You seem to be either cross-compiling or doing a multiarchitecture build,
18264 skipping the byteorder check.
18270 case "$byteorder" in
18273 In the following, larger digits indicate more significance. A big-endian
18274 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18275 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18276 machines may have weird orders like 3412. A Cray will report 87654321,
18277 an Alpha will report 12345678. If the test program works the default is
18279 I'm now running the test program...
18283 #$i_stdlib I_STDLIB
18285 #include <stdlib.h>
18287 #include <sys/types.h>
18288 typedef $uvtype UV;
18298 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18300 u.l = (UV)0x04030201;
18301 for (i = 0; i < $uvsize; i++)
18302 printf("%c", u.c[i]+'0');
18309 if eval $compile && $run ./try > /dev/null; then
18312 [1-4][1-4][1-4][1-4]|12345678|87654321)
18313 echo "(The test program ran ok.)"
18314 echo "byteorder=$dflt"
18317 ????|????????) echo "(The test program ran ok.)" ;;
18318 *) echo "(The test program didn't run right for some reason.)" ;;
18323 (I can't seem to compile the test program. Guessing big-endian...)
18326 case "$xxx_prompt" in
18328 rp="What is the order of bytes in $uvtype?"
18341 : Checking 32bit aligndness
18344 Checking to see whether you can access character data unalignedly...
18346 case "$d_u32align" in
18347 '') $cat >try.c <<EOCP
18349 #$i_stdlib I_STDLIB
18351 #include <stdlib.h>
18353 #define U32 $u32type
18354 #define BYTEORDER 0x$byteorder
18356 #include <signal.h>
18358 $signal_t bletch(int s) { exit(4); }
18361 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18366 if (sizeof(U32) != 4) {
18367 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18374 signal(SIGBUS, bletch);
18386 for (i = 0; i < 4; i++) {
18387 up = (U32*)(buf + i);
18388 if (! ((*up == 1 << (8*i)) || /* big-endian */
18389 (*up == 1 << (8*(3-i))) /* little-endian */
18393 printf("read failed (%x)\n", *up);
18399 for (i = 0; i < 4; i++) {
18400 up = (U32*)(buf + i);
18402 if (*up != 0xBeef) {
18403 printf("write failed (%x)\n", *up);
18417 if eval $compile_ok; then
18418 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18419 $run ./try 2>&1 >/dev/null
18422 You can access character data pretty unalignedly.
18424 d_u32align="$undef"
18427 It seems that you must access character data in an aligned manner.
18429 d_u32align="$define"
18433 rp='Can you access character data at unaligned addresses?'
18437 [yY]*) d_u32align="$undef" ;;
18438 *) d_u32align="$define" ;;
18445 : see if ualarm exists
18446 set ualarm d_ualarm
18449 : see if umask exists
18453 : see if unordered exists
18454 set unordered d_unordered
18457 : see if unsetenv exists
18458 set unsetenv d_unsetenv
18461 : see if usleep exists
18462 set usleep d_usleep
18465 : see if prototype for usleep is available
18467 set d_usleepproto usleep $i_unistd unistd.h
18470 : see if ustat exists
18474 : see if closedir exists
18475 set closedir d_closedir
18478 case "$d_closedir" in
18481 echo "Checking whether closedir() returns a status..." >&4
18483 #$i_dirent I_DIRENT /**/
18484 #$i_sysdir I_SYS_DIR /**/
18485 #$i_sysndir I_SYS_NDIR /**/
18486 #$i_systypes I_SYS_TYPES /**/
18488 #if defined(I_SYS_TYPES)
18489 #include <sys/types.h>
18491 #if defined(I_DIRENT)
18492 #include <dirent.h>
18493 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18494 #include <sys/dir.h>
18498 #include <sys/ndir.h>
18502 #include <ndir.h> /* may be wrong in the future */
18504 #include <sys/dir.h>
18509 int main() { return closedir(opendir(".")); }
18512 if eval $compile_ok; then
18513 if $run ./try > /dev/null 2>&1 ; then
18514 echo "Yes, it does."
18517 echo "No, it doesn't."
18521 echo "(I can't seem to compile the test program--assuming it doesn't)"
18529 set d_void_closedir
18533 : see if there is a wait4
18537 : see if waitpid exists
18538 set waitpid d_waitpid
18541 : see if wcstombs exists
18542 set wcstombs d_wcstombs
18545 : see if wctomb exists
18546 set wctomb d_wctomb
18549 : see if writev exists
18550 set writev d_writev
18553 : preserve RCS keywords in files with variable substitution, grrr
18558 Revision='$Revision'
18560 : check for alignment requirements
18562 case "$usecrosscompile$multiarch" in
18565 You seem to be either cross-compiling or doing a multiarchitecture build,
18566 skipping the memory alignment check.
18569 case "$alignbytes" in
18570 '') alignbytes=8 ;;
18574 case "$alignbytes" in
18575 '') echo "Checking alignment constraints..." >&4
18576 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18577 $cat >try.c <<'EOCP'
18578 typedef long double NV;
18581 $cat >try.c <<'EOCP'
18585 $cat >>try.c <<'EOCP'
18593 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18598 if eval $compile_ok; then
18602 echo "(I can't seem to compile the test program...)"
18605 *) dflt="$alignbytes"
18608 rp="Doubles must be aligned on a how-many-byte boundary?"
18616 : set the base revision
18619 : how do we concatenate cpp tokens here?
18621 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18622 $cat >cpp_stuff.c <<'EOCP'
18623 #define RCAT(a,b)a/**/b
18624 #define ACAT(a,b)a ## b
18628 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18629 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18630 echo "Oh! Smells like ANSI's been here." >&4
18631 echo "We can catify or stringify, separately or together!"
18633 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18634 echo "Ah, yes! The good old days!" >&4
18635 echo "However, in the good old days we don't know how to stringify and"
18636 echo "catify at the same time."
18640 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18641 You're going to have to edit the values of CAT[2-5] in config.h...
18643 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18647 : see if this is a db.h system
18653 : Check db version.
18655 echo "Checking Berkeley DB version ..." >&4
18661 #include <sys/types.h>
18663 #$i_stdlib I_STDLIB
18665 #include <stdlib.h>
18668 int main(int argc, char *argv[])
18670 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18671 int Major, Minor, Patch ;
18672 unsigned long Version ;
18673 (void)db_version(&Major, &Minor, &Patch) ;
18675 printf("%d %d %d %d %d %d\n",
18676 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18677 Major, Minor, Patch);
18680 printf("You have Berkeley DB Version 2 or greater.\n");
18682 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18683 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18684 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18685 Major, Minor, Patch) ;
18687 /* check that db.h & libdb are compatible */
18688 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18689 printf("db.h and libdb are incompatible.\n") ;
18693 printf("db.h and libdb are compatible.\n") ;
18695 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18696 + DB_VERSION_PATCH ;
18698 /* needs to be >= 2.3.4 */
18699 if (Version < 2003004) {
18700 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18701 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18707 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18712 printf("You have Berkeley DB Version 1.\n");
18713 exit(0); /* DB version < 2: the coast is clear. */
18715 exit(1); /* <db.h> not Berkeley DB? */
18721 if eval $compile_ok && $run ./try; then
18722 echo 'Looks OK.' >&4
18724 db_version_major=$1
18725 db_version_minor=$2
18726 db_version_patch=$3
18728 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18732 : Remove db from list of libraries to use
18733 echo "Removing unusable -ldb from library list" >&4
18734 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18737 echo "libs = $libs" >&4
18747 : Check the return type needed for hash
18749 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18755 #include <sys/types.h>
18758 #ifndef DB_VERSION_MAJOR
18759 u_int32_t hash_cb (ptr, size)
18767 info.hash = hash_cb;
18771 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18772 if $contains warning try.out >>/dev/null 2>&1 ; then
18775 db_hashtype='u_int32_t'
18778 : XXX Maybe we should just give up here.
18779 db_hashtype=u_int32_t
18781 echo "Help: I can't seem to compile the db test program." >&4
18782 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18785 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18787 *) db_hashtype=u_int32_t
18792 : Check the return type needed for prefix
18794 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18800 #include <sys/types.h>
18803 #ifndef DB_VERSION_MAJOR
18804 size_t prefix_cb (key1, key2)
18812 info.prefix = prefix_cb;
18816 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18817 if $contains warning try.out >>/dev/null 2>&1 ; then
18818 db_prefixtype='int'
18820 db_prefixtype='size_t'
18823 db_prefixtype='size_t'
18824 : XXX Maybe we should just give up here.
18826 echo "Help: I can't seem to compile the db test program." >&4
18827 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18830 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18832 *) db_prefixtype='size_t'
18836 : How can we generate normalized random numbers ?
18838 echo "Looking for a random number function..." >&4
18839 case "$randfunc" in
18841 if set drand48 val -f; eval $csym; $val; then
18843 echo "Good, found drand48()." >&4
18844 elif set random val -f; eval $csym; $val; then
18846 echo "OK, found random()." >&4
18849 echo "Yick, looks like I have to use rand()." >&4
18860 *-Dmy_rand=*|*-Dmy_srand=*)
18861 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18862 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18863 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18864 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18868 while $test "$cont"; do
18869 rp="Use which function to generate random numbers?"
18871 if $test "$ans" = "$dflt"; then
18877 if set $ans val -f; eval $csym; $val; then
18881 rp="I cannot find function $ans. Use that name anyway?"
18890 case "$randfunc" in
18892 drand01="drand48()"
18898 case "$randbits" in
18900 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18902 #$i_unistd I_UNISTD
18903 #$i_stdlib I_STDLIB
18906 # include <unistd.h>
18909 # include <stdlib.h>
18914 register unsigned long tmp;
18915 register unsigned long max = 0L;
18917 for (i = 1000; i; i--) {
18918 tmp = (unsigned long) $randfunc();
18919 if (tmp > max) max = tmp;
18921 for (i = 0; max; i++)
18927 if eval $compile_ok; then
18931 echo "(I can't seem to compile the test program...)"
18938 rp="How many bits does your $randfunc() function produce?"
18942 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18943 seedfunc="s$randfunc"
18944 randseedtype=unsigned
18948 rp="How many bits does your $randfunc() function produce?"
18951 seedfunc="s$randfunc"
18952 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18953 if set $seedfunc val -f; eval $csym; $val; then
18954 echo "(Using $seedfunc() to seed random generator)"
18956 echo "(Warning: no $seedfunc() to seed random generator)"
18959 randseedtype=unsigned
18966 : Determine if this is an EBCDIC system
18968 echo "Determining whether or not we are on an EBCDIC system..." >&4
18969 $cat >try.c <<'EOM'
18972 if ('M'==0xd4) return 0;
18979 if eval $compile_ok; then
18980 if $run ./try; then
18981 echo "You seem to speak EBCDIC." >&4
18984 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18987 echo "I'm unable to compile the test program." >&4
18988 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18994 : Check how to flush
18997 Checking how to flush all pending stdio output...
18999 # I only know how to find the first 32 possibly open files on SunOS.
19000 # See also hints/sunos_4_1.sh and util.c --AD
19002 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
19004 $cat >>try.c <<EOCP
19006 #$i_stdlib I_STDLIB
19008 #include <stdlib.h>
19010 #$i_unistd I_UNISTD
19012 # include <unistd.h>
19014 #$d_sysconf HAS_SYSCONF
19015 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
19016 #ifdef HAS_STDIO_STREAM_ARRAY
19017 # define STDIO_STREAM_ARRAY $stdio_stream_array
19022 p = fopen("try.out", "w");
19026 # ifdef TRY_FPRINTF
19030 #ifdef TRY_FFLUSH_NULL
19033 #ifdef TRY_FFLUSH_ALL
19035 long open_max = -1;
19036 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19037 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19039 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19040 open_max = sysconf(_SC_OPEN_MAX);
19043 open_max = FOPEN_MAX;
19046 open_max = OPEN_MAX;
19055 # ifdef HAS_STDIO_STREAM_ARRAY
19056 if (open_max > 0) {
19058 for (i = 0; i < open_max; i++)
19059 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19060 STDIO_STREAM_ARRAY[i]._file < open_max &&
19061 STDIO_STREAM_ARRAY[i]._flag)
19062 fflush(&STDIO_STREAM_ARRAY[i]);
19070 : first we have to find out how _not_ to flush
19072 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19074 set try -DTRY_FPUTC
19075 if eval $compile; then
19076 $run ./try 2>/dev/null
19079 if $test ! -s try.out -a "X$code" = X42; then
19085 set try -DTRY_FPRINTF
19086 if eval $compile; then
19087 $run ./try 2>/dev/null
19090 if $test ! -s try.out -a "X$code" = X42; then
19091 output=-DTRY_FPRINTF
19097 : check for fflush NULL behaviour
19098 case "$fflushNULL" in
19099 '') set try -DTRY_FFLUSH_NULL $output
19100 if eval $compile; then
19101 $run ./try 2>/dev/null
19104 if $test -s try.out -a "X$code" = X42; then
19105 fflushNULL="`$cat try.out`"
19107 if $test "X$code" != X42; then
19109 (If this test failed, don't worry, we'll try another method shortly.)
19114 $rm -f core try.core core.try.*
19115 case "$fflushNULL" in
19117 Your fflush(NULL) works okay for output streams.
19118 Let's see if it clobbers input pipes...
19120 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19121 # bug that improperly flushes the input end of pipes. So we avoid the
19122 # autoflush on fork/system/exec support for now. :-(
19123 $cat >tryp.c <<EOCP
19126 main(int argc, char **argv)
19132 while ((i = getc(stdin)) != -1
19133 && (*bp++ = i) != '\n'
19134 && bp < &buf[1024])
19137 fprintf(stdout, "%s", buf);
19145 fflushNULL="$define"
19147 if eval $compile; then
19149 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19150 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19152 fflush(NULL) seems to behave okay with input streams.
19154 fflushNULL="$define"
19157 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19159 fflushNULL="$undef"
19162 $rm -f core tryp.c tryp.core core.tryp.*
19165 Your fflush(NULL) isn't working (contrary to ANSI C).
19167 fflushNULL="$undef"
19170 Cannot figure out whether your fflush(NULL) works or not.
19171 I'm assuming it doesn't (contrary to ANSI C).
19173 fflushNULL="$undef"
19177 $define|true|[yY]*)
19178 fflushNULL="$define"
19181 fflushNULL="$undef"
19184 : check explicit looping only if NULL did not work, and if the pipe
19185 : bug does not show up on an explicit flush too
19186 case "$fflushNULL" in
19188 $cat >tryp.c <<EOCP
19191 main(int argc, char **argv)
19197 while ((i = getc(stdin)) != -1
19198 && (*bp++ = i) != '\n'
19199 && bp < &buf[1024])
19202 fprintf(stdout, "%s", buf);
19211 if eval $compile; then
19213 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19214 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19216 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19218 : now check for fflushall behaviour
19219 case "$fflushall" in
19220 '') set try -DTRY_FFLUSH_ALL $output
19221 if eval $compile; then
19223 (Now testing the other method--but note that this also may fail.)
19225 $run ./try 2>/dev/null
19228 if $test -s try.out -a "X$code" = X42; then
19229 fflushall="`$cat try.out`"
19233 case "$fflushall" in
19235 Whew. Flushing explicitly all the stdio streams works.
19237 fflushall="$define"
19240 Sigh. Flushing explicitly all the stdio streams doesn't work.
19245 Cannot figure out whether flushing stdio streams explicitly works or not.
19246 I'm assuming it doesn't.
19252 "$define"|true|[yY]*)
19253 fflushall="$define"
19261 All is futile. Even fflush(stdin) clobbers input pipes!
19268 $rm -f core tryp.c tryp.core core.tryp.*
19270 *) fflushall="$undef"
19274 case "$fflushNULL$fflushall" in
19277 OK, I give up. I cannot figure out how to flush pending stdio output.
19278 We won't be flushing handles at all before fork/exec/popen.
19284 : Store the full pathname to the ar program for use in the C program
19285 : Respect a hint or command line value for full_ar.
19290 : Store the full pathname to the sed program for use in the C program
19293 : see what type gids are declared as in the kernel
19295 echo "Looking for the type for group ids returned by getgid()."
19296 set gid_t gidtype xxx stdio.h sys/types.h
19300 xxx=`./findhdr sys/user.h`
19301 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19303 unsigned) dflt="$1 $2" ;;
19307 *) dflt="$gidtype";;
19310 gid_t) echo "gid_t found." ;;
19311 *) rp="What is the type for group ids returned by getgid()?"
19317 : Check the size of GID
19320 *_t) zzz="$gidtype" ;;
19323 echo "Checking the size of $zzz..." >&4
19325 #include <sys/types.h>
19327 #$i_stdlib I_STDLIB
19329 #include <stdlib.h>
19332 printf("%d\n", (int)sizeof($gidtype));
19337 if eval $compile_ok; then
19341 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19344 echo "Your $zzz is $gidsize bytes long."
19349 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19353 : Check if GID is signed
19356 *_t) zzz="$gidtype" ;;
19359 echo "Checking the sign of $zzz..." >&4
19361 #include <sys/types.h>
19372 if eval $compile; then
19376 echo "(I can't execute the test program--guessing unsigned.)" >&4
19380 1) echo "Your $zzz is unsigned." ;;
19381 -1) echo "Your $zzz is signed." ;;
19387 echo "(I can't compile the test program--guessing unsigned.)" >&4
19391 : Check 64bit sizes
19394 if $test X"$quadtype" != X; then
19396 echo "Checking how to print 64-bit integers..." >&4
19398 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19399 $cat >try.c <<'EOCP'
19400 #include <sys/types.h>
19403 int q = 12345678901;
19404 printf("%ld\n", q);
19408 if eval $compile; then
19412 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19413 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19414 echo "We will use %d."
19420 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19421 $cat >try.c <<'EOCP'
19422 #include <sys/types.h>
19425 long q = 12345678901;
19426 printf("%ld\n", q);
19430 if eval $compile; then
19434 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19435 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19436 echo "We will use %ld."
19442 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19443 $cat >try.c <<'EOCP'
19444 #include <sys/types.h>
19445 #include <inttypes.h>
19448 int64_t q = 12345678901;
19449 printf("%" PRId64 "\n", q);
19453 if eval $compile; then
19457 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19458 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19459 echo "We will use the C9X style."
19465 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19467 #include <sys/types.h>
19470 $quadtype q = 12345678901;
19471 printf("%Ld\n", q);
19475 if eval $compile; then
19479 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19480 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19481 echo "We will use %Ld."
19487 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19488 $cat >try.c <<'EOCP'
19489 #include <sys/types.h>
19492 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19493 printf("%lld\n", q);
19497 if eval $compile; then
19501 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19502 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19503 echo "We will use the %lld style."
19509 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19511 #include <sys/types.h>
19514 $quadtype q = 12345678901;
19515 printf("%qd\n", q);
19519 if eval $compile; then
19523 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19524 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19525 echo "We will use %qd."
19531 if $test X"$sPRId64" = X; then
19532 echo "Cannot figure out how to print 64-bit integers." >&4
19539 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19540 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19542 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19543 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19547 : Check format strings for internal types
19549 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19551 if $test X"$ivsize" = X8; then
19552 ivdformat="$sPRId64"
19553 uvuformat="$sPRIu64"
19554 uvoformat="$sPRIo64"
19555 uvxformat="$sPRIx64"
19556 uvXUformat="$sPRIXU64"
19558 if $test X"$ivsize" = X"$longsize"; then
19565 if $test X"$ivsize" = X"$intsize"; then
19573 if $test X"$ivsize" = X"$shortsize"; then
19584 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19585 nveformat="$sPRIeldbl"
19586 nvfformat="$sPRIfldbl"
19587 nvgformat="$sPRIgldbl"
19588 nvEUformat="$sPRIEUldbl"
19589 nvFUformat="$sPRIFUldbl"
19590 nvGUformat="$sPRIGUldbl"
19600 case "$ivdformat" in
19601 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19606 : Check format string for GID
19609 $echo "Checking the format string to be used for gids..." >&4
19612 -1) if $test X"$gidsize" = X"$ivsize"; then
19613 gidformat="$ivdformat"
19615 if $test X"$gidsize" = X"$longsize"; then
19618 if $test X"$gidsize" = X"$intsize"; then
19621 if $test X"$gidsize" = X"$shortsize"; then
19628 *) if $test X"$gidsize" = X"$uvsize"; then
19629 gidformat="$uvuformat"
19631 if $test X"$gidsize" = X"$longsize"; then
19634 if $test X"$gidsize" = X"$intsize"; then
19637 if $test X"$gidsize" = X"$shortsize"; then
19646 : see if getgroups exists
19647 set getgroups d_getgrps
19650 : see if setgroups exists
19651 set setgroups d_setgrps
19654 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19656 case "$d_getgrps$d_setgrps" in
19658 case "$groupstype" in
19659 '') dflt="$gidtype" ;;
19660 *) dflt="$groupstype" ;;
19663 What type of pointer is the second argument to getgroups() and setgroups()?
19664 Usually this is the same as group ids, $gidtype, but not always.
19667 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19671 *) groupstype="$gidtype";;
19674 : MAD = Misc Attribute Definition
19676 if $test $patchlevel -lt 9; then
19677 : MAD is not available in 5.8.x or earlier.
19681 $define|true|[yY]*) dflt='y' ;;
19686 Would you like to build with Misc Attribute Decoration? This is development
19687 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19688 overhead on the interpreter.
19690 If this doesn't make any sense to you, just accept the default '$dflt'.
19692 rp='Build Perl with MAD?'
19697 madlyh='madly.h madly.act madly.tab'
19699 madlyobj="madly$_o" ;;
19708 : check whether make sets MAKE
19710 echo "Checking if your $make program sets \$(MAKE)..." >&4
19711 case "$make_set_make" in
19713 $sed 's/^X //' > testmake.mak << 'EOF'
19715 X @echo 'maketemp="$(MAKE)"'
19717 case "`$make -f testmake.mak 2>/dev/null`" in
19718 *maketemp=*) make_set_make='#' ;;
19719 *) make_set_make="MAKE=$make" ;;
19721 $rm -f testmake.mak
19724 case "$make_set_make" in
19725 '#') echo "Yup, it does.";;
19726 *) echo "Nope, it doesn't.";;
19729 : see what type is used for mode_t
19730 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19731 set mode_t modetype int stdio.h sys/types.h
19734 : see if we need va_copy
19736 case "$i_stdarg" in
19739 #include <stdarg.h>
19741 #$i_stdlib I_STDLIB
19743 #include <stdlib.h>
19745 #include <signal.h>
19748 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19750 return vfprintf(f, fmt, *valp);
19754 myvfprintf(FILE *f, const char *fmt, va_list val)
19756 return ivfprintf(f, fmt, &val);
19760 myprintf(char *fmt, ...)
19763 va_start(val, fmt);
19764 return myvfprintf(stdout, fmt, val);
19768 main(int ac, char **av)
19770 signal(SIGSEGV, exit);
19772 myprintf("%s%cs all right, then\n", "that", '\'');
19777 if eval $compile && $run ./try 2>&1 >/dev/null; then
19778 case "`$run ./try`" in
19779 "that's all right, then")
19785 yes) echo "It seems that you don't need va_copy()." >&4
19786 need_va_copy="$undef"
19788 *) echo "It seems that va_copy() or similar will be needed." >&4
19789 need_va_copy="$define"
19794 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19798 : see what type is used for size_t
19799 rp="What is the type used for the length parameter for string functions?"
19800 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19803 : check for type of arguments to gethostbyaddr.
19804 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19805 case "$d_gethbyaddr" in
19809 Checking to see what type of arguments are accepted by gethostbyaddr().
19811 hdrs="$define sys/types.h
19812 $d_socket sys/socket.h
19813 $i_niin netinet/in.h
19815 $i_unistd unistd.h"
19816 : The first arg can 'char *' or 'void *'
19817 : The second arg is some of integral type
19818 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19819 for yyy in size_t long int; do
19820 case "$netdb_host_type" in
19821 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19822 if ./protochk "$try" $hdrs; then
19823 echo "Your system accepts $xxx for the first arg."
19824 echo "...and $yyy for the second arg."
19825 netdb_host_type="$xxx"
19826 netdb_hlen_type="$yyy"
19832 : In case none of those worked, prompt the user.
19833 case "$netdb_host_type" in
19834 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19837 netdb_host_type=$ans
19838 rp='What is the type for the 2nd argument to gethostbyaddr?'
19841 netdb_hlen_type=$ans
19845 *) : no gethostbyaddr, so pick harmless defaults
19846 netdb_host_type='char *'
19847 netdb_hlen_type="$sizetype"
19850 # Remove the "const" if needed. -- but then we'll have a
19852 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19855 : check for type of argument to gethostbyname.
19856 if test "X$netdb_name_type" = X ; then
19857 case "$d_gethbyname" in
19861 Checking to see what type of argument is accepted by gethostbyname().
19863 hdrs="$define sys/types.h
19864 $d_socket sys/socket.h
19865 $i_niin netinet/in.h
19867 $i_unistd unistd.h"
19868 for xxx in "const char *" "char *"; do
19869 case "$netdb_name_type" in
19870 '') try="extern struct hostent *gethostbyname($xxx);"
19871 if ./protochk "$try" $hdrs; then
19872 echo "Your system accepts $xxx."
19873 netdb_name_type="$xxx"
19878 : In case none of those worked, prompt the user.
19879 case "$netdb_name_type" in
19880 '') rp='What is the type for the 1st argument to gethostbyname?'
19883 netdb_name_type=$ans
19887 *) : no gethostbyname, so pick harmless default
19888 netdb_name_type='char *'
19893 : check for type of 1st argument to getnetbyaddr.
19894 if test "X$netdb_net_type" = X ; then
19895 case "$d_getnbyaddr" in
19899 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19901 hdrs="$define sys/types.h
19902 $d_socket sys/socket.h
19903 $i_niin netinet/in.h
19905 $i_unistd unistd.h"
19906 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19907 case "$netdb_net_type" in
19908 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19909 if ./protochk "$try" $hdrs; then
19910 echo "Your system accepts $xxx."
19911 netdb_net_type="$xxx"
19916 : In case none of those worked, prompt the user.
19917 case "$netdb_net_type" in
19918 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19921 netdb_net_type=$ans
19925 *) : no getnetbyaddr, so pick harmless default
19926 netdb_net_type='long'
19930 : locate the preferred pager for this system
19937 [a-zA-Z]:/*) dflt=$pg;;
19941 [a-zA-Z]:/*) dflt=$more;;
19945 [a-zA-Z]:/*) dflt=$less;;
19948 '') dflt=/usr/ucb/more;;
19956 rp='What pager is used on your system?'
19960 : see what type pids are declared as in the kernel
19961 rp="What is the type of process ids on this system?"
19962 set pid_t pidtype int stdio.h sys/types.h
19965 : see if ar generates random libraries by itself
19967 echo "Checking how to generate random libraries on your machine..." >&4
19968 echo 'int bar1() { return bar2(); }' > bar1.c
19969 echo 'int bar2() { return 2; }' > bar2.c
19971 #$i_stdlib I_STDLIB
19973 #include <stdlib.h>
19975 int main() { printf("%d\n", bar1()); exit(0); }
19977 $cc $ccflags -c bar1.c >/dev/null 2>&1
19978 $cc $ccflags -c bar2.c >/dev/null 2>&1
19979 $cc $ccflags -c foo.c >/dev/null 2>&1
19980 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19981 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19982 $run ./foobar >/dev/null 2>&1; then
19983 echo "$ar appears to generate random libraries itself."
19985 if [ "X$ranlib" = "X" ]; then
19988 elif $ar s bar$_a >/dev/null 2>&1 &&
19989 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19990 $run ./foobar >/dev/null 2>&1; then
19991 echo "a table of contents needs to be added with '$ar s'."
19994 elif $ar ts bar$_a >/dev/null 2>&1 &&
19995 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19996 $run ./foobar >/dev/null 2>&1; then
19997 echo "a table of contents needs to be added with '$ar ts'."
20004 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
20005 $test -f $ranlib || ranlib=''
20008 if $test -n "$ranlib"; then
20009 echo "your system has '$ranlib'; we'll use that."
20012 echo "your system doesn't seem to support random libraries"
20013 echo "so we'll use lorder and tsort to order the libraries."
20020 : see if this is a values.h system
20021 set values.h i_values
20024 : Check the max offset that gmtime accepts
20025 echo "Checking max offsets that gmtime () accepts"
20028 define) yyy="#include <values.h>" ;;
20033 #include <sys/types.h>
20042 void gm_check (time_t t)
20045 if (tmp == NULL || tmp->tm_year < -1900)
20056 gm_check (MAXLONG);
20058 if (tmp == NULL || tmp->tm_year < 0) {
20059 for (i = 63; i >= 0; i--) {
20060 time_t x = pt | ((time_t)1 << i);
20061 if (x < 0) continue;
20065 printf ("sGMTIME_max=%ld\n", pt);
20074 gm_check (MINLONG);
20077 for (i = 36; i >= 0; i--) {
20078 time_t x = pt - ((time_t)1 << i);
20079 if (x > 0) continue;
20083 printf ("sGMTIME_min=%ld\n", pt);
20087 int main (int argc, char *argv[])
20089 fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
20096 if eval $compile; then
20100 echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
20104 : check for type of arguments to select.
20105 case "$selecttype" in
20106 '') case "$d_select" in
20110 Checking to see what type of arguments are accepted by select().
20112 hdrs="$define sys/types.h
20113 $i_systime sys/time.h
20114 $i_sysselct sys/select.h
20115 $d_socket sys/socket.h"
20116 : The first arg can be int, unsigned, or size_t
20117 : The last arg may or may not be 'const'
20119 : void pointer has been seen but using that
20120 : breaks the selectminbits test
20121 for xxx in 'fd_set *' 'int *'; do
20122 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20123 for tmo in 'struct timeval *' 'const struct timeval *'; do
20125 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20126 if ./protochk "$try" $hdrs; then
20127 echo "Your system accepts $xxx."
20136 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20137 case "$d_fd_set" in
20138 $define) dflt="fd_set *" ;;
20147 *) : no select, so pick a harmless default
20154 : check for the select 'width'
20155 case "$selectminbits" in
20156 '') safebits=`expr $ptrsize \* 8`
20157 case "$d_select" in
20161 Checking to see on how many bits at a time your select() operates...
20164 #include <sys/types.h>
20166 #$i_systime I_SYS_TIME
20167 #$i_systimek I_SYS_TIME_KERNEL
20172 # ifdef I_SYS_TIME_KERNEL
20175 # include <sys/time.h>
20176 # ifdef I_SYS_TIME_KERNEL
20180 #$i_sysselct I_SYS_SELECT
20181 #ifdef I_SYS_SELECT
20182 #include <sys/select.h>
20184 #$d_socket HAS_SOCKET
20186 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20189 #$i_stdlib I_STDLIB
20191 #include <stdlib.h>
20194 #define S sizeof(*(b))
20196 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20197 #define NBITS (NBYTES * 8)
20199 char *s = (char *)malloc(NBYTES);
20208 fp = fopen("try.c", "r");
20214 b = ($selecttype)s;
20215 for (i = 0; i < NBITS; i++)
20219 select(fd + 1, b, 0, 0, &t);
20220 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20222 printf("%d\n", i + 1);
20227 if eval $compile_ok; then
20228 selectminbits=`$run ./try`
20229 case "$selectminbits" in
20231 Cannot figure out on how many bits at a time your select() operates.
20232 I'll play safe and guess it is $safebits bits.
20234 selectminbits=$safebits
20235 bits="$safebits bits"
20238 *) bits="$selectminbits bits" ;;
20240 echo "Your select() operates on $bits at a time." >&4
20242 rp='What is the minimum number of bits your select() operates on?'
20243 case "$byteorder" in
20244 12345678) dflt=64 ;;
20250 selectminbits="$val"
20254 *) : no select, so pick a harmless default
20255 selectminbits=$safebits
20261 : Trace out the files included by signal.h, then look for SIGxxx names.
20262 if [ "X$fieldn" = X ]; then
20263 : Just make some guesses. We check them later.
20264 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20266 xxx=`echo '#include <signal.h>' |
20267 $cppstdin $cppminus $cppflags 2>/dev/null |
20268 $grep '^[ ]*#.*include' |
20269 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20270 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20273 for xx in $xxx /dev/null ; do
20274 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20276 case "$xxxfiles" in
20277 '') xxxfiles=`./findhdr signal.h` ;;
20280 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20281 print substr($2, 4, 20)
20283 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20284 print substr($3, 4, 20)
20286 : Append some common names just in case the awk scan failed.
20287 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20288 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20289 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20290 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20291 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20293 : generate a few handy files for later
20294 $cat > signal.c <<EOCP
20295 #include <sys/types.h>
20296 #include <signal.h>
20297 #$i_stdlib I_STDLIB
20299 #include <stdlib.h>
20304 /* Strange style to avoid deeply-nested #if/#else/#endif */
20307 # define NSIG (_NSIG)
20313 # define NSIG (SIGMAX+1)
20319 # define NSIG (SIG_MAX+1)
20325 # define NSIG (_SIG_MAX+1)
20331 # define NSIG (MAXSIG+1)
20337 # define NSIG (MAX_SIG+1)
20342 # ifdef SIGARRAYSIZE
20343 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20349 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20353 /* Default to some arbitrary number that's big enough to get most
20354 of the common signals.
20360 printf("NSIG %d\n", NSIG);
20366 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20368 printf "#ifdef SIG"; printf $1; printf "\n"
20369 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20370 printf $1; printf ");\n"
20374 printf "#endif /* JUST_NSIG */\n";
20375 printf "exit(0);\n}\n";
20378 $cat >signal.awk <<'EOP'
20379 BEGIN { ndups = 0 }
20380 $1 ~ /^NSIG$/ { nsig = $2 }
20381 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20382 if ($2 > maxsig) { maxsig = $2 }
20383 if (sig_name[$2]) {
20384 dup_name[ndups] = $1
20385 dup_num[ndups] = $2
20397 printf("NSIG %d\n", nsig);
20398 for (n = 1; n < nsig; n++) {
20400 printf("%s %d\n", sig_name[n], sig_num[n])
20403 printf("NUM%d %d\n", n, n)
20406 for (n = 0; n < ndups; n++) {
20407 printf("%s %d\n", dup_name[n], dup_num[n])
20411 $cat >signal_cmd <<EOS
20413 if $test -s signal.lst; then
20414 echo "Using your existing signal.lst file"
20419 $cat >>signal_cmd <<'EOS'
20422 if eval $compile_ok; then
20423 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20424 $uniq | $awk -f signal.awk >signal.lst
20426 echo "(I can't seem be able to compile the whole test program)" >&4
20427 echo "(I'll try it in little pieces.)" >&4
20428 set signal -DJUST_NSIG
20429 if eval $compile_ok; then
20430 $run ./signal$_exe > signal.nsg
20433 echo "I can't seem to figure out how many signals you have." >&4
20434 echo "Guessing 50." >&4
20435 echo 'NSIG 50' > signal.nsg
20437 : Now look at all the signal names, one at a time.
20438 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20439 $cat > signal.c <<EOCP
20440 #include <sys/types.h>
20441 #include <signal.h>
20444 printf("$xx %d\n", SIG${xx});
20449 if eval $compile; then
20450 echo "SIG${xx} found."
20451 $run ./signal$_exe >> signal.ls1
20453 echo "SIG${xx} NOT found."
20456 if $test -s signal.ls1; then
20457 $cat signal.nsg signal.ls1 |
20458 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20462 if $test -s signal.lst; then
20465 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20466 echo 'kill -l' >signal
20467 set X `csh -f <signal`
20471 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20473 echo $@ | $tr ' ' $trnl | \
20474 $awk '{ printf "%s %d\n", $1, ++s; }
20475 END { printf "NSIG %d\n", ++s }' >signal.lst
20477 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20479 chmod a+x signal_cmd
20480 $eunicefix signal_cmd
20482 : generate list of signal names
20484 case "$sig_name_init" in
20486 *) case "$sig_num_init" in
20487 ''|*,*) doinit=yes ;;
20492 echo "Generating a list of signal names and numbers..." >&4
20494 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20495 sig_name=`$awk 'BEGIN { printf "ZERO " }
20496 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20497 sig_num=`$awk 'BEGIN { printf "0 " }
20498 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20499 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20500 !/^NSIG/ { printf "\"%s\", ", $1 }
20501 END { printf "0\n" }' signal.lst`
20502 sig_num_init=`$awk 'BEGIN { printf "0, " }
20503 !/^NSIG/ { printf "%d, ", $2}
20504 END { printf "0\n"}' signal.lst`
20507 echo "The following $sig_count signals are available:"
20509 echo $sig_name | $awk \
20510 'BEGIN { linelen = 0 }
20512 for (i = 1; i <= NF; i++) {
20513 name = "SIG" $i " "
20514 linelen = linelen + length(name)
20515 if (linelen > 70) {
20517 linelen = length(name)
20523 sig_size=`echo $sig_name | awk '{print NF}'`
20524 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20526 : Check size of size
20528 case "$sizetype" in
20529 *_t) zzz="$sizetype" ;;
20530 *) zzz="filesize" ;;
20532 echo "Checking the size of $zzz..." >&4
20534 #include <sys/types.h>
20536 #$i_stdlib I_STDLIB
20538 #include <stdlib.h>
20541 printf("%d\n", (int)sizeof($sizetype));
20546 if eval $compile_ok; then
20550 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20553 echo "Your $zzz size is $sizesize bytes."
20558 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20562 : check for socklen_t
20564 echo "Checking to see if you have socklen_t..." >&4
20566 #include <sys/types.h>
20567 #$d_socket HAS_SOCKET
20569 #include <sys/socket.h>
20571 int main() { socklen_t x = 16; }
20574 if eval $compile; then
20576 echo "You have socklen_t."
20579 echo "You do not have socklen_t."
20580 case "$sizetype" in
20581 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20588 : see if this is a socks.h system
20589 set socks.h i_socks
20592 : check for type of the size argument to socket calls
20593 case "$d_socket" in
20597 Checking to see what type is the last argument of accept().
20600 case "$d_socklen_t" in
20601 "$define") yyy="$yyy socklen_t"
20603 yyy="$yyy $sizetype int long unsigned"
20604 for xxx in $yyy; do
20605 case "$socksizetype" in
20606 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20607 case "$usesocks" in
20609 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20610 echo "Your system accepts '$xxx *' for the last argument of accept()."
20611 socksizetype="$xxx"
20614 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20615 echo "Your system accepts '$xxx *' for the last argument of accept()."
20616 socksizetype="$xxx"
20623 : In case none of those worked, prompt the user.
20624 case "$socksizetype" in
20625 '') rp='What is the type for socket address structure sizes?'
20632 *) : no sockets, so pick relatively harmless default
20637 : see what type is used for signed size_t
20638 set ssize_t ssizetype int stdio.h sys/types.h
20643 #$i_stdlib I_STDLIB
20645 #include <stdlib.h>
20647 #include <sys/types.h>
20648 #define Size_t $sizetype
20649 #define SSize_t $dflt
20652 if (sizeof(Size_t) == sizeof(SSize_t))
20654 else if (sizeof(Size_t) == sizeof(int))
20663 if eval $compile_ok && $run ./try > /dev/null; then
20664 ssizetype=`$run ./try`
20665 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20668 Help! I can't compile and run the ssize_t test program: please enlighten me!
20669 (This is probably a misconfiguration in your system or libraries, and
20670 you really ought to fix it. Still, I'll try anyway.)
20672 I need a type that is the same size as $sizetype, but is guaranteed to
20673 be signed. Common values are ssize_t, int and long.
20676 rp="What signed type is the same size as $sizetype?"
20682 : see what type of char stdio uses.
20684 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
20685 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20686 echo "Your stdio uses unsigned chars." >&4
20687 stdchar="unsigned char"
20689 echo "Your stdio uses signed chars." >&4
20694 : see what type uids are declared as in the kernel
20696 echo "Looking for the type for user ids returned by getuid()."
20697 set uid_t uidtype xxx stdio.h sys/types.h
20701 xxx=`./findhdr sys/user.h`
20702 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20704 unsigned) dflt="$1 $2" ;;
20708 *) dflt="$uidtype";;
20711 uid_t) echo "uid_t found." ;;
20712 *) rp="What is the type for user ids returned by getuid()?"
20718 : Check size of UID
20721 *_t) zzz="$uidtype" ;;
20724 echo "Checking the size of $zzz..." >&4
20726 #include <sys/types.h>
20728 #$i_stdlib I_STDLIB
20730 #include <stdlib.h>
20733 printf("%d\n", (int)sizeof($uidtype));
20738 if eval $compile_ok; then
20742 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20745 echo "Your $zzz is $uidsize bytes long."
20750 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20753 : Check if UID is signed
20756 *_t) zzz="$uidtype" ;;
20759 echo "Checking the sign of $zzz..." >&4
20761 #include <sys/types.h>
20772 if eval $compile; then
20776 echo "(I can't execute the test program--guessing unsigned.)" >&4
20780 1) echo "Your $zzz is unsigned." ;;
20781 -1) echo "Your $zzz is signed." ;;
20787 echo "(I can't compile the test program--guessing unsigned.)" >&4
20791 : Check format string for UID
20793 $echo "Checking the format string to be used for uids..." >&4
20796 -1) if $test X"$uidsize" = X"$ivsize"; then
20797 uidformat="$ivdformat"
20799 if $test X"$uidsize" = X"$longsize"; then
20802 if $test X"$uidsize" = X"$intsize"; then
20805 if $test X"$uidsize" = X"$shortsize"; then
20812 *) if $test X"$uidsize" = X"$uvsize"; then
20813 uidformat="$uvuformat"
20815 if $test X"$uidsize" = X"$longsize"; then
20818 if $test X"$uidsize" = X"$intsize"; then
20821 if $test X"$uidsize" = X"$shortsize"; then
20830 : Check if site customization support was requested
20831 case "$usesitecustomize" in
20832 $define|true|[Yy]*)
20833 usesitecustomize="$define"
20836 usesitecustomize="$undef"
20840 : determine compiler compiler
20849 if $test -f "$byacc$_exe"; then
20851 comp="byacc or $comp"
20853 if $test -f "$bison$_exe"; then
20854 comp="$comp or bison -y"
20856 rp="Which compiler compiler ($comp) shall I use?"
20865 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20871 : see if this is a assert.h system
20872 set assert.h i_assert
20875 : see if this is a fp.h system
20879 : see if this is a fp_class.h system
20880 set fp_class.h i_fp_class
20883 : see if gdbm.h is available
20888 : see if gdbm_open exists
20889 set gdbm_open d_gdbm_open
20891 case "$d_gdbm_open" in
20894 echo "We won't be including <gdbm.h>"
20903 : see if ndbm.h is available
20906 : Compatibility location for RedHat 7.1
20907 set gdbm/ndbm.h i_gdbmndbm
20909 : Compatibility location for Debian 4.0
20910 set gdbm-ndbm.h i_gdbm_ndbm
20913 if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
20914 : see if dbm_open exists
20915 set dbm_open d_dbm_open
20917 case "$d_dbm_open" in
20920 i_gdbmndbm="$undef"
20921 i_gdbm_ndbm="$undef"
20922 echo "We won't be including <ndbm.h>"
20932 : see if this is a ieeefp.h system
20933 case "$i_ieeefp" in
20934 '' ) set ieeefp.h i_ieeefp
20939 : see if this is a libutil.h system
20940 set libutil.h i_libutil
20943 : see if mach cthreads are available
20944 if test "X$usethreads" = "X$define"; then
20945 set mach/cthreads.h i_machcthr
20948 i_machcthr="$undef"
20951 : see if this is a mntent.h system
20952 set mntent.h i_mntent
20955 : see if net/errno.h is available
20957 set net/errno.h val
20960 : Unfortunately, it causes problems on some systems. Arrgh.
20963 cat > try.c <<'EOM'
20966 #include <net/errno.h>
20972 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20973 echo "We'll be including <net/errno.h>." >&4
20975 echo "We won't be including <net/errno.h>." >&4
20984 : see if netinet/tcp.h is available
20985 set netinet/tcp.h i_netinettcp
20988 : see if this is a poll.h system
20992 : see if this is a prot.h system
20996 : Preprocessor symbols
20998 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20999 $cat <<'EOSH' > Cppsym.know
21000 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
21001 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
21002 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
21003 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
21004 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
21005 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
21006 bull c cadmus clipper CMU COFF COMPILER_VERSION
21007 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
21008 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
21009 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
21010 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
21012 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
21013 H3050R H3050RX hbullx20 hcx host_mips
21014 hp200 hp300 hp700 HP700 hp800 hp9000
21015 hp9000s200 hp9000s300 hp9000s400 hp9000s500
21016 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
21017 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
21018 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
21019 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
21020 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
21021 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
21022 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
21023 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
21024 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
21025 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
21026 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
21027 MATH_HAS_NO_SIDE_EFFECTS
21028 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
21029 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
21030 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
21031 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
21032 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
21033 NetBSD news1500 news1700 news1800 news1900 news3700
21034 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
21035 ns32016 ns32332 ns32k nsc32000
21036 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
21037 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
21038 pc532 pdp11 PGC PIC plexus PORTAR posix
21039 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
21040 POSIX_C_SOURCE POSIX_SOURCE POWER
21041 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
21042 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
21043 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
21044 sony sony_news sonyrisc sparc sparclite spectrum
21045 stardent stdc STDC_EXT stratos sun sun3 sun386
21046 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
21047 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
21048 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
21049 sysV68 sysV88 Tek4132 Tek4300 titan
21050 TM3200 TM5400 TM5600
21051 tower tower32 tower32_200 tower32_600 tower32_700
21052 tower32_800 tower32_850 tss
21053 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
21054 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
21055 unix UNIX95 UNIX99 unixpc unos
21056 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
21057 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
21058 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
21060 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
21061 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
21062 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
21065 # Maybe put other stuff here too.
21066 cat <<EOSH >>Cppsym.know
21069 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
21070 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
21071 $cat Cppsym.know > Cppsym.c
21072 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
21073 $rm -f Cppsym.a Cppsym.b Cppsym.c
21074 cat <<EOSH > Cppsym
21076 if $test \$# -gt 0; then
21077 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
21078 if $test -s Cppsym.got; then
21085 $tr " " "$trnl" | ./Cppsym.try
21091 cat <<EOSH > Cppsym.try
21093 cat <<'EOCP' > try.c
21096 #define STRINGIFY(a) "a"
21098 #if cpp_stuff == 42
21099 #define StGiFy(a) #a
21100 #define STRINGIFY(a) StGiFy(a)
21102 #if $cpp_stuff != 1 && $cpp_stuff != 42
21103 # include "Bletch: How does this C preprocessor stringify macros?"
21109 cat <<'EOSH' >> Cppsym.try
21111 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21112 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21113 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21114 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21116 echo 'return 0;}' >> try.c
21118 cat <<EOSH >> Cppsym.try
21120 case "$osname-$gccversion" in
21121 irix-) ccflags="\$ccflags -woff 1178" ;;
21122 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21124 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21126 chmod +x Cppsym.try
21127 $eunicefix Cppsym.try
21128 ./Cppsym < Cppsym.know > Cppsym.true
21129 : Add in any linux cpp "predefined macros":
21130 case "$osname::$gccversion" in
21133 rm -f $tHdrH'.h' $tHdrH
21135 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21136 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21137 if [ -s $tHdrH'_cppsym.real' ]; then
21138 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21141 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21144 : now check the C compiler for additional symbols
21145 postprocess_cc_v=''
21147 aix) postprocess_cc_v="|$tr , ' '" ;;
21154 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21157 -D*) echo "\$i" | $sed 's/^-D//';;
21158 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21163 postprocess_cc_v=''
21166 ./ccsym > ccsym1.raw
21167 if $test -s ccsym1.raw; then
21168 $sort ccsym1.raw | $uniq >ccsym.raw
21170 mv ccsym1.raw ccsym.raw
21173 $awk '/\=/ { print $0; next }
21174 { print $0"=1" }' ccsym.raw >ccsym.list
21175 $comm -13 Cppsym.true ccsym.list >ccsym.own
21176 $comm -12 Cppsym.true ccsym.list >ccsym.com
21177 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21179 if $test -z ccsym.raw; then
21180 echo "Your C compiler doesn't seem to define any symbols!" >&4
21182 echo "However, your C preprocessor defines the following symbols:"
21185 cppsymbols=`$cat Cppsym.true`
21186 cppsymbols=`echo $cppsymbols`
21187 cppccsymbols="$cppsymbols"
21189 if $test -s ccsym.com; then
21190 echo "Your C compiler and pre-processor define these symbols:"
21191 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21194 cppccsymbols=`$cat ccsym.com`
21195 cppccsymbols=`echo $cppccsymbols`
21196 $test "$silent" || sleep 1
21198 if $test -s ccsym.cpp; then
21199 $test "$also" && echo " "
21200 echo "Your C pre-processor ${also}defines the following symbols:"
21201 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21203 cppsymbols=`$cat ccsym.cpp`
21204 cppsymbols=`echo $cppsymbols`
21205 $test "$silent" || sleep 1
21207 if $test -s ccsym.own; then
21208 $test "$also" && echo " "
21209 echo "Your C compiler ${also}defines the following cpp symbols:"
21210 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21211 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21212 ccsymbols=`$cat ccsym.own`
21213 ccsymbols=`echo $ccsymbols`
21214 $test "$silent" || sleep 1
21218 : see if this is a termio system
21222 if $test `./findhdr termios.h`; then
21223 set tcsetattr i_termios
21229 "$define") echo "You have POSIX termios.h... good!" >&4;;
21230 *) if ./Cppsym pyr; then
21231 case "`/bin/universe`" in
21232 ucb) if $test `./findhdr sgtty.h`; then
21234 echo "<sgtty.h> found." >&4
21236 echo "System is pyramid with BSD universe."
21237 ./warn "<sgtty.h> not found--you could have problems."
21239 *) if $test `./findhdr termio.h`; then
21241 echo "<termio.h> found." >&4
21243 echo "System is pyramid with USG universe."
21244 ./warn "<termio.h> not found--you could have problems."
21248 if $test `./findhdr termio.h`; then
21249 echo "<termio.h> found." >&4
21251 elif $test `./findhdr sgtty.h`; then
21252 echo "<sgtty.h> found." >&4
21255 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21258 if $test `./findhdr sgtty.h`; then
21259 echo "<sgtty.h> found." >&4
21261 elif $test `./findhdr termio.h`; then
21262 echo "<termio.h> found." >&4
21265 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21269 set i_termio; eval $setvar
21270 val=$val2; set i_sgtty; eval $setvar
21271 val=$val3; set i_termios; eval $setvar
21273 : see if stddef is available
21274 set stddef.h i_stddef
21277 : see if sys/access.h is available
21278 set sys/access.h i_sysaccess
21281 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21282 set sys/filio.h i_sysfilio
21285 if $test `./findhdr sys/ioctl.h`; then
21287 echo '<sys/ioctl.h> found.' >&4
21290 if $test $i_sysfilio = "$define"; then
21291 echo '<sys/ioctl.h> NOT found.' >&4
21293 $test $i_sgtty = "$define" && xxx="sgtty.h"
21294 $test $i_termio = "$define" && xxx="termio.h"
21295 $test $i_termios = "$define" && xxx="termios.h"
21296 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21302 : see if socket ioctl defs are in sys/sockio.h
21304 xxx=`./findhdr sys/sockio.h`
21305 if $test "$xxx"; then
21306 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21308 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21311 echo "No socket ioctls found in <sys/sockio.h>." >&4
21316 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21322 : see if this is a syslog.h system
21323 set syslog.h i_syslog
21326 : see if this is a sys/mode.h system
21327 set sys/mode.h i_sysmode
21330 : see if there is a sys/poll.h file
21331 set sys/poll.h i_syspoll
21334 : see if sys/resource.h has to be included
21335 set sys/resource.h i_sysresrc
21338 : see if sys/security.h is available
21339 set sys/security.h i_syssecrt
21342 : see if this is a sys/statvfs.h system
21343 set sys/statvfs.h i_sysstatvfs
21346 : see if this is a sys/un.h system
21347 set sys/un.h i_sysun
21350 : see if this is a sys/utsname.h system
21351 set sys/utsname.h i_sysutsname
21354 : see if this is a syswait system
21355 set sys/wait.h i_syswait
21358 : see if this is a ustat.h system
21359 set ustat.h i_ustat
21362 : see if this is an utime system
21363 set utime.h i_utime
21366 : see if this is a vfork system
21369 set vfork.h i_vfork
21379 echo "Looking for extensions..." >&4
21380 : If we are using the old config.sh, known_extensions may contain
21381 : old or inaccurate or duplicate values.
21382 known_extensions=''
21383 nonxs_extensions=''
21384 : We do not use find because it might not be available.
21385 : We do not just use MANIFEST because the user may have dropped
21386 : some additional extensions into the source tree and expect them
21389 : Function to recursively find available extensions, ignoring DynaLoader
21390 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21394 DynaLoader|dynaload) ;;
21396 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21397 known_extensions="$known_extensions $1$xxx";
21398 elif $test -f $xxx/Makefile.PL; then
21399 nonxs_extensions="$nonxs_extensions $1$xxx";
21401 if $test -d $xxx -a $# -lt 10; then
21404 eval $find_extensions;
21416 eval $find_extensions
21417 # Special case: Add in modules that nest beyond the first level.
21418 # Currently threads/shared and Hash/Util/FieldHash, since they are
21419 # not picked up by the recursive find above (and adding in general
21420 # recursive finding breaks SDBM_File/sdbm).
21421 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21422 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21423 set X $known_extensions
21425 known_extensions="$*"
21426 set X $nonxs_extensions
21428 nonxs_extensions="$*"
21431 : Now see which are supported on this system.
21433 for xxx in $known_extensions ; do
21437 $define) avail_ext="$avail_ext $xxx" ;;
21440 GDBM_File|gdbm_fil)
21442 $define) avail_ext="$avail_ext $xxx" ;;
21445 I18N/Langinfo|i18n_lan)
21446 case "$i_langinfo$d_nl_langinfo" in
21447 $define$define) avail_ext="$avail_ext $xxx" ;;
21451 : XXX Do we need a useipcsysv variable here
21452 case "${d_msg}${d_sem}${d_shm}" in
21453 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21456 NDBM_File|ndbm_fil)
21459 case "$osname-$use64bitint" in
21462 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21465 *) avail_ext="$avail_ext $xxx" ;;
21470 ODBM_File|odbm_fil)
21471 case "${i_dbm}${i_rpcsvcdbm}" in
21473 case "$d_cplusplus" in
21474 define) ;; # delete as a function name will not work
21475 *) case "$osname-$use64bitint" in
21478 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21481 *) avail_ext="$avail_ext $xxx" ;;
21489 case "$useopcode" in
21490 true|define|y) avail_ext="$avail_ext $xxx" ;;
21494 case "$useposix" in
21495 true|define|y) avail_ext="$avail_ext $xxx" ;;
21499 case "$d_socket" in
21502 beos) ;; # not unless BONE
21503 *) avail_ext="$avail_ext $xxx" ;;
21508 Sys/Syslog|sys/syslog)
21509 : XXX syslog requires socket
21510 case "$d_socket" in
21511 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21515 case "$usethreads" in
21517 case "$use5005threads" in
21518 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21522 threads|threads/shared)
21523 # threads and threads::shared are special cases.
21524 # To stop people from asking "Perl 5.8.0 was supposed
21525 # to have this new fancy threads implementation but my
21526 # perl doesn't have it" and from people trying to
21527 # (re)install the threads module using CPAN.pm and
21528 # CPAN.pm then offering to reinstall Perl 5.8.0,
21529 # the threads.pm and threads/shared.pm will always be
21530 # there, croaking informatively ("you need to rebuild
21531 # all of Perl with threads, sorry") when threads haven't
21532 # been compiled in.
21534 avail_ext="$avail_ext $xxx"
21538 cygwin) avail_ext="$avail_ext $xxx" ;;
21541 XS/APItest|xs/apitest)
21542 # This is just for testing. Skip it unless we have dynamic loading.
21545 $define) avail_ext="$avail_ext $xxx" ;;
21548 XS/Typemap|xs/typemap)
21549 # This is just for testing. Skip it unless we have dynamic loading.
21551 $define) avail_ext="$avail_ext $xxx" ;;
21554 *) avail_ext="$avail_ext $xxx"
21563 case "$onlyextensions" in
21565 *) keepextensions=''
21566 echo "You have requested that only certains extensions be included..." >&4
21567 for i in $onlyextensions; do
21568 case " $avail_ext " in
21570 echo "Keeping extension $i."
21571 keepextensions="$keepextensions $i"
21573 *) echo "Ignoring extension $i." ;;
21576 avail_ext="$keepextensions"
21580 case "$noextensions" in
21582 *) keepextensions=''
21583 echo "You have requested that certain extensions be ignored..." >&4
21584 for i in $avail_ext; do
21585 case " $noextensions " in
21586 *" $i "*) echo "Ignoring extension $i." ;;
21587 *) echo "Keeping extension $i.";
21588 keepextensions="$keepextensions $i"
21592 avail_ext="$keepextensions"
21596 : Now see which nonxs extensions are supported on this system.
21597 : For now assume all are.
21599 for xxx in $nonxs_extensions ; do
21601 *) nonxs_ext="$nonxs_ext $xxx"
21613 A number of extensions are supplied with $package. You may choose to
21614 compile these extensions for dynamic loading (the default), compile
21615 them into the $package executable (static loading), or not include
21616 them at all. Answer "none" to include no extensions.
21617 Note that DynaLoader is always built and need not be mentioned here.
21620 case "$dynamic_ext" in
21622 : Exclude those listed in static_ext
21624 for xxx in $avail_ext; do
21625 case " $static_ext " in
21627 *) dflt="$dflt $xxx" ;;
21634 *) dflt="$dynamic_ext"
21635 # Perhaps we are reusing an old out-of-date config.sh.
21638 if test X"$dynamic_ext" != X"$avail_ext"; then
21640 NOTICE: Your previous config.sh list may be incorrect.
21641 The extensions now available to you are
21643 but the default list from your previous config.sh is
21655 rp="What extensions do you wish to load dynamically?"
21658 none) dynamic_ext=' ' ;;
21659 *) dynamic_ext="$ans" ;;
21662 case "$static_ext" in
21664 : Exclude those already listed in dynamic linking
21666 for xxx in $avail_ext; do
21667 case " $dynamic_ext " in
21669 *) dflt="$dflt $xxx" ;;
21676 *) dflt="$static_ext"
21683 rp="What extensions do you wish to load statically?"
21686 none) static_ext=' ' ;;
21687 *) static_ext="$ans" ;;
21692 A number of extensions are supplied with $package. Answer "none"
21693 to include no extensions.
21694 Note that DynaLoader is always built and need not be mentioned here.
21697 case "$static_ext" in
21698 '') dflt="$avail_ext" ;;
21699 *) dflt="$static_ext"
21700 # Perhaps we are reusing an old out-of-date config.sh.
21703 if test X"$static_ext" != X"$avail_ext"; then
21705 NOTICE: Your previous config.sh list may be incorrect.
21706 The extensions now available to you are
21708 but the default list from your previous config.sh is
21717 : Exclude those that are not xs extensions
21721 rp="What extensions do you wish to include?"
21724 none) static_ext=' ' ;;
21725 *) static_ext="$ans" ;;
21730 # Encode is a special case. If we are building Encode as a static
21731 # extension, we need to explicitly list its subextensions as well.
21732 # For other nested extensions, this is handled automatically by
21733 # the appropriate Makefile.PL.
21734 case " $static_ext " in
21735 *" Encode "*) # Add the subextensions of Encode
21737 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21738 static_ext="$static_ext Encode/$xxx"
21744 set X $dynamic_ext $static_ext $nonxs_ext
21748 # Sanity check: We require an extension suitable for use with
21749 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21750 # should show up as failures in the test suite, but it's helpful to
21751 # catch them now.) The 'extensions' list is normally sorted
21752 # alphabetically, so we need to accept either
21753 # DB_File ... Fcntl ... IO ....
21754 # or something like
21755 # Fcntl ... NDBM_File ... IO ....
21756 case " $extensions" in
21757 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21758 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21759 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21760 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21761 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21765 : Remove libraries needed only for extensions
21766 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21767 : The exception is SunOS 4.x, which needs them.
21768 case "${osname}X${osvers}" in
21772 *) case "$usedl" in
21773 $define|true|[yY]*)
21774 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21778 *) perllibs="$libs"
21784 : Remove build directory name from cppstdin so it can be used from
21785 : either the present location or the final installed location.
21787 : Get out of the UU directory to get correct path name.
21789 case "$cppstdin" in
21791 echo "Stripping down cppstdin path name"
21797 : end of configuration questions
21799 echo "End of configuration questions."
21802 : back to where it started
21803 if test -d ../UU; then
21807 : configuration may be unconditionally patched via a 'config.arch' file
21808 if $test -f config.arch; then
21809 echo "I see a config.arch file, loading it." >&4
21813 : configuration may be patched via a 'config.over' file
21814 if $test -f config.over; then
21817 rp='I see a config.over file. Do you wish to load it?'
21820 n*) echo "OK, I'll ignore it.";;
21822 echo "Configuration override changes have been loaded."
21827 : in case they want portability, strip down executable paths
21828 case "$d_portable" in
21831 echo "Stripping down executable paths..." >&4
21832 for file in $loclist $trylist; do
21834 eval $file=`basename $temp`
21839 : create config.sh file
21841 echo "Creating config.sh..." >&4
21842 $spitshell <<EOT >config.sh
21845 # This file was produced by running the Configure script. It holds all the
21846 # definitions figured out by Configure. Should you modify one of these values,
21847 # do not forget to propagate your changes by running "Configure -der". You may
21848 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21851 # Package name : $package
21852 # Source directory : $src
21853 # Configuration time: $cf_time
21854 # Configured by : $cf_by
21855 # Target system : $myuname
21858 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21859 $spitshell <<EOT >>config.sh
21868 Revision='$Revision'
21876 alignbytes='$alignbytes'
21877 ansi2knr='$ansi2knr'
21878 aphostname='$aphostname'
21879 api_revision='$api_revision'
21880 api_subversion='$api_subversion'
21881 api_version='$api_version'
21882 api_versionstring='$api_versionstring'
21885 archlibexp='$archlibexp'
21886 archname64='$archname64'
21887 archname='$archname'
21888 archobjs='$archobjs'
21889 asctime_r_proto='$asctime_r_proto'
21897 byteorder='$byteorder'
21899 castflags='$castflags'
21902 cccdlflags='$cccdlflags'
21903 ccdlflags='$ccdlflags'
21905 ccflags_uselargefiles='$ccflags_uselargefiles'
21907 ccsymbols='$ccsymbols'
21908 ccversion='$ccversion'
21910 cf_email='$cf_email'
21915 clocktype='$clocktype'
21917 compress='$compress'
21918 contains='$contains'
21922 cpp_stuff='$cpp_stuff'
21923 cppccsymbols='$cppccsymbols'
21924 cppflags='$cppflags'
21926 cppminus='$cppminus'
21928 cppstdin='$cppstdin'
21929 cppsymbols='$cppsymbols'
21930 crypt_r_proto='$crypt_r_proto'
21931 cryptlib='$cryptlib'
21933 ctermid_r_proto='$ctermid_r_proto'
21934 ctime_r_proto='$ctime_r_proto'
21935 d_Gconvert='$d_Gconvert'
21936 d_PRIEUldbl='$d_PRIEUldbl'
21937 d_PRIFUldbl='$d_PRIFUldbl'
21938 d_PRIGUldbl='$d_PRIGUldbl'
21939 d_PRIXU64='$d_PRIXU64'
21940 d_PRId64='$d_PRId64'
21941 d_PRIeldbl='$d_PRIeldbl'
21942 d_PRIfldbl='$d_PRIfldbl'
21943 d_PRIgldbl='$d_PRIgldbl'
21944 d_PRIi64='$d_PRIi64'
21945 d_PRIo64='$d_PRIo64'
21946 d_PRIu64='$d_PRIu64'
21947 d_PRIx64='$d_PRIx64'
21948 d_SCNfldbl='$d_SCNfldbl'
21949 d__fwalk='$d__fwalk'
21950 d_access='$d_access'
21951 d_accessx='$d_accessx'
21954 d_archlib='$d_archlib'
21955 d_asctime_r='$d_asctime_r'
21958 d_attribute_format='$d_attribute_format'
21959 d_attribute_malloc='$d_attribute_malloc'
21960 d_attribute_nonnull='$d_attribute_nonnull'
21961 d_attribute_noreturn='$d_attribute_noreturn'
21962 d_attribute_pure='$d_attribute_pure'
21963 d_attribute_unused='$d_attribute_unused'
21964 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21968 d_bsdgetpgrp='$d_bsdgetpgrp'
21969 d_bsdsetpgrp='$d_bsdsetpgrp'
21970 d_builtin_choose_expr='$d_builtin_choose_expr'
21971 d_builtin_expect='$d_builtin_expect'
21973 d_c99_variadic_macros='$d_c99_variadic_macros'
21974 d_casti32='$d_casti32'
21975 d_castneg='$d_castneg'
21976 d_charvspr='$d_charvspr'
21978 d_chroot='$d_chroot'
21979 d_chsize='$d_chsize'
21981 d_clearenv='$d_clearenv'
21982 d_closedir='$d_closedir'
21983 d_cmsghdr_s='$d_cmsghdr_s'
21985 d_copysignl='$d_copysignl'
21986 d_cplusplus='$d_cplusplus'
21988 d_crypt_r='$d_crypt_r'
21990 d_ctermid='$d_ctermid'
21991 d_ctermid_r='$d_ctermid_r'
21992 d_ctime_r='$d_ctime_r'
21993 d_cuserid='$d_cuserid'
21994 d_dbl_dig='$d_dbl_dig'
21995 d_dbminitproto='$d_dbminitproto'
21996 d_difftime='$d_difftime'
21997 d_dir_dd_fd='$d_dir_dd_fd'
21999 d_dirnamlen='$d_dirnamlen'
22000 d_dlerror='$d_dlerror'
22001 d_dlopen='$d_dlopen'
22002 d_dlsymun='$d_dlsymun'
22003 d_dosuid='$d_dosuid'
22004 d_drand48_r='$d_drand48_r'
22005 d_drand48proto='$d_drand48proto'
22007 d_eaccess='$d_eaccess'
22008 d_endgrent='$d_endgrent'
22009 d_endgrent_r='$d_endgrent_r'
22010 d_endhent='$d_endhent'
22011 d_endhostent_r='$d_endhostent_r'
22012 d_endnent='$d_endnent'
22013 d_endnetent_r='$d_endnetent_r'
22014 d_endpent='$d_endpent'
22015 d_endprotoent_r='$d_endprotoent_r'
22016 d_endpwent='$d_endpwent'
22017 d_endpwent_r='$d_endpwent_r'
22018 d_endsent='$d_endsent'
22019 d_endservent_r='$d_endservent_r'
22020 d_eofnblk='$d_eofnblk'
22021 d_eunice='$d_eunice'
22022 d_faststdio='$d_faststdio'
22023 d_fchdir='$d_fchdir'
22024 d_fchmod='$d_fchmod'
22025 d_fchown='$d_fchown'
22027 d_fcntl_can_lock='$d_fcntl_can_lock'
22028 d_fd_macros='$d_fd_macros'
22029 d_fd_set='$d_fd_set'
22030 d_fds_bits='$d_fds_bits'
22031 d_fgetpos='$d_fgetpos'
22032 d_finite='$d_finite'
22033 d_finitel='$d_finitel'
22034 d_flexfnam='$d_flexfnam'
22036 d_flockproto='$d_flockproto'
22038 d_fp_class='$d_fp_class'
22039 d_fpathconf='$d_fpathconf'
22040 d_fpclass='$d_fpclass'
22041 d_fpclassify='$d_fpclassify'
22042 d_fpclassl='$d_fpclassl'
22043 d_fpos64_t='$d_fpos64_t'
22044 d_frexpl='$d_frexpl'
22045 d_fs_data_s='$d_fs_data_s'
22046 d_fseeko='$d_fseeko'
22047 d_fsetpos='$d_fsetpos'
22048 d_fstatfs='$d_fstatfs'
22049 d_fstatvfs='$d_fstatvfs'
22051 d_ftello='$d_ftello'
22053 d_futimes='$d_futimes'
22054 d_getcwd='$d_getcwd'
22055 d_getespwnam='$d_getespwnam'
22056 d_getfsstat='$d_getfsstat'
22057 d_getgrent='$d_getgrent'
22058 d_getgrent_r='$d_getgrent_r'
22059 d_getgrgid_r='$d_getgrgid_r'
22060 d_getgrnam_r='$d_getgrnam_r'
22061 d_getgrps='$d_getgrps'
22062 d_gethbyaddr='$d_gethbyaddr'
22063 d_gethbyname='$d_gethbyname'
22064 d_gethent='$d_gethent'
22065 d_gethname='$d_gethname'
22066 d_gethostbyaddr_r='$d_gethostbyaddr_r'
22067 d_gethostbyname_r='$d_gethostbyname_r'
22068 d_gethostent_r='$d_gethostent_r'
22069 d_gethostprotos='$d_gethostprotos'
22070 d_getitimer='$d_getitimer'
22071 d_getlogin='$d_getlogin'
22072 d_getlogin_r='$d_getlogin_r'
22073 d_getmnt='$d_getmnt'
22074 d_getmntent='$d_getmntent'
22075 d_getnbyaddr='$d_getnbyaddr'
22076 d_getnbyname='$d_getnbyname'
22077 d_getnent='$d_getnent'
22078 d_getnetbyaddr_r='$d_getnetbyaddr_r'
22079 d_getnetbyname_r='$d_getnetbyname_r'
22080 d_getnetent_r='$d_getnetent_r'
22081 d_getnetprotos='$d_getnetprotos'
22082 d_getpagsz='$d_getpagsz'
22083 d_getpbyname='$d_getpbyname'
22084 d_getpbynumber='$d_getpbynumber'
22085 d_getpent='$d_getpent'
22086 d_getpgid='$d_getpgid'
22087 d_getpgrp2='$d_getpgrp2'
22088 d_getpgrp='$d_getpgrp'
22089 d_getppid='$d_getppid'
22090 d_getprior='$d_getprior'
22091 d_getprotobyname_r='$d_getprotobyname_r'
22092 d_getprotobynumber_r='$d_getprotobynumber_r'
22093 d_getprotoent_r='$d_getprotoent_r'
22094 d_getprotoprotos='$d_getprotoprotos'
22095 d_getprpwnam='$d_getprpwnam'
22096 d_getpwent='$d_getpwent'
22097 d_getpwent_r='$d_getpwent_r'
22098 d_getpwnam_r='$d_getpwnam_r'
22099 d_getpwuid_r='$d_getpwuid_r'
22100 d_getsbyname='$d_getsbyname'
22101 d_getsbyport='$d_getsbyport'
22102 d_getsent='$d_getsent'
22103 d_getservbyname_r='$d_getservbyname_r'
22104 d_getservbyport_r='$d_getservbyport_r'
22105 d_getservent_r='$d_getservent_r'
22106 d_getservprotos='$d_getservprotos'
22107 d_getspnam='$d_getspnam'
22108 d_getspnam_r='$d_getspnam_r'
22109 d_gettimeod='$d_gettimeod'
22110 d_gmtime_r='$d_gmtime_r'
22111 d_gnulibc='$d_gnulibc'
22112 d_grpasswd='$d_grpasswd'
22113 d_hasmntopt='$d_hasmntopt'
22115 d_ilogbl='$d_ilogbl'
22116 d_inc_version_list='$d_inc_version_list'
22118 d_inetaton='$d_inetaton'
22119 d_int64_t='$d_int64_t'
22120 d_isascii='$d_isascii'
22121 d_isfinite='$d_isfinite'
22124 d_isnanl='$d_isnanl'
22125 d_killpg='$d_killpg'
22126 d_lchown='$d_lchown'
22127 d_ldbl_dig='$d_ldbl_dig'
22128 d_libm_lib_version='$d_libm_lib_version'
22130 d_localtime_r='$d_localtime_r'
22131 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22132 d_locconv='$d_locconv'
22134 d_longdbl='$d_longdbl'
22135 d_longlong='$d_longlong'
22136 d_lseekproto='$d_lseekproto'
22138 d_madvise='$d_madvise'
22139 d_malloc_good_size='$d_malloc_good_size'
22140 d_malloc_size='$d_malloc_size'
22142 d_mbstowcs='$d_mbstowcs'
22143 d_mbtowc='$d_mbtowc'
22144 d_memchr='$d_memchr'
22145 d_memcmp='$d_memcmp'
22146 d_memcpy='$d_memcpy'
22147 d_memmove='$d_memmove'
22148 d_memset='$d_memset'
22150 d_mkdtemp='$d_mkdtemp'
22151 d_mkfifo='$d_mkfifo'
22152 d_mkstemp='$d_mkstemp'
22153 d_mkstemps='$d_mkstemps'
22154 d_mktime='$d_mktime'
22157 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22158 d_modflproto='$d_modflproto'
22159 d_mprotect='$d_mprotect'
22161 d_msg_ctrunc='$d_msg_ctrunc'
22162 d_msg_dontroute='$d_msg_dontroute'
22163 d_msg_oob='$d_msg_oob'
22164 d_msg_peek='$d_msg_peek'
22165 d_msg_proxy='$d_msg_proxy'
22166 d_msgctl='$d_msgctl'
22167 d_msgget='$d_msgget'
22168 d_msghdr_s='$d_msghdr_s'
22169 d_msgrcv='$d_msgrcv'
22170 d_msgsnd='$d_msgsnd'
22172 d_munmap='$d_munmap'
22173 d_mymalloc='$d_mymalloc'
22176 d_nl_langinfo='$d_nl_langinfo'
22177 d_nv_preserves_uv='$d_nv_preserves_uv'
22178 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22179 d_off64_t='$d_off64_t'
22180 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22181 d_oldpthreads='$d_oldpthreads'
22182 d_oldsock='$d_oldsock'
22184 d_pathconf='$d_pathconf'
22186 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22187 d_phostname='$d_phostname'
22190 d_portable='$d_portable'
22191 d_printf_format_null='$d_printf_format_null'
22192 d_procselfexe='$d_procselfexe'
22193 d_pseudofork='$d_pseudofork'
22194 d_pthread_atfork='$d_pthread_atfork'
22195 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22196 d_pthread_yield='$d_pthread_yield'
22198 d_pwchange='$d_pwchange'
22199 d_pwclass='$d_pwclass'
22200 d_pwcomment='$d_pwcomment'
22201 d_pwexpire='$d_pwexpire'
22202 d_pwgecos='$d_pwgecos'
22203 d_pwpasswd='$d_pwpasswd'
22204 d_pwquota='$d_pwquota'
22207 d_random_r='$d_random_r'
22208 d_readdir64_r='$d_readdir64_r'
22209 d_readdir='$d_readdir'
22210 d_readdir_r='$d_readdir_r'
22211 d_readlink='$d_readlink'
22213 d_recvmsg='$d_recvmsg'
22214 d_rename='$d_rename'
22215 d_rewinddir='$d_rewinddir'
22217 d_safebcpy='$d_safebcpy'
22218 d_safemcpy='$d_safemcpy'
22219 d_sanemcmp='$d_sanemcmp'
22220 d_sbrkproto='$d_sbrkproto'
22221 d_scalbnl='$d_scalbnl'
22222 d_sched_yield='$d_sched_yield'
22223 d_scm_rights='$d_scm_rights'
22224 d_seekdir='$d_seekdir'
22225 d_select='$d_select'
22227 d_semctl='$d_semctl'
22228 d_semctl_semid_ds='$d_semctl_semid_ds'
22229 d_semctl_semun='$d_semctl_semun'
22230 d_semget='$d_semget'
22232 d_sendmsg='$d_sendmsg'
22233 d_setegid='$d_setegid'
22234 d_seteuid='$d_seteuid'
22235 d_setgrent='$d_setgrent'
22236 d_setgrent_r='$d_setgrent_r'
22237 d_setgrps='$d_setgrps'
22238 d_sethent='$d_sethent'
22239 d_sethostent_r='$d_sethostent_r'
22240 d_setitimer='$d_setitimer'
22241 d_setlinebuf='$d_setlinebuf'
22242 d_setlocale='$d_setlocale'
22243 d_setlocale_r='$d_setlocale_r'
22244 d_setnent='$d_setnent'
22245 d_setnetent_r='$d_setnetent_r'
22246 d_setpent='$d_setpent'
22247 d_setpgid='$d_setpgid'
22248 d_setpgrp2='$d_setpgrp2'
22249 d_setpgrp='$d_setpgrp'
22250 d_setprior='$d_setprior'
22251 d_setproctitle='$d_setproctitle'
22252 d_setprotoent_r='$d_setprotoent_r'
22253 d_setpwent='$d_setpwent'
22254 d_setpwent_r='$d_setpwent_r'
22255 d_setregid='$d_setregid'
22256 d_setresgid='$d_setresgid'
22257 d_setresuid='$d_setresuid'
22258 d_setreuid='$d_setreuid'
22259 d_setrgid='$d_setrgid'
22260 d_setruid='$d_setruid'
22261 d_setsent='$d_setsent'
22262 d_setservent_r='$d_setservent_r'
22263 d_setsid='$d_setsid'
22264 d_setvbuf='$d_setvbuf'
22268 d_shmatprototype='$d_shmatprototype'
22269 d_shmctl='$d_shmctl'
22271 d_shmget='$d_shmget'
22272 d_sigaction='$d_sigaction'
22273 d_signbit='$d_signbit'
22274 d_sigprocmask='$d_sigprocmask'
22275 d_sigsetjmp='$d_sigsetjmp'
22276 d_sitearch='$d_sitearch'
22277 d_snprintf='$d_snprintf'
22278 d_sockatmark='$d_sockatmark'
22279 d_sockatmarkproto='$d_sockatmarkproto'
22280 d_socket='$d_socket'
22281 d_socklen_t='$d_socklen_t'
22282 d_sockpair='$d_sockpair'
22283 d_socks5_init='$d_socks5_init'
22284 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22286 d_srand48_r='$d_srand48_r'
22287 d_srandom_r='$d_srandom_r'
22288 d_sresgproto='$d_sresgproto'
22289 d_sresuproto='$d_sresuproto'
22290 d_statblks='$d_statblks'
22291 d_statfs_f_flags='$d_statfs_f_flags'
22292 d_statfs_s='$d_statfs_s'
22293 d_statvfs='$d_statvfs'
22294 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22295 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22296 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22297 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22298 d_stdio_stream_array='$d_stdio_stream_array'
22299 d_stdiobase='$d_stdiobase'
22300 d_stdstdio='$d_stdstdio'
22301 d_strchr='$d_strchr'
22302 d_strcoll='$d_strcoll'
22303 d_strctcpy='$d_strctcpy'
22304 d_strerrm='$d_strerrm'
22305 d_strerror='$d_strerror'
22306 d_strerror_r='$d_strerror_r'
22307 d_strftime='$d_strftime'
22308 d_strlcat='$d_strlcat'
22309 d_strlcpy='$d_strlcpy'
22310 d_strtod='$d_strtod'
22311 d_strtol='$d_strtol'
22312 d_strtold='$d_strtold'
22313 d_strtoll='$d_strtoll'
22314 d_strtoq='$d_strtoq'
22315 d_strtoul='$d_strtoul'
22316 d_strtoull='$d_strtoull'
22317 d_strtouq='$d_strtouq'
22318 d_strxfrm='$d_strxfrm'
22319 d_suidsafe='$d_suidsafe'
22320 d_symlink='$d_symlink'
22321 d_syscall='$d_syscall'
22322 d_syscallproto='$d_syscallproto'
22323 d_sysconf='$d_sysconf'
22324 d_sysernlst='$d_sysernlst'
22325 d_syserrlst='$d_syserrlst'
22326 d_system='$d_system'
22327 d_tcgetpgrp='$d_tcgetpgrp'
22328 d_tcsetpgrp='$d_tcsetpgrp'
22329 d_telldir='$d_telldir'
22330 d_telldirproto='$d_telldirproto'
22332 d_timegm='$d_timegm'
22334 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22335 d_tm_tm_zone='$d_tm_tm_zone'
22336 d_tmpnam_r='$d_tmpnam_r'
22337 d_truncate='$d_truncate'
22338 d_ttyname_r='$d_ttyname_r'
22339 d_tzname='$d_tzname'
22340 d_u32align='$d_u32align'
22341 d_ualarm='$d_ualarm'
22344 d_union_semun='$d_union_semun'
22345 d_unordered='$d_unordered'
22346 d_unsetenv='$d_unsetenv'
22347 d_usleep='$d_usleep'
22348 d_usleepproto='$d_usleepproto'
22350 d_vendorarch='$d_vendorarch'
22351 d_vendorbin='$d_vendorbin'
22352 d_vendorlib='$d_vendorlib'
22353 d_vendorscript='$d_vendorscript'
22355 d_void_closedir='$d_void_closedir'
22356 d_voidsig='$d_voidsig'
22357 d_voidtty='$d_voidtty'
22358 d_volatile='$d_volatile'
22359 d_vprintf='$d_vprintf'
22360 d_vsnprintf='$d_vsnprintf'
22362 d_waitpid='$d_waitpid'
22363 d_wcstombs='$d_wcstombs'
22364 d_wctomb='$d_wctomb'
22365 d_writev='$d_writev'
22368 db_hashtype='$db_hashtype'
22369 db_prefixtype='$db_prefixtype'
22370 db_version_major='$db_version_major'
22371 db_version_minor='$db_version_minor'
22372 db_version_patch='$db_version_patch'
22373 defvoidused='$defvoidused'
22374 direntrytype='$direntrytype'
22377 doublesize='$doublesize'
22379 drand48_r_proto='$drand48_r_proto'
22381 dynamic_ext='$dynamic_ext'
22387 endgrent_r_proto='$endgrent_r_proto'
22388 endhostent_r_proto='$endhostent_r_proto'
22389 endnetent_r_proto='$endnetent_r_proto'
22390 endprotoent_r_proto='$endprotoent_r_proto'
22391 endpwent_r_proto='$endpwent_r_proto'
22392 endservent_r_proto='$endservent_r_proto'
22393 eunicefix='$eunicefix'
22396 extensions='$extensions'
22398 fflushNULL='$fflushNULL'
22399 fflushall='$fflushall'
22401 firstmakefile='$firstmakefile'
22403 fpossize='$fpossize'
22404 fpostype='$fpostype'
22405 freetype='$freetype'
22408 full_csh='$full_csh'
22409 full_sed='$full_sed'
22410 gccansipedantic='$gccansipedantic'
22411 gccosandvers='$gccosandvers'
22412 gccversion='$gccversion'
22413 getgrent_r_proto='$getgrent_r_proto'
22414 getgrgid_r_proto='$getgrgid_r_proto'
22415 getgrnam_r_proto='$getgrnam_r_proto'
22416 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22417 gethostbyname_r_proto='$gethostbyname_r_proto'
22418 gethostent_r_proto='$gethostent_r_proto'
22419 getlogin_r_proto='$getlogin_r_proto'
22420 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22421 getnetbyname_r_proto='$getnetbyname_r_proto'
22422 getnetent_r_proto='$getnetent_r_proto'
22423 getprotobyname_r_proto='$getprotobyname_r_proto'
22424 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22425 getprotoent_r_proto='$getprotoent_r_proto'
22426 getpwent_r_proto='$getpwent_r_proto'
22427 getpwnam_r_proto='$getpwnam_r_proto'
22428 getpwuid_r_proto='$getpwuid_r_proto'
22429 getservbyname_r_proto='$getservbyname_r_proto'
22430 getservbyport_r_proto='$getservbyport_r_proto'
22431 getservent_r_proto='$getservent_r_proto'
22432 getspnam_r_proto='$getspnam_r_proto'
22433 gidformat='$gidformat'
22439 gmtime_r_proto='$gmtime_r_proto'
22440 gnulibc_version='$gnulibc_version'
22442 groupcat='$groupcat'
22443 groupstype='$groupstype'
22446 h_sysfile='$h_sysfile'
22449 html1dir='$html1dir'
22450 html1direxp='$html1direxp'
22451 html3dir='$html3dir'
22452 html3direxp='$html3direxp'
22461 i_arpainet='$i_arpainet'
22462 i_assert='$i_assert'
22463 i_bsdioctl='$i_bsdioctl'
22467 i_dirent='$i_dirent'
22473 i_fp_class='$i_fp_class'
22475 i_gdbm_ndbm='$i_gdbm_ndbm'
22476 i_gdbmndbm='$i_gdbmndbm'
22478 i_ieeefp='$i_ieeefp'
22479 i_inttypes='$i_inttypes'
22480 i_langinfo='$i_langinfo'
22481 i_libutil='$i_libutil'
22482 i_limits='$i_limits'
22483 i_locale='$i_locale'
22484 i_machcthr='$i_machcthr'
22485 i_malloc='$i_malloc'
22486 i_mallocmalloc='$i_mallocmalloc'
22488 i_memory='$i_memory'
22489 i_mntent='$i_mntent'
22492 i_neterrno='$i_neterrno'
22493 i_netinettcp='$i_netinettcp'
22497 i_pthread='$i_pthread'
22499 i_rpcsvcdbm='$i_rpcsvcdbm'
22502 i_shadow='$i_shadow'
22504 i_stdarg='$i_stdarg'
22505 i_stddef='$i_stddef'
22506 i_stdlib='$i_stdlib'
22507 i_string='$i_string'
22508 i_sunmath='$i_sunmath'
22509 i_sysaccess='$i_sysaccess'
22510 i_sysdir='$i_sysdir'
22511 i_sysfile='$i_sysfile'
22512 i_sysfilio='$i_sysfilio'
22514 i_sysioctl='$i_sysioctl'
22515 i_syslog='$i_syslog'
22516 i_sysmman='$i_sysmman'
22517 i_sysmode='$i_sysmode'
22518 i_sysmount='$i_sysmount'
22519 i_sysndir='$i_sysndir'
22520 i_sysparam='$i_sysparam'
22521 i_syspoll='$i_syspoll'
22522 i_sysresrc='$i_sysresrc'
22523 i_syssecrt='$i_syssecrt'
22524 i_sysselct='$i_sysselct'
22525 i_syssockio='$i_syssockio'
22526 i_sysstat='$i_sysstat'
22527 i_sysstatfs='$i_sysstatfs'
22528 i_sysstatvfs='$i_sysstatvfs'
22529 i_systime='$i_systime'
22530 i_systimek='$i_systimek'
22531 i_systimes='$i_systimes'
22532 i_systypes='$i_systypes'
22533 i_sysuio='$i_sysuio'
22535 i_sysutsname='$i_sysutsname'
22536 i_sysvfs='$i_sysvfs'
22537 i_syswait='$i_syswait'
22538 i_termio='$i_termio'
22539 i_termios='$i_termios'
22541 i_unistd='$i_unistd'
22544 i_values='$i_values'
22545 i_varargs='$i_varargs'
22546 i_varhdr='$i_varhdr'
22548 ignore_versioned_solibs='$ignore_versioned_solibs'
22549 inc_version_list='$inc_version_list'
22550 inc_version_list_init='$inc_version_list_init'
22553 initialinstalllocation='$initialinstalllocation'
22554 installarchlib='$installarchlib'
22555 installbin='$installbin'
22556 installhtml1dir='$installhtml1dir'
22557 installhtml3dir='$installhtml3dir'
22558 installman1dir='$installman1dir'
22559 installman3dir='$installman3dir'
22560 installprefix='$installprefix'
22561 installprefixexp='$installprefixexp'
22562 installprivlib='$installprivlib'
22563 installscript='$installscript'
22564 installsitearch='$installsitearch'
22565 installsitebin='$installsitebin'
22566 installsitehtml1dir='$installsitehtml1dir'
22567 installsitehtml3dir='$installsitehtml3dir'
22568 installsitelib='$installsitelib'
22569 installsiteman1dir='$installsiteman1dir'
22570 installsiteman3dir='$installsiteman3dir'
22571 installsitescript='$installsitescript'
22572 installstyle='$installstyle'
22573 installusrbinperl='$installusrbinperl'
22574 installvendorarch='$installvendorarch'
22575 installvendorbin='$installvendorbin'
22576 installvendorhtml1dir='$installvendorhtml1dir'
22577 installvendorhtml3dir='$installvendorhtml3dir'
22578 installvendorlib='$installvendorlib'
22579 installvendorman1dir='$installvendorman1dir'
22580 installvendorman3dir='$installvendorman3dir'
22581 installvendorscript='$installvendorscript'
22583 issymlink='$issymlink'
22584 ivdformat='$ivdformat'
22587 known_extensions='$known_extensions'
22590 lddlflags='$lddlflags'
22592 ldflags_uselargefiles='$ldflags_uselargefiles'
22593 ldlibpthname='$ldlibpthname'
22600 libsdirs='$libsdirs'
22601 libsfiles='$libsfiles'
22602 libsfound='$libsfound'
22603 libspath='$libspath'
22604 libswanted='$libswanted'
22605 libswanted_uselargefiles='$libswanted_uselargefiles'
22611 localtime_r_proto='$localtime_r_proto'
22612 locincpth='$locincpth'
22613 loclibpth='$loclibpth'
22614 longdblsize='$longdblsize'
22615 longlongsize='$longlongsize'
22616 longsize='$longsize'
22620 lseeksize='$lseeksize'
22621 lseektype='$lseektype'
22624 madlyobj='$madlyobj'
22625 madlysrc='$madlysrc'
22629 make_set_make='$make_set_make'
22630 mallocobj='$mallocobj'
22631 mallocsrc='$mallocsrc'
22632 malloctype='$malloctype'
22634 man1direxp='$man1direxp'
22637 man3direxp='$man3direxp'
22639 mips_type='$mips_type'
22640 mistrustnm='$mistrustnm'
22642 mmaptype='$mmaptype'
22643 modetype='$modetype'
22645 multiarch='$multiarch'
22647 myarchname='$myarchname'
22648 mydomain='$mydomain'
22649 myhostname='$myhostname'
22652 need_va_copy='$need_va_copy'
22653 netdb_hlen_type='$netdb_hlen_type'
22654 netdb_host_type='$netdb_host_type'
22655 netdb_name_type='$netdb_name_type'
22656 netdb_net_type='$netdb_net_type'
22659 nm_so_opt='$nm_so_opt'
22660 nonxs_ext='$nonxs_ext'
22662 nvEUformat='$nvEUformat'
22663 nvFUformat='$nvFUformat'
22664 nvGUformat='$nvGUformat'
22665 nv_overflows_integers_at='$nv_overflows_integers_at'
22666 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22667 nveformat='$nveformat'
22668 nvfformat='$nvfformat'
22669 nvgformat='$nvgformat'
22672 o_nonblock='$o_nonblock'
22674 old_pthread_create_joinable='$old_pthread_create_joinable'
22675 optimize='$optimize'
22676 orderlib='$orderlib'
22679 otherlibdirs='$otherlibdirs'
22683 patchlevel='$patchlevel'
22684 path_sep='$path_sep'
22687 perl_patchlevel='$perl_patchlevel'
22688 perladmin='$perladmin'
22689 perllibs='$perllibs'
22690 perlpath='$perlpath'
22692 phostname='$phostname'
22698 prefixexp='$prefixexp'
22700 privlibexp='$privlibexp'
22701 procselfexe='$procselfexe'
22702 prototype='$prototype'
22704 quadkind='$quadkind'
22705 quadtype='$quadtype'
22706 randbits='$randbits'
22707 randfunc='$randfunc'
22708 random_r_proto='$random_r_proto'
22709 randseedtype='$randseedtype'
22711 rd_nodata='$rd_nodata'
22712 readdir64_r_proto='$readdir64_r_proto'
22713 readdir_r_proto='$readdir_r_proto'
22714 revision='$revision'
22720 sGMTIME_max='$sGMTIME_max'
22721 sGMTIME_min='$sGMTIME_min'
22722 sPRIEUldbl='$sPRIEUldbl'
22723 sPRIFUldbl='$sPRIFUldbl'
22724 sPRIGUldbl='$sPRIGUldbl'
22725 sPRIXU64='$sPRIXU64'
22727 sPRIeldbl='$sPRIeldbl'
22728 sPRIfldbl='$sPRIfldbl'
22729 sPRIgldbl='$sPRIgldbl'
22734 sSCNfldbl='$sSCNfldbl'
22735 sched_yield='$sched_yield'
22736 scriptdir='$scriptdir'
22737 scriptdirexp='$scriptdirexp'
22739 seedfunc='$seedfunc'
22740 selectminbits='$selectminbits'
22741 selecttype='$selecttype'
22742 sendmail='$sendmail'
22743 setgrent_r_proto='$setgrent_r_proto'
22744 sethostent_r_proto='$sethostent_r_proto'
22745 setlocale_r_proto='$setlocale_r_proto'
22746 setnetent_r_proto='$setnetent_r_proto'
22747 setprotoent_r_proto='$setprotoent_r_proto'
22748 setpwent_r_proto='$setpwent_r_proto'
22749 setservent_r_proto='$setservent_r_proto'
22752 sharpbang='$sharpbang'
22753 shmattype='$shmattype'
22754 shortsize='$shortsize'
22757 sig_count='$sig_count'
22758 sig_name='$sig_name'
22759 sig_name_init='$sig_name_init'
22761 sig_num_init='$sig_num_init'
22762 sig_size='$sig_size'
22763 signal_t='$signal_t'
22764 sitearch='$sitearch'
22765 sitearchexp='$sitearchexp'
22767 sitebinexp='$sitebinexp'
22768 sitehtml1dir='$sitehtml1dir'
22769 sitehtml1direxp='$sitehtml1direxp'
22770 sitehtml3dir='$sitehtml3dir'
22771 sitehtml3direxp='$sitehtml3direxp'
22773 sitelib_stem='$sitelib_stem'
22774 sitelibexp='$sitelibexp'
22775 siteman1dir='$siteman1dir'
22776 siteman1direxp='$siteman1direxp'
22777 siteman3dir='$siteman3dir'
22778 siteman3direxp='$siteman3direxp'
22779 siteprefix='$siteprefix'
22780 siteprefixexp='$siteprefixexp'
22781 sitescript='$sitescript'
22782 sitescriptexp='$sitescriptexp'
22783 sizesize='$sizesize'
22784 sizetype='$sizetype'
22788 sockethdr='$sockethdr'
22789 socketlib='$socketlib'
22790 socksizetype='$socksizetype'
22792 spackage='$spackage'
22793 spitshell='$spitshell'
22794 srand48_r_proto='$srand48_r_proto'
22795 srandom_r_proto='$srandom_r_proto'
22797 ssizetype='$ssizetype'
22798 startperl='$startperl'
22800 static_ext='$static_ext'
22802 stdio_base='$stdio_base'
22803 stdio_bufsiz='$stdio_bufsiz'
22804 stdio_cnt='$stdio_cnt'
22805 stdio_filbuf='$stdio_filbuf'
22806 stdio_ptr='$stdio_ptr'
22807 stdio_stream_array='$stdio_stream_array'
22808 strerror_r_proto='$strerror_r_proto'
22811 subversion='$subversion'
22815 targetarch='$targetarch'
22819 timeincl='$timeincl'
22820 timetype='$timetype'
22821 tmpnam_r_proto='$tmpnam_r_proto'
22827 ttyname_r_proto='$ttyname_r_proto'
22836 uidformat='$uidformat'
22842 uquadtype='$uquadtype'
22843 use5005threads='$use5005threads'
22844 use64bitall='$use64bitall'
22845 use64bitint='$use64bitint'
22846 usecrosscompile='$usecrosscompile'
22848 usedtrace='$usedtrace'
22849 usefaststdio='$usefaststdio'
22850 useithreads='$useithreads'
22851 uselargefiles='$uselargefiles'
22852 uselongdouble='$uselongdouble'
22853 usemallocwrap='$usemallocwrap'
22854 usemorebits='$usemorebits'
22855 usemultiplicity='$usemultiplicity'
22856 usemymalloc='$usemymalloc'
22858 useopcode='$useopcode'
22859 useperlio='$useperlio'
22860 useposix='$useposix'
22861 usereentrant='$usereentrant'
22862 userelocatableinc='$userelocatableinc'
22864 useshrplib='$useshrplib'
22865 usesitecustomize='$usesitecustomize'
22866 usesocks='$usesocks'
22867 usethreads='$usethreads'
22868 usevendorprefix='$usevendorprefix'
22869 usevfork='$usevfork'
22872 uvXUformat='$uvXUformat'
22873 uvoformat='$uvoformat'
22876 uvuformat='$uvuformat'
22877 uvxformat='$uvxformat'
22878 vendorarch='$vendorarch'
22879 vendorarchexp='$vendorarchexp'
22880 vendorbin='$vendorbin'
22881 vendorbinexp='$vendorbinexp'
22882 vendorhtml1dir='$vendorhtml1dir'
22883 vendorhtml1direxp='$vendorhtml1direxp'
22884 vendorhtml3dir='$vendorhtml3dir'
22885 vendorhtml3direxp='$vendorhtml3direxp'
22886 vendorlib='$vendorlib'
22887 vendorlib_stem='$vendorlib_stem'
22888 vendorlibexp='$vendorlibexp'
22889 vendorman1dir='$vendorman1dir'
22890 vendorman1direxp='$vendorman1direxp'
22891 vendorman3dir='$vendorman3dir'
22892 vendorman3direxp='$vendorman3direxp'
22893 vendorprefix='$vendorprefix'
22894 vendorprefixexp='$vendorprefixexp'
22895 vendorscript='$vendorscript'
22896 vendorscriptexp='$vendorscriptexp'
22898 version_patchlevel_string='$version_patchlevel_string'
22899 versiononly='$versiononly'
22901 voidflags='$voidflags'
22904 yaccflags='$yaccflags'
22909 : Add in command line options if available
22910 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22912 : add special variables
22913 $test -f $src/patchlevel.h && \
22914 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22915 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22916 echo "PERL_CONFIG_SH=true" >>config.sh
22918 : propagate old symbols
22919 if $test -f UU/config.sh; then
22920 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22921 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
22922 config.sh config.sh UU/oldconfig.sh |\
22923 $sort | $uniq -u >UU/oldsyms
22924 set X `cat UU/oldsyms`
22930 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22932 echo ": Variables propagated from previous config.sh file." >>config.sh
22933 for sym in `cat UU/oldsyms`; do
22934 echo " Propagating $hint variable "'$'"$sym..."
22935 eval 'tmp="$'"${sym}"'"'
22937 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22943 : Finish up by extracting the .SH files
22947 echo "Extraction done."
22957 If you'd like to make any changes to the config.sh file before I begin
22958 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22961 rp="Press return or use a shell escape to edit config.sh:"
22966 *) : in case they cannot read
22967 sh 1>&4 -c "$ans";;
22972 : if this fails, just run all the .SH files by hand
22981 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22988 Now you need to generate make dependencies by running "$make depend".
22989 You might prefer to run it in background: "$make depend > makedepend.out &"
22990 It can take a while, so you might not want to run it right now.
22995 rp="Run $make depend now?"
22999 $make depend && echo "Now you must run '$make'."
23002 echo "You must run '$make depend' then '$make'."
23005 elif test -f [Mm]akefile; then
23007 echo "Now you must run a $make."
23009 echo "Configure done."
23012 if $test -f Policy.sh; then
23015 If you compile $package on a different machine or from a different object
23016 directory, copy the Policy.sh file from this object directory to the
23017 new one before you run Configure -- this will help you with most of
23018 the policy defaults.
23022 if $test -f config.msg; then
23023 echo "Hmm. I also noted the following information while running:"
23025 $cat config.msg >&4
23028 $rm -f kit*isdone ark*isdone