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 Wed Jan 9 22:02:14 CET 2008 [metaconfig 3.0 PL70]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
337 initialinstalllocation=''
364 d_attribute_format=''
365 d_attribute_malloc=''
366 d_attribute_nonnull=''
367 d_attribute_noreturn=''
369 d_attribute_unused=''
370 d_attribute_warn_unused_result=''
371 d_printf_format_null=''
374 d_builtin_choose_expr=''
377 d_c99_variadic_macros=''
424 endhostent_r_proto=''
430 endprotoent_r_proto=''
436 endservent_r_proto=''
488 gethostbyaddr_r_proto=''
490 gethostbyname_r_proto=''
492 gethostent_r_proto=''
504 getnetbyaddr_r_proto=''
506 getnetbyname_r_proto=''
520 d_getprotobyname_r=''
521 getprotobyname_r_proto=''
522 d_getprotobynumber_r=''
523 getprotobynumber_r_proto=''
525 getprotoent_r_proto=''
537 getservbyname_r_proto=''
539 getservbyport_r_proto=''
541 getservent_r_proto=''
565 d_libm_lib_version=''
568 d_localtime_r_needs_tzset=''
579 d_malloc_good_size=''
621 d_old_pthread_create_joinable=''
622 old_pthread_create_joinable=''
624 d_pthread_attr_setscope=''
663 sethostent_r_proto=''
680 setprotoent_r_proto=''
692 setservent_r_proto=''
726 d_sprintf_returns_strlen=''
741 d_stdio_ptr_lval_nochange_cnt=''
742 d_stdio_ptr_lval_sets_cnt=''
947 d_inc_version_list=''
949 inc_version_list_init=''
968 ignore_versioned_solibs=''
1032 d_perl_otherlibdirs=''
1040 api_versionstring=''
1046 version_patchlevel_string=''
1050 d_nv_preserves_uv=''
1051 d_nv_zero_is_allbits_zero=''
1062 nv_preserves_uv_bits=''
1134 installsitehtml1dir=''
1137 installsitehtml3dir=''
1144 installsiteman1dir=''
1147 installsiteman3dir=''
1152 installsitescript=''
1167 d_stdio_stream_array=''
1168 stdio_stream_array=''
1179 ccflags_uselargefiles=''
1180 ldflags_uselargefiles=''
1181 libswanted_uselargefiles=''
1202 installvendorarch=''
1209 installvendorhtml1dir=''
1211 vendorhtml1direxp=''
1212 installvendorhtml3dir=''
1214 vendorhtml3direxp=''
1220 installvendorman1dir=''
1223 installvendorman3dir=''
1230 installvendorscript=''
1242 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1245 : We must find out about Eunice early
1247 if test -f /etc/unixtovms; then
1248 eunicefix=/etc/unixtovms
1250 if test -f /etc/unixtovms.exe; then
1251 eunicefix=/etc/unixtovms.exe
1254 : Set executable suffix now -- needed before hints available
1255 if test -f "/libs/version.library"; then
1258 elif test -f "/system/gnu_library/bin/ar.pm"; then
1261 elif test -n "$DJGPP"; then
1264 elif test -d c:/. -o -n "$is_os2" ; then
1270 : Trailing extension. Override this in a hint file, if needed.
1271 : Extra object files, if any, needed on this platform.
1276 : change the next line if compiling for Xenix/286 on Xenix/386
1277 xlibpth='/usr/lib/386 /lib/386'
1278 : Possible local library directories to search.
1279 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1280 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1282 : general looking path for locating libraries
1283 glibpth="/lib /usr/lib $xlibpth"
1284 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1285 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1286 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1287 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1289 : Private path used by Configure to find libraries. Its value
1290 : is prepended to libpth. This variable takes care of special
1291 : machines, like the mips. Usually, it should be empty.
1294 : default library list
1296 : some systems want to use only the non-versioned libso:s
1297 ignore_versioned_solibs=''
1301 : set usethreads on the Configure command line to enable threads.
1302 usereentrant='undef'
1303 : full support for void wanted by default
1306 : Possible local include directories to search.
1307 : Set locincpth to "" in a hint file to defeat local include searches.
1308 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1309 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1311 : no include file wanted by default
1314 : Enable -DEBUGGING and -DDEBUGGING from the command line
1321 : set useposix=false in your hint file to disable the POSIX extension.
1323 : set useopcode=false in your hint file to disable the Opcode extension.
1326 ccflags_uselargefiles=''
1327 ldflags_uselargefiles=''
1328 libswanted_uselargefiles=''
1329 : set usemultiplicity on the Configure command line to enable multiplicity.
1330 : set usesocks on the Configure command line to enable socks.
1331 : List of libraries we want.
1332 : If anyone needs extra -lxxx, put those in a hint file.
1333 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1334 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1335 : We probably want to search /usr/shlib before most other libraries.
1336 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1337 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1338 glibpth="/usr/shlib $glibpth"
1339 : Do not use vfork unless overridden by a hint file.
1342 : Find the basic shell for Bourne shell scripts
1346 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1349 if test -f "$xxx"; then
1352 : Build up a list and do a single loop so we can 'break' out.
1353 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1354 for xxx in sh bash ksh pdksh ash; do
1356 try="$try ${p}/${xxx}"
1360 if test -f "$xxx"; then
1363 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1366 elif test -f "$xxx.exe"; then
1377 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1379 Usually it's in /bin/sh. How did you even get this far?
1380 Please contact me (Perl Maintainers) at perlbug@perl.org and
1381 we'll try to straighten this all out.
1387 : see if sh knows # comments
1388 if `$sh -c '#' >/dev/null 2>&1`; then
1392 test -f $xcat$_exe || xcat=/usr/bin/cat
1393 if test ! -f $xcat$_exe; then
1394 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1395 if test -f $p/cat$_exe; then
1400 if test ! -f $xcat$_exe; then
1401 echo "Can't find cat anywhere!"
1405 echo "#!$xcat" >sharp
1409 if test -s today; then
1412 echo "#! $xcat" > sharp
1416 if test -s today; then
1424 echo "Your $sh doesn't grok # comments--I will strip them later on."
1427 echo "exec grep -v '^[ ]*#'" >spitshell
1429 $eunicefix spitshell
1430 spitshell=`pwd`/spitshell
1432 echo "I presume that if # doesn't work, #! won't work either!"
1437 : figure out how to guarantee sh startup
1439 '') startsh=${sharpbang}${sh} ;;
1451 : echo "Yup, it does."
1453 echo "Hmm... '$startsh' does not guarantee sh startup..."
1454 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1458 : Save command line options in file UU/cmdline.opt for later use in
1459 : generating config.sh.
1460 cat > cmdline.opt <<EOSH
1461 : Configure command line arguments.
1470 cat >>cmdline.opt <<EOSH
1471 config_arg$argn='$arg'
1473 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1476 arg_exp=`cat cmdl.opt`
1477 args_exp="$args_exp$args_sep'$arg_exp'"
1478 argn=`expr $argn + 1`
1483 : produce awk script to parse command line options
1484 cat >options.awk <<'EOF'
1486 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1488 len = length(optstr);
1489 for (i = 1; i <= len; i++) {
1490 c = substr(optstr, i, 1);
1491 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1502 if (substr(str, 1, 1) != "-") {
1503 printf("'%s'\n", str);
1507 for (i = 2; i <= len; i++) {
1508 c = substr(str, i, 1);
1510 printf("-%s\n", substr(str, i));
1516 printf("'%s'\n", substr(str, i + 1));
1529 : process the command line options
1530 set X `for arg in "$@"; do echo "X$arg"; done |
1531 sed -e s/X// | awk -f options.awk`
1536 : set up default values
1546 rm -f optdef.sh posthint.sh
1547 cat >optdef.sh <<EOS
1553 while test $# -gt 0; do
1555 -d) shift; fastread=yes;;
1556 -e) shift; alldone=cont;;
1560 if test -r "$1"; then
1563 echo "$me: cannot read config file $1." >&2
1569 -h) shift; error=true;;
1570 -r) shift; reuseval=true;;
1571 -s) shift; silent=true; realsilent=true;;
1572 -E) shift; alldone=exit;;
1573 -K) shift; knowitall=true;;
1574 -O) shift; override=true;;
1575 -S) shift; silent=true; extractsh=true;;
1580 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1581 echo "$me: ignoring -D $1" >&2
1584 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1585 *) echo "$1='define'" >> optdef.sh;;
1592 *=) echo "$1" >> optdef.sh;;
1594 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1595 echo "$me: ignoring -U $1" >&2
1597 *) echo "$1='undef'" >> optdef.sh;;
1608 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1612 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1613 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1619 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1620 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1621 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1622 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1623 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1624 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1630 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1632 echo "$yyy=''" >> posthint.sh ;;
1637 echo "$yyy='$zzz'" >> posthint.sh ;;
1639 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1641 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1646 echo "$yyy=$zzz" >> posthint.sh ;;
1647 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1651 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1654 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1662 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1663 [-U symbol] [-U symbol=] [-A command:symbol...]
1664 -d : use defaults for all answers.
1665 -e : go on without questioning past the production of config.sh.
1666 -f : specify an alternate default configuration file.
1667 -h : print this help message and exit (with an error status).
1668 -r : reuse C symbols value if possible (skips costly nm extraction).
1669 -s : silent mode, only echoes questions and essential information.
1670 -D : define symbol to have some value:
1671 -D symbol symbol gets the value 'define'
1672 -D symbol=value symbol gets the value 'value'
1673 common used examples (see INSTALL for more info):
1674 -Duse64bitint use 64bit integers
1675 -Duse64bitall use 64bit integers and pointers
1676 -Dusethreads use thread support
1677 -Dinc_version_list=none do not include older perl trees in @INC
1678 -DEBUGGING=none DEBUGGING options
1679 -Dcc=gcc choose your compiler
1680 -Dprefix=/opt/perl5 choose your destination
1681 -E : stop at the end of questions, after having produced config.sh.
1682 -K : do not use unless you know what you are doing.
1683 -O : let -D and -U override definitions from loaded configuration file.
1684 -S : perform variable substitutions on all .SH files (can mix with -f)
1685 -U : undefine symbol:
1686 -U symbol symbol gets the value 'undef'
1687 -U symbol= symbol gets completely empty
1689 -A : manipulate symbol after the platform specific hints have been applied:
1690 -A append:symbol=value append value to symbol
1691 -A symbol=value like append:, but with a separating space
1692 -A define:symbol=value define symbol to have value
1693 -A clear:symbol define symbol to be ''
1694 -A define:symbol define symbol to be 'define'
1695 -A eval:symbol=value define symbol to be eval of value
1696 -A prepend:symbol=value prepend value to symbol
1697 -A undef:symbol define symbol to be 'undef'
1698 -A undef:symbol= define symbol to be ''
1699 e.g.: -A prepend:libswanted='cl pthread '
1700 -A ccflags=-DSOME_MACRO
1701 -V : print version number and exit (with a zero status).
1708 case "$fastread$alldone" in
1711 case "$extractsh" in
1714 if test ! -t 0; then
1715 echo "Say 'sh Configure', not 'sh <Configure'"
1725 true) exec 1>/dev/null;;
1728 : run the defines and the undefines, if any, but leave the file out there...
1731 : create the posthint manipulation script and leave the file out there...
1736 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1737 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1738 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1739 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1740 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1743 : Some greps do not return status, grrr.
1744 echo "grimblepritz" >grimble
1745 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1747 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1753 : the following should work in any shell
1757 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1758 cat >contains <<'EOSS'
1759 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1764 : Find the path to the source tree
1767 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1771 *) src=`cd ../$src && pwd` ;;
1784 if test -f $rsrc/Configure && \
1785 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1787 : found it, so we are ok.
1790 for src in . .. ../.. ../../.. ../../../..; do
1791 if test -f ../$src/Configure && \
1792 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1803 Sorry, I can't seem to locate the source dir for $package. Please start
1804 Configure with an explicit path -- i.e. /some/path/Configure.
1812 echo "Sources for $package found in \"$src\"." >&4
1816 : script used to extract .SH files with variable substitutions
1817 cat >extract <<'EOS'
1819 echo "Doing variable substitutions on .SH files..."
1820 if test -f MANIFEST; then
1821 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1823 echo "(Looking for .SH files under the source directory.)"
1824 set x `(cd "$src"; find . -name "*.SH" -print)`
1828 0) set x `(cd "$src"; echo *.SH)`; shift;;
1830 if test ! -f "$src/$1"; then
1836 while test $name; do
1837 if test ! -d "$name"; then
1838 create="$name $create";
1839 name=`echo $name | sed -e "s|^[^/]*$||"`;
1840 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1845 for file in $create; do
1854 dir=`expr X$file : 'X\(.*\)/'`
1855 file=`expr X$file : 'X.*/\(.*\)'`
1856 (cd "$dir" && . ./$file)
1866 dir=`expr X$file : 'X\(.*\)/'`
1867 file=`expr X$file : 'X.*/\(.*\)'`
1868 (set x $dir; shift; eval $mkdir_p)
1869 sh <"$src/$dir/$file"
1878 if test -f "$src/config_h.SH"; then
1879 if test ! -f config.h; then
1880 : oops, they left it out of MANIFEST, probably, so do it anyway.
1881 . "$src/config_h.SH"
1886 : extract files and exit if asked to do so
1887 case "$extractsh" in
1889 case "$realsilent" in
1893 case "$config_sh" in
1894 '') config_sh='config.sh';;
1897 echo "Fetching answers from $config_sh..."
1900 test "$override" && . ./optdef.sh
1904 echo "Extraction done."
1909 : Eunice requires " " instead of "", can you believe it
1912 echo "Beginning of configuration questions for $package."
1914 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1916 : first determine how to suppress newline on echo command
1918 echo "Checking echo to see how to suppress newlines..."
1919 (echo "hi there\c" ; echo " ") >.echotmp
1920 if $contains c .echotmp >/dev/null 2>&1 ; then
1931 echo $n "The star should be here-->$c"
1935 : Now test for existence of everything in MANIFEST
1937 if test -f "$rsrc/MANIFEST"; then
1938 echo "First let's make sure your kit is complete. Checking..." >&4
1939 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1942 for filelist in x??; do
1943 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1945 if test -s missing; then
1949 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1951 You have the option of continuing the configuration process, despite the
1952 distinct possibility that your kit is damaged, by typing 'y'es. If you
1953 do, don't blame me if something goes wrong. I advise you to type 'n'o
1954 and contact the author (perlbug@perl.org).
1957 echo $n "Continue? [n] $c" >&4
1961 echo "Continuing..." >&4
1965 echo "ABORTING..." >&4
1970 echo "Looks good..."
1973 echo "There is no MANIFEST file. I hope your kit is complete !"
1977 : Find the appropriate value for a newline for tr
1979 if test -n "$DJGPP"; then
1982 if test X"$trnl" = X; then
1983 case "`echo foo|tr '\n' x 2>/dev/null`" in
1987 if test X"$trnl" = X; then
1988 case "`echo foo|tr '\012' x 2>/dev/null`" in
1989 foox) trnl='\012' ;;
1992 if test X"$trnl" = X; then
1993 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1994 fooxy) trnl='\n\r' ;;
1997 if test X"$trnl" = X; then
2000 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2006 : compute the number of columns on the terminal for proper question formatting
2011 : set up the echo used in my read
2012 myecho="case \"\$xxxm\" in
2013 '') echo $n \"\$rp $c\" >&4;;
2015 '') echo $n \"[\$xxxm] $c\";;
2017 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2019 echo $n \"[\$xxxm] $c\" >&4
2021 echo $n \"\$rp [\$xxxm] $c\" >&4
2027 : now set up to do reads with possible shell escape and default assignment
2033 case "\$fastread" in
2034 yes) case "\$dflt" in
2037 case "\$silent-\$rp" in
2042 *) case "\$silent" in
2043 true) case "\$rp" in
2048 while expr "X\$ans" : "X!" >/dev/null; do
2052 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2060 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2069 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2074 echo "(OK, I'll run with -d after this question.)" >&4
2077 echo "*** Sorry, \$1 not supported yet." >&4
2087 echo "*** Substitution done -- please confirm."
2089 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2094 echo "*** Error -- try again."
2101 case "\$ans\$xxxm\$nostick" in
2113 : create .config dir to save info across Configure sessions
2114 test -d ../.config || mkdir ../.config
2115 cat >../.config/README <<EOF
2116 This directory created by Configure to save information that should
2117 persist across sessions for $package.
2119 You may safely delete it if you wish.
2122 : See if we are using a devel version and want that
2123 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2125 $define|true|[yY]*) ;;
2126 *) case "$xversion" in
2129 *** WHOA THERE!!! ***
2131 This is an UNSTABLE DEVELOPMENT release.
2132 The version of this $package distribution is $xversion, that is, odd,
2133 (as opposed to even) and that signifies a development release.
2134 If you want a maintenance release, you want an even-numbered version.
2136 Do ***NOT*** install this into production use.
2137 Data corruption and crashes are possible.
2139 It is most seriously suggested that you do not continue any further
2140 unless you want to help in developing and debugging Perl.
2142 If you *still* want to build perl, you can answer 'y' now,
2143 or pass -Dusedevel to Configure.
2146 rp='Do you really want to continue?'
2150 [yY]) echo >&4 "Okay, continuing."
2151 usedevel="$define" ;;
2152 *) echo >&4 "Okay, bye."
2162 case "$versiononly" in
2163 '') versiononly="$define" ;;
2165 case "$installusrbinperl" in
2166 '') installusrbinperl="$undef" ;;
2171 : general instructions
2174 user=`(logname) 2>/dev/null`
2176 '') user=`whoami 2>&1`;;
2178 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2181 rp='Would you like to see the instructions?'
2192 This installation shell script will examine your system and ask you questions
2193 to determine how the perl5 package should be installed. If you get
2194 stuck on a question, you may use a ! shell escape to start a subshell or
2195 execute a command. Many of the questions will have default answers in square
2196 brackets; typing carriage return will give you the default.
2198 On some of the questions which ask for file or directory names you are allowed
2199 to use the ~name construct to specify the login directory belonging to "name",
2200 even if you don't have a shell which knows about that. Questions where this is
2201 allowed will be marked "(~name ok)".
2205 dflt='Type carriage return to continue'
2209 The prompter used in this script allows you to use shell variables and
2210 backticks in your answers. You may use $1, $2, etc... to refer to the words
2211 in the default answer, as if the default line was a set of arguments given to a
2212 script shell. This means you may also use $* to repeat the whole default line,
2213 so you do not have to re-type everything to add something to the default.
2215 Everytime there is a substitution, you will have to confirm. If there is an
2216 error (e.g. an unmatched backtick), the default answer will remain unchanged
2217 and you will be prompted again.
2219 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2220 the questions and use the computed defaults (or the previous answers if there
2221 was already a config.sh file). Type 'Configure -h' for a list of options.
2222 You may also start interactively and then answer '& -d' at any prompt to turn
2223 on the non-interactive behaviour for the remainder of the execution.
2229 Much effort has been expended to ensure that this shell script will run on any
2230 Unix system. If despite that it blows up on yours, your best bet is to edit
2231 Configure and run it again. If you can't run Configure for some reason,
2232 you'll have to generate a config.sh file by hand. Whatever problems you
2233 have, let me (perlbug@perl.org) know how I blew it.
2235 This installation script affects things in two ways:
2237 1) it may do direct variable substitutions on some of the files included
2239 2) it builds a config.h file for inclusion in C programs. You may edit
2240 any of these files as the need arises after running this script.
2242 If you make a mistake on a question, there is no easy way to back up to it
2243 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2244 files. Configure will offer to let you do this before it runs the SH files.
2247 dflt='Type carriage return to continue'
2249 case "$firsttime" in
2250 true) echo $user >>../.config/instruct;;
2254 : find out where common programs are
2256 echo "Locating common programs..." >&4
2269 if test -d \$dir/\$thing; then
2275 for thisthing in \$dir/\$thing; do
2276 : just loop through to pick last item
2278 if test -f \$thisthing; then
2281 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2284 elif test -f \$dir/\$thing.exe; then
2285 if test -n "$DJGPP"; then
2286 echo \$dir/\$thing.exe
2287 elif test "$eunicefix" != ":"; then
2288 : on Eunice apparently
2342 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2343 pth="$pth /lib /usr/lib"
2344 for file in $loclist; do
2348 if test -f "$xxx"; then
2351 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2352 xxx=`./loc $file $file $pth`
2355 '') xxx=`./loc $file $file $pth`;;
2356 *) xxx=`./loc $xxx $xxx $pth`;;
2358 eval $file=$xxx$_exe
2362 echo $file is in $xxx.
2365 echo $file is in $xxx.
2368 echo "I don't know where '$file' is, and my life depends on it." >&4
2369 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2375 echo "Don't worry if any of the following aren't found..."
2377 for file in $trylist; do
2381 if test -f "$xxx"; then
2384 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2385 xxx=`./loc $file $file $pth`
2388 '') xxx=`./loc $file $file $pth`;;
2389 *) xxx=`./loc $xxx $xxx $pth`;;
2391 eval $file=$xxx$_exe
2395 echo $file is in $xxx.
2398 echo $file is in $xxx.
2401 echo "I don't see $file out there, $say."
2408 echo "Substituting grep for egrep."
2415 echo "Substituting cp for ln."
2424 echo "I can't find make or gmake, and my life depends on it." >&4
2425 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2433 *) # We can't have osname yet.
2434 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2435 # Assume that gmake, if found, is definitely GNU make
2436 # and prefer it over the system make.
2437 echo "Substituting gmake for make."
2445 echo "Hopefully test is built into your sh."
2448 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2449 echo "Using the test built into your sh."
2457 echo "Hopefully echo is built into your sh."
2462 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2463 $echo $n "hi there$c" >foo1
2464 echo $n "hi there$c" >foo2
2465 if cmp foo1 foo2 >/dev/null 2>&1; then
2466 echo "They are compatible. In fact, they may be identical."
2473 They are not compatible! You are probably running ksh on a non-USG system.
2474 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2475 have echo built in and we may have to run some Bourne shell scripts. That
2476 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2479 $echo $n "The star should be here-->$c"
2486 # This question was auctioned at YAPC::Europe-2007 in Vienna
2487 # I never promised you could answer it. I only auctioned the question.
2489 The following message is sponsored by
2491 Dresden.pm<--The stars should be here.
2493 Dear Perl user, system administrator or package
2494 maintainer, the Perl community sends greetings to
2495 you. Do you (emblematical) greet back [Y/n]? n
2499 : Check what type of C compiler we use
2503 cat <<'EOSC' >>trygcc
2508 int main(int argc, char *argv[]) {
2512 if $cc -o try $ccflags $ldflags try.c; then
2515 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2521 # Skip this test because it gives a false match on output like:
2522 # ./trygcc: line 23: cc: command not found
2523 # case "`$cc -v -c try.c 2>&1`" in
2524 # *gcc*) trygcc=no ;;
2526 if $test X"$trygcc" = Xyes; then
2527 if gcc -o try -c try.c; then
2529 echo "You seem to have a working gcc, though." >&4
2530 # Switching compilers may undo the work of hints files.
2531 # The most common problem is -D_REENTRANT for threads.
2532 # This heuristic catches that case, but gets false positives
2533 # if -Dusethreads was not actually specified. Better to
2534 # bail out here with a useful message than fail
2535 # mysteriously later. Should we perhaps just try to
2536 # re-invoke Configure -Dcc=gcc config_args ?
2537 if $test -f usethreads.cbu; then
2540 *** However, any setting of the C compiler flags (e.g. for thread support)
2541 *** will be lost. It may be necessary for you to restart Configure and
2542 *** add -Dcc=gcc to your Configure command line.
2545 rp="Would you like to go ahead and try gcc anyway?"
2548 rp="Would you like to use it?"
2551 if $test -f myread; then
2554 if $test -f UU/myread; then
2557 echo "Cannot find myread, sorry. Aborting." >&2
2562 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2575 cat <<'EOSC' >>checkcc
2580 int main(int argc, char *argv[]) {
2584 if $cc -o try $ccflags $ldflags try.c; then
2587 if $test X"$despair" = Xyes; then
2588 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2591 You need to find a working C compiler.
2592 Either (purchase and) install the C compiler supplied by your OS vendor,
2593 or for a free C compiler try http://gcc.gnu.org/
2594 I cannot continue any further, aborting.
2603 : determine whether symbolic links are supported
2606 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2607 echo "Symbolic links are supported." >&4
2610 echo "Symbolic links are NOT supported." >&4
2615 : determine whether symbolic links are supported
2619 echo "Checking how to test for symbolic links..." >&4
2621 if $test "X$issymlink" = X; then
2623 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2624 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2626 if test $? = 0; then
2629 echo "Your builtin 'test -h' may be broken." >&4
2632 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2635 if test -f "$p/$test"; then
2644 echo "Trying external '$test -h'." >&4
2645 issymlink="$test -h"
2646 if $test ! -h sym >/dev/null 2>&1; then
2647 echo "External '$test -h' is broken, too." >&4
2655 if $test "X$issymlink" = X; then
2656 if $test -L sym 2>/dev/null; then
2657 issymlink="$test -L"
2658 echo "The builtin '$test -L' worked." >&4
2661 if $test "X$issymlink" != X; then
2662 echo "You can test for symbolic links with '$issymlink'." >&4
2664 echo "I do not know how you can test for symbolic links." >&4
2668 *) echo "No symbolic links, so not testing for their testing..." >&4
2674 case "$mksymlinks" in
2677 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2680 *) case "$lns:$issymlink" in
2681 *"ln"*" -s:"*"test -"?)
2682 echo "Creating the symbolic links..." >&4
2683 echo "(First creating the subdirectories...)" >&4
2685 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2687 test -z "$directory" && break
2691 if test ! -d t/base; then
2692 echo "Failed to create the subdirectories. Aborting." >&4
2695 echo "(Then creating the symlinks...)" >&4
2696 awk '{print $1}' $src/MANIFEST | while true; do
2698 test -z "$filename" && break
2699 if test -f $filename; then
2700 if $issymlink $filename; then
2704 if test -f $filename; then
2705 echo "$filename already exists, not symlinking."
2707 ln -s $src/$filename $filename
2711 if test ! -f t/base/lex.t; then
2712 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2717 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2725 : Check for Cross-Compilation
2726 case "$usecrosscompile" in
2728 $echo "Cross-compiling..."
2731 *-*-gcc) # A cross-compiling gcc, probably.
2732 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2734 # leave out ld, choosing it is more complex
2736 ranlib=$targetarch-ranlib
2737 $echo 'extern int foo;' > try.c
2738 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2740 if $test $# -gt 0; then
2742 incpth="`$echo $incpth|$sed 's/^ //'`"
2743 echo "Guessing incpth '$incpth'." >&4
2745 j="`$echo $i|$sed 's,/include$,/lib,'`"
2746 if $test -d $j; then
2750 libpth="`$echo $libpth|$sed 's/^ //'`"
2751 echo "Guessing libpth '$libpth'." >&4
2756 case "$targetarch" in
2757 '') echo "Targetarch not defined." >&4; croak=y ;;
2758 *) echo "Using targetarch $targetarch." >&4 ;;
2761 '') echo "Incpth not defined." >&4; croak=y ;;
2762 *) echo "Using incpth '$incpth'." >&4 ;;
2765 '') echo "Libpth not defined." >&4; croak=y ;;
2766 *) echo "Using libpth '$libpth'." >&4 ;;
2769 '') for i in $incpth; do
2770 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2772 echo "Guessing usrinc $usrinc." >&4
2777 '') echo "Usrinc not defined." >&4; croak=y ;;
2780 *) echo "Using usrinc $usrinc." >&4 ;;
2782 case "$targethost" in
2783 '') echo "Targethost not defined." >&4; croak=y ;;
2784 *) echo "Using targethost $targethost." >&4
2789 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2792 /*) run=$src/Cross/run
2793 targetmkdir=$src/Cross/mkdir
2795 from=$src/Cross/from
2797 *) pwd=`$test -f ../Configure & cd ..; pwd`
2799 targetmkdir=$pwd/Cross/mkdir
2801 from=$pwd/Cross/from
2804 case "$targetrun" in
2805 '') targetrun=ssh ;;
2810 case "$targetfrom" in
2811 '') targetfrom=scp ;;
2815 from=$from-$targetfrom
2816 case "$targetdir" in
2818 echo "Guessing targetdir $targetdir." >&4
2821 case "$targetuser" in
2823 echo "Guessing targetuser $targetuser." >&4
2826 case "$targetfrom" in
2830 case "$targetrun" in
2842 '') cwd=$targetdir ;;
2846 if $test ! -f \$exe.xok; then
2850 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2853 *) echo "Unknown targetrun '$targetrun'" >&4
2857 case "$targetmkdir" in
2859 cat >$targetmkdir <<EOF
2861 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2863 $chmod a+rx $targetmkdir
2865 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2877 $targetmkdir \`dirname \$f\`
2878 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2881 $targetmkdir $targetdir/\`dirname \$f\`
2882 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2895 $mkdir -p $targetdir/\`dirname \$f\`
2896 $cp \$f $targetdir/\$f || exit 1
2899 $targetmkdir $targetdir/\`dirname \$f\`
2900 $cp \$f $targetdir/\$f || exit 1
2907 *) echo "Unknown targetto '$targetto'" >&4
2911 case "$targetfrom" in
2918 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2923 cp) cat >$from <<EOF
2928 cp $targetdir/\$f . || exit 1
2933 *) echo "Unknown targetfrom '$targetfrom'" >&4
2937 if $test ! -f $run; then
2938 echo "Target 'run' script '$run' not found." >&4
2942 if $test ! -f $to; then
2943 echo "Target 'to' script '$to' not found." >&4
2947 if $test ! -f $from; then
2948 echo "Target 'from' script '$from' not found." >&4
2952 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2956 Using '$run' for remote execution,
2957 and '$from' and '$to'
2958 for remote file transfer.
2964 usecrosscompile='undef'
2969 : see whether [:lower:] and [:upper:] are supported character classes
2971 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2973 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2977 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2978 # (0xd9 and 0xe2), therefore that is a nice testing point.
2979 if test "X$up" = X -o "X$low" = X; then
2980 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2986 if test "X$up" = X -o "X$low" = X; then
2987 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2993 if test "X$up" = X -o "X$low" = X; then
2994 case "`echo RS | od -x 2>/dev/null`" in
2996 echo "Hey, this might be EBCDIC." >&4
2997 if test "X$up" = X -o "X$low" = X; then
2998 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2999 rs) up='[A-IJ-RS-Z]'
3004 if test "X$up" = X -o "X$low" = X; then
3005 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3015 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3017 echo "Using $up and $low to convert case." >&4
3020 echo "I don't know how to translate letters from upper to lower case." >&4
3021 echo "Your tr is not acting any way I know of." >&4
3025 : set up the translation script tr, must be called with ./tr of course
3029 '[A-Z][a-z]') exec $tr '$up' '$low';;
3030 '[a-z][A-Z]') exec $tr '$low' '$up';;
3037 : Try to determine whether config.sh was made on this system
3038 case "$config_sh" in
3040 myuname=`$uname -a 2>/dev/null`
3041 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
3042 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
3043 # because the A-Z/a-z are not consecutive.
3044 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
3045 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
3046 newmyuname="$myuname"
3048 case "$knowitall" in
3050 if test -f ../config.sh; then
3051 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3052 eval "`grep myuname= ../config.sh`"
3054 if test "X$myuname" = "X$newmyuname"; then
3062 : Get old answers from old config file if Configure was run on the
3063 : same system, otherwise use the hints.
3066 if test -f config.sh; then
3068 rp="I see a config.sh file. Shall I use it to set the defaults?"
3071 n*|N*) echo "OK, I'll ignore it."
3072 mv config.sh config.sh.old
3073 myuname="$newmyuname"
3075 *) echo "Fetching default answers from your old config.sh file..." >&4
3083 : Older versions did not always set $sh. Catch re-use of such
3093 if test ! -f config.sh; then
3096 First time through, eh? I have some defaults handy for some systems
3097 that need some extra help getting the Configure answers right:
3100 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3102 : Half the following guesses are probably wrong... If you have better
3103 : tests or hints, please send them to perlbug@perl.org
3104 : The metaconfig authors would also appreciate a copy...
3105 $test -f /irix && osname=irix
3106 $test -f /xenix && osname=sco_xenix
3107 $test -f /dynix && osname=dynix
3108 $test -f /dnix && osname=dnix
3109 $test -f /lynx.os && osname=lynxos
3110 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3111 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3112 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3113 $test -f /bin/mips && /bin/mips && osname=mips
3114 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3115 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3116 $test -d /usr/apollo/bin && osname=apollo
3117 $test -f /etc/saf/_sactab && osname=svr4
3118 $test -d /usr/include/minix && osname=minix
3119 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3120 if $test -d /MachTen -o -d /MachTen_Folder; then
3122 if $test -x /sbin/version; then
3123 osvers=`/sbin/version | $awk '{print $2}' |
3124 $sed -e 's/[A-Za-z]$//'`
3125 elif $test -x /usr/etc/version; then
3126 osvers=`/usr/etc/version | $awk '{print $2}' |
3127 $sed -e 's/[A-Za-z]$//'`
3133 $test -f /sys/posix.dll &&
3134 $test -f /usr/bin/what &&
3135 set X `/usr/bin/what /sys/posix.dll` &&
3136 $test "$3" = UWIN &&
3140 if $test -f $uname; then
3148 umips) osname=umips ;;
3151 [23]100) osname=mips ;;
3152 next*) osname=next ;;
3154 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3155 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3158 elif $test -f /etc/kconfig; then
3160 if test "$lns" = "$ln -s"; then
3162 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3164 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3171 if test -n "$DJGPP"; then
3180 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3182 # oslevel can fail with:
3183 # oslevel: Unable to acquire lock.
3184 *not\ found) osvers="$4"."$3" ;;
3185 '<3240'|'<>3240') osvers=3.2.0 ;;
3186 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3187 '=3250'|'>3250') osvers=3.2.5 ;;
3191 bsd386) osname=bsd386
3194 cygwin*) osname=cygwin
3197 *dc.osx) osname=dcosx
3203 domainos) osname=apollo
3209 dragonfly) osname=dragonfly
3212 dynixptx*) osname=dynixptx
3213 osvers=`echo "$4"|sed 's/^v//'`
3215 freebsd) osname=freebsd
3217 genix) osname=genix ;;
3221 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3237 netbsd*) osname=netbsd
3240 news-os) osvers="$3"
3242 4*) osname=newsos4 ;;
3246 next*) osname=next ;;
3247 nonstop-ux) osname=nonstopux ;;
3248 openbsd) osname=openbsd
3254 POSIX-BC | posix-bc ) osname=posix-bc
3257 powerux | power_ux | powermax_os | powermaxos | \
3258 powerunix | power_unix) osname=powerux
3264 solaris) osname=solaris
3266 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3273 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3277 titanos) osname=titanos
3286 ultrix) osname=ultrix
3289 osf1|mls+) case "$5" in
3292 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3295 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3298 hp*) osname=hp_osf1 ;;
3299 mips) osname=mips_osf1 ;;
3302 # UnixWare 7.1.2 is known as Open UNIX 8
3303 openunix|unixware) osname=svr5
3311 $2) case "$osname" in
3315 : svr4.x or possibly later
3325 if test -f /stand/boot ; then
3326 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3327 if test -n "$INITPROG" -a -f "$INITPROG"; then
3328 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3329 if test -n "$isesix"; then
3337 *) if test -f /etc/systemid; then
3339 set `echo $3 | $sed 's/\./ /g'` $4
3340 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3342 elif $test -f $src/hints/sco_$1_$2.sh; then
3344 elif $test -f $src/hints/sco_$1.sh; then
3349 '') : Still unknown. Probably a generic Sys V.
3358 *) case "$osname" in
3359 '') : Still unknown. Probably a generic BSD.
3367 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3368 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3369 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3372 $rm -f UU/kernel.what
3373 elif test -d c:/. -o -n "$is_os2" ; then
3380 case "$targetarch" in
3383 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3388 : Now look for a hint file osname_osvers, unless one has been
3389 : specified already.
3392 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3393 : Also try without trailing minor version numbers.
3394 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3395 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3396 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3397 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3400 *) case "$osvers" in
3403 *) if $test -f $src/hints/$file.sh ; then
3405 elif $test -f $src/hints/$xfile.sh ; then
3407 elif $test -f $src/hints/$xxfile.sh ; then
3409 elif $test -f $src/hints/$xxxfile.sh ; then
3411 elif $test -f $src/hints/$xxxxfile.sh ; then
3413 elif $test -f "$src/hints/${osname}.sh" ; then
3422 if $test -f Policy.sh ; then
3425 none) dflt="Policy" ;;
3426 *) dflt="Policy $dflt" ;;
3431 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3435 if $test -f Policy.sh ; then
3438 There's also a Policy hint file available, which should make the
3439 site-specific (policy) questions easier to answer.
3446 You may give one or more space-separated answers, or "none" if appropriate.
3447 If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3448 previous run of Configure, you may specify it as well as or instead of
3449 OS-specific hints. If hints are provided for your OS, you should use them:
3450 although Perl can probably be built without hints on many platforms, using
3451 hints often improve performance and may enable features that Configure can't
3452 set up on its own. If there are no hints that match your OS, specify "none";
3453 DO NOT give a wrong version or a wrong OS.
3457 rp="Which of these apply, if any?"
3460 for file in $tans; do
3461 if $test X$file = XPolicy -a -f Policy.sh; then
3463 $cat Policy.sh >> UU/config.sh
3464 elif $test -f $src/hints/$file.sh; then
3465 . $src/hints/$file.sh
3466 $cat $src/hints/$file.sh >> UU/config.sh
3467 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3470 : Give one chance to correct a possible typo.
3471 echo "$file.sh does not exist"
3473 rp="hint to use instead?"
3475 for file in $ans; do
3476 if $test -f "$src/hints/$file.sh"; then
3477 . $src/hints/$file.sh
3478 $cat $src/hints/$file.sh >> UU/config.sh
3479 elif $test X$ans = X -o X$ans = Xnone ; then
3482 echo "$file.sh does not exist -- ignored."
3489 : Remember our hint file for later.
3490 if $test -f "$src/hints/$file.sh" ; then
3500 echo "Fetching default answers from $config_sh..." >&4
3504 cp $config_sh config.sh 2>/dev/null
3514 test "$override" && . ./optdef.sh
3516 : Restore computed paths
3517 for file in $loclist $trylist; do
3518 eval $file="\$_$file"
3523 Configure uses the operating system name and version to set some defaults.
3524 The default value is probably right if the name rings a bell. Otherwise,
3525 since spelling matters for me, either accept the default or answer "none"
3532 ''|' '|none) dflt=none ;;
3533 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3536 *) dflt="$osname" ;;
3538 rp="Operating system name?"
3542 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3548 ''|' '|none) dflt=none ;;
3549 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3550 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3552 ''|' ') dflt=none ;;
3557 *) dflt="$osvers" ;;
3559 rp="Operating system version?"
3569 : who configured the system
3570 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3573 cf_by=`(logname) 2>/dev/null`
3576 cf_by=`(whoami) 2>/dev/null`
3578 "") cf_by=unknown ;;
3583 : decide how portable to be. Allow command line overrides.
3584 case "$d_portable" in
3586 *) d_portable="$define" ;;
3589 : set up shell script to do ~ expansion
3595 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3598 if $test -f /bin/csh; then
3599 /bin/csh -f -c "glob \$1"
3604 name=\`$expr x\$1 : '..\([^/]*\)'\`
3605 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3606 if $test ! -d "\$dir"; then
3608 echo "\$me: can't locate home directory for: \$name" >&2
3613 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3629 : now set up to get a file name
3633 cat <<'EOSC' >>getfile
3649 : getfile will accept an answer from the comma-separated list
3650 : enclosed in parentheses even if it does not meet other criteria.
3651 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3652 fn=`echo $fn | sed 's/(.*)//'`
3658 loc_file=`expr $fn : '.*:\(.*\)'`
3659 fn=`expr $fn : '\(.*\):.*'`
3667 */*) fullpath=true;;
3676 *e*) exp_file=true;;
3679 *p*) nopath_ok=true;;
3684 *d*) type='Directory';;
3685 *l*) type='Locate';;
3690 Locate) what='File';;
3695 case "$d_portable" in
3703 while test "$type"; do
3708 true) rp="$rp (~name ok)";;
3711 if test -f UU/getfile.ok && \
3712 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3731 value=`UU/filexp $ans`
3734 if test "$ans" != "$value"; then
3735 echo "(That expands to $value on this system.)"
3749 /*) value="$ansexp" ;;
3750 [a-zA-Z]:/*) value="$ansexp" ;;
3755 echo "I shall only accept a full path name, as in /bin/ls." >&4
3756 echo "Use a ! shell escape if you wish to check pathnames." >&4
3759 echo "Please give a full path name, starting with slash." >&4
3762 echo "Note that using ~name is ok provided it expands well." >&4
3775 for fp in $gfpth; do
3776 if test "X$fp" = X.; then
3781 if test -f "$pf"; then
3783 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3785 echo "($value is not a plain file, but that's ok.)"
3788 if test X"$type" = X; then
3795 for fp in $gfpth; do
3796 if test "X$fp" = X.; then
3801 direxp="$fp/$ansexp"
3803 if test -d "$direxp"; then
3811 if test -d "$ansexp"; then
3812 echo "(Looking for $loc_file in directory $value.)"
3813 value="$value/$loc_file"
3814 ansexp="$ansexp/$loc_file"
3816 if test -f "$ansexp"; then
3819 case "$nopath_ok" in
3820 true) case "$value" in
3822 *) echo "Assuming $value will be in people's path."
3838 if test "$fastread" = yes; then
3843 rp="$what $value doesn't exist. Use that name anyway?"
3862 test "X$gfpthkeep" != Xy && gfpth=""
3865 : determine root of directory hierarchy where package will be installed.
3868 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3871 dflt=`echo "$prefix" | sed 's/.$//'`
3879 By default, $package will be installed in $dflt/bin, manual pages
3880 under $dflt/man, etc..., i.e. with $dflt as prefix for all
3881 installation directories. Typically this is something like /usr/local.
3882 If you wish to have binaries under /usr/bin but other parts of the
3883 installation under /usr/local, that's ok: you will be prompted
3884 separately for each of the installation directories, the prefix being
3885 only used to set the defaults.
3889 rp='Installation prefix to use?'
3897 *) oldprefix="$prefix";;
3906 *) afsroot=$afsroot ;;
3912 $define|true) afs=true ;;
3913 $undef|false) afs=false ;;
3914 *) if test -d $afsroot; then
3922 echo "AFS may be running... I'll be extra cautious then..." >&4
3924 echo "AFS does not seem to be running..." >&4
3927 : determine installation prefix for where package is to be installed.
3931 Since you are running AFS, I need to distinguish the directory in which
3932 files will reside from the directory in which they are installed (and from
3933 which they are presumably copied to the former directory by occult means).
3936 case "$installprefix" in
3937 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3938 *) dflt="$installprefix";;
3943 In some special cases, particularly when building $package for distribution,
3944 it is convenient to distinguish the directory in which files should be
3945 installed from the directory ($prefix) in which they will
3946 eventually reside. For most users, these two directories are the same.
3949 case "$installprefix" in
3951 *) dflt=$installprefix;;
3955 rp='What installation prefix should I use for installing files?'
3957 installprefix="$ans"
3958 installprefixexp="$ansexp"
3960 : Perform the prefixexp/installprefixexp correction if necessary
3961 cat <<EOS >installprefix
3964 cat <<'EOSC' >>installprefix
3965 : Change installation prefix, if necessary.
3966 if $test X"$prefix" != X"$installprefix"; then
3967 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3969 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3972 chmod +x installprefix
3973 $eunicefix installprefix
3975 : Set variables such as privlib and privlibexp from the output of ./getfile
3976 : performing the prefixexp/installprefixexp correction if necessary.
3977 cat <<EOS >setprefixvar
3980 cat <<'EOSC' >>setprefixvar
3981 eval "${prefixvar}=\"\$ans\""
3982 eval "${prefixvar}exp=\"\$ansexp\""
3985 chmod +x setprefixvar
3986 $eunicefix setprefixvar
3988 : set up the script used to warn in case of inconsistency
3997 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
3999 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4000 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4005 echo "*** WHOA THERE!!! ***" >&4
4006 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4009 rp=" Keep the $hint value?"
4012 y) td=$was; tu=$was;;
4016 : function used to set $1 to $val
4017 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4019 $define$undef) . ./whoa; eval "$var=\$td";;
4020 $undef$define) . ./whoa; eval "$var=\$tu";;
4021 *) eval "$var=$val";;
4025 $define|true|[yY]*) dflt='y';;
4030 Perl can be built to use the SOCKS proxy protocol library. To do so,
4031 Configure must be run with -Dusesocks. If you use SOCKS you also need
4032 to use the PerlIO abstraction layer, this will be implicitly selected.
4034 If this doesn't make any sense to you, just accept the default '$dflt'.
4036 rp='Build Perl for SOCKS?'
4039 y|Y) val="$define" ;;
4046 $define|true|[yY]*) useperlio="$define";;
4049 case "$useperlio" in
4050 $define|true|[yY]*|'') dflt='y';;
4055 Previous version of $package used the standard IO mechanisms as
4056 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4057 alternate IO mechanisms via the PerlIO abstraction layer, but the
4058 stdio mechanism is still available if needed. The abstraction layer
4059 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4060 Using PerlIO with sfio may cause problems with some extension modules.
4062 If this doesn't make any sense to you, just accept the default '$dflt'.
4064 rp='Use the PerlIO abstraction layer?'
4071 echo "Ok, doing things the stdio way."
4080 case "$useperlio" in
4081 $define|true|[yY]*) ;;
4084 You are using the SOCKS proxy protocol library which means that you
4085 should also use the PerlIO layer. You may be headed for trouble.
4094 : get the patchlevel
4096 echo "Getting the current patchlevel..." >&4
4097 if $test -r $rsrc/patchlevel.h;then
4098 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4099 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4100 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4101 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4102 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4103 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4104 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4113 $echo "(You do not have patchlevel.h. Eek.)"
4115 if $test -r $rsrc/.patch ; then
4116 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4117 perl_patchlevel=`cat $rsrc/.patch`
4120 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4121 version_patchlevel_string="version $patchlevel subversion $subversion"
4122 case "$perl_patchlevel" in
4124 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4127 $echo "(You have $package $version_patchlevel_string.)"
4131 : XXX Should be a Configure test for double-dots in filenames.
4132 version=`echo $revision $patchlevel $subversion | \
4133 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4134 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4135 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4138 version=`echo $revision $patchlevel $subversion | \
4139 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4140 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4141 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4144 : Special case the 5.005_xx maintenance series, which used 5.005
4145 : without any subversion label as a subdirectory in $sitelib
4146 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4147 api_versionstring='5.005'
4150 : Do we want threads support and if so, what type
4151 case "$usethreads" in
4152 $define|true|[yY]*) dflt='y';;
4153 *) # Catch case where user specified ithreads or 5005threads but
4154 # forgot -Dusethreads (A.D. 4/2002)
4155 case "$useithreads$use5005threads" in
4157 case "$useperlio" in
4158 "$define") dflt='y' ;;
4168 Perl can be built to take advantage of threads on some systems.
4169 To do so, Configure can be run with -Dusethreads.
4171 Note that Perl built with threading support runs slightly slower
4172 and uses more memory than plain Perl. The current implementation
4173 is believed to be stable, but it is fairly new, and so should be
4174 treated with caution.
4176 If this doesn't make any sense to you, just accept the default '$dflt'.
4178 rp='Build a threading Perl?'
4181 y|Y) val="$define" ;;
4187 if $test $patchlevel -lt 9; then
4188 case "$usethreads" in
4192 Since release 5.6, Perl has had two different threading implementations,
4193 the newer interpreter-based version (ithreads) with one interpreter per
4194 thread, and the older 5.005 version (5005threads).
4195 The 5005threads version is effectively unmaintained and will probably be
4196 removed in Perl 5.10, so there should be no need to build a Perl using it
4197 unless needed for backwards compatibility with some existing 5.005threads
4201 : Default to ithreads unless overridden on command line or with
4204 case "$use5005threads" in
4205 $define|true|[yY]*) dflt='n';;
4207 case "$useithreads" in
4208 $undef|false|[nN]*) dflt='n';;
4210 rp='Use the newer interpreter-based ithreads?'
4213 y|Y) val="$define" ;;
4218 : Now set use5005threads to the opposite value.
4219 case "$useithreads" in
4220 $define) val="$undef" ;;
4227 useithreads="$undef"
4228 use5005threads="$undef"
4232 case "$useithreads$use5005threads" in
4236 You cannot have both the ithreads and the 5.005 threads enabled
4237 at the same time. Disabling the 5.005 threads since they are
4238 much less stable than the ithreads.
4241 use5005threads="$undef"
4246 : perl-5.9.x and later
4248 if test X"$usethreads" = "X$define"; then
4249 case "$use5005threads" in
4253 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4260 use5005threads="$undef"
4261 useithreads="$usethreads"
4264 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4267 *** To build with ithreads you must also use the PerlIO layer.
4268 *** Cannot continue, aborting.
4274 case "$d_oldpthreads" in
4275 '') : Configure tests would be welcome here. For now, assume undef.
4277 *) val="$d_oldpthreads" ;;
4283 : Look for a hint-file generated 'call-back-unit'. If the
4284 : user has specified that a threading perl is to be built,
4285 : we may need to set or change some other defaults.
4286 if $test -f usethreads.cbu; then
4287 echo "Your platform has some specific hints regarding threaded builds, using them..."
4290 case "$usethreads" in
4291 "$define"|true|[yY]*)
4293 (Your platform does not have any specific hints for threaded builds.
4294 Assuming POSIX threads, then.)
4302 Perl can be built so that multiple Perl interpreters can coexist
4303 within the same Perl executable.
4306 case "$useithreads" in
4309 This multiple interpreter support is required for interpreter-based threads.
4313 *) case "$usemultiplicity" in
4314 $define|true|[yY]*) dflt='y';;
4318 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4319 rp='Build Perl for multiplicity?'
4322 y|Y) val="$define" ;;
4331 case "$usemorebits" in
4332 "$define"|true|[yY]*)
4333 use64bitint="$define"
4334 uselongdouble="$define"
4335 usemorebits="$define"
4337 *) usemorebits="$undef"
4341 : make some quick guesses about what we are up against
4343 $echo $n "Hmm... $c"
4353 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4354 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4356 echo "Looks kind of like an OSF/1 system, but we'll see..."
4358 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4359 xxx=`./loc addbib blurfl $pth`
4360 if $test -f $xxx; then
4361 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4365 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4366 echo "Looks kind of like an extended USG system, but we'll see..."
4368 echo "Looks kind of like a USG system, but we'll see..."
4372 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4373 echo "Looks kind of like a BSD system, but we'll see..."
4377 echo "Looks kind of like a Version 7 system, but we'll see..."
4380 case "$eunicefix" in
4383 There is, however, a strange, musty smell in the air that reminds me of
4384 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4388 : it so happens the Eunice I know will not run shell scripts in Unix format
4392 echo "Congratulations. You aren't running Eunice."
4396 : Detect OS2. The p_ variable is set above in the Head.U unit.
4397 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4398 : semicolon as a patch separator
4403 I have the feeling something is not exactly right, however...don't tell me...
4404 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4405 (Or you may be running DOS with DJGPP.)
4410 if test -f /xenix; then
4411 echo "Actually, this looks more like a XENIX system..."
4416 echo "It's not Xenix..."
4421 if test -f /venix; then
4422 echo "Actually, this looks more like a VENIX system..."
4429 echo "Nor is it Venix..."
4432 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4433 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4440 rp="Use which C compiler?"
4444 : See if they have not cc but they do have gcc
4446 : Look for a hint-file generated 'call-back-unit'. Now that the
4447 : user has specified the compiler, we may need to set or change some
4449 if $test -f cc.cbu; then
4454 : Check if we are using GNU gcc and what its version is
4456 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4460 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4462 printf("%s\n", __VERSION__);
4464 printf("%s\n", "1");
4470 if $cc -o try $ccflags $ldflags try.c; then
4471 gccversion=`$run ./try`
4472 case "$gccversion" in
4473 '') echo "You are not using GNU cc." ;;
4474 *) echo "You are using GNU cc $gccversion."
4480 echo "*** WHOA THERE!!! ***" >&4
4481 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4482 case "$knowitall" in
4484 echo " You'd better start hunting for one and let me know about it." >&4
4490 case "$gccversion" in
4491 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4493 case "$gccversion" in
4494 '') gccosandvers='' ;;
4495 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4496 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4498 case "$gccosandvers" in
4499 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4500 $osname$osvers) ;; # looking good
4501 $osname*) cat <<EOM >&4
4503 *** WHOA THERE!!! ***
4505 Your gcc has not been compiled for the exact release of
4506 your operating system ($gccosandvers versus $osname$osvers).
4508 In general it is a good idea to keep gcc synchronized with
4509 the operating system because otherwise serious problems
4510 may ensue when trying to compile software, like Perl.
4512 I'm trying to be optimistic here, though, and will continue.
4513 If later during the configuration and build icky compilation
4514 problems appear (headerfile conflicts being the most common
4515 manifestation), I suggest reinstalling the gcc to match
4516 your operating system release.
4520 *) gccosandvers='' ;; # failed to parse, better be silent
4528 # gcc 3.* complain about adding -Idirectories that they already know about,
4529 # so we will take those off from locincpth.
4530 case "$gccversion" in
4532 echo "main(){}">try.c
4533 for incdir in $locincpth; do
4534 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4535 grep '^c[cp]p*[01]: warning: changing search order '`
4536 if test "X$warn" != X; then
4537 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4543 : What should the include directory be ?
4545 $echo $n "Hmm... $c"
4549 if $test -f /bin/mips && /bin/mips; then
4550 echo "Looks like a MIPS system..."
4551 $cat >usr.c <<'EOCP'
4552 #ifdef SYSTYPE_BSD43
4556 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4557 dflt='/bsd43/usr/include'
4561 mips_type='System V'
4563 $rm -f usr.c usr.out
4564 echo "and you're compiling with the $mips_type compiler and libraries."
4568 echo "Doesn't look like a MIPS system."
4578 case "$xxx_prompt" in
4581 rp='Where are the include files you want to use?'
4589 : see how we invoke the C preprocessor
4591 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4592 cat <<'EOT' >testcpp.c
4598 if test ! -f cppstdin; then
4599 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4600 # AIX cc -E doesn't show the absolute headerfile
4601 # locations but we'll cheat by using the -M flag.
4602 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
4604 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4607 echo "Keeping your $hint cppstdin wrapper."
4610 wrapper=`pwd`/cppstdin
4614 if $test "X$cppstdin" != "X" && \
4615 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4616 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4618 echo "You used to use $cppstdin $cppminus so we'll use that again."
4620 '') echo "But let's see if we can live without a wrapper..." ;;
4622 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4623 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4625 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4628 echo "(However, $cpprun $cpplast does not work, let's see...)"
4636 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4643 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4644 $cc -E <testcpp.c >testcpp.out 2>&1; \
4645 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4646 echo "Yup, it does."
4649 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4650 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4651 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4652 echo "Yup, it does."
4655 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4656 $cc -P <testcpp.c >testcpp.out 2>&1; \
4657 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4658 echo "Yipee, that works!"
4661 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4662 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4663 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4664 echo "At long last!"
4667 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4668 $cpp <testcpp.c >testcpp.out 2>&1; \
4669 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4673 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4674 $cpp - <testcpp.c >testcpp.out 2>&1; \
4675 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4676 echo "Hooray, it works! I was beginning to wonder."
4679 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4680 $wrapper <testcpp.c >testcpp.out 2>&1; \
4681 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4687 rp="No dice. I can't find a C preprocessor. Name one:"
4691 $x_cpp <testcpp.c >testcpp.out 2>&1
4692 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4693 echo "OK, that will do." >&4
4695 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4710 echo "Perhaps can we force $cc -E using a wrapper..."
4711 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4712 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4718 echo "Nope, we'll have to live without it..."
4732 "$wrapper"|'cppstdin') ;;
4733 *) $rm -f $wrapper;;
4735 $rm -f testcpp.c testcpp.out
4737 : Set private lib path
4740 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4745 '') dlist="$loclibpth $plibpth $glibpth";;
4746 *) dlist="$libpth";;
4749 : Now check and see which directories actually exist, avoiding duplicates
4753 if $test -d $xxx; then
4756 *) libpth="$libpth $xxx";;
4762 Some systems have incompatible or broken versions of libraries. Among
4763 the directories listed in the question below, please remove any you
4764 know not to be holding relevant libraries, and add any that are needed.
4765 Say "none" for none.
4776 rp="Directories to use for library searches?"
4783 : compute shared library extension
4786 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4796 On some systems, shared libraries may be available. Answer 'none' if
4797 you want to suppress searching of shared libraries for the remainder
4798 of this configuration.
4801 rp='What is the file extension used for shared libraries?'
4805 : Define several unixisms.
4806 : Hints files or command line option can be used to override them.
4807 : The convoluted testing is in case hints files set either the old
4810 '') case "$exe_ext" in
4812 *) _exe="$exe_ext" ;;
4817 '') case "$lib_ext" in
4824 '') case "$obj_ext" in
4831 '') case "$path_sep" in
4842 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4844 : Which makefile gets called first. This is used by make depend.
4845 case "$firstmakefile" in
4846 '') firstmakefile='makefile';;
4850 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4853 case "$uselongdouble" in
4854 $define|true|[yY]*) dflt='y';;
4859 Perl can be built to take advantage of long doubles which
4860 (if available) may give more accuracy and range for floating point numbers.
4862 If this doesn't make any sense to you, just accept the default '$dflt'.
4864 rp='Try to use long doubles if available?'
4867 y|Y) val="$define" ;;
4873 case "$uselongdouble" in
4874 true|[yY]*) uselongdouble="$define" ;;
4877 : Look for a hint-file generated 'call-back-unit'. If the
4878 : user has specified that long doubles should be used,
4879 : we may need to set or change some other defaults.
4880 if $test -f uselongdouble.cbu; then
4881 echo "Your platform has some specific hints regarding long doubles, using them..."
4882 . ./uselongdouble.cbu
4884 case "$uselongdouble" in
4887 (Your platform does not have any specific hints for long doubles.)
4893 : Looking for optional libraries
4895 echo "Checking for optional libraries..." >&4
4900 case "$libswanted" in
4901 '') libswanted='c_s';;
4904 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4910 for thisdir in $libpth $xlibpth; do
4911 test -d $thisdir && libspath="$libspath $thisdir"
4913 for thislib in $libswanted; do
4914 for thisdir in $libspath; do
4916 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4917 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4918 $test -f "$xxx" && eval $libscheck
4919 $test -f "$xxx" && libstyle=shared
4921 if test ! -f "$xxx"; then
4922 xxx=$thisdir/lib$thislib.$so
4923 $test -f "$xxx" && eval $libscheck
4924 $test -f "$xxx" && libstyle=shared
4926 if test ! -f "$xxx"; then
4927 xxx=$thisdir/lib$thislib$_a
4928 $test -f "$xxx" && eval $libscheck
4929 $test -f "$xxx" && libstyle=static
4931 if test ! -f "$xxx"; then
4932 xxx=$thisdir/$thislib$_a
4933 $test -f "$xxx" && eval $libscheck
4934 $test -f "$xxx" && libstyle=static
4936 if test ! -f "$xxx"; then
4937 xxx=$thisdir/lib${thislib}_s$_a
4938 $test -f "$xxx" && eval $libscheck
4939 $test -f "$xxx" && libstyle=static
4940 $test -f "$xxx" && thislib=${thislib}_s
4942 if test ! -f "$xxx"; then
4943 xxx=$thisdir/Slib$thislib$_a
4944 $test -f "$xxx" && eval $libscheck
4945 $test -f "$xxx" && libstyle=static
4947 if $test -f "$xxx"; then
4949 shared) echo "Found -l$thislib (shared)." ;;
4950 static) echo "Found -l$thislib." ;;
4951 *) echo "Found -l$thislib ($libstyle)." ;;
4955 *) dflt="$dflt -l$thislib"
4956 libsfound="$libsfound $xxx"
4958 libsfiles="$libsfiles $yyy"
4959 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4960 case " $libsdirs " in
4962 *) libsdirs="$libsdirs $yyy" ;;
4969 if $test ! -f "$xxx"; then
4970 echo "No -l$thislib."
4981 ' '|'') dflt='none';;
4986 In order to compile $package on your machine, a number of libraries
4987 are usually needed. Include any other special libraries here as well.
4988 Say "none" for none. The default list is almost always right.
4992 rp="What libraries to use?"
4999 : determine optimization, if desired, or use for debug flag also
5001 ' '|$undef) dflt='none';;
5003 *) dflt="$optimize";;
5007 By default, $package compiles with the -O flag to use the optimizer.
5008 Alternately, you might want to use the symbolic debugger, which uses
5009 the -g flag (on traditional Unix systems). Either flag can be
5010 specified here. To use neither flag, specify the word "none".
5013 rp="What optimizer/debugger flag should be used?"
5017 'none') optimize=" ";;
5020 : Check what DEBUGGING is required from the command line
5021 : -DEBUGGING or -DDEBUGGING or
5022 : -DEBUGGING=both = -g + -DDEBUGGING
5023 : -DEBUGGING=-g or -Doptimize=-g = -g
5024 : -DEBUGGING=none or -UDEBUGGING =
5025 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5028 *) DEBUGGING=$EBUGGING ;;
5031 case "$DEBUGGING" in
5035 *) optimize="$optimize -g" ;;
5039 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5047 case "$DEBUGGING" in
5048 both|$define) dflt='-DDEBUGGING'
5051 : argument order is deliberate, as the flag will start with - which set could
5052 : think is an option
5053 checkccflag='check=$1; flag=$2; callback=$3;
5055 echo "Checking if your compiler accepts $flag" 2>&1;
5056 echo "int main(void) { return 0; }" > gcctest.c;
5057 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5058 echo "Yes, it does." 2>&1;
5059 if $test -s gcctest.out ; then
5060 echo "But your platform does not like it:";
5065 echo "Leaving current flags $ccflags alone." 2>&1
5067 *) dflt="$dflt $flag";
5073 echo "Nope, it does not, but that is ok." 2>&1;
5077 : We will not override a previous value, but we might want to
5078 : augment a hint file
5080 default|recommended)
5081 case "$gccversion" in
5082 1*) dflt="$dflt -fpcc-struct-return" ;;
5084 case "$optimize:$DEBUGGING" in
5085 *-g*:old) dflt="$dflt -DDEBUGGING";;
5087 case "$gccversion" in
5088 2*) if $test -d /etc/conf/kconfig.d &&
5089 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5091 # Interactive Systems (ISC) POSIX mode.
5096 case "$gccversion" in
5099 ?*) set strict-aliasing -fno-strict-aliasing
5103 # For gcc, adding -pipe speeds up compilations for some, but apparently
5104 # some assemblers can't read from stdin. (It also slows down compilations
5105 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5106 case "$gccversion" in
5112 # on x86_64 (at least) we require an extra library (libssp) in the
5113 # link command line. This library is not named, so I infer that it is
5114 # an implementation detail that may change. Hence the safest approach
5115 # is to add the flag to the flags passed to the compiler at link time,
5116 # as that way the compiler can do the right implementation dependant
5118 case "$gccversion" in
5119 ?*) set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"'
5126 case "$mips_type" in
5127 *BSD*|'') inclwanted="$locincpth $usrinc";;
5128 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5130 for thisincl in $inclwanted; do
5131 if $test -d $thisincl; then
5132 if $test x$thisincl != x$usrinc; then
5134 *" -I$thisincl "*);;
5135 *) dflt="$dflt -I$thisincl ";;
5141 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5143 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5151 *) dflt="$dflt -D$2";;
5155 set signal.h LANGUAGE_C; eval $inctest
5159 ccflags="$ccflags -DSOCKS"
5164 default|recommended) dflt="$ccflags $dflt" ;;
5165 *) dflt="$ccflags";;
5174 Your C compiler may want other flags. For this question you should include
5175 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5176 but you should NOT include libraries or ld flags like -lwhatever. If you
5177 want $package to honor its debug switch, you should include -DDEBUGGING here.
5178 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5180 To use no flags, specify the word "none".
5186 rp="Any additional cc flags?"
5193 : the following weeds options from ccflags that are of no interest to cpp
5195 '') cppflags="$ccflags" ;;
5196 *) cppflags="$cppflags $ccflags" ;;
5198 case "$gccversion" in
5199 1*) cppflags="$cppflags -D__GNUC__"
5201 case "$mips_type" in
5203 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5209 echo "Let me guess what the preprocessor flags are..." >&4
5223 *) ftry="$previous $flag";;
5225 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5226 >cpp1.out 2>/dev/null && \
5227 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5228 >cpp2.out 2>/dev/null && \
5229 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5230 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5232 cppflags="$cppflags $ftry"
5242 *-*) echo "They appear to be: $cppflags";;
5244 $rm -f cpp.c cpp?.out
5248 : flags used in final linking phase
5250 '') if ./venix; then
5256 *-posix*) dflt="$dflt -posix" ;;
5259 *) dflt="$ldflags";;
5262 : Try to guess additional flags to pick up local libraries.
5263 for thislibdir in $libpth; do
5264 case " $loclibpth " in
5267 *"-L$thislibdir "*) ;;
5268 *) dflt="$dflt -L$thislibdir" ;;
5280 Your C linker may need flags. For this question you should
5281 include -L/whatever and any other flags used by the C linker, but you
5282 should NOT include libraries like -lwhatever.
5284 Make sure you include the appropriate -L/path flags if your C linker
5285 does not normally search all of the directories you specified above,
5288 To use no flags, specify the word "none".
5292 rp="Any additional ld flags (NOT including libraries)?"
5298 rmlist="$rmlist pdp11"
5302 echo "Checking your choice of C compiler and flags for coherency..." >&4
5303 $cat > try.c <<'EOF'
5305 int main() { printf("Ok\n"); return(0); }
5307 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5309 $cat >try.msg <<'EOM'
5310 I've tried to compile and run the following simple program:
5313 $cat try.c >> try.msg
5315 $cat >> try.msg <<EOM
5322 and I got the following output:
5326 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5327 if $sh -c "$run ./try " >>try.msg 2>&1; then
5331 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5334 cat >> try.msg <<'EOQS'
5335 If $libs contains -lsfio, and sfio is mis-configured, then it
5336 sometimes (apparently) runs and exits with a 0 status, but with no
5337 output! It may have to do with sfio's use of _exit vs. exit.
5340 rp="You have a big problem. Shall I abort Configure"
5347 echo "The program compiled OK, but exited with status $?." >>try.msg
5348 rp="You have a problem. Shall I abort Configure"
5352 echo "I can't compile the test program." >>try.msg
5353 rp="You have a BIG problem. Shall I abort Configure"
5359 case "$knowitall" in
5361 echo "(The supplied flags or libraries might be incorrect.)"
5369 *) echo "Ok. Stopping Configure." >&4
5374 n) echo "OK, that should do.";;
5376 $rm_try gcctest gcctest.out
5378 : define a shorthand compile call
5382 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5383 : define a shorthand compile call for compilations that should be ok.
5387 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5389 : determine filename position in cpp output
5391 echo "Computing filename position in cpp output for #include directives..." >&4
5393 vos) testaccess=-e ;;
5396 echo '#include <stdio.h>' > foo.c
5399 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5400 $grep '^[ ]*#.*stdio\.h' | \
5401 while read cline; do
5404 while $test \$# -gt 0; do
5405 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5410 pos=\`expr \$pos + 1\`
5422 *) pos="${fieldn}th";;
5424 echo "Your cpp writes the filename in the $pos field of the line."
5427 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5428 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5431 : locate header file
5436 for usrincdir in $usrinc
5438 if test -f \$usrincdir/\$wanted; then
5439 echo "\$usrincdir/\$wanted"
5443 awkprg='{ print \$$fieldn }'
5444 echo "#include <\$wanted>" > foo\$\$.c
5445 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5446 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5447 while read cline; do
5448 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5450 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5451 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5456 # status = 0: grep returned 0 lines, case statement not executed
5457 # status = 1: headerfile found
5458 # status = 2: while loop executed, no headerfile found
5462 if test \$status -eq 1; then
5469 : define an alternate in-header-list? function
5470 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5471 cont=true; xxf="echo \"<\$1> found.\" >&4";
5472 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5473 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5475 case $# in 4) instead=instead;; *) instead="at last";; esac;
5476 while $test "$cont"; do
5478 var=$2; eval "was=\$$2";
5479 if $test "$xxx" && $test -r "$xxx";
5481 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5484 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5485 set $yyy; shift; shift; yyy=$@;
5486 case $# in 0) cont="";;
5487 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5488 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5489 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5490 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5494 do set $yyy; var=$2; eval "was=\$$2";
5495 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5496 set $yyy; shift; shift; yyy=$@;
5499 : see if stdlib is available
5500 set stdlib.h i_stdlib
5503 : check for lengths of integral types
5507 echo "Checking to see how big your integers are..." >&4
5516 printf("intsize=%d;\n", (int)sizeof(int));
5517 printf("longsize=%d;\n", (int)sizeof(long));
5518 printf("shortsize=%d;\n", (int)sizeof(short));
5523 if eval $compile_ok && $run ./try > /dev/null; then
5525 echo "Your integers are $intsize bytes long."
5526 echo "Your long integers are $longsize bytes long."
5527 echo "Your short integers are $shortsize bytes long."
5531 Help! I can't compile and run the intsize test program: please enlighten me!
5532 (This is probably a misconfiguration in your system or libraries, and
5533 you really ought to fix it. Still, I'll try anyway.)
5537 rp="What is the size of an integer (in bytes)?"
5541 rp="What is the size of a long integer (in bytes)?"
5545 rp="What is the size of a short integer (in bytes)?"
5553 : check for long long
5555 echo "Checking to see if you have long long..." >&4
5556 echo 'int main() { long long x = 7; return 0; }' > try.c
5558 if eval $compile; then
5560 echo "You have long long."
5563 echo "You do not have long long."
5569 : check for length of long long
5570 case "${d_longlong}${longlongsize}" in
5573 echo "Checking to see how big your long longs are..." >&4
5574 $cat >try.c <<'EOCP'
5578 printf("%d\n", (int)sizeof(long long));
5583 if eval $compile_ok; then
5584 longlongsize=`$run ./try`
5585 echo "Your long longs are $longlongsize bytes long."
5589 echo "(I can't seem to compile the test program. Guessing...)"
5590 rp="What is the size of a long long (in bytes)?"
5594 if $test "X$longsize" = "X$longlongsize"; then
5595 echo "(That isn't any different from an ordinary long.)"
5601 : see if inttypes.h is available
5602 : we want a real compile instead of Inhdr because some systems
5603 : have an inttypes.h which includes non-existent headers
5606 #include <inttypes.h>
5608 static int32_t foo32 = 0x12345678;
5612 if eval $compile; then
5613 echo "<inttypes.h> found." >&4
5616 echo "<inttypes.h> NOT found." >&4
5625 echo "Checking to see if you have int64_t..." >&4
5627 #include <sys/types.h>
5628 #$i_inttypes I_INTTYPES
5630 #include <inttypes.h>
5632 int main() { int64_t x = 7; }
5635 if eval $compile; then
5637 echo "You have int64_t."
5640 echo "You do not have int64_t."
5646 : Check if 64bit ints have a quad type
5648 echo "Checking which 64-bit integer type we could use..." >&4
5654 val='"unsigned int"'
5659 *) case "$longsize" in
5663 val='"unsigned long"'
5668 *) case "$d_longlong:$longlongsize" in
5673 val='"unsigned long long"'
5678 *) case "$d_int64_t" in
5697 '') echo "Alas, no 64-bit integer types in sight." >&4
5700 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5706 case "$uselonglong" in
5707 "$define"|true|[yY]*)
5710 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5712 use64bitint="$define"
5715 case "$use64bits" in
5716 "$define"|true|[yY]*)
5719 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5721 use64bitint="$define"
5724 case "$use64bitints" in
5725 "$define"|true|[yY]*)
5728 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5730 use64bitint="$define"
5733 case "$use64bitsint" in
5734 "$define"|true|[yY]*)
5737 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5739 use64bitint="$define"
5742 case "$uselonglongs" in
5743 "$define"|true|[yY]*)
5746 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5748 use64bitint="$define"
5751 case "$use64bitsall" in
5752 "$define"|true|[yY]*)
5755 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5757 use64bitall="$define"
5762 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5764 case "$use64bitall" in
5765 "$define"|true|[yY]*) use64bitint="$define" ;;
5771 You have natively 64-bit long integers.
5775 *) case "$use64bitint" in
5776 "$define"|true|[yY]*) dflt='y';;
5785 Perl can be built to take advantage of 64-bit integer types
5786 on some systems. To do so, Configure can be run with -Duse64bitint.
5787 Choosing this option will most probably introduce binary incompatibilities.
5789 If this doesn't make any sense to you, just accept the default '$dflt'.
5790 (The default has been chosen based on your configuration.)
5792 rp='Try to use 64-bit integers, if available?'
5795 [yY]*) val="$define" ;;
5803 case "$use64bitall" in
5804 "$define"|true|[yY]*) dflt='y' ;;
5805 *) case "$longsize" in
5813 You may also choose to try maximal 64-bitness. It means using as much
5814 64-bitness as possible on the platform. This in turn means even more
5815 binary incompatibilities. On the other hand, your platform may not
5816 have any more 64-bitness available than what you already have chosen.
5818 If this doesn't make any sense to you, just accept the default '$dflt'.
5819 (The default has been chosen based on your configuration.)
5821 rp='Try to use maximal 64-bit support, if available?'
5824 [yY]*) val="$define" ;;
5829 case "$use64bitall" in
5831 case "$use64bitint" in
5835 Since you have chosen a maximally 64-bit build, I'm also turning on
5836 the use of 64-bit integers.
5838 use64bitint="$define" ;;
5843 : Look for a hint-file generated 'call-back-unit'. If the
5844 : user has specified that a 64-bit perl is to be built,
5845 : we may need to set or change some other defaults.
5846 if $test -f use64bitint.cbu; then
5847 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5850 case "$use64bitint" in
5851 "$define"|true|[yY]*)
5853 4) case "$archname64" in
5854 '') archname64=64int ;;
5861 : Look for a hint-file generated 'call-back-unit'. If the
5862 : user has specified that a maximally 64-bit perl is to be built,
5863 : we may need to set or change some other defaults.
5864 if $test -f use64bitall.cbu; then
5865 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5868 case "$use64bitall" in
5869 "$define"|true|[yY]*)
5871 4) case "$archname64" in
5872 ''|64int) archname64=64all ;;
5879 case "$d_quad:$use64bitint" in
5883 *** You have chosen to use 64-bit integers,
5884 *** but none can be found.
5885 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5886 *** Cannot continue, aborting.
5893 : check for length of double
5895 case "$doublesize" in
5897 echo "Checking to see how big your double precision numbers are..." >&4
5906 printf("%d\n", (int)sizeof(double));
5911 if eval $compile_ok; then
5912 doublesize=`$run ./try`
5913 echo "Your double is $doublesize bytes long."
5916 echo "(I can't seem to compile the test program. Guessing...)"
5917 rp="What is the size of a double precision number (in bytes)?"
5925 : check for long doubles
5927 echo "Checking to see if you have long double..." >&4
5928 echo 'int main() { long double x = 7.0; }' > try.c
5930 if eval $compile; then
5932 echo "You have long double."
5935 echo "You do not have long double."
5941 : check for length of long double
5942 case "${d_longdbl}${longdblsize}" in
5945 echo "Checking to see how big your long doubles are..." >&4
5946 $cat >try.c <<'EOCP'
5950 printf("%d\n", sizeof(long double));
5955 if eval $compile; then
5956 longdblsize=`$run ./try`
5957 echo "Your long doubles are $longdblsize bytes long."
5961 echo "(I can't seem to compile the test program. Guessing...)" >&4
5962 rp="What is the size of a long double (in bytes)?"
5966 if $test "X$doublesize" = "X$longdblsize"; then
5967 echo "That isn't any different from an ordinary double."
5968 echo "I'll keep your setting anyway, but you may see some"
5969 echo "harmless compilation warnings."
5975 : determine the architecture name
5977 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5978 tarch=`arch`"-$osname"
5979 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5980 if uname -m > tmparch 2>&1 ; then
5981 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5982 -e 's/$/'"-$osname/" tmparch`
5990 case "$myarchname" in
5993 echo "(Your architecture name used to be $myarchname.)"
5997 case "$targetarch" in
5999 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6004 *) dflt="$archname";;
6006 rp='What is your architecture name'
6009 case "$usethreads" in
6011 echo "Threads selected." >&4
6013 *-thread*) echo "...and architecture name already has -thread." >&4
6015 *) archname="$archname-thread"
6016 echo "...setting architecture name to $archname." >&4
6021 case "$usemultiplicity" in
6023 echo "Multiplicity selected." >&4
6025 *-multi*) echo "...and architecture name already has -multi." >&4
6027 *) archname="$archname-multi"
6028 echo "...setting architecture name to $archname." >&4
6033 case "$use64bitint$use64bitall" in
6035 case "$archname64" in
6037 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6040 case "$use64bitint" in
6041 "$define") echo "64 bit integers selected." >&4 ;;
6043 case "$use64bitall" in
6044 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6047 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6049 *) archname="$archname-$archname64"
6050 echo "...setting architecture name to $archname." >&4
6056 case "$uselongdouble" in
6058 echo "Long doubles selected." >&4
6059 case "$longdblsize" in
6061 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6065 *-ld*) echo "...and architecture name already has -ld." >&4
6067 *) archname="$archname-ld"
6068 echo "...setting architecture name to $archname." >&4
6075 case "$useperlio" in
6077 echo "Perlio selected." >&4
6080 echo "Perlio not selected, using stdio." >&4
6082 *-stdio*) echo "...and architecture name already has -stdio." >&4
6084 *) archname="$archname-stdio"
6085 echo "...setting architecture name to $archname." >&4
6090 if $test -f archname.cbu; then
6091 echo "Your platform has some specific hints for architecture name, using them..."
6095 : set the prefixit variable, to compute a suitable default value
6096 prefixit='case "$3" in
6098 case "$oldprefix" in
6099 "") eval "$1=\"\$$2\"";;
6106 ""|" ") eval "$1=\"\$$2\"";;
6112 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6114 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6115 /*-$oldprefix/*|\~*-$oldprefix/*)
6116 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6117 *) eval "$1=\"\$$2\"";;
6121 : determine installation style
6122 : For now, try to deduce it from prefix unless it is already set.
6123 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6124 case "$installstyle" in
6125 '') case "$prefix" in
6126 *perl*) dflt='lib';;
6127 *) dflt='lib/perl5' ;;
6130 *) dflt="$installstyle" ;;
6132 : Probably not worth prompting for this since we prompt for all
6133 : the directories individually, and the prompt would be too long and
6137 : determine where public executables go
6142 rp='Pathname where the public executables will reside?'
6144 if $test "X$ansexp" != "X$binexp"; then
6148 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6149 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6150 : this via initialinstalllocation
6153 case "$userelocatableinc" in
6154 $define|true|[yY]*) dflt='y' ;;
6159 Would you like to build Perl so that the installation is relocatable, so that
6160 library paths in @INC are determined relative to the path of the perl binary?
6161 This is not advised for system Perl installs, or if you need to run setid
6162 scripts or scripts under taint mode.
6164 If this doesn't make any sense to you, just accept the default '$dflt'.
6166 rp='Use relocatable @INC?'
6169 y|Y) val="$define" ;;
6172 set userelocatableinc
6175 initialinstalllocation="$binexp"
6176 : Default prefix is now "up one level from where the binaries are"
6177 case "$userelocatableinc" in
6183 installprefixexp=".../.."
6187 : determine where private library files go
6188 : Usual default is /usr/local/lib/perl5/$version.
6189 : Also allow things like /opt/perl/lib/$version, since
6190 : /opt/perl/lib/perl5... would be redundant.
6191 : The default "style" setting is made in installstyle.U
6192 case "$installstyle" in
6193 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6194 *) set dflt privlib lib/$version ;;
6199 There are some auxiliary files for $package that need to be put into a
6200 private library directory that is accessible by everyone.
6205 rp='Pathname where the private library files will reside?'
6210 : set the prefixup variable, to restore leading tilda escape
6211 prefixup='case "$prefixexp" in
6213 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6216 : determine where public architecture dependent libraries go
6219 : privlib default is /usr/local/lib/$package/$version
6220 : archlib default is /usr/local/lib/$package/$version/$archname
6221 : privlib may have an optional trailing /share.
6222 tdflt=`echo $privlib | $sed 's,/share$,,'`
6223 tdflt=$tdflt/$archname
6232 $spackage contains architecture-dependent library files. If you are
6233 sharing libraries in a heterogeneous environment, you might store
6234 these files in a separate location. Otherwise, you can just include
6235 them with the rest of the public library files.
6240 rp='Where do you want to put the public architecture-dependent libraries?'
6244 if $test X"$archlib" = X"$privlib"; then
6250 : see if setuid scripts can be secure
6253 Some kernels have a bug that prevents setuid #! scripts from being
6254 secure. Some sites have disabled setuid #! scripts because of this.
6256 First let's decide if your kernel supports secure setuid #! scripts.
6257 (If setuid #! scripts would be secure but have been disabled anyway,
6258 don't say that they are secure if asked.)
6263 if $test -d /dev/fd; then
6264 echo "#!$ls" >reflect
6265 chmod +x,u+s reflect
6266 ./reflect >flect 2>&1
6267 if $contains "/dev/fd" flect >/dev/null; then
6268 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6272 If you are not sure if they are secure, I can check but I'll need a
6273 username and password different from the one you are using right now.
6274 If you don't have such a username or don't want me to test, simply
6278 rp='Other username to test security of setuid scripts with?'
6283 case "$d_suidsafe" in
6284 '') echo "I'll assume setuid scripts are *not* secure." >&4
6287 echo "Well, the $hint value is *not* secure." >&4
6289 *) echo "Well, the $hint value *is* secure." >&4
6294 $rm -f reflect flect
6295 echo "#!$ls" >reflect
6296 chmod +x,u+s reflect
6299 echo '"su" will (probably) prompt you for '"$ans's password."
6300 su $ans -c './reflect >flect'
6301 if $contains "/dev/fd" flect >/dev/null; then
6302 echo "Okay, it looks like setuid scripts are secure." >&4
6305 echo "I don't think setuid scripts are secure." >&4
6310 rp='Does your kernel have *secure* setuid scripts?'
6313 [yY]*) val="$define";;
6318 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6319 echo "(That's for file descriptors, not floppy disks.)"
6325 $rm -f reflect flect
6327 : now see if they want to do setuid emulation
6330 case "$d_suidsafe" in
6333 echo "No need to emulate SUID scripts since they are secure here." >&4
6337 Some systems have disabled setuid scripts, especially systems where
6338 setuid scripts cannot be secure. On systems where setuid scripts have
6339 been disabled, the setuid/setgid bits on scripts are currently
6340 useless. It is possible for $package to detect those bits and emulate
6341 setuid/setgid in a secure fashion. This emulation will only work if
6342 setuid scripts have been disabled in your kernel.
6346 "$define") dflt=y ;;
6349 rp="Do you want to do setuid/setgid emulation?"
6352 [yY]*) val="$define";;
6360 : Find perl5.005 or later.
6361 echo "Looking for a previously installed perl5.005 or later... "
6363 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6364 : Check if this perl is recent and can load a simple module
6365 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6368 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6378 '') echo "None found. That's ok.";;
6379 *) echo "Using $perl5." ;;
6382 : Set the siteprefix variables
6385 After $package is installed, you may wish to install various
6386 add-on modules and utilities. Typically, these add-ons will
6387 be installed under $prefix with the rest
6388 of this package. However, you may wish to install such add-ons
6389 elsewhere under a different prefix.
6391 If you do not wish to put everything under a single prefix, that's
6392 ok. You will be prompted for the individual locations; this siteprefix
6393 is only used to suggest the defaults.
6395 The default should be fine for most people.
6399 rp='Installation prefix to use for add-on modules and utilities?'
6400 : XXX Here might be another good place for an installstyle setting.
6401 case "$siteprefix" in
6403 *) dflt=$siteprefix ;;
6406 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6408 case "$siteprefix" in
6412 *) oldsiteprefix="$prefix";;
6417 siteprefixexp="$ansexp"
6419 : determine where site specific libraries go.
6420 : Usual default is /usr/local/lib/perl5/site_perl/$version
6421 : The default "style" setting is made in installstyle.U
6422 : XXX No longer works with Prefixit stuff.
6423 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6425 '') case "$installstyle" in
6426 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6427 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6435 The installation process will create a directory for
6436 site-specific extensions and modules. Most users find it convenient
6437 to place all site-specific files in this directory rather than in the
6438 main distribution directory.
6442 rp='Pathname for the site-specific library files?'
6446 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6448 : Determine list of previous versions to include in @INC
6449 $cat > getverlist <<EOPL
6452 \$api_versionstring = "$api_versionstring";
6453 \$version = "$version";
6454 \$stem = "$sitelib_stem";
6455 \$archname = "$archname";
6457 $cat >> getverlist <<'EOPL'
6458 # The list found is store twice for each entry: the original name, and
6459 # the binary broken down version as pack "sss", so sorting is easy and
6460 # unambiguous. This will work for all versions that have a maximum of
6461 # three digit groups, separate by '.'s or '_'s. Names are extended with
6462 # ".0.0" to ensure at least three elements for the pack.
6463 # -- H.Merijn Brand (m)'06 23-10-2006
6465 # Can't have leading @ because metaconfig interprets it as a command!
6466 ;@inc_version_list=();
6467 # XXX Redo to do opendir/readdir?
6470 ;@candidates = map {
6471 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6477 ($pversion, $aversion, $vsn5005) = map {
6478 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6479 foreach $d (@candidates) {
6480 if ($d->[1] lt $pversion) {
6481 if ($d->[1] ge $aversion) {
6482 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6484 elsif ($d->[1] ge $vsn5005) {
6485 unshift(@inc_version_list, grep { -d } $d->[0]);
6489 # Skip newer version. I.e. don't look in
6490 # 5.7.0 if we're installing 5.6.1.
6494 if (@inc_version_list) {
6495 print join(' ', @inc_version_list);
6498 # Blank space to preserve value for next Configure run.
6503 case "$inc_version_list" in
6504 '') if test -x "$perl5$exe_ext"; then
6505 dflt=`$perl5 getverlist`
6510 $undef) dflt='none' ;;
6511 *) eval dflt=\"$inc_version_list\" ;;
6514 ''|' ') dflt=none ;;
6521 In order to ease the process of upgrading, this version of perl
6522 can be configured to use modules built and installed with earlier
6523 versions of perl that were installed under $prefix. Specify here
6524 the list of earlier versions that this version of perl should check.
6525 If Configure detected no earlier versions of perl installed under
6526 $prefix, then the list will be empty. Answer 'none' to tell perl
6527 to not search earlier versions.
6529 The default should almost always be sensible, so if you're not sure,
6530 just accept the default.
6533 rp='List of earlier versions to include in @INC?'
6536 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6537 *) inc_version_list="$ans" ;;
6539 case "$inc_version_list" in
6541 inc_version_list_init='0'
6542 d_inc_version_list="$undef"
6544 *) inc_version_list_init=`echo $inc_version_list |
6545 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6546 d_inc_version_list="$define"
6551 : see if this is a malloc.h system
6552 : we want a real compile instead of Inhdr because some systems have a
6553 : malloc.h that just gives a compile error saying to use stdlib.h instead
6558 int main () { return 0; }
6561 if eval $compile; then
6562 echo "<malloc.h> found." >&4
6565 echo "<malloc.h> NOT found." >&4
6572 : check for void type
6574 echo "Checking to see how well your C compiler groks the void type..." >&4
6575 case "$voidflags" in
6587 extern void moo(); /* function returning void */
6588 void (*goo)(); /* ptr to func returning void */
6590 void *hue; /* generic ptr */
6603 int main() { sub(); }
6605 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6606 voidflags=$defvoidused
6607 echo "Good. It appears to support void to the level $package wants.">&4
6608 if $contains warning .out >/dev/null 2>&1; then
6609 echo "However, you might get some warnings that look like this:"
6613 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6614 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6615 echo "It supports 1..."
6616 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6617 echo "It also supports 2..."
6618 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6620 echo "And it supports 4 but not 8 definitely."
6622 echo "It doesn't support 4..."
6623 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6625 echo "But it supports 8."
6628 echo "Neither does it support 8."
6632 echo "It does not support 2..."
6633 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6635 echo "But it supports 4 and 8."
6637 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6639 echo "And it supports 4 but has not heard about 8."
6641 echo "However it supports 8 but not 4."
6646 echo "There is no support at all for void."
6651 case "$voidflags" in
6654 Support flag bits are:
6655 1: basic void declarations.
6656 2: arrays of pointers to functions returning void.
6657 4: operations between pointers to and addresses of void functions.
6658 8: generic void pointers.
6661 rp="Your void support flags add up to what?"
6668 : check for length of pointer
6672 echo "Checking to see how big your pointers are..." >&4
6673 if test "$voidflags" -gt 7; then
6674 echo '#define VOID_PTR char *' > try.c
6676 echo '#define VOID_PTR void *' > try.c
6686 printf("%d\n", (int)sizeof(VOID_PTR));
6691 if eval $compile_ok; then
6692 ptrsize=`$run ./try`
6693 echo "Your pointers are $ptrsize bytes long."
6696 echo "(I can't seem to compile the test program. Guessing...)" >&4
6697 rp="What is the size of a pointer (in bytes)?"
6704 case "$use64bitall" in
6705 "$define"|true|[yY]*)
6709 *** You have chosen a maximally 64-bit build,
6710 *** but your pointers are only 4 bytes wide.
6711 *** Please rerun Configure without -Duse64bitall.
6716 *** Since you have quads, you could possibly try with -Duse64bitint.
6721 *** Cannot continue, aborting.
6732 : determine whether to use malloc wrapping
6734 case "$usemallocwrap" in
6735 [yY]*|true|$define) dflt='y' ;;
6736 [nN]*|false|$undef) dflt='n' ;;
6737 *) case "$usedevel" in
6738 [yY]*|true|$define) dflt='y' ;;
6743 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6745 usemallocwrap="$ans"
6748 usemallocwrap="$define" ;;
6750 usemallocwrap="$undef" ;;
6753 : determine which malloc to compile in
6755 case "$usemymalloc" in
6756 [yY]*|true|$define) dflt='y' ;;
6757 [nN]*|false|$undef) dflt='n' ;;
6758 *) case "$ptrsize" in
6764 rp="Do you wish to attempt to use the malloc that comes with $package?"
6770 mallocsrc='malloc.c'
6771 mallocobj="malloc$_o"
6772 d_mymalloc="$define"
6775 : Remove malloc from list of libraries to use
6776 echo "Removing unneeded -lmalloc from library list" >&4
6777 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6780 echo "libs = $libs" >&4
6792 : compute the return types of malloc and free
6794 $cat >malloc.c <<END
6798 #include <sys/types.h>
6812 case "$malloctype" in
6814 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6821 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6825 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6832 echo "Your system uses $freetype free(), it would seem." >&4
6834 : determine where site specific architecture-dependent libraries go.
6835 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6836 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6837 : sitelib may have an optional trailing /share.
6839 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6840 dflt="$dflt/$archname"
6845 set sitearch sitearch none
6849 The installation process will also create a directory for
6850 architecture-dependent site-specific extensions and modules.
6854 rp='Pathname for the site-specific architecture-dependent library files?'
6858 if $test X"$sitearch" = X"$sitelib"; then
6861 d_sitearch="$define"
6864 : Set the vendorprefix variables
6867 The installation process will also create a directory for
6868 vendor-supplied add-ons. Vendors who supply perl with their system
6869 may find it convenient to place all vendor-supplied files in this
6870 directory rather than in the main distribution directory. This will
6871 ease upgrades between binary-compatible maintenance versions of perl.
6873 Of course you may also use these directories in whatever way you see
6874 fit. For example, you might use them to access modules shared over a
6875 company-wide network.
6877 The default answer should be fine for most people.
6878 This causes further questions about vendor add-ons to be skipped
6879 and no vendor-specific directories will be configured for perl.
6882 rp='Do you want to configure vendor-specific add-on directories?'
6883 case "$usevendorprefix" in
6884 define|true|[yY]*) dflt=y ;;
6885 *) : User may have set vendorprefix directly on Configure command line.
6886 case "$vendorprefix" in
6895 rp='Installation prefix to use for vendor-supplied add-ons?'
6896 case "$vendorprefix" in
6898 *) dflt=$vendorprefix ;;
6901 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6903 case "$vendorprefix" in
6907 *) oldvendorprefix="$prefix";;
6911 usevendorprefix="$define"
6913 vendorprefixexp="$ansexp"
6915 *) usevendorprefix="$undef"
6921 : Set the vendorlib variables
6922 case "$vendorprefix" in
6923 '') d_vendorlib="$undef"
6927 *) d_vendorlib="$define"
6928 : determine where vendor-supplied modules go.
6929 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6930 case "$vendorlib" in
6932 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6933 case "$installstyle" in
6934 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6935 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6938 *) dflt="$vendorlib"
6942 rp='Pathname for the vendor-supplied library files?'
6945 vendorlibexp="$ansexp"
6948 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6952 : Set the vendorarch variables
6953 case "$vendorprefix" in
6954 '') d_vendorarch="$undef"
6958 *) d_vendorarch="$define"
6959 : determine where vendor-supplied architecture-dependent libraries go.
6960 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6961 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6962 : vendorlib may have an optional trailing /share.
6963 case "$vendorarch" in
6964 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6965 dflt="$dflt/$archname"
6967 *) dflt="$vendorarch" ;;
6970 rp='Pathname for vendor-supplied architecture-dependent files?'
6973 vendorarchexp="$ansexp"
6976 prefixvar=vendorarch
6979 : Final catch-all directories to search
6982 Lastly, you can have perl look in other directories for extensions and
6983 modules in addition to those already specified.
6984 These directories will be searched after
6988 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6989 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6991 case "$otherlibdirs" in
6992 ''|' ') dflt='none' ;;
6993 *) dflt="$otherlibdirs" ;;
6996 Enter a colon-separated set of extra paths to include in perl's @INC
6997 search path, or enter 'none' for no extra paths.
7001 rp='Colon-separated list of additional directories for perl to search?'
7004 ' '|''|none) otherlibdirs=' ' ;;
7005 *) otherlibdirs="$ans" ;;
7007 case "$otherlibdirs" in
7011 set d_perl_otherlibdirs
7014 : Cruising for prototypes
7016 echo "Checking out function prototypes..." >&4
7017 $cat >prototype.c <<EOCP
7022 int main(int argc, char *argv[]) {
7025 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7026 echo "Your C compiler appears to support function prototypes."
7029 echo "Your C compiler doesn't seem to understand function prototypes."
7036 : Check if ansi2knr is required
7037 case "$prototype" in
7039 *) ansi2knr='ansi2knr'
7044 This version of $package can only be compiled by a compiler that
7045 understands function prototypes. Unfortunately, your C compiler
7047 doesn't seem to understand them. Sorry about that.
7049 If GNU cc is available for your system, perhaps you could try that instead.
7051 Eventually, we hope to support building Perl with pre-ANSI compilers.
7052 If you would like to help in that effort, please contact <perlbug@perl.org>.
7054 Aborting Configure now.
7060 : See if we want extra modules installed
7067 Perl can be built with extra modules or bundles of modules which
7068 will be fetched from the CPAN and installed alongside Perl.
7070 Notice that you will need access to the CPAN; either via the Internet,
7071 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7072 be asked later to configure the CPAN.pm module which will in turn do
7073 the installation of the rest of the extra modules or bundles.)
7075 Notice also that if the modules require any external software such as
7076 libraries and headers (the libz library and the zlib.h header for the
7077 Compress::Zlib module, for example) you MUST have any such software
7078 already installed, this configuration process will NOT install such
7081 If this doesn't make any sense to you, just accept the default '$dflt'.
7083 rp='Install any extra modules (y or n)?'
7089 Please list any extra modules or bundles to be installed from CPAN,
7090 with spaces between the names. The names can be in any format the
7091 'install' command of CPAN.pm will understand. (Answer 'none',
7092 without the quotes, to install no extra modules or bundles.)
7102 $rm -f ../extras.lst
7104 *) echo "(Saving the list of extras for later...)"
7105 echo "$extras" > ../extras.lst
7113 : determine where html pages for programs go
7114 set html1dir html1dir none
7118 If you wish to install html files for programs in $spackage, indicate
7119 the appropriate directory here. To skip installing html files,
7123 ''|none|$undef|' ') dflt=none ;;
7124 *) dflt=$html1dir ;;
7127 rp="Directory for the main $spackage html pages?"
7131 : Use ' ' for none so value is preserved next time through Configure
7132 $test X"$html1dir" = "X" && html1dir=' '
7134 : determine where html pages for libraries and modules go
7135 set html3dir html3dir none
7139 If you wish to install html files for modules associated with $spackage,
7140 indicate the appropriate directory here. To skip installing html files,
7143 : There is no obvious default. If they have specified html1dir, then
7144 : try to key off that, possibly changing .../html1 into .../html3.
7146 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7147 *) dflt=$html3dir ;;
7150 rp="Directory for the $spackage module html pages?"
7154 : Use ' ' for none so value is preserved next time through Configure
7155 $test X"$html3dir" = "X" && html3dir=' '
7157 : determine whether to install perl also as /usr/bin/perl
7160 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7162 Many scripts expect perl to be installed as /usr/bin/perl.
7164 If you want to, I can install the perl you are about to compile
7165 as /usr/bin/perl (in addition to $bin/perl).
7167 if test -f /usr/bin/perl; then
7170 However, please note that because you already have a /usr/bin/perl,
7171 overwriting that with a new Perl would very probably cause problems.
7172 Therefore I'm assuming you don't want to do that (unless you insist).
7175 case "$installusrbinperl" in
7176 "$define"|[yY]*) dflt='y';;
7182 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7185 case "$installusrbinperl" in
7186 "$undef"|[nN]*) dflt='n';;
7190 rp="Do you want to install perl as /usr/bin/perl?"
7193 [yY]*) val="$define";;
7199 set installusrbinperl
7202 : Check if we are using the GNU C library
7204 echo "Checking for GNU C Library..." >&4
7206 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7207 alone are insufficient to distinguish different versions, such as
7208 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7209 libc version 2.1.0. A. Dougherty, June 3, 2002.
7215 # ifdef __GLIBC_MINOR__
7216 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7217 # include <gnu/libc-version.h>
7218 printf("%s\n", gnu_get_libc_version());
7220 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7223 printf("%d\n", __GLIBC__);
7232 if eval $compile_ok && $run ./try > glibc.ver; then
7234 gnulibc_version=`$cat glibc.ver`
7235 echo "You are using the GNU C Library version $gnulibc_version"
7239 echo "You are not using the GNU C Library"
7245 : see if nm is to be used to determine whether a symbol is defined or not
7249 case "$d_gnulibc" in
7252 echo "nm probably won't work on the GNU C Library." >&4
7258 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7260 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7261 echo "'nm' won't be sufficient on this sytem." >&4
7267 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7268 if $test $dflt -gt 20; then
7278 true|$define) dflt=y;;
7285 I can use $nm to extract the symbols from your C libraries. This
7286 is a time consuming task which may generate huge output on the disk (up
7287 to 3 megabytes) but that should make the symbols extraction faster. The
7288 alternative is to skip the 'nm' extraction part and to compile a small
7289 test program instead to determine whether each symbol is present. If
7290 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7291 this may be the best solution.
7293 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7296 rp="Shall I use $nm to extract C symbols from the libraries?"
7299 [Nn]*) usenm=false;;
7308 : nm options which may be necessary
7310 '') if $test -f /mach_boot; then
7312 elif $test -d /usr/ccs/lib; then
7313 nm_opt='-p' # Solaris (and SunOS?)
7314 elif $test -f /dgux; then
7316 elif $test -f /lib64/rld; then
7317 nm_opt='-p' # 64-bit Irix
7323 : nm options which may be necessary for shared libraries but illegal
7324 : for archive libraries. Thank you, Linux.
7325 case "$nm_so_opt" in
7326 '') case "$myuname" in
7328 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7329 nm_so_opt='--dynamic'
7338 : get list of predefined functions in a handy place
7343 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7349 *) for thislib in $libs; do
7352 : Handle C library specially below.
7355 thislib=`echo $thislib | $sed -e 's/^-l//'`
7356 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7358 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7360 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7362 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7364 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7366 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7368 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7373 libnames="$libnames $try"
7375 *) libnames="$libnames $thislib" ;;
7384 for xxx in $libpth; do
7385 $test -r $1 || set $xxx/libc.$so
7386 : The messy sed command sorts on library version numbers.
7388 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7389 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7391 s/[0-9][0-9]*/0000&/g
7392 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7395 $sort | $sed -e 's/^.* //'`
7398 $test -r $1 || set /usr/ccs/lib/libc.$so
7399 $test -r $1 || set /lib/libsys_s$_a
7405 if $test -r "$1"; then
7406 echo "Your (shared) C library seems to be in $1."
7408 elif $test -r /lib/libc && $test -r /lib/clib; then
7409 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7411 libc='/lib/clib /lib/libc'
7412 if $test -r /lib/syslib; then
7413 echo "(Your math library is in /lib/syslib.)"
7414 libc="$libc /lib/syslib"
7416 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7417 echo "Your C library seems to be in $libc, as you said before."
7418 elif $test -r $incpath/usr/lib/libc$_a; then
7419 libc=$incpath/usr/lib/libc$_a;
7420 echo "Your C library seems to be in $libc. That's fine."
7421 elif $test -r /lib/libc$_a; then
7423 echo "Your C library seems to be in $libc. You're normal."
7425 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7427 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7428 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7429 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7431 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7433 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7436 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7438 if $test -r "$tans"; then
7439 echo "Your C library seems to be in $tans, of all places."
7445 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7449 If the guess above is wrong (which it might be if you're using a strange
7450 compiler, or your machine supports multiple models), you can override it here.
7455 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7457 I can't seem to find your C library. I've looked in the following places:
7460 $sed 's/^/ /' libpath
7463 None of these seems to contain your C library. I need to get its name...
7468 rp='Where is your C library?'
7473 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7474 set X `cat libnames`
7477 case $# in 1) xxx=file; esac
7478 echo "Extracting names from the following $xxx for later perusal:" >&4
7480 $sed 's/^/ /' libnames >&4
7482 $echo $n "This may take a while...$c" >&4
7486 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7487 *) $nm $nm_opt $file 2>/dev/null;;
7492 $grep fprintf libc.tmp > libc.ptf
7493 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7494 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7496 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7498 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7500 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7502 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7504 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7506 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7508 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7510 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7512 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7514 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7516 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7518 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7520 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7521 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7523 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7525 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7527 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7529 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7531 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7533 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7535 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7537 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7539 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7541 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7543 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7545 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7547 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7549 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7551 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7554 $nm -p $* 2>/dev/null >libc.tmp
7555 $grep fprintf libc.tmp > libc.ptf
7556 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7557 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7563 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7565 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7566 for thisname in $libnames $libc; do
7567 $ar t $thisname >>libc.tmp
7569 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7571 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7572 # Repeat libc to extract forwarders to DLL entries too
7573 for thisname in $libnames $libc; do
7574 $ar tv $thisname >>libc.tmp
7575 # Revision 50 of EMX has bug in $ar.
7576 # it will not extract forwarders to DLL entries
7577 # Use emximp which will extract exactly them.
7578 emximp -o tmp.imp $thisname \
7580 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7581 < tmp.imp >>libc.tmp
7584 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7587 echo "$ar didn't seem to work right." >&4
7588 echo "Maybe this is a Cray...trying bld instead..." >&4
7589 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7591 for thisname in $libnames; do
7593 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7594 $ar t $thisname >>libc.tmp
7598 echo "That didn't work either. Giving up." >&4
7608 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7609 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7611 *) if $test -f /lib/syscalls.exp; then
7613 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7614 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7620 $rm -f libnames libpath
7622 : see if dld is available
7626 : Check if we are using C++
7628 echo "Checking for C++..." >&4
7629 $cat >try.c <<'EOCP'
7641 if eval $compile_ok && $run ./try; then
7643 echo "You are using a C++ compiler."
7646 echo "You are not using a C++ compiler."
7652 : is a C symbol defined?
7655 -v) tf=libc.tmp; tdc="";;
7656 -a) tf=libc.tmp; tdc="[]";;
7657 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7660 case "$reuseval-$4" in
7662 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7667 case "$d_cplusplus" in
7668 $define) extern_C=\"C\";;
7670 if $test "$runnm" = true; then
7671 if $contains $tlook $tf >/dev/null 2>&1; then
7673 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7674 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7675 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7676 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7680 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7681 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7687 $define) tval=true;;
7694 : define an is-in-libc? function
7695 inlibc='echo " "; td=$define; tu=$undef;
7696 sym=$1; var=$2; eval "was=\$$2";
7698 case "$reuseval$was" in
7708 echo "$sym() found." >&4;
7709 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7711 echo "$sym() NOT found." >&4;
7712 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7716 $define) echo "$sym() found." >&4;;
7717 *) echo "$sym() NOT found." >&4;;
7721 : see if dlopen exists
7723 xxx_ccflags="$ccflags"
7725 : with g++ one needs -shared to get is-in-libc to work for dlopen
7726 case "$gccversion" in
7728 *) case "$d_cplusplus" in
7729 "$define") ccflags="$ccflags -shared" ;;
7736 ccflags="$xxx_ccflags"
7738 : see if this is a unistd.h system
7739 set unistd.h i_unistd
7742 : determine which dynamic loading, if any, to compile in
7744 dldir="ext/DynaLoader"
7757 $define) dflt='y' ;;
7760 $define) dflt='y' ;;
7762 : Does a dl_xxx.xs file exist for this operating system
7763 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7766 rp="Do you wish to use dynamic loading?"
7773 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7774 dflt="$dldir/dl_${osname}.xs"
7775 elif $test "$d_dlopen" = "$define" ; then
7776 dflt="$dldir/dl_dlopen.xs"
7777 elif $test "$i_dld" = "$define" ; then
7778 dflt="$dldir/dl_dld.xs"
7783 *) dflt="$dldir/$dlsrc"
7786 echo "The following dynamic loading files are available:"
7787 : Can not go over to $dldir because getfile has path hard-coded in.
7788 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7789 rp="Source file to use for dynamic loading"
7795 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7799 Some systems may require passing special flags to $cc -c to
7800 compile modules that will be used to create a shared library.
7801 To use no flags, say "none".
7804 case "$cccdlflags" in
7805 '') case "$gccversion" in
7806 '') case "$osname" in
7808 next) dflt='none' ;;
7809 irix*) dflt='-KPIC' ;;
7810 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7811 sunos) dflt='-pic' ;;
7815 *) case "$osname" in
7816 darwin) dflt='none' ;;
7817 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7822 *) dflt="$cccdlflags" ;;
7824 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7827 none) cccdlflags=' ' ;;
7828 *) cccdlflags="$ans" ;;
7833 Some systems use ld to create libraries that can be dynamically loaded,
7834 while other systems (such as those using ELF) use $cc.
7838 '') $cat >try.c <<EOM
7839 /* Test for whether ELF binaries are produced */
7851 int i = open("a.out",O_RDONLY);
7854 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7855 exit(0); /* succeed (yes, it's ELF) */
7860 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7862 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7866 echo "I'll use ld to build dynamic libraries."
7875 rp="What command should be used to create dynamic libraries?"
7881 Some systems may require passing special flags to $ld to create a
7882 library that can be dynamically loaded. If your ld flags include
7883 -L/other/path options to locate libraries outside your loader's normal
7884 search path, you may need to specify those -L options here as well. To
7885 use no flags, say "none".
7888 case "$lddlflags" in
7889 '') case "$osname" in
7890 beos) dflt='-nostart' ;;
7892 case "$gccversion" in
7893 '') dflt="$dflt +vnocompatwarnings" ;;
7896 linux|irix*|gnu*) dflt="-shared $optimize" ;;
7897 next) dflt='none' ;;
7898 solaris) dflt='-G' ;;
7899 sunos) dflt='-assert nodefinitions' ;;
7900 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7904 *) dflt="$lddlflags" ;;
7907 : Try to guess additional flags to pick up local libraries.
7908 : Be careful not to append to a plain 'none'
7912 for thisflag in $ldflags; do
7917 *) dflt="$dflt $thisflag" ;;
7924 ''|' ') dflt='none' ;;
7927 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7930 none) lddlflags=' ' ;;
7931 *) lddlflags="$ans" ;;
7936 Some systems may require passing special flags to $cc to indicate that
7937 the resulting executable will use dynamic linking. To use no flags,
7941 case "$ccdlflags" in
7942 '') case "$osname" in
7943 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7944 next|sunos) dflt='none' ;;
7948 *) dflt="$ccdlflags" ;;
7950 rp="Any special flags to pass to $cc to use dynamic linking?"
7953 none) ccdlflags=' ' ;;
7954 *) ccdlflags="$ans" ;;
7968 # No dynamic loading being used, so don't bother even to prompt.
7971 *) case "$useshrplib" in
7972 '') case "$osname" in
7973 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7975 also='Building a shared libperl is required for dynamic loading to work on your system.'
7980 also='Building a shared libperl is needed for MAB support.'
7998 The perl executable is normally obtained by linking perlmain.c with
7999 libperl${_a}, any static extensions (usually just DynaLoader), and
8000 any other libraries needed on this system (such as -lm, etc.). Since
8001 your system supports dynamic loading, it is probably possible to build
8002 a shared libperl.$so. If you will have more than one executable linked
8003 to libperl.$so, this will significantly reduce the size of each
8004 executable, but it may have a noticeable effect on performance. The
8005 default is probably sensible for your system.
8009 rp="Build a shared libperl.$so (y/n)"
8013 useshrplib='true' ;;
8014 *) useshrplib='false' ;;
8019 case "$useshrplib" in
8023 # Figure out a good name for libperl.so. Since it gets stored in
8024 # a version-specific architecture-dependent library, the version
8025 # number isn't really that important, except for making cc/ld happy.
8027 # A name such as libperl.so.3.1
8028 majmin="libperl.$so.$patchlevel.$subversion"
8029 # A name such as libperl.so.301
8030 majonly=`echo $patchlevel $subversion |
8031 $awk '{printf "%d%02d", $1, $2}'`
8032 majonly=libperl.$so.$majonly
8033 # I'd prefer to keep the os-specific stuff here to a minimum, and
8034 # rely on figuring it out from the naming of libc.
8035 case "${osname}${osvers}" in
8038 # XXX How handle the --version stuff for MAB?
8040 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8043 cygwin*) # ld links against an importlib
8044 dflt=libperl$lib_ext
8046 *) # Try to guess based on whether libc has major.minor.
8048 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8049 *libc.$so.[0-9]*) dflt=$majonly ;;
8050 *) dflt=libperl.$so ;;
8060 I need to select a good name for the shared libperl. If your system uses
8061 library names with major and minor numbers, then you might want something
8062 like $majmin. Alternatively, if your system uses a single version
8063 number for shared libraries, then you might want to use $majonly.
8064 Or, your system might be quite happy with a simple libperl.$so.
8066 Since the shared libperl will get installed into a version-specific
8067 architecture-dependent directory, the version number of the shared perl
8068 library probably isn't important, so the default should be o.k.
8071 rp='What name do you want to give to the shared libperl?'
8074 echo "Ok, I'll use $libperl"
8077 libperl="libperl${_a}"
8081 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8085 WARNING: Use of the shrpdir variable for the installation location of
8086 the shared $libperl is not supported. It was never documented and
8087 will not work in this version. Let me (perlbug@perl.org)
8088 know of any problems this may cause.
8094 But your current setting of $shrpdir is
8095 the default anyway, so it's harmless.
8100 Further, your current attempted setting of $shrpdir
8101 conflicts with the value of $archlibexp/CORE
8102 that installperl will use.
8109 # How will the perl executable find the installed shared $libperl?
8110 # Add $xxx to ccdlflags.
8111 # If we can't figure out a command-line option, use $shrpenv to
8112 # set env LD_RUN_PATH. The main perl makefile uses this.
8113 shrpdir=$archlibexp/CORE
8116 if "$useshrplib"; then
8119 # We'll set it in Makefile.SH...
8124 freebsd|netbsd|openbsd|interix|dragonfly)
8125 xxx="-Wl,-R$shrpdir"
8127 bsdos|linux|irix*|dec_osf|gnu*)
8128 xxx="-Wl,-rpath,$shrpdir"
8131 # next doesn't like the default...
8134 # beos doesn't like the default, either.
8137 # hpux doesn't like the default, either.
8138 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8141 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8147 # Only add $xxx if it isn't already in ccdlflags.
8148 case " $ccdlflags " in
8150 *) ccdlflags="$ccdlflags $xxx"
8153 Adding $xxx to the flags
8154 passed to $ld so that the perl executable will find the
8155 installed shared $libperl.
8163 # Fix ccdlflags in AIX for building external extensions.
8164 # (For building Perl itself bare -bE:perl.exp is needed,
8165 # Makefile.SH takes care of this.)
8167 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8169 # Respect a hint or command-line value.
8171 '') shrpenv="$tmp_shrpenv" ;;
8173 case "$ldlibpthname" in
8174 '') ldlibpthname=LD_LIBRARY_PATH ;;
8175 none) ldlibpthname='' ;;
8178 : determine where manual pages are on this system
8182 syspath='/usr/share/man/man1 /usr/man/man1'
8183 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8184 syspath="$syspath /usr/man/u_man/man1"
8185 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8186 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8187 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8188 sysman=`./loc . /usr/man/man1 $syspath`
8191 if $test -d "$sysman"; then
8192 echo "System manual is in $sysman." >&4
8194 echo "Could not find manual pages in source form." >&4
8197 : determine where manual pages go
8198 set man1dir man1dir none
8202 $spackage has manual pages available in source form.
8206 echo "However, you don't have nroff, so they're probably useless to you."
8208 '') man1dir="none";;
8211 echo "If you don't want the manual sources installed, answer 'none'."
8216 lookpath="$prefixexp/share/man/man1"
8217 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8218 lookpath="$lookpath $prefixexp/man/p_man/man1"
8219 lookpath="$lookpath $prefixexp/man/u_man/man1"
8220 lookpath="$lookpath $prefixexp/man/man.1"
8222 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8223 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8233 rp="Where do the main $spackage manual pages (source) go?"
8235 if $test "X$man1direxp" != "X$ansexp"; then
8246 : What suffix to use on installed man pages
8253 rp="What suffix should be used for the main $spackage man pages?"
8255 '') case "$man1dir" in
8269 *) dflt="$man1ext";;
8276 : see if we can have long filenames
8278 first=123456789abcdef
8280 if (echo hi >$first) 2>/dev/null; then
8281 if $test -f 123456789abcde; then
8282 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8285 echo 'You can have filenames longer than 14 characters.'>&4
8290 You can't have filenames longer than 14 chars.
8291 You can't even think about them!
8297 $rm -rf 123456789abcde*
8299 : determine where library module manual pages go
8300 set man3dir man3dir none
8304 $spackage has manual pages for many of the library modules.
8310 However, you don't have nroff, so they're probably useless to you.
8313 '') man3dir="none";;
8317 case "$d_flexfnam" in
8320 However, your system can't handle the long file names like File::Basename.3.
8323 '') man3dir="none";;
8327 echo "If you don't want the manual sources installed, answer 'none'."
8328 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8330 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8331 if $test -d "$privlib/man/man3"; then
8334 WARNING: Previous versions of perl installed man3 pages into
8335 $privlib/man/man3. This version will suggest a
8336 new default of $dflt.
8340 rp='Do you wish to preserve the old behavior?(y/n)'
8343 y*) dflt="$privlib/man/man3" ;;
8348 *) dflt="$man3dir" ;;
8355 rp="Where do the $package library man pages (source) go?"
8365 : What suffix to use on installed man pages
8371 rp="What suffix should be used for the $package library man pages?"
8373 '') case "$man3dir" in
8387 *) dflt="$man3ext";;
8394 : see if we have to deal with yellow pages, now NIS.
8395 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8396 if $test -f /usr/etc/nibindd; then
8398 echo "I'm fairly confident you're on a NeXT."
8400 rp='Do you get the hosts file via NetInfo?'
8409 y*) hostcat='nidump hosts .';;
8410 *) case "$hostcat" in
8411 nidump*) hostcat='';;
8421 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8429 rp='Are you getting the hosts file via yellow pages?'
8432 y*) hostcat='ypcat hosts';;
8433 *) hostcat='cat /etc/hosts';;
8439 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8442 '') test -f /etc/group && groupcat='cat /etc/group';;
8445 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8448 : now get the host name
8450 echo "Figuring out host name..." >&4
8451 case "$myhostname" in
8453 echo 'Maybe "hostname" will work...'
8454 if tans=`sh -c hostname 2>&1` ; then
8462 if $test "$cont"; then
8464 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8465 if tans=`cat /etc/systemid 2>&1` ; then
8467 phostname='cat /etc/systemid'
8468 echo "Whadyaknow. Xenix always was a bit strange..."
8471 elif $test -r /etc/systemid; then
8472 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8475 if $test "$cont"; then
8476 echo 'No, maybe "uuname -l" will work...'
8477 if tans=`sh -c 'uuname -l' 2>&1` ; then
8479 phostname='uuname -l'
8481 echo 'Strange. Maybe "uname -n" will work...'
8482 if tans=`sh -c 'uname -n' 2>&1` ; then
8484 phostname='uname -n'
8486 echo 'Oh well, maybe I can mine it out of whoami.h...'
8487 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8488 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8489 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8491 case "$myhostname" in
8492 '') echo "Does this machine have an identity crisis or something?"
8495 echo "Well, you said $myhostname before..."
8496 phostname='echo $myhostname';;
8502 case "$myhostname" in
8503 '') myhostname=noname ;;
8505 : you do not want to know about this
8510 if $test "$myhostname" ; then
8512 rp='Your host name appears to be "'$myhostname'".'" Right?"
8520 : bad guess or no guess
8521 while $test "X$myhostname" = X ; do
8523 rp="Please type the (one word) name of your host:"
8528 : translate upper to lower if necessary
8529 case "$myhostname" in
8531 echo "(Normalizing case in your host name)"
8532 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8536 case "$myhostname" in
8538 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8539 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8540 echo "(Trimming domain name from host name--host name is now $myhostname)"
8542 *) case "$mydomain" in
8545 test "X$hostcat" = "Xypcat hosts" &&
8546 ypmatch "$myhostname" hosts 2>/dev/null |\
8547 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8550 test "X$hostcat" != "X" &&
8551 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8552 /[ ]$myhostname[ . ]/p" > hosts
8555 if $test -f hosts; then
8556 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8557 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8558 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8559 hosts | $sort | $uniq | \
8560 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8561 case `$echo X$dflt` in
8562 X*\ *) echo "(Several hosts in the database matched hostname)"
8565 X.) echo "(You do not have fully-qualified names in the hosts database)"
8569 echo "(I cannot locate a hosts database anywhere)"
8574 tans=`./loc resolv.conf X /etc /usr/etc`
8575 if $test -f "$tans"; then
8576 echo "(Attempting domain name extraction from $tans)"
8577 dflt=.`$sed -n -e 's/ / /g' \
8578 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8579 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8581 .) dflt=.`$sed -n -e 's/ / /g' \
8582 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8583 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8590 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8591 dflt=.`sh -c domainname 2>/dev/null`
8594 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8598 case "$dflt$osname" in
8599 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8600 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8604 .) echo "(Lost all hope -- silly guess then)"
8610 *) dflt="$mydomain";;
8614 rp="What is your domain name?"
8624 : translate upper to lower if necessary
8627 echo "(Normalizing case in your domain name)"
8628 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8632 : a little sanity check here
8633 case "$phostname" in
8636 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8637 $myhostname$mydomain|$myhostname) ;;
8639 case "$phostname" in
8641 echo "(That doesn't agree with your whoami.h file, by the way.)"
8644 echo "(That doesn't agree with your $phostname command, by the way.)"
8654 I need to get your e-mail address in Internet format if possible, i.e.
8655 something like user@host.domain. Please answer accurately since I have
8656 no easy means to double check it. The default value provided below
8657 is most probably close to reality but may not be valid from outside
8658 your organization...
8662 while test "$cont"; do
8664 '') dflt="$cf_by@$myhostname$mydomain";;
8665 *) dflt="$cf_email";;
8667 rp='What is your e-mail address?'
8673 rp='Address does not look like an Internet one. Use it anyway?'
8689 If you or somebody else will be maintaining perl at your site, please
8690 fill in the correct e-mail address here so that they may be contacted
8691 if necessary. Currently, the "perlbug" program included with perl
8692 will send mail to this address in addition to perlbug@perl.org. You may
8693 enter "none" for no administrator.
8696 case "$perladmin" in
8697 '') dflt="$cf_email";;
8698 *) dflt="$perladmin";;
8700 rp='Perl administrator e-mail address'
8704 : determine whether to only install version-specific parts.
8707 Do you want to install only the version-specific parts of the perl
8708 distribution? Usually you do *not* want to do this.
8710 case "$versiononly" in
8711 "$define"|[Yy]*|true) dflt='y' ;;
8714 rp="Do you want to install only the version-specific parts of perl?"
8717 [yY]*) val="$define";;
8723 case "$versiononly" in
8724 "$define") inc_version_list=''
8725 inc_version_list_init=0
8729 : figure out how to guarantee perl startup
8730 : XXX Note that this currently takes advantage of the bug that binexp ignores
8731 : the Configure -Dinstallprefix setting, which in turn means that under
8732 : relocatable @INC, initialinstalllocation is what binexp started as.
8733 case "$startperl" in
8735 case "$sharpbang" in
8739 I can use the #! construct to start perl on your system. This will
8740 make startup of perl scripts faster, but may cause problems if you
8741 want to share those scripts and perl is not in a standard place
8742 ($initialinstalllocation/perl) on all your platforms. The alternative
8743 is to force a shell by starting the script with a single ':' character.
8746 case "$versiononly" in
8747 "$define") dflt="$initialinstalllocation/perl$version";;
8748 *) dflt="$initialinstalllocation/perl";;
8750 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8753 none) startperl=": # use perl";;
8754 *) startperl="#!$ans"
8755 if $test 30 -lt `echo "$ans" | wc -c`; then
8758 WARNING: Some systems limit the #! command to 32 characters.
8759 If you experience difficulty running Perl scripts with #!, try
8760 installing Perl in a directory with a shorter pathname.
8766 *) startperl=": # use perl"
8771 echo "I'll use $startperl to start perl scripts."
8773 : figure best path for perl in scripts
8776 case "$versiononly" in
8777 "$define") perlpath="$initialinstalllocation/perl$version";;
8778 *) perlpath="$initialinstalllocation/perl";;
8780 case "$startperl" in
8785 I will use the "eval 'exec'" idiom to start Perl on your system.
8786 I can use the full path of your Perl binary for this purpose, but
8787 doing so may cause problems if you want to share those scripts and
8788 Perl is not always in a standard place ($initialinstalllocation/perl).
8791 dflt="$initialinstalllocation/perl"
8792 rp="What path shall I use in \"eval 'exec'\"?"
8799 case "$startperl" in
8801 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8804 : determine where public executable scripts go
8805 set scriptdir scriptdir
8807 case "$scriptdir" in
8810 : guess some guesses
8811 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8812 $test -d /usr/share/bin && dflt=/usr/share/bin
8813 $test -d /usr/local/script && dflt=/usr/local/script
8814 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8815 $test -d $prefixexp/script && dflt=$prefixexp/script
8819 *) dflt="$scriptdir"
8824 Some installations have a separate directory just for executable scripts so
8825 that they can mount it across multiple architectures but keep the scripts in
8826 one spot. You might, for example, have a subdirectory of /usr/share for this.
8827 Or you might just lump your scripts in with all your other executables.
8831 rp='Where do you keep publicly executable scripts?'
8833 if $test "X$ansexp" != "X$scriptdirexp"; then
8839 : A little fix up for an irregularly named variable.
8840 installscript="$installscriptdir"
8842 : determine where add-on public executables go
8844 '') dflt=$siteprefix/bin ;;
8848 rp='Pathname where the add-on public executables should be installed?'
8853 : determine where add-on html pages go
8854 : There is no standard location, so try to copy the previously-selected
8855 : directory structure for the core html pages.
8856 case "$sitehtml1dir" in
8857 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8858 *) dflt=$sitehtml1dir ;;
8861 ''|' ') dflt=none ;;
8864 rp='Pathname where the site-specific html pages should be installed?'
8866 prefixvar=sitehtml1dir
8869 : determine where add-on library html pages go
8870 : There is no standard location, so try to copy the previously-selected
8871 : directory structure for the core html pages.
8872 case "$sitehtml3dir" in
8873 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8874 *) dflt=$sitehtml3dir ;;
8877 ''|' ') dflt=none ;;
8880 rp='Pathname where the site-specific library html pages should be installed?'
8882 prefixvar=sitehtml3dir
8885 : determine where add-on manual pages go
8886 case "$siteman1dir" in
8887 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8888 *) dflt=$siteman1dir ;;
8891 ''|' ') dflt=none ;;
8894 rp='Pathname where the site-specific manual pages should be installed?'
8896 prefixvar=siteman1dir
8899 : determine where add-on library man pages go
8900 case "$siteman3dir" in
8901 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8902 *) dflt=$siteman3dir ;;
8905 ''|' ') dflt=none ;;
8908 rp='Pathname where the site-specific library manual pages should be installed?'
8910 prefixvar=siteman3dir
8913 : determine where add-on public executable scripts go
8914 case "$sitescript" in
8915 '') dflt=$siteprefix/script
8916 $test -d $dflt || dflt=$sitebin ;;
8917 *) dflt="$sitescript" ;;
8920 rp='Pathname where add-on public executable scripts should be installed?'
8922 prefixvar=sitescript
8925 case "$usefaststdio" in
8926 $define|true|[yY]*|'')
8927 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8937 Perl can be built to use 'fast stdio', which means using the stdio
8938 library but also directly manipulating the stdio buffers to enable
8939 faster I/O. Using stdio is better for backward compatibility (especially
8940 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8941 interface has been preferred instead of stdio.
8943 If this doesn't make any sense to you, just accept the default '$dflt'.
8945 rp='Use the "fast stdio" if available?'
8948 y|Y) val="$define" ;;
8955 dflt_dtrace='/usr/sbin/dtrace'
8958 Perl can be built to support DTrace on platforms that support it.
8959 DTrace is a diagnosis and performance analysis tool from Sun.
8961 If this doesn't make any sense to you, just accept the default '$dflt'.
8965 case "$usedtrace" in
8971 dflt_dtrace=$usedtrace
8978 rp='Support DTrace if available?'
8981 y|Y) val="$define" ;;
8987 test "X$usedtrace" != "X$define" && break
8990 rp='Where is the dtrace executable?'
8999 if $dtrace -h -s ../perldtrace.d \
9000 -o perldtrace.tmp >/dev/null 2>&1 \
9001 && rm -f perldtrace.tmp
9004 echo "Good: your $dtrace knows about the -h flag."
9008 *** $me: Fatal Error: $dtrace doesn't support -h flag
9010 *** Your installed dtrace doesn't support the -h switch to compile a D
9011 *** program into a C header. Can't continue.
9019 echo "$dtrace was not found."
9023 : define an is-a-typedef? function
9024 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9026 "") inclist="sys/types.h";;
9028 eval "varval=\$$var";
9032 for inc in $inclist; do
9033 echo "#include <$inc>" >>temp.c;
9035 echo "#ifdef $type" >> temp.c;
9036 echo "printf(\"We have $type\");" >> temp.c;
9037 echo "#endif" >> temp.c;
9038 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9039 if $contains $type temp.E >/dev/null 2>&1; then
9045 *) eval "$var=\$varval";;
9048 : define an is-a-typedef? function that prompts if the type is not available.
9049 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9051 "") inclist="sys/types.h";;
9053 eval "varval=\$$var";
9057 for inc in $inclist; do
9058 echo "#include <$inc>" >>temp.c;
9060 echo "#ifdef $type" >> temp.c;
9061 echo "printf(\"We have $type\");" >> temp.c;
9062 echo "#endif" >> temp.c;
9063 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9065 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9066 if $contains $type temp.E >/dev/null 2>&1; then
9067 echo "$type found." >&4;
9070 echo "$type NOT found." >&4;
9076 *) eval "$var=\$varval";;
9079 : see what type lseek is declared as in the kernel
9080 rp="What is the type used for lseek's offset on this system?"
9081 set off_t lseektype long stdio.h sys/types.h
9085 echo "Checking to see how big your file offsets are..." >&4
9087 #include <sys/types.h>
9091 printf("%d\n", (int)sizeof($lseektype));
9096 if eval $compile_ok; then
9097 lseeksize=`$run ./try`
9098 echo "Your file offsets are $lseeksize bytes long."
9102 echo "(I can't seem to compile the test program. Guessing...)"
9103 rp="What is the size of your file offsets (in bytes)?"
9109 : see what type file positions are declared as in the library
9110 rp="What is the type for file position used by fsetpos()?"
9111 set fpos_t fpostype long stdio.h sys/types.h
9114 : Check size for Fpos_t
9117 *_t) zzz="$fpostype" ;;
9120 echo "Checking the size of $zzz..." >&4
9122 #include <sys/types.h>
9129 printf("%d\n", (int)sizeof($fpostype));
9134 if eval $compile_ok; then
9138 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9141 echo "Your $zzz is $fpossize bytes long."
9147 echo "(I can't compile the test program. Guessing...)" >&4
9148 rp="What is the size of your file positions (in bytes)?"
9153 : Check for large file support
9154 # Backward compatibility (uselfs is deprecated).
9156 "$define"|true|[yY]*)
9159 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9161 uselargefiles="$define"
9165 case "$lseeksize:$fpossize" in
9168 You can have files larger than 2 gigabytes.
9171 *) case "$uselargefiles" in
9172 "$undef"|false|[nN]*) dflt='n' ;;
9177 Perl can be built to understand large files (files larger than 2 gigabytes)
9178 on some systems. To do so, Configure can be run with -Duselargefiles.
9180 If this doesn't make any sense to you, just accept the default '$dflt'.
9182 rp='Try to understand large files, if available?'
9185 y|Y) val="$define" ;;
9192 : Look for a hint-file generated 'call-back-unit'. If the
9193 : user has specified that a large files perl is to be built,
9194 : we may need to set or change some other defaults.
9195 if $test -f uselargefiles.cbu; then
9196 echo "Your platform has some specific hints regarding large file builds, using them..."
9197 . ./uselargefiles.cbu
9199 case "$uselargefiles" in
9201 if $test -f uselargefiles.cbu; then
9203 echo "Rechecking to see how big your file offsets are..." >&4
9205 #include <sys/types.h>
9209 printf("%d\n", (int)sizeof($lseektype));
9214 if eval $compile_ok; then
9215 lseeksize=`$run ./try`
9216 $echo "Your file offsets are now $lseeksize bytes long."
9220 echo "(I can't seem to compile the test program. Guessing...)"
9221 rp="What is the size of your file offsets (in bytes)?"
9226 *_t) zzz="$fpostype" ;;
9229 $echo $n "Rechecking the size of $zzz...$c" >&4
9231 #include <sys/types.h>
9238 printf("%d\n", (int)sizeof($fpostype));
9243 if eval $compile_ok; then
9248 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9251 echo " $fpossize bytes." >&4
9257 echo "(I can't compile the test program. Guessing...)" >&4
9258 rp="What is the size of your file positions (in bytes)?"
9267 : Set the vendorbin variables
9268 case "$vendorprefix" in
9269 '') d_vendorbin="$undef"
9273 *) d_vendorbin="$define"
9274 : determine where vendor-supplied executables go.
9275 case "$vendorbin" in
9276 '') dflt=$vendorprefix/bin ;;
9277 *) dflt="$vendorbin" ;;
9280 rp='Pathname for the vendor-supplied executables directory?'
9283 vendorbinexp="$ansexp"
9289 : Set the vendorhtml1dir variables
9290 case "$vendorprefix" in
9291 '') vendorhtml1dir=''
9292 vendorhtml1direxp=''
9294 *) : determine where vendor-supplied html pages go.
9295 : There is no standard location, so try to copy the previously-selected
9296 : directory structure for the core html pages.
9297 : XXX Better default suggestions would be welcome.
9298 case "$vendorhtml1dir" in
9299 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9300 *) dflt=$vendorhtml1dir ;;
9303 ''|' ') dflt=none ;;
9306 rp='Pathname for the vendor-supplied html pages?'
9308 vendorhtml1dir="$ans"
9309 vendorhtml1direxp="$ansexp"
9312 : Use ' ' for none so value is preserved next time through Configure
9313 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9314 prefixvar=vendorhtml1dir
9317 : Set the vendorhtml3dir variables
9318 case "$vendorprefix" in
9319 '') vendorhtml3dir=''
9320 vendorhtml3direxp=''
9322 *) : determine where vendor-supplied module html pages go.
9323 : There is no standard location, so try to copy the previously-selected
9324 : directory structure for the core html pages.
9325 : XXX Better default suggestions would be welcome.
9326 case "$vendorhtml3dir" in
9327 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9328 *) dflt=$vendorhtml3dir ;;
9331 ''|' ') dflt=none ;;
9334 rp='Pathname for the vendor-supplied html pages?'
9336 vendorhtml3dir="$ans"
9337 vendorhtml3direxp="$ansexp"
9340 : Use ' ' for none so value is preserved next time through Configure
9341 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9342 prefixvar=vendorhtml3dir
9345 : Set the vendorman1dir variables
9346 case "$vendorprefix" in
9347 '') vendorman1dir=''
9350 *) : determine where vendor-supplied manual pages go.
9351 case "$vendorman1dir" in
9352 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9353 *) dflt=$vendorman1dir ;;
9356 ''|' ') dflt=none ;;
9359 rp='Pathname for the vendor-supplied manual section 1 pages?'
9361 vendorman1dir="$ans"
9362 vendorman1direxp="$ansexp"
9365 : Use ' ' for none so value is preserved next time through Configure
9366 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9367 prefixvar=vendorman1dir
9370 : Set the vendorman3dir variables
9371 case "$vendorprefix" in
9372 '') vendorman3dir=''
9375 *) : determine where vendor-supplied module manual pages go.
9376 case "$vendorman3dir" in
9377 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9378 *) dflt=$vendorman3dir ;;
9381 ''|' ') dflt=none ;;
9384 rp='Pathname for the vendor-supplied manual section 3 pages?'
9386 vendorman3dir="$ans"
9387 vendorman3direxp="$ansexp"
9390 : Use ' ' for none so value is preserved next time through Configure
9391 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9392 prefixvar=vendorman3dir
9395 : Set the vendorscript variables
9396 case "$vendorprefix" in
9397 '') d_vendorscript="$undef"
9401 *) d_vendorscript="$define"
9402 : determine where vendor-supplied scripts go.
9403 case "$vendorscript" in
9404 '') dflt=$vendorprefix/script
9405 $test -d $dflt || dflt=$vendorbin ;;
9406 *) dflt="$vendorscript" ;;
9410 The installation process will create a directory for
9411 vendor-supplied scripts.
9415 rp='Pathname for the vendor-supplied scripts directory?'
9418 vendorscriptexp="$ansexp"
9421 prefixvar=vendorscript
9424 : see if qgcvt exists
9428 : Check print/scan long double stuff
9431 if $test X"$d_longdbl" = X"$define"; then
9433 echo "Checking how to print long doubles..." >&4
9435 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9436 $cat >try.c <<'EOCP'
9437 #include <sys/types.h>
9441 printf("%.3f\n", d);
9445 if eval $compile; then
9449 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9450 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9451 echo "We will use %f."
9457 if $test X"$sPRIfldbl" = X; then
9458 $cat >try.c <<'EOCP'
9459 #include <sys/types.h>
9462 long double d = 123.456;
9463 printf("%.3Lf\n", d);
9467 if eval $compile; then
9471 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9472 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9473 echo "We will use %Lf."
9479 if $test X"$sPRIfldbl" = X; then
9480 $cat >try.c <<'EOCP'
9481 #include <sys/types.h>
9484 long double d = 123.456;
9485 printf("%.3llf\n", d);
9489 if eval $compile; then
9493 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9494 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9495 echo "We will use %llf."
9501 if $test X"$sPRIfldbl" = X; then
9502 $cat >try.c <<'EOCP'
9503 #include <sys/types.h>
9506 long double d = 123.456;
9507 printf("%.3lf\n", d);
9511 if eval $compile; then
9515 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9516 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9517 echo "We will use %lf."
9523 if $test X"$sPRIfldbl" = X; then
9524 echo "Cannot figure out how to print long doubles." >&4
9526 sSCNfldbl=$sPRIfldbl # expect consistency
9533 case "$sPRIfldbl" in
9534 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9535 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9536 d_SCNfldbl="$undef";
9538 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9539 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9540 d_SCNfldbl="$define";
9544 : Check how to convert floats to strings.
9546 if test "X$d_Gconvert" = X; then
9549 echo "Checking for an efficient way to convert floats to strings."
9551 case "$uselongdouble" in
9552 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9554 case "$d_longdbl" in
9555 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9557 case "$d_PRIgldbl" in
9558 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9562 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9563 char *myname = "gconvert";
9566 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9567 char *myname = "gcvt";
9570 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9571 char *myname = "qgcvt";
9572 #define DOUBLETYPE long double
9575 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9577 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9579 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9582 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9584 char *myname = "sprintf";
9588 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9589 #define DOUBLETYPE long double
9591 #define DOUBLETYPE double
9597 #define I_STDLIB $i_stdlib
9603 checkit(expect, got)
9607 if (strcmp(expect, got)) {
9608 printf("%s oddity: Expected %s, got %s\n",
9609 myname, expect, got);
9619 /* This must be 1st test on (which?) platform */
9620 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9621 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9622 checkit("0.1", buf);
9624 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9625 checkit("0.01", buf);
9627 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9628 checkit("0.001", buf);
9630 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9631 checkit("0.0001", buf);
9633 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9634 if (strlen(buf) > 5)
9635 checkit("9e-005", buf); /* for Microsoft ?? */
9637 checkit("9e-05", buf);
9639 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9642 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9643 checkit("1.1", buf);
9645 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9646 checkit("1.01", buf);
9648 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9649 checkit("1.001", buf);
9651 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9652 checkit("1.0001", buf);
9654 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9655 checkit("1.00001", buf);
9657 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9658 checkit("1.000001", buf);
9660 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9663 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9666 /* Some Linux gcvt's give 1.e+5 here. */
9667 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9668 checkit("100000", buf);
9670 /* Some Linux gcvt's give -1.e+5 here. */
9671 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9672 checkit("-100000", buf);
9674 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9675 checkit("123.456", buf);
9677 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9678 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9679 /* 34 should be enough to scare even long double
9680 * places into using the e notation. */
9681 if (strlen(buf) > 5)
9682 checkit("1e+034", buf); /* for Microsoft */
9684 checkit("1e+34", buf);
9686 /* For Perl, if you add additional tests here, also add them to
9687 * t/base/num.t for benefit of platforms not using Configure or
9688 * overriding d_Gconvert */
9693 : first add preferred functions to our list
9695 for xxx_convert in $gconvert_preference; do
9696 case $xxx_convert in
9697 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9698 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9701 : then add any others
9702 for xxx_convert in gconvert gcvt sprintf; do
9705 *) xxx_list="$xxx_list $xxx_convert" ;;
9709 case "$d_longdbl$uselongdouble" in
9711 : again, add prefered functions to our list first
9713 for xxx_convert in $gconvert_ld_preference; do
9714 case $xxx_convert in
9715 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9716 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9719 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9720 for xxx_convert in qgcvt sprintf $xxx_list; do
9721 case "$xxx_ld_list" in
9722 $xxx_convert*|*" $xxx_convert"*) ;;
9723 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9726 : if sprintf cannot do long doubles, move it to the end
9727 if test "$d_PRIgldbl" != "$define"; then
9728 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9730 : if no qgcvt, remove it
9731 if test "$d_qgcvt" != "$define"; then
9732 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9735 xxx_list="$xxx_ld_list"
9739 for xxx_convert in $xxx_list; do
9740 echo "Trying $xxx_convert..."
9741 $rm -f try try$_o core
9742 set try -DTRY_$xxx_convert
9743 if eval $compile; then
9744 echo "$xxx_convert() found." >&4
9746 echo "I'll use $xxx_convert to convert floats into a string." >&4
9749 echo "...But $xxx_convert didn't work as I expected."
9753 echo "$xxx_convert NOT found." >&4
9757 if test X$xxx_convert = X; then
9758 echo "*** WHOA THERE!!! ***" >&4
9759 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9763 case "$xxx_convert" in
9764 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9765 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9766 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9767 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9768 "$define$define$define")
9769 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9770 "$define$define$undef")
9771 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9772 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9780 : see if _fwalk exists
9784 : Initialize h_fcntl
9787 : Initialize h_sysfile
9790 : access call always available on UNIX
9794 : locate the flags for 'access()'
9798 $cat >access.c <<EOCP
9799 #include <sys/types.h>
9804 #include <sys/file.h>
9817 : check sys/file.h first, no particular reason here
9818 if $test `./findhdr sys/file.h` && \
9819 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9821 echo "<sys/file.h> defines the *_OK access constants." >&4
9822 elif $test `./findhdr fcntl.h` && \
9823 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9825 echo "<fcntl.h> defines the *_OK access constants." >&4
9826 elif $test `./findhdr unistd.h` && \
9827 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9828 echo "<unistd.h> defines the *_OK access constants." >&4
9830 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9836 : see if accessx exists
9837 set accessx d_accessx
9840 : see if aintl exists
9844 : see if alarm exists
9848 : see if POSIX threads are available
9849 set pthread.h i_pthread
9852 : define a fucntion to check prototypes
9853 $cat > protochk <<EOSH
9856 optimize="$optimize"
9858 prototype="$prototype"
9861 usethreads=$usethreads
9862 i_pthread=$i_pthread
9863 pthread_h_first=$pthread_h_first
9866 $cat >> protochk <<'EOSH'
9871 while test $# -ge 2; do
9873 $define) echo "#include <$2>" >> try.c ;;
9874 literal) echo "$2" >> try.c ;;
9876 # Extra magic for the benefit of systems that need pthread.h
9877 # to be included early to correctly detect threadsafe functions.
9878 # Such functions must guarantee themselves, though, that the usethreads
9879 # and i_pthread have been defined, before calling protochk.
9880 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9881 echo "#include <pthread.h>" >> try.c
9886 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9887 cat >> try.c <<'EOCP'
9888 #ifdef CAN_PROTOTYPE
9889 #define _(args) args
9894 echo "$foo" >> try.c
9895 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9896 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9904 hasproto='varname=$1; func=$2; shift; shift;
9905 while $test $# -ge 2; do
9907 $define) echo "#include <$2>";;
9911 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9912 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9913 echo "$func() prototype found.";
9916 echo "$func() prototype NOT found.";
9923 : see if sys/types.h has to be included
9924 set sys/types.h i_systypes
9927 : see if sys/select.h has to be included
9928 set sys/select.h i_sysselct
9931 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9932 while $test $# -ge 2; do
9934 $define) echo "#include <$2>";;
9938 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9940 if eval $compile; then
9949 : see if we should include time.h, sys/time.h, or both
9951 if test "X$timeincl" = X; then
9952 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9953 $echo $n "I'm now running the test program...$c"
9955 #include <sys/types.h>
9960 #ifdef SYSTIMEKERNEL
9963 #include <sys/time.h>
9966 #include <sys/select.h>
9979 struct timezone tzp;
9981 if (foo.tm_sec == foo.tm_sec)
9984 if (bar.tv_sec == bar.tv_sec)
9991 for s_timezone in '-DS_TIMEZONE' ''; do
9993 for s_timeval in '-DS_TIMEVAL' ''; do
9994 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9995 for i_time in '' '-DI_TIME'; do
9996 for i_systime in '-DI_SYSTIME' ''; do
9999 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10000 if eval $compile; then
10001 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10005 $echo $n "Succeeded with $flags$c"
10017 *SYSTIMEKERNEL*) i_systimek="$define"
10018 timeincl=`./findhdr sys/time.h`
10019 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10020 *) i_systimek="$undef";;
10023 *I_TIME*) i_time="$define"
10024 timeincl=`./findhdr time.h`" $timeincl"
10025 echo "We'll include <time.h>." >&4;;
10026 *) i_time="$undef";;
10029 *I_SYSTIME*) i_systime="$define"
10030 timeincl=`./findhdr sys/time.h`" $timeincl"
10031 echo "We'll include <sys/time.h>." >&4;;
10032 *) i_systime="$undef";;
10036 : see if struct tm knows about tm_zone
10037 case "$i_systime$i_time" in
10040 echo "Checking to see if your struct tm has tm_zone field..." >&4
10041 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10049 case "$d_tm_tm_zone" in
10050 "$define") echo "Yes, it does." ;;
10051 *) echo "No, it doesn't." ;;
10053 : see if struct tm knows about tm_gmtoff
10054 case "$i_systime$i_time" in
10057 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10058 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10066 case "$d_tm_tm_gmtoff" in
10067 "$define") echo "Yes, it does." ;;
10068 *) echo "No, it doesn't." ;;
10071 : see if asctime_r exists
10072 set asctime_r d_asctime_r
10074 case "$d_asctime_r" in
10076 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10077 case "$d_asctime_r_proto:$usethreads" in
10078 ":define") d_asctime_r_proto=define
10079 set d_asctime_r_proto asctime_r $hdrs
10083 case "$d_asctime_r_proto" in
10085 case "$asctime_r_proto" in
10086 ''|0) try='char* asctime_r(const struct tm*, char*);'
10087 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10089 case "$asctime_r_proto" in
10090 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10091 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10093 case "$asctime_r_proto" in
10094 ''|0) try='int asctime_r(const struct tm*, char*);'
10095 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10097 case "$asctime_r_proto" in
10098 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10099 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10101 case "$asctime_r_proto" in
10102 ''|0) d_asctime_r=undef
10104 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10105 * ) case "$asctime_r_proto" in
10106 REENTRANT_PROTO*) ;;
10107 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10109 echo "Prototype: $try" ;;
10112 *) case "$usethreads" in
10113 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10120 *) asctime_r_proto=0
10124 : see if atolf exists
10128 : see if atoll exists
10132 : Look for GCC-style attribute format
10133 case "$d_attribute_format" in
10136 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10137 $cat >attrib.c <<'EOCP'
10139 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10141 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10142 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10143 echo "Your C compiler doesn't support __attribute__((format))."
10146 echo "Your C compiler supports __attribute__((format))."
10150 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10154 *) val="$d_attribute_format" ;;
10156 set d_attribute_format
10160 : Look for GCC-style attribute format with null format allowed
10161 case "$d_printf_format_null" in
10162 '') case "$d_attribute_format" in
10165 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10166 $cat >attrib.c <<EOCP
10168 #$i_stdlib I_STDLIB
10170 #include <stdlib.h>
10172 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10173 int null_printf (char* pat,...) { return (int)pat; }
10174 int main () { exit(null_printf(NULL)); }
10176 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10177 : run the executable in case it produces a run-time warning
10178 if $run ./attrib >>attrib.out 2>&1; then
10179 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10180 echo "Your C compiler doesn't allow __printf__ format to be null."
10183 echo "Your C compiler allows __printf__ format to be null."
10187 echo "Your C compiler executable failed with __printf__ format null."
10191 echo "Your C compiler fails with __printf__ format null."
10198 *) val="$d_printf_format_null" ;;
10200 set d_printf_format_null
10204 : Look for GCC-style attribute malloc
10205 case "$d_attribute_malloc" in
10208 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10209 $cat >attrib.c <<'EOCP'
10211 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10213 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10214 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10215 echo "Your C compiler doesn't support __attribute__((malloc))."
10218 echo "Your C compiler supports __attribute__((malloc))."
10222 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10226 *) val="$d_attribute_malloc" ;;
10228 set d_attribute_malloc
10232 : Look for GCC-style attribute nonnull
10233 case "$d_attribute_nonnull" in
10236 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10237 $cat >attrib.c <<'EOCP'
10239 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10241 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10242 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10243 echo "Your C compiler doesn't support __attribute__((nonnull))."
10246 echo "Your C compiler supports __attribute__((nonnull))."
10250 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10254 *) val="$d_attribute_nonnull" ;;
10256 set d_attribute_nonnull
10260 : Look for GCC-style attribute noreturn
10261 case "$d_attribute_noreturn" in
10264 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10265 $cat >attrib.c <<'EOCP'
10267 void fall_over_dead( void ) __attribute__((noreturn));
10269 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10270 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10271 echo "Your C compiler doesn't support __attribute__((noreturn))."
10274 echo "Your C compiler supports __attribute__((noreturn))."
10278 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10282 *) val="$d_attribute_noreturn" ;;
10284 set d_attribute_noreturn
10288 : Look for GCC-style attribute pure
10289 case "$d_attribute_pure" in
10292 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10293 $cat >attrib.c <<'EOCP'
10295 int square( int n ) __attribute__((pure));
10297 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10298 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10299 echo "Your C compiler doesn't support __attribute__((pure))."
10302 echo "Your C compiler supports __attribute__((pure))."
10306 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10310 *) val="$d_attribute_pure" ;;
10312 set d_attribute_pure
10316 : Look for GCC-style attribute unused
10317 case "$d_attribute_unused" in
10320 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10321 $cat >attrib.c <<'EOCP'
10323 int do_something( int dummy __attribute__((unused)), int n );
10325 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10326 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10327 echo "Your C compiler doesn't support __attribute__((unused))."
10330 echo "Your C compiler supports __attribute__((unused))."
10334 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10338 *) val="$d_attribute_unused" ;;
10340 set d_attribute_unused
10344 : Look for GCC-style attribute warn_unused_result
10345 case "$d_attribute_warn_unused_result" in
10348 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10349 $cat >attrib.c <<'EOCP'
10351 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10353 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10354 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10355 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10358 echo "Your C compiler supports __attribute__((warn_unused_result))."
10362 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10366 *) val="$d_attribute_warn_unused_result" ;;
10368 set d_attribute_warn_unused_result
10372 : see if bcmp exists
10376 : see if bcopy exists
10380 : see if getpgrp exists
10381 set getpgrp d_getpgrp
10384 case "$d_getpgrp" in
10387 echo "Checking to see which flavor of getpgrp is in use..."
10389 #$i_unistd I_UNISTD
10390 #include <sys/types.h>
10392 # include <unistd.h>
10394 #$i_stdlib I_STDLIB
10396 #include <stdlib.h>
10400 if (getuid() == 0) {
10401 printf("(I see you are running Configure as super-user...)\n");
10404 #ifdef TRY_BSD_PGRP
10405 if (getpgrp(1) == 0)
10414 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10415 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10417 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10418 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10421 echo "I can't seem to compile and run the test program."
10423 xxx="a USG one, i.e. you use getpgrp()."
10425 # SVR4 systems can appear rather BSD-ish.
10426 case "$i_unistd" in
10428 xxx="a BSD one, i.e. you use getpgrp(pid)."
10432 xxx="probably a USG one, i.e. you use getpgrp()."
10437 echo "Assuming your getpgrp is $xxx" >&4
10446 : see if setpgrp exists
10447 set setpgrp d_setpgrp
10450 case "$d_setpgrp" in
10453 echo "Checking to see which flavor of setpgrp is in use..."
10455 #$i_unistd I_UNISTD
10456 #include <sys/types.h>
10458 # include <unistd.h>
10460 #$i_stdlib I_STDLIB
10462 #include <stdlib.h>
10466 if (getuid() == 0) {
10467 printf("(I see you are running Configure as super-user...)\n");
10470 #ifdef TRY_BSD_PGRP
10471 if (-1 == setpgrp(1, 1))
10474 if (setpgrp() != -1)
10480 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10481 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10483 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10484 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10487 echo "(I can't seem to compile and run the test program.)"
10489 xxx="a USG one, i.e. you use setpgrp()."
10491 # SVR4 systems can appear rather BSD-ish.
10492 case "$i_unistd" in
10494 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10498 xxx="probably a USG one, i.e. you use setpgrp()."
10503 echo "Assuming your setpgrp is $xxx" >&4
10512 : Look for GCC-style __builtin_choose_expr
10513 case "$d_builtin_choose_expr" in
10516 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10517 $cat >try.c <<'EOCP'
10518 #include <assert.h>
10519 #include <stdlib.h>
10522 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10525 assert( SYRINX(1) == 2112 );
10526 assert( SYRINX(1) != 5150 );
10527 assert( SYRINX(0) == 5150 );
10528 assert( SYRINX(0) != 2112 );
10529 puts( "All good!" );
10535 if eval $compile; then
10536 echo "Your C compiler supports __builtin_choose_expr."
10539 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10543 *) val="$d_builtin_choose_expr" ;;
10546 set d_builtin_choose_expr
10550 : Look for GCC-style __builtin_expect
10551 case "$d_builtin_expect" in
10554 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10555 $cat >builtin.c <<'EOCP'
10558 if ( __builtin_expect(n, 0) ) n = 1;
10562 if eval $compile; then
10563 echo "Your C compiler supports __builtin_choose_expr."
10566 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10570 *) val="$d_builtin_expect" ;;
10573 set d_builtin_expect
10577 : see if bzero exists
10581 : see if stdarg is available
10583 if $test `./findhdr stdarg.h`; then
10584 echo "<stdarg.h> found." >&4
10587 echo "<stdarg.h> NOT found." >&4
10591 : see if varags is available
10593 if $test `./findhdr varargs.h`; then
10594 echo "<varargs.h> found." >&4
10596 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10599 : set up the varargs testing programs
10600 $cat > varargs.c <<EOP
10602 #include <stdarg.h>
10605 #include <varargs.h>
10609 int f(char *p, ...)
10623 p = va_arg(ap, char *);
10629 $cat > varargs <<EOP
10631 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10640 : now check which varargs header should be included
10645 if `./varargs I_STDARG`; then
10647 elif `./varargs I_VARARGS`; then
10652 if `./varargs I_VARARGS`; then
10659 echo "I could not find the definition for va_dcl... You have problems..." >&4
10660 val="$undef"; set i_stdarg; eval $setvar
10661 val="$undef"; set i_varargs; eval $setvar
10666 case "$i_varhdr" in
10668 val="$define"; set i_stdarg; eval $setvar
10669 val="$undef"; set i_varargs; eval $setvar
10672 val="$undef"; set i_stdarg; eval $setvar
10673 val="$define"; set i_varargs; eval $setvar
10676 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10680 : see if the Compiler supports C99 variadic macros
10681 case "$i_stdarg$i_stdlib" in
10683 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10686 #include <stdarg.h>
10688 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10692 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10698 if eval $compile && $run ./try 2>&1 >/dev/null; then
10699 case "`$run ./try`" in
10701 echo "You have C99 variadic macros." >&4
10702 d_c99_variadic_macros="$define"
10705 echo "You don't have functional C99 variadic macros." >&4
10706 d_c99_variadic_macros="$undef"
10710 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10711 d_c99_variadic_macros="$undef"
10716 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10717 d_c99_variadic_macros="$undef"
10721 : see if signal is declared as pointer to function returning int or void
10723 xxx=`./findhdr signal.h`
10724 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10725 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10726 echo "You have int (*signal())() instead of void." >&4
10728 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10729 echo "You have void (*signal())()." >&4
10731 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10732 echo "You have int (*signal())() instead of void." >&4
10734 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10735 echo "You have void (*signal())()." >&4
10738 case "$d_voidsig" in
10740 echo "I can't determine whether signal handler returns void or int..." >&4
10742 rp="What type does your signal handler return?"
10745 v*) val="$define";;
10749 echo "As you already told me, signal handler returns void." >&4
10752 *) echo "As you already told me, signal handler returns int." >&4
10759 case "$d_voidsig" in
10760 "$define") signal_t="void";;
10761 *) signal_t="int";;
10765 : check for ability to cast large floats to 32-bit ints.
10767 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10768 if $test "$intsize" -ge 4; then
10775 #$i_stdlib I_STDLIB
10777 #include <stdlib.h>
10779 #include <sys/types.h>
10780 #include <signal.h>
10781 $signal_t blech(int s) { exit(3); }
10788 signal(SIGFPE, blech);
10790 /* Don't let compiler optimize the test away. Store the number
10791 in a writable string for gcc to pass to sscanf under HP/UX.
10793 sprintf(str, "2147483647");
10794 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10798 /* x86 processors will probably give 0x8000 0000, which is a
10799 sign change. We don't want that. We want to mimic SPARC
10800 behavior here, which is to preserve the sign and give
10803 if (i32 != ($xxx) f)
10809 if eval $compile_ok; then
10813 echo "(I can't seem to compile the test program--assuming it can't)"
10818 echo "Yup, it can."
10821 echo "Nope, it can't."
10828 : check for ability to cast negative floats to unsigned
10830 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10833 #$i_stdlib I_STDLIB
10835 #include <stdlib.h>
10837 #include <sys/types.h>
10838 #include <signal.h>
10839 $signal_t blech(int s) { exit(7); }
10840 $signal_t blech_in_list(int s) { exit(4); }
10841 unsigned long dummy_long(unsigned long p) { return p; }
10842 unsigned int dummy_int(unsigned int p) { return p; }
10843 unsigned short dummy_short(unsigned short p) { return p; }
10847 unsigned long along;
10849 unsigned short ashort;
10853 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10854 a direct f = -123. assignment. gcc-2.8.0 reportedly
10855 optimized the whole file away
10857 /* Store the number in a writable string for gcc to pass to
10858 sscanf under HP/UX.
10860 sprintf(str, "-123");
10861 sscanf(str, "%lf", &f); /* f = -123.; */
10863 signal(SIGFPE, blech);
10864 along = (unsigned long)f;
10865 aint = (unsigned int)f;
10866 ashort = (unsigned short)f;
10867 if (along != (unsigned long)-123)
10869 if (aint != (unsigned int)-123)
10871 if (ashort != (unsigned short)-123)
10873 sprintf(str, "1073741824.");
10874 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10877 along = (unsigned long)f;
10878 if (along != 0x80000000)
10882 along = (unsigned long)f;
10883 if (along != 0x7fffffff)
10887 along = (unsigned long)f;
10888 if (along != 0x80000001)
10892 signal(SIGFPE, blech_in_list);
10893 sprintf(str, "123.");
10894 sscanf(str, "%lf", &f); /* f = 123.; */
10895 along = dummy_long((unsigned long)f);
10896 aint = dummy_int((unsigned int)f);
10897 ashort = dummy_short((unsigned short)f);
10898 if (along != (unsigned long)123)
10900 if (aint != (unsigned int)123)
10902 if (ashort != (unsigned short)123)
10909 if eval $compile_ok; then
10913 echo "(I can't seem to compile the test program--assuming it can't)"
10916 case "$castflags" in
10918 echo "Yup, it can."
10921 echo "Nope, it can't."
10928 : see if vprintf exists
10930 if set vprintf val -f d_vprintf; eval $csym; $val; then
10931 echo 'vprintf() found.' >&4
10934 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10935 #$i_varargs I_VARARGS
10937 #$i_stdlib I_STDLIB
10938 #$i_unistd I_UNISTD
10941 # include <stdarg.h>
10942 #else /* I_VARARGS */
10943 # include <varargs.h>
10947 # include <unistd.h>
10951 # include <stdlib.h>
10954 #include <stdio.h> /* vsprintf prototype */
10957 void xxx(int n, ...)
10962 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10964 int main() { xxx(1, "foo"); }
10966 #else /* I_VARARGS */
10974 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10976 int main() { xxx("foo"); }
10982 if eval $compile_ok; then
10983 if $run ./try; then
10984 echo "Your vsprintf() returns (int)." >&4
10987 echo "Your vsprintf() returns (char*)." >&4
10991 echo 'I am unable to compile the vsprintf() test program.' >&4
10992 # We shouldn't get here. If we do, assume the standard signature,
10993 # not the old BSD one.
10994 echo 'Guessing that vsprintf() returns (int).' >&4
10998 echo 'vprintf() NOT found.' >&4
11009 : see if chown exists
11013 : see if chroot exists
11014 set chroot d_chroot
11017 : see if chsize exists
11018 set chsize d_chsize
11021 : see if class exists
11025 : see if clearenv exists
11026 set clearenv d_clearenv
11029 hasstruct='varname=$1; struct=$2; shift; shift;
11030 while $test $# -ge 2; do
11032 $define) echo "#include <$2>";;
11036 echo "int main () { struct $struct foo; }" >> try.c;
11038 if eval $compile; then
11049 : see whether socket exists
11051 $echo $n "Hmm... $c" >&4
11052 if set socket val -f d_socket; eval $csym; $val; then
11053 echo "Looks like you have Berkeley networking support." >&4
11055 if set setsockopt val -f; eval $csym; $val; then
11058 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11059 d_oldsock="$define"
11062 if $contains socklib libc.list >/dev/null 2>&1; then
11063 echo "Looks like you have Berkeley networking support." >&4
11065 : we will have to assume that it supports the 4.2 BSD interface
11068 echo "You don't have Berkeley networking in libc$_a..." >&4
11069 if test "X$d_socket" = "X$define"; then
11070 echo "...but you seem to believe that you have sockets." >&4
11072 for net in net socket
11074 if test -f /usr/lib/lib$net$_a; then
11075 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11076 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11077 if $contains socket libc.list >/dev/null 2>&1; then
11082 echo "...but the Wollongong group seems to have hacked it in." >&4
11083 sockethdr="-I/usr/netinclude"
11086 echo "Found Berkeley sockets interface in lib$net." >&4
11087 if $contains setsockopt libc.list >/dev/null 2>&1; then
11090 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11091 d_oldsock="$define"
11097 if test "X$d_socket" != "X$define"; then
11098 echo "or anywhere else I see." >&4
11106 : see if socketpair exists
11107 set socketpair d_sockpair
11112 echo "Checking the availability of certain socket constants..." >&4
11113 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11114 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11116 #include <sys/types.h>
11117 #include <sys/socket.h>
11123 set try; if eval $compile; then
11126 set d_${enum}; eval $setvar
11130 : see if this is a sys/uio.h system
11131 set sys/uio.h i_sysuio
11136 echo "Checking to see if your system supports struct cmsghdr..." >&4
11137 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11139 case "$d_cmsghdr_s" in
11140 "$define") echo "Yes, it does." ;;
11141 *) echo "No, it doesn't." ;;
11145 : check for const keyword
11147 echo 'Checking to see if your C compiler knows about "const"...' >&4
11148 $cat >const.c <<'EOCP'
11149 typedef struct spug { int drokk; } spug;
11153 const spug y = { 0 };
11156 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11158 echo "Yup, it does."
11161 echo "Nope, it doesn't."
11166 : see if copysignl exists
11167 set copysignl d_copysignl
11170 : see if crypt exists
11175 $define) cryptlib='' ;;
11176 *) if set crypt val -f d_crypt; eval $csym; $val; then
11177 echo 'crypt() found.' >&4
11181 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11182 if $test -z "$cryptlib"; then
11183 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11187 if $test -z "$cryptlib"; then
11188 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11192 if $test -z "$cryptlib"; then
11193 cryptlib=`./loc libcrypt$_a "" $libpth`
11197 if $test -z "$cryptlib"; then
11198 echo 'crypt() NOT found.' >&4
11209 : see if this is a crypt.h system
11210 set crypt.h i_crypt
11213 : see if crypt_r exists
11214 set crypt_r d_crypt_r
11216 case "$d_crypt_r" in
11218 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11219 case "$d_crypt_r_proto:$usethreads" in
11220 ":define") d_crypt_r_proto=define
11221 set d_crypt_r_proto crypt_r $hdrs
11225 case "$d_crypt_r_proto" in
11227 case "$crypt_r_proto" in
11228 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11229 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11231 case "$crypt_r_proto" in
11232 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11233 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11235 case "$crypt_r_proto" in
11236 ''|0) d_crypt_r=undef
11238 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11239 * ) case "$crypt_r_proto" in
11240 REENTRANT_PROTO*) ;;
11241 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11243 echo "Prototype: $try" ;;
11246 *) case "$usethreads" in
11247 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11258 : get csh whereabouts
11260 'csh') val="$undef" ;;
11261 *) val="$define" ;;
11265 : Respect a hint or command line value for full_csh.
11266 case "$full_csh" in
11267 '') full_csh=$csh ;;
11270 : see if ctermid exists
11271 set ctermid d_ctermid
11274 : see if ctermid_r exists
11275 set ctermid_r d_ctermid_r
11277 case "$d_ctermid_r" in
11279 hdrs="$i_systypes sys/types.h define stdio.h "
11280 case "$d_ctermid_r_proto:$usethreads" in
11281 ":define") d_ctermid_r_proto=define
11282 set d_ctermid_r_proto ctermid_r $hdrs
11286 case "$d_ctermid_r_proto" in
11288 case "$ctermid_r_proto" in
11289 ''|0) try='char* ctermid_r(char*);'
11290 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11292 case "$ctermid_r_proto" in
11293 ''|0) d_ctermid_r=undef
11295 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11296 * ) case "$ctermid_r_proto" in
11297 REENTRANT_PROTO*) ;;
11298 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11300 echo "Prototype: $try" ;;
11303 *) case "$usethreads" in
11304 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11311 *) ctermid_r_proto=0
11315 : see if ctime_r exists
11316 set ctime_r d_ctime_r
11318 case "$d_ctime_r" in
11320 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11321 case "$d_ctime_r_proto:$usethreads" in
11322 ":define") d_ctime_r_proto=define
11323 set d_ctime_r_proto ctime_r $hdrs
11327 case "$d_ctime_r_proto" in
11329 case "$ctime_r_proto" in
11330 ''|0) try='char* ctime_r(const time_t*, char*);'
11331 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11333 case "$ctime_r_proto" in
11334 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11335 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11337 case "$ctime_r_proto" in
11338 ''|0) try='int ctime_r(const time_t*, char*);'
11339 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11341 case "$ctime_r_proto" in
11342 ''|0) try='int ctime_r(const time_t*, char*, int);'
11343 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11345 case "$ctime_r_proto" in
11346 ''|0) d_ctime_r=undef
11348 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11349 * ) case "$ctime_r_proto" in
11350 REENTRANT_PROTO*) ;;
11351 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11353 echo "Prototype: $try" ;;
11356 *) case "$usethreads" in
11357 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11368 : see if cuserid exists
11369 set cuserid d_cuserid
11372 : see if this is a limits.h system
11373 set limits.h i_limits
11376 : see if this is a float.h system
11377 set float.h i_float
11380 : See if number of significant digits in a double precision number is known
11382 $cat >dbl_dig.c <<EOM
11383 #$i_limits I_LIMITS
11386 #include <limits.h>
11392 printf("Contains DBL_DIG");
11395 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11396 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11397 echo "DBL_DIG found." >&4
11400 echo "DBL_DIG NOT found." >&4
11407 : see if dbm.h is available
11408 : see if dbmclose exists
11409 set dbmclose d_dbmclose
11412 case "$d_dbmclose" in
11422 *) set rpcsvc/dbm.h i_rpcsvcdbm
11427 *) echo "We won't be including <dbm.h>"
11437 : see if prototype for dbminit is available
11439 set d_dbminitproto dbminit $i_dbm dbm.h
11442 : see if difftime exists
11443 set difftime d_difftime
11446 : see if this is a dirent system
11448 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11450 echo "<dirent.h> found." >&4
11453 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11454 echo "<sys/dir.h> found." >&4
11457 xinc=`./findhdr sys/ndir.h`
11459 echo "<dirent.h> NOT found." >&4
11464 : Look for type of directory structure.
11466 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11468 case "$direntrytype" in
11470 case "$i_dirent" in
11471 $define) guess1='struct dirent' ;;
11472 *) guess1='struct direct' ;;
11475 *) guess1="$direntrytype"
11480 'struct dirent') guess2='struct direct' ;;
11481 *) guess2='struct dirent' ;;
11484 if $contains "$guess1" try.c >/dev/null 2>&1; then
11485 direntrytype="$guess1"
11486 echo "Your directory entries are $direntrytype." >&4
11487 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11488 direntrytype="$guess2"
11489 echo "Your directory entries seem to be $direntrytype." >&4
11491 echo "I don't recognize your system's directory entries." >&4
11492 rp="What type is used for directory entries on this system?"
11495 direntrytype="$ans"
11499 : see if the directory entry stores field length
11501 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11502 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11503 echo "Good, your directory entry keeps length information in d_namlen." >&4
11506 echo "Your directory entry does not know about the d_namlen field." >&4
11513 : Look for DIR.dd_fd
11514 case "$i_dirent" in
11516 echo "Checking to see if DIR has a dd_fd member variable" >&4
11518 #$i_stdlib I_STDLIB
11520 #include <stdlib.h>
11522 #include <dirent.h>
11532 if eval $compile; then
11533 echo "Yes, it does."
11536 echo "No, it does not."
11541 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11549 : see if this is an sysdir system
11550 set sys/dir.h i_sysdir
11553 : see if this is an sysndir system
11554 set sys/ndir.h i_sysndir
11559 $cat >dirfd.c <<EOM
11561 #$i_stdlib I_STDLIB
11563 #include <stdlib.h>
11565 #$i_dirent I_DIRENT /**/
11566 #$i_sysdir I_SYS_DIR /**/
11567 #$i_sysndir I_SYS_NDIR /**/
11568 #$i_systypes I_SYS_TYPES /**/
11569 #if defined(I_SYS_TYPES)
11570 #include <sys/types.h>
11572 #if defined(I_DIRENT)
11573 #include <dirent.h>
11574 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11575 #include <sys/dir.h>
11579 #include <sys/ndir.h>
11583 #include <ndir.h> /* may be wrong in the future */
11585 #include <sys/dir.h>
11591 DIR *dirp = opendir(".");
11592 if (dirfd(dirp) >= 0)
11600 if eval $compile; then
11604 $define) echo "dirfd() found." >&4 ;;
11605 *) echo "dirfd() NOT found." >&4 ;;
11611 : see if dlerror exists
11614 set dlerror d_dlerror
11618 : see if dlfcn is available
11619 set dlfcn.h i_dlfcn
11626 On a few systems, the dynamically loaded modules that perl generates and uses
11627 will need a different extension than shared libs. The default will probably
11633 *) dflt="$dlext" ;;
11635 rp='What is the extension of dynamically loaded modules'
11644 : Check if dlsym need a leading underscore
11650 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11651 $cat >dyna.c <<'EOM'
11658 #$i_stdlib I_STDLIB
11660 #include <stdlib.h>
11664 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11666 #include <sys/types.h>
11671 extern int fred() ;
11680 int mode = RTLD_LAZY ;
11682 handle = dlopen("./dyna.$dlext", mode) ;
11683 if (handle == NULL) {
11688 symbol = dlsym(handle, "fred") ;
11689 if (symbol == NULL) {
11690 /* try putting a leading underscore */
11691 symbol = dlsym(handle, "_fred") ;
11692 if (symbol == NULL) {
11705 : Call the object file tmp-dyna.o in case dlext=o.
11706 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11707 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11708 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11709 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11712 1) echo "Test program failed using dlopen." >&4
11713 echo "Perhaps you should not use dynamic loading." >&4;;
11714 2) echo "Test program failed using dlsym." >&4
11715 echo "Perhaps you should not use dynamic loading." >&4;;
11716 3) echo "dlsym needs a leading underscore" >&4
11718 4) echo "dlsym doesn't need a leading underscore." >&4;;
11721 echo "I can't compile and run the test program." >&4
11722 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11727 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11732 : see if drand48_r exists
11733 set drand48_r d_drand48_r
11735 case "$d_drand48_r" in
11737 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11738 case "$d_drand48_r_proto:$usethreads" in
11739 ":define") d_drand48_r_proto=define
11740 set d_drand48_r_proto drand48_r $hdrs
11744 case "$d_drand48_r_proto" in
11746 case "$drand48_r_proto" in
11747 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11748 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11750 case "$drand48_r_proto" in
11751 ''|0) d_drand48_r=undef
11753 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11754 * ) case "$drand48_r_proto" in
11755 REENTRANT_PROTO*) ;;
11756 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11758 echo "Prototype: $try" ;;
11761 *) case "$usethreads" in
11762 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11769 *) drand48_r_proto=0
11773 : see if prototype for drand48 is available
11775 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11778 : see if dup2 exists
11782 : see if eaccess exists
11783 set eaccess d_eaccess
11786 : see if endgrent exists
11787 set endgrent d_endgrent
11790 : see if this is an grp system
11796 xxx=`./findhdr grp.h`
11797 $cppstdin $cppflags $cppminus < $xxx >$$.h
11799 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11811 set d_grpasswd; eval $setvar
11815 : see if endgrent_r exists
11816 set endgrent_r d_endgrent_r
11818 case "$d_endgrent_r" in
11820 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11821 case "$d_endgrent_r_proto:$usethreads" in
11822 ":define") d_endgrent_r_proto=define
11823 set d_endgrent_r_proto endgrent_r $hdrs
11827 case "$d_endgrent_r_proto" in
11829 case "$endgrent_r_proto" in
11830 ''|0) try='int endgrent_r(FILE**);'
11831 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11833 case "$endgrent_r_proto" in
11834 ''|0) try='void endgrent_r(FILE**);'
11835 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11837 case "$endgrent_r_proto" in
11838 ''|0) d_endgrent_r=undef
11840 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11841 * ) case "$endgrent_r_proto" in
11842 REENTRANT_PROTO*) ;;
11843 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11845 echo "Prototype: $try" ;;
11848 *) case "$usethreads" in
11849 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11856 *) endgrent_r_proto=0
11860 : see if endhostent exists
11861 set endhostent d_endhent
11864 : see if this is a netdb.h system
11865 set netdb.h i_netdb
11868 : see if endhostent_r exists
11869 set endhostent_r d_endhostent_r
11871 case "$d_endhostent_r" in
11873 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11874 case "$d_endhostent_r_proto:$usethreads" in
11875 ":define") d_endhostent_r_proto=define
11876 set d_endhostent_r_proto endhostent_r $hdrs
11880 case "$d_endhostent_r_proto" in
11882 case "$endhostent_r_proto" in
11883 ''|0) try='int endhostent_r(struct hostent_data*);'
11884 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11886 case "$endhostent_r_proto" in
11887 ''|0) try='void endhostent_r(struct hostent_data*);'
11888 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11890 case "$endhostent_r_proto" in
11891 ''|0) d_endhostent_r=undef
11892 endhostent_r_proto=0
11893 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11894 * ) case "$endhostent_r_proto" in
11895 REENTRANT_PROTO*) ;;
11896 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11898 echo "Prototype: $try" ;;
11901 *) case "$usethreads" in
11902 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11904 d_endhostent_r=undef
11905 endhostent_r_proto=0
11909 *) endhostent_r_proto=0
11913 : see if endnetent exists
11914 set endnetent d_endnent
11917 : see if endnetent_r exists
11918 set endnetent_r d_endnetent_r
11920 case "$d_endnetent_r" in
11922 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11923 case "$d_endnetent_r_proto:$usethreads" in
11924 ":define") d_endnetent_r_proto=define
11925 set d_endnetent_r_proto endnetent_r $hdrs
11929 case "$d_endnetent_r_proto" in
11931 case "$endnetent_r_proto" in
11932 ''|0) try='int endnetent_r(struct netent_data*);'
11933 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11935 case "$endnetent_r_proto" in
11936 ''|0) try='void endnetent_r(struct netent_data*);'
11937 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11939 case "$endnetent_r_proto" in
11940 ''|0) d_endnetent_r=undef
11941 endnetent_r_proto=0
11942 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11943 * ) case "$endnetent_r_proto" in
11944 REENTRANT_PROTO*) ;;
11945 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11947 echo "Prototype: $try" ;;
11950 *) case "$usethreads" in
11951 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11953 d_endnetent_r=undef
11954 endnetent_r_proto=0
11958 *) endnetent_r_proto=0
11962 : see if endprotoent exists
11963 set endprotoent d_endpent
11966 : see if endprotoent_r exists
11967 set endprotoent_r d_endprotoent_r
11969 case "$d_endprotoent_r" in
11971 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11972 case "$d_endprotoent_r_proto:$usethreads" in
11973 ":define") d_endprotoent_r_proto=define
11974 set d_endprotoent_r_proto endprotoent_r $hdrs
11978 case "$d_endprotoent_r_proto" in
11980 case "$endprotoent_r_proto" in
11981 ''|0) try='int endprotoent_r(struct protoent_data*);'
11982 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11984 case "$endprotoent_r_proto" in
11985 ''|0) try='void endprotoent_r(struct protoent_data*);'
11986 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11988 case "$endprotoent_r_proto" in
11989 ''|0) d_endprotoent_r=undef
11990 endprotoent_r_proto=0
11991 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11992 * ) case "$endprotoent_r_proto" in
11993 REENTRANT_PROTO*) ;;
11994 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11996 echo "Prototype: $try" ;;
11999 *) case "$usethreads" in
12000 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12002 d_endprotoent_r=undef
12003 endprotoent_r_proto=0
12007 *) endprotoent_r_proto=0
12011 : see if endpwent exists
12012 set endpwent d_endpwent
12015 : see if this is a pwd.h system
12021 xxx=`./findhdr pwd.h`
12022 $cppstdin $cppflags $cppminus < $xxx >$$.h
12024 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12032 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12040 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12048 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12056 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12064 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12072 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12080 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12092 set d_pwquota; eval $setvar
12093 set d_pwage; eval $setvar
12094 set d_pwchange; eval $setvar
12095 set d_pwclass; eval $setvar
12096 set d_pwexpire; eval $setvar
12097 set d_pwcomment; eval $setvar
12098 set d_pwgecos; eval $setvar
12099 set d_pwpasswd; eval $setvar
12103 : see if endpwent_r exists
12104 set endpwent_r d_endpwent_r
12106 case "$d_endpwent_r" in
12108 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12109 case "$d_endpwent_r_proto:$usethreads" in
12110 ":define") d_endpwent_r_proto=define
12111 set d_endpwent_r_proto endpwent_r $hdrs
12115 case "$d_endpwent_r_proto" in
12117 case "$endpwent_r_proto" in
12118 ''|0) try='int endpwent_r(FILE**);'
12119 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12121 case "$endpwent_r_proto" in
12122 ''|0) try='void endpwent_r(FILE**);'
12123 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12125 case "$endpwent_r_proto" in
12126 ''|0) d_endpwent_r=undef
12128 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12129 * ) case "$endpwent_r_proto" in
12130 REENTRANT_PROTO*) ;;
12131 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12133 echo "Prototype: $try" ;;
12136 *) case "$usethreads" in
12137 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12144 *) endpwent_r_proto=0
12148 : see if endservent exists
12149 set endservent d_endsent
12152 : see if endservent_r exists
12153 set endservent_r d_endservent_r
12155 case "$d_endservent_r" in
12157 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12158 case "$d_endservent_r_proto:$usethreads" in
12159 ":define") d_endservent_r_proto=define
12160 set d_endservent_r_proto endservent_r $hdrs
12164 case "$d_endservent_r_proto" in
12166 case "$endservent_r_proto" in
12167 ''|0) try='int endservent_r(struct servent_data*);'
12168 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12170 case "$endservent_r_proto" in
12171 ''|0) try='void endservent_r(struct servent_data*);'
12172 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12174 case "$endservent_r_proto" in
12175 ''|0) d_endservent_r=undef
12176 endservent_r_proto=0
12177 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12178 * ) case "$endservent_r_proto" in
12179 REENTRANT_PROTO*) ;;
12180 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12182 echo "Prototype: $try" ;;
12185 *) case "$usethreads" in
12186 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12188 d_endservent_r=undef
12189 endservent_r_proto=0
12193 *) endservent_r_proto=0
12197 : Locate the flags for 'open()'
12200 #include <sys/types.h>
12205 #include <sys/file.h>
12207 #$i_stdlib I_STDLIB
12209 #include <stdlib.h>
12220 : check sys/file.h first to get FREAD on Sun
12221 if $test `./findhdr sys/file.h` && \
12222 set try -DI_SYS_FILE && eval $compile; then
12224 echo "<sys/file.h> defines the O_* constants..." >&4
12225 if $run ./try; then
12226 echo "and you have the 3 argument form of open()." >&4
12229 echo "but not the 3 argument form of open(). Oh, well." >&4
12232 elif $test `./findhdr fcntl.h` && \
12233 set try -DI_FCNTL && eval $compile; then
12235 echo "<fcntl.h> defines the O_* constants..." >&4
12236 if $run ./try; then
12237 echo "and you have the 3 argument form of open()." >&4
12240 echo "but not the 3 argument form of open(). Oh, well." >&4
12245 echo "I can't find the O_* constant definitions! You got problems." >&4
12251 : see which of string.h or strings.h is needed
12253 strings=`./findhdr string.h`
12254 if $test "$strings" && $test -r "$strings"; then
12255 echo "Using <string.h> instead of <strings.h>." >&4
12259 strings=`./findhdr strings.h`
12260 if $test "$strings" && $test -r "$strings"; then
12261 echo "Using <strings.h> instead of <string.h>." >&4
12263 echo "No string header found -- You'll surely have problems." >&4
12268 case "$i_string" in
12269 "$undef") strings=`./findhdr strings.h`;;
12270 *) strings=`./findhdr string.h`;;
12273 : see if this is a sys/file.h system
12278 : do we need to include sys/file.h ?
12282 if $h_sysfile; then
12284 echo "We'll be including <sys/file.h>." >&4
12287 echo "We won't be including <sys/file.h>." >&4
12297 : see if fcntl.h is there
12302 : see if we can include fcntl.h
12308 echo "We'll be including <fcntl.h>." >&4
12311 if $h_sysfile; then
12312 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12314 echo "We won't be including <fcntl.h>." >&4
12326 : see if fork exists
12330 : see if pipe exists
12334 : check for non-blocking I/O stuff
12335 case "$h_sysfile" in
12336 true) echo "#include <sys/file.h>" > head.c;;
12339 true) echo "#include <fcntl.h>" > head.c;;
12340 *) echo "#include <sys/fcntl.h>" > head.c;;
12345 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12346 case "$o_nonblock" in
12348 $cat head.c > try.c
12349 $cat >>try.c <<EOCP
12351 #$i_stdlib I_STDLIB
12353 #include <stdlib.h>
12361 printf("O_NONBLOCK\n");
12365 printf("O_NDELAY\n");
12369 printf("FNDELAY\n");
12376 if eval $compile_ok; then
12377 o_nonblock=`$run ./try`
12378 case "$o_nonblock" in
12379 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12380 *) echo "Seems like we can use $o_nonblock.";;
12383 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12386 *) echo "Using $hint value $o_nonblock.";;
12391 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12394 case "$d_fork:$d_pipe" in
12396 $cat head.c > try.c
12397 $cat >>try.c <<EOCP
12399 #include <sys/types.h>
12400 #include <signal.h>
12402 #$i_stdlib I_STDLIB
12404 #include <stdlib.h>
12410 #define MY_O_NONBLOCK $o_nonblock
12411 #ifndef errno /* XXX need better Configure test */
12414 #$i_unistd I_UNISTD
12416 #include <unistd.h>
12418 #$i_string I_STRING
12420 #include <string.h>
12422 #include <strings.h>
12424 $signal_t blech(int x) { exit(3); }
12426 $cat >> try.c <<'EOCP'
12434 pipe(pd); /* Down: child -> parent */
12435 pipe(pu); /* Up: parent -> child */
12438 close(pd[1]); /* Parent reads from pd[0] */
12439 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12441 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12446 signal(SIGALRM, blech);
12448 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12450 sprintf(string, "%d\n", ret);
12451 write(2, string, strlen(string));
12454 if (errno == EAGAIN) {
12455 printf("EAGAIN\n");
12460 if (errno == EWOULDBLOCK)
12461 printf("EWOULDBLOCK\n");
12464 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12465 sleep(2); /* Give it time to close our pipe */
12467 ret = read(pd[0], buf, 1); /* Should read EOF */
12469 sprintf(string, "%d\n", ret);
12470 write(4, string, strlen(string));
12474 close(pd[0]); /* We write to pd[1] */
12475 close(pu[1]); /* We read from pu[0] */
12476 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12477 close(pd[1]); /* Pipe pd is now fully closed! */
12478 exit(0); /* Bye bye, thank you for playing! */
12482 if eval $compile_ok; then
12483 echo "$startsh" >mtry
12484 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12486 ./mtry >/dev/null 2>&1
12488 0) eagain=`$cat try.out`;;
12489 1) echo "Could not perform non-blocking setting!";;
12490 2) echo "I did a successful read() for something that was not there!";;
12491 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12492 4) echo "Could not find F_SETFL!";;
12493 *) echo "Something terribly wrong happened during testing.";;
12495 rd_nodata=`$cat try.ret`
12496 echo "A read() system call with no data present returns $rd_nodata."
12497 case "$rd_nodata" in
12500 echo "(That's peculiar, fixing that to be -1.)"
12506 echo "Forcing errno EAGAIN on read() with no data available."
12510 echo "Your read() sets errno to $eagain when no data is available."
12513 status=`$cat try.err`
12515 0) echo "And it correctly returns 0 to signal EOF.";;
12516 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12517 *) echo "However, your read() returns '$status' on EOF??";;
12520 if test "$status" = "$rd_nodata"; then
12521 echo "WARNING: you can't distinguish between EOF and no data!"
12525 echo "I can't compile the test program--assuming errno EAGAIN will do."
12529 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12538 echo "Using $hint value $eagain."
12539 echo "Your read() returns $rd_nodata when no data is present."
12540 case "$d_eofnblk" in
12541 "$define") echo "And you can see EOF because read() returns 0.";;
12542 "$undef") echo "But you can't see EOF status from read() returned value.";;
12544 echo "(Assuming you can't see EOF status from read anyway.)"
12550 $rm_try head.c mtry
12552 : see if _ptr and _cnt from stdio act std
12555 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12556 echo "(Looks like you have stdio.h from BSD.)"
12557 case "$stdio_ptr" in
12558 '') stdio_ptr='((fp)->_p)'
12561 *) ptr_lval=$d_stdio_ptr_lval;;
12563 case "$stdio_cnt" in
12564 '') stdio_cnt='((fp)->_r)'
12567 *) cnt_lval=$d_stdio_cnt_lval;;
12569 case "$stdio_base" in
12570 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12572 case "$stdio_bufsiz" in
12573 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12575 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12576 echo "(Looks like you have stdio.h from Linux.)"
12577 case "$stdio_ptr" in
12578 '') stdio_ptr='((fp)->_IO_read_ptr)'
12581 *) ptr_lval=$d_stdio_ptr_lval;;
12583 case "$stdio_cnt" in
12584 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12587 *) cnt_lval=$d_stdio_cnt_lval;;
12589 case "$stdio_base" in
12590 '') stdio_base='((fp)->_IO_read_base)';;
12592 case "$stdio_bufsiz" in
12593 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12596 case "$stdio_ptr" in
12597 '') stdio_ptr='((fp)->_ptr)'
12600 *) ptr_lval=$d_stdio_ptr_lval;;
12602 case "$stdio_cnt" in
12603 '') stdio_cnt='((fp)->_cnt)'
12606 *) cnt_lval=$d_stdio_cnt_lval;;
12608 case "$stdio_base" in
12609 '') stdio_base='((fp)->_base)';;
12611 case "$stdio_bufsiz" in
12612 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12616 : test whether _ptr and _cnt really work
12617 echo "Checking how std your stdio is..." >&4
12620 #$i_stdlib I_STDLIB
12622 #include <stdlib.h>
12624 #define FILE_ptr(fp) $stdio_ptr
12625 #define FILE_cnt(fp) $stdio_cnt
12627 FILE *fp = fopen("try.c", "r");
12630 18 <= FILE_cnt(fp) &&
12631 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12639 if eval $compile && $to try.c; then
12640 if $run ./try; then
12641 echo "Your stdio acts pretty std."
12644 echo "Your stdio isn't very std."
12647 echo "Your stdio doesn't appear very std."
12651 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12652 # direct buffer manipulation no longer works. The Configure tests
12653 # should be changed to correctly detect this, but until then,
12654 # the following check should at least let perl compile and run.
12655 # (This quick fix should be updated before 5.8.1.)
12656 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12657 # A. Dougherty, June 3, 2002.
12658 case "$d_gnulibc" in
12660 case "$gnulibc_version" in
12664 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12673 : Can _ptr be used as an lvalue?
12674 case "$d_stdstdio$ptr_lval" in
12675 $define$define) val=$define ;;
12678 set d_stdio_ptr_lval
12681 : Can _cnt be used as an lvalue?
12682 case "$d_stdstdio$cnt_lval" in
12683 $define$define) val=$define ;;
12686 set d_stdio_cnt_lval
12690 : test whether setting _ptr sets _cnt as a side effect
12691 d_stdio_ptr_lval_sets_cnt="$undef"
12692 d_stdio_ptr_lval_nochange_cnt="$undef"
12693 case "$d_stdio_ptr_lval$d_stdstdio" in
12695 echo "Checking to see what happens if we set the stdio ptr..." >&4
12698 /* Can we scream? */
12699 /* Eat dust sed :-) */
12700 /* In the buffer space, no one can hear you scream. */
12701 #$i_stdlib I_STDLIB
12703 #include <stdlib.h>
12705 #define FILE_ptr(fp) $stdio_ptr
12706 #define FILE_cnt(fp) $stdio_cnt
12707 #include <sys/types.h>
12709 FILE *fp = fopen("try.c", "r");
12714 puts("Fail even to read");
12717 c = getc(fp); /* Read away the first # */
12719 puts("Fail even to read");
12723 18 <= FILE_cnt(fp) &&
12724 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12726 puts("Fail even to read");
12729 ptr = (char*) FILE_ptr(fp);
12730 cnt = (size_t)FILE_cnt(fp);
12732 FILE_ptr(fp) += 42;
12734 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12735 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12738 if (FILE_cnt(fp) <= 20) {
12739 printf ("Fail (<20 chars to test)");
12742 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12743 puts("Fail compare");
12746 if (cnt == FILE_cnt(fp)) {
12747 puts("Pass_unchanged");
12750 if (FILE_cnt(fp) == (cnt - 42)) {
12751 puts("Pass_changed");
12754 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12760 if eval $compile && $to try.c; then
12761 case `$run ./try` in
12763 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12764 d_stdio_ptr_lval_sets_cnt="$define" ;;
12766 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12767 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12769 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12771 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12774 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12780 : see if _base is also standard
12782 case "$d_stdstdio" in
12786 #$i_stdlib I_STDLIB
12788 #include <stdlib.h>
12790 #define FILE_base(fp) $stdio_base
12791 #define FILE_bufsiz(fp) $stdio_bufsiz
12793 FILE *fp = fopen("try.c", "r");
12796 19 <= FILE_bufsiz(fp) &&
12797 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12804 if eval $compile && $to try.c; then
12805 if $run ./try; then
12806 echo "And its _base field acts std."
12809 echo "But its _base field isn't std."
12812 echo "However, it seems to be lacking the _base field."
12820 : see if fast_stdio exists
12822 case "$d_stdstdio:$d_stdio_ptr_lval" in
12824 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12826 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12837 : see if fchdir exists
12838 set fchdir d_fchdir
12841 : see if fchmod exists
12842 set fchmod d_fchmod
12845 : see if fchown exists
12846 set fchown d_fchown
12849 : see if this is an fcntl system
12853 : See if fcntl-based locking works.
12856 #$i_stdlib I_STDLIB
12858 #include <stdlib.h>
12860 #include <unistd.h>
12862 #include <signal.h>
12863 $signal_t blech(int x) { exit(3); }
12865 #if defined(F_SETLK) && defined(F_SETLKW)
12866 struct flock flock;
12868 fd = open("try.c", O_RDONLY);
12869 flock.l_type = F_RDLCK;
12870 flock.l_whence = SEEK_SET;
12871 flock.l_start = flock.l_len = 0;
12872 signal(SIGALRM, blech);
12874 retval = fcntl(fd, F_SETLK, &flock);
12876 (retval < 0 ? exit(2) : exit(0));
12882 echo "Checking if fcntl-based file locking works... "
12886 if eval $compile_ok; then
12887 if $run ./try; then
12888 echo "Yes, it seems to work."
12891 echo "Nope, it didn't work."
12896 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12897 *** This is (almost) impossible.
12898 *** If your NFS lock daemons are not feeling well, something like
12899 *** this may happen, please investigate. Cannot continue, aborting.
12907 echo "I'm unable to compile the test program, so I'll assume not."
12912 echo "Nope, since you don't even have fcntl()."
12915 set d_fcntl_can_lock
12919 : check for fd_set items
12922 Checking to see how well your C compiler handles fd_set and friends ...
12925 #$i_stdlib I_STDLIB
12927 #include <stdlib.h>
12929 #$i_systime I_SYS_TIME
12930 #$i_sysselct I_SYS_SELECT
12931 #$d_socket HAS_SOCKET
12932 #include <sys/types.h>
12934 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12937 #include <sys/time.h>
12939 #ifdef I_SYS_SELECT
12940 #include <sys/select.h>
12949 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12957 if eval $compile; then
12958 d_fds_bits="$define"
12960 echo "Well, your system knows about the normal fd_set typedef..." >&4
12961 if $run ./try; then
12962 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12963 d_fd_macros="$define"
12966 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12968 d_fd_macros="$undef"
12972 Hmm, your compiler has some difficulty with fd_set. Checking further...
12975 if eval $compile; then
12976 d_fds_bits="$undef"
12978 echo "Well, your system has some sort of fd_set available..." >&4
12979 if $run ./try; then
12980 echo "and you have the normal fd_set macros." >&4
12981 d_fd_macros="$define"
12984 but not the normal fd_set macros! Gross! More work for me...
12986 d_fd_macros="$undef"
12989 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12991 d_fds_bits="$undef"
12992 d_fd_macros="$undef"
12997 : see if fgetpos exists
12998 set fgetpos d_fgetpos
13001 : see if finite exists
13002 set finite d_finite
13005 : see if finitel exists
13006 set finitel d_finitel
13009 : see if flock exists
13013 : see if prototype for flock is available
13015 set d_flockproto flock $i_sysfile sys/file.h
13018 : see if fp_class exists
13019 set fp_class d_fp_class
13022 : see if pathconf exists
13023 set pathconf d_pathconf
13026 : see if fpathconf exists
13027 set fpathconf d_fpathconf
13030 : see if fpclass exists
13031 set fpclass d_fpclass
13034 : see if fpclassify exists
13035 set fpclassify d_fpclassify
13038 : see if fpclassl exists
13039 set fpclassl d_fpclassl
13043 : check for fpos64_t
13045 echo "Checking to see if you have fpos64_t..." >&4
13048 int main() { fpos64_t x = 7; }
13051 if eval $compile; then
13053 echo "You have fpos64_t."
13056 echo "You do not have fpos64_t."
13057 case "$fpossize" in
13058 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13065 : see if frexpl exists
13066 set frexpl d_frexpl
13069 : see if this is a sys/param system
13070 set sys/param.h i_sysparam
13073 : see if this is a sys/mount.h system
13074 set sys/mount.h i_sysmount
13079 echo "Checking to see if your system supports struct fs_data..." >&4
13080 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13082 case "$d_fs_data_s" in
13083 "$define") echo "Yes, it does." ;;
13084 *) echo "No, it doesn't." ;;
13087 : see if fseeko exists
13088 set fseeko d_fseeko
13090 case "$longsize" in
13091 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13094 : see if fsetpos exists
13095 set fsetpos d_fsetpos
13099 : see if fstatfs exists
13100 set fstatfs d_fstatfs
13104 : see if statvfs exists
13105 set statvfs d_statvfs
13108 : see if fstatvfs exists
13109 set fstatvfs d_fstatvfs
13113 : see if fsync exists
13117 : see if ftello exists
13118 set ftello d_ftello
13120 case "$longsize" in
13121 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13124 : check for a working futimes
13127 echo "Checking if you have a working futimes()" >&4
13130 #include <sys/time.h>
13137 fd = open ("try.c", O_RDWR);
13138 if (-1 == fd) exit (1);
13139 rv = futimes (fd, NULL);
13140 exit (rv == -1 ? errno : 0);
13144 if eval $compile; then
13148 0) echo "Yes, you have" >&4
13149 d_futimes="$define"
13151 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13155 echo "No, it does not (probably harmless)" >&4
13159 : see if getcwd exists
13160 set getcwd d_getcwd
13163 : see if getespwnam exists
13164 set getespwnam d_getespwnam
13168 : see if getfsstat exists
13169 set getfsstat d_getfsstat
13172 : see if getgrent exists
13173 set getgrent d_getgrent
13176 : see if getgrent_r exists
13177 set getgrent_r d_getgrent_r
13179 case "$d_getgrent_r" in
13181 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13182 case "$d_getgrent_r_proto:$usethreads" in
13183 ":define") d_getgrent_r_proto=define
13184 set d_getgrent_r_proto getgrent_r $hdrs
13188 case "$d_getgrent_r_proto" in
13190 case "$getgrent_r_proto" in
13191 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13192 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13194 case "$getgrent_r_proto" in
13195 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13196 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13198 case "$getgrent_r_proto" in
13199 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13200 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13202 case "$getgrent_r_proto" in
13203 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13204 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13206 case "$getgrent_r_proto" in
13207 ''|0) try='int getgrent_r(struct group*, char*, int);'
13208 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13210 case "$getgrent_r_proto" in
13211 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13212 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13214 case "$getgrent_r_proto" in
13215 ''|0) d_getgrent_r=undef
13217 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13218 * ) case "$getgrent_r_proto" in
13219 REENTRANT_PROTO*) ;;
13220 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13222 echo "Prototype: $try" ;;
13225 *) case "$usethreads" in
13226 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13233 *) getgrent_r_proto=0
13237 : see if getgrgid_r exists
13238 set getgrgid_r d_getgrgid_r
13240 case "$d_getgrgid_r" in
13242 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13243 case "$d_getgrgid_r_proto:$usethreads" in
13244 ":define") d_getgrgid_r_proto=define
13245 set d_getgrgid_r_proto getgrgid_r $hdrs
13249 case "$d_getgrgid_r_proto" in
13251 case "$getgrgid_r_proto" in
13252 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13253 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13255 case "$getgrgid_r_proto" in
13256 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13257 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13259 case "$getgrgid_r_proto" in
13260 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13261 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13263 case "$getgrgid_r_proto" in
13264 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13265 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13267 case "$getgrgid_r_proto" in
13268 ''|0) d_getgrgid_r=undef
13270 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13271 * ) case "$getgrgid_r_proto" in
13272 REENTRANT_PROTO*) ;;
13273 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13275 echo "Prototype: $try" ;;
13278 *) case "$usethreads" in
13279 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13286 *) getgrgid_r_proto=0
13290 : see if getgrnam_r exists
13291 set getgrnam_r d_getgrnam_r
13293 case "$d_getgrnam_r" in
13295 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13296 case "$d_getgrnam_r_proto:$usethreads" in
13297 ":define") d_getgrnam_r_proto=define
13298 set d_getgrnam_r_proto getgrnam_r $hdrs
13302 case "$d_getgrnam_r_proto" in
13304 case "$getgrnam_r_proto" in
13305 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13306 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13308 case "$getgrnam_r_proto" in
13309 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13310 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13312 case "$getgrnam_r_proto" in
13313 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13314 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13316 case "$getgrnam_r_proto" in
13317 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13318 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13320 case "$getgrnam_r_proto" in
13321 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13322 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13324 case "$getgrnam_r_proto" in
13325 ''|0) d_getgrnam_r=undef
13327 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13328 * ) case "$getgrnam_r_proto" in
13329 REENTRANT_PROTO*) ;;
13330 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13332 echo "Prototype: $try" ;;
13335 *) case "$usethreads" in
13336 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13343 *) getgrnam_r_proto=0
13347 : see if gethostbyaddr exists
13348 set gethostbyaddr d_gethbyaddr
13351 : see if gethostbyname exists
13352 set gethostbyname d_gethbyname
13355 : see if gethostent exists
13356 set gethostent d_gethent
13359 : see how we will look up host name
13362 if set gethostname val -f d_gethname; eval $csym; $val; then
13363 echo 'gethostname() found.' >&4
13364 d_gethname="$define"
13367 if set uname val -f d_uname; eval $csym; $val; then
13370 uname() was found, but you're running xenix, and older versions of xenix
13371 have a broken uname(). If you don't really know whether your xenix is old
13372 enough to have a broken system call, use the default answer.
13377 "$define") dflt=n;;
13379 rp='Is your uname() broken?'
13382 n*) d_uname="$define"; call=uname;;
13385 echo 'uname() found.' >&4
13392 case "$d_gethname" in
13393 '') d_gethname="$undef";;
13396 '') d_uname="$undef";;
13398 case "$d_uname$d_gethname" in
13403 Every now and then someone has a $call() that lies about the hostname
13404 but can't be fixed for political or economic reasons. If you wish, I can
13405 pretend $call() isn't there and maybe compute hostname at run-time
13406 thanks to the '$phostname' command.
13409 rp="Shall I ignore $call() from now on?"
13412 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13415 case "$phostname" in
13416 '') aphostname='';;
13417 *) case "$aphostname" in
13419 *) set X $phostname
13423 file=`./loc $file $file $pth`
13424 aphostname=`echo $file $*`
13429 case "$d_uname$d_gethname" in
13432 case "$phostname" in
13434 echo "There will be no way for $package to get your hostname." >&4;;
13436 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13440 case "$d_phostname" in
13441 '') d_phostname="$undef";;
13444 : see if gethostbyaddr_r exists
13445 set gethostbyaddr_r d_gethostbyaddr_r
13447 case "$d_gethostbyaddr_r" in
13449 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13450 case "$d_gethostbyaddr_r_proto:$usethreads" in
13451 ":define") d_gethostbyaddr_r_proto=define
13452 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13456 case "$d_gethostbyaddr_r_proto" in
13458 case "$gethostbyaddr_r_proto" in
13459 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13460 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13462 case "$gethostbyaddr_r_proto" in
13463 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13464 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13466 case "$gethostbyaddr_r_proto" in
13467 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13468 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13470 case "$gethostbyaddr_r_proto" in
13471 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13472 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13474 case "$gethostbyaddr_r_proto" in
13475 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13476 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13478 case "$gethostbyaddr_r_proto" in
13479 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13480 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13482 case "$gethostbyaddr_r_proto" in
13483 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13484 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13486 case "$gethostbyaddr_r_proto" in
13487 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13488 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13490 case "$gethostbyaddr_r_proto" in
13491 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13492 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13494 case "$gethostbyaddr_r_proto" in
13495 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13496 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13498 case "$gethostbyaddr_r_proto" in
13499 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13500 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13502 case "$gethostbyaddr_r_proto" in
13503 ''|0) d_gethostbyaddr_r=undef
13504 gethostbyaddr_r_proto=0
13505 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13506 * ) case "$gethostbyaddr_r_proto" in
13507 REENTRANT_PROTO*) ;;
13508 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13510 echo "Prototype: $try" ;;
13513 *) case "$usethreads" in
13514 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13516 d_gethostbyaddr_r=undef
13517 gethostbyaddr_r_proto=0
13521 *) gethostbyaddr_r_proto=0
13525 : see if gethostbyname_r exists
13526 set gethostbyname_r d_gethostbyname_r
13528 case "$d_gethostbyname_r" in
13530 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13531 case "$d_gethostbyname_r_proto:$usethreads" in
13532 ":define") d_gethostbyname_r_proto=define
13533 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13537 case "$d_gethostbyname_r_proto" in
13539 case "$gethostbyname_r_proto" in
13540 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13541 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13543 case "$gethostbyname_r_proto" in
13544 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13545 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13547 case "$gethostbyname_r_proto" in
13548 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13549 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13551 case "$gethostbyname_r_proto" in
13552 ''|0) d_gethostbyname_r=undef
13553 gethostbyname_r_proto=0
13554 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13555 * ) case "$gethostbyname_r_proto" in
13556 REENTRANT_PROTO*) ;;
13557 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13559 echo "Prototype: $try" ;;
13562 *) case "$usethreads" in
13563 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13565 d_gethostbyname_r=undef
13566 gethostbyname_r_proto=0
13570 *) gethostbyname_r_proto=0
13574 : see if gethostent_r exists
13575 set gethostent_r d_gethostent_r
13577 case "$d_gethostent_r" in
13579 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13580 case "$d_gethostent_r_proto:$usethreads" in
13581 ":define") d_gethostent_r_proto=define
13582 set d_gethostent_r_proto gethostent_r $hdrs
13586 case "$d_gethostent_r_proto" in
13588 case "$gethostent_r_proto" in
13589 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13590 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13592 case "$gethostent_r_proto" in
13593 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13594 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13596 case "$gethostent_r_proto" in
13597 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13598 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13600 case "$gethostent_r_proto" in
13601 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13602 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13604 case "$gethostent_r_proto" in
13605 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13606 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13608 case "$gethostent_r_proto" in
13609 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13610 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13612 case "$gethostent_r_proto" in
13613 ''|0) d_gethostent_r=undef
13614 gethostent_r_proto=0
13615 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13616 * ) case "$gethostent_r_proto" in
13617 REENTRANT_PROTO*) ;;
13618 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13620 echo "Prototype: $try" ;;
13623 *) case "$usethreads" in
13624 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13626 d_gethostent_r=undef
13627 gethostent_r_proto=0
13631 *) gethostent_r_proto=0
13635 : see if prototypes for various gethostxxx netdb.h functions are available
13637 set d_gethostprotos gethostent $i_netdb netdb.h
13640 : see if getitimer exists
13641 set getitimer d_getitimer
13644 : see if getlogin exists
13645 set getlogin d_getlogin
13648 : see if getlogin_r exists
13649 set getlogin_r d_getlogin_r
13651 case "$d_getlogin_r" in
13653 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13654 case "$d_getlogin_r_proto:$usethreads" in
13655 ":define") d_getlogin_r_proto=define
13656 set d_getlogin_r_proto getlogin_r $hdrs
13660 case "$d_getlogin_r_proto" in
13662 case "$getlogin_r_proto" in
13663 ''|0) try='int getlogin_r(char*, size_t);'
13664 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13666 case "$getlogin_r_proto" in
13667 ''|0) try='int getlogin_r(char*, int);'
13668 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13670 case "$getlogin_r_proto" in
13671 ''|0) try='char* getlogin_r(char*, size_t);'
13672 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13674 case "$getlogin_r_proto" in
13675 ''|0) try='char* getlogin_r(char*, int);'
13676 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13678 case "$getlogin_r_proto" in
13679 ''|0) d_getlogin_r=undef
13681 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13682 * ) case "$getlogin_r_proto" in
13683 REENTRANT_PROTO*) ;;
13684 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13686 echo "Prototype: $try" ;;
13689 *) case "$usethreads" in
13690 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13697 *) getlogin_r_proto=0
13701 : see if getmnt exists
13702 set getmnt d_getmnt
13705 : see if getmntent exists
13706 set getmntent d_getmntent
13709 : see if getnetbyaddr exists
13710 set getnetbyaddr d_getnbyaddr
13713 : see if getnetbyname exists
13714 set getnetbyname d_getnbyname
13717 : see if getnetent exists
13718 set getnetent d_getnent
13721 : see if getnetbyaddr_r exists
13722 set getnetbyaddr_r d_getnetbyaddr_r
13724 case "$d_getnetbyaddr_r" in
13726 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13727 case "$d_getnetbyaddr_r_proto:$usethreads" in
13728 ":define") d_getnetbyaddr_r_proto=define
13729 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13733 case "$d_getnetbyaddr_r_proto" in
13735 case "$getnetbyaddr_r_proto" in
13736 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13737 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13739 case "$getnetbyaddr_r_proto" in
13740 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13741 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13743 case "$getnetbyaddr_r_proto" in
13744 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13745 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13747 case "$getnetbyaddr_r_proto" in
13748 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13749 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13751 case "$getnetbyaddr_r_proto" in
13752 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13753 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13755 case "$getnetbyaddr_r_proto" in
13756 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13757 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13759 case "$getnetbyaddr_r_proto" in
13760 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13761 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13763 case "$getnetbyaddr_r_proto" in
13764 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13765 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13767 case "$getnetbyaddr_r_proto" in
13768 ''|0) d_getnetbyaddr_r=undef
13769 getnetbyaddr_r_proto=0
13770 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13771 * ) case "$getnetbyaddr_r_proto" in
13772 REENTRANT_PROTO*) ;;
13773 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13775 echo "Prototype: $try" ;;
13778 *) case "$usethreads" in
13779 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13781 d_getnetbyaddr_r=undef
13782 getnetbyaddr_r_proto=0
13786 *) getnetbyaddr_r_proto=0
13790 : see if getnetbyname_r exists
13791 set getnetbyname_r d_getnetbyname_r
13793 case "$d_getnetbyname_r" in
13795 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13796 case "$d_getnetbyname_r_proto:$usethreads" in
13797 ":define") d_getnetbyname_r_proto=define
13798 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13802 case "$d_getnetbyname_r_proto" in
13804 case "$getnetbyname_r_proto" in
13805 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13806 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13808 case "$getnetbyname_r_proto" in
13809 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13810 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13812 case "$getnetbyname_r_proto" in
13813 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13814 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13816 case "$getnetbyname_r_proto" in
13817 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13818 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13820 case "$getnetbyname_r_proto" in
13821 ''|0) d_getnetbyname_r=undef
13822 getnetbyname_r_proto=0
13823 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13824 * ) case "$getnetbyname_r_proto" in
13825 REENTRANT_PROTO*) ;;
13826 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13828 echo "Prototype: $try" ;;
13831 *) case "$usethreads" in
13832 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13834 d_getnetbyname_r=undef
13835 getnetbyname_r_proto=0
13839 *) getnetbyname_r_proto=0
13843 : see if getnetent_r exists
13844 set getnetent_r d_getnetent_r
13846 case "$d_getnetent_r" in
13848 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13849 case "$d_getnetent_r_proto:$usethreads" in
13850 ":define") d_getnetent_r_proto=define
13851 set d_getnetent_r_proto getnetent_r $hdrs
13855 case "$d_getnetent_r_proto" in
13857 case "$getnetent_r_proto" in
13858 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13859 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13861 case "$getnetent_r_proto" in
13862 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13863 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13865 case "$getnetent_r_proto" in
13866 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13867 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13869 case "$getnetent_r_proto" in
13870 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13871 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13873 case "$getnetent_r_proto" in
13874 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13875 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13877 case "$getnetent_r_proto" in
13878 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13879 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13881 case "$getnetent_r_proto" in
13882 ''|0) d_getnetent_r=undef
13883 getnetent_r_proto=0
13884 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13885 * ) case "$getnetent_r_proto" in
13886 REENTRANT_PROTO*) ;;
13887 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13889 echo "Prototype: $try" ;;
13892 *) case "$usethreads" in
13893 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13895 d_getnetent_r=undef
13896 getnetent_r_proto=0
13900 *) getnetent_r_proto=0
13904 : see if prototypes for various getnetxxx netdb.h functions are available
13906 set d_getnetprotos getnetent $i_netdb netdb.h
13909 : see if getpagesize exists
13910 set getpagesize d_getpagsz
13914 : see if getprotobyname exists
13915 set getprotobyname d_getpbyname
13918 : see if getprotobynumber exists
13919 set getprotobynumber d_getpbynumber
13922 : see if getprotoent exists
13923 set getprotoent d_getpent
13926 : see if getpgid exists
13927 set getpgid d_getpgid
13930 : see if getpgrp2 exists
13931 set getpgrp2 d_getpgrp2
13934 : see if getppid exists
13935 set getppid d_getppid
13938 : see if getpriority exists
13939 set getpriority d_getprior
13942 : see if getprotobyname_r exists
13943 set getprotobyname_r d_getprotobyname_r
13945 case "$d_getprotobyname_r" in
13947 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13948 case "$d_getprotobyname_r_proto:$usethreads" in
13949 ":define") d_getprotobyname_r_proto=define
13950 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13954 case "$d_getprotobyname_r_proto" in
13956 case "$getprotobyname_r_proto" in
13957 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13958 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13960 case "$getprotobyname_r_proto" in
13961 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13962 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13964 case "$getprotobyname_r_proto" in
13965 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13966 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13968 case "$getprotobyname_r_proto" in
13969 ''|0) d_getprotobyname_r=undef
13970 getprotobyname_r_proto=0
13971 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13972 * ) case "$getprotobyname_r_proto" in
13973 REENTRANT_PROTO*) ;;
13974 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13976 echo "Prototype: $try" ;;
13979 *) case "$usethreads" in
13980 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13982 d_getprotobyname_r=undef
13983 getprotobyname_r_proto=0
13987 *) getprotobyname_r_proto=0
13991 : see if getprotobynumber_r exists
13992 set getprotobynumber_r d_getprotobynumber_r
13994 case "$d_getprotobynumber_r" in
13996 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13997 case "$d_getprotobynumber_r_proto:$usethreads" in
13998 ":define") d_getprotobynumber_r_proto=define
13999 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14003 case "$d_getprotobynumber_r_proto" in
14005 case "$getprotobynumber_r_proto" in
14006 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14007 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14009 case "$getprotobynumber_r_proto" in
14010 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14011 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14013 case "$getprotobynumber_r_proto" in
14014 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14015 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14017 case "$getprotobynumber_r_proto" in
14018 ''|0) d_getprotobynumber_r=undef
14019 getprotobynumber_r_proto=0
14020 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14021 * ) case "$getprotobynumber_r_proto" in
14022 REENTRANT_PROTO*) ;;
14023 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14025 echo "Prototype: $try" ;;
14028 *) case "$usethreads" in
14029 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14031 d_getprotobynumber_r=undef
14032 getprotobynumber_r_proto=0
14036 *) getprotobynumber_r_proto=0
14040 : see if getprotoent_r exists
14041 set getprotoent_r d_getprotoent_r
14043 case "$d_getprotoent_r" in
14045 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14046 case "$d_getprotoent_r_proto:$usethreads" in
14047 ":define") d_getprotoent_r_proto=define
14048 set d_getprotoent_r_proto getprotoent_r $hdrs
14052 case "$d_getprotoent_r_proto" in
14054 case "$getprotoent_r_proto" in
14055 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14056 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14058 case "$getprotoent_r_proto" in
14059 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14060 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14062 case "$getprotoent_r_proto" in
14063 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14064 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14066 case "$getprotoent_r_proto" in
14067 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14068 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14070 case "$getprotoent_r_proto" in
14071 ''|0) d_getprotoent_r=undef
14072 getprotoent_r_proto=0
14073 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14074 * ) case "$getprotoent_r_proto" in
14075 REENTRANT_PROTO*) ;;
14076 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14078 echo "Prototype: $try" ;;
14081 *) case "$usethreads" in
14082 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14084 d_getprotoent_r=undef
14085 getprotoent_r_proto=0
14089 *) getprotoent_r_proto=0
14093 : see if prototypes for various getprotoxxx netdb.h functions are available
14095 set d_getprotoprotos getprotoent $i_netdb netdb.h
14098 : see if getprpwnam exists
14099 set getprpwnam d_getprpwnam
14102 : see if getpwent exists
14103 set getpwent d_getpwent
14106 : see if getpwent_r exists
14107 set getpwent_r d_getpwent_r
14109 case "$d_getpwent_r" in
14111 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14112 case "$d_getpwent_r_proto:$usethreads" in
14113 ":define") d_getpwent_r_proto=define
14114 set d_getpwent_r_proto getpwent_r $hdrs
14118 case "$d_getpwent_r_proto" in
14120 case "$getpwent_r_proto" in
14121 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14122 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14124 case "$getpwent_r_proto" in
14125 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14126 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14128 case "$getpwent_r_proto" in
14129 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14130 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14132 case "$getpwent_r_proto" in
14133 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14134 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14136 case "$getpwent_r_proto" in
14137 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14138 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14140 case "$getpwent_r_proto" in
14141 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14142 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14144 case "$getpwent_r_proto" in
14145 ''|0) d_getpwent_r=undef
14147 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14148 * ) case "$getpwent_r_proto" in
14149 REENTRANT_PROTO*) ;;
14150 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14152 echo "Prototype: $try" ;;
14155 *) case "$usethreads" in
14156 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14163 *) getpwent_r_proto=0
14167 : see if getpwnam_r exists
14168 set getpwnam_r d_getpwnam_r
14170 case "$d_getpwnam_r" in
14172 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14173 case "$d_getpwnam_r_proto:$usethreads" in
14174 ":define") d_getpwnam_r_proto=define
14175 set d_getpwnam_r_proto getpwnam_r $hdrs
14179 case "$d_getpwnam_r_proto" in
14181 case "$getpwnam_r_proto" in
14182 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14183 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14185 case "$getpwnam_r_proto" in
14186 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14187 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14189 case "$getpwnam_r_proto" in
14190 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14191 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14193 case "$getpwnam_r_proto" in
14194 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14195 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14197 case "$getpwnam_r_proto" in
14198 ''|0) d_getpwnam_r=undef
14200 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14201 * ) case "$getpwnam_r_proto" in
14202 REENTRANT_PROTO*) ;;
14203 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14205 echo "Prototype: $try" ;;
14208 *) case "$usethreads" in
14209 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14216 *) getpwnam_r_proto=0
14220 : see if getpwuid_r exists
14221 set getpwuid_r d_getpwuid_r
14223 case "$d_getpwuid_r" in
14225 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14226 case "$d_getpwuid_r_proto:$usethreads" in
14227 ":define") d_getpwuid_r_proto=define
14228 set d_getpwuid_r_proto getpwuid_r $hdrs
14232 case "$d_getpwuid_r_proto" in
14234 case "$getpwuid_r_proto" in
14235 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14236 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14238 case "$getpwuid_r_proto" in
14239 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14240 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14242 case "$getpwuid_r_proto" in
14243 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14244 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14246 case "$getpwuid_r_proto" in
14247 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14248 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14250 case "$getpwuid_r_proto" in
14251 ''|0) d_getpwuid_r=undef
14253 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14254 * ) case "$getpwuid_r_proto" in
14255 REENTRANT_PROTO*) ;;
14256 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14258 echo "Prototype: $try" ;;
14261 *) case "$usethreads" in
14262 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14269 *) getpwuid_r_proto=0
14274 : see if getservbyname exists
14275 set getservbyname d_getsbyname
14278 : see if getservbyport exists
14279 set getservbyport d_getsbyport
14282 : see if getservent exists
14283 set getservent d_getsent
14286 : see if getservbyname_r exists
14287 set getservbyname_r d_getservbyname_r
14289 case "$d_getservbyname_r" in
14291 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14292 case "$d_getservbyname_r_proto:$usethreads" in
14293 ":define") d_getservbyname_r_proto=define
14294 set d_getservbyname_r_proto getservbyname_r $hdrs
14298 case "$d_getservbyname_r_proto" in
14300 case "$getservbyname_r_proto" in
14301 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14302 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14304 case "$getservbyname_r_proto" in
14305 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14306 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14308 case "$getservbyname_r_proto" in
14309 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14310 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14312 case "$getservbyname_r_proto" in
14313 ''|0) d_getservbyname_r=undef
14314 getservbyname_r_proto=0
14315 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14316 * ) case "$getservbyname_r_proto" in
14317 REENTRANT_PROTO*) ;;
14318 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14320 echo "Prototype: $try" ;;
14323 *) case "$usethreads" in
14324 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14326 d_getservbyname_r=undef
14327 getservbyname_r_proto=0
14331 *) getservbyname_r_proto=0
14335 : see if getservbyport_r exists
14336 set getservbyport_r d_getservbyport_r
14338 case "$d_getservbyport_r" in
14340 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14341 case "$d_getservbyport_r_proto:$usethreads" in
14342 ":define") d_getservbyport_r_proto=define
14343 set d_getservbyport_r_proto getservbyport_r $hdrs
14347 case "$d_getservbyport_r_proto" in
14349 case "$getservbyport_r_proto" in
14350 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14351 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14353 case "$getservbyport_r_proto" in
14354 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14355 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14357 case "$getservbyport_r_proto" in
14358 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14359 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14361 case "$getservbyport_r_proto" in
14362 ''|0) d_getservbyport_r=undef
14363 getservbyport_r_proto=0
14364 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14365 * ) case "$getservbyport_r_proto" in
14366 REENTRANT_PROTO*) ;;
14367 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14369 echo "Prototype: $try" ;;
14372 *) case "$usethreads" in
14373 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14375 d_getservbyport_r=undef
14376 getservbyport_r_proto=0
14380 *) getservbyport_r_proto=0
14384 : see if getservent_r exists
14385 set getservent_r d_getservent_r
14387 case "$d_getservent_r" in
14389 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14390 case "$d_getservent_r_proto:$usethreads" in
14391 ":define") d_getservent_r_proto=define
14392 set d_getservent_r_proto getservent_r $hdrs
14396 case "$d_getservent_r_proto" in
14398 case "$getservent_r_proto" in
14399 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14400 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14402 case "$getservent_r_proto" in
14403 ''|0) try='int getservent_r(struct servent*, char*, int);'
14404 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14406 case "$getservent_r_proto" in
14407 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14408 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14410 case "$getservent_r_proto" in
14411 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14412 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14414 case "$getservent_r_proto" in
14415 ''|0) d_getservent_r=undef
14416 getservent_r_proto=0
14417 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14418 * ) case "$getservent_r_proto" in
14419 REENTRANT_PROTO*) ;;
14420 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14422 echo "Prototype: $try" ;;
14425 *) case "$usethreads" in
14426 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14428 d_getservent_r=undef
14429 getservent_r_proto=0
14433 *) getservent_r_proto=0
14437 : see if prototypes for various getservxxx netdb.h functions are available
14439 set d_getservprotos getservent $i_netdb netdb.h
14442 : see if getspnam exists
14443 set getspnam d_getspnam
14446 : see if this is a shadow.h system
14447 set shadow.h i_shadow
14450 : see if getspnam_r exists
14451 set getspnam_r d_getspnam_r
14453 case "$d_getspnam_r" in
14455 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14456 case "$d_getspnam_r_proto:$usethreads" in
14457 ":define") d_getspnam_r_proto=define
14458 set d_getspnam_r_proto getspnam_r $hdrs
14462 case "$d_getspnam_r_proto" in
14464 case "$getspnam_r_proto" in
14465 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14466 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14468 case "$getspnam_r_proto" in
14469 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14470 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14472 case "$getspnam_r_proto" in
14473 ''|0) d_getspnam_r=undef
14475 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14476 * ) case "$getspnam_r_proto" in
14477 REENTRANT_PROTO*) ;;
14478 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14480 echo "Prototype: $try" ;;
14483 *) case "$usethreads" in
14484 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14491 *) getspnam_r_proto=0
14495 : see if gettimeofday or ftime exists
14496 set gettimeofday d_gettimeod
14498 case "$d_gettimeod" in
14504 val="$undef"; set d_ftime; eval $setvar
14507 case "$d_gettimeod$d_ftime" in
14510 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14514 : see if gmtime_r exists
14515 set gmtime_r d_gmtime_r
14517 case "$d_gmtime_r" in
14519 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14520 case "$d_gmtime_r_proto:$usethreads" in
14521 ":define") d_gmtime_r_proto=define
14522 set d_gmtime_r_proto gmtime_r $hdrs
14526 case "$d_gmtime_r_proto" in
14528 case "$gmtime_r_proto" in
14529 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14530 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14532 case "$gmtime_r_proto" in
14533 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14534 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14536 case "$gmtime_r_proto" in
14537 ''|0) d_gmtime_r=undef
14539 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14540 * ) case "$gmtime_r_proto" in
14541 REENTRANT_PROTO*) ;;
14542 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14544 echo "Prototype: $try" ;;
14547 *) case "$usethreads" in
14548 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14555 *) gmtime_r_proto=0
14559 : see if hasmntopt exists
14560 set hasmntopt d_hasmntopt
14563 : see if this is a netinet/in.h or sys/in.h system
14564 set netinet/in.h i_niin sys/in.h i_sysin
14567 : see if arpa/inet.h has to be included
14568 set arpa/inet.h i_arpainet
14571 : see if htonl --and friends-- exists
14576 : Maybe they are macros.
14579 $cat >htonl.c <<EOM
14581 #include <sys/types.h>
14582 #$i_niin I_NETINET_IN
14584 #$i_arpainet I_ARPA_INET
14585 #ifdef I_NETINET_IN
14586 #include <netinet/in.h>
14589 #include <sys/in.h>
14592 #include <arpa/inet.h>
14595 printf("Defined as a macro.");
14598 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14599 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14601 echo "But it seems to be defined as a macro." >&4
14609 : see if ilogbl exists
14610 set ilogbl d_ilogbl
14615 if set index val -f; eval $csym; $val; then
14616 if set strchr val -f d_strchr; eval $csym; $val; then
14617 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14620 echo "strchr() found." >&4
14624 echo "index() found." >&4
14629 echo "index() found." >&4
14632 if set strchr val -f d_strchr; eval $csym; $val; then
14635 echo "strchr() found." >&4
14637 echo "No index() or strchr() found!" >&4
14642 set d_strchr; eval $setvar
14644 set d_index; eval $setvar
14646 : check whether inet_aton exists
14647 set inet_aton d_inetaton
14652 $cat >isascii.c <<EOCP
14655 #$i_stdlib I_STDLIB
14657 #include <stdlib.h>
14668 if eval $compile; then
14669 echo "isascii() found." >&4
14672 echo "isascii() NOT found." >&4
14679 : see if isfinite exists
14680 set isfinite d_isfinite
14683 : see if isinf exists
14687 : see if isnan exists
14691 : see if isnanl exists
14692 set isnanl d_isnanl
14695 : see if killpg exists
14696 set killpg d_killpg
14699 : see if lchown exists
14701 $cat > try.c <<'EOCP'
14702 /* System header to define __stub macros and hopefully few prototypes,
14703 which can conflict with char lchown(); below. */
14704 #include <assert.h>
14705 /* Override any gcc2 internal prototype to avoid an error. */
14706 /* We use char because int might match the return type of a gcc2
14707 builtin and then its argument prototype would still apply. */
14710 /* The GNU C library defines this for functions which it implements
14711 to always fail with ENOSYS. Some functions are actually named
14712 something starting with __ and the normal name is an alias. */
14713 #if defined (__stub_lchown) || defined (__stub___lchown)
14721 if eval $compile; then
14722 $echo "lchown() found." >&4
14725 $echo "lchown() NOT found." >&4
14731 : See if number of significant digits in a double precision number is known
14733 $cat >ldbl_dig.c <<EOM
14734 #$i_limits I_LIMITS
14737 #include <limits.h>
14743 printf("Contains LDBL_DIG");
14746 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14747 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14748 echo "LDBL_DIG found." >&4
14751 echo "LDBL_DIG NOT found." >&4
14758 : see if this is a math.h system
14762 : check to see if math.h defines _LIB_VERSION
14763 d_libm_lib_version="$undef"
14767 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14769 #include <unistd.h>
14771 int main (int argc, char *argv[])
14773 printf ("%d\n", _LIB_VERSION);
14778 if eval $compile; then
14780 echo "Yes, it does ($foo)" >&4
14781 d_libm_lib_version="$define"
14783 echo "No, it does not (probably harmless)" >&4
14790 : see if link exists
14794 : see if localtime_r exists
14795 set localtime_r d_localtime_r
14797 case "$d_localtime_r" in
14799 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14800 case "$d_localtime_r_proto:$usethreads" in
14801 ":define") d_localtime_r_proto=define
14802 set d_localtime_r_proto localtime_r $hdrs
14806 case "$d_localtime_r_proto" in
14808 case "$localtime_r_proto" in
14809 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14810 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14812 case "$localtime_r_proto" in
14813 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14814 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14816 case "$localtime_r_proto" in
14817 ''|0) d_localtime_r=undef
14818 localtime_r_proto=0
14819 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14820 * ) case "$localtime_r_proto" in
14821 REENTRANT_PROTO*) ;;
14822 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14824 echo "Prototype: $try" ;;
14827 *) case "$usethreads" in
14828 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14830 d_localtime_r=undef
14831 localtime_r_proto=0
14835 *) localtime_r_proto=0
14839 : see if localtime_r calls tzset
14840 case "$localtime_r_proto" in
14843 /* Does our libc's localtime_r call tzset ?
14844 * return 0 if so, 1 otherwise.
14846 #include <sys/types.h>
14847 #include <unistd.h>
14849 #include <string.h>
14850 #include <malloc.h>
14853 time_t t = time(0L);
14854 char w_tz[]="TZ" "=GMT+5",
14855 e_tz[]="TZ" "=GMT-5",
14856 *tz_e = (char*)malloc(16),
14857 *tz_w = (char*)malloc(16);
14858 struct tm tm_e, tm_w;
14859 memset(&tm_e,'\0',sizeof(struct tm));
14860 memset(&tm_w,'\0',sizeof(struct tm));
14865 localtime_r(&t, &tm_e);
14868 localtime_r(&t, &tm_w);
14870 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14876 if eval $compile; then
14877 if $run ./try; then
14878 d_localtime_r_needs_tzset=undef;
14880 d_localtime_r_needs_tzset=define;
14883 d_localtime_r_needs_tzset=undef;
14887 d_localtime_r_needs_tzset=undef;
14892 : see if localeconv exists
14893 set localeconv d_locconv
14896 : see if lockf exists
14900 : see if prototype for lseek is available
14902 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14905 : see if lstat exists
14909 : see if madvise exists
14910 set madvise d_madvise
14913 : see if malloc_size exists
14914 set malloc_size d_malloc_size
14917 : see if malloc_size_good exists
14918 set malloc_good_size d_malloc_good_size
14921 : see if mblen exists
14925 : see if mbstowcs exists
14926 set mbstowcs d_mbstowcs
14929 : see if mbtowc exists
14930 set mbtowc d_mbtowc
14933 : see if memchr exists
14934 set memchr d_memchr
14937 : see if memcmp exists
14938 set memcmp d_memcmp
14941 : see if memcpy exists
14942 set memcpy d_memcpy
14945 : see if memmove exists
14946 set memmove d_memmove
14949 : see if memset exists
14950 set memset d_memset
14953 : see if mkdir exists
14957 : see if mkdtemp exists
14958 set mkdtemp d_mkdtemp
14961 : see if mkfifo exists
14962 set mkfifo d_mkfifo
14965 : see if mkstemp exists
14966 set mkstemp d_mkstemp
14969 : see if mkstemps exists
14970 set mkstemps d_mkstemps
14973 : see if mktime exists
14974 set mktime d_mktime
14977 : see if this is a sys/mman.h system
14978 set sys/mman.h i_sysmman
14981 : see if mmap exists
14984 : see what shmat returns
14985 : default to something harmless
14987 case "$i_sysmman$d_mmap" in
14989 $cat >mmap.c <<'END'
14990 #include <sys/mman.h>
14993 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14998 echo "and it returns ($mmaptype)." >&4
15004 : see if sqrtl exists
15008 : see if scalbnl exists
15009 set scalbnl d_scalbnl
15012 : see if modfl exists
15016 : see if prototype for modfl is available
15018 set d_modflproto modfl $i_math math.h
15021 d_modfl_pow32_bug="$undef"
15023 case "$d_longdbl$d_modfl" in
15026 Checking to see whether your modfl() is okay for large values...
15032 if $test "X$d_modflproto" != "X$define"; then
15033 $cat >>try.c <<EOCP
15034 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15035 long double modfl (long double, long double *);
15038 $cat >>try.c <<EOCP
15040 long double nv = 4294967303.15;
15046 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15050 case "$osname:$gccversion" in
15051 aix:) saveccflags="$ccflags"
15052 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15055 if eval $compile; then
15058 *" 4294967303.150000 1.150000 4294967302.000000")
15059 echo >&4 "Your modfl() is broken for large values."
15060 d_modfl_pow32_bug="$define"
15062 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15066 *" 4294967303.150000 0.150000 4294967303.000000")
15067 echo >&4 "Your modfl() seems okay for large values."
15069 *) echo >&4 "I don't understand your modfl() at all."
15075 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15078 case "$osname:$gccversion" in
15079 aix:) ccflags="$saveccflags" ;; # restore
15084 if $test "$uselongdouble" = "$define"; then
15086 if $test "$d_sqrtl" != "$define"; then
15087 message="$message sqrtl"
15089 if $test "$d_modfl" != "$define"; then
15090 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15091 echo "You have both aintl and copysignl, so I can emulate modfl."
15093 message="$message modfl"
15096 if $test "$d_frexpl" != "$define"; then
15097 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15098 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15100 message="$message frexpl"
15104 if $test "$message" != ""; then
15107 *** You requested the use of long doubles but you do not seem to have
15108 *** the following mathematical functions needed for long double support:
15110 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15111 *** Cannot continue, aborting.
15119 : see if mprotect exists
15120 set mprotect d_mprotect
15123 : see if msgctl exists
15124 set msgctl d_msgctl
15127 : see if msgget exists
15128 set msgget d_msgget
15131 : see if msgsnd exists
15132 set msgsnd d_msgsnd
15135 : see if msgrcv exists
15136 set msgrcv d_msgrcv
15139 : see how much of the 'msg*(2)' library is present.
15142 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15143 *"$undef"*) h_msg=false;;
15147 case "`ipcs 2>&1`" in
15148 "SVID messages"*"not configured"*)
15149 echo "Your $osname does not have the msg*(2) configured." >&4
15152 set msgctl d_msgctl
15154 set msgget d_msgget
15156 set msgsnd d_msgsnd
15158 set msgrcv d_msgrcv
15164 : we could also check for sys/ipc.h ...
15165 if $h_msg && $test `./findhdr sys/msg.h`; then
15166 echo "You have the full msg*(2) library." >&4
15169 echo "You don't have the full msg*(2) library." >&4
15177 echo "Checking to see if your system supports struct msghdr..." >&4
15178 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15180 case "$d_msghdr_s" in
15181 "$define") echo "Yes, it does." ;;
15182 *) echo "No, it doesn't." ;;
15186 : see if msync exists
15190 : see if munmap exists
15191 set munmap d_munmap
15194 : see if nice exists
15198 : see if this is a langinfo.h system
15199 set langinfo.h i_langinfo
15202 : see if nl_langinfo exists
15203 set nl_langinfo d_nl_langinfo
15206 : check for volatile keyword
15208 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15209 $cat >try.c <<'EOCP'
15212 typedef struct _goo_struct goo_struct;
15213 goo_struct * volatile goo = ((goo_struct *)0);
15214 struct _goo_struct {
15219 typedef unsigned short foo_t;
15220 char *volatile foo;
15222 volatile foo_t blech;
15226 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15228 echo "Yup, it does."
15231 echo "Nope, it doesn't."
15237 : Check basic sizes
15239 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15241 case "$use64bitint:$d_quad:$quadtype" in
15244 uvtype="$uquadtype"
15249 uvtype="unsigned long"
15255 case "$uselongdouble:$d_longdbl" in
15257 nvtype="long double"
15258 nvsize=$longdblsize
15265 $echo "(IV will be "$ivtype", $ivsize bytes)"
15266 $echo "(UV will be "$uvtype", $uvsize bytes)"
15267 $echo "(NV will be "$nvtype", $nvsize bytes)"
15270 #$i_inttypes I_INTTYPES
15272 #include <inttypes.h>
15277 int8_t i = INT8_MAX;
15278 uint8_t u = UINT8_MAX;
15279 printf("int8_t\n");
15282 int16_t i = INT16_MAX;
15283 uint16_t i = UINT16_MAX;
15284 printf("int16_t\n");
15287 int32_t i = INT32_MAX;
15288 uint32_t u = UINT32_MAX;
15289 printf("int32_t\n");
15294 i8type="signed char"
15295 u8type="unsigned char"
15300 '') case "$shortsize" in
15302 u16type="unsigned short"
15310 '') set try -DINT16
15311 if eval $compile; then
15312 case "`$run ./try`" in
15324 '') if $test $shortsize -ge 2; then
15326 u16type="unsigned short"
15334 '') case "$longsize" in
15336 u32type="unsigned long"
15340 *) case "$intsize" in
15342 u32type="unsigned int"
15352 '') set try -DINT32
15353 if eval $compile; then
15354 case "`$run ./try`" in
15366 '') if $test $intsize -ge 4; then
15368 u32type="unsigned int"
15376 '') case "$d_quad:$quadtype" in
15378 i64type="$quadtype"
15379 u64type="$uquadtype"
15387 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15388 : volatile so that the compiler has to store it out to memory.
15389 if test X"$d_volatile" = X"$define"; then
15394 #$i_stdlib I_STDLIB
15396 #include <stdlib.h>
15398 #include <sys/types.h>
15399 #include <signal.h>
15401 $volatile int bletched = 0;
15402 $signal_t blech(int s) { bletched = 1; }
15407 int n = 8 * $uvsize;
15410 signal(SIGFPE, blech);
15413 for (i = 0; i < n; i++) {
15414 u = u << 1 | ($uvtype)1;
15416 if (($uvtype)d != u)
15420 d = ($nvtype)(u - 1);
15421 if (($uvtype)d != (u - 1))
15428 printf("%d\n", ((i == n) ? -n : i));
15434 d_nv_preserves_uv="$undef"
15435 if eval $compile; then
15436 nv_preserves_uv_bits="`$run ./try`"
15438 case "$nv_preserves_uv_bits" in
15440 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15441 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15442 d_nv_preserves_uv="$define"
15444 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15445 d_nv_preserves_uv="$undef" ;;
15446 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15447 nv_preserves_uv_bits="0" ;;
15451 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15452 : volatile so that the compiler has to store it out to memory.
15453 if test X"$d_volatile" = X"$define"; then
15458 #$i_stdlib I_STDLIB
15460 #include <stdlib.h>
15462 #$i_string I_STRING
15464 # include <string.h>
15466 # include <strings.h>
15468 #include <sys/types.h>
15469 #include <signal.h>
15471 $volatile int bletched = 0;
15472 $signal_t blech(int s) { bletched = 1; }
15475 int checkit($nvtype d, char *where) {
15476 unsigned char *p = (char *)&d;
15477 unsigned char *end = p + sizeof(d);
15487 printf("No - %s: 0x", where);
15489 printf ("%02X", *p++);
15494 int main(int argc, char **argv) {
15497 fail += checkit(d, "0.0");
15499 /* The compiler shouldn't be assuming that bletched is 0 */
15502 fail += checkit(d, "bleched");
15505 signal(SIGFPE, blech);
15508 /* Paranoia - the compiler should have no way of knowing that ANSI says
15509 that argv[argc] will always be NULL. Actually, if it did assume this it
15510 would be buggy, as this is C and main() can be called from elsewhere in
15512 d = argv[argc] ? 1 : 0;
15515 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15518 fail += checkit(d, "ternary");
15520 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15523 printf("No - memset doesn't give 0.0\n");
15524 /* This might just blow up: */
15525 printf("(gives %g)\n", d);
15531 printf("No - something bleched\n");
15536 printf("No - %d fail(s)\n", fail);
15545 d_nv_zero_is_allbits_zero="$undef"
15546 if eval $compile; then
15552 0.0 is represented as all bits zero in memory
15554 d_nv_zero_is_allbits_zero="$define"
15557 0.0 is not represented as all bits zero in memory
15559 d_nv_zero_is_allbits_zero="$undef"
15564 0.0 is not represented as all bits zero in memory
15566 d_nv_zero_is_allbits_zero="$undef"
15572 : check for off64_t
15574 echo "Checking to see if you have off64_t..." >&4
15576 #include <sys/types.h>
15577 #include <unistd.h>
15578 int main() { off64_t x = 7; }
15581 if eval $compile; then
15583 echo "You have off64_t."
15586 echo "You do not have off64_t."
15587 case "$lseeksize" in
15588 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15595 : how to create joinable pthreads
15596 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15598 echo "Checking what constant to use for creating joinable pthreads..." >&4
15599 $cat >try.c <<'EOCP'
15600 #include <pthread.h>
15602 int detachstate = JOINABLE;
15605 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15606 if eval $compile; then
15607 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15608 val="$undef" # Yes, undef.
15609 set d_old_pthread_create_joinable
15612 set old_pthread_create_joinable
15615 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15616 if eval $compile; then
15617 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15619 set d_old_pthread_create_joinable
15621 val=PTHREAD_CREATE_UNDETACHED
15622 set old_pthread_create_joinable
15625 set try -DJOINABLE=__UNDETACHED
15626 if eval $compile; then
15627 echo "You seem to use __UNDETACHED." >&4
15629 set d_old_pthread_create_joinable
15632 set old_pthread_create_joinable
15635 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15637 set d_old_pthread_create_joinable
15640 set old_pthread_create_joinable
15647 d_old_pthread_create_joinable="$undef"
15648 old_pthread_create_joinable=""
15651 : see if pause exists
15655 : see if poll exists
15659 : see if readlink exists
15660 set readlink d_readlink
15663 : Check if exe is symlink to abs path of executing program
15667 case "$d_readlink" in
15669 if $issymlink /proc/self/exe ; then
15670 $ls -l /proc/self/exe > reflect
15671 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15672 echo "You have Linux-like /proc/self/exe."
15673 procselfexe='"/proc/self/exe"'
15677 if $issymlink /proc/curproc/file ; then
15678 $ls -l /proc/curproc/file > reflect
15679 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15680 echo "You have BSD-like /proc/curproc/file."
15681 procselfexe='"/proc/curproc/file"'
15691 : backward compatibility for d_hvfork
15692 if test X$d_hvfork != X; then
15693 d_vfork="$d_hvfork"
15696 : see if there is a vfork
15701 d_pseudofork=$undef
15703 : Ok, but do we want to use it. vfork is reportedly unreliable in
15704 : perl on Solaris 2.x, and probably elsewhere.
15708 case "$usevfork" in
15714 Perl can only use a vfork() that doesn't suffer from strict
15715 restrictions on calling functions or modifying global data in
15716 the child. For example, glibc-2.1 contains such a vfork()
15717 that is unsuitable. If your system provides a proper fork()
15718 call, chances are that you do NOT want perl to use vfork().
15721 rp="Do you still want to use vfork()?"
15726 echo "Ok, we won't use vfork()."
15735 $define) usevfork='true';;
15736 *) usevfork='false';;
15739 : see whether the pthread_atfork exists
15741 #include <pthread.h>
15744 #ifdef PTHREAD_ATFORK
15745 pthread_atfork(NULL,NULL,NULL);
15750 : see if pthread_atfork exists
15751 set try -DPTHREAD_ATFORK
15752 if eval $compile; then
15757 case "$usethreads" in
15760 $define) echo 'pthread_atfork found.' >&4 ;;
15761 *) echo 'pthread_atfork NOT found.' >&4 ;;
15764 set d_pthread_atfork
15767 : see if pthread_attr_setscope exists
15768 set pthread_attr_setscope d_pthread_attr_setscope
15772 : see whether the various POSIXish _yields exist
15774 #include <pthread.h>
15780 #ifdef PTHREAD_YIELD
15783 #ifdef PTHREAD_YIELD_NULL
15784 pthread_yield(NULL);
15790 : see if sched_yield exists
15791 set try -DSCHED_YIELD
15792 if eval $compile; then
15794 sched_yield='sched_yield()'
15798 case "$usethreads" in
15801 $define) echo 'sched_yield() found.' >&4 ;;
15802 *) echo 'sched_yield() NOT found.' >&4 ;;
15808 : see if pthread_yield exists
15809 set try -DPTHREAD_YIELD
15810 if eval $compile; then
15812 case "$sched_yield" in
15813 '') sched_yield='pthread_yield()' ;;
15816 set try -DPTHREAD_YIELD_NULL
15817 if eval $compile; then
15819 case "$sched_yield" in
15820 '') sched_yield='pthread_yield(NULL)' ;;
15826 case "$usethreads" in
15829 $define) echo 'pthread_yield() found.' >&4 ;;
15830 *) echo 'pthread_yield() NOT found.' >&4 ;;
15834 set d_pthread_yield
15836 case "$sched_yield" in
15837 '') sched_yield=undef ;;
15841 : see if random_r exists
15842 set random_r d_random_r
15844 case "$d_random_r" in
15846 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15847 case "$d_random_r_proto:$usethreads" in
15848 ":define") d_random_r_proto=define
15849 set d_random_r_proto random_r $hdrs
15853 case "$d_random_r_proto" in
15855 case "$random_r_proto" in
15856 ''|0) try='int random_r(int*, struct random_data*);'
15857 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15859 case "$random_r_proto" in
15860 ''|0) try='int random_r(long*, struct random_data*);'
15861 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15863 case "$random_r_proto" in
15864 ''|0) try='int random_r(struct random_data*, int32_t*);'
15865 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15867 case "$random_r_proto" in
15868 ''|0) d_random_r=undef
15870 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15871 * ) case "$random_r_proto" in
15872 REENTRANT_PROTO*) ;;
15873 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15875 echo "Prototype: $try" ;;
15878 *) case "$usethreads" in
15879 define) echo "random_r has no prototype, not using it." >&4 ;;
15886 *) random_r_proto=0
15890 : see if readdir and friends exist
15891 set readdir d_readdir
15893 set seekdir d_seekdir
15895 set telldir d_telldir
15897 set rewinddir d_rewinddir
15900 : see if readdir64_r exists
15901 set readdir64_r d_readdir64_r
15903 case "$d_readdir64_r" in
15905 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15906 case "$d_readdir64_r_proto:$usethreads" in
15907 ":define") d_readdir64_r_proto=define
15908 set d_readdir64_r_proto readdir64_r $hdrs
15912 case "$d_readdir64_r_proto" in
15914 case "$readdir64_r_proto" in
15915 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15916 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15918 case "$readdir64_r_proto" in
15919 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15920 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15922 case "$readdir64_r_proto" in
15923 ''|0) d_readdir64_r=undef
15924 readdir64_r_proto=0
15925 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15926 * ) case "$readdir64_r_proto" in
15927 REENTRANT_PROTO*) ;;
15928 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15930 echo "Prototype: $try" ;;
15933 *) case "$usethreads" in
15934 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15936 d_readdir64_r=undef
15937 readdir64_r_proto=0
15941 *) readdir64_r_proto=0
15945 : see if readdir_r exists
15946 set readdir_r d_readdir_r
15948 case "$d_readdir_r" in
15950 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15951 case "$d_readdir_r_proto:$usethreads" in
15952 ":define") d_readdir_r_proto=define
15953 set d_readdir_r_proto readdir_r $hdrs
15957 case "$d_readdir_r_proto" in
15959 case "$readdir_r_proto" in
15960 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15961 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15963 case "$readdir_r_proto" in
15964 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15965 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15967 case "$readdir_r_proto" in
15968 ''|0) d_readdir_r=undef
15970 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15971 * ) case "$readdir_r_proto" in
15972 REENTRANT_PROTO*) ;;
15973 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15975 echo "Prototype: $try" ;;
15978 *) case "$usethreads" in
15979 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15986 *) readdir_r_proto=0
15990 : see if readv exists
15994 : see if recvmsg exists
15995 set recvmsg d_recvmsg
15998 : see if rename exists
15999 set rename d_rename
16002 : see if rmdir exists
16006 : see if memory.h is available.
16011 : See if it conflicts with string.h
16017 $cppstdin $cppflags $cppminus < $strings > mem.h
16018 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16020 echo "We won't be including <memory.h>."
16030 : can bcopy handle overlapping blocks?
16033 case "$d_memmove" in
16034 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16035 *) case "$d_bcopy" in
16037 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16039 #$i_memory I_MEMORY
16040 #$i_stdlib I_STDLIB
16041 #$i_string I_STRING
16042 #$i_unistd I_UNISTD
16044 $cat >>try.c <<'EOCP'
16047 # include <memory.h>
16050 # include <stdlib.h>
16053 # include <string.h>
16055 # include <strings.h>
16058 # include <unistd.h> /* Needed for NetBSD */
16062 char buf[128], abc[128];
16068 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16069 try to store the string in read-only memory. */
16070 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16072 for (align = 7; align >= 0; align--) {
16073 for (len = 36; len; len--) {
16075 bcopy(abc, b, len);
16076 for (off = 1; off <= len; off++) {
16077 bcopy(b, b+off, len);
16078 bcopy(b+off, b, len);
16079 if (bcmp(b, abc, len))
16088 if eval $compile_ok; then
16089 if $run ./try 2>/dev/null; then
16090 echo "Yes, it can."
16093 echo "It can't, sorry."
16096 echo "(I can't compile the test program, so we'll assume not...)"
16106 : can memcpy handle overlapping blocks?
16109 case "$d_memmove" in
16110 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16111 *) case "$d_memcpy" in
16113 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16115 #$i_memory I_MEMORY
16116 #$i_stdlib I_STDLIB
16117 #$i_string I_STRING
16118 #$i_unistd I_UNISTD
16120 $cat >>try.c <<'EOCP'
16123 # include <memory.h>
16126 # include <stdlib.h>
16129 # include <string.h>
16131 # include <strings.h>
16134 # include <unistd.h> /* Needed for NetBSD */
16138 char buf[128], abc[128];
16144 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16145 try to store the string in read-only memory. */
16146 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16148 for (align = 7; align >= 0; align--) {
16149 for (len = 36; len; len--) {
16151 memcpy(b, abc, len);
16152 for (off = 1; off <= len; off++) {
16153 memcpy(b+off, b, len);
16154 memcpy(b, b+off, len);
16155 if (memcmp(b, abc, len))
16164 if eval $compile_ok; then
16165 if $run ./try 2>/dev/null; then
16166 echo "Yes, it can."
16169 echo "It can't, sorry."
16172 echo "(I can't compile the test program, so we'll assume not...)"
16182 : can memcmp be trusted to compare relative magnitude?
16184 case "$d_memcmp" in
16187 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16189 #$i_memory I_MEMORY
16190 #$i_stdlib I_STDLIB
16191 #$i_string I_STRING
16192 #$i_unistd I_UNISTD
16194 $cat >>try.c <<'EOCP'
16197 # include <memory.h>
16200 # include <stdlib.h>
16203 # include <string.h>
16205 # include <strings.h>
16208 # include <unistd.h> /* Needed for NetBSD */
16214 if ((a < b) && memcmp(&a, &b, 1) < 0)
16220 if eval $compile_ok; then
16221 if $run ./try 2>/dev/null; then
16222 echo "Yes, it can."
16225 echo "No, it can't (it uses signed chars)."
16228 echo "(I can't compile the test program, so we'll assume not...)"
16236 : see if prototype for sbrk is available
16238 set d_sbrkproto sbrk $i_unistd unistd.h
16241 : see if select exists
16242 set select d_select
16245 : see if semctl exists
16246 set semctl d_semctl
16249 : see if semget exists
16250 set semget d_semget
16253 : see if semop exists
16257 : see how much of the 'sem*(2)' library is present.
16260 case "$d_semctl$d_semget$d_semop" in
16261 *"$undef"*) h_sem=false;;
16265 case "`ipcs 2>&1`" in
16266 "SVID messages"*"not configured"*)
16267 echo "Your $osname does not have the sem*(2) configured." >&4
16270 set semctl d_semctl
16272 set semget d_semget
16280 : we could also check for sys/ipc.h ...
16281 if $h_sem && $test `./findhdr sys/sem.h`; then
16282 echo "You have the full sem*(2) library." >&4
16285 echo "You don't have the full sem*(2) library." >&4
16291 : see whether sys/sem.h defines union semun
16293 $cat > try.c <<'END'
16294 #include <sys/types.h>
16295 #include <sys/ipc.h>
16296 #include <sys/sem.h>
16297 int main () { union semun semun; semun.buf = 0; }
16300 if eval $compile; then
16301 echo "You have union semun in <sys/sem.h>." >&4
16304 echo "You do not have union semun in <sys/sem.h>." >&4
16311 : see how to do semctl IPC_STAT
16315 $cat > tryh.h <<END
16318 # define S_IRUSR S_IREAD
16319 # define S_IWUSR S_IWRITE
16320 # define S_IXUSR S_IEXEC
16322 # define S_IRUSR 0400
16323 # define S_IWUSR 0200
16324 # define S_IXUSR 0100
16326 # define S_IRGRP (S_IRUSR>>3)
16327 # define S_IWGRP (S_IWUSR>>3)
16328 # define S_IXGRP (S_IXUSR>>3)
16329 # define S_IROTH (S_IRUSR>>6)
16330 # define S_IWOTH (S_IWUSR>>6)
16331 # define S_IXOTH (S_IXUSR>>6)
16334 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16335 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16336 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16339 : see whether semctl IPC_STAT can use union semun
16340 case "$d_semctl_semun" in
16344 #include <sys/types.h>
16345 #include <sys/ipc.h>
16346 #include <sys/sem.h>
16347 #include <sys/stat.h>
16354 #$d_union_semun HAS_UNION_SEMUN
16357 #ifndef HAS_UNION_SEMUN
16360 struct semid_ds *buf;
16361 unsigned short *array;
16367 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16368 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16370 struct semid_ds argbuf;
16373 st = semctl(sem, 0, IPC_STAT, arg);
16377 # endif /* IPC_STAT */
16378 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16380 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16381 # endif /* IPC_RMID */
16382 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16384 #endif /* IPC_PRIVATE && ... */
16385 printf("semget failed: errno = %d\n", errno);
16390 if eval $compile; then
16393 semun) val="$define" ;;
16401 case "$d_semctl_semun" in
16403 echo "You can use union semun for semctl IPC_STAT." >&4
16406 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16411 : see whether semctl IPC_STAT can use struct semid_ds pointer
16412 case "$d_semctl_semid_ds" in
16415 $cat > try.c <<'END'
16416 #include <sys/types.h>
16417 #include <sys/ipc.h>
16418 #include <sys/sem.h>
16419 #include <sys/stat.h>
16427 struct semid_ds arg;
16430 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16431 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16434 st = semctl(sem, 0, IPC_STAT, &arg);
16436 printf("semid_ds\n");
16438 # endif /* IPC_STAT */
16439 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16441 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16442 # endif /* IPC_RMID */
16443 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16445 #endif /* IPC_PRIVATE && ... */
16446 printf("semget failed: errno = %d\n", errno);
16452 if eval $compile; then
16455 semid_ds) val="$define" ;;
16459 set d_semctl_semid_ds
16463 case "$d_semctl_semid_ds" in
16465 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16467 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16473 # We do not have the full sem*(2) library, so assume we can not
16479 set d_semctl_semid_ds
16485 : see if sendmsg exists
16486 set sendmsg d_sendmsg
16489 : see if setegid exists
16490 set setegid d_setegid
16493 : see if seteuid exists
16494 set seteuid d_seteuid
16497 : see if setgrent exists
16498 set setgrent d_setgrent
16501 : see if setgrent_r exists
16502 set setgrent_r d_setgrent_r
16504 case "$d_setgrent_r" in
16506 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16507 case "$d_setgrent_r_proto:$usethreads" in
16508 ":define") d_setgrent_r_proto=define
16509 set d_setgrent_r_proto setgrent_r $hdrs
16513 case "$d_setgrent_r_proto" in
16515 case "$setgrent_r_proto" in
16516 ''|0) try='int setgrent_r(FILE**);'
16517 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16519 case "$setgrent_r_proto" in
16520 ''|0) try='void setgrent_r(FILE**);'
16521 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16523 case "$setgrent_r_proto" in
16524 ''|0) d_setgrent_r=undef
16526 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16527 * ) case "$setgrent_r_proto" in
16528 REENTRANT_PROTO*) ;;
16529 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16531 echo "Prototype: $try" ;;
16534 *) case "$usethreads" in
16535 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16542 *) setgrent_r_proto=0
16546 : see if sethostent exists
16547 set sethostent d_sethent
16550 : see if sethostent_r exists
16551 set sethostent_r d_sethostent_r
16553 case "$d_sethostent_r" in
16555 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16556 case "$d_sethostent_r_proto:$usethreads" in
16557 ":define") d_sethostent_r_proto=define
16558 set d_sethostent_r_proto sethostent_r $hdrs
16562 case "$d_sethostent_r_proto" in
16564 case "$sethostent_r_proto" in
16565 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16566 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16568 case "$sethostent_r_proto" in
16569 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16570 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16572 case "$sethostent_r_proto" in
16573 ''|0) d_sethostent_r=undef
16574 sethostent_r_proto=0
16575 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16576 * ) case "$sethostent_r_proto" in
16577 REENTRANT_PROTO*) ;;
16578 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16580 echo "Prototype: $try" ;;
16583 *) case "$usethreads" in
16584 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16586 d_sethostent_r=undef
16587 sethostent_r_proto=0
16591 *) sethostent_r_proto=0
16595 : see if setitimer exists
16596 set setitimer d_setitimer
16599 : see if setlinebuf exists
16600 set setlinebuf d_setlinebuf
16603 : see if setlocale exists
16604 set setlocale d_setlocale
16607 : see if locale.h is available
16608 set locale.h i_locale
16611 : see if setlocale_r exists
16612 set setlocale_r d_setlocale_r
16614 case "$d_setlocale_r" in
16616 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16617 case "$d_setlocale_r_proto:$usethreads" in
16618 ":define") d_setlocale_r_proto=define
16619 set d_setlocale_r_proto setlocale_r $hdrs
16623 case "$d_setlocale_r_proto" in
16625 case "$setlocale_r_proto" in
16626 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16627 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16629 case "$setlocale_r_proto" in
16630 ''|0) d_setlocale_r=undef
16631 setlocale_r_proto=0
16632 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16633 * ) case "$setlocale_r_proto" in
16634 REENTRANT_PROTO*) ;;
16635 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16637 echo "Prototype: $try" ;;
16640 *) case "$usethreads" in
16641 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16643 d_setlocale_r=undef
16644 setlocale_r_proto=0
16648 *) setlocale_r_proto=0
16652 : see if setnetent exists
16653 set setnetent d_setnent
16656 : see if setnetent_r exists
16657 set setnetent_r d_setnetent_r
16659 case "$d_setnetent_r" in
16661 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16662 case "$d_setnetent_r_proto:$usethreads" in
16663 ":define") d_setnetent_r_proto=define
16664 set d_setnetent_r_proto setnetent_r $hdrs
16668 case "$d_setnetent_r_proto" in
16670 case "$setnetent_r_proto" in
16671 ''|0) try='int setnetent_r(int, struct netent_data*);'
16672 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16674 case "$setnetent_r_proto" in
16675 ''|0) try='void setnetent_r(int, struct netent_data*);'
16676 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16678 case "$setnetent_r_proto" in
16679 ''|0) d_setnetent_r=undef
16680 setnetent_r_proto=0
16681 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16682 * ) case "$setnetent_r_proto" in
16683 REENTRANT_PROTO*) ;;
16684 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16686 echo "Prototype: $try" ;;
16689 *) case "$usethreads" in
16690 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16692 d_setnetent_r=undef
16693 setnetent_r_proto=0
16697 *) setnetent_r_proto=0
16701 : see if setprotoent exists
16702 set setprotoent d_setpent
16705 : see if setpgid exists
16706 set setpgid d_setpgid
16709 : see if setpgrp2 exists
16710 set setpgrp2 d_setpgrp2
16713 : see if setpriority exists
16714 set setpriority d_setprior
16717 : see if setproctitle exists
16718 set setproctitle d_setproctitle
16721 : see if setprotoent_r exists
16722 set setprotoent_r d_setprotoent_r
16724 case "$d_setprotoent_r" in
16726 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16727 case "$d_setprotoent_r_proto:$usethreads" in
16728 ":define") d_setprotoent_r_proto=define
16729 set d_setprotoent_r_proto setprotoent_r $hdrs
16733 case "$d_setprotoent_r_proto" in
16735 case "$setprotoent_r_proto" in
16736 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16737 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16739 case "$setprotoent_r_proto" in
16740 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16741 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16743 case "$setprotoent_r_proto" in
16744 ''|0) d_setprotoent_r=undef
16745 setprotoent_r_proto=0
16746 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16747 * ) case "$setprotoent_r_proto" in
16748 REENTRANT_PROTO*) ;;
16749 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16751 echo "Prototype: $try" ;;
16754 *) case "$usethreads" in
16755 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16757 d_setprotoent_r=undef
16758 setprotoent_r_proto=0
16762 *) setprotoent_r_proto=0
16766 : see if setpwent exists
16767 set setpwent d_setpwent
16770 : see if setpwent_r exists
16771 set setpwent_r d_setpwent_r
16773 case "$d_setpwent_r" in
16775 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16776 case "$d_setpwent_r_proto:$usethreads" in
16777 ":define") d_setpwent_r_proto=define
16778 set d_setpwent_r_proto setpwent_r $hdrs
16782 case "$d_setpwent_r_proto" in
16784 case "$setpwent_r_proto" in
16785 ''|0) try='int setpwent_r(FILE**);'
16786 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16788 case "$setpwent_r_proto" in
16789 ''|0) try='void setpwent_r(FILE**);'
16790 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16792 case "$setpwent_r_proto" in
16793 ''|0) d_setpwent_r=undef
16795 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16796 * ) case "$setpwent_r_proto" in
16797 REENTRANT_PROTO*) ;;
16798 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16800 echo "Prototype: $try" ;;
16803 *) case "$usethreads" in
16804 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16811 *) setpwent_r_proto=0
16815 : see if setregid exists
16816 set setregid d_setregid
16818 set setresgid d_setresgid
16821 : see if setreuid exists
16822 set setreuid d_setreuid
16824 set setresuid d_setresuid
16827 : see if setrgid exists
16828 set setrgid d_setrgid
16831 : see if setruid exists
16832 set setruid d_setruid
16835 : see if setservent exists
16836 set setservent d_setsent
16839 : see if setservent_r exists
16840 set setservent_r d_setservent_r
16842 case "$d_setservent_r" in
16844 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16845 case "$d_setservent_r_proto:$usethreads" in
16846 ":define") d_setservent_r_proto=define
16847 set d_setservent_r_proto setservent_r $hdrs
16851 case "$d_setservent_r_proto" in
16853 case "$setservent_r_proto" in
16854 ''|0) try='int setservent_r(int, struct servent_data*);'
16855 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16857 case "$setservent_r_proto" in
16858 ''|0) try='void setservent_r(int, struct servent_data*);'
16859 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16861 case "$setservent_r_proto" in
16862 ''|0) d_setservent_r=undef
16863 setservent_r_proto=0
16864 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16865 * ) case "$setservent_r_proto" in
16866 REENTRANT_PROTO*) ;;
16867 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16869 echo "Prototype: $try" ;;
16872 *) case "$usethreads" in
16873 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16875 d_setservent_r=undef
16876 setservent_r_proto=0
16880 *) setservent_r_proto=0
16884 : see if setsid exists
16885 set setsid d_setsid
16888 : see if setvbuf exists
16889 set setvbuf d_setvbuf
16892 : see if sfio.h is available
16897 : see if sfio library is available
16908 : Ok, but do we want to use it.
16912 true|$define|[yY]*) dflt='y';;
16915 echo "$package can use the sfio library, but it is experimental."
16916 case "$useperlio" in
16918 echo "For sfio also the PerlIO abstraction layer is needed."
16919 echo "Earlier you said you wouldn't want that."
16922 rp="You seem to have sfio available, do you want to try using it?"
16925 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16926 useperlio="$define"
16929 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16934 *) case "$usesfio" in
16935 true|$define|[yY]*)
16936 echo "Sorry, cannot find sfio on this machine." >&4
16937 echo "Ignoring your setting of usesfio=$usesfio." >&4
16946 $define) usesfio='true';;
16947 *) usesfio='false';;
16951 *) : Remove sfio from list of libraries to use
16954 echo "Removing unneeded -lsfio from library list" >&4
16955 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16958 echo "libs = $libs" >&4
16965 : see if shmctl exists
16966 set shmctl d_shmctl
16969 : see if shmget exists
16970 set shmget d_shmget
16973 : see if shmat exists
16976 : see what shmat returns
16979 $cat >shmat.c <<'END'
16980 #include <sys/shm.h>
16983 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16988 echo "and it returns ($shmattype)." >&4
16989 : see if a prototype for shmat is available
16990 xxx=`./findhdr sys/shm.h`
16991 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16992 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17003 set d_shmatprototype
17006 : see if shmdt exists
17010 : see how much of the 'shm*(2)' library is present.
17013 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17014 *"$undef"*) h_shm=false;;
17018 case "`ipcs 2>&1`" in
17019 "SVID shared memory"*"not configured"*)
17020 echo "Your $osname does not have the shm*(2) configured." >&4
17023 set shmctl d_shmctl
17025 set shmget d_shmget
17035 : we could also check for sys/ipc.h ...
17036 if $h_shm && $test `./findhdr sys/shm.h`; then
17037 echo "You have the full shm*(2) library." >&4
17040 echo "You don't have the full shm*(2) library." >&4
17046 : see if we have sigaction
17048 if set sigaction val -f d_sigaction; eval $csym; $val; then
17049 echo 'sigaction() found.' >&4
17052 #include <sys/types.h>
17053 #include <signal.h>
17054 #$i_stdlib I_STDLIB
17056 #include <stdlib.h>
17060 struct sigaction act, oact;
17062 oact.sa_handler = 0;
17063 /* so that act and oact are used */
17064 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17068 if eval $compile_ok; then
17071 echo "But you don't seem to have a useable struct sigaction." >&4
17075 echo 'sigaction NOT found.' >&4
17078 set d_sigaction; eval $setvar
17081 : see if this is a sunmath.h system
17082 set sunmath.h i_sunmath
17085 : see if signbit exists
17086 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17089 #$i_sunmath I_SUNMATH
17093 #ifdef I_SUNMATH /* Solaris special math library */
17094 # include <sunmath.h>
17097 int main(int argc, char **argv)
17101 if ((signbit(x) == 0) && (signbit(y) != 0))
17109 if eval $compile; then
17110 if $run ./try; then
17114 $echo "Signbit seems to be available, but doesn't work as I expected."
17115 $echo "I won't use it." >&4
17126 : see if sigprocmask exists
17127 set sigprocmask d_sigprocmask
17130 : see if sigsetjmp exists
17132 case "$d_sigsetjmp" in
17135 #include <setjmp.h>
17136 #$i_stdlib I_STDLIB
17138 #include <stdlib.h>
17144 if (sigsetjmp(env,1))
17147 siglongjmp(env, 1);
17152 if eval $compile; then
17153 if $run ./try >/dev/null 2>&1; then
17154 echo "POSIX sigsetjmp found." >&4
17158 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17164 echo "sigsetjmp not found." >&4
17168 *) val="$d_sigsetjmp"
17169 case "$d_sigsetjmp" in
17170 $define) echo "POSIX sigsetjmp found." >&4;;
17171 $undef) echo "sigsetjmp not found." >&4;;
17179 : see if snprintf exists
17180 set snprintf d_snprintf
17183 : see if vsnprintf exists
17184 set vsnprintf d_vsnprintf
17187 case "$d_snprintf-$d_vsnprintf" in
17190 Checking whether your snprintf() and vsnprintf() work okay...
17192 $cat >try.c <<'EOCP'
17193 /* v?snprintf testing logic courtesy of Russ Allbery.
17194 * According to C99:
17195 * - if the buffer is too short it still must be \0-terminated
17196 * - if the buffer is too short the potentially required length
17197 * must be returned and not -1
17198 * - if the buffer is NULL the potentially required length
17199 * must be returned and not -1 or core dump
17202 #include <stdarg.h>
17206 int test (char *format, ...)
17211 va_start (args, format);
17212 count = vsnprintf (buf, sizeof buf, format, args);
17219 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17220 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17224 if eval $compile; then
17227 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17229 Your snprintf() and snprintf() don't seem to be working okay.
17231 d_snprintf="$undef"
17232 d_vsnprintf="$undef"
17236 echo "(I can't seem to compile the test program--assuming they don't)"
17237 d_snprintf="$undef"
17238 d_vsnprintf="$undef"
17244 : see if sockatmark exists
17245 set sockatmark d_sockatmark
17248 : see if prototype for sockatmark is available
17250 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17253 : see if socks5_init exists
17254 set socks5_init d_socks5_init
17257 : see if sprintf returns the length of the string in the buffer as per ANSI
17258 $echo "Checking whether sprintf returns the length of the string..." >&4
17261 #$i_stdlib I_STDLIB
17263 #include <stdlib.h>
17265 #$i_string I_STRING
17267 # include <string.h>
17269 # include <strings.h>
17278 int check (size_t expect, int test) {
17279 size_t got = strlen(buffer);
17283 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17288 int main(int argc, char **argv) {
17291 check(sprintf(buffer, ""), ++test);
17292 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17293 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17300 d_sprintf_returns_strlen="$undef"
17301 if eval $compile; then
17305 sprintf returns the length of the string (as ANSI says it should)
17307 d_sprintf_returns_strlen="$define"
17310 sprintf does not return the length of the string (how old is this system?)
17312 d_sprintf_returns_strlen="$undef"
17318 : see if srand48_r exists
17319 set srand48_r d_srand48_r
17321 case "$d_srand48_r" in
17323 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17324 case "$d_srand48_r_proto:$usethreads" in
17325 ":define") d_srand48_r_proto=define
17326 set d_srand48_r_proto srand48_r $hdrs
17330 case "$d_srand48_r_proto" in
17332 case "$srand48_r_proto" in
17333 ''|0) try='int srand48_r(long, struct drand48_data*);'
17334 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17336 case "$srand48_r_proto" in
17337 ''|0) d_srand48_r=undef
17339 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17340 * ) case "$srand48_r_proto" in
17341 REENTRANT_PROTO*) ;;
17342 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17344 echo "Prototype: $try" ;;
17347 *) case "$usethreads" in
17348 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17355 *) srand48_r_proto=0
17359 : see if srandom_r exists
17360 set srandom_r d_srandom_r
17362 case "$d_srandom_r" in
17364 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17365 case "$d_srandom_r_proto:$usethreads" in
17366 ":define") d_srandom_r_proto=define
17367 set d_srandom_r_proto srandom_r $hdrs
17371 case "$d_srandom_r_proto" in
17373 case "$srandom_r_proto" in
17374 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17375 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17377 case "$srandom_r_proto" in
17378 ''|0) d_srandom_r=undef
17380 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17381 * ) case "$srandom_r_proto" in
17382 REENTRANT_PROTO*) ;;
17383 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17385 echo "Prototype: $try" ;;
17388 *) case "$usethreads" in
17389 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17396 *) srandom_r_proto=0
17400 : see if prototype for setresgid is available
17402 set d_sresgproto setresgid $i_unistd unistd.h
17405 : see if prototype for setresuid is available
17407 set d_sresuproto setresuid $i_unistd unistd.h
17410 : see if sys/stat.h is available
17411 set sys/stat.h i_sysstat
17415 : see if stat knows about block sizes
17417 echo "Checking to see if your struct stat has st_blocks field..." >&4
17418 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17422 : see if this is a sys/vfs.h system
17423 set sys/vfs.h i_sysvfs
17427 : see if this is a sys/statfs.h system
17428 set sys/statfs.h i_sysstatfs
17433 echo "Checking to see if your system supports struct statfs..." >&4
17434 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
17436 case "$d_statfs_s" in
17437 "$define") echo "Yes, it does." ;;
17438 *) echo "No, it doesn't." ;;
17443 : see if struct statfs knows about f_flags
17444 case "$d_statfs_s" in
17447 echo "Checking to see if your struct statfs has f_flags field..." >&4
17448 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
17452 set d_statfs_f_flags
17456 case "$d_statfs_f_flags" in
17457 "$define") echo "Yes, it does." ;;
17458 *) echo "No, it doesn't." ;;
17461 : Check stream access
17463 Checking how to access stdio streams by file descriptor number...
17465 case "$stdio_stream_array" in
17466 '') $cat >try.c <<EOCP
17469 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17473 for s in _iob __iob __sF
17475 set try -DSTDIO_STREAM_ARRAY=$s
17476 if eval $compile; then
17477 case "`$run ./try`" in
17478 yes) stdio_stream_array=$s; break ;;
17484 case "$stdio_stream_array" in
17486 I can't figure out how to access stdio streams by file descriptor number.
17488 d_stdio_stream_array="$undef"
17491 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17493 d_stdio_stream_array="$define"
17497 : see if strcoll exists
17498 set strcoll d_strcoll
17501 : check for structure copying
17503 echo "Checking to see if your C compiler can copy structs..." >&4
17504 $cat >try.c <<'EOCP'
17514 if $cc -c try.c >/dev/null 2>&1 ; then
17516 echo "Yup, it can."
17519 echo "Nope, it can't."
17525 : see if strerror and/or sys_errlist[] exist
17527 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17528 if set strerror val -f d_strerror; eval $csym; $val; then
17529 echo 'strerror() found.' >&4
17530 d_strerror="$define"
17531 d_strerrm='strerror(e)'
17532 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17533 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17534 d_syserrlst="$define"
17536 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17537 d_syserrlst="$undef"
17539 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17540 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17541 echo 'strerror() found in string header.' >&4
17542 d_strerror="$define"
17543 d_strerrm='strerror(e)'
17544 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17545 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17546 d_syserrlst="$define"
17548 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17549 d_syserrlst="$undef"
17551 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17552 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17553 d_strerror="$undef"
17554 d_syserrlst="$define"
17555 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17557 echo 'strerror() and sys_errlist[] NOT found.' >&4
17558 d_strerror="$undef"
17559 d_syserrlst="$undef"
17560 d_strerrm='"unknown"'
17564 : see if strerror_r exists
17565 set strerror_r d_strerror_r
17567 case "$d_strerror_r" in
17569 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17570 case "$d_strerror_r_proto:$usethreads" in
17571 ":define") d_strerror_r_proto=define
17572 set d_strerror_r_proto strerror_r $hdrs
17576 case "$d_strerror_r_proto" in
17578 case "$strerror_r_proto" in
17579 ''|0) try='int strerror_r(int, char*, size_t);'
17580 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17582 case "$strerror_r_proto" in
17583 ''|0) try='int strerror_r(int, char*, int);'
17584 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17586 case "$strerror_r_proto" in
17587 ''|0) try='char* strerror_r(int, char*, size_t);'
17588 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17590 case "$strerror_r_proto" in
17591 ''|0) d_strerror_r=undef
17593 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17594 * ) case "$strerror_r_proto" in
17595 REENTRANT_PROTO*) ;;
17596 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17598 echo "Prototype: $try" ;;
17601 *) case "$usethreads" in
17602 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17609 *) strerror_r_proto=0
17613 : see if strftime exists
17614 set strftime d_strftime
17617 : see if strlcat exists
17618 set strlcat d_strlcat
17621 : see if strlcpy exists
17622 set strlcpy d_strlcpy
17625 : see if strtod exists
17626 set strtod d_strtod
17629 : see if strtol exists
17630 set strtol d_strtol
17633 : see if strtold exists
17634 set strtold d_strtold
17637 : see if strtoll exists
17638 set strtoll d_strtoll
17641 case "$d_longlong-$d_strtoll" in
17644 Checking whether your strtoll() works okay...
17646 $cat >try.c <<'EOCP'
17649 #define strtoll __strtoll
17652 #define strtoll _strtoll
17655 extern long long int strtoll(char *s, char **, int);
17656 static int bad = 0;
17657 int check(char *s, long long ell, int een) {
17660 gll = strtoll(s, 0, 10);
17661 if (!((gll == ell) && (errno == een)))
17665 check(" 1", 1LL, 0);
17666 check(" 0", 0LL, 0);
17667 check("-1", -1LL, 0);
17668 check("-9223372036854775808", -9223372036854775808LL, 0);
17669 check("-9223372036854775808", -9223372036854775808LL, 0);
17670 check(" 9223372036854775807", 9223372036854775807LL, 0);
17671 check("-9223372036854775808", -9223372036854775808LL, 0);
17672 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17673 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17679 if eval $compile; then
17682 ok) echo "Your strtoll() seems to be working okay." ;;
17684 Your strtoll() doesn't seem to be working okay.
17690 echo "(I can't seem to compile the test program--assuming it doesn't)"
17696 : see if strtoq exists
17697 set strtoq d_strtoq
17700 : see if strtoul exists
17701 set strtoul d_strtoul
17704 case "$d_strtoul" in
17707 Checking whether your strtoul() works okay...
17709 $cat >try.c <<'EOCP'
17712 extern unsigned long int strtoul(char *s, char **, int);
17713 static int bad = 0;
17714 void check(char *s, unsigned long eul, int een) {
17717 gul = strtoul(s, 0, 10);
17718 if (!((gul == eul) && (errno == een)))
17722 check(" 1", 1L, 0);
17723 check(" 0", 0L, 0);
17725 case "$longsize" in
17727 $cat >>try.c <<'EOCP'
17728 check("18446744073709551615", 18446744073709551615UL, 0);
17729 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17730 #if 0 /* strtoul() for /^-/ strings is undefined. */
17731 check("-1", 18446744073709551615UL, 0);
17732 check("-18446744073709551614", 2, 0);
17733 check("-18446744073709551615", 1, 0);
17734 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17735 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17740 $cat >>try.c <<'EOCP'
17741 check("4294967295", 4294967295UL, 0);
17742 check("4294967296", 4294967295UL, ERANGE);
17743 #if 0 /* strtoul() for /^-/ strings is undefined. */
17744 check("-1", 4294967295UL, 0);
17745 check("-4294967294", 2, 0);
17746 check("-4294967295", 1, 0);
17747 check("-4294967296", 4294967295UL, ERANGE);
17748 check("-4294967297", 4294967295UL, ERANGE);
17753 : Should we write these tests to be more portable by sprintf-ing
17754 : ~0 and then manipulating that char string as input for strtol?
17757 $cat >>try.c <<'EOCP'
17764 if eval $compile; then
17765 case "`$run ./try`" in
17766 ok) echo "Your strtoul() seems to be working okay." ;;
17768 Your strtoul() doesn't seem to be working okay.
17774 echo "(I can't seem to compile the test program--assuming it doesn't)"
17780 : see if strtoull exists
17781 set strtoull d_strtoull
17784 case "$d_longlong-$d_strtoull" in
17787 Checking whether your strtoull() works okay...
17789 $cat >try.c <<'EOCP'
17792 #define strtoull __strtoull
17795 extern unsigned long long int strtoull(char *s, char **, int);
17796 static int bad = 0;
17797 int check(char *s, long long eull, int een) {
17800 gull = strtoull(s, 0, 10);
17801 if (!((gull == eull) && (errno == een)))
17805 check(" 1", 1LL, 0);
17806 check(" 0", 0LL, 0);
17807 check("18446744073709551615", 18446744073709551615ULL, 0);
17808 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17809 #if 0 /* strtoull() for /^-/ strings is undefined. */
17810 check("-1", 18446744073709551615ULL, 0);
17811 check("-18446744073709551614", 2LL, 0);
17812 check("-18446744073709551615", 1LL, 0);
17813 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17814 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17821 if eval $compile; then
17822 case "`$run ./try`" in
17823 ok) echo "Your strtoull() seems to be working okay." ;;
17825 Your strtoull() doesn't seem to be working okay.
17827 d_strtoull="$undef"
17831 echo "(I can't seem to compile the test program--assuming it doesn't)"
17832 d_strtoull="$undef"
17837 : see if strtouq exists
17838 set strtouq d_strtouq
17841 case "$d_strtouq" in
17844 Checking whether your strtouq() works okay...
17846 $cat >try.c <<'EOCP'
17849 extern unsigned long long int strtouq(char *s, char **, int);
17850 static int bad = 0;
17851 void check(char *s, unsigned long long eull, int een) {
17852 unsigned long long gull;
17854 gull = strtouq(s, 0, 10);
17855 if (!((gull == eull) && (errno == een)))
17859 check(" 1", 1LL, 0);
17860 check(" 0", 0LL, 0);
17861 check("18446744073709551615", 18446744073709551615ULL, 0);
17862 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17863 #if 0 /* strtouq() for /^-/ strings is undefined. */
17864 check("-1", 18446744073709551615ULL, 0);
17865 check("-18446744073709551614", 2LL, 0);
17866 check("-18446744073709551615", 1LL, 0);
17867 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17868 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17876 if eval $compile; then
17877 case "`$run ./try`" in
17878 ok) echo "Your strtouq() seems to be working okay." ;;
17880 Your strtouq() doesn't seem to be working okay.
17886 echo "(I can't seem to compile the test program--assuming it doesn't)"
17892 : see if strxfrm exists
17893 set strxfrm d_strxfrm
17896 : see if symlink exists
17897 set symlink d_symlink
17900 : see if syscall exists
17901 set syscall d_syscall
17904 : see if prototype for syscall is available
17906 set d_syscallproto syscall $i_unistd unistd.h
17909 : see if sysconf exists
17910 set sysconf d_sysconf
17913 : see if system exists
17914 set system d_system
17917 : see if tcgetpgrp exists
17918 set tcgetpgrp d_tcgetpgrp
17921 : see if tcsetpgrp exists
17922 set tcsetpgrp d_tcsetpgrp
17925 : see if prototype for telldir is available
17927 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17930 : see if time exists
17932 if test "X$d_time" = X -o X"$timetype" = X; then
17933 if set time val -f d_time; eval $csym; $val; then
17934 echo 'time() found.' >&4
17936 rp="What is the type returned by time() on this system?"
17937 set time_t timetype long stdio.h sys/types.h
17940 echo 'time() not found, hope that will do.' >&4
17948 : see if this is a sys/times.h system
17949 set sys/times.h i_systimes
17952 : see if times exists
17954 if set times val -f d_times; eval $csym; $val; then
17955 echo 'times() found.' >&4
17958 case "$i_systimes" in
17959 "$define") inc='sys/times.h';;
17961 rp="What is the type returned by times() on this system?"
17962 set clock_t clocktype long stdio.h sys/types.h $inc
17965 echo 'times() NOT found, hope that will do.' >&4
17970 : see if tmpnam_r exists
17971 set tmpnam_r d_tmpnam_r
17973 case "$d_tmpnam_r" in
17975 hdrs="$i_systypes sys/types.h define stdio.h "
17976 case "$d_tmpnam_r_proto:$usethreads" in
17977 ":define") d_tmpnam_r_proto=define
17978 set d_tmpnam_r_proto tmpnam_r $hdrs
17982 case "$d_tmpnam_r_proto" in
17984 case "$tmpnam_r_proto" in
17985 ''|0) try='char* tmpnam_r(char*);'
17986 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17988 case "$tmpnam_r_proto" in
17989 ''|0) d_tmpnam_r=undef
17991 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17992 * ) case "$tmpnam_r_proto" in
17993 REENTRANT_PROTO*) ;;
17994 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17996 echo "Prototype: $try" ;;
17999 *) case "$usethreads" in
18000 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18007 *) tmpnam_r_proto=0
18011 : see if truncate exists
18012 set truncate d_truncate
18015 : see if ttyname_r exists
18016 set ttyname_r d_ttyname_r
18018 case "$d_ttyname_r" in
18020 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18021 case "$d_ttyname_r_proto:$usethreads" in
18022 ":define") d_ttyname_r_proto=define
18023 set d_ttyname_r_proto ttyname_r $hdrs
18027 case "$d_ttyname_r_proto" in
18029 case "$ttyname_r_proto" in
18030 ''|0) try='int ttyname_r(int, char*, size_t);'
18031 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18033 case "$ttyname_r_proto" in
18034 ''|0) try='int ttyname_r(int, char*, int);'
18035 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18037 case "$ttyname_r_proto" in
18038 ''|0) try='char* ttyname_r(int, char*, int);'
18039 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18041 case "$ttyname_r_proto" in
18042 ''|0) d_ttyname_r=undef
18044 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18045 * ) case "$ttyname_r_proto" in
18046 REENTRANT_PROTO*) ;;
18047 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18049 echo "Prototype: $try" ;;
18052 *) case "$usethreads" in
18053 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18060 *) ttyname_r_proto=0
18064 : see if tzname[] exists
18066 if set tzname val -a d_tzname; eval $csym; $val; then
18068 echo 'tzname[] found.' >&4
18071 echo 'tzname[] NOT found.' >&4
18076 : Check if is a multiplatform env
18078 next|rhapsody|darwin) multiarch="$define" ;;
18080 case "$multiarch" in
18081 ''|[nN]*) multiarch="$undef" ;;
18084 : check for ordering of bytes in a UV
18086 case "$usecrosscompile$multiarch" in
18089 You seem to be either cross-compiling or doing a multiarchitecture build,
18090 skipping the byteorder check.
18096 case "$byteorder" in
18099 In the following, larger digits indicate more significance. A big-endian
18100 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18101 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18102 machines may have weird orders like 3412. A Cray will report 87654321,
18103 an Alpha will report 12345678. If the test program works the default is
18105 I'm now running the test program...
18109 #$i_stdlib I_STDLIB
18111 #include <stdlib.h>
18113 #include <sys/types.h>
18114 typedef $uvtype UV;
18124 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18126 u.l = (UV)0x04030201;
18127 for (i = 0; i < $uvsize; i++)
18128 printf("%c", u.c[i]+'0');
18135 if eval $compile && $run ./try > /dev/null; then
18138 [1-4][1-4][1-4][1-4]|12345678|87654321)
18139 echo "(The test program ran ok.)"
18140 echo "byteorder=$dflt"
18143 ????|????????) echo "(The test program ran ok.)" ;;
18144 *) echo "(The test program didn't run right for some reason.)" ;;
18149 (I can't seem to compile the test program. Guessing big-endian...)
18152 case "$xxx_prompt" in
18154 rp="What is the order of bytes in $uvtype?"
18167 : Checking 32bit aligndness
18170 Checking to see whether you can access character data unalignedly...
18172 case "$d_u32align" in
18173 '') $cat >try.c <<EOCP
18175 #$i_stdlib I_STDLIB
18177 #include <stdlib.h>
18179 #define U32 $u32type
18180 #define BYTEORDER 0x$byteorder
18182 #include <signal.h>
18184 $signal_t bletch(int s) { exit(4); }
18187 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18192 if (sizeof(U32) != 4) {
18193 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18200 signal(SIGBUS, bletch);
18212 for (i = 0; i < 4; i++) {
18213 up = (U32*)(buf + i);
18214 if (! ((*up == 1 << (8*i)) || /* big-endian */
18215 (*up == 1 << (8*(3-i))) /* little-endian */
18219 printf("read failed (%x)\n", *up);
18225 for (i = 0; i < 4; i++) {
18226 up = (U32*)(buf + i);
18228 if (*up != 0xBeef) {
18229 printf("write failed (%x)\n", *up);
18243 if eval $compile_ok; then
18244 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18245 $run ./try 2>&1 >/dev/null
18248 You can access character data pretty unalignedly.
18250 d_u32align="$undef"
18253 It seems that you must access character data in an aligned manner.
18255 d_u32align="$define"
18259 rp='Can you access character data at unaligned addresses?'
18263 [yY]*) d_u32align="$undef" ;;
18264 *) d_u32align="$define" ;;
18271 : see if ualarm exists
18272 set ualarm d_ualarm
18275 : see if umask exists
18279 : see if unordered exists
18280 set unordered d_unordered
18283 : see if unsetenv exists
18284 set unsetenv d_unsetenv
18287 : see if usleep exists
18288 set usleep d_usleep
18291 : see if prototype for usleep is available
18293 set d_usleepproto usleep $i_unistd unistd.h
18296 : see if ustat exists
18300 : see if closedir exists
18301 set closedir d_closedir
18304 case "$d_closedir" in
18307 echo "Checking whether closedir() returns a status..." >&4
18309 #$i_dirent I_DIRENT /**/
18310 #$i_sysdir I_SYS_DIR /**/
18311 #$i_sysndir I_SYS_NDIR /**/
18312 #$i_systypes I_SYS_TYPES /**/
18314 #if defined(I_SYS_TYPES)
18315 #include <sys/types.h>
18317 #if defined(I_DIRENT)
18318 #include <dirent.h>
18319 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18320 #include <sys/dir.h>
18324 #include <sys/ndir.h>
18328 #include <ndir.h> /* may be wrong in the future */
18330 #include <sys/dir.h>
18335 int main() { return closedir(opendir(".")); }
18338 if eval $compile_ok; then
18339 if $run ./try > /dev/null 2>&1 ; then
18340 echo "Yes, it does."
18343 echo "No, it doesn't."
18347 echo "(I can't seem to compile the test program--assuming it doesn't)"
18355 set d_void_closedir
18359 : see if there is a wait4
18363 : see if waitpid exists
18364 set waitpid d_waitpid
18367 : see if wcstombs exists
18368 set wcstombs d_wcstombs
18371 : see if wctomb exists
18372 set wctomb d_wctomb
18375 : see if writev exists
18376 set writev d_writev
18379 : preserve RCS keywords in files with variable substitution, grrr
18384 Revision='$Revision'
18386 : check for alignment requirements
18388 case "$usecrosscompile$multiarch" in
18391 You seem to be either cross-compiling or doing a multiarchitecture build,
18392 skipping the memory alignment check.
18395 case "$alignbytes" in
18396 '') alignbytes=8 ;;
18400 case "$alignbytes" in
18401 '') echo "Checking alignment constraints..." >&4
18402 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18403 $cat >try.c <<'EOCP'
18404 typedef long double NV;
18407 $cat >try.c <<'EOCP'
18411 $cat >>try.c <<'EOCP'
18419 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18424 if eval $compile_ok; then
18428 echo "(I can't seem to compile the test program...)"
18431 *) dflt="$alignbytes"
18434 rp="Doubles must be aligned on a how-many-byte boundary?"
18442 : set the base revision
18445 : how do we concatenate cpp tokens here?
18447 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18448 $cat >cpp_stuff.c <<'EOCP'
18449 #define RCAT(a,b)a/**/b
18450 #define ACAT(a,b)a ## b
18454 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18455 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18456 echo "Oh! Smells like ANSI's been here." >&4
18457 echo "We can catify or stringify, separately or together!"
18459 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18460 echo "Ah, yes! The good old days!" >&4
18461 echo "However, in the good old days we don't know how to stringify and"
18462 echo "catify at the same time."
18466 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18467 You're going to have to edit the values of CAT[2-5] in config.h...
18469 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18473 : see if this is a db.h system
18479 : Check db version.
18481 echo "Checking Berkeley DB version ..." >&4
18487 #include <sys/types.h>
18489 #$i_stdlib I_STDLIB
18491 #include <stdlib.h>
18494 int main(int argc, char *argv[])
18496 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18497 int Major, Minor, Patch ;
18498 unsigned long Version ;
18499 (void)db_version(&Major, &Minor, &Patch) ;
18501 printf("%d %d %d %d %d %d\n",
18502 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18503 Major, Minor, Patch);
18506 printf("You have Berkeley DB Version 2 or greater.\n");
18508 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18509 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18510 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18511 Major, Minor, Patch) ;
18513 /* check that db.h & libdb are compatible */
18514 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18515 printf("db.h and libdb are incompatible.\n") ;
18519 printf("db.h and libdb are compatible.\n") ;
18521 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18522 + DB_VERSION_PATCH ;
18524 /* needs to be >= 2.3.4 */
18525 if (Version < 2003004) {
18526 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18527 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18533 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18538 printf("You have Berkeley DB Version 1.\n");
18539 exit(0); /* DB version < 2: the coast is clear. */
18541 exit(1); /* <db.h> not Berkeley DB? */
18547 if eval $compile_ok && $run ./try; then
18548 echo 'Looks OK.' >&4
18550 db_version_major=$1
18551 db_version_minor=$2
18552 db_version_patch=$3
18554 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18558 : Remove db from list of libraries to use
18559 echo "Removing unusable -ldb from library list" >&4
18560 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18563 echo "libs = $libs" >&4
18573 : Check the return type needed for hash
18575 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18581 #include <sys/types.h>
18584 #ifndef DB_VERSION_MAJOR
18585 u_int32_t hash_cb (ptr, size)
18593 info.hash = hash_cb;
18597 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18598 if $contains warning try.out >>/dev/null 2>&1 ; then
18601 db_hashtype='u_int32_t'
18604 : XXX Maybe we should just give up here.
18605 db_hashtype=u_int32_t
18607 echo "Help: I can't seem to compile the db test program." >&4
18608 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18611 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18613 *) db_hashtype=u_int32_t
18618 : Check the return type needed for prefix
18620 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18626 #include <sys/types.h>
18629 #ifndef DB_VERSION_MAJOR
18630 size_t prefix_cb (key1, key2)
18638 info.prefix = prefix_cb;
18642 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18643 if $contains warning try.out >>/dev/null 2>&1 ; then
18644 db_prefixtype='int'
18646 db_prefixtype='size_t'
18649 db_prefixtype='size_t'
18650 : XXX Maybe we should just give up here.
18652 echo "Help: I can't seem to compile the db test program." >&4
18653 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18656 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18658 *) db_prefixtype='size_t'
18662 : How can we generate normalized random numbers ?
18664 echo "Looking for a random number function..." >&4
18665 case "$randfunc" in
18667 if set drand48 val -f; eval $csym; $val; then
18669 echo "Good, found drand48()." >&4
18670 elif set random val -f; eval $csym; $val; then
18672 echo "OK, found random()." >&4
18675 echo "Yick, looks like I have to use rand()." >&4
18686 *-Dmy_rand=*|*-Dmy_srand=*)
18687 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18688 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18689 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18690 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18694 while $test "$cont"; do
18695 rp="Use which function to generate random numbers?"
18697 if $test "$ans" = "$dflt"; then
18703 if set $ans val -f; eval $csym; $val; then
18707 rp="I cannot find function $ans. Use that name anyway?"
18716 case "$randfunc" in
18718 drand01="drand48()"
18724 case "$randbits" in
18726 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18728 #$i_unistd I_UNISTD
18729 #$i_stdlib I_STDLIB
18732 # include <unistd.h>
18735 # include <stdlib.h>
18740 register unsigned long tmp;
18741 register unsigned long max = 0L;
18743 for (i = 1000; i; i--) {
18744 tmp = (unsigned long) $randfunc();
18745 if (tmp > max) max = tmp;
18747 for (i = 0; max; i++)
18753 if eval $compile_ok; then
18757 echo "(I can't seem to compile the test program...)"
18764 rp="How many bits does your $randfunc() function produce?"
18768 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18769 seedfunc="s$randfunc"
18770 randseedtype=unsigned
18774 rp="How many bits does your $randfunc() function produce?"
18777 seedfunc="s$randfunc"
18778 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18779 if set $seedfunc val -f; eval $csym; $val; then
18780 echo "(Using $seedfunc() to seed random generator)"
18782 echo "(Warning: no $seedfunc() to seed random generator)"
18785 randseedtype=unsigned
18792 : Determine if this is an EBCDIC system
18794 echo "Determining whether or not we are on an EBCDIC system..." >&4
18795 $cat >try.c <<'EOM'
18798 if ('M'==0xd4) return 0;
18805 if eval $compile_ok; then
18806 if $run ./try; then
18807 echo "You seem to speak EBCDIC." >&4
18810 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18813 echo "I'm unable to compile the test program." >&4
18814 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18820 : Check how to flush
18823 Checking how to flush all pending stdio output...
18825 # I only know how to find the first 32 possibly open files on SunOS.
18826 # See also hints/sunos_4_1.sh and util.c --AD
18828 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18830 $cat >>try.c <<EOCP
18832 #$i_stdlib I_STDLIB
18834 #include <stdlib.h>
18836 #$i_unistd I_UNISTD
18838 # include <unistd.h>
18840 #$d_sysconf HAS_SYSCONF
18841 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18842 #ifdef HAS_STDIO_STREAM_ARRAY
18843 # define STDIO_STREAM_ARRAY $stdio_stream_array
18848 p = fopen("try.out", "w");
18852 # ifdef TRY_FPRINTF
18856 #ifdef TRY_FFLUSH_NULL
18859 #ifdef TRY_FFLUSH_ALL
18861 long open_max = -1;
18862 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18863 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18865 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18866 open_max = sysconf(_SC_OPEN_MAX);
18869 open_max = FOPEN_MAX;
18872 open_max = OPEN_MAX;
18881 # ifdef HAS_STDIO_STREAM_ARRAY
18882 if (open_max > 0) {
18884 for (i = 0; i < open_max; i++)
18885 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18886 STDIO_STREAM_ARRAY[i]._file < open_max &&
18887 STDIO_STREAM_ARRAY[i]._flag)
18888 fflush(&STDIO_STREAM_ARRAY[i]);
18896 : first we have to find out how _not_ to flush
18898 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18900 set try -DTRY_FPUTC
18901 if eval $compile; then
18902 $run ./try 2>/dev/null
18905 if $test ! -s try.out -a "X$code" = X42; then
18911 set try -DTRY_FPRINTF
18912 if eval $compile; then
18913 $run ./try 2>/dev/null
18916 if $test ! -s try.out -a "X$code" = X42; then
18917 output=-DTRY_FPRINTF
18923 : check for fflush NULL behaviour
18924 case "$fflushNULL" in
18925 '') set try -DTRY_FFLUSH_NULL $output
18926 if eval $compile; then
18927 $run ./try 2>/dev/null
18930 if $test -s try.out -a "X$code" = X42; then
18931 fflushNULL="`$cat try.out`"
18933 if $test "X$code" != X42; then
18935 (If this test failed, don't worry, we'll try another method shortly.)
18941 case "$fflushNULL" in
18943 Your fflush(NULL) works okay for output streams.
18944 Let's see if it clobbers input pipes...
18946 # As of mid-March 2000 all versions of Solaris appear to have a stdio
18947 # bug that improperly flushes the input end of pipes. So we avoid the
18948 # autoflush on fork/system/exec support for now. :-(
18949 $cat >tryp.c <<EOCP
18952 main(int argc, char **argv)
18958 while ((i = getc(stdin)) != -1
18959 && (*bp++ = i) != '\n'
18960 && bp < &buf[1024])
18963 fprintf(stdout, "%s", buf);
18971 fflushNULL="$define"
18973 if eval $compile; then
18975 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18976 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18978 fflush(NULL) seems to behave okay with input streams.
18980 fflushNULL="$define"
18983 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18985 fflushNULL="$undef"
18988 $rm -f core tryp.c tryp.core core.tryp.*
18991 Your fflush(NULL) isn't working (contrary to ANSI C).
18993 fflushNULL="$undef"
18996 Cannot figure out whether your fflush(NULL) works or not.
18997 I'm assuming it doesn't (contrary to ANSI C).
18999 fflushNULL="$undef"
19003 $define|true|[yY]*)
19004 fflushNULL="$define"
19007 fflushNULL="$undef"
19010 : check explicit looping only if NULL did not work, and if the pipe
19011 : bug does not show up on an explicit flush too
19012 case "$fflushNULL" in
19014 $cat >tryp.c <<EOCP
19017 main(int argc, char **argv)
19023 while ((i = getc(stdin)) != -1
19024 && (*bp++ = i) != '\n'
19025 && bp < &buf[1024])
19028 fprintf(stdout, "%s", buf);
19037 if eval $compile; then
19039 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19040 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19042 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19044 : now check for fflushall behaviour
19045 case "$fflushall" in
19046 '') set try -DTRY_FFLUSH_ALL $output
19047 if eval $compile; then
19049 (Now testing the other method--but note that this also may fail.)
19051 $run ./try 2>/dev/null
19054 if $test -s try.out -a "X$code" = X42; then
19055 fflushall="`$cat try.out`"
19059 case "$fflushall" in
19061 Whew. Flushing explicitly all the stdio streams works.
19063 fflushall="$define"
19066 Sigh. Flushing explicitly all the stdio streams doesn't work.
19071 Cannot figure out whether flushing stdio streams explicitly works or not.
19072 I'm assuming it doesn't.
19078 "$define"|true|[yY]*)
19079 fflushall="$define"
19087 All is futile. Even fflush(stdin) clobbers input pipes!
19094 $rm -f core tryp.c tryp.core core.tryp.*
19096 *) fflushall="$undef"
19100 case "$fflushNULL$fflushall" in
19103 OK, I give up. I cannot figure out how to flush pending stdio output.
19104 We won't be flushing handles at all before fork/exec/popen.
19110 : Store the full pathname to the ar program for use in the C program
19111 : Respect a hint or command line value for full_ar.
19116 : Store the full pathname to the sed program for use in the C program
19119 : see what type gids are declared as in the kernel
19121 echo "Looking for the type for group ids returned by getgid()."
19122 set gid_t gidtype xxx stdio.h sys/types.h
19126 xxx=`./findhdr sys/user.h`
19127 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19129 unsigned) dflt="$1 $2" ;;
19133 *) dflt="$gidtype";;
19136 gid_t) echo "gid_t found." ;;
19137 *) rp="What is the type for group ids returned by getgid()?"
19143 : Check the size of GID
19146 *_t) zzz="$gidtype" ;;
19149 echo "Checking the size of $zzz..." >&4
19151 #include <sys/types.h>
19153 #$i_stdlib I_STDLIB
19155 #include <stdlib.h>
19158 printf("%d\n", (int)sizeof($gidtype));
19163 if eval $compile_ok; then
19167 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19170 echo "Your $zzz is $gidsize bytes long."
19175 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19179 : Check if GID is signed
19182 *_t) zzz="$gidtype" ;;
19185 echo "Checking the sign of $zzz..." >&4
19187 #include <sys/types.h>
19198 if eval $compile; then
19202 echo "(I can't execute the test program--guessing unsigned.)" >&4
19206 1) echo "Your $zzz is unsigned." ;;
19207 -1) echo "Your $zzz is signed." ;;
19213 echo "(I can't compile the test program--guessing unsigned.)" >&4
19217 : Check 64bit sizes
19220 if $test X"$quadtype" != X; then
19222 echo "Checking how to print 64-bit integers..." >&4
19224 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19225 $cat >try.c <<'EOCP'
19226 #include <sys/types.h>
19229 int q = 12345678901;
19230 printf("%ld\n", q);
19234 if eval $compile; then
19238 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19239 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19240 echo "We will use %d."
19246 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19247 $cat >try.c <<'EOCP'
19248 #include <sys/types.h>
19251 long q = 12345678901;
19252 printf("%ld\n", q);
19256 if eval $compile; then
19260 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19261 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19262 echo "We will use %ld."
19268 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19269 $cat >try.c <<'EOCP'
19270 #include <sys/types.h>
19271 #include <inttypes.h>
19274 int64_t q = 12345678901;
19275 printf("%" PRId64 "\n", q);
19279 if eval $compile; then
19283 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19284 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19285 echo "We will use the C9X style."
19291 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19293 #include <sys/types.h>
19296 $quadtype q = 12345678901;
19297 printf("%Ld\n", q);
19301 if eval $compile; then
19305 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19306 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19307 echo "We will use %Ld."
19313 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19314 $cat >try.c <<'EOCP'
19315 #include <sys/types.h>
19318 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19319 printf("%lld\n", q);
19323 if eval $compile; then
19327 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19328 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19329 echo "We will use the %lld style."
19335 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19337 #include <sys/types.h>
19340 $quadtype q = 12345678901;
19341 printf("%qd\n", q);
19345 if eval $compile; then
19349 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19350 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19351 echo "We will use %qd."
19357 if $test X"$sPRId64" = X; then
19358 echo "Cannot figure out how to print 64-bit integers." >&4
19365 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19366 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19368 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19369 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19375 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19377 if $test X"$ivsize" = X8; then
19378 ivdformat="$sPRId64"
19379 uvuformat="$sPRIu64"
19380 uvoformat="$sPRIo64"
19381 uvxformat="$sPRIx64"
19382 uvXUformat="$sPRIXU64"
19384 if $test X"$ivsize" = X"$longsize"; then
19391 if $test X"$ivsize" = X"$intsize"; then
19399 if $test X"$ivsize" = X"$shortsize"; then
19410 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19411 nveformat="$sPRIeldbl"
19412 nvfformat="$sPRIfldbl"
19413 nvgformat="$sPRIgldbl"
19414 nvEUformat="$sPRIEUldbl"
19415 nvFUformat="$sPRIFUldbl"
19416 nvGUformat="$sPRIGUldbl"
19426 case "$ivdformat" in
19427 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19434 $echo "Checking the format string to be used for gids..." >&4
19437 -1) if $test X"$gidsize" = X"$ivsize"; then
19438 gidformat="$ivdformat"
19440 if $test X"$gidsize" = X"$longsize"; then
19443 if $test X"$gidsize" = X"$intsize"; then
19446 if $test X"$gidsize" = X"$shortsize"; then
19453 *) if $test X"$gidsize" = X"$uvsize"; then
19454 gidformat="$uvuformat"
19456 if $test X"$gidsize" = X"$longsize"; then
19459 if $test X"$gidsize" = X"$intsize"; then
19462 if $test X"$gidsize" = X"$shortsize"; then
19471 : see if getgroups exists
19472 set getgroups d_getgrps
19475 : see if setgroups exists
19476 set setgroups d_setgrps
19480 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19482 case "$d_getgrps$d_setgrps" in
19484 case "$groupstype" in
19485 '') dflt="$gidtype" ;;
19486 *) dflt="$groupstype" ;;
19489 What type of pointer is the second argument to getgroups() and setgroups()?
19490 Usually this is the same as group ids, $gidtype, but not always.
19493 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19497 *) groupstype="$gidtype";;
19500 : MAD = Misc Attribute Definition
19502 if $test $patchlevel -lt 9; then
19503 : MAD is not available in 5.8.x or earlier.
19507 $define|true|[yY]*) dflt='y' ;;
19512 Would you like to build with Misc Attribute Decoration? This is development
19513 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19514 overhead on the interpreter.
19516 If this doesn't make any sense to you, just accept the default '$dflt'.
19518 rp='Build Perl with MAD?'
19523 madlyh='madly.h madly.act madly.tab'
19525 madlyobj="madly$_o" ;;
19535 echo "Checking if your $make program sets \$(MAKE)..." >&4
19536 case "$make_set_make" in
19538 $sed 's/^X //' > testmake.mak << 'EOF'
19540 X @echo 'maketemp="$(MAKE)"'
19542 case "`$make -f testmake.mak 2>/dev/null`" in
19543 *maketemp=*) make_set_make='#' ;;
19544 *) make_set_make="MAKE=$make" ;;
19546 $rm -f testmake.mak
19549 case "$make_set_make" in
19550 '#') echo "Yup, it does.";;
19551 *) echo "Nope, it doesn't.";;
19554 : see what type is used for mode_t
19555 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19556 set mode_t modetype int stdio.h sys/types.h
19559 : see if we need va_copy
19561 case "$i_stdarg" in
19564 #include <stdarg.h>
19566 #$i_stdlib I_STDLIB
19568 #include <stdlib.h>
19570 #include <signal.h>
19573 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19575 return vfprintf(f, fmt, *valp);
19579 myvfprintf(FILE *f, const char *fmt, va_list val)
19581 return ivfprintf(f, fmt, &val);
19585 myprintf(char *fmt, ...)
19588 va_start(val, fmt);
19589 return myvfprintf(stdout, fmt, val);
19593 main(int ac, char **av)
19595 signal(SIGSEGV, exit);
19597 myprintf("%s%cs all right, then\n", "that", '\'');
19602 if eval $compile && $run ./try 2>&1 >/dev/null; then
19603 case "`$run ./try`" in
19604 "that's all right, then")
19610 yes) echo "It seems that you don't need va_copy()." >&4
19611 need_va_copy="$undef"
19613 *) echo "It seems that va_copy() or similar will be needed." >&4
19614 need_va_copy="$define"
19619 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19623 : see what type is used for size_t
19624 rp="What is the type used for the length parameter for string functions?"
19625 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19628 : check for type of arguments to gethostbyaddr.
19629 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19630 case "$d_gethbyaddr" in
19634 Checking to see what type of arguments are accepted by gethostbyaddr().
19636 hdrs="$define sys/types.h
19637 $d_socket sys/socket.h
19638 $i_niin netinet/in.h
19640 $i_unistd unistd.h"
19641 : The first arg can 'char *' or 'void *'
19642 : The second arg is some of integral type
19643 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19644 for yyy in size_t long int; do
19645 case "$netdb_host_type" in
19646 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19647 if ./protochk "$try" $hdrs; then
19648 echo "Your system accepts $xxx for the first arg."
19649 echo "...and $yyy for the second arg."
19650 netdb_host_type="$xxx"
19651 netdb_hlen_type="$yyy"
19657 : In case none of those worked, prompt the user.
19658 case "$netdb_host_type" in
19659 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19662 netdb_host_type=$ans
19663 rp='What is the type for the 2nd argument to gethostbyaddr?'
19666 netdb_hlen_type=$ans
19670 *) : no gethostbyaddr, so pick harmless defaults
19671 netdb_host_type='char *'
19672 netdb_hlen_type="$sizetype"
19675 # Remove the "const" if needed. -- but then we'll have a
19677 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19680 : check for type of argument to gethostbyname.
19681 if test "X$netdb_name_type" = X ; then
19682 case "$d_gethbyname" in
19686 Checking to see what type of argument is accepted by gethostbyname().
19688 hdrs="$define sys/types.h
19689 $d_socket sys/socket.h
19690 $i_niin netinet/in.h
19692 $i_unistd unistd.h"
19693 for xxx in "const char *" "char *"; do
19694 case "$netdb_name_type" in
19695 '') try="extern struct hostent *gethostbyname($xxx);"
19696 if ./protochk "$try" $hdrs; then
19697 echo "Your system accepts $xxx."
19698 netdb_name_type="$xxx"
19703 : In case none of those worked, prompt the user.
19704 case "$netdb_name_type" in
19705 '') rp='What is the type for the 1st argument to gethostbyname?'
19708 netdb_name_type=$ans
19712 *) : no gethostbyname, so pick harmless default
19713 netdb_name_type='char *'
19718 : check for type of 1st argument to getnetbyaddr.
19719 if test "X$netdb_net_type" = X ; then
19720 case "$d_getnbyaddr" in
19724 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19726 hdrs="$define sys/types.h
19727 $d_socket sys/socket.h
19728 $i_niin netinet/in.h
19730 $i_unistd unistd.h"
19731 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19732 case "$netdb_net_type" in
19733 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19734 if ./protochk "$try" $hdrs; then
19735 echo "Your system accepts $xxx."
19736 netdb_net_type="$xxx"
19741 : In case none of those worked, prompt the user.
19742 case "$netdb_net_type" in
19743 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19746 netdb_net_type=$ans
19750 *) : no getnetbyaddr, so pick harmless default
19751 netdb_net_type='long'
19755 : locate the preferred pager for this system
19762 [a-zA-Z]:/*) dflt=$pg;;
19766 [a-zA-Z]:/*) dflt=$more;;
19770 [a-zA-Z]:/*) dflt=$less;;
19773 '') dflt=/usr/ucb/more;;
19777 : Instruct ./getfile to trust the hinted or previous pager value,
19778 : even if it does not begin with a slash. For example, on os2,
19779 : pager might be cmd /c more. See comments in UU/getfile.
19784 rp='What pager is used on your system?'
19788 : see what type pids are declared as in the kernel
19789 rp="What is the type of process ids on this system?"
19790 set pid_t pidtype int stdio.h sys/types.h
19793 : see if ar generates random libraries by itself
19795 echo "Checking how to generate random libraries on your machine..." >&4
19796 echo 'int bar1() { return bar2(); }' > bar1.c
19797 echo 'int bar2() { return 2; }' > bar2.c
19799 #$i_stdlib I_STDLIB
19801 #include <stdlib.h>
19803 int main() { printf("%d\n", bar1()); exit(0); }
19805 $cc $ccflags -c bar1.c >/dev/null 2>&1
19806 $cc $ccflags -c bar2.c >/dev/null 2>&1
19807 $cc $ccflags -c foo.c >/dev/null 2>&1
19808 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19809 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19810 $run ./foobar >/dev/null 2>&1; then
19811 echo "$ar appears to generate random libraries itself."
19813 if [ "X$ranlib" = "X" ]; then
19816 elif $ar s bar$_a >/dev/null 2>&1 &&
19817 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19818 $run ./foobar >/dev/null 2>&1; then
19819 echo "a table of contents needs to be added with '$ar s'."
19822 elif $ar ts bar$_a >/dev/null 2>&1 &&
19823 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19824 $run ./foobar >/dev/null 2>&1; then
19825 echo "a table of contents needs to be added with '$ar ts'."
19832 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19833 $test -f $ranlib || ranlib=''
19836 if $test -n "$ranlib"; then
19837 echo "your system has '$ranlib'; we'll use that."
19840 echo "your system doesn't seem to support random libraries"
19841 echo "so we'll use lorder and tsort to order the libraries."
19848 : check for type of arguments to select.
19849 case "$selecttype" in
19850 '') case "$d_select" in
19854 Checking to see what type of arguments are accepted by select().
19856 hdrs="$define sys/types.h
19857 $i_systime sys/time.h
19858 $i_sysselct sys/select.h
19859 $d_socket sys/socket.h"
19860 : The first arg can be int, unsigned, or size_t
19861 : The last arg may or may not be 'const'
19863 : void pointer has been seen but using that
19864 : breaks the selectminbits test
19865 for xxx in 'fd_set *' 'int *'; do
19866 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19867 for tmo in 'struct timeval *' 'const struct timeval *'; do
19869 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19870 if ./protochk "$try" $hdrs; then
19871 echo "Your system accepts $xxx."
19880 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19881 case "$d_fd_set" in
19882 $define) dflt="fd_set *" ;;
19891 *) : no select, so pick a harmless default
19898 : check for the select 'width'
19899 case "$selectminbits" in
19900 '') safebits=`expr $ptrsize \* 8`
19901 case "$d_select" in
19905 Checking to see on how many bits at a time your select() operates...
19908 #include <sys/types.h>
19910 #$i_systime I_SYS_TIME
19911 #$i_systimek I_SYS_TIME_KERNEL
19916 # ifdef I_SYS_TIME_KERNEL
19919 # include <sys/time.h>
19920 # ifdef I_SYS_TIME_KERNEL
19924 #$i_sysselct I_SYS_SELECT
19925 #ifdef I_SYS_SELECT
19926 #include <sys/select.h>
19928 #$d_socket HAS_SOCKET
19930 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19933 #$i_stdlib I_STDLIB
19935 #include <stdlib.h>
19938 #define S sizeof(*(b))
19940 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19941 #define NBITS (NBYTES * 8)
19943 char *s = (char *)malloc(NBYTES);
19952 fp = fopen("try.c", "r");
19958 b = ($selecttype)s;
19959 for (i = 0; i < NBITS; i++)
19963 select(fd + 1, b, 0, 0, &t);
19964 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19966 printf("%d\n", i + 1);
19971 if eval $compile_ok; then
19972 selectminbits=`$run ./try`
19973 case "$selectminbits" in
19975 Cannot figure out on how many bits at a time your select() operates.
19976 I'll play safe and guess it is $safebits bits.
19978 selectminbits=$safebits
19979 bits="$safebits bits"
19982 *) bits="$selectminbits bits" ;;
19984 echo "Your select() operates on $bits at a time." >&4
19986 rp='What is the minimum number of bits your select() operates on?'
19987 case "$byteorder" in
19988 12345678) dflt=64 ;;
19994 selectminbits="$val"
19998 *) : no select, so pick a harmless default
19999 selectminbits=$safebits
20005 : Trace out the files included by signal.h, then look for SIGxxx names.
20006 : Remove SIGARRAYSIZE used by HPUX.
20007 : Remove SIGSTKSIZE used by Linux.
20008 : Remove SIGSTKSZ used by Posix.
20009 : Remove SIGTYP void lines used by OS2.
20010 : Some cpps, like os390, dont give the file name anywhere
20011 if [ "X$fieldn" = X ]; then
20012 : Just make some guesses. We check them later.
20013 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20015 xxx=`echo '#include <signal.h>' |
20016 $cppstdin $cppminus $cppflags 2>/dev/null |
20017 $grep '^[ ]*#.*include' |
20018 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20020 : Check this list of files to be sure we have parsed the cpp output ok.
20021 : This will also avoid potentially non-existent files, such
20024 for xx in $xxx /dev/null ; do
20025 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20027 : If we have found no files, at least try signal.h
20028 case "$xxxfiles" in
20029 '') xxxfiles=`./findhdr signal.h` ;;
20032 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20033 print substr($2, 4, 20)
20035 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20036 print substr($3, 4, 20)
20038 : Append some common names just in case the awk scan failed.
20039 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20040 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20041 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20042 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20043 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20045 : generate a few handy files for later
20046 $cat > signal.c <<EOCP
20047 #include <sys/types.h>
20048 #include <signal.h>
20049 #$i_stdlib I_STDLIB
20051 #include <stdlib.h>
20056 /* Strange style to avoid deeply-nested #if/#else/#endif */
20059 # define NSIG (_NSIG)
20065 # define NSIG (SIGMAX+1)
20071 # define NSIG (SIG_MAX+1)
20077 # define NSIG (_SIG_MAX+1)
20083 # define NSIG (MAXSIG+1)
20089 # define NSIG (MAX_SIG+1)
20094 # ifdef SIGARRAYSIZE
20095 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20101 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20105 /* Default to some arbitrary number that's big enough to get most
20106 of the common signals.
20112 printf("NSIG %d\n", NSIG);
20118 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20120 printf "#ifdef SIG"; printf $1; printf "\n"
20121 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20122 printf $1; printf ");\n"
20126 printf "#endif /* JUST_NSIG */\n";
20127 printf "exit(0);\n}\n";
20130 $cat >signal.awk <<'EOP'
20131 BEGIN { ndups = 0 }
20132 $1 ~ /^NSIG$/ { nsig = $2 }
20133 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20134 if ($2 > maxsig) { maxsig = $2 }
20135 if (sig_name[$2]) {
20136 dup_name[ndups] = $1
20137 dup_num[ndups] = $2
20149 printf("NSIG %d\n", nsig);
20150 for (n = 1; n < nsig; n++) {
20152 printf("%s %d\n", sig_name[n], sig_num[n])
20155 printf("NUM%d %d\n", n, n)
20158 for (n = 0; n < ndups; n++) {
20159 printf("%s %d\n", dup_name[n], dup_num[n])
20163 $cat >signal_cmd <<EOS
20165 if $test -s signal.lst; then
20166 echo "Using your existing signal.lst file"
20171 $cat >>signal_cmd <<'EOS'
20174 if eval $compile_ok; then
20175 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
20177 echo "(I can't seem be able to compile the whole test program)" >&4
20178 echo "(I'll try it in little pieces.)" >&4
20179 set signal -DJUST_NSIG
20180 if eval $compile_ok; then
20181 $run ./signal$_exe > signal.nsg
20184 echo "I can't seem to figure out how many signals you have." >&4
20185 echo "Guessing 50." >&4
20186 echo 'NSIG 50' > signal.nsg
20188 : Now look at all the signal names, one at a time.
20189 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20190 $cat > signal.c <<EOCP
20191 #include <sys/types.h>
20192 #include <signal.h>
20195 printf("$xx %d\n", SIG${xx});
20200 if eval $compile; then
20201 echo "SIG${xx} found."
20202 $run ./signal$_exe >> signal.ls1
20204 echo "SIG${xx} NOT found."
20207 if $test -s signal.ls1; then
20208 $cat signal.nsg signal.ls1 |
20209 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20213 if $test -s signal.lst; then
20216 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20217 echo 'kill -l' >signal
20218 set X `csh -f <signal`
20222 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20224 echo $@ | $tr ' ' $trnl | \
20225 $awk '{ printf "%s %d\n", $1, ++s; }
20226 END { printf "NSIG %d\n", ++s }' >signal.lst
20228 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20230 chmod a+x signal_cmd
20231 $eunicefix signal_cmd
20233 : generate list of signal names
20235 case "$sig_name_init" in
20237 *) case "$sig_num_init" in
20238 ''|*,*) doinit=yes ;;
20243 echo "Generating a list of signal names and numbers..." >&4
20245 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20246 sig_name=`$awk 'BEGIN { printf "ZERO " }
20247 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20248 sig_num=`$awk 'BEGIN { printf "0 " }
20249 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20250 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20251 !/^NSIG/ { printf "\"%s\", ", $1 }
20252 END { printf "0\n" }' signal.lst`
20253 sig_num_init=`$awk 'BEGIN { printf "0, " }
20254 !/^NSIG/ { printf "%d, ", $2}
20255 END { printf "0\n"}' signal.lst`
20258 echo "The following $sig_count signals are available:"
20260 echo $sig_name | $awk \
20261 'BEGIN { linelen = 0 }
20263 for (i = 1; i <= NF; i++) {
20264 name = "SIG" $i " "
20265 linelen = linelen + length(name)
20266 if (linelen > 70) {
20268 linelen = length(name)
20274 sig_size=`echo $sig_name | awk '{print NF}'`
20275 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20277 : Check size of size
20279 case "$sizetype" in
20280 *_t) zzz="$sizetype" ;;
20281 *) zzz="filesize" ;;
20283 echo "Checking the size of $zzz..." >&4
20285 #include <sys/types.h>
20287 #$i_stdlib I_STDLIB
20289 #include <stdlib.h>
20292 printf("%d\n", (int)sizeof($sizetype));
20297 if eval $compile_ok; then
20301 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20304 echo "Your $zzz size is $sizesize bytes."
20309 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20313 : check for socklen_t
20315 echo "Checking to see if you have socklen_t..." >&4
20317 #include <sys/types.h>
20318 #$d_socket HAS_SOCKET
20320 #include <sys/socket.h>
20322 int main() { socklen_t x = 16; }
20325 if eval $compile; then
20327 echo "You have socklen_t."
20330 echo "You do not have socklen_t."
20331 case "$sizetype" in
20332 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20339 : see if this is a socks.h system
20340 set socks.h i_socks
20343 : check for type of the size argument to socket calls
20344 case "$d_socket" in
20348 Checking to see what type is the last argument of accept().
20351 case "$d_socklen_t" in
20352 "$define") yyy="$yyy socklen_t"
20354 yyy="$yyy $sizetype int long unsigned"
20355 for xxx in $yyy; do
20356 case "$socksizetype" in
20357 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20358 case "$usesocks" in
20360 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20361 echo "Your system accepts '$xxx *' for the last argument of accept()."
20362 socksizetype="$xxx"
20365 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20366 echo "Your system accepts '$xxx *' for the last argument of accept()."
20367 socksizetype="$xxx"
20374 : In case none of those worked, prompt the user.
20375 case "$socksizetype" in
20376 '') rp='What is the type for socket address structure sizes?'
20383 *) : no sockets, so pick relatively harmless default
20388 : see what type is used for signed size_t
20389 set ssize_t ssizetype int stdio.h sys/types.h
20394 #$i_stdlib I_STDLIB
20396 #include <stdlib.h>
20398 #include <sys/types.h>
20399 #define Size_t $sizetype
20400 #define SSize_t $dflt
20403 if (sizeof(Size_t) == sizeof(SSize_t))
20405 else if (sizeof(Size_t) == sizeof(int))
20414 if eval $compile_ok && $run ./try > /dev/null; then
20415 ssizetype=`$run ./try`
20416 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20419 Help! I can't compile and run the ssize_t test program: please enlighten me!
20420 (This is probably a misconfiguration in your system or libraries, and
20421 you really ought to fix it. Still, I'll try anyway.)
20423 I need a type that is the same size as $sizetype, but is guaranteed to
20424 be signed. Common values are ssize_t, int and long.
20427 rp="What signed type is the same size as $sizetype?"
20433 : see what type of char stdio uses.
20435 echo '#include <stdio.h>' > stdio.c
20436 $cppstdin $cppminus < stdio.c > stdioh
20437 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20438 echo "Your stdio uses unsigned chars." >&4
20439 stdchar="unsigned char"
20441 echo "Your stdio uses signed chars." >&4
20444 $rm -f stdio.* stdioh
20446 : see what type uids are declared as in the kernel
20448 echo "Looking for the type for user ids returned by getuid()."
20449 set uid_t uidtype xxx stdio.h sys/types.h
20453 xxx=`./findhdr sys/user.h`
20454 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20456 unsigned) dflt="$1 $2" ;;
20460 *) dflt="$uidtype";;
20463 uid_t) echo "uid_t found." ;;
20464 *) rp="What is the type for user ids returned by getuid()?"
20470 : Check size of UID
20473 *_t) zzz="$uidtype" ;;
20476 echo "Checking the size of $zzz..." >&4
20478 #include <sys/types.h>
20480 #$i_stdlib I_STDLIB
20482 #include <stdlib.h>
20485 printf("%d\n", (int)sizeof($uidtype));
20490 if eval $compile_ok; then
20494 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20497 echo "Your $zzz is $uidsize bytes long."
20502 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20505 : Check if UID is signed
20508 *_t) zzz="$uidtype" ;;
20511 echo "Checking the sign of $zzz..." >&4
20513 #include <sys/types.h>
20524 if eval $compile; then
20528 echo "(I can't execute the test program--guessing unsigned.)" >&4
20532 1) echo "Your $zzz is unsigned." ;;
20533 -1) echo "Your $zzz is signed." ;;
20539 echo "(I can't compile the test program--guessing unsigned.)" >&4
20545 $echo "Checking the format string to be used for uids..." >&4
20548 -1) if $test X"$uidsize" = X"$ivsize"; then
20549 uidformat="$ivdformat"
20551 if $test X"$uidsize" = X"$longsize"; then
20554 if $test X"$uidsize" = X"$intsize"; then
20557 if $test X"$uidsize" = X"$shortsize"; then
20564 *) if $test X"$uidsize" = X"$uvsize"; then
20565 uidformat="$uvuformat"
20567 if $test X"$uidsize" = X"$longsize"; then
20570 if $test X"$uidsize" = X"$intsize"; then
20573 if $test X"$uidsize" = X"$shortsize"; then
20583 case "$usesitecustomize" in
20584 $define|true|[Yy]*)
20585 usesitecustomize="$define"
20588 usesitecustomize="$undef"
20592 : determine compiler compiler
20601 if $test -f "$byacc$_exe"; then
20603 comp="byacc or $comp"
20605 if $test -f "$bison$_exe"; then
20606 comp="$comp or bison -y"
20608 rp="Which compiler compiler ($comp) shall I use?"
20617 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20624 : see if this is a assert.h system
20625 set assert.h i_assert
20628 : see if this is a fp.h system
20632 : see if this is a fp_class.h system
20633 set fp_class.h i_fp_class
20636 : see if gdbm.h is available
20641 : see if gdbm_open exists
20642 set gdbm_open d_gdbm_open
20644 case "$d_gdbm_open" in
20647 echo "We won't be including <gdbm.h>"
20656 : see if this is a ieeefp.h system
20657 case "$i_ieeefp" in
20658 '' ) set ieeefp.h i_ieeefp
20663 : see if this is a libutil.h system
20664 set libutil.h i_libutil
20667 : see if mach cthreads are available
20668 if test "X$usethreads" = "X$define"; then
20669 set mach/cthreads.h i_machcthr
20672 i_machcthr="$undef"
20675 : see if this is a mntent.h system
20676 set mntent.h i_mntent
20679 : see if ndbm.h is available
20685 # Some Linux distributions such as RedHat 7.1 put the
20686 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20687 if $test -f /usr/include/gdbm/ndbm.h; then
20688 echo '<gdbm/ndbm.h> found.'
20689 ccflags="$ccflags -I/usr/include/gdbm"
20690 cppflags="$cppflags -I/usr/include/gdbm"
20698 : see if dbm_open exists
20699 set dbm_open d_dbm_open
20701 case "$d_dbm_open" in
20704 echo "We won't be including <ndbm.h>"
20713 : see if net/errno.h is available
20715 set net/errno.h val
20718 : Unfortunately, it causes problems on some systems. Arrgh.
20721 cat > try.c <<'EOM'
20724 #include <net/errno.h>
20730 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20731 echo "We'll be including <net/errno.h>." >&4
20733 echo "We won't be including <net/errno.h>." >&4
20742 : see if netinet/tcp.h is available
20743 set netinet/tcp.h i_netinettcp
20746 : see if this is a poll.h system
20750 : see if this is a prot.h system
20754 : Preprocessor symbols
20756 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20757 $cat <<'EOSH' > Cppsym.know
20758 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20759 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20760 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20761 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20762 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20763 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20764 bull c cadmus clipper CMU COFF COMPILER_VERSION
20765 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20766 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20767 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20768 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20770 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20771 H3050R H3050RX hbullx20 hcx host_mips
20772 hp200 hp300 hp700 HP700 hp800 hp9000
20773 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20774 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20775 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20776 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20777 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20778 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20779 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20780 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20781 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20782 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20783 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20784 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20785 MATH_HAS_NO_SIDE_EFFECTS
20786 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20787 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20788 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20789 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20790 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20791 NetBSD news1500 news1700 news1800 news1900 news3700
20792 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20793 ns32016 ns32332 ns32k nsc32000
20794 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20795 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20796 pc532 pdp11 PGC PIC plexus PORTAR posix
20797 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20798 POSIX_C_SOURCE POSIX_SOURCE POWER
20799 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20800 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20801 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20802 sony sony_news sonyrisc sparc sparclite spectrum
20803 stardent stdc STDC_EXT stratos sun sun3 sun386
20804 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20805 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20806 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20807 sysV68 sysV88 Tek4132 Tek4300 titan
20808 TM3200 TM5400 TM5600
20809 tower tower32 tower32_200 tower32_600 tower32_700
20810 tower32_800 tower32_850 tss
20811 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20812 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20813 unix UNIX95 UNIX99 unixpc unos
20814 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20815 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20816 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20818 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20819 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20820 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20823 # Maybe put other stuff here too.
20824 cat <<EOSH >>Cppsym.know
20827 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20828 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20829 $cat Cppsym.know > Cppsym.c
20830 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20831 $rm -f Cppsym.a Cppsym.b Cppsym.c
20832 cat <<EOSH > Cppsym
20834 if $test \$# -gt 0; then
20835 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20836 if $test -s Cppsym.got; then
20843 $tr " " "$trnl" | ./Cppsym.try
20849 cat <<EOSH > Cppsym.try
20851 cat <<'EOCP' > try.c
20854 #define STRINGIFY(a) "a"
20856 #if cpp_stuff == 42
20857 #define StGiFy(a) #a
20858 #define STRINGIFY(a) StGiFy(a)
20860 #if $cpp_stuff != 1 && $cpp_stuff != 42
20861 # include "Bletch: How does this C preprocessor stringify macros?"
20867 cat <<'EOSH' >> Cppsym.try
20869 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20870 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20871 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20872 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20874 echo 'return 0;}' >> try.c
20876 cat <<EOSH >> Cppsym.try
20878 case "$osname-$gccversion" in
20879 irix-) ccflags="\$ccflags -woff 1178" ;;
20880 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20882 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20884 chmod +x Cppsym.try
20885 $eunicefix Cppsym.try
20886 ./Cppsym < Cppsym.know > Cppsym.true
20887 : Add in any linux cpp "predefined macros":
20888 case "$osname::$gccversion" in
20891 rm -f $tHdrH'.h' $tHdrH
20893 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20894 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20895 if [ -s $tHdrH'_cppsym.real' ]; then
20896 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20899 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20902 : now check the C compiler for additional symbols
20903 postprocess_cc_v=''
20905 aix) postprocess_cc_v="|$tr , ' '" ;;
20912 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20915 -D*) echo "\$i" | $sed 's/^-D//';;
20916 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20921 postprocess_cc_v=''
20924 ./ccsym > ccsym1.raw
20925 if $test -s ccsym1.raw; then
20926 $sort ccsym1.raw | $uniq >ccsym.raw
20928 mv ccsym1.raw ccsym.raw
20931 $awk '/\=/ { print $0; next }
20932 { print $0"=1" }' ccsym.raw >ccsym.list
20933 $comm -13 Cppsym.true ccsym.list >ccsym.own
20934 $comm -12 Cppsym.true ccsym.list >ccsym.com
20935 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
20937 if $test -z ccsym.raw; then
20938 echo "Your C compiler doesn't seem to define any symbols!" >&4
20940 echo "However, your C preprocessor defines the following symbols:"
20943 cppsymbols=`$cat Cppsym.true`
20944 cppsymbols=`echo $cppsymbols`
20945 cppccsymbols="$cppsymbols"
20947 if $test -s ccsym.com; then
20948 echo "Your C compiler and pre-processor define these symbols:"
20949 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20952 cppccsymbols=`$cat ccsym.com`
20953 cppccsymbols=`echo $cppccsymbols`
20954 $test "$silent" || sleep 1
20956 if $test -s ccsym.cpp; then
20957 $test "$also" && echo " "
20958 echo "Your C pre-processor ${also}defines the following symbols:"
20959 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20961 cppsymbols=`$cat ccsym.cpp`
20962 cppsymbols=`echo $cppsymbols`
20963 $test "$silent" || sleep 1
20965 if $test -s ccsym.own; then
20966 $test "$also" && echo " "
20967 echo "Your C compiler ${also}defines the following cpp symbols:"
20968 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20969 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20970 ccsymbols=`$cat ccsym.own`
20971 ccsymbols=`echo $ccsymbols`
20972 $test "$silent" || sleep 1
20976 : see if this is a termio system
20980 if $test `./findhdr termios.h`; then
20981 set tcsetattr i_termios
20987 "$define") echo "You have POSIX termios.h... good!" >&4;;
20988 *) if ./Cppsym pyr; then
20989 case "`/bin/universe`" in
20990 ucb) if $test `./findhdr sgtty.h`; then
20992 echo "<sgtty.h> found." >&4
20994 echo "System is pyramid with BSD universe."
20995 echo "<sgtty.h> not found--you could have problems." >&4
20997 *) if $test `./findhdr termio.h`; then
20999 echo "<termio.h> found." >&4
21001 echo "System is pyramid with USG universe."
21002 echo "<termio.h> not found--you could have problems." >&4
21006 if $test `./findhdr termio.h`; then
21007 echo "<termio.h> found." >&4
21009 elif $test `./findhdr sgtty.h`; then
21010 echo "<sgtty.h> found." >&4
21013 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
21016 if $test `./findhdr sgtty.h`; then
21017 echo "<sgtty.h> found." >&4
21019 elif $test `./findhdr termio.h`; then
21020 echo "<termio.h> found." >&4
21023 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
21027 set i_termio; eval $setvar
21028 val=$val2; set i_sgtty; eval $setvar
21029 val=$val3; set i_termios; eval $setvar
21031 : see if stddef is available
21032 set stddef.h i_stddef
21035 : see if sys/access.h is available
21036 set sys/access.h i_sysaccess
21039 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21040 set sys/filio.h i_sysfilio
21043 if $test `./findhdr sys/ioctl.h`; then
21045 echo '<sys/ioctl.h> found.' >&4
21048 if $test $i_sysfilio = "$define"; then
21049 echo '<sys/ioctl.h> NOT found.' >&4
21051 $test $i_sgtty = "$define" && xxx="sgtty.h"
21052 $test $i_termio = "$define" && xxx="termio.h"
21053 $test $i_termios = "$define" && xxx="termios.h"
21054 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21060 : see if socket ioctl defs are in sys/sockio.h
21062 xxx=`./findhdr sys/sockio.h`
21063 if $test "$xxx"; then
21064 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21066 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21069 echo "No socket ioctls found in <sys/sockio.h>." >&4
21074 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21081 : see if this is a syslog.h system
21082 set syslog.h i_syslog
21086 : see if this is a sys/mode.h system
21087 set sys/mode.h i_sysmode
21090 : see if sys/resource.h has to be included
21091 set sys/resource.h i_sysresrc
21094 : see if sys/security.h is available
21095 set sys/security.h i_syssecrt
21098 : see if this is a sys/statvfs.h system
21099 set sys/statvfs.h i_sysstatvfs
21102 : see if this is a sys/un.h system
21103 set sys/un.h i_sysun
21107 : see if this is a sys/utsname.h system
21108 set sys/utsname.h i_sysutsname
21111 : see if this is a syswait system
21112 set sys/wait.h i_syswait
21115 : see if this is a ustat.h system
21116 set ustat.h i_ustat
21119 : see if this is an utime system
21120 set utime.h i_utime
21123 : see if this is a values.h system
21124 set values.h i_values
21127 : see if this is a vfork system
21130 set vfork.h i_vfork
21140 echo "Looking for extensions..." >&4
21141 : If we are using the old config.sh, known_extensions may contain
21142 : old or inaccurate or duplicate values.
21143 known_extensions=''
21144 nonxs_extensions=''
21145 : We do not use find because it might not be available.
21146 : We do not just use MANIFEST because the user may have dropped
21147 : some additional extensions into the source tree and expect them
21150 : Function to recursively find available extensions, ignoring DynaLoader
21151 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21155 DynaLoader|dynaload) ;;
21157 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21158 known_extensions="$known_extensions $1$xxx";
21159 elif $test -f $xxx/Makefile.PL; then
21160 nonxs_extensions="$nonxs_extensions $1$xxx";
21162 if $test -d $xxx -a $# -lt 10; then
21165 eval $find_extensions;
21177 eval $find_extensions
21178 # Special case: Add in modules that nest beyond the first level.
21179 # Currently threads/shared and Hash/Util/FieldHash, since they are
21180 # not picked up by the recursive find above (and adding in general
21181 # recursive finding breaks SDBM_File/sdbm).
21182 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21183 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21184 set X $known_extensions
21186 known_extensions="$*"
21187 set X $nonxs_extensions
21189 nonxs_extensions="$*"
21192 : Now see which are supported on this system.
21194 for xxx in $known_extensions ; do
21198 $define) avail_ext="$avail_ext $xxx" ;;
21201 GDBM_File|gdbm_fil)
21203 $define) avail_ext="$avail_ext $xxx" ;;
21206 I18N/Langinfo|i18n_lan)
21207 case "$i_langinfo$d_nl_langinfo" in
21208 $define$define) avail_ext="$avail_ext $xxx" ;;
21212 : XXX Do we need a useipcsysv variable here
21213 case "${d_msg}${d_sem}${d_shm}" in
21214 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21217 NDBM_File|ndbm_fil)
21220 case "$osname-$use64bitint" in
21223 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21226 *) avail_ext="$avail_ext $xxx" ;;
21231 ODBM_File|odbm_fil)
21232 case "${i_dbm}${i_rpcsvcdbm}" in
21234 case "$d_cplusplus" in
21235 define) ;; # delete as a function name will not work
21236 *) case "$osname-$use64bitint" in
21239 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21242 *) avail_ext="$avail_ext $xxx" ;;
21250 case "$useopcode" in
21251 true|define|y) avail_ext="$avail_ext $xxx" ;;
21255 case "$useposix" in
21256 true|define|y) avail_ext="$avail_ext $xxx" ;;
21260 case "$d_socket" in
21263 beos) ;; # not unless BONE
21264 *) avail_ext="$avail_ext $xxx" ;;
21269 Sys/Syslog|sys/syslog)
21270 : XXX syslog requires socket
21271 case "$d_socket" in
21272 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21276 case "$usethreads" in
21278 case "$use5005threads" in
21279 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21283 threads|threads/shared)
21284 # threads and threads::shared are special cases.
21285 # To stop people from asking "Perl 5.8.0 was supposed
21286 # to have this new fancy threads implementation but my
21287 # perl doesn't have it" and from people trying to
21288 # (re)install the threads module using CPAN.pm and
21289 # CPAN.pm then offering to reinstall Perl 5.8.0,
21290 # the threads.pm and threads/shared.pm will always be
21291 # there, croaking informatively ("you need to rebuild
21292 # all of Perl with threads, sorry") when threads haven't
21293 # been compiled in.
21295 avail_ext="$avail_ext $xxx"
21299 cygwin) avail_ext="$avail_ext $xxx" ;;
21302 XS/APItest|xs/apitest)
21303 # This is just for testing. Skip it unless we have dynamic loading.
21306 $define) avail_ext="$avail_ext $xxx" ;;
21309 XS/Typemap|xs/typemap)
21310 # This is just for testing. Skip it unless we have dynamic loading.
21312 $define) avail_ext="$avail_ext $xxx" ;;
21315 *) avail_ext="$avail_ext $xxx"
21324 case "$onlyextensions" in
21326 *) keepextensions=''
21327 echo "You have requested that only certains extensions be included..." >&4
21328 for i in $onlyextensions; do
21329 case " $avail_ext " in
21331 echo "Keeping extension $i."
21332 keepextensions="$keepextensions $i"
21334 *) echo "Ignoring extension $i." ;;
21337 avail_ext="$keepextensions"
21341 case "$noextensions" in
21343 *) keepextensions=''
21344 echo "You have requested that certain extensions be ignored..." >&4
21345 for i in $avail_ext; do
21346 case " $noextensions " in
21347 *" $i "*) echo "Ignoring extension $i." ;;
21348 *) echo "Keeping extension $i.";
21349 keepextensions="$keepextensions $i"
21353 avail_ext="$keepextensions"
21357 : Now see which nonxs extensions are supported on this system.
21358 : For now assume all are.
21360 for xxx in $nonxs_extensions ; do
21362 *) nonxs_ext="$nonxs_ext $xxx"
21374 A number of extensions are supplied with $package. You may choose to
21375 compile these extensions for dynamic loading (the default), compile
21376 them into the $package executable (static loading), or not include
21377 them at all. Answer "none" to include no extensions.
21378 Note that DynaLoader is always built and need not be mentioned here.
21381 case "$dynamic_ext" in
21383 : Exclude those listed in static_ext
21385 for xxx in $avail_ext; do
21386 case " $static_ext " in
21388 *) dflt="$dflt $xxx" ;;
21395 *) dflt="$dynamic_ext"
21396 # Perhaps we are reusing an old out-of-date config.sh.
21399 if test X"$dynamic_ext" != X"$avail_ext"; then
21401 NOTICE: Your previous config.sh list may be incorrect.
21402 The extensions now available to you are
21404 but the default list from your previous config.sh is
21416 rp="What extensions do you wish to load dynamically?"
21419 none) dynamic_ext=' ' ;;
21420 *) dynamic_ext="$ans" ;;
21423 case "$static_ext" in
21425 : Exclude those already listed in dynamic linking
21427 for xxx in $avail_ext; do
21428 case " $dynamic_ext " in
21430 *) dflt="$dflt $xxx" ;;
21437 *) dflt="$static_ext"
21444 rp="What extensions do you wish to load statically?"
21447 none) static_ext=' ' ;;
21448 *) static_ext="$ans" ;;
21453 A number of extensions are supplied with $package. Answer "none"
21454 to include no extensions.
21455 Note that DynaLoader is always built and need not be mentioned here.
21458 case "$static_ext" in
21459 '') dflt="$avail_ext" ;;
21460 *) dflt="$static_ext"
21461 # Perhaps we are reusing an old out-of-date config.sh.
21464 if test X"$static_ext" != X"$avail_ext"; then
21466 NOTICE: Your previous config.sh list may be incorrect.
21467 The extensions now available to you are
21469 but the default list from your previous config.sh is
21478 : Exclude those that are not xs extensions
21482 rp="What extensions do you wish to include?"
21485 none) static_ext=' ' ;;
21486 *) static_ext="$ans" ;;
21491 # Encode is a special case. If we are building Encode as a static
21492 # extension, we need to explicitly list its subextensions as well.
21493 # For other nested extensions, this is handled automatically by
21494 # the appropriate Makefile.PL.
21495 case " $static_ext " in
21496 *" Encode "*) # Add the subextensions of Encode
21498 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21499 static_ext="$static_ext Encode/$xxx"
21505 set X $dynamic_ext $static_ext $nonxs_ext
21509 # Sanity check: We require an extension suitable for use with
21510 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21511 # should show up as failures in the test suite, but it's helpful to
21512 # catch them now.) The 'extensions' list is normally sorted
21513 # alphabetically, so we need to accept either
21514 # DB_File ... Fcntl ... IO ....
21515 # or something like
21516 # Fcntl ... NDBM_File ... IO ....
21517 case " $extensions" in
21518 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21519 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21520 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21521 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21522 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21526 : Remove libraries needed only for extensions
21527 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21528 : The exception is SunOS 4.x, which needs them.
21529 case "${osname}X${osvers}" in
21533 *) case "$usedl" in
21534 $define|true|[yY]*)
21535 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21539 *) perllibs="$libs"
21545 : Remove build directory name from cppstdin so it can be used from
21546 : either the present location or the final installed location.
21548 : Get out of the UU directory to get correct path name.
21550 case "$cppstdin" in
21552 echo "Stripping down cppstdin path name"
21558 : end of configuration questions
21560 echo "End of configuration questions."
21563 : back to where it started
21564 if test -d ../UU; then
21568 : configuration may be patched via a 'config.arch' file
21569 if $test -f config.arch; then
21570 echo "I see a config.arch file, loading it."
21574 : configuration may be patched via a 'config.over' file
21575 if $test -f config.over; then
21578 rp='I see a config.over file. Do you wish to load it?'
21581 n*) echo "OK, I'll ignore it.";;
21583 echo "Configuration override changes have been loaded."
21588 : in case they want portability, strip down executable paths
21589 case "$d_portable" in
21592 echo "Stripping down executable paths..." >&4
21593 for file in $loclist $trylist; do
21595 eval $file=`basename $temp`
21600 : create config.sh file
21602 echo "Creating config.sh..." >&4
21603 $spitshell <<EOT >config.sh
21606 # This file was produced by running the Configure script. It holds all the
21607 # definitions figured out by Configure. Should you modify one of these values,
21608 # do not forget to propagate your changes by running "Configure -der". You may
21609 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21612 # Package name : $package
21613 # Source directory : $src
21614 # Configuration time: $cf_time
21615 # Configured by : $cf_by
21616 # Target system : $myuname
21626 Revision='$Revision'
21634 alignbytes='$alignbytes'
21635 ansi2knr='$ansi2knr'
21636 aphostname='$aphostname'
21637 api_revision='$api_revision'
21638 api_subversion='$api_subversion'
21639 api_version='$api_version'
21640 api_versionstring='$api_versionstring'
21643 archlibexp='$archlibexp'
21644 archname64='$archname64'
21645 archname='$archname'
21646 archobjs='$archobjs'
21647 asctime_r_proto='$asctime_r_proto'
21655 byteorder='$byteorder'
21657 castflags='$castflags'
21660 cccdlflags='$cccdlflags'
21661 ccdlflags='$ccdlflags'
21663 ccflags_uselargefiles='$ccflags_uselargefiles'
21665 ccsymbols='$ccsymbols'
21666 ccversion='$ccversion'
21668 cf_email='$cf_email'
21673 clocktype='$clocktype'
21675 compress='$compress'
21676 contains='$contains'
21680 cpp_stuff='$cpp_stuff'
21681 cppccsymbols='$cppccsymbols'
21682 cppflags='$cppflags'
21684 cppminus='$cppminus'
21686 cppstdin='$cppstdin'
21687 cppsymbols='$cppsymbols'
21688 crypt_r_proto='$crypt_r_proto'
21689 cryptlib='$cryptlib'
21691 ctermid_r_proto='$ctermid_r_proto'
21692 ctime_r_proto='$ctime_r_proto'
21693 d_Gconvert='$d_Gconvert'
21694 d_PRIEUldbl='$d_PRIEUldbl'
21695 d_PRIFUldbl='$d_PRIFUldbl'
21696 d_PRIGUldbl='$d_PRIGUldbl'
21697 d_PRIXU64='$d_PRIXU64'
21698 d_PRId64='$d_PRId64'
21699 d_PRIeldbl='$d_PRIeldbl'
21700 d_PRIfldbl='$d_PRIfldbl'
21701 d_PRIgldbl='$d_PRIgldbl'
21702 d_PRIi64='$d_PRIi64'
21703 d_PRIo64='$d_PRIo64'
21704 d_PRIu64='$d_PRIu64'
21705 d_PRIx64='$d_PRIx64'
21706 d_SCNfldbl='$d_SCNfldbl'
21707 d__fwalk='$d__fwalk'
21708 d_access='$d_access'
21709 d_accessx='$d_accessx'
21712 d_archlib='$d_archlib'
21713 d_asctime_r='$d_asctime_r'
21716 d_attribute_format='$d_attribute_format'
21717 d_attribute_malloc='$d_attribute_malloc'
21718 d_attribute_nonnull='$d_attribute_nonnull'
21719 d_attribute_noreturn='$d_attribute_noreturn'
21720 d_attribute_pure='$d_attribute_pure'
21721 d_attribute_unused='$d_attribute_unused'
21722 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21726 d_bsdgetpgrp='$d_bsdgetpgrp'
21727 d_bsdsetpgrp='$d_bsdsetpgrp'
21728 d_builtin_choose_expr='$d_builtin_choose_expr'
21729 d_builtin_expect='$d_builtin_expect'
21731 d_c99_variadic_macros='$d_c99_variadic_macros'
21732 d_casti32='$d_casti32'
21733 d_castneg='$d_castneg'
21734 d_charvspr='$d_charvspr'
21736 d_chroot='$d_chroot'
21737 d_chsize='$d_chsize'
21739 d_clearenv='$d_clearenv'
21740 d_closedir='$d_closedir'
21741 d_cmsghdr_s='$d_cmsghdr_s'
21743 d_copysignl='$d_copysignl'
21744 d_cplusplus='$d_cplusplus'
21746 d_crypt_r='$d_crypt_r'
21748 d_ctermid='$d_ctermid'
21749 d_ctermid_r='$d_ctermid_r'
21750 d_ctime_r='$d_ctime_r'
21751 d_cuserid='$d_cuserid'
21752 d_dbl_dig='$d_dbl_dig'
21753 d_dbminitproto='$d_dbminitproto'
21754 d_difftime='$d_difftime'
21755 d_dir_dd_fd='$d_dir_dd_fd'
21757 d_dirnamlen='$d_dirnamlen'
21758 d_dlerror='$d_dlerror'
21759 d_dlopen='$d_dlopen'
21760 d_dlsymun='$d_dlsymun'
21761 d_dosuid='$d_dosuid'
21762 d_drand48_r='$d_drand48_r'
21763 d_drand48proto='$d_drand48proto'
21765 d_eaccess='$d_eaccess'
21766 d_endgrent='$d_endgrent'
21767 d_endgrent_r='$d_endgrent_r'
21768 d_endhent='$d_endhent'
21769 d_endhostent_r='$d_endhostent_r'
21770 d_endnent='$d_endnent'
21771 d_endnetent_r='$d_endnetent_r'
21772 d_endpent='$d_endpent'
21773 d_endprotoent_r='$d_endprotoent_r'
21774 d_endpwent='$d_endpwent'
21775 d_endpwent_r='$d_endpwent_r'
21776 d_endsent='$d_endsent'
21777 d_endservent_r='$d_endservent_r'
21778 d_eofnblk='$d_eofnblk'
21779 d_eunice='$d_eunice'
21780 d_faststdio='$d_faststdio'
21781 d_fchdir='$d_fchdir'
21782 d_fchmod='$d_fchmod'
21783 d_fchown='$d_fchown'
21785 d_fcntl_can_lock='$d_fcntl_can_lock'
21786 d_fd_macros='$d_fd_macros'
21787 d_fd_set='$d_fd_set'
21788 d_fds_bits='$d_fds_bits'
21789 d_fgetpos='$d_fgetpos'
21790 d_finite='$d_finite'
21791 d_finitel='$d_finitel'
21792 d_flexfnam='$d_flexfnam'
21794 d_flockproto='$d_flockproto'
21796 d_fp_class='$d_fp_class'
21797 d_fpathconf='$d_fpathconf'
21798 d_fpclass='$d_fpclass'
21799 d_fpclassify='$d_fpclassify'
21800 d_fpclassl='$d_fpclassl'
21801 d_fpos64_t='$d_fpos64_t'
21802 d_frexpl='$d_frexpl'
21803 d_fs_data_s='$d_fs_data_s'
21804 d_fseeko='$d_fseeko'
21805 d_fsetpos='$d_fsetpos'
21806 d_fstatfs='$d_fstatfs'
21807 d_fstatvfs='$d_fstatvfs'
21809 d_ftello='$d_ftello'
21811 d_futimes='$d_futimes'
21812 d_getcwd='$d_getcwd'
21813 d_getespwnam='$d_getespwnam'
21814 d_getfsstat='$d_getfsstat'
21815 d_getgrent='$d_getgrent'
21816 d_getgrent_r='$d_getgrent_r'
21817 d_getgrgid_r='$d_getgrgid_r'
21818 d_getgrnam_r='$d_getgrnam_r'
21819 d_getgrps='$d_getgrps'
21820 d_gethbyaddr='$d_gethbyaddr'
21821 d_gethbyname='$d_gethbyname'
21822 d_gethent='$d_gethent'
21823 d_gethname='$d_gethname'
21824 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21825 d_gethostbyname_r='$d_gethostbyname_r'
21826 d_gethostent_r='$d_gethostent_r'
21827 d_gethostprotos='$d_gethostprotos'
21828 d_getitimer='$d_getitimer'
21829 d_getlogin='$d_getlogin'
21830 d_getlogin_r='$d_getlogin_r'
21831 d_getmnt='$d_getmnt'
21832 d_getmntent='$d_getmntent'
21833 d_getnbyaddr='$d_getnbyaddr'
21834 d_getnbyname='$d_getnbyname'
21835 d_getnent='$d_getnent'
21836 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21837 d_getnetbyname_r='$d_getnetbyname_r'
21838 d_getnetent_r='$d_getnetent_r'
21839 d_getnetprotos='$d_getnetprotos'
21840 d_getpagsz='$d_getpagsz'
21841 d_getpbyname='$d_getpbyname'
21842 d_getpbynumber='$d_getpbynumber'
21843 d_getpent='$d_getpent'
21844 d_getpgid='$d_getpgid'
21845 d_getpgrp2='$d_getpgrp2'
21846 d_getpgrp='$d_getpgrp'
21847 d_getppid='$d_getppid'
21848 d_getprior='$d_getprior'
21849 d_getprotobyname_r='$d_getprotobyname_r'
21850 d_getprotobynumber_r='$d_getprotobynumber_r'
21851 d_getprotoent_r='$d_getprotoent_r'
21852 d_getprotoprotos='$d_getprotoprotos'
21853 d_getprpwnam='$d_getprpwnam'
21854 d_getpwent='$d_getpwent'
21855 d_getpwent_r='$d_getpwent_r'
21856 d_getpwnam_r='$d_getpwnam_r'
21857 d_getpwuid_r='$d_getpwuid_r'
21858 d_getsbyname='$d_getsbyname'
21859 d_getsbyport='$d_getsbyport'
21860 d_getsent='$d_getsent'
21861 d_getservbyname_r='$d_getservbyname_r'
21862 d_getservbyport_r='$d_getservbyport_r'
21863 d_getservent_r='$d_getservent_r'
21864 d_getservprotos='$d_getservprotos'
21865 d_getspnam='$d_getspnam'
21866 d_getspnam_r='$d_getspnam_r'
21867 d_gettimeod='$d_gettimeod'
21868 d_gmtime_r='$d_gmtime_r'
21869 d_gnulibc='$d_gnulibc'
21870 d_grpasswd='$d_grpasswd'
21871 d_hasmntopt='$d_hasmntopt'
21873 d_ilogbl='$d_ilogbl'
21874 d_inc_version_list='$d_inc_version_list'
21876 d_inetaton='$d_inetaton'
21877 d_int64_t='$d_int64_t'
21878 d_isascii='$d_isascii'
21879 d_isfinite='$d_isfinite'
21882 d_isnanl='$d_isnanl'
21883 d_killpg='$d_killpg'
21884 d_lchown='$d_lchown'
21885 d_ldbl_dig='$d_ldbl_dig'
21886 d_libm_lib_version='$d_libm_lib_version'
21888 d_localtime_r='$d_localtime_r'
21889 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
21890 d_locconv='$d_locconv'
21892 d_longdbl='$d_longdbl'
21893 d_longlong='$d_longlong'
21894 d_lseekproto='$d_lseekproto'
21896 d_madvise='$d_madvise'
21897 d_malloc_good_size='$d_malloc_good_size'
21898 d_malloc_size='$d_malloc_size'
21900 d_mbstowcs='$d_mbstowcs'
21901 d_mbtowc='$d_mbtowc'
21902 d_memchr='$d_memchr'
21903 d_memcmp='$d_memcmp'
21904 d_memcpy='$d_memcpy'
21905 d_memmove='$d_memmove'
21906 d_memset='$d_memset'
21908 d_mkdtemp='$d_mkdtemp'
21909 d_mkfifo='$d_mkfifo'
21910 d_mkstemp='$d_mkstemp'
21911 d_mkstemps='$d_mkstemps'
21912 d_mktime='$d_mktime'
21915 d_modfl_pow32_bug='$d_modfl_pow32_bug'
21916 d_modflproto='$d_modflproto'
21917 d_mprotect='$d_mprotect'
21919 d_msg_ctrunc='$d_msg_ctrunc'
21920 d_msg_dontroute='$d_msg_dontroute'
21921 d_msg_oob='$d_msg_oob'
21922 d_msg_peek='$d_msg_peek'
21923 d_msg_proxy='$d_msg_proxy'
21924 d_msgctl='$d_msgctl'
21925 d_msgget='$d_msgget'
21926 d_msghdr_s='$d_msghdr_s'
21927 d_msgrcv='$d_msgrcv'
21928 d_msgsnd='$d_msgsnd'
21930 d_munmap='$d_munmap'
21931 d_mymalloc='$d_mymalloc'
21933 d_nl_langinfo='$d_nl_langinfo'
21934 d_nv_preserves_uv='$d_nv_preserves_uv'
21935 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21936 d_off64_t='$d_off64_t'
21937 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21938 d_oldpthreads='$d_oldpthreads'
21939 d_oldsock='$d_oldsock'
21941 d_pathconf='$d_pathconf'
21943 d_perl_otherlibdirs='$d_perl_otherlibdirs'
21944 d_phostname='$d_phostname'
21947 d_portable='$d_portable'
21948 d_printf_format_null='$d_printf_format_null'
21949 d_procselfexe='$d_procselfexe'
21950 d_pseudofork='$d_pseudofork'
21951 d_pthread_atfork='$d_pthread_atfork'
21952 d_pthread_attr_setscope='$d_pthread_attr_setscope'
21953 d_pthread_yield='$d_pthread_yield'
21955 d_pwchange='$d_pwchange'
21956 d_pwclass='$d_pwclass'
21957 d_pwcomment='$d_pwcomment'
21958 d_pwexpire='$d_pwexpire'
21959 d_pwgecos='$d_pwgecos'
21960 d_pwpasswd='$d_pwpasswd'
21961 d_pwquota='$d_pwquota'
21964 d_random_r='$d_random_r'
21965 d_readdir64_r='$d_readdir64_r'
21966 d_readdir='$d_readdir'
21967 d_readdir_r='$d_readdir_r'
21968 d_readlink='$d_readlink'
21970 d_recvmsg='$d_recvmsg'
21971 d_rename='$d_rename'
21972 d_rewinddir='$d_rewinddir'
21974 d_safebcpy='$d_safebcpy'
21975 d_safemcpy='$d_safemcpy'
21976 d_sanemcmp='$d_sanemcmp'
21977 d_sbrkproto='$d_sbrkproto'
21978 d_scalbnl='$d_scalbnl'
21979 d_sched_yield='$d_sched_yield'
21980 d_scm_rights='$d_scm_rights'
21981 d_seekdir='$d_seekdir'
21982 d_select='$d_select'
21984 d_semctl='$d_semctl'
21985 d_semctl_semid_ds='$d_semctl_semid_ds'
21986 d_semctl_semun='$d_semctl_semun'
21987 d_semget='$d_semget'
21989 d_sendmsg='$d_sendmsg'
21990 d_setegid='$d_setegid'
21991 d_seteuid='$d_seteuid'
21992 d_setgrent='$d_setgrent'
21993 d_setgrent_r='$d_setgrent_r'
21994 d_setgrps='$d_setgrps'
21995 d_sethent='$d_sethent'
21996 d_sethostent_r='$d_sethostent_r'
21997 d_setitimer='$d_setitimer'
21998 d_setlinebuf='$d_setlinebuf'
21999 d_setlocale='$d_setlocale'
22000 d_setlocale_r='$d_setlocale_r'
22001 d_setnent='$d_setnent'
22002 d_setnetent_r='$d_setnetent_r'
22003 d_setpent='$d_setpent'
22004 d_setpgid='$d_setpgid'
22005 d_setpgrp2='$d_setpgrp2'
22006 d_setpgrp='$d_setpgrp'
22007 d_setprior='$d_setprior'
22008 d_setproctitle='$d_setproctitle'
22009 d_setprotoent_r='$d_setprotoent_r'
22010 d_setpwent='$d_setpwent'
22011 d_setpwent_r='$d_setpwent_r'
22012 d_setregid='$d_setregid'
22013 d_setresgid='$d_setresgid'
22014 d_setresuid='$d_setresuid'
22015 d_setreuid='$d_setreuid'
22016 d_setrgid='$d_setrgid'
22017 d_setruid='$d_setruid'
22018 d_setsent='$d_setsent'
22019 d_setservent_r='$d_setservent_r'
22020 d_setsid='$d_setsid'
22021 d_setvbuf='$d_setvbuf'
22025 d_shmatprototype='$d_shmatprototype'
22026 d_shmctl='$d_shmctl'
22028 d_shmget='$d_shmget'
22029 d_sigaction='$d_sigaction'
22030 d_signbit='$d_signbit'
22031 d_sigprocmask='$d_sigprocmask'
22032 d_sigsetjmp='$d_sigsetjmp'
22033 d_sitearch='$d_sitearch'
22034 d_snprintf='$d_snprintf'
22035 d_sockatmark='$d_sockatmark'
22036 d_sockatmarkproto='$d_sockatmarkproto'
22037 d_socket='$d_socket'
22038 d_socklen_t='$d_socklen_t'
22039 d_sockpair='$d_sockpair'
22040 d_socks5_init='$d_socks5_init'
22041 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22043 d_srand48_r='$d_srand48_r'
22044 d_srandom_r='$d_srandom_r'
22045 d_sresgproto='$d_sresgproto'
22046 d_sresuproto='$d_sresuproto'
22047 d_statblks='$d_statblks'
22048 d_statfs_f_flags='$d_statfs_f_flags'
22049 d_statfs_s='$d_statfs_s'
22050 d_statvfs='$d_statvfs'
22051 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22052 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22053 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22054 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22055 d_stdio_stream_array='$d_stdio_stream_array'
22056 d_stdiobase='$d_stdiobase'
22057 d_stdstdio='$d_stdstdio'
22058 d_strchr='$d_strchr'
22059 d_strcoll='$d_strcoll'
22060 d_strctcpy='$d_strctcpy'
22061 d_strerrm='$d_strerrm'
22062 d_strerror='$d_strerror'
22063 d_strerror_r='$d_strerror_r'
22064 d_strftime='$d_strftime'
22065 d_strlcat='$d_strlcat'
22066 d_strlcpy='$d_strlcpy'
22067 d_strtod='$d_strtod'
22068 d_strtol='$d_strtol'
22069 d_strtold='$d_strtold'
22070 d_strtoll='$d_strtoll'
22071 d_strtoq='$d_strtoq'
22072 d_strtoul='$d_strtoul'
22073 d_strtoull='$d_strtoull'
22074 d_strtouq='$d_strtouq'
22075 d_strxfrm='$d_strxfrm'
22076 d_suidsafe='$d_suidsafe'
22077 d_symlink='$d_symlink'
22078 d_syscall='$d_syscall'
22079 d_syscallproto='$d_syscallproto'
22080 d_sysconf='$d_sysconf'
22081 d_sysernlst='$d_sysernlst'
22082 d_syserrlst='$d_syserrlst'
22083 d_system='$d_system'
22084 d_tcgetpgrp='$d_tcgetpgrp'
22085 d_tcsetpgrp='$d_tcsetpgrp'
22086 d_telldir='$d_telldir'
22087 d_telldirproto='$d_telldirproto'
22090 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22091 d_tm_tm_zone='$d_tm_tm_zone'
22092 d_tmpnam_r='$d_tmpnam_r'
22093 d_truncate='$d_truncate'
22094 d_ttyname_r='$d_ttyname_r'
22095 d_tzname='$d_tzname'
22096 d_u32align='$d_u32align'
22097 d_ualarm='$d_ualarm'
22100 d_union_semun='$d_union_semun'
22101 d_unordered='$d_unordered'
22102 d_unsetenv='$d_unsetenv'
22103 d_usleep='$d_usleep'
22104 d_usleepproto='$d_usleepproto'
22106 d_vendorarch='$d_vendorarch'
22107 d_vendorbin='$d_vendorbin'
22108 d_vendorlib='$d_vendorlib'
22109 d_vendorscript='$d_vendorscript'
22111 d_void_closedir='$d_void_closedir'
22112 d_voidsig='$d_voidsig'
22113 d_voidtty='$d_voidtty'
22114 d_volatile='$d_volatile'
22115 d_vprintf='$d_vprintf'
22116 d_vsnprintf='$d_vsnprintf'
22118 d_waitpid='$d_waitpid'
22119 d_wcstombs='$d_wcstombs'
22120 d_wctomb='$d_wctomb'
22121 d_writev='$d_writev'
22124 db_hashtype='$db_hashtype'
22125 db_prefixtype='$db_prefixtype'
22126 db_version_major='$db_version_major'
22127 db_version_minor='$db_version_minor'
22128 db_version_patch='$db_version_patch'
22129 defvoidused='$defvoidused'
22130 direntrytype='$direntrytype'
22133 doublesize='$doublesize'
22135 drand48_r_proto='$drand48_r_proto'
22137 dynamic_ext='$dynamic_ext'
22143 endgrent_r_proto='$endgrent_r_proto'
22144 endhostent_r_proto='$endhostent_r_proto'
22145 endnetent_r_proto='$endnetent_r_proto'
22146 endprotoent_r_proto='$endprotoent_r_proto'
22147 endpwent_r_proto='$endpwent_r_proto'
22148 endservent_r_proto='$endservent_r_proto'
22149 eunicefix='$eunicefix'
22152 extensions='$extensions'
22154 fflushNULL='$fflushNULL'
22155 fflushall='$fflushall'
22157 firstmakefile='$firstmakefile'
22159 fpossize='$fpossize'
22160 fpostype='$fpostype'
22161 freetype='$freetype'
22164 full_csh='$full_csh'
22165 full_sed='$full_sed'
22166 gccansipedantic='$gccansipedantic'
22167 gccosandvers='$gccosandvers'
22168 gccversion='$gccversion'
22169 getgrent_r_proto='$getgrent_r_proto'
22170 getgrgid_r_proto='$getgrgid_r_proto'
22171 getgrnam_r_proto='$getgrnam_r_proto'
22172 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22173 gethostbyname_r_proto='$gethostbyname_r_proto'
22174 gethostent_r_proto='$gethostent_r_proto'
22175 getlogin_r_proto='$getlogin_r_proto'
22176 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22177 getnetbyname_r_proto='$getnetbyname_r_proto'
22178 getnetent_r_proto='$getnetent_r_proto'
22179 getprotobyname_r_proto='$getprotobyname_r_proto'
22180 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22181 getprotoent_r_proto='$getprotoent_r_proto'
22182 getpwent_r_proto='$getpwent_r_proto'
22183 getpwnam_r_proto='$getpwnam_r_proto'
22184 getpwuid_r_proto='$getpwuid_r_proto'
22185 getservbyname_r_proto='$getservbyname_r_proto'
22186 getservbyport_r_proto='$getservbyport_r_proto'
22187 getservent_r_proto='$getservent_r_proto'
22188 getspnam_r_proto='$getspnam_r_proto'
22189 gidformat='$gidformat'
22195 gmtime_r_proto='$gmtime_r_proto'
22196 gnulibc_version='$gnulibc_version'
22198 groupcat='$groupcat'
22199 groupstype='$groupstype'
22202 h_sysfile='$h_sysfile'
22205 html1dir='$html1dir'
22206 html1direxp='$html1direxp'
22207 html3dir='$html3dir'
22208 html3direxp='$html3direxp'
22217 i_arpainet='$i_arpainet'
22218 i_assert='$i_assert'
22219 i_bsdioctl='$i_bsdioctl'
22223 i_dirent='$i_dirent'
22229 i_fp_class='$i_fp_class'
22232 i_ieeefp='$i_ieeefp'
22233 i_inttypes='$i_inttypes'
22234 i_langinfo='$i_langinfo'
22235 i_libutil='$i_libutil'
22236 i_limits='$i_limits'
22237 i_locale='$i_locale'
22238 i_machcthr='$i_machcthr'
22239 i_malloc='$i_malloc'
22241 i_memory='$i_memory'
22242 i_mntent='$i_mntent'
22245 i_neterrno='$i_neterrno'
22246 i_netinettcp='$i_netinettcp'
22250 i_pthread='$i_pthread'
22252 i_rpcsvcdbm='$i_rpcsvcdbm'
22255 i_shadow='$i_shadow'
22257 i_stdarg='$i_stdarg'
22258 i_stddef='$i_stddef'
22259 i_stdlib='$i_stdlib'
22260 i_string='$i_string'
22261 i_sunmath='$i_sunmath'
22262 i_sysaccess='$i_sysaccess'
22263 i_sysdir='$i_sysdir'
22264 i_sysfile='$i_sysfile'
22265 i_sysfilio='$i_sysfilio'
22267 i_sysioctl='$i_sysioctl'
22268 i_syslog='$i_syslog'
22269 i_sysmman='$i_sysmman'
22270 i_sysmode='$i_sysmode'
22271 i_sysmount='$i_sysmount'
22272 i_sysndir='$i_sysndir'
22273 i_sysparam='$i_sysparam'
22274 i_sysresrc='$i_sysresrc'
22275 i_syssecrt='$i_syssecrt'
22276 i_sysselct='$i_sysselct'
22277 i_syssockio='$i_syssockio'
22278 i_sysstat='$i_sysstat'
22279 i_sysstatfs='$i_sysstatfs'
22280 i_sysstatvfs='$i_sysstatvfs'
22281 i_systime='$i_systime'
22282 i_systimek='$i_systimek'
22283 i_systimes='$i_systimes'
22284 i_systypes='$i_systypes'
22285 i_sysuio='$i_sysuio'
22287 i_sysutsname='$i_sysutsname'
22288 i_sysvfs='$i_sysvfs'
22289 i_syswait='$i_syswait'
22290 i_termio='$i_termio'
22291 i_termios='$i_termios'
22293 i_unistd='$i_unistd'
22296 i_values='$i_values'
22297 i_varargs='$i_varargs'
22298 i_varhdr='$i_varhdr'
22300 ignore_versioned_solibs='$ignore_versioned_solibs'
22301 inc_version_list='$inc_version_list'
22302 inc_version_list_init='$inc_version_list_init'
22305 initialinstalllocation='$initialinstalllocation'
22306 installarchlib='$installarchlib'
22307 installbin='$installbin'
22308 installhtml1dir='$installhtml1dir'
22309 installhtml3dir='$installhtml3dir'
22310 installman1dir='$installman1dir'
22311 installman3dir='$installman3dir'
22312 installprefix='$installprefix'
22313 installprefixexp='$installprefixexp'
22314 installprivlib='$installprivlib'
22315 installscript='$installscript'
22316 installsitearch='$installsitearch'
22317 installsitebin='$installsitebin'
22318 installsitehtml1dir='$installsitehtml1dir'
22319 installsitehtml3dir='$installsitehtml3dir'
22320 installsitelib='$installsitelib'
22321 installsiteman1dir='$installsiteman1dir'
22322 installsiteman3dir='$installsiteman3dir'
22323 installsitescript='$installsitescript'
22324 installstyle='$installstyle'
22325 installusrbinperl='$installusrbinperl'
22326 installvendorarch='$installvendorarch'
22327 installvendorbin='$installvendorbin'
22328 installvendorhtml1dir='$installvendorhtml1dir'
22329 installvendorhtml3dir='$installvendorhtml3dir'
22330 installvendorlib='$installvendorlib'
22331 installvendorman1dir='$installvendorman1dir'
22332 installvendorman3dir='$installvendorman3dir'
22333 installvendorscript='$installvendorscript'
22335 issymlink='$issymlink'
22336 ivdformat='$ivdformat'
22339 known_extensions='$known_extensions'
22342 lddlflags='$lddlflags'
22344 ldflags_uselargefiles='$ldflags_uselargefiles'
22345 ldlibpthname='$ldlibpthname'
22352 libsdirs='$libsdirs'
22353 libsfiles='$libsfiles'
22354 libsfound='$libsfound'
22355 libspath='$libspath'
22356 libswanted='$libswanted'
22357 libswanted_uselargefiles='$libswanted_uselargefiles'
22363 localtime_r_proto='$localtime_r_proto'
22364 locincpth='$locincpth'
22365 loclibpth='$loclibpth'
22366 longdblsize='$longdblsize'
22367 longlongsize='$longlongsize'
22368 longsize='$longsize'
22372 lseeksize='$lseeksize'
22373 lseektype='$lseektype'
22376 madlyobj='$madlyobj'
22377 madlysrc='$madlysrc'
22381 make_set_make='$make_set_make'
22382 mallocobj='$mallocobj'
22383 mallocsrc='$mallocsrc'
22384 malloctype='$malloctype'
22386 man1direxp='$man1direxp'
22389 man3direxp='$man3direxp'
22391 mips_type='$mips_type'
22392 mistrustnm='$mistrustnm'
22394 mmaptype='$mmaptype'
22395 modetype='$modetype'
22397 multiarch='$multiarch'
22399 myarchname='$myarchname'
22400 mydomain='$mydomain'
22401 myhostname='$myhostname'
22404 need_va_copy='$need_va_copy'
22405 netdb_hlen_type='$netdb_hlen_type'
22406 netdb_host_type='$netdb_host_type'
22407 netdb_name_type='$netdb_name_type'
22408 netdb_net_type='$netdb_net_type'
22411 nm_so_opt='$nm_so_opt'
22412 nonxs_ext='$nonxs_ext'
22414 nvEUformat='$nvEUformat'
22415 nvFUformat='$nvFUformat'
22416 nvGUformat='$nvGUformat'
22417 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22418 nveformat='$nveformat'
22419 nvfformat='$nvfformat'
22420 nvgformat='$nvgformat'
22423 o_nonblock='$o_nonblock'
22425 old_pthread_create_joinable='$old_pthread_create_joinable'
22426 optimize='$optimize'
22427 orderlib='$orderlib'
22430 otherlibdirs='$otherlibdirs'
22434 patchlevel='$patchlevel'
22435 path_sep='$path_sep'
22438 perl_patchlevel='$perl_patchlevel'
22439 perladmin='$perladmin'
22440 perllibs='$perllibs'
22441 perlpath='$perlpath'
22443 phostname='$phostname'
22449 prefixexp='$prefixexp'
22451 privlibexp='$privlibexp'
22452 procselfexe='$procselfexe'
22453 prototype='$prototype'
22455 quadkind='$quadkind'
22456 quadtype='$quadtype'
22457 randbits='$randbits'
22458 randfunc='$randfunc'
22459 random_r_proto='$random_r_proto'
22460 randseedtype='$randseedtype'
22462 rd_nodata='$rd_nodata'
22463 readdir64_r_proto='$readdir64_r_proto'
22464 readdir_r_proto='$readdir_r_proto'
22465 revision='$revision'
22471 sPRIEUldbl='$sPRIEUldbl'
22472 sPRIFUldbl='$sPRIFUldbl'
22473 sPRIGUldbl='$sPRIGUldbl'
22474 sPRIXU64='$sPRIXU64'
22476 sPRIeldbl='$sPRIeldbl'
22477 sPRIfldbl='$sPRIfldbl'
22478 sPRIgldbl='$sPRIgldbl'
22483 sSCNfldbl='$sSCNfldbl'
22484 sched_yield='$sched_yield'
22485 scriptdir='$scriptdir'
22486 scriptdirexp='$scriptdirexp'
22488 seedfunc='$seedfunc'
22489 selectminbits='$selectminbits'
22490 selecttype='$selecttype'
22491 sendmail='$sendmail'
22492 setgrent_r_proto='$setgrent_r_proto'
22493 sethostent_r_proto='$sethostent_r_proto'
22494 setlocale_r_proto='$setlocale_r_proto'
22495 setnetent_r_proto='$setnetent_r_proto'
22496 setprotoent_r_proto='$setprotoent_r_proto'
22497 setpwent_r_proto='$setpwent_r_proto'
22498 setservent_r_proto='$setservent_r_proto'
22501 sharpbang='$sharpbang'
22502 shmattype='$shmattype'
22503 shortsize='$shortsize'
22506 sig_count='$sig_count'
22507 sig_name='$sig_name'
22508 sig_name_init='$sig_name_init'
22510 sig_num_init='$sig_num_init'
22511 sig_size='$sig_size'
22512 signal_t='$signal_t'
22513 sitearch='$sitearch'
22514 sitearchexp='$sitearchexp'
22516 sitebinexp='$sitebinexp'
22517 sitehtml1dir='$sitehtml1dir'
22518 sitehtml1direxp='$sitehtml1direxp'
22519 sitehtml3dir='$sitehtml3dir'
22520 sitehtml3direxp='$sitehtml3direxp'
22522 sitelib_stem='$sitelib_stem'
22523 sitelibexp='$sitelibexp'
22524 siteman1dir='$siteman1dir'
22525 siteman1direxp='$siteman1direxp'
22526 siteman3dir='$siteman3dir'
22527 siteman3direxp='$siteman3direxp'
22528 siteprefix='$siteprefix'
22529 siteprefixexp='$siteprefixexp'
22530 sitescript='$sitescript'
22531 sitescriptexp='$sitescriptexp'
22532 sizesize='$sizesize'
22533 sizetype='$sizetype'
22537 sockethdr='$sockethdr'
22538 socketlib='$socketlib'
22539 socksizetype='$socksizetype'
22541 spackage='$spackage'
22542 spitshell='$spitshell'
22543 srand48_r_proto='$srand48_r_proto'
22544 srandom_r_proto='$srandom_r_proto'
22546 ssizetype='$ssizetype'
22547 startperl='$startperl'
22549 static_ext='$static_ext'
22551 stdio_base='$stdio_base'
22552 stdio_bufsiz='$stdio_bufsiz'
22553 stdio_cnt='$stdio_cnt'
22554 stdio_filbuf='$stdio_filbuf'
22555 stdio_ptr='$stdio_ptr'
22556 stdio_stream_array='$stdio_stream_array'
22557 strerror_r_proto='$strerror_r_proto'
22560 subversion='$subversion'
22564 targetarch='$targetarch'
22568 timeincl='$timeincl'
22569 timetype='$timetype'
22570 tmpnam_r_proto='$tmpnam_r_proto'
22576 ttyname_r_proto='$ttyname_r_proto'
22585 uidformat='$uidformat'
22591 uquadtype='$uquadtype'
22592 use5005threads='$use5005threads'
22593 use64bitall='$use64bitall'
22594 use64bitint='$use64bitint'
22595 usecrosscompile='$usecrosscompile'
22597 usedtrace='$usedtrace'
22598 usefaststdio='$usefaststdio'
22599 useithreads='$useithreads'
22600 uselargefiles='$uselargefiles'
22601 uselongdouble='$uselongdouble'
22602 usemallocwrap='$usemallocwrap'
22603 usemorebits='$usemorebits'
22604 usemultiplicity='$usemultiplicity'
22605 usemymalloc='$usemymalloc'
22607 useopcode='$useopcode'
22608 useperlio='$useperlio'
22609 useposix='$useposix'
22610 usereentrant='$usereentrant'
22611 userelocatableinc='$userelocatableinc'
22613 useshrplib='$useshrplib'
22614 usesitecustomize='$usesitecustomize'
22615 usesocks='$usesocks'
22616 usethreads='$usethreads'
22617 usevendorprefix='$usevendorprefix'
22618 usevfork='$usevfork'
22621 uvXUformat='$uvXUformat'
22622 uvoformat='$uvoformat'
22625 uvuformat='$uvuformat'
22626 uvxformat='$uvxformat'
22627 vendorarch='$vendorarch'
22628 vendorarchexp='$vendorarchexp'
22629 vendorbin='$vendorbin'
22630 vendorbinexp='$vendorbinexp'
22631 vendorhtml1dir='$vendorhtml1dir'
22632 vendorhtml1direxp='$vendorhtml1direxp'
22633 vendorhtml3dir='$vendorhtml3dir'
22634 vendorhtml3direxp='$vendorhtml3direxp'
22635 vendorlib='$vendorlib'
22636 vendorlib_stem='$vendorlib_stem'
22637 vendorlibexp='$vendorlibexp'
22638 vendorman1dir='$vendorman1dir'
22639 vendorman1direxp='$vendorman1direxp'
22640 vendorman3dir='$vendorman3dir'
22641 vendorman3direxp='$vendorman3direxp'
22642 vendorprefix='$vendorprefix'
22643 vendorprefixexp='$vendorprefixexp'
22644 vendorscript='$vendorscript'
22645 vendorscriptexp='$vendorscriptexp'
22647 version_patchlevel_string='$version_patchlevel_string'
22648 versiononly='$versiononly'
22650 voidflags='$voidflags'
22653 yaccflags='$yaccflags'
22658 : Add in command line options if available
22659 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22661 : add special variables
22662 $test -f $src/patchlevel.h && \
22663 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22664 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22665 echo "PERL_CONFIG_SH=true" >>config.sh
22667 : propagate old symbols
22668 if $test -f UU/config.sh; then
22669 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22670 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22671 $sort | $uniq -u >UU/oldsyms
22672 set X `cat UU/oldsyms`
22678 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22680 echo "# Variables propagated from previous config.sh file." >>config.sh
22681 for sym in `cat UU/oldsyms`; do
22682 echo " Propagating $hint variable "'$'"$sym..."
22683 eval 'tmp="$'"${sym}"'"'
22685 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22691 : Finish up by extracting the .SH files
22695 echo "Extraction done."
22705 If you'd like to make any changes to the config.sh file before I begin
22706 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22709 rp="Press return or use a shell escape to edit config.sh:"
22714 *) : in case they cannot read
22715 sh 1>&4 -c "$ans";;
22720 : if this fails, just run all the .SH files by hand
22729 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22736 Now you need to generate make dependencies by running "$make depend".
22737 You might prefer to run it in background: "$make depend > makedepend.out &"
22738 It can take a while, so you might not want to run it right now.
22743 rp="Run $make depend now?"
22747 $make depend && echo "Now you must run '$make'."
22750 echo "You must run '$make depend' then '$make'."
22753 elif test -f [Mm]akefile; then
22755 echo "Now you must run a $make."
22757 echo "Configure done."
22760 if $test -f Policy.sh; then
22763 If you compile $package on a different machine or from a different object
22764 directory, copy the Policy.sh file from this object directory to the
22765 new one before you run Configure -- this will help you with most of
22766 the policy defaults.
22770 if $test -f config.msg; then
22771 echo "Hmm. I also noted the following information while running:"
22773 $cat config.msg >&4
22776 $rm -f kit*isdone ark*isdone