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 Sat May 17 15:55:21 CEST 2008 [metaconfig 3.5 PL0]
29 # (with additional metaconfig patches by perlbug@perl.org)
34 SCO csh still thinks true is false. Write to SCO today and tell them that next
35 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
38 we'd have to do is go in and swap the && and || tokens, wherever they are.)
40 [End of diatribe. We now return you to your regularly scheduled programming...]
44 OOPS! You naughty creature! You didn't run Configure with sh!
45 I will attempt to remedy the situation by running sh for you...
49 true || exec sh $0 $argv:q
51 (exit $?0) || cat c2$$
52 (exit $?0) || exec sh $0 $argv:q
55 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
58 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
59 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
60 *** Please read the README.plan9 for further instructions.
61 *** Cannot continue, aborting.
67 if test ! -c /dev/null ; then
70 *** I'm sorry, but /dev/null appears to be a file rather than a device.
71 *** Please consult your operating sytem's notes for making a device
73 *** Cannot continue, aborting.
79 : compute my invocation name
83 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
88 : Proper separator for the PATH environment variable
90 : On OS/2 this directory should exist if this is not floppy only system ":-]"
91 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
92 if test -n "$OS2_SHELL"; then
94 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
95 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
97 elif test -n "$DJGPP"; then
98 case "X${MACHTYPE:-nonesuchmach}" in
105 : Proper PATH setting
106 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
107 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
108 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
109 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
110 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
111 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
112 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
113 paths="$paths /sbin /usr/sbin /usr/libexec"
114 paths="$paths /system/gnu_library/bin"
118 case "$p_$PATH$p_" in
120 *) test -d $p && PATH=$PATH$p_$p ;;
127 : shall we be using ksh?
133 if (PATH=.; alias -x) >/dev/null 2>&1; then
136 if test -f /hp-ux -a -f /bin/ksh; then
137 needksh='to avoid sh bug in "here document" expansion'
139 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
140 if test X`/usr/bin/uname -v` = X4; then
141 avoidksh="to avoid AIX 4's /bin/sh"
145 if test -f /osf_boot -a -f /usr/sbin/setld; then
146 if test X`/usr/bin/uname -s` = XOSF1; then
147 avoidksh="to avoid Digital UNIX' ksh"
152 case "$inksh/$needksh" in
159 case "$inksh/$avoidksh" in
165 case "$inksh/$needksh-$avoidksh-" in
168 (I see you are using the Korn shell. Some ksh's blow up on $me,
169 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
176 echo "(Feeding myself to $newsh $reason.)"
178 Configure|*/Configure) exec $newsh $0 "$@";;
179 *) exec $newsh Configure "$@";;
183 test -x "${newsh}" || unset newsh
185 : if needed, set CDPATH to a harmless value that is not chatty
186 : avoid bash 2.02 problems with empty CDPATH.
190 *bash*) CDPATH='.' ;;
196 : Configure runs within the UU subdirectory
197 test -d UU || mkdir UU
335 initialinstalllocation=''
362 d_attribute_format=''
363 d_attribute_malloc=''
364 d_attribute_nonnull=''
365 d_attribute_noreturn=''
367 d_attribute_unused=''
368 d_attribute_warn_unused_result=''
369 d_printf_format_null=''
372 d_builtin_choose_expr=''
375 d_c99_variadic_macros=''
422 endhostent_r_proto=''
428 endprotoent_r_proto=''
434 endservent_r_proto=''
486 gethostbyaddr_r_proto=''
488 gethostbyname_r_proto=''
490 gethostent_r_proto=''
502 getnetbyaddr_r_proto=''
504 getnetbyname_r_proto=''
518 d_getprotobyname_r=''
519 getprotobyname_r_proto=''
520 d_getprotobynumber_r=''
521 getprotobynumber_r_proto=''
523 getprotoent_r_proto=''
535 getservbyname_r_proto=''
537 getservbyport_r_proto=''
539 getservent_r_proto=''
563 d_libm_lib_version=''
566 d_localtime_r_needs_tzset=''
577 d_malloc_good_size=''
619 d_old_pthread_create_joinable=''
620 old_pthread_create_joinable=''
622 d_pthread_attr_setscope=''
661 sethostent_r_proto=''
678 setprotoent_r_proto=''
690 setservent_r_proto=''
724 d_sprintf_returns_strlen=''
739 d_stdio_ptr_lval_nochange_cnt=''
740 d_stdio_ptr_lval_sets_cnt=''
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_overflows_integers_at=''
1063 nv_preserves_uv_bits=''
1135 installsitehtml1dir=''
1138 installsitehtml3dir=''
1145 installsiteman1dir=''
1148 installsiteman3dir=''
1153 installsitescript=''
1168 d_stdio_stream_array=''
1169 stdio_stream_array=''
1182 ccflags_uselargefiles=''
1183 ldflags_uselargefiles=''
1184 libswanted_uselargefiles=''
1204 installvendorarch=''
1211 installvendorhtml1dir=''
1213 vendorhtml1direxp=''
1214 installvendorhtml3dir=''
1216 vendorhtml3direxp=''
1222 installvendorman1dir=''
1225 installvendorman3dir=''
1232 installvendorscript=''
1245 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1248 : We must find out about Eunice early
1250 if test -f /etc/unixtovms; then
1251 eunicefix=/etc/unixtovms
1253 if test -f /etc/unixtovms.exe; then
1254 eunicefix=/etc/unixtovms.exe
1257 : Set executable suffix now -- needed before hints available
1258 if test -f "/libs/version.library"; then
1261 elif test -f "/system/gnu_library/bin/ar.pm"; then
1264 elif test -n "$DJGPP"; then
1267 elif test -d c:/. -o -n "$is_os2" ; then
1273 : Trailing extension. Override this in a hint file, if needed.
1274 : Extra object files, if any, needed on this platform.
1279 : change the next line if compiling for Xenix/286 on Xenix/386
1280 xlibpth='/usr/lib/386 /lib/386'
1281 : Possible local library directories to search.
1282 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1283 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1285 : general looking path for locating libraries
1286 glibpth="/lib /usr/lib $xlibpth"
1287 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1288 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1289 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1290 test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
1292 : Private path used by Configure to find libraries. Its value
1293 : is prepended to libpth. This variable takes care of special
1294 : machines, like the mips. Usually, it should be empty.
1297 : default library list
1299 : some systems want to use only the non-versioned libso:s
1300 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.5 PL0." >&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" |\
1940 (split -l 50 2>/dev/null || split -50)
1943 for filelist in x??; do
1944 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1945 >/dev/null 2>>"$tmppwd/missing")
1947 if test -s missing; then
1951 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1953 You have the option of continuing the configuration process, despite the
1954 distinct possibility that your kit is damaged, by typing 'y'es. If you
1955 do, don't blame me if something goes wrong. I advise you to type 'n'o
1956 and contact the author (perlbug@perl.org).
1959 echo $n "Continue? [n] $c" >&4
1963 echo "Continuing..." >&4
1967 echo "ABORTING..." >&4
1972 echo "Looks good..."
1975 echo "There is no MANIFEST file. I hope your kit is complete !"
1979 : Find the appropriate value for a newline for tr
1981 if test -n "$DJGPP"; then
1984 if test X"$trnl" = X; then
1985 case "`echo foo|tr '\n' x 2>/dev/null`" in
1989 if test X"$trnl" = X; then
1990 case "`echo foo|tr '\012' x 2>/dev/null`" in
1991 foox) trnl='\012' ;;
1994 if test X"$trnl" = X; then
1995 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1996 fooxy) trnl='\n\r' ;;
1999 if test X"$trnl" = X; then
2002 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2008 : compute the number of columns on the terminal for proper question formatting
2013 : set up the echo used in my read
2014 myecho="case \"\$xxxm\" in
2015 '') echo $n \"\$rp $c\" >&4;;
2017 '') echo $n \"[\$xxxm] $c\";;
2019 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2021 echo $n \"[\$xxxm] $c\" >&4
2023 echo $n \"\$rp [\$xxxm] $c\" >&4
2029 : now set up to do reads with possible shell escape and default assignment
2035 case "\$fastread" in
2036 yes) case "\$dflt" in
2039 case "\$silent-\$rp" in
2044 *) case "\$silent" in
2045 true) case "\$rp" in
2050 while expr "X\$ans" : "X!" >/dev/null; do
2054 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2062 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2071 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2076 echo "(OK, I'll run with -d after this question.)" >&4
2079 echo "*** Sorry, \$1 not supported yet." >&4
2089 echo "*** Substitution done -- please confirm."
2091 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2096 echo "*** Error -- try again."
2103 case "\$ans\$xxxm\$nostick" in
2115 : create .config dir to save info across Configure sessions
2116 test -d ../.config || mkdir ../.config
2117 cat >../.config/README <<EOF
2118 This directory created by Configure to save information that should
2119 persist across sessions for $package.
2121 You may safely delete it if you wish.
2124 : See if we are using a devel version and want that
2125 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2127 $define|true|[yY]*) ;;
2128 *) case "$xversion" in
2131 *** WHOA THERE!!! ***
2133 This is an UNSTABLE DEVELOPMENT release.
2134 The version of this $package distribution is $xversion, that is, odd,
2135 (as opposed to even) and that signifies a development release.
2136 If you want a maintenance release, you want an even-numbered version.
2138 Do ***NOT*** install this into production use.
2139 Data corruption and crashes are possible.
2141 It is most seriously suggested that you do not continue any further
2142 unless you want to help in developing and debugging Perl.
2144 If you *still* want to build perl, you can answer 'y' now,
2145 or pass -Dusedevel to Configure.
2148 rp='Do you really want to continue?'
2152 [yY]) echo >&4 "Okay, continuing."
2153 usedevel="$define" ;;
2154 *) echo >&4 "Okay, bye."
2164 case "$versiononly" in
2165 '') versiononly="$define" ;;
2167 case "$installusrbinperl" in
2168 '') installusrbinperl="$undef" ;;
2173 : general instructions
2176 user=`(logname) 2>/dev/null`
2178 '') user=`whoami 2>&1`;;
2180 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2183 rp='Would you like to see the instructions?'
2194 This installation shell script will examine your system and ask you questions
2195 to determine how the perl5 package should be installed. If you get
2196 stuck on a question, you may use a ! shell escape to start a subshell or
2197 execute a command. Many of the questions will have default answers in square
2198 brackets; typing carriage return will give you the default.
2200 On some of the questions which ask for file or directory names you are allowed
2201 to use the ~name construct to specify the login directory belonging to "name",
2202 even if you don't have a shell which knows about that. Questions where this is
2203 allowed will be marked "(~name ok)".
2207 dflt='Type carriage return to continue'
2211 The prompter used in this script allows you to use shell variables and
2212 backticks in your answers. You may use $1, $2, etc... to refer to the words
2213 in the default answer, as if the default line was a set of arguments given to a
2214 script shell. This means you may also use $* to repeat the whole default line,
2215 so you do not have to re-type everything to add something to the default.
2217 Everytime there is a substitution, you will have to confirm. If there is an
2218 error (e.g. an unmatched backtick), the default answer will remain unchanged
2219 and you will be prompted again.
2221 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2222 the questions and use the computed defaults (or the previous answers if there
2223 was already a config.sh file). Type 'Configure -h' for a list of options.
2224 You may also start interactively and then answer '& -d' at any prompt to turn
2225 on the non-interactive behaviour for the remainder of the execution.
2231 Much effort has been expended to ensure that this shell script will run on any
2232 Unix system. If despite that it blows up on yours, your best bet is to edit
2233 Configure and run it again. If you can't run Configure for some reason,
2234 you'll have to generate a config.sh file by hand. Whatever problems you
2235 have, let me (perlbug@perl.org) know how I blew it.
2237 This installation script affects things in two ways:
2239 1) it may do direct variable substitutions on some of the files included
2241 2) it builds a config.h file for inclusion in C programs. You may edit
2242 any of these files as the need arises after running this script.
2244 If you make a mistake on a question, there is no easy way to back up to it
2245 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2246 files. Configure will offer to let you do this before it runs the SH files.
2249 dflt='Type carriage return to continue'
2251 case "$firsttime" in
2252 true) echo $user >>../.config/instruct;;
2256 : find out where common programs are
2258 echo "Locating common programs..." >&4
2271 if test -d \$dir/\$thing; then
2277 for thisthing in \$dir/\$thing; do
2278 : just loop through to pick last item
2280 if test -f \$thisthing; then
2283 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2286 elif test -f \$dir/\$thing.exe; then
2287 if test -n "$DJGPP"; then
2288 echo \$dir/\$thing.exe
2289 elif test "$eunicefix" != ":"; then
2290 : 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
2673 : Make symlinks util
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";;
3904 : allow them to override the AFS root
3907 *) afsroot=$afsroot ;;
3913 $define|true) afs=true ;;
3914 $undef|false) afs=false ;;
3915 *) if $test -d $afsroot; then
3923 echo "AFS may be running... I'll be extra cautious then..." >&4
3925 echo "AFS does not seem to be running..." >&4
3928 : determine installation prefix for where package is to be installed.
3932 Since you are running AFS, I need to distinguish the directory in which
3933 files will reside from the directory in which they are installed (and from
3934 which they are presumably copied to the former directory by occult means).
3937 case "$installprefix" in
3938 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3939 *) dflt="$installprefix";;
3944 In some special cases, particularly when building $package for distribution,
3945 it is convenient to distinguish the directory in which files should be
3946 installed from the directory ($prefix) in which they will
3947 eventually reside. For most users, these two directories are the same.
3950 case "$installprefix" in
3952 *) dflt=$installprefix;;
3956 rp='What installation prefix should I use for installing files?'
3958 installprefix="$ans"
3959 installprefixexp="$ansexp"
3961 : Perform the prefixexp/installprefixexp correction if necessary
3962 cat <<EOS >installprefix
3965 cat <<'EOSC' >>installprefix
3966 : Change installation prefix, if necessary.
3967 if $test X"$prefix" != X"$installprefix"; then
3968 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3970 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3973 chmod +x installprefix
3974 $eunicefix installprefix
3976 : Set variables such as privlib and privlibexp from the output of ./getfile
3977 : performing the prefixexp/installprefixexp correction if necessary.
3978 cat <<EOS >setprefixvar
3981 cat <<'EOSC' >>setprefixvar
3982 eval "${prefixvar}=\"\$ans\""
3983 eval "${prefixvar}exp=\"\$ansexp\""
3986 chmod +x setprefixvar
3987 $eunicefix setprefixvar
3989 : set up the script used to warn in case of inconsistency
3998 '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
4000 *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4
4001 echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
4006 echo "*** WHOA THERE!!! ***" >&4
4007 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
4010 rp=" Keep the $hint value?"
4013 y) td=$was; tu=$was;;
4017 : function used to set '$1' to '$val'
4018 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
4020 $define$undef) . ./whoa; eval "$var=\$td";;
4021 $undef$define) . ./whoa; eval "$var=\$tu";;
4022 *) eval "$var=$val";;
4025 : Check is we will use socks
4027 $define|true|[yY]*) dflt='y';;
4032 Perl can be built to use the SOCKS proxy protocol library. To do so,
4033 Configure must be run with -Dusesocks. If you use SOCKS you also need
4034 to use the PerlIO abstraction layer, this will be implicitly selected.
4036 If this doesn't make any sense to you, just accept the default '$dflt'.
4038 rp='Build Perl for SOCKS?'
4041 y|Y) val="$define" ;;
4048 $define|true|[yY]*) useperlio="$define";;
4051 : Check if we want perlio
4052 case "$useperlio" in
4053 $define|true|[yY]*|'') dflt='y';;
4058 Previous version of $package used the standard IO mechanisms as
4059 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
4060 alternate IO mechanisms via the PerlIO abstraction layer, but the
4061 stdio mechanism is still available if needed. The abstraction layer
4062 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
4063 Using PerlIO with sfio may cause problems with some extension modules.
4065 If this doesn't make any sense to you, just accept the default '$dflt'.
4067 rp='Use the PerlIO abstraction layer?'
4074 echo "Ok, doing things the stdio way."
4083 case "$useperlio" in
4084 $define|true|[yY]*) ;;
4087 You are using the SOCKS proxy protocol library which means that you
4088 should also use the PerlIO layer. You may be headed for trouble.
4096 : get the patchlevel
4098 echo "Getting the current patchlevel..." >&4
4099 if $test -r $rsrc/patchlevel.h;then
4100 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
4101 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
4102 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4103 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
4104 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
4105 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
4106 perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
4115 $echo "(You do not have patchlevel.h. Eek.)"
4117 if $test -r $rsrc/.patch ; then
4118 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
4119 perl_patchlevel=`cat $rsrc/.patch`
4122 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
4123 version_patchlevel_string="version $patchlevel subversion $subversion"
4124 case "$perl_patchlevel" in
4126 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
4129 $echo "(You have $package $version_patchlevel_string.)"
4133 : XXX Should be a Configure test for double-dots in filenames.
4134 version=`echo $revision $patchlevel $subversion | \
4135 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4136 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4137 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
4140 version=`echo $revision $patchlevel $subversion | \
4141 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4142 api_versionstring=`echo $api_revision $api_version $api_subversion | \
4143 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
4146 : Special case the 5.005_xx maintenance series, which used 5.005
4147 : without any subversion label as a subdirectory in $sitelib
4148 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
4149 api_versionstring='5.005'
4152 : Do we want threads support and if so, what type
4153 case "$usethreads" in
4154 $define|true|[yY]*) dflt='y';;
4155 *) # Catch case where user specified ithreads or 5005threads but
4156 # forgot -Dusethreads (A.D. 4/2002)
4157 case "$useithreads$use5005threads" in
4159 case "$useperlio" in
4160 "$define") dflt='y' ;;
4170 Perl can be built to take advantage of threads on some systems.
4171 To do so, Configure can be run with -Dusethreads.
4173 Note that Perl built with threading support runs slightly slower
4174 and uses more memory than plain Perl. The current implementation
4175 is believed to be stable, but it is fairly new, and so should be
4176 treated with caution.
4178 If this doesn't make any sense to you, just accept the default '$dflt'.
4180 rp='Build a threading Perl?'
4183 y|Y) val="$define" ;;
4189 if $test $patchlevel -lt 9; then
4190 case "$usethreads" in
4194 Since release 5.6, Perl has had two different threading implementations,
4195 the newer interpreter-based version (ithreads) with one interpreter per
4196 thread, and the older 5.005 version (5005threads).
4197 The 5005threads version is effectively unmaintained and will probably be
4198 removed in Perl 5.10, so there should be no need to build a Perl using it
4199 unless needed for backwards compatibility with some existing 5.005threads
4203 : Default to ithreads unless overridden on command line or with
4206 case "$use5005threads" in
4207 $define|true|[yY]*) dflt='n';;
4209 case "$useithreads" in
4210 $undef|false|[nN]*) dflt='n';;
4212 rp='Use the newer interpreter-based ithreads?'
4215 y|Y) val="$define" ;;
4220 : Now set use5005threads to the opposite value.
4221 case "$useithreads" in
4222 $define) val="$undef" ;;
4229 useithreads="$undef"
4230 use5005threads="$undef"
4234 case "$useithreads$use5005threads" in
4238 You cannot have both the ithreads and the 5.005 threads enabled
4239 at the same time. Disabling the 5.005 threads since they are
4240 much less stable than the ithreads.
4243 use5005threads="$undef"
4248 : perl-5.9.x and later
4250 if test X"$usethreads" = "X$define"; then
4251 case "$use5005threads" in
4255 5.005 threads has been removed for 5.10. Perl will be built using ithreads.
4262 use5005threads="$undef"
4263 useithreads="$usethreads"
4266 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4269 *** To build with ithreads you must also use the PerlIO layer.
4270 *** Cannot continue, aborting.
4276 case "$d_oldpthreads" in
4277 '') : Configure tests would be welcome here. For now, assume undef.
4279 *) val="$d_oldpthreads" ;;
4285 : Look for a hint-file generated 'call-back-unit'. If the
4286 : user has specified that a threading perl is to be built,
4287 : we may need to set or change some other defaults.
4288 if $test -f usethreads.cbu; then
4289 echo "Your platform has some specific hints regarding threaded builds, using them..."
4292 case "$usethreads" in
4293 "$define"|true|[yY]*)
4295 (Your platform does not have any specific hints for threaded builds.
4296 Assuming POSIX threads, then.)
4302 : Check if multiplicity is required
4305 Perl can be built so that multiple Perl interpreters can coexist
4306 within the same Perl executable.
4309 case "$useithreads" in
4312 This multiple interpreter support is required for interpreter-based threads.
4316 *) case "$usemultiplicity" in
4317 $define|true|[yY]*) dflt='y';;
4321 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4322 rp='Build Perl for multiplicity?'
4325 y|Y) val="$define" ;;
4333 : Check if morebits is requested
4334 case "$usemorebits" in
4335 "$define"|true|[yY]*)
4336 use64bitint="$define"
4337 uselongdouble="$define"
4338 usemorebits="$define"
4340 *) usemorebits="$undef"
4344 : Determine the C compiler to be used
4350 rp="Use which C compiler?"
4354 : See whether they have no cc but they do have gcc
4356 if $test -f cc.cbu; then
4361 : make some quick guesses about what we are up against
4363 $echo $n "Hmm... $c"
4373 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4374 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4376 echo "Looks kind of like an OSF/1 system, but we'll see..."
4378 elif test `echo abc | $tr a-z A-Z` = Abc ; then
4379 xxx=`./loc addbib blurfl $pth`
4380 if $test -f $xxx; then
4381 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4385 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4386 echo "Looks kind of like an extended USG system, but we'll see..."
4388 echo "Looks kind of like a USG system, but we'll see..."
4392 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4393 echo "Looks kind of like a BSD system, but we'll see..."
4397 echo "Looks kind of like a Version 7 system, but we'll see..."
4400 case "$eunicefix" in
4403 There is, however, a strange, musty smell in the air that reminds me of
4404 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4408 : it so happens the Eunice I know will not run shell scripts in Unix format
4412 echo "Congratulations. You aren't running Eunice."
4416 : Detect OS2. The p_ variable is set above in the Head.U unit.
4417 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4418 : semicolon as a patch separator
4423 I have the feeling something is not exactly right, however...don't tell me...
4424 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4425 (Or you may be running DOS with DJGPP.)
4430 if test -f /xenix; then
4431 echo "Actually, this looks more like a XENIX system..."
4436 echo "It's not Xenix..."
4441 if test -f /venix; then
4442 echo "Actually, this looks more like a VENIX system..."
4449 echo "Nor is it Venix..."
4452 chmod +x bsd usg v7 osf1 eunice xenix venix os2
4453 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
4456 : Check if we are using GNU gcc and what its version is
4458 echo "Checking for GNU cc in disguise and/or its version number..." >&4
4462 #if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4464 printf("%s\n", __VERSION__);
4466 printf("%s\n", "1");
4472 if $cc -o try $ccflags $ldflags try.c; then
4473 gccversion=`$run ./try`
4474 case "$gccversion" in
4475 '') echo "You are not using GNU cc." ;;
4476 *) echo "You are using GNU cc $gccversion."
4482 echo "*** WHOA THERE!!! ***" >&4
4483 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4484 case "$knowitall" in
4486 echo " You'd better start hunting for one and let me know about it." >&4
4492 case "$gccversion" in
4493 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4495 case "$gccversion" in
4496 '') gccosandvers='' ;;
4497 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4498 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4500 case "$gccosandvers" in
4501 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4502 $osname$osvers) ;; # looking good
4503 $osname*) cat <<EOM >&4
4505 *** WHOA THERE!!! ***
4507 Your gcc has not been compiled for the exact release of
4508 your operating system ($gccosandvers versus $osname$osvers).
4510 In general it is a good idea to keep gcc synchronized with
4511 the operating system because otherwise serious problems
4512 may ensue when trying to compile software, like Perl.
4514 I'm trying to be optimistic here, though, and will continue.
4515 If later during the configuration and build icky compilation
4516 problems appear (headerfile conflicts being the most common
4517 manifestation), I suggest reinstalling the gcc to match
4518 your operating system release.
4522 *) gccosandvers='' ;; # failed to parse, better be silent
4530 # gcc 3.* complain about adding -Idirectories that they already know about,
4531 # so we will take those off from locincpth.
4532 case "$gccversion" in
4534 echo "main(){}">try.c
4535 for incdir in $locincpth; do
4536 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4537 grep '^c[cp]p*[01]: warning: changing search order '`
4538 if test "X$warn" != X; then
4539 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4545 : What should the include directory be ?
4547 $echo $n "Hmm... $c"
4551 if $test -f /bin/mips && /bin/mips; then
4552 echo "Looks like a MIPS system..."
4553 $cat >usr.c <<'EOCP'
4554 #ifdef SYSTYPE_BSD43
4558 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4559 dflt='/bsd43/usr/include'
4563 mips_type='System V'
4565 $rm -f usr.c usr.out
4566 echo "and you're compiling with the $mips_type compiler and libraries."
4570 echo "Doesn't look like a MIPS system."
4580 case "$xxx_prompt" in
4583 rp='Where are the include files you want to use?'
4591 : see how we invoke the C preprocessor
4593 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4594 cat <<'EOT' >testcpp.c
4600 if test ! -f cppstdin; then
4601 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4602 # AIX cc -E doesn't show the absolute headerfile
4603 # locations but we'll cheat by using the -M flag.
4604 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
4606 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4609 echo "Keeping your $hint cppstdin wrapper."
4612 wrapper=`pwd`/cppstdin
4616 if $test "X$cppstdin" != "X" && \
4617 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4618 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4620 echo "You used to use $cppstdin $cppminus so we'll use that again."
4622 '') echo "But let's see if we can live without a wrapper..." ;;
4624 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4625 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4627 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4630 echo "(However, $cpprun $cpplast does not work, let's see...)"
4638 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4645 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4646 $cc -E <testcpp.c >testcpp.out 2>&1; \
4647 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4648 echo "Yup, it does."
4651 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4652 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4653 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4654 echo "Yup, it does."
4657 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4658 $cc -P <testcpp.c >testcpp.out 2>&1; \
4659 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4660 echo "Yipee, that works!"
4663 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4664 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4665 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4666 echo "At long last!"
4669 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4670 $cpp <testcpp.c >testcpp.out 2>&1; \
4671 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4675 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4676 $cpp - <testcpp.c >testcpp.out 2>&1; \
4677 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4678 echo "Hooray, it works! I was beginning to wonder."
4681 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4682 $wrapper <testcpp.c >testcpp.out 2>&1; \
4683 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4689 rp="No dice. I can't find a C preprocessor. Name one:"
4693 $x_cpp <testcpp.c >testcpp.out 2>&1
4694 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4695 echo "OK, that will do." >&4
4697 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4712 echo "Perhaps can we force $cc -E using a wrapper..."
4713 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4714 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4720 echo "Nope, we'll have to live without it..."
4734 "$wrapper"|'cppstdin') ;;
4735 *) $rm -f $wrapper;;
4737 $rm -f testcpp.c testcpp.out
4739 : Set private lib path
4742 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4747 '') dlist="$loclibpth $plibpth $glibpth";;
4748 *) dlist="$libpth";;
4751 : Now check and see which directories actually exist, avoiding duplicates
4755 if $test -d $xxx; then
4758 *) libpth="$libpth $xxx";;
4764 Some systems have incompatible or broken versions of libraries. Among
4765 the directories listed in the question below, please remove any you
4766 know not to be holding relevant libraries, and add any that are needed.
4767 Say "none" for none.
4778 rp="Directories to use for library searches?"
4785 : compute shared library extension
4788 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4798 On some systems, shared libraries may be available. Answer 'none' if
4799 you want to suppress searching of shared libraries for the remainder
4800 of this configuration.
4803 rp='What is the file extension used for shared libraries?'
4807 : Define several unixisms.
4808 : Hints files or command line option can be used to override them.
4809 : The convoluted testing is in case hints files set either the old
4812 '') case "$exe_ext" in
4814 *) _exe="$exe_ext" ;;
4819 '') case "$lib_ext" in
4826 '') case "$obj_ext" in
4833 '') case "$path_sep" in
4844 rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*"
4846 : Which makefile gets called first. This is used by make depend.
4847 case "$firstmakefile" in
4848 '') firstmakefile='makefile';;
4851 : Check for uselongdouble support
4853 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4856 case "$uselongdouble" in
4857 $define|true|[yY]*) dflt='y';;
4862 Perl can be built to take advantage of long doubles which
4863 (if available) may give more accuracy and range for floating point numbers.
4865 If this doesn't make any sense to you, just accept the default '$dflt'.
4867 rp='Try to use long doubles if available?'
4870 y|Y) val="$define" ;;
4876 case "$uselongdouble" in
4877 true|[yY]*) uselongdouble="$define" ;;
4880 : Look for a hint-file generated 'call-back-unit'. If the
4881 : user has specified that long doubles should be used,
4882 : we may need to set or change some other defaults.
4883 if $test -f uselongdouble.cbu; then
4884 echo "Your platform has some specific hints regarding long doubles, using them..."
4885 . ./uselongdouble.cbu
4887 case "$uselongdouble" in
4890 (Your platform does not have any specific hints for long doubles.)
4896 : Looking for optional libraries
4898 echo "Checking for optional libraries..." >&4
4903 case "$libswanted" in
4904 '') libswanted='c_s';;
4907 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4913 for thisdir in $libpth $xlibpth; do
4914 test -d $thisdir && libspath="$libspath $thisdir"
4916 for thislib in $libswanted; do
4917 for thisdir in $libspath; do
4919 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4920 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4921 $test -f "$xxx" && eval $libscheck
4922 $test -f "$xxx" && libstyle=shared
4924 if test ! -f "$xxx"; then
4925 xxx=$thisdir/lib$thislib.$so
4926 $test -f "$xxx" && eval $libscheck
4927 $test -f "$xxx" && libstyle=shared
4929 if test ! -f "$xxx"; then
4930 xxx=$thisdir/lib$thislib$_a
4931 $test -f "$xxx" && eval $libscheck
4932 $test -f "$xxx" && libstyle=static
4934 if test ! -f "$xxx"; then
4935 xxx=$thisdir/$thislib$_a
4936 $test -f "$xxx" && eval $libscheck
4937 $test -f "$xxx" && libstyle=static
4939 if test ! -f "$xxx"; then
4940 xxx=$thisdir/lib${thislib}_s$_a
4941 $test -f "$xxx" && eval $libscheck
4942 $test -f "$xxx" && libstyle=static
4943 $test -f "$xxx" && thislib=${thislib}_s
4945 if test ! -f "$xxx"; then
4946 xxx=$thisdir/Slib$thislib$_a
4947 $test -f "$xxx" && eval $libscheck
4948 $test -f "$xxx" && libstyle=static
4950 if $test -f "$xxx"; then
4952 shared) echo "Found -l$thislib (shared)." ;;
4953 static) echo "Found -l$thislib." ;;
4954 *) echo "Found -l$thislib ($libstyle)." ;;
4958 *) dflt="$dflt -l$thislib"
4959 libsfound="$libsfound $xxx"
4961 libsfiles="$libsfiles $yyy"
4962 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4963 case " $libsdirs " in
4965 *) libsdirs="$libsdirs $yyy" ;;
4972 if $test ! -f "$xxx"; then
4973 echo "No -l$thislib."
4984 ' '|'') dflt='none';;
4989 In order to compile $package on your machine, a number of libraries
4990 are usually needed. Include any other special libraries here as well.
4991 Say "none" for none. The default list is almost always right.
4995 rp="What libraries to use?"
5002 : determine optimization, if desired, or use for debug flag also
5004 ' '|$undef) dflt='none';;
5006 *) dflt="$optimize";;
5010 By default, $package compiles with the -O flag to use the optimizer.
5011 Alternately, you might want to use the symbolic debugger, which uses
5012 the -g flag (on traditional Unix systems). Either flag can be
5013 specified here. To use neither flag, specify the word "none".
5016 rp="What optimizer/debugger flag should be used?"
5020 'none') optimize=" ";;
5023 : Check what DEBUGGING is required from the command line
5024 : -DEBUGGING or -DDEBUGGING or
5025 : -DEBUGGING=both = -g + -DDEBUGGING
5026 : -DEBUGGING=-g or -Doptimize=-g = -g
5027 : -DEBUGGING=none or -UDEBUGGING =
5028 : -DEBUGGING=old or -DEBUGGING=default = ? $optimize
5031 *) DEBUGGING=$EBUGGING ;;
5034 case "$DEBUGGING" in
5038 *) optimize="$optimize -g" ;;
5042 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
5050 case "$DEBUGGING" in
5051 both|$define) dflt='-DDEBUGGING'
5054 : argument order is deliberate, as the flag will start with - which set could
5055 : think is an option
5056 checkccflag='check=$1; flag=$2; callback=$3;
5058 echo "Checking if your compiler accepts $flag" 2>&1;
5059 echo "int main(void) { return 0; }" > gcctest.c;
5060 if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
5061 echo "Yes, it does." 2>&1;
5062 if $test -s gcctest.out ; then
5063 echo "But your platform does not like it:";
5068 echo "Leaving current flags $ccflags alone." 2>&1
5070 *) dflt="$dflt $flag";
5076 echo "Nope, it does not, but that is ok." 2>&1;
5080 : We will not override a previous value, but we might want to
5081 : augment a hint file
5083 default|recommended)
5084 case "$gccversion" in
5085 1*) dflt="$dflt -fpcc-struct-return" ;;
5087 case "$optimize:$DEBUGGING" in
5088 *-g*:old) dflt="$dflt -DDEBUGGING";;
5090 case "$gccversion" in
5091 2*) if $test -d /etc/conf/kconfig.d &&
5092 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
5094 # Interactive Systems (ISC) POSIX mode.
5099 case "$gccversion" in
5102 ?*) set strict-aliasing -fno-strict-aliasing
5106 # For gcc, adding -pipe speeds up compilations for some, but apparently
5107 # some assemblers can't read from stdin. (It also slows down compilations
5108 # in other cases, but those are apparently rarer these days.) AD 5/2004.
5109 case "$gccversion" in
5115 # on x86_64 (at least) we require an extra library (libssp) in the
5116 # link command line. This library is not named, so I infer that it is
5117 # an implementation detail that may change. Hence the safest approach
5118 # is to add the flag to the flags passed to the compiler at link time,
5119 # as that way the compiler can do the right implementation dependant
5121 case "$gccversion" in
5122 ?*) set stack-protector -fstack-protector
5129 case "$mips_type" in
5130 *BSD*|'') inclwanted="$locincpth $usrinc";;
5131 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
5133 for thisincl in $inclwanted; do
5134 if $test -d $thisincl; then
5135 if $test x$thisincl != x$usrinc; then
5137 *" -I$thisincl "*);;
5138 *) dflt="$dflt -I$thisincl ";;
5144 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
5146 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
5154 *) dflt="$dflt -D$2";;
5158 set signal.h LANGUAGE_C; eval $inctest
5162 ccflags="$ccflags -DSOCKS"
5167 default|recommended) dflt="$ccflags $dflt" ;;
5168 *) dflt="$ccflags";;
5177 Your C compiler may want other flags. For this question you should include
5178 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5179 but you should NOT include libraries or ld flags like -lwhatever. If you
5180 want $package to honor its debug switch, you should include -DDEBUGGING here.
5181 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5183 To use no flags, specify the word "none".
5189 rp="Any additional cc flags?"
5196 : the following weeds options from ccflags that are of no interest to cpp
5198 '') cppflags="$ccflags" ;;
5199 *) cppflags="$cppflags $ccflags" ;;
5201 case "$gccversion" in
5202 1*) cppflags="$cppflags -D__GNUC__"
5204 case "$mips_type" in
5206 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5212 echo "Let me guess what the preprocessor flags are..." >&4
5226 *) ftry="$previous $flag";;
5228 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5229 >cpp1.out 2>/dev/null && \
5230 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5231 >cpp2.out 2>/dev/null && \
5232 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5233 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5235 cppflags="$cppflags $ftry"
5245 *-*) echo "They appear to be: $cppflags";;
5247 $rm -f cpp.c cpp?.out
5251 : flags used in final linking phase
5253 '') if ./venix; then
5259 *-posix*) dflt="$dflt -posix" ;;
5261 # See note above about -fstack-protector
5263 *-fstack-protector*) dflt="$dflt -fstack-protector" ;;
5266 *) dflt="$ldflags";;
5269 : Try to guess additional flags to pick up local libraries.
5270 for thislibdir in $libpth; do
5271 case " $loclibpth " in
5274 *"-L$thislibdir "*) ;;
5275 *) dflt="$dflt -L$thislibdir" ;;
5287 Your C linker may need flags. For this question you should
5288 include -L/whatever and any other flags used by the C linker, but you
5289 should NOT include libraries like -lwhatever.
5291 Make sure you include the appropriate -L/path flags if your C linker
5292 does not normally search all of the directories you specified above,
5295 To use no flags, specify the word "none".
5299 rp="Any additional ld flags (NOT including libraries)?"
5305 rmlist="$rmlist pdp11"
5309 echo "Checking your choice of C compiler and flags for coherency..." >&4
5310 $cat > try.c <<'EOF'
5312 int main() { printf("Ok\n"); return(0); }
5314 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5316 $cat >try.msg <<'EOM'
5317 I've tried to compile and run the following simple program:
5320 $cat try.c >> try.msg
5322 $cat >> try.msg <<EOM
5329 and I got the following output:
5333 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5334 if $sh -c "$run ./try " >>try.msg 2>&1; then
5338 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5341 cat >> try.msg <<'EOQS'
5342 If $libs contains -lsfio, and sfio is mis-configured, then it
5343 sometimes (apparently) runs and exits with a 0 status, but with no
5344 output! It may have to do with sfio's use of _exit vs. exit.
5347 rp="You have a big problem. Shall I abort Configure"
5354 echo "The program compiled OK, but exited with status $?." >>try.msg
5355 rp="You have a problem. Shall I abort Configure"
5359 echo "I can't compile the test program." >>try.msg
5360 rp="You have a BIG problem. Shall I abort Configure"
5366 case "$knowitall" in
5368 echo "(The supplied flags or libraries might be incorrect.)"
5376 *) echo "Ok. Stopping Configure." >&4
5381 n) echo "OK, that should do.";;
5383 $rm_try gcctest gcctest.out
5385 : define a shorthand compile call
5389 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
5390 echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
5394 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5395 : define a shorthand compile call for compilations that should be ok.
5399 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5401 : determine filename position in cpp output
5403 echo "Computing filename position in cpp output for #include directives..." >&4
5405 vos) testaccess=-e ;;
5408 echo '#include <stdio.h>' > foo.c
5411 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5412 $grep '^[ ]*#.*stdio\.h' | \
5413 while read cline; do
5416 while $test \$# -gt 0; do
5417 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5422 pos=\`expr \$pos + 1\`
5434 *) pos="${fieldn}th";;
5436 echo "Your cpp writes the filename in the $pos field of the line."
5439 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5440 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5443 : locate header file
5448 for usrincdir in $usrinc
5450 if test -f \$usrincdir/\$wanted; then
5451 echo "\$usrincdir/\$wanted"
5455 awkprg='{ print \$$fieldn }'
5456 echo "#include <\$wanted>" > foo\$\$.c
5457 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5458 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5459 while read cline; do
5460 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5462 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5463 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5468 # status = 0: grep returned 0 lines, case statement not executed
5469 # status = 1: headerfile found
5470 # status = 2: while loop executed, no headerfile found
5474 if test \$status -eq 1; then
5481 : define an alternate in-header-list? function
5482 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5483 cont=true; xxf="echo \"<\$1> found.\" >&4";
5484 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5485 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5487 case $# in 4) instead=instead;; *) instead="at last";; esac;
5488 while $test "$cont"; do
5490 var=$2; eval "was=\$$2";
5491 if $test "$xxx" && $test -r "$xxx";
5493 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5496 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5497 set $yyy; shift; shift; yyy=$@;
5498 case $# in 0) cont="";;
5499 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5500 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5501 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5502 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5506 do set $yyy; var=$2; eval "was=\$$2";
5507 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5508 set $yyy; shift; shift; yyy=$@;
5511 : see if stdlib is available
5512 set stdlib.h i_stdlib
5515 : check for lengths of integral types
5519 echo "Checking to see how big your integers are..." >&4
5528 printf("intsize=%d;\n", (int)sizeof(int));
5529 printf("longsize=%d;\n", (int)sizeof(long));
5530 printf("shortsize=%d;\n", (int)sizeof(short));
5535 if eval $compile_ok && $run ./try > /dev/null; then
5537 echo "Your integers are $intsize bytes long."
5538 echo "Your long integers are $longsize bytes long."
5539 echo "Your short integers are $shortsize bytes long."
5543 Help! I can't compile and run the intsize test program: please enlighten me!
5544 (This is probably a misconfiguration in your system or libraries, and
5545 you really ought to fix it. Still, I'll try anyway.)
5549 rp="What is the size of an integer (in bytes)?"
5553 rp="What is the size of a long integer (in bytes)?"
5557 rp="What is the size of a short integer (in bytes)?"
5565 : check for long long
5567 echo "Checking to see if you have long long..." >&4
5568 echo 'int main() { long long x = 7; return 0; }' > try.c
5570 if eval $compile; then
5572 echo "You have long long."
5575 echo "You do not have long long."
5581 : check for length of long long
5582 case "${d_longlong}${longlongsize}" in
5585 echo "Checking to see how big your long longs are..." >&4
5586 $cat >try.c <<'EOCP'
5590 printf("%d\n", (int)sizeof(long long));
5595 if eval $compile_ok; then
5596 longlongsize=`$run ./try`
5597 echo "Your long longs are $longlongsize bytes long."
5601 echo "(I can't seem to compile the test program. Guessing...)"
5602 rp="What is the size of a long long (in bytes)?"
5606 if $test "X$longsize" = "X$longlongsize"; then
5607 echo "(That isn't any different from an ordinary long.)"
5613 : see if inttypes.h is available
5614 : we want a real compile instead of Inhdr because some systems
5615 : have an inttypes.h which includes non-existent headers
5618 #include <inttypes.h>
5620 static int32_t foo32 = 0x12345678;
5624 if eval $compile; then
5625 echo "<inttypes.h> found." >&4
5628 echo "<inttypes.h> NOT found." >&4
5637 echo "Checking to see if you have int64_t..." >&4
5639 #include <sys/types.h>
5640 #$i_inttypes I_INTTYPES
5642 #include <inttypes.h>
5644 int main() { int64_t x = 7; }
5647 if eval $compile; then
5649 echo "You have int64_t."
5652 echo "You do not have int64_t."
5658 : Check if 64bit ints have a quad type
5660 echo "Checking which 64-bit integer type we could use..." >&4
5666 val='"unsigned int"'
5671 *) case "$longsize" in
5675 val='"unsigned long"'
5680 *) case "$d_longlong:$longlongsize" in
5685 val='"unsigned long long"'
5690 *) case "$d_int64_t" in
5709 '') echo "Alas, no 64-bit integer types in sight." >&4
5712 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5717 : Do we want 64bit support
5718 case "$uselonglong" in
5719 "$define"|true|[yY]*)
5722 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5724 use64bitint="$define"
5727 case "$use64bits" in
5728 "$define"|true|[yY]*)
5731 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5733 use64bitint="$define"
5736 case "$use64bitints" in
5737 "$define"|true|[yY]*)
5740 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5742 use64bitint="$define"
5745 case "$use64bitsint" in
5746 "$define"|true|[yY]*)
5749 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5751 use64bitint="$define"
5754 case "$uselonglongs" in
5755 "$define"|true|[yY]*)
5758 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5760 use64bitint="$define"
5763 case "$use64bitsall" in
5764 "$define"|true|[yY]*)
5767 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5769 use64bitall="$define"
5774 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5776 case "$use64bitall" in
5777 "$define"|true|[yY]*) use64bitint="$define" ;;
5783 You have natively 64-bit long integers.
5787 *) case "$use64bitint" in
5788 "$define"|true|[yY]*) dflt='y';;
5797 Perl can be built to take advantage of 64-bit integer types
5798 on some systems. To do so, Configure can be run with -Duse64bitint.
5799 Choosing this option will most probably introduce binary incompatibilities.
5801 If this doesn't make any sense to you, just accept the default '$dflt'.
5802 (The default has been chosen based on your configuration.)
5804 rp='Try to use 64-bit integers, if available?'
5807 [yY]*) val="$define" ;;
5815 case "$use64bitall" in
5816 "$define"|true|[yY]*) dflt='y' ;;
5817 *) case "$longsize" in
5825 You may also choose to try maximal 64-bitness. It means using as much
5826 64-bitness as possible on the platform. This in turn means even more
5827 binary incompatibilities. On the other hand, your platform may not
5828 have any more 64-bitness available than what you already have chosen.
5830 If this doesn't make any sense to you, just accept the default '$dflt'.
5831 (The default has been chosen based on your configuration.)
5833 rp='Try to use maximal 64-bit support, if available?'
5836 [yY]*) val="$define" ;;
5841 case "$use64bitall" in
5843 case "$use64bitint" in
5847 Since you have chosen a maximally 64-bit build, I'm also turning on
5848 the use of 64-bit integers.
5850 use64bitint="$define" ;;
5855 : Look for a hint-file generated 'call-back-unit'. If the
5856 : user has specified that a 64-bit perl is to be built,
5857 : we may need to set or change some other defaults.
5858 if $test -f use64bitint.cbu; then
5859 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5862 case "$use64bitint" in
5863 "$define"|true|[yY]*)
5865 4) case "$archname64" in
5866 '') archname64=64int ;;
5873 : Look for a hint-file generated 'call-back-unit'. If the
5874 : user has specified that a maximally 64-bit perl is to be built,
5875 : we may need to set or change some other defaults.
5876 if $test -f use64bitall.cbu; then
5877 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5880 case "$use64bitall" in
5881 "$define"|true|[yY]*)
5883 4) case "$archname64" in
5884 ''|64int) archname64=64all ;;
5891 case "$d_quad:$use64bitint" in
5895 *** You have chosen to use 64-bit integers,
5896 *** but none can be found.
5897 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5898 *** Cannot continue, aborting.
5905 : check for length of double
5907 case "$doublesize" in
5909 echo "Checking to see how big your double precision numbers are..." >&4
5918 printf("%d\n", (int)sizeof(double));
5923 if eval $compile_ok; then
5924 doublesize=`$run ./try`
5925 echo "Your double is $doublesize bytes long."
5928 echo "(I can't seem to compile the test program. Guessing...)"
5929 rp="What is the size of a double precision number (in bytes)?"
5937 : check for long doubles
5939 echo "Checking to see if you have long double..." >&4
5940 echo 'int main() { long double x = 7.0; }' > try.c
5942 if eval $compile; then
5944 echo "You have long double."
5947 echo "You do not have long double."
5953 : check for length of long double
5954 case "${d_longdbl}${longdblsize}" in
5957 echo "Checking to see how big your long doubles are..." >&4
5958 $cat >try.c <<'EOCP'
5962 printf("%d\n", sizeof(long double));
5967 if eval $compile; then
5968 longdblsize=`$run ./try`
5969 echo "Your long doubles are $longdblsize bytes long."
5973 echo "(I can't seem to compile the test program. Guessing...)" >&4
5974 rp="What is the size of a long double (in bytes)?"
5978 if $test "X$doublesize" = "X$longdblsize"; then
5979 echo "That isn't any different from an ordinary double."
5980 echo "I'll keep your setting anyway, but you may see some"
5981 echo "harmless compilation warnings."
5987 : determine the architecture name
5989 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5990 tarch=`arch`"-$osname"
5991 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5992 if uname -m > tmparch 2>&1 ; then
5993 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5994 -e 's/$/'"-$osname/" tmparch`
6002 case "$myarchname" in
6005 echo "(Your architecture name used to be $myarchname.)"
6009 case "$targetarch" in
6011 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6016 *) dflt="$archname";;
6018 rp='What is your architecture name'
6021 case "$usethreads" in
6023 echo "Threads selected." >&4
6025 *-thread*) echo "...and architecture name already has -thread." >&4
6027 *) archname="$archname-thread"
6028 echo "...setting architecture name to $archname." >&4
6033 case "$usemultiplicity" in
6035 echo "Multiplicity selected." >&4
6037 *-multi*) echo "...and architecture name already has -multi." >&4
6039 *) archname="$archname-multi"
6040 echo "...setting architecture name to $archname." >&4
6045 case "$use64bitint$use64bitall" in
6047 case "$archname64" in
6049 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6052 case "$use64bitint" in
6053 "$define") echo "64 bit integers selected." >&4 ;;
6055 case "$use64bitall" in
6056 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6059 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6061 *) archname="$archname-$archname64"
6062 echo "...setting architecture name to $archname." >&4
6068 case "$uselongdouble" in
6070 echo "Long doubles selected." >&4
6071 case "$longdblsize" in
6073 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6077 *-ld*) echo "...and architecture name already has -ld." >&4
6079 *) archname="$archname-ld"
6080 echo "...setting architecture name to $archname." >&4
6087 case "$useperlio" in
6089 echo "Perlio selected." >&4
6092 echo "Perlio not selected, using stdio." >&4
6094 *-stdio*) echo "...and architecture name already has -stdio." >&4
6096 *) archname="$archname-stdio"
6097 echo "...setting architecture name to $archname." >&4
6102 if $test -f archname.cbu; then
6103 echo "Your platform has some specific hints for architecture name, using them..."
6107 : set the prefixit variable, to compute a suitable default value
6108 prefixit='case "$3" in
6110 case "$oldprefix" in
6111 "") eval "$1=\"\$$2\"";;
6118 ""|" ") eval "$1=\"\$$2\"";;
6124 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6126 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6127 /*-$oldprefix/*|\~*-$oldprefix/*)
6128 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6129 *) eval "$1=\"\$$2\"";;
6133 : determine installation style
6134 : For now, try to deduce it from prefix unless it is already set.
6135 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6136 case "$installstyle" in
6137 '') case "$prefix" in
6138 *perl*) dflt='lib';;
6139 *) dflt='lib/perl5' ;;
6142 *) dflt="$installstyle" ;;
6144 : Probably not worth prompting for this since we prompt for all
6145 : the directories individually, and the prompt would be too long and
6149 : determine where public executables go
6154 rp='Pathname where the public executables will reside?'
6156 if $test "X$ansexp" != "X$binexp"; then
6160 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6161 : XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6162 : this via initialinstalllocation
6165 case "$userelocatableinc" in
6166 $define|true|[yY]*) dflt='y' ;;
6171 Would you like to build Perl so that the installation is relocatable, so that
6172 library paths in @INC are determined relative to the path of the perl binary?
6173 This is not advised for system Perl installs, or if you need to run setid
6174 scripts or scripts under taint mode.
6176 If this doesn't make any sense to you, just accept the default '$dflt'.
6178 rp='Use relocatable @INC?'
6181 y|Y) val="$define" ;;
6184 set userelocatableinc
6187 initialinstalllocation="$binexp"
6188 : Default prefix is now "up one level from where the binaries are"
6189 case "$userelocatableinc" in
6195 installprefixexp=".../.."
6199 : determine where private library files go
6200 : Usual default is /usr/local/lib/perl5/$version.
6201 : Also allow things like /opt/perl/lib/$version, since
6202 : /opt/perl/lib/perl5... would be redundant.
6203 : The default "style" setting is made in installstyle.U
6204 case "$installstyle" in
6205 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6206 *) set dflt privlib lib/$version ;;
6211 There are some auxiliary files for $package that need to be put into a
6212 private library directory that is accessible by everyone.
6217 rp='Pathname where the private library files will reside?'
6222 : set the prefixup variable, to restore leading tilda escape
6223 prefixup='case "$prefixexp" in
6225 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6228 : determine where public architecture dependent libraries go
6231 : privlib default is /usr/local/lib/$package/$version
6232 : archlib default is /usr/local/lib/$package/$version/$archname
6233 : privlib may have an optional trailing /share.
6234 tdflt=`echo $privlib | $sed 's,/share$,,'`
6235 tdflt=$tdflt/$archname
6244 $spackage contains architecture-dependent library files. If you are
6245 sharing libraries in a heterogeneous environment, you might store
6246 these files in a separate location. Otherwise, you can just include
6247 them with the rest of the public library files.
6252 rp='Where do you want to put the public architecture-dependent libraries?'
6256 if $test X"$archlib" = X"$privlib"; then
6262 : see if setuid scripts can be secure
6265 Some kernels have a bug that prevents setuid #! scripts from being
6266 secure. Some sites have disabled setuid #! scripts because of this.
6268 First let's decide if your kernel supports secure setuid #! scripts.
6269 (If setuid #! scripts would be secure but have been disabled anyway,
6270 don't say that they are secure if asked.)
6275 if $test -d /dev/fd; then
6276 echo "#!$ls" >reflect
6277 chmod +x,u+s reflect
6278 ./reflect >flect 2>&1
6279 if $contains "/dev/fd" flect >/dev/null; then
6280 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6284 If you are not sure if they are secure, I can check but I'll need a
6285 username and password different from the one you are using right now.
6286 If you don't have such a username or don't want me to test, simply
6290 rp='Other username to test security of setuid scripts with?'
6295 case "$d_suidsafe" in
6296 '') echo "I'll assume setuid scripts are *not* secure." >&4
6299 echo "Well, the $hint value is *not* secure." >&4
6301 *) echo "Well, the $hint value *is* secure." >&4
6306 $rm -f reflect flect
6307 echo "#!$ls" >reflect
6308 chmod +x,u+s reflect
6311 echo '"su" will (probably) prompt you for '"$ans's password."
6312 su $ans -c './reflect >flect'
6313 if $contains "/dev/fd" flect >/dev/null; then
6314 echo "Okay, it looks like setuid scripts are secure." >&4
6317 echo "I don't think setuid scripts are secure." >&4
6322 rp='Does your kernel have *secure* setuid scripts?'
6325 [yY]*) val="$define";;
6330 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6331 echo "(That's for file descriptors, not floppy disks.)"
6337 $rm -f reflect flect
6339 : now see if they want to do setuid emulation
6342 case "$d_suidsafe" in
6345 echo "No need to emulate SUID scripts since they are secure here." >&4
6349 Some systems have disabled setuid scripts, especially systems where
6350 setuid scripts cannot be secure. On systems where setuid scripts have
6351 been disabled, the setuid/setgid bits on scripts are currently
6352 useless. It is possible for $package to detect those bits and emulate
6353 setuid/setgid in a secure fashion. This emulation will only work if
6354 setuid scripts have been disabled in your kernel.
6358 "$define") dflt=y ;;
6361 rp="Do you want to do setuid/setgid emulation?"
6364 [yY]*) val="$define";;
6372 : Find perl5.005 or later.
6373 echo "Looking for a previously installed perl5.005 or later... "
6375 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6376 : Check if this perl is recent and can load a simple module
6377 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6380 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6390 '') echo "None found. That's ok.";;
6391 *) echo "Using $perl5." ;;
6394 : Set the siteprefix variables
6397 After $package is installed, you may wish to install various
6398 add-on modules and utilities. Typically, these add-ons will
6399 be installed under $prefix with the rest
6400 of this package. However, you may wish to install such add-ons
6401 elsewhere under a different prefix.
6403 If you do not wish to put everything under a single prefix, that's
6404 ok. You will be prompted for the individual locations; this siteprefix
6405 is only used to suggest the defaults.
6407 The default should be fine for most people.
6411 rp='Installation prefix to use for add-on modules and utilities?'
6412 : XXX Here might be another good place for an installstyle setting.
6413 case "$siteprefix" in
6415 *) dflt=$siteprefix ;;
6418 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6420 case "$siteprefix" in
6424 *) oldsiteprefix="$prefix";;
6429 siteprefixexp="$ansexp"
6431 : determine where site specific libraries go.
6432 : Usual default is /usr/local/lib/perl5/site_perl/$version
6433 : The default "style" setting is made in installstyle.U
6434 : XXX No longer works with Prefixit stuff.
6435 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6437 '') case "$installstyle" in
6438 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6439 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6447 The installation process will create a directory for
6448 site-specific extensions and modules. Most users find it convenient
6449 to place all site-specific files in this directory rather than in the
6450 main distribution directory.
6454 rp='Pathname for the site-specific library files?'
6458 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6460 : Determine list of previous versions to include in @INC
6461 $cat > getverlist <<EOPL
6464 \$api_versionstring = "$api_versionstring";
6465 \$version = "$version";
6466 \$stem = "$sitelib_stem";
6467 \$archname = "$archname";
6469 $cat >> getverlist <<'EOPL'
6470 # The list found is store twice for each entry: the original name, and
6471 # the binary broken down version as pack "sss", so sorting is easy and
6472 # unambiguous. This will work for all versions that have a maximum of
6473 # three digit groups, separate by '.'s or '_'s. Names are extended with
6474 # ".0.0" to ensure at least three elements for the pack.
6475 # -- H.Merijn Brand (m)'06 23-10-2006
6477 # Can't have leading @ because metaconfig interprets it as a command!
6478 ;@inc_version_list=();
6479 # XXX Redo to do opendir/readdir?
6482 ;@candidates = map {
6483 [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
6489 ($pversion, $aversion, $vsn5005) = map {
6490 pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
6491 foreach $d (@candidates) {
6492 if ($d->[1] lt $pversion) {
6493 if ($d->[1] ge $aversion) {
6494 unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
6496 elsif ($d->[1] ge $vsn5005) {
6497 unshift(@inc_version_list, grep { -d } $d->[0]);
6501 # Skip newer version. I.e. don't look in
6502 # 5.7.0 if we're installing 5.6.1.
6506 if (@inc_version_list) {
6507 print join(' ', @inc_version_list);
6510 # Blank space to preserve value for next Configure run.
6515 case "$inc_version_list" in
6516 '') if test -x "$perl5$exe_ext"; then
6517 dflt=`$perl5 getverlist`
6522 $undef) dflt='none' ;;
6523 *) eval dflt=\"$inc_version_list\" ;;
6526 ''|' ') dflt=none ;;
6533 In order to ease the process of upgrading, this version of perl
6534 can be configured to use modules built and installed with earlier
6535 versions of perl that were installed under $prefix. Specify here
6536 the list of earlier versions that this version of perl should check.
6537 If Configure detected no earlier versions of perl installed under
6538 $prefix, then the list will be empty. Answer 'none' to tell perl
6539 to not search earlier versions.
6541 The default should almost always be sensible, so if you're not sure,
6542 just accept the default.
6545 rp='List of earlier versions to include in @INC?'
6548 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6549 *) inc_version_list="$ans" ;;
6551 case "$inc_version_list" in
6553 inc_version_list_init='0'
6554 d_inc_version_list="$undef"
6556 *) inc_version_list_init=`echo $inc_version_list |
6557 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6558 d_inc_version_list="$define"
6563 : see if malloc/malloc.h has to be included
6564 set malloc/malloc.h i_mallocmalloc
6567 : see if this is a malloc.h system
6568 : we want a real compile instead of Inhdr because some systems have a
6569 : malloc.h that just gives a compile error saying to use stdlib.h instead
6574 #$i_mallocmalloc I_MALLOCMALLOC
6575 #ifdef I_MALLOCMALLOC
6576 # include <malloc/malloc.h>
6579 int main () { return 0; }
6582 if eval $compile; then
6583 echo "<malloc.h> found." >&4
6586 echo "<malloc.h> NOT found." >&4
6593 : check for void type
6595 echo "Checking to see how well your C compiler groks the void type..." >&4
6596 case "$voidflags" in
6608 extern void moo(); /* function returning void */
6609 void (*goo)(); /* ptr to func returning void */
6611 void *hue; /* generic ptr */
6624 int main() { sub(); }
6626 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6627 voidflags=$defvoidused
6628 echo "Good. It appears to support void to the level $package wants.">&4
6629 if $contains warning .out >/dev/null 2>&1; then
6630 echo "However, you might get some warnings that look like this:"
6634 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6635 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6636 echo "It supports 1..."
6637 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6638 echo "It also supports 2..."
6639 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6641 echo "And it supports 4 but not 8 definitely."
6643 echo "It doesn't support 4..."
6644 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6646 echo "But it supports 8."
6649 echo "Neither does it support 8."
6653 echo "It does not support 2..."
6654 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6656 echo "But it supports 4 and 8."
6658 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6660 echo "And it supports 4 but has not heard about 8."
6662 echo "However it supports 8 but not 4."
6667 echo "There is no support at all for void."
6672 case "$voidflags" in
6675 Support flag bits are:
6676 1: basic void declarations.
6677 2: arrays of pointers to functions returning void.
6678 4: operations between pointers to and addresses of void functions.
6679 8: generic void pointers.
6682 rp="Your void support flags add up to what?"
6689 : check for length of pointer
6693 echo "Checking to see how big your pointers are..." >&4
6694 if test "$voidflags" -gt 7; then
6695 echo '#define VOID_PTR char *' > try.c
6697 echo '#define VOID_PTR void *' > try.c
6707 printf("%d\n", (int)sizeof(VOID_PTR));
6712 if eval $compile_ok; then
6713 ptrsize=`$run ./try`
6714 echo "Your pointers are $ptrsize bytes long."
6717 echo "(I can't seem to compile the test program. Guessing...)" >&4
6718 rp="What is the size of a pointer (in bytes)?"
6725 case "$use64bitall" in
6726 "$define"|true|[yY]*)
6730 *** You have chosen a maximally 64-bit build,
6731 *** but your pointers are only 4 bytes wide.
6732 *** Please rerun Configure without -Duse64bitall.
6737 *** Since you have quads, you could possibly try with -Duse64bitint.
6742 *** Cannot continue, aborting.
6753 : determine whether to use malloc wrapping
6755 case "$usemallocwrap" in
6756 [yY]*|true|$define) dflt='y' ;;
6757 [nN]*|false|$undef) dflt='n' ;;
6758 *) case "$usedevel" in
6759 [yY]*|true|$define) dflt='y' ;;
6764 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6766 usemallocwrap="$ans"
6769 usemallocwrap="$define" ;;
6771 usemallocwrap="$undef" ;;
6774 : determine which malloc to compile in
6776 case "$usemymalloc" in
6777 [yY]*|true|$define) dflt='y' ;;
6778 [nN]*|false|$undef) dflt='n' ;;
6779 *) case "$ptrsize" in
6785 rp="Do you wish to attempt to use the malloc that comes with $package?"
6791 mallocsrc='malloc.c'
6792 mallocobj="malloc$_o"
6793 d_mymalloc="$define"
6796 : Remove malloc from list of libraries to use
6797 echo "Removing unneeded -lmalloc from library list" >&4
6798 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6801 echo "libs = $libs" >&4
6813 : compute the return types of malloc and free
6815 $cat >malloc.c <<END
6819 #include <sys/types.h>
6833 case "$malloctype" in
6835 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6842 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6846 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6853 echo "Your system uses $freetype free(), it would seem." >&4
6855 : determine where site specific architecture-dependent libraries go.
6856 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6857 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6858 : sitelib may have an optional trailing /share.
6860 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6861 dflt="$dflt/$archname"
6866 set sitearch sitearch none
6870 The installation process will also create a directory for
6871 architecture-dependent site-specific extensions and modules.
6875 rp='Pathname for the site-specific architecture-dependent library files?'
6879 if $test X"$sitearch" = X"$sitelib"; then
6882 d_sitearch="$define"
6885 : Set the vendorprefix variables
6888 The installation process will also create a directory for
6889 vendor-supplied add-ons. Vendors who supply perl with their system
6890 may find it convenient to place all vendor-supplied files in this
6891 directory rather than in the main distribution directory. This will
6892 ease upgrades between binary-compatible maintenance versions of perl.
6894 Of course you may also use these directories in whatever way you see
6895 fit. For example, you might use them to access modules shared over a
6896 company-wide network.
6898 The default answer should be fine for most people.
6899 This causes further questions about vendor add-ons to be skipped
6900 and no vendor-specific directories will be configured for perl.
6903 rp='Do you want to configure vendor-specific add-on directories?'
6904 case "$usevendorprefix" in
6905 define|true|[yY]*) dflt=y ;;
6906 *) : User may have set vendorprefix directly on Configure command line.
6907 case "$vendorprefix" in
6916 rp='Installation prefix to use for vendor-supplied add-ons?'
6917 case "$vendorprefix" in
6919 *) dflt=$vendorprefix ;;
6922 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6924 case "$vendorprefix" in
6928 *) oldvendorprefix="$prefix";;
6932 usevendorprefix="$define"
6934 vendorprefixexp="$ansexp"
6936 *) usevendorprefix="$undef"
6942 : Set the vendorlib variables
6943 case "$vendorprefix" in
6944 '') d_vendorlib="$undef"
6948 *) d_vendorlib="$define"
6949 : determine where vendor-supplied modules go.
6950 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6951 case "$vendorlib" in
6953 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6954 case "$installstyle" in
6955 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6956 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6959 *) dflt="$vendorlib"
6963 rp='Pathname for the vendor-supplied library files?'
6966 vendorlibexp="$ansexp"
6969 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6973 : Set the vendorarch variables
6974 case "$vendorprefix" in
6975 '') d_vendorarch="$undef"
6979 *) d_vendorarch="$define"
6980 : determine where vendor-supplied architecture-dependent libraries go.
6981 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6982 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6983 : vendorlib may have an optional trailing /share.
6984 case "$vendorarch" in
6985 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6986 dflt="$dflt/$archname"
6988 *) dflt="$vendorarch" ;;
6991 rp='Pathname for vendor-supplied architecture-dependent files?'
6994 vendorarchexp="$ansexp"
6997 prefixvar=vendorarch
7000 : Final catch-all directories to search
7003 Lastly, you can have perl look in other directories for extensions and
7004 modules in addition to those already specified.
7005 These directories will be searched after
7009 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7010 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7012 case "$otherlibdirs" in
7013 ''|' ') dflt='none' ;;
7014 *) dflt="$otherlibdirs" ;;
7017 Enter a colon-separated set of extra paths to include in perl's @INC
7018 search path, or enter 'none' for no extra paths.
7022 rp='Colon-separated list of additional directories for perl to search?'
7025 ' '|''|none) otherlibdirs=' ' ;;
7026 *) otherlibdirs="$ans" ;;
7028 case "$otherlibdirs" in
7032 set d_perl_otherlibdirs
7035 : Cruising for prototypes
7037 echo "Checking out function prototypes..." >&4
7038 $cat >prototype.c <<EOCP
7043 int main(int argc, char *argv[]) {
7046 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7047 echo "Your C compiler appears to support function prototypes."
7050 echo "Your C compiler doesn't seem to understand function prototypes."
7057 : Check if ansi2knr is required
7058 case "$prototype" in
7060 *) ansi2knr='ansi2knr'
7065 This version of $package can only be compiled by a compiler that
7066 understands function prototypes. Unfortunately, your C compiler
7068 doesn't seem to understand them. Sorry about that.
7070 If GNU cc is available for your system, perhaps you could try that instead.
7072 Eventually, we hope to support building Perl with pre-ANSI compilers.
7073 If you would like to help in that effort, please contact <perlbug@perl.org>.
7075 Aborting Configure now.
7082 dflt_dtrace='/usr/sbin/dtrace'
7085 Perl can be built to support DTrace on platforms that support it.
7086 DTrace is a diagnosis and performance analysis tool from Sun.
7088 If this doesn't make any sense to you, just accept the default '$dflt'.
7092 case "$usedtrace" in
7098 dflt_dtrace=$usedtrace
7105 rp='Support DTrace if available?'
7108 y|Y) val="$define" ;;
7114 test "X$usedtrace" != "X$define" && break
7117 rp='Where is the dtrace executable?'
7126 if $dtrace -h -s ../perldtrace.d \
7127 -o perldtrace.tmp >/dev/null 2>&1 \
7128 && rm -f perldtrace.tmp
7131 echo "Good: your $dtrace knows about the -h flag."
7135 *** $me: Fatal Error: $dtrace doesn't support -h flag
7137 *** Your installed dtrace doesn't support the -h switch to compile a D
7138 *** program into a C header. Can't continue.
7150 *** $me: Fatal Error: $dtrace not found.
7157 echo "*** $dtrace was not found."
7163 : See if we want extra modules installed
7170 Perl can be built with extra modules or bundles of modules which
7171 will be fetched from the CPAN and installed alongside Perl.
7173 Notice that you will need access to the CPAN; either via the Internet,
7174 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7175 be asked later to configure the CPAN.pm module which will in turn do
7176 the installation of the rest of the extra modules or bundles.)
7178 Notice also that if the modules require any external software such as
7179 libraries and headers (the libz library and the zlib.h header for the
7180 Compress::Zlib module, for example) you MUST have any such software
7181 already installed, this configuration process will NOT install such
7184 If this doesn't make any sense to you, just accept the default '$dflt'.
7186 rp='Install any extra modules (y or n)?'
7192 Please list any extra modules or bundles to be installed from CPAN,
7193 with spaces between the names. The names can be in any format the
7194 'install' command of CPAN.pm will understand. (Answer 'none',
7195 without the quotes, to install no extra modules or bundles.)
7205 $rm -f ../extras.lst
7207 *) echo "(Saving the list of extras for later...)"
7208 echo "$extras" > ../extras.lst
7216 : determine where html pages for programs go
7217 set html1dir html1dir none
7221 If you wish to install html files for programs in $spackage, indicate
7222 the appropriate directory here. To skip installing html files,
7226 ''|none|$undef|' ') dflt=none ;;
7227 *) dflt=$html1dir ;;
7230 rp="Directory for the main $spackage html pages?"
7234 : Use ' ' for none so value is preserved next time through Configure
7235 $test X"$html1dir" = "X" && html1dir=' '
7237 : determine where html pages for libraries and modules go
7238 set html3dir html3dir none
7242 If you wish to install html files for modules associated with $spackage,
7243 indicate the appropriate directory here. To skip installing html files,
7246 : There is no obvious default. If they have specified html1dir, then
7247 : try to key off that, possibly changing .../html1 into .../html3.
7249 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7250 *) dflt=$html3dir ;;
7253 rp="Directory for the $spackage module html pages?"
7257 : Use ' ' for none so value is preserved next time through Configure
7258 $test X"$html3dir" = "X" && html3dir=' '
7260 : determine whether to install perl also as /usr/bin/perl
7263 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7265 Many scripts expect perl to be installed as /usr/bin/perl.
7267 If you want to, I can install the perl you are about to compile
7268 as /usr/bin/perl (in addition to $bin/perl).
7270 if test -f /usr/bin/perl; then
7273 However, please note that because you already have a /usr/bin/perl,
7274 overwriting that with a new Perl would very probably cause problems.
7275 Therefore I'm assuming you don't want to do that (unless you insist).
7278 case "$installusrbinperl" in
7279 "$define"|[yY]*) dflt='y';;
7285 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7288 case "$installusrbinperl" in
7289 "$undef"|[nN]*) dflt='n';;
7293 rp="Do you want to install perl as /usr/bin/perl?"
7296 [yY]*) val="$define";;
7302 set installusrbinperl
7305 : Check if we are using the GNU C library
7307 echo "Checking for GNU C Library..." >&4
7309 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7310 alone are insufficient to distinguish different versions, such as
7311 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7312 libc version 2.1.0. A. Dougherty, June 3, 2002.
7318 # ifdef __GLIBC_MINOR__
7319 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7320 # include <gnu/libc-version.h>
7321 printf("%s\n", gnu_get_libc_version());
7323 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7326 printf("%d\n", __GLIBC__);
7335 if eval $compile_ok && $run ./try > glibc.ver; then
7337 gnulibc_version=`$cat glibc.ver`
7338 echo "You are using the GNU C Library version $gnulibc_version"
7342 echo "You are not using the GNU C Library"
7348 : see if nm is to be used to determine whether a symbol is defined or not
7352 case "$d_gnulibc" in
7355 echo "nm probably won't work on the GNU C Library." >&4
7361 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7363 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7364 echo "'nm' won't be sufficient on this sytem." >&4
7370 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7371 if $test $dflt -gt 20; then
7381 true|$define) dflt=y;;
7388 I can use $nm to extract the symbols from your C libraries. This
7389 is a time consuming task which may generate huge output on the disk (up
7390 to 3 megabytes) but that should make the symbols extraction faster. The
7391 alternative is to skip the 'nm' extraction part and to compile a small
7392 test program instead to determine whether each symbol is present. If
7393 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7394 this may be the best solution.
7396 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7399 rp="Shall I use $nm to extract C symbols from the libraries?"
7402 [Nn]*) usenm=false;;
7411 : nm options which may be necessary
7413 '') if $test -f /mach_boot; then
7415 elif $test -d /usr/ccs/lib; then
7416 nm_opt='-p' # Solaris (and SunOS?)
7417 elif $test -f /dgux; then
7419 elif $test -f /lib64/rld; then
7420 nm_opt='-p' # 64-bit Irix
7426 : nm options which may be necessary for shared libraries but illegal
7427 : for archive libraries. Thank you, Linux.
7428 case "$nm_so_opt" in
7429 '') case "$myuname" in
7431 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7432 nm_so_opt='--dynamic'
7439 : get list of predefined functions in a handy place
7446 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7452 *) for thislib in $libs; do
7455 : Handle C library specially below.
7458 thislib=`echo $thislib | $sed -e 's/^-l//'`
7459 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7461 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7463 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7465 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7467 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7469 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7471 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7476 libnames="$libnames $try"
7478 *) libnames="$libnames $thislib" ;;
7487 for xxx in $libpth; do
7488 $test -r $1 || set $xxx/libc.$so
7489 : The messy sed command sorts on library version numbers.
7491 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7492 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7494 s/[0-9][0-9]*/0000&/g
7495 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7498 $sort | $sed -e 's/^.* //'`
7501 $test -r $1 || set /usr/ccs/lib/libc.$so
7502 $test -r $1 || set /lib/libsys_s$_a
7508 if $test -r "$1"; then
7509 echo "Your (shared) C library seems to be in $1."
7511 elif $test -r /lib/libc && $test -r /lib/clib; then
7512 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7514 libc='/lib/clib /lib/libc'
7515 if $test -r /lib/syslib; then
7516 echo "(Your math library is in /lib/syslib.)"
7517 libc="$libc /lib/syslib"
7519 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7520 echo "Your C library seems to be in $libc, as you said before."
7521 elif $test -r $incpath/usr/lib/libc$_a; then
7522 libc=$incpath/usr/lib/libc$_a;
7523 echo "Your C library seems to be in $libc. That's fine."
7524 elif $test -r /lib/libc$_a; then
7526 echo "Your C library seems to be in $libc. You're normal."
7528 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7530 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7531 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7532 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7534 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7536 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7539 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7541 if $test -r "$tans"; then
7542 echo "Your C library seems to be in $tans, of all places."
7548 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7552 If the guess above is wrong (which it might be if you're using a strange
7553 compiler, or your machine supports multiple models), you can override it here.
7558 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7560 I can't seem to find your C library. I've looked in the following places:
7563 $sed 's/^/ /' libpath
7566 None of these seems to contain your C library. I need to get its name...
7571 rp='Where is your C library?'
7576 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7577 set X `cat libnames`
7580 case $# in 1) xxx=file; esac
7581 echo "Extracting names from the following $xxx for later perusal:" >&4
7583 $sed 's/^/ /' libnames >&4
7585 $echo $n "This may take a while...$c" >&4
7589 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7590 *) $nm $nm_opt $file 2>/dev/null;;
7595 $grep fprintf libc.tmp > libc.ptf
7596 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7597 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7599 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7601 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7603 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7605 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7607 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7611 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7615 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7619 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7621 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7623 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7624 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7626 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7628 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7630 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7632 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7634 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7636 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7638 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7640 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7642 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7644 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7646 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7648 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7650 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7652 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7654 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7657 $nm -p $* 2>/dev/null >libc.tmp
7658 $grep fprintf libc.tmp > libc.ptf
7659 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7660 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7666 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7668 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7669 for thisname in $libnames $libc; do
7670 $ar t $thisname >>libc.tmp
7672 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7674 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7675 # Repeat libc to extract forwarders to DLL entries too
7676 for thisname in $libnames $libc; do
7677 $ar tv $thisname >>libc.tmp
7678 # Revision 50 of EMX has bug in $ar.
7679 # it will not extract forwarders to DLL entries
7680 # Use emximp which will extract exactly them.
7681 emximp -o tmp.imp $thisname \
7683 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7684 < tmp.imp >>libc.tmp
7687 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7690 echo "$ar didn't seem to work right." >&4
7691 echo "Maybe this is a Cray...trying bld instead..." >&4
7692 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7694 for thisname in $libnames; do
7696 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7697 $ar t $thisname >>libc.tmp
7701 echo "That didn't work either. Giving up." >&4
7711 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7712 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7714 *) if $test -f /lib/syscalls.exp; then
7716 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7717 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7723 $rm -f libnames libpath
7725 : see if dld is available
7729 : Check if we are using C++
7731 echo "Checking for C++..." >&4
7732 $cat >try.c <<'EOCP'
7744 if eval $compile_ok && $run ./try; then
7746 echo "You are using a C++ compiler."
7749 echo "You are not using a C++ compiler."
7755 : is a C symbol defined?
7758 -v) tf=libc.tmp; tdc="";;
7759 -a) tf=libc.tmp; tdc="[]";;
7760 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7763 case "$reuseval-$4" in
7765 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7770 case "$d_cplusplus" in
7771 $define) extern_C=\"C\";;
7773 if $test "$runnm" = true; then
7774 if $contains $tlook $tf >/dev/null 2>&1; then
7776 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7777 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7778 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7779 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7783 echo "extern $extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7784 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7790 $define) tval=true;;
7797 : define an is-in-libc? function
7798 inlibc='echo " "; td=$define; tu=$undef;
7799 sym=$1; var=$2; eval "was=\$$2";
7801 case "$reuseval$was" in
7811 echo "$sym() found." >&4;
7812 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7814 echo "$sym() NOT found." >&4;
7815 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7819 $define) echo "$sym() found." >&4;;
7820 *) echo "$sym() NOT found." >&4;;
7824 : see if dlopen exists
7826 xxx_ccflags="$ccflags"
7828 : with g++ one needs -shared to get is-in-libc to work for dlopen
7829 case "$gccversion" in
7831 *) case "$d_cplusplus" in
7832 "$define") ccflags="$ccflags -shared" ;;
7839 ccflags="$xxx_ccflags"
7841 : see if this is a unistd.h system
7842 set unistd.h i_unistd
7845 : determine which dynamic loading, if any, to compile in
7847 dldir="ext/DynaLoader"
7860 $define) dflt='y' ;;
7863 $define) dflt='y' ;;
7865 : Does a dl_xxx.xs file exist for this operating system
7866 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7869 rp="Do you wish to use dynamic loading?"
7876 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7877 dflt="$dldir/dl_${osname}.xs"
7878 elif $test "$d_dlopen" = "$define" ; then
7879 dflt="$dldir/dl_dlopen.xs"
7880 elif $test "$i_dld" = "$define" ; then
7881 dflt="$dldir/dl_dld.xs"
7886 *) dflt="$dldir/$dlsrc"
7889 echo "The following dynamic loading files are available:"
7890 : Can not go over to $dldir because getfile has path hard-coded in.
7891 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7892 rp="Source file to use for dynamic loading"
7898 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7902 Some systems may require passing special flags to $cc -c to
7903 compile modules that will be used to create a shared library.
7904 To use no flags, say "none".
7907 case "$cccdlflags" in
7908 '') case "$gccversion" in
7909 '') case "$osname" in
7911 next) dflt='none' ;;
7912 irix*) dflt='-KPIC' ;;
7913 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7914 sunos) dflt='-pic' ;;
7918 *) case "$osname" in
7919 darwin) dflt='none' ;;
7920 linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7925 *) dflt="$cccdlflags" ;;
7927 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7930 none) cccdlflags=' ' ;;
7931 *) cccdlflags="$ans" ;;
7936 Some systems use ld to create libraries that can be dynamically loaded,
7937 while other systems (such as those using ELF) use $cc.
7941 '') $cat >try.c <<EOM
7942 /* Test for whether ELF binaries are produced */
7954 int i = open("a.out",O_RDONLY);
7957 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7958 exit(0); /* succeed (yes, it's ELF) */
7963 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7965 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7969 echo "I'll use ld to build dynamic libraries."
7978 rp="What command should be used to create dynamic libraries?"
7984 Some systems may require passing special flags to $ld to create a
7985 library that can be dynamically loaded. If your ld flags include
7986 -L/other/path options to locate libraries outside your loader's normal
7987 search path, you may need to specify those -L options here as well. To
7988 use no flags, say "none".
7991 case "$lddlflags" in
7992 '') case "$osname" in
7993 beos) dflt='-nostart' ;;
7995 case "$gccversion" in
7996 '') dflt="$dflt +vnocompatwarnings" ;;
7999 linux|irix*|gnu*) dflt="-shared $optimize" ;;
8000 next) dflt='none' ;;
8001 solaris) dflt='-G' ;;
8002 sunos) dflt='-assert nodefinitions' ;;
8003 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
8007 *) dflt="$lddlflags" ;;
8010 : Try to guess additional flags to pick up local libraries.
8011 : Be careful not to append to a plain 'none'
8015 for thisflag in $ldflags; do
8020 *) dflt="$dflt $thisflag" ;;
8027 ''|' ') dflt='none' ;;
8031 *-fstack-protector*)
8033 *-fstack-protector*) ;; # Don't add it again
8034 *) dflt="$dflt -fstack-protector" ;;
8040 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
8043 none) lddlflags=' ' ;;
8044 *) lddlflags="$ans" ;;
8049 Some systems may require passing special flags to $cc to indicate that
8050 the resulting executable will use dynamic linking. To use no flags,
8054 case "$ccdlflags" in
8055 '') case "$osname" in
8056 linux|hpux|gnu*) dflt='-Wl,-E' ;;
8057 next|sunos) dflt='none' ;;
8061 *) dflt="$ccdlflags" ;;
8063 rp="Any special flags to pass to $cc to use dynamic linking?"
8066 none) ccdlflags=' ' ;;
8067 *) ccdlflags="$ans" ;;
8078 : Do we want a shared libperl?
8082 # No dynamic loading being used, so don't bother even to prompt.
8085 *) case "$useshrplib" in
8086 '') case "$osname" in
8087 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
8089 also='Building a shared libperl is required for dynamic loading to work on your system.'
8094 also='Building a shared libperl is needed for MAB support.'
8112 The perl executable is normally obtained by linking perlmain.c with
8113 libperl${_a}, any static extensions (usually just DynaLoader), and
8114 any other libraries needed on this system (such as -lm, etc.). Since
8115 your system supports dynamic loading, it is probably possible to build
8116 a shared libperl.$so. If you will have more than one executable linked
8117 to libperl.$so, this will significantly reduce the size of each
8118 executable, but it may have a noticeable effect on performance. The
8119 default is probably sensible for your system.
8123 rp="Build a shared libperl.$so (y/n)"
8127 useshrplib='true' ;;
8128 *) useshrplib='false' ;;
8133 case "$useshrplib" in
8137 # Figure out a good name for libperl.so. Since it gets stored in
8138 # a version-specific architecture-dependent library, the version
8139 # number isn't really that important, except for making cc/ld happy.
8141 # A name such as libperl.so.3.1
8142 majmin="libperl.$so.$patchlevel.$subversion"
8143 # A name such as libperl.so.301
8144 majonly=`echo $patchlevel $subversion |
8145 $awk '{printf "%d%02d", $1, $2}'`
8146 majonly=libperl.$so.$majonly
8147 # I'd prefer to keep the os-specific stuff here to a minimum, and
8148 # rely on figuring it out from the naming of libc.
8149 case "${osname}${osvers}" in
8152 # XXX How handle the --version stuff for MAB?
8154 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
8157 cygwin*) # ld links against an importlib
8158 dflt=libperl$lib_ext
8160 *) # Try to guess based on whether libc has major.minor.
8162 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
8163 *libc.$so.[0-9]*) dflt=$majonly ;;
8164 *) dflt=libperl.$so ;;
8174 I need to select a good name for the shared libperl. If your system uses
8175 library names with major and minor numbers, then you might want something
8176 like $majmin. Alternatively, if your system uses a single version
8177 number for shared libraries, then you might want to use $majonly.
8178 Or, your system might be quite happy with a simple libperl.$so.
8180 Since the shared libperl will get installed into a version-specific
8181 architecture-dependent directory, the version number of the shared perl
8182 library probably isn't important, so the default should be o.k.
8185 rp='What name do you want to give to the shared libperl?'
8188 echo "Ok, I'll use $libperl"
8191 libperl="libperl${_a}"
8195 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
8199 WARNING: Use of the shrpdir variable for the installation location of
8200 the shared $libperl is not supported. It was never documented and
8201 will not work in this version. Let me (perlbug@perl.org)
8202 know of any problems this may cause.
8208 But your current setting of $shrpdir is
8209 the default anyway, so it's harmless.
8214 Further, your current attempted setting of $shrpdir
8215 conflicts with the value of $archlibexp/CORE
8216 that installperl will use.
8223 # How will the perl executable find the installed shared $libperl?
8224 # Add $xxx to ccdlflags.
8225 # If we can't figure out a command-line option, use $shrpenv to
8226 # set env LD_RUN_PATH. The main perl makefile uses this.
8227 shrpdir=$archlibexp/CORE
8230 if "$useshrplib"; then
8233 # We'll set it in Makefile.SH...
8238 freebsd|netbsd|openbsd|interix|dragonfly)
8239 xxx="-Wl,-R$shrpdir"
8241 bsdos|linux|irix*|dec_osf|gnu*)
8242 xxx="-Wl,-rpath,$shrpdir"
8245 # next doesn't like the default...
8248 # beos doesn't like the default, either.
8251 # hpux doesn't like the default, either.
8252 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8255 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8261 # Only add $xxx if it isn't already in ccdlflags.
8262 case " $ccdlflags " in
8264 *) ccdlflags="$ccdlflags $xxx"
8267 Adding $xxx to the flags
8268 passed to $ld so that the perl executable will find the
8269 installed shared $libperl.
8277 # Fix ccdlflags in AIX for building external extensions.
8278 # (For building Perl itself bare -bE:perl.exp is needed,
8279 # Makefile.SH takes care of this.)
8281 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8283 # Respect a hint or command-line value.
8285 '') shrpenv="$tmp_shrpenv" ;;
8287 case "$ldlibpthname" in
8288 '') ldlibpthname=LD_LIBRARY_PATH ;;
8289 none) ldlibpthname='' ;;
8292 : determine where manual pages are on this system
8296 syspath='/usr/share/man/man1 /usr/man/man1'
8297 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8298 syspath="$syspath /usr/man/u_man/man1"
8299 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8300 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8301 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8302 sysman=`./loc . /usr/man/man1 $syspath`
8305 if $test -d "$sysman"; then
8306 echo "System manual is in $sysman." >&4
8308 echo "Could not find manual pages in source form." >&4
8311 : determine where manual pages go
8312 set man1dir man1dir none
8316 $spackage has manual pages available in source form.
8320 echo "However, you don't have nroff, so they're probably useless to you."
8322 '') man1dir="none";;
8325 echo "If you don't want the manual sources installed, answer 'none'."
8330 lookpath="$prefixexp/share/man/man1"
8331 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8332 lookpath="$lookpath $prefixexp/man/p_man/man1"
8333 lookpath="$lookpath $prefixexp/man/u_man/man1"
8334 lookpath="$lookpath $prefixexp/man/man.1"
8336 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8337 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8347 rp="Where do the main $spackage manual pages (source) go?"
8349 if $test "X$man1direxp" != "X$ansexp"; then
8360 : What suffix to use on installed man pages
8367 rp="What suffix should be used for the main $spackage man pages?"
8369 '') case "$man1dir" in
8383 *) dflt="$man1ext";;
8390 : see if we can have long filenames
8392 first=123456789abcdef
8394 if (echo hi >$first) 2>/dev/null; then
8395 if $test -f 123456789abcde; then
8396 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8399 echo 'You can have filenames longer than 14 characters.'>&4
8404 You can't have filenames longer than 14 chars.
8405 You can't even think about them!
8411 $rm -rf 123456789abcde*
8413 : determine where library module manual pages go
8414 set man3dir man3dir none
8418 $spackage has manual pages for many of the library modules.
8424 However, you don't have nroff, so they're probably useless to you.
8427 '') man3dir="none";;
8431 case "$d_flexfnam" in
8434 However, your system can't handle the long file names like File::Basename.3.
8437 '') man3dir="none";;
8441 echo "If you don't want the manual sources installed, answer 'none'."
8442 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8444 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8445 if $test -d "$privlib/man/man3"; then
8448 WARNING: Previous versions of perl installed man3 pages into
8449 $privlib/man/man3. This version will suggest a
8450 new default of $dflt.
8454 rp='Do you wish to preserve the old behavior?(y/n)'
8457 y*) dflt="$privlib/man/man3" ;;
8462 *) dflt="$man3dir" ;;
8469 rp="Where do the $package library man pages (source) go?"
8479 : What suffix to use on installed man pages
8485 rp="What suffix should be used for the $package library man pages?"
8487 '') case "$man3dir" in
8501 *) dflt="$man3ext";;
8508 : see if we have to deal with yellow pages, now NIS.
8509 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8510 if $test -f /usr/etc/nibindd; then
8512 echo "I'm fairly confident you're on a NeXT."
8514 rp='Do you get the hosts file via NetInfo?'
8523 y*) hostcat='nidump hosts .';;
8524 *) case "$hostcat" in
8525 nidump*) hostcat='';;
8535 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8543 rp='Are you getting the hosts file via yellow pages?'
8546 y*) hostcat='ypcat hosts';;
8547 *) hostcat='cat /etc/hosts';;
8553 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8556 '') test -f /etc/group && groupcat='cat /etc/group';;
8559 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8562 : now get the host name
8564 echo "Figuring out host name..." >&4
8565 case "$myhostname" in
8567 echo 'Maybe "hostname" will work...'
8568 if tans=`sh -c hostname 2>&1` ; then
8576 if $test "$cont"; then
8578 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8579 if tans=`cat /etc/systemid 2>&1` ; then
8581 phostname='cat /etc/systemid'
8582 echo "Whadyaknow. Xenix always was a bit strange..."
8585 elif $test -r /etc/systemid; then
8586 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8589 if $test "$cont"; then
8590 echo 'No, maybe "uuname -l" will work...'
8591 if tans=`sh -c 'uuname -l' 2>&1` ; then
8593 phostname='uuname -l'
8595 echo 'Strange. Maybe "uname -n" will work...'
8596 if tans=`sh -c 'uname -n' 2>&1` ; then
8598 phostname='uname -n'
8600 echo 'Oh well, maybe I can mine it out of whoami.h...'
8601 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8602 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8603 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8605 case "$myhostname" in
8606 '') echo "Does this machine have an identity crisis or something?"
8609 echo "Well, you said $myhostname before..."
8610 phostname='echo $myhostname';;
8616 case "$myhostname" in
8617 '') myhostname=noname ;;
8619 : you do not want to know about this
8624 if $test "$myhostname" ; then
8626 rp='Your host name appears to be "'$myhostname'".'" Right?"
8634 : bad guess or no guess
8635 while $test "X$myhostname" = X ; do
8637 rp="Please type the (one word) name of your host:"
8642 : translate upper to lower if necessary
8643 case "$myhostname" in
8645 echo "(Normalizing case in your host name)"
8646 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8650 case "$myhostname" in
8652 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8653 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8654 echo "(Trimming domain name from host name--host name is now $myhostname)"
8656 *) case "$mydomain" in
8659 test "X$hostcat" = "Xypcat hosts" &&
8660 ypmatch "$myhostname" hosts 2>/dev/null |\
8661 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8664 test "X$hostcat" != "X" &&
8665 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8666 /[ ]$myhostname[ . ]/p" > hosts
8669 if $test -f hosts; then
8670 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8671 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8672 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8673 hosts | $sort | $uniq | \
8674 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8675 case `$echo X$dflt` in
8676 X*\ *) echo "(Several hosts in the database matched hostname)"
8679 X.) echo "(You do not have fully-qualified names in the hosts database)"
8683 echo "(I cannot locate a hosts database anywhere)"
8688 tans=`./loc resolv.conf X /etc /usr/etc`
8689 if $test -f "$tans"; then
8690 echo "(Attempting domain name extraction from $tans)"
8691 dflt=.`$sed -n -e 's/ / /g' \
8692 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8693 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8695 .) dflt=.`$sed -n -e 's/ / /g' \
8696 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8697 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8704 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8705 dflt=.`sh -c domainname 2>/dev/null`
8708 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8712 case "$dflt$osname" in
8713 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8714 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8718 .) echo "(Lost all hope -- silly guess then)"
8724 *) dflt="$mydomain";;
8728 rp="What is your domain name?"
8738 : translate upper to lower if necessary
8741 echo "(Normalizing case in your domain name)"
8742 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8746 : a little sanity check here
8747 case "$phostname" in
8750 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8751 $myhostname$mydomain|$myhostname) ;;
8753 case "$phostname" in
8755 echo "(That doesn't agree with your whoami.h file, by the way.)"
8758 echo "(That doesn't agree with your $phostname command, by the way.)"
8766 : determine the e-mail address of the user who is running us
8769 I need to get your e-mail address in Internet format if possible, i.e.
8770 something like user@host.domain. Please answer accurately since I have
8771 no easy means to double check it. The default value provided below
8772 is most probably close to reality but may not be valid from outside
8773 your organization...
8777 while test "$cont"; do
8779 '') dflt="$cf_by@$myhostname$mydomain";;
8780 *) dflt="$cf_email";;
8782 rp='What is your e-mail address?'
8788 rp='Address does not look like an Internet one. Use it anyway?'
8802 : Ask e-mail of administrator
8805 If you or somebody else will be maintaining perl at your site, please
8806 fill in the correct e-mail address here so that they may be contacted
8807 if necessary. Currently, the "perlbug" program included with perl
8808 will send mail to this address in addition to perlbug@perl.org. You may
8809 enter "none" for no administrator.
8812 case "$perladmin" in
8813 '') dflt="$cf_email";;
8814 *) dflt="$perladmin";;
8816 rp='Perl administrator e-mail address'
8820 : determine whether to only install version-specific parts.
8823 Do you want to install only the version-specific parts of the perl
8824 distribution? Usually you do *not* want to do this.
8826 case "$versiononly" in
8827 "$define"|[Yy]*|true) dflt='y' ;;
8830 rp="Do you want to install only the version-specific parts of perl?"
8833 [yY]*) val="$define";;
8839 case "$versiononly" in
8840 "$define") inc_version_list=''
8841 inc_version_list_init=0
8845 : figure out how to guarantee perl startup
8846 : XXX Note that this currently takes advantage of the bug that binexp ignores
8847 : the Configure -Dinstallprefix setting, which in turn means that under
8848 : relocatable @INC, initialinstalllocation is what binexp started as.
8849 case "$startperl" in
8851 case "$sharpbang" in
8855 I can use the #! construct to start perl on your system. This will
8856 make startup of perl scripts faster, but may cause problems if you
8857 want to share those scripts and perl is not in a standard place
8858 ($initialinstalllocation/perl) on all your platforms. The alternative
8859 is to force a shell by starting the script with a single ':' character.
8862 case "$versiononly" in
8863 "$define") dflt="$initialinstalllocation/perl$version";;
8864 *) dflt="$initialinstalllocation/perl";;
8866 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8869 none) startperl=": # use perl";;
8870 *) startperl="#!$ans"
8871 if $test 30 -lt `echo "$ans" | wc -c`; then
8874 WARNING: Some systems limit the #! command to 32 characters.
8875 If you experience difficulty running Perl scripts with #!, try
8876 installing Perl in a directory with a shorter pathname.
8882 *) startperl=": # use perl"
8887 echo "I'll use $startperl to start perl scripts."
8889 : figure best path for perl in scripts
8892 case "$versiononly" in
8893 "$define") perlpath="$initialinstalllocation/perl$version";;
8894 *) perlpath="$initialinstalllocation/perl";;
8896 case "$startperl" in
8901 I will use the "eval 'exec'" idiom to start Perl on your system.
8902 I can use the full path of your Perl binary for this purpose, but
8903 doing so may cause problems if you want to share those scripts and
8904 Perl is not always in a standard place ($initialinstalllocation/perl).
8907 dflt="$initialinstalllocation/perl"
8908 rp="What path shall I use in \"eval 'exec'\"?"
8915 case "$startperl" in
8917 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8920 : determine where public executable scripts go
8921 set scriptdir scriptdir
8923 case "$scriptdir" in
8926 : guess some guesses
8927 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8928 $test -d /usr/share/bin && dflt=/usr/share/bin
8929 $test -d /usr/local/script && dflt=/usr/local/script
8930 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8931 $test -d $prefixexp/script && dflt=$prefixexp/script
8935 *) dflt="$scriptdir"
8940 Some installations have a separate directory just for executable scripts so
8941 that they can mount it across multiple architectures but keep the scripts in
8942 one spot. You might, for example, have a subdirectory of /usr/share for this.
8943 Or you might just lump your scripts in with all your other executables.
8947 rp='Where do you keep publicly executable scripts?'
8949 if $test "X$ansexp" != "X$scriptdirexp"; then
8955 : A little fix up for an irregularly named variable.
8956 installscript="$installscriptdir"
8958 : determine where add-on public executables go
8960 '') dflt=$siteprefix/bin ;;
8964 rp='Pathname where the add-on public executables should be installed?'
8969 : determine where add-on html pages go
8970 : There is no standard location, so try to copy the previously-selected
8971 : directory structure for the core html pages.
8972 case "$sitehtml1dir" in
8973 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8974 *) dflt=$sitehtml1dir ;;
8977 ''|' ') dflt=none ;;
8980 rp='Pathname where the site-specific html pages should be installed?'
8982 prefixvar=sitehtml1dir
8985 : determine where add-on library html pages go
8986 : There is no standard location, so try to copy the previously-selected
8987 : directory structure for the core html pages.
8988 case "$sitehtml3dir" in
8989 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8990 *) dflt=$sitehtml3dir ;;
8993 ''|' ') dflt=none ;;
8996 rp='Pathname where the site-specific library html pages should be installed?'
8998 prefixvar=sitehtml3dir
9001 : determine where add-on manual pages go
9002 case "$siteman1dir" in
9003 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
9004 *) dflt=$siteman1dir ;;
9007 ''|' ') dflt=none ;;
9010 rp='Pathname where the site-specific manual pages should be installed?'
9012 prefixvar=siteman1dir
9015 : determine where add-on library man pages go
9016 case "$siteman3dir" in
9017 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
9018 *) dflt=$siteman3dir ;;
9021 ''|' ') dflt=none ;;
9024 rp='Pathname where the site-specific library manual pages should be installed?'
9026 prefixvar=siteman3dir
9029 : determine where add-on public executable scripts go
9030 case "$sitescript" in
9031 '') dflt=$siteprefix/script
9032 $test -d $dflt || dflt=$sitebin ;;
9033 *) dflt="$sitescript" ;;
9036 rp='Pathname where add-on public executable scripts should be installed?'
9038 prefixvar=sitescript
9041 : Check if faststdio is requested and available
9042 case "$usefaststdio" in
9043 $define|true|[yY]*|'')
9044 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
9054 Perl can be built to use 'fast stdio', which means using the stdio
9055 library but also directly manipulating the stdio buffers to enable
9056 faster I/O. Using stdio is better for backward compatibility (especially
9057 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
9058 interface has been preferred instead of stdio.
9060 If this doesn't make any sense to you, just accept the default '$dflt'.
9062 rp='Use the "fast stdio" if available?'
9065 y|Y) val="$define" ;;
9072 : define an is-a-typedef? function
9073 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9075 "") inclist="sys/types.h";;
9077 eval "varval=\$$var";
9081 for inc in $inclist; do
9082 echo "#include <$inc>" >>temp.c;
9084 echo "#ifdef $type" >> temp.c;
9085 echo "printf(\"We have $type\");" >> temp.c;
9086 echo "#endif" >> temp.c;
9087 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9088 if $contains $type temp.E >/dev/null 2>&1; then
9094 *) eval "$var=\$varval";;
9097 : define an is-a-typedef? function that prompts if the type is not available.
9098 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
9100 "") inclist="sys/types.h";;
9102 eval "varval=\$$var";
9106 for inc in $inclist; do
9107 echo "#include <$inc>" >>temp.c;
9109 echo "#ifdef $type" >> temp.c;
9110 echo "printf(\"We have $type\");" >> temp.c;
9111 echo "#endif" >> temp.c;
9112 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
9114 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
9115 if $contains $type temp.E >/dev/null 2>&1; then
9116 echo "$type found." >&4;
9119 echo "$type NOT found." >&4;
9125 *) eval "$var=\$varval";;
9128 : see what type lseek is declared as in the kernel
9129 rp="What is the type used for lseek's offset on this system?"
9130 set off_t lseektype long stdio.h sys/types.h
9134 echo "Checking to see how big your file offsets are..." >&4
9136 #include <sys/types.h>
9140 printf("%d\n", (int)sizeof($lseektype));
9145 if eval $compile_ok; then
9146 lseeksize=`$run ./try`
9147 echo "Your file offsets are $lseeksize bytes long."
9151 echo "(I can't seem to compile the test program. Guessing...)"
9152 rp="What is the size of your file offsets (in bytes)?"
9158 : see what type file positions are declared as in the library
9159 rp="What is the type for file position used by fsetpos()?"
9160 set fpos_t fpostype long stdio.h sys/types.h
9163 : Check size for Fpos_t
9166 *_t) zzz="$fpostype" ;;
9169 echo "Checking the size of $zzz..." >&4
9171 #include <sys/types.h>
9178 printf("%d\n", (int)sizeof($fpostype));
9183 if eval $compile_ok; then
9187 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9190 echo "Your $zzz is $fpossize bytes long."
9196 echo "(I can't compile the test program. Guessing...)" >&4
9197 rp="What is the size of your file positions (in bytes)?"
9202 : Check for large file support
9203 # Backward compatibility (uselfs is deprecated).
9205 "$define"|true|[yY]*)
9208 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
9210 uselargefiles="$define"
9214 case "$lseeksize:$fpossize" in
9217 You can have files larger than 2 gigabytes.
9220 *) case "$uselargefiles" in
9221 "$undef"|false|[nN]*) dflt='n' ;;
9226 Perl can be built to understand large files (files larger than 2 gigabytes)
9227 on some systems. To do so, Configure can be run with -Duselargefiles.
9229 If this doesn't make any sense to you, just accept the default '$dflt'.
9231 rp='Try to understand large files, if available?'
9234 y|Y) val="$define" ;;
9241 : Look for a hint-file generated 'call-back-unit'. If the
9242 : user has specified that a large files perl is to be built,
9243 : we may need to set or change some other defaults.
9244 if $test -f uselargefiles.cbu; then
9245 echo "Your platform has some specific hints regarding large file builds, using them..."
9246 . ./uselargefiles.cbu
9248 case "$uselargefiles" in
9250 if $test -f uselargefiles.cbu; then
9252 echo "Rechecking to see how big your file offsets are..." >&4
9254 #include <sys/types.h>
9258 printf("%d\n", (int)sizeof($lseektype));
9263 if eval $compile_ok; then
9264 lseeksize=`$run ./try`
9265 $echo "Your file offsets are now $lseeksize bytes long."
9269 echo "(I can't seem to compile the test program. Guessing...)"
9270 rp="What is the size of your file offsets (in bytes)?"
9275 *_t) zzz="$fpostype" ;;
9278 $echo $n "Rechecking the size of $zzz...$c" >&4
9280 #include <sys/types.h>
9287 printf("%d\n", (int)sizeof($fpostype));
9292 if eval $compile_ok; then
9297 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9300 echo " $fpossize bytes." >&4
9306 echo "(I can't compile the test program. Guessing...)" >&4
9307 rp="What is the size of your file positions (in bytes)?"
9316 : Set the vendorbin variables
9317 case "$vendorprefix" in
9318 '') d_vendorbin="$undef"
9322 *) d_vendorbin="$define"
9323 : determine where vendor-supplied executables go.
9324 case "$vendorbin" in
9325 '') dflt=$vendorprefix/bin ;;
9326 *) dflt="$vendorbin" ;;
9329 rp='Pathname for the vendor-supplied executables directory?'
9332 vendorbinexp="$ansexp"
9338 : Set the vendorhtml1dir variables
9339 case "$vendorprefix" in
9340 '') vendorhtml1dir=''
9341 vendorhtml1direxp=''
9343 *) : determine where vendor-supplied html pages go.
9344 : There is no standard location, so try to copy the previously-selected
9345 : directory structure for the core html pages.
9346 : XXX Better default suggestions would be welcome.
9347 case "$vendorhtml1dir" in
9348 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9349 *) dflt=$vendorhtml1dir ;;
9352 ''|' ') dflt=none ;;
9355 rp='Pathname for the vendor-supplied html pages?'
9357 vendorhtml1dir="$ans"
9358 vendorhtml1direxp="$ansexp"
9361 : Use ' ' for none so value is preserved next time through Configure
9362 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9363 prefixvar=vendorhtml1dir
9366 : Set the vendorhtml3dir variables
9367 case "$vendorprefix" in
9368 '') vendorhtml3dir=''
9369 vendorhtml3direxp=''
9371 *) : determine where vendor-supplied module html pages go.
9372 : There is no standard location, so try to copy the previously-selected
9373 : directory structure for the core html pages.
9374 : XXX Better default suggestions would be welcome.
9375 case "$vendorhtml3dir" in
9376 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9377 *) dflt=$vendorhtml3dir ;;
9380 ''|' ') dflt=none ;;
9383 rp='Pathname for the vendor-supplied html pages?'
9385 vendorhtml3dir="$ans"
9386 vendorhtml3direxp="$ansexp"
9389 : Use ' ' for none so value is preserved next time through Configure
9390 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9391 prefixvar=vendorhtml3dir
9394 : Set the vendorman1dir variables
9395 case "$vendorprefix" in
9396 '') vendorman1dir=''
9399 *) : determine where vendor-supplied manual pages go.
9400 case "$vendorman1dir" in
9401 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9402 *) dflt=$vendorman1dir ;;
9405 ''|' ') dflt=none ;;
9408 rp='Pathname for the vendor-supplied manual section 1 pages?'
9410 vendorman1dir="$ans"
9411 vendorman1direxp="$ansexp"
9414 : Use ' ' for none so value is preserved next time through Configure
9415 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9416 prefixvar=vendorman1dir
9419 : Set the vendorman3dir variables
9420 case "$vendorprefix" in
9421 '') vendorman3dir=''
9424 *) : determine where vendor-supplied module manual pages go.
9425 case "$vendorman3dir" in
9426 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9427 *) dflt=$vendorman3dir ;;
9430 ''|' ') dflt=none ;;
9433 rp='Pathname for the vendor-supplied manual section 3 pages?'
9435 vendorman3dir="$ans"
9436 vendorman3direxp="$ansexp"
9439 : Use ' ' for none so value is preserved next time through Configure
9440 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9441 prefixvar=vendorman3dir
9444 : Set the vendorscript variables
9445 case "$vendorprefix" in
9446 '') d_vendorscript="$undef"
9450 *) d_vendorscript="$define"
9451 : determine where vendor-supplied scripts go.
9452 case "$vendorscript" in
9453 '') dflt=$vendorprefix/script
9454 $test -d $dflt || dflt=$vendorbin ;;
9455 *) dflt="$vendorscript" ;;
9459 The installation process will create a directory for
9460 vendor-supplied scripts.
9464 rp='Pathname for the vendor-supplied scripts directory?'
9467 vendorscriptexp="$ansexp"
9470 prefixvar=vendorscript
9473 : see if qgcvt exists
9477 : Check print/scan long double stuff
9480 if $test X"$d_longdbl" = X"$define"; then
9482 echo "Checking how to print long doubles..." >&4
9484 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9485 $cat >try.c <<'EOCP'
9486 #include <sys/types.h>
9490 printf("%.3f\n", d);
9494 if eval $compile; then
9498 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9499 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9500 echo "We will use %f."
9506 if $test X"$sPRIfldbl" = X; then
9507 $cat >try.c <<'EOCP'
9508 #include <sys/types.h>
9511 long double d = 123.456;
9512 printf("%.3Lf\n", d);
9516 if eval $compile; then
9520 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9521 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9522 echo "We will use %Lf."
9528 if $test X"$sPRIfldbl" = X; then
9529 $cat >try.c <<'EOCP'
9530 #include <sys/types.h>
9533 long double d = 123.456;
9534 printf("%.3llf\n", d);
9538 if eval $compile; then
9542 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9543 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9544 echo "We will use %llf."
9550 if $test X"$sPRIfldbl" = X; then
9551 $cat >try.c <<'EOCP'
9552 #include <sys/types.h>
9555 long double d = 123.456;
9556 printf("%.3lf\n", d);
9560 if eval $compile; then
9564 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9565 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9566 echo "We will use %lf."
9572 if $test X"$sPRIfldbl" = X; then
9573 echo "Cannot figure out how to print long doubles." >&4
9575 sSCNfldbl=$sPRIfldbl # expect consistency
9582 case "$sPRIfldbl" in
9583 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9584 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9585 d_SCNfldbl="$undef";
9587 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9588 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9589 d_SCNfldbl="$define";
9593 : Check how to convert floats to strings.
9595 if test "X$d_Gconvert" = X; then
9598 echo "Checking for an efficient way to convert floats to strings."
9600 case "$uselongdouble" in
9601 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9603 case "$d_longdbl" in
9604 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9606 case "$d_PRIgldbl" in
9607 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9611 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9612 char *myname = "gconvert";
9615 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9616 char *myname = "gcvt";
9619 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9620 char *myname = "qgcvt";
9621 #define DOUBLETYPE long double
9624 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9626 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9628 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9631 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9633 char *myname = "sprintf";
9637 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9638 #define DOUBLETYPE long double
9640 #define DOUBLETYPE double
9646 #define I_STDLIB $i_stdlib
9652 checkit(expect, got)
9656 if (strcmp(expect, got)) {
9657 printf("%s oddity: Expected %s, got %s\n",
9658 myname, expect, got);
9668 /* This must be 1st test on (which?) platform */
9669 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9670 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9671 checkit("0.1", buf);
9673 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9674 checkit("0.01", buf);
9676 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9677 checkit("0.001", buf);
9679 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9680 checkit("0.0001", buf);
9682 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9683 if (strlen(buf) > 5)
9684 checkit("9e-005", buf); /* for Microsoft ?? */
9686 checkit("9e-05", buf);
9688 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9691 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9692 checkit("1.1", buf);
9694 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9695 checkit("1.01", buf);
9697 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9698 checkit("1.001", buf);
9700 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9701 checkit("1.0001", buf);
9703 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9704 checkit("1.00001", buf);
9706 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9707 checkit("1.000001", buf);
9709 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9712 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9715 /* Some Linux gcvt's give 1.e+5 here. */
9716 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9717 checkit("100000", buf);
9719 /* Some Linux gcvt's give -1.e+5 here. */
9720 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9721 checkit("-100000", buf);
9723 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9724 checkit("123.456", buf);
9726 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9727 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9728 /* 34 should be enough to scare even long double
9729 * places into using the e notation. */
9730 if (strlen(buf) > 5)
9731 checkit("1e+034", buf); /* for Microsoft */
9733 checkit("1e+34", buf);
9735 /* For Perl, if you add additional tests here, also add them to
9736 * t/base/num.t for benefit of platforms not using Configure or
9737 * overriding d_Gconvert */
9742 : first add preferred functions to our list
9744 for xxx_convert in $gconvert_preference; do
9745 case $xxx_convert in
9746 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9747 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9750 : then add any others
9751 for xxx_convert in gconvert gcvt sprintf; do
9754 *) xxx_list="$xxx_list $xxx_convert" ;;
9758 case "$d_longdbl$uselongdouble" in
9760 : again, add prefered functions to our list first
9762 for xxx_convert in $gconvert_ld_preference; do
9763 case $xxx_convert in
9764 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9765 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9768 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9769 for xxx_convert in qgcvt sprintf $xxx_list; do
9770 case "$xxx_ld_list" in
9771 $xxx_convert*|*" $xxx_convert"*) ;;
9772 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9775 : if sprintf cannot do long doubles, move it to the end
9776 if test "$d_PRIgldbl" != "$define"; then
9777 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9779 : if no qgcvt, remove it
9780 if test "$d_qgcvt" != "$define"; then
9781 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9784 xxx_list="$xxx_ld_list"
9788 for xxx_convert in $xxx_list; do
9789 echo "Trying $xxx_convert..."
9790 $rm -f try try$_o core
9791 set try -DTRY_$xxx_convert
9792 if eval $compile; then
9793 echo "$xxx_convert() found." >&4
9795 echo "I'll use $xxx_convert to convert floats into a string." >&4
9798 echo "...But $xxx_convert didn't work as I expected."
9802 echo "$xxx_convert NOT found." >&4
9806 if test X$xxx_convert = X; then
9807 echo "*** WHOA THERE!!! ***" >&4
9808 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9812 case "$xxx_convert" in
9813 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9814 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9815 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9816 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9817 "$define$define$define")
9818 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9819 "$define$define$undef")
9820 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9821 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9829 : see if _fwalk exists
9833 : Initialize h_fcntl
9836 : Initialize h_sysfile
9839 : access call always available on UNIX
9843 : locate the flags for 'access()'
9847 $cat >access.c <<EOCP
9848 #include <sys/types.h>
9853 #include <sys/file.h>
9866 : check sys/file.h first, no particular reason here
9867 if $test `./findhdr sys/file.h` && \
9868 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9870 echo "<sys/file.h> defines the *_OK access constants." >&4
9871 elif $test `./findhdr fcntl.h` && \
9872 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9874 echo "<fcntl.h> defines the *_OK access constants." >&4
9875 elif $test `./findhdr unistd.h` && \
9876 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9877 echo "<unistd.h> defines the *_OK access constants." >&4
9879 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9885 : see if accessx exists
9886 set accessx d_accessx
9889 : see if aintl exists
9893 : see if alarm exists
9897 : see if POSIX threads are available
9898 set pthread.h i_pthread
9901 : define a fucntion to check prototypes
9902 $cat > protochk <<EOSH
9905 optimize="$optimize"
9907 prototype="$prototype"
9910 usethreads=$usethreads
9911 i_pthread=$i_pthread
9912 pthread_h_first=$pthread_h_first
9915 $cat >> protochk <<'EOSH'
9920 while test $# -ge 2; do
9922 $define) echo "#include <$2>" >> try.c ;;
9923 literal) echo "$2" >> try.c ;;
9925 # Extra magic for the benefit of systems that need pthread.h
9926 # to be included early to correctly detect threadsafe functions.
9927 # Such functions must guarantee themselves, though, that the usethreads
9928 # and i_pthread have been defined, before calling protochk.
9929 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9930 echo "#include <pthread.h>" >> try.c
9935 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9936 cat >> try.c <<'EOCP'
9937 #ifdef CAN_PROTOTYPE
9938 #define _(args) args
9943 echo "$foo" >> try.c
9944 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9945 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9953 : Define hasproto macro for Configure internal use
9954 hasproto='varname=$1; func=$2; shift; shift;
9955 while $test $# -ge 2; do
9957 $define) echo "#include <$2>";;
9961 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9962 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9963 echo "$func() prototype found.";
9966 echo "$func() prototype NOT found.";
9973 : see if sys/types.h has to be included
9974 set sys/types.h i_systypes
9977 : see if sys/select.h has to be included
9978 set sys/select.h i_sysselct
9981 : Define hasfield macro for Configure internal use
9982 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9983 while $test $# -ge 2; do
9985 $define) echo "#include <$2>";;
9989 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9991 if eval $compile; then
10000 : see if we should include time.h, sys/time.h, or both
10002 if test "X$timeincl" = X; then
10003 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
10004 $echo $n "I'm now running the test program...$c"
10006 #include <sys/types.h>
10011 #ifdef SYSTIMEKERNEL
10014 #include <sys/time.h>
10017 #include <sys/select.h>
10019 #$i_stdlib I_STDLIB
10021 #include <stdlib.h>
10027 struct timeval bar;
10030 struct timezone tzp;
10032 if (foo.tm_sec == foo.tm_sec)
10035 if (bar.tv_sec == bar.tv_sec)
10042 for s_timezone in '-DS_TIMEZONE' ''; do
10044 for s_timeval in '-DS_TIMEVAL' ''; do
10045 for i_systimek in '' '-DSYSTIMEKERNEL'; do
10046 for i_time in '' '-DI_TIME'; do
10047 for i_systime in '-DI_SYSTIME' ''; do
10050 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
10051 if eval $compile; then
10052 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
10056 $echo $n "Succeeded with $flags$c"
10068 *SYSTIMEKERNEL*) i_systimek="$define"
10069 timeincl=`./findhdr sys/time.h`
10070 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
10071 *) i_systimek="$undef";;
10074 *I_TIME*) i_time="$define"
10075 timeincl=`./findhdr time.h`" $timeincl"
10076 echo "We'll include <time.h>." >&4;;
10077 *) i_time="$undef";;
10080 *I_SYSTIME*) i_systime="$define"
10081 timeincl=`./findhdr sys/time.h`" $timeincl"
10082 echo "We'll include <sys/time.h>." >&4;;
10083 *) i_systime="$undef";;
10087 : see if struct tm knows about tm_zone
10088 case "$i_systime$i_time" in
10091 echo "Checking to see if your struct tm has tm_zone field..." >&4
10092 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
10100 case "$d_tm_tm_zone" in
10101 "$define") echo "Yes, it does." ;;
10102 *) echo "No, it doesn't." ;;
10104 : see if struct tm knows about tm_gmtoff
10105 case "$i_systime$i_time" in
10108 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
10109 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
10117 case "$d_tm_tm_gmtoff" in
10118 "$define") echo "Yes, it does." ;;
10119 *) echo "No, it doesn't." ;;
10122 : see if asctime_r exists
10123 set asctime_r d_asctime_r
10125 case "$d_asctime_r" in
10127 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10128 case "$d_asctime_r_proto:$usethreads" in
10129 ":define") d_asctime_r_proto=define
10130 set d_asctime_r_proto asctime_r $hdrs
10134 case "$d_asctime_r_proto" in
10136 case "$asctime_r_proto" in
10137 ''|0) try='char* asctime_r(const struct tm*, char*);'
10138 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
10140 case "$asctime_r_proto" in
10141 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
10142 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
10144 case "$asctime_r_proto" in
10145 ''|0) try='int asctime_r(const struct tm*, char*);'
10146 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
10148 case "$asctime_r_proto" in
10149 ''|0) try='int asctime_r(const struct tm*, char*, int);'
10150 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
10152 case "$asctime_r_proto" in
10153 ''|0) d_asctime_r=undef
10155 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
10156 * ) case "$asctime_r_proto" in
10157 REENTRANT_PROTO*) ;;
10158 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
10160 echo "Prototype: $try" ;;
10163 *) case "$usethreads" in
10164 define) echo "asctime_r has no prototype, not using it." >&4 ;;
10171 *) asctime_r_proto=0
10175 : see if atolf exists
10179 : see if atoll exists
10183 : Look for GCC-style attribute format
10184 case "$d_attribute_format" in
10187 echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
10188 $cat >attrib.c <<'EOCP'
10190 void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
10192 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10193 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10194 echo "Your C compiler doesn't support __attribute__((format))."
10197 echo "Your C compiler supports __attribute__((format))."
10201 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10205 *) val="$d_attribute_format" ;;
10207 set d_attribute_format
10211 : Look for GCC-style attribute format with null format allowed
10212 case "$d_printf_format_null" in
10213 '') case "$d_attribute_format" in
10216 echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
10217 $cat >attrib.c <<EOCP
10219 #$i_stdlib I_STDLIB
10221 #include <stdlib.h>
10223 int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
10224 int null_printf (char* pat,...) { return (int)pat; }
10225 int main () { exit(null_printf(NULL)); }
10227 if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
10228 : run the executable in case it produces a run-time warning
10229 if $run ./attrib >>attrib.out 2>&1; then
10230 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10231 echo "Your C compiler doesn't allow __printf__ format to be null."
10234 echo "Your C compiler allows __printf__ format to be null."
10238 echo "Your C compiler executable failed with __printf__ format null."
10242 echo "Your C compiler fails with __printf__ format null."
10249 *) val="$d_printf_format_null" ;;
10251 set d_printf_format_null
10255 : Look for GCC-style attribute malloc
10256 case "$d_attribute_malloc" in
10259 echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
10260 $cat >attrib.c <<'EOCP'
10262 char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
10264 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10265 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10266 echo "Your C compiler doesn't support __attribute__((malloc))."
10269 echo "Your C compiler supports __attribute__((malloc))."
10273 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10277 *) val="$d_attribute_malloc" ;;
10279 set d_attribute_malloc
10283 : Look for GCC-style attribute nonnull
10284 case "$d_attribute_nonnull" in
10287 echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
10288 $cat >attrib.c <<'EOCP'
10290 void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
10292 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10293 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10294 echo "Your C compiler doesn't support __attribute__((nonnull))."
10297 echo "Your C compiler supports __attribute__((nonnull))."
10301 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10305 *) val="$d_attribute_nonnull" ;;
10307 set d_attribute_nonnull
10311 : Look for GCC-style attribute noreturn
10312 case "$d_attribute_noreturn" in
10315 echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10316 $cat >attrib.c <<'EOCP'
10318 void fall_over_dead( void ) __attribute__((noreturn));
10320 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10321 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10322 echo "Your C compiler doesn't support __attribute__((noreturn))."
10325 echo "Your C compiler supports __attribute__((noreturn))."
10329 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10333 *) val="$d_attribute_noreturn" ;;
10335 set d_attribute_noreturn
10339 : Look for GCC-style attribute pure
10340 case "$d_attribute_pure" in
10343 echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10344 $cat >attrib.c <<'EOCP'
10346 int square( int n ) __attribute__((pure));
10348 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10349 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10350 echo "Your C compiler doesn't support __attribute__((pure))."
10353 echo "Your C compiler supports __attribute__((pure))."
10357 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10361 *) val="$d_attribute_pure" ;;
10363 set d_attribute_pure
10367 : Look for GCC-style attribute unused
10368 case "$d_attribute_unused" in
10371 echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10372 $cat >attrib.c <<'EOCP'
10374 int do_something( int dummy __attribute__((unused)), int n );
10376 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10377 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10378 echo "Your C compiler doesn't support __attribute__((unused))."
10381 echo "Your C compiler supports __attribute__((unused))."
10385 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10389 *) val="$d_attribute_unused" ;;
10391 set d_attribute_unused
10395 : Look for GCC-style attribute warn_unused_result
10396 case "$d_attribute_warn_unused_result" in
10399 echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10400 $cat >attrib.c <<'EOCP'
10402 int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10404 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10405 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10406 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10409 echo "Your C compiler supports __attribute__((warn_unused_result))."
10413 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10417 *) val="$d_attribute_warn_unused_result" ;;
10419 set d_attribute_warn_unused_result
10423 : see if bcmp exists
10427 : see if bcopy exists
10431 : see if getpgrp exists
10432 set getpgrp d_getpgrp
10435 case "$d_getpgrp" in
10438 echo "Checking to see which flavor of getpgrp is in use..."
10440 #$i_unistd I_UNISTD
10441 #include <sys/types.h>
10443 # include <unistd.h>
10445 #$i_stdlib I_STDLIB
10447 #include <stdlib.h>
10451 if (getuid() == 0) {
10452 printf("(I see you are running Configure as super-user...)\n");
10455 #ifdef TRY_BSD_PGRP
10456 if (getpgrp(1) == 0)
10465 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10466 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10468 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10469 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10472 echo "I can't seem to compile and run the test program."
10474 xxx="a USG one, i.e. you use getpgrp()."
10476 # SVR4 systems can appear rather BSD-ish.
10477 case "$i_unistd" in
10479 xxx="a BSD one, i.e. you use getpgrp(pid)."
10483 xxx="probably a USG one, i.e. you use getpgrp()."
10488 echo "Assuming your getpgrp is $xxx" >&4
10497 : see if setpgrp exists
10498 set setpgrp d_setpgrp
10501 case "$d_setpgrp" in
10504 echo "Checking to see which flavor of setpgrp is in use..."
10506 #$i_unistd I_UNISTD
10507 #include <sys/types.h>
10509 # include <unistd.h>
10511 #$i_stdlib I_STDLIB
10513 #include <stdlib.h>
10517 if (getuid() == 0) {
10518 printf("(I see you are running Configure as super-user...)\n");
10521 #ifdef TRY_BSD_PGRP
10522 if (-1 == setpgrp(1, 1))
10525 if (setpgrp() != -1)
10531 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10532 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10534 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10535 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10538 echo "(I can't seem to compile and run the test program.)"
10540 xxx="a USG one, i.e. you use setpgrp()."
10542 # SVR4 systems can appear rather BSD-ish.
10543 case "$i_unistd" in
10545 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10549 xxx="probably a USG one, i.e. you use setpgrp()."
10554 echo "Assuming your setpgrp is $xxx" >&4
10563 : Look for GCC-style __builtin_choose_expr
10564 case "$d_builtin_choose_expr" in
10567 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10568 $cat >try.c <<'EOCP'
10569 #include <assert.h>
10570 #include <stdlib.h>
10573 #define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10576 assert( SYRINX(1) == 2112 );
10577 assert( SYRINX(1) != 5150 );
10578 assert( SYRINX(0) == 5150 );
10579 assert( SYRINX(0) != 2112 );
10580 puts( "All good!" );
10586 if eval $compile && $run ./try; then
10587 echo "Your C compiler supports __builtin_choose_expr."
10590 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10594 *) val="$d_builtin_choose_expr" ;;
10597 set d_builtin_choose_expr
10601 : Look for GCC-style __builtin_expect
10602 case "$d_builtin_expect" in
10605 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10606 $cat >try.c <<'EOCP'
10609 if ( __builtin_expect(n, 0) ) n = 1;
10610 /* Remember shell exit code truth is 0, C truth is non-zero */
10615 if eval $compile && $run ./try; then
10616 echo "Your C compiler supports __builtin_expect."
10619 echo "Your C compiler doesn't seem to understand __builtin_expect."
10623 *) val="$d_builtin_expect" ;;
10626 set d_builtin_expect
10630 : see if bzero exists
10634 : see if stdarg is available
10636 if $test `./findhdr stdarg.h`; then
10637 echo "<stdarg.h> found." >&4
10640 echo "<stdarg.h> NOT found." >&4
10644 : see if varags is available
10646 if $test `./findhdr varargs.h`; then
10647 echo "<varargs.h> found." >&4
10649 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10652 : set up the varargs testing programs
10653 $cat > varargs.c <<EOP
10655 #include <stdarg.h>
10658 #include <varargs.h>
10662 int f(char *p, ...)
10676 p = va_arg(ap, char *);
10682 $cat > varargs <<EOP
10684 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10693 : now check which varargs header should be included
10698 if `./varargs I_STDARG`; then
10700 elif `./varargs I_VARARGS`; then
10705 if `./varargs I_VARARGS`; then
10712 echo "I could not find the definition for va_dcl... You have problems..." >&4
10713 val="$undef"; set i_stdarg; eval $setvar
10714 val="$undef"; set i_varargs; eval $setvar
10719 case "$i_varhdr" in
10721 val="$define"; set i_stdarg; eval $setvar
10722 val="$undef"; set i_varargs; eval $setvar
10725 val="$undef"; set i_stdarg; eval $setvar
10726 val="$define"; set i_varargs; eval $setvar
10729 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10733 : see if the Compiler supports C99 variadic macros
10734 case "$i_stdarg$i_stdlib" in
10736 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10739 #include <stdarg.h>
10741 #define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10745 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10751 if eval $compile && $run ./try 2>&1 >/dev/null; then
10752 case "`$run ./try`" in
10754 echo "You have C99 variadic macros." >&4
10755 d_c99_variadic_macros="$define"
10758 echo "You don't have functional C99 variadic macros." >&4
10759 d_c99_variadic_macros="$undef"
10763 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10764 d_c99_variadic_macros="$undef"
10769 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10770 d_c99_variadic_macros="$undef"
10774 : see if signal is declared as pointer to function returning int or void
10776 xxx=`./findhdr signal.h`
10777 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10778 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10779 echo "You have int (*signal())() instead of void." >&4
10781 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10782 echo "You have void (*signal())()." >&4
10784 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10785 echo "You have int (*signal())() instead of void." >&4
10787 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10788 echo "You have void (*signal())()." >&4
10791 case "$d_voidsig" in
10793 echo "I can't determine whether signal handler returns void or int..." >&4
10795 rp="What type does your signal handler return?"
10798 v*) val="$define";;
10802 echo "As you already told me, signal handler returns void." >&4
10805 *) echo "As you already told me, signal handler returns int." >&4
10812 case "$d_voidsig" in
10813 "$define") signal_t="void";;
10814 *) signal_t="int";;
10818 : check for ability to cast large floats to 32-bit ints.
10820 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10821 if $test "$intsize" -ge 4; then
10828 #$i_stdlib I_STDLIB
10830 #include <stdlib.h>
10832 #include <sys/types.h>
10833 #include <signal.h>
10834 $signal_t blech(int s) { exit(3); }
10841 signal(SIGFPE, blech);
10843 /* Don't let compiler optimize the test away. Store the number
10844 in a writable string for gcc to pass to sscanf under HP/UX.
10846 sprintf(str, "2147483647");
10847 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10851 /* x86 processors will probably give 0x8000 0000, which is a
10852 sign change. We don't want that. We want to mimic SPARC
10853 behavior here, which is to preserve the sign and give
10856 if (i32 != ($xxx) f)
10862 if eval $compile_ok; then
10866 echo "(I can't seem to compile the test program--assuming it can't)"
10871 echo "Yup, it can."
10874 echo "Nope, it can't."
10881 : check for ability to cast negative floats to unsigned
10883 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10886 #$i_stdlib I_STDLIB
10888 #include <stdlib.h>
10890 #include <sys/types.h>
10891 #include <signal.h>
10892 $signal_t blech(int s) { exit(7); }
10893 $signal_t blech_in_list(int s) { exit(4); }
10894 unsigned long dummy_long(unsigned long p) { return p; }
10895 unsigned int dummy_int(unsigned int p) { return p; }
10896 unsigned short dummy_short(unsigned short p) { return p; }
10900 unsigned long along;
10902 unsigned short ashort;
10906 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10907 a direct f = -123. assignment. gcc-2.8.0 reportedly
10908 optimized the whole file away
10910 /* Store the number in a writable string for gcc to pass to
10911 sscanf under HP/UX.
10913 sprintf(str, "-123");
10914 sscanf(str, "%lf", &f); /* f = -123.; */
10916 signal(SIGFPE, blech);
10917 along = (unsigned long)f;
10918 aint = (unsigned int)f;
10919 ashort = (unsigned short)f;
10920 if (along != (unsigned long)-123)
10922 if (aint != (unsigned int)-123)
10924 if (ashort != (unsigned short)-123)
10926 sprintf(str, "1073741824.");
10927 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10930 along = (unsigned long)f;
10931 if (along != 0x80000000)
10935 along = (unsigned long)f;
10936 if (along != 0x7fffffff)
10940 along = (unsigned long)f;
10941 if (along != 0x80000001)
10945 signal(SIGFPE, blech_in_list);
10946 sprintf(str, "123.");
10947 sscanf(str, "%lf", &f); /* f = 123.; */
10948 along = dummy_long((unsigned long)f);
10949 aint = dummy_int((unsigned int)f);
10950 ashort = dummy_short((unsigned short)f);
10951 if (along != (unsigned long)123)
10953 if (aint != (unsigned int)123)
10955 if (ashort != (unsigned short)123)
10962 if eval $compile_ok; then
10966 echo "(I can't seem to compile the test program--assuming it can't)"
10969 case "$castflags" in
10971 echo "Yup, it can."
10974 echo "Nope, it can't."
10981 : see if vprintf exists
10983 if set vprintf val -f d_vprintf; eval $csym; $val; then
10984 echo 'vprintf() found.' >&4
10987 #$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
10988 #$i_varargs I_VARARGS
10990 #$i_stdlib I_STDLIB
10991 #$i_unistd I_UNISTD
10994 # include <stdarg.h>
10995 #else /* I_VARARGS */
10996 # include <varargs.h>
11000 # include <unistd.h>
11004 # include <stdlib.h>
11007 #include <stdio.h> /* vsprintf prototype */
11010 void xxx(int n, ...)
11015 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11017 int main() { xxx(1, "foo"); }
11019 #else /* I_VARARGS */
11027 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
11029 int main() { xxx("foo"); }
11035 if eval $compile_ok; then
11036 if $run ./try; then
11037 echo "Your vsprintf() returns (int)." >&4
11040 echo "Your vsprintf() returns (char*)." >&4
11044 echo 'I am unable to compile the vsprintf() test program.' >&4
11045 # We shouldn't get here. If we do, assume the standard signature,
11046 # not the old BSD one.
11047 echo 'Guessing that vsprintf() returns (int).' >&4
11051 echo 'vprintf() NOT found.' >&4
11062 : see if chown exists
11066 : see if chroot exists
11067 set chroot d_chroot
11070 : see if chsize exists
11071 set chsize d_chsize
11074 : see if class exists
11078 : see if clearenv exists
11079 set clearenv d_clearenv
11082 : Define hasstruct macro for Configure internal use
11083 hasstruct='varname=$1; struct=$2; shift; shift;
11084 while $test $# -ge 2; do
11086 $define) echo "#include <$2>";;
11090 echo "int main () { struct $struct foo; }" >> try.c;
11092 if eval $compile; then
11101 : see whether socket exists
11105 $echo $n "Hmm... $c" >&4
11106 if set socket val -f d_socket; eval $csym; $val; then
11107 echo "Looks like you have Berkeley networking support." >&4
11109 if set setsockopt val -f; eval $csym; $val; then
11112 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
11113 d_oldsock="$define"
11116 if $contains socklib libc.list >/dev/null 2>&1; then
11117 echo "Looks like you have Berkeley networking support." >&4
11119 : we will have to assume that it supports the 4.2 BSD interface
11122 echo "You don't have Berkeley networking in libc$_a..." >&4
11123 if test "X$d_socket" = "X$define"; then
11124 echo "...but you seem to believe that you have sockets." >&4
11126 for net in net socket
11128 if test -f /usr/lib/lib$net$_a; then
11129 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
11130 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
11131 if $contains socket libc.list >/dev/null 2>&1; then
11136 echo "...but the Wollongong group seems to have hacked it in." >&4
11137 sockethdr="-I/usr/netinclude"
11140 echo "Found Berkeley sockets interface in lib$net." >&4
11141 if $contains setsockopt libc.list >/dev/null 2>&1; then
11144 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
11145 d_oldsock="$define"
11151 if test "X$d_socket" != "X$define"; then
11152 echo "or anywhere else I see." >&4
11160 : see if socketpair exists
11161 set socketpair d_sockpair
11166 echo "Checking the availability of certain socket constants..." >&4
11167 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
11168 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
11170 #include <sys/types.h>
11171 #include <sys/socket.h>
11177 set try; if eval $compile; then
11180 set d_${enum}; eval $setvar
11184 : see if this is a sys/uio.h system
11185 set sys/uio.h i_sysuio
11188 : Check for cmsghdr support
11190 echo "Checking to see if your system supports struct cmsghdr..." >&4
11191 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
11193 case "$d_cmsghdr_s" in
11194 "$define") echo "Yes, it does." ;;
11195 *) echo "No, it doesn't." ;;
11199 : check for const keyword
11201 echo 'Checking to see if your C compiler knows about "const"...' >&4
11202 $cat >const.c <<'EOCP'
11203 typedef struct spug { int drokk; } spug;
11207 const spug y = { 0 };
11210 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
11212 echo "Yup, it does."
11215 echo "Nope, it doesn't."
11220 : see if copysignl exists
11221 set copysignl d_copysignl
11224 : see if crypt exists
11229 $define) cryptlib='' ;;
11230 *) if set crypt val -f d_crypt; eval $csym; $val; then
11231 echo 'crypt() found.' >&4
11235 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
11236 if $test -z "$cryptlib"; then
11237 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
11241 if $test -z "$cryptlib"; then
11242 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
11246 if $test -z "$cryptlib"; then
11247 cryptlib=`./loc libcrypt$_a "" $libpth`
11251 if $test -z "$cryptlib"; then
11252 echo 'crypt() NOT found.' >&4
11263 : see if this is a crypt.h system
11264 set crypt.h i_crypt
11267 : see if crypt_r exists
11268 set crypt_r d_crypt_r
11270 case "$d_crypt_r" in
11272 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
11273 case "$d_crypt_r_proto:$usethreads" in
11274 ":define") d_crypt_r_proto=define
11275 set d_crypt_r_proto crypt_r $hdrs
11279 case "$d_crypt_r_proto" in
11281 case "$crypt_r_proto" in
11282 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
11283 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
11285 case "$crypt_r_proto" in
11286 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
11287 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
11289 case "$crypt_r_proto" in
11290 ''|0) d_crypt_r=undef
11292 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
11293 * ) case "$crypt_r_proto" in
11294 REENTRANT_PROTO*) ;;
11295 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
11297 echo "Prototype: $try" ;;
11300 *) case "$usethreads" in
11301 define) echo "crypt_r has no prototype, not using it." >&4 ;;
11312 : get csh whereabouts
11314 'csh') val="$undef" ;;
11315 *) val="$define" ;;
11319 : Respect a hint or command line value for full_csh.
11320 case "$full_csh" in
11321 '') full_csh=$csh ;;
11324 : see if ctermid exists
11325 set ctermid d_ctermid
11328 : see if ctermid_r exists
11329 set ctermid_r d_ctermid_r
11331 case "$d_ctermid_r" in
11333 hdrs="$i_systypes sys/types.h define stdio.h "
11334 case "$d_ctermid_r_proto:$usethreads" in
11335 ":define") d_ctermid_r_proto=define
11336 set d_ctermid_r_proto ctermid_r $hdrs
11340 case "$d_ctermid_r_proto" in
11342 case "$ctermid_r_proto" in
11343 ''|0) try='char* ctermid_r(char*);'
11344 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11346 case "$ctermid_r_proto" in
11347 ''|0) d_ctermid_r=undef
11349 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11350 * ) case "$ctermid_r_proto" in
11351 REENTRANT_PROTO*) ;;
11352 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11354 echo "Prototype: $try" ;;
11357 *) case "$usethreads" in
11358 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11365 *) ctermid_r_proto=0
11369 : see if ctime_r exists
11370 set ctime_r d_ctime_r
11372 case "$d_ctime_r" in
11374 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11375 case "$d_ctime_r_proto:$usethreads" in
11376 ":define") d_ctime_r_proto=define
11377 set d_ctime_r_proto ctime_r $hdrs
11381 case "$d_ctime_r_proto" in
11383 case "$ctime_r_proto" in
11384 ''|0) try='char* ctime_r(const time_t*, char*);'
11385 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11387 case "$ctime_r_proto" in
11388 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11389 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11391 case "$ctime_r_proto" in
11392 ''|0) try='int ctime_r(const time_t*, char*);'
11393 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11395 case "$ctime_r_proto" in
11396 ''|0) try='int ctime_r(const time_t*, char*, int);'
11397 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11399 case "$ctime_r_proto" in
11400 ''|0) d_ctime_r=undef
11402 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11403 * ) case "$ctime_r_proto" in
11404 REENTRANT_PROTO*) ;;
11405 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11407 echo "Prototype: $try" ;;
11410 *) case "$usethreads" in
11411 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11422 : see if cuserid exists
11423 set cuserid d_cuserid
11426 : see if this is a limits.h system
11427 set limits.h i_limits
11430 : see if this is a float.h system
11431 set float.h i_float
11434 : See if number of significant digits in a double precision number is known
11436 $cat >dbl_dig.c <<EOM
11437 #$i_limits I_LIMITS
11440 #include <limits.h>
11446 printf("Contains DBL_DIG");
11449 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11450 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11451 echo "DBL_DIG found." >&4
11454 echo "DBL_DIG NOT found." >&4
11461 : see if dbm.h is available
11462 : see if dbmclose exists
11463 set dbmclose d_dbmclose
11466 case "$d_dbmclose" in
11476 *) set rpcsvc/dbm.h i_rpcsvcdbm
11481 *) echo "We won't be including <dbm.h>"
11491 : see if prototype for dbminit is available
11493 set d_dbminitproto dbminit $i_dbm dbm.h
11496 : see if difftime exists
11497 set difftime d_difftime
11500 : see if this is a dirent system
11502 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11504 echo "<dirent.h> found." >&4
11507 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11508 echo "<sys/dir.h> found." >&4
11511 xinc=`./findhdr sys/ndir.h`
11513 echo "<dirent.h> NOT found." >&4
11518 : Look for type of directory structure.
11520 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11522 case "$direntrytype" in
11524 case "$i_dirent" in
11525 $define) guess1='struct dirent' ;;
11526 *) guess1='struct direct' ;;
11529 *) guess1="$direntrytype"
11534 'struct dirent') guess2='struct direct' ;;
11535 *) guess2='struct dirent' ;;
11538 if $contains "$guess1" try.c >/dev/null 2>&1; then
11539 direntrytype="$guess1"
11540 echo "Your directory entries are $direntrytype." >&4
11541 elif $contains "$guess2" try.c >/dev/null 2>&1; then
11542 direntrytype="$guess2"
11543 echo "Your directory entries seem to be $direntrytype." >&4
11545 echo "I don't recognize your system's directory entries." >&4
11546 rp="What type is used for directory entries on this system?"
11549 direntrytype="$ans"
11553 : see if the directory entry stores field length
11555 $cppstdin $cppflags $cppminus < "$xinc" > try.c
11556 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11557 echo "Good, your directory entry keeps length information in d_namlen." >&4
11560 echo "Your directory entry does not know about the d_namlen field." >&4
11567 : Look for DIR.dd_fd
11568 case "$i_dirent" in
11570 echo "Checking to see if DIR has a dd_fd member variable" >&4
11572 #$i_stdlib I_STDLIB
11574 #include <stdlib.h>
11576 #include <dirent.h>
11586 if eval $compile; then
11587 echo "Yes, it does."
11590 echo "No, it does not."
11595 echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
11603 : see if this is an sysdir system
11604 set sys/dir.h i_sysdir
11607 : see if this is an sysndir system
11608 set sys/ndir.h i_sysndir
11613 $cat >dirfd.c <<EOM
11615 #$i_stdlib I_STDLIB
11617 #include <stdlib.h>
11619 #$i_dirent I_DIRENT /**/
11620 #$i_sysdir I_SYS_DIR /**/
11621 #$i_sysndir I_SYS_NDIR /**/
11622 #$i_systypes I_SYS_TYPES /**/
11623 #if defined(I_SYS_TYPES)
11624 #include <sys/types.h>
11626 #if defined(I_DIRENT)
11627 #include <dirent.h>
11628 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11629 #include <sys/dir.h>
11633 #include <sys/ndir.h>
11637 #include <ndir.h> /* may be wrong in the future */
11639 #include <sys/dir.h>
11645 DIR *dirp = opendir(".");
11646 if (dirfd(dirp) >= 0)
11654 if eval $compile; then
11658 $define) echo "dirfd() found." >&4 ;;
11659 *) echo "dirfd() NOT found." >&4 ;;
11665 : see if dlerror exists
11668 set dlerror d_dlerror
11672 : see if dlfcn is available
11673 set dlfcn.h i_dlfcn
11676 : Check what extension to use for shared libs
11681 On a few systems, the dynamically loaded modules that perl generates and uses
11682 will need a different extension than shared libs. The default will probably
11688 *) dflt="$dlext" ;;
11690 rp='What is the extension of dynamically loaded modules'
11699 : Check if dlsym need a leading underscore
11705 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11706 $cat >dyna.c <<'EOM'
11713 #$i_stdlib I_STDLIB
11715 #include <stdlib.h>
11719 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11721 #include <sys/types.h>
11726 extern int fred() ;
11735 int mode = RTLD_LAZY ;
11737 handle = dlopen("./dyna.$dlext", mode) ;
11738 if (handle == NULL) {
11743 symbol = dlsym(handle, "fred") ;
11744 if (symbol == NULL) {
11745 /* try putting a leading underscore */
11746 symbol = dlsym(handle, "_fred") ;
11747 if (symbol == NULL) {
11760 : Call the object file tmp-dyna.o in case dlext=o.
11761 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11762 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11763 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11764 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11767 1) echo "Test program failed using dlopen." >&4
11768 echo "Perhaps you should not use dynamic loading." >&4;;
11769 2) echo "Test program failed using dlsym." >&4
11770 echo "Perhaps you should not use dynamic loading." >&4;;
11771 3) echo "dlsym needs a leading underscore" >&4
11773 4) echo "dlsym doesn't need a leading underscore." >&4;;
11776 echo "I can't compile and run the test program." >&4
11777 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11782 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11787 : see if drand48_r exists
11788 set drand48_r d_drand48_r
11790 case "$d_drand48_r" in
11792 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11793 case "$d_drand48_r_proto:$usethreads" in
11794 ":define") d_drand48_r_proto=define
11795 set d_drand48_r_proto drand48_r $hdrs
11799 case "$d_drand48_r_proto" in
11801 case "$drand48_r_proto" in
11802 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11803 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11805 case "$drand48_r_proto" in
11806 ''|0) d_drand48_r=undef
11808 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11809 * ) case "$drand48_r_proto" in
11810 REENTRANT_PROTO*) ;;
11811 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11813 echo "Prototype: $try" ;;
11816 *) case "$usethreads" in
11817 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11824 *) drand48_r_proto=0
11828 : see if prototype for drand48 is available
11830 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11833 : see if dup2 exists
11837 : see if eaccess exists
11838 set eaccess d_eaccess
11841 : see if endgrent exists
11842 set endgrent d_endgrent
11845 : see if this is an grp system
11851 xxx=`./findhdr grp.h`
11852 $cppstdin $cppflags $cppminus < $xxx >$$.h
11854 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11866 set d_grpasswd; eval $setvar
11870 : see if endgrent_r exists
11871 set endgrent_r d_endgrent_r
11873 case "$d_endgrent_r" in
11875 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11876 case "$d_endgrent_r_proto:$usethreads" in
11877 ":define") d_endgrent_r_proto=define
11878 set d_endgrent_r_proto endgrent_r $hdrs
11882 case "$d_endgrent_r_proto" in
11884 case "$endgrent_r_proto" in
11885 ''|0) try='int endgrent_r(FILE**);'
11886 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11888 case "$endgrent_r_proto" in
11889 ''|0) try='void endgrent_r(FILE**);'
11890 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11892 case "$endgrent_r_proto" in
11893 ''|0) d_endgrent_r=undef
11895 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11896 * ) case "$endgrent_r_proto" in
11897 REENTRANT_PROTO*) ;;
11898 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11900 echo "Prototype: $try" ;;
11903 *) case "$usethreads" in
11904 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11911 *) endgrent_r_proto=0
11915 : see if endhostent exists
11916 set endhostent d_endhent
11919 : see if this is a netdb.h system
11920 set netdb.h i_netdb
11923 : see if endhostent_r exists
11924 set endhostent_r d_endhostent_r
11926 case "$d_endhostent_r" in
11928 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11929 case "$d_endhostent_r_proto:$usethreads" in
11930 ":define") d_endhostent_r_proto=define
11931 set d_endhostent_r_proto endhostent_r $hdrs
11935 case "$d_endhostent_r_proto" in
11937 case "$endhostent_r_proto" in
11938 ''|0) try='int endhostent_r(struct hostent_data*);'
11939 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11941 case "$endhostent_r_proto" in
11942 ''|0) try='void endhostent_r(struct hostent_data*);'
11943 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11945 case "$endhostent_r_proto" in
11946 ''|0) d_endhostent_r=undef
11947 endhostent_r_proto=0
11948 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11949 * ) case "$endhostent_r_proto" in
11950 REENTRANT_PROTO*) ;;
11951 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11953 echo "Prototype: $try" ;;
11956 *) case "$usethreads" in
11957 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11959 d_endhostent_r=undef
11960 endhostent_r_proto=0
11964 *) endhostent_r_proto=0
11968 : see if endnetent exists
11969 set endnetent d_endnent
11972 : see if endnetent_r exists
11973 set endnetent_r d_endnetent_r
11975 case "$d_endnetent_r" in
11977 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11978 case "$d_endnetent_r_proto:$usethreads" in
11979 ":define") d_endnetent_r_proto=define
11980 set d_endnetent_r_proto endnetent_r $hdrs
11984 case "$d_endnetent_r_proto" in
11986 case "$endnetent_r_proto" in
11987 ''|0) try='int endnetent_r(struct netent_data*);'
11988 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11990 case "$endnetent_r_proto" in
11991 ''|0) try='void endnetent_r(struct netent_data*);'
11992 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11994 case "$endnetent_r_proto" in
11995 ''|0) d_endnetent_r=undef
11996 endnetent_r_proto=0
11997 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11998 * ) case "$endnetent_r_proto" in
11999 REENTRANT_PROTO*) ;;
12000 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
12002 echo "Prototype: $try" ;;
12005 *) case "$usethreads" in
12006 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
12008 d_endnetent_r=undef
12009 endnetent_r_proto=0
12013 *) endnetent_r_proto=0
12017 : see if endprotoent exists
12018 set endprotoent d_endpent
12021 : see if endprotoent_r exists
12022 set endprotoent_r d_endprotoent_r
12024 case "$d_endprotoent_r" in
12026 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12027 case "$d_endprotoent_r_proto:$usethreads" in
12028 ":define") d_endprotoent_r_proto=define
12029 set d_endprotoent_r_proto endprotoent_r $hdrs
12033 case "$d_endprotoent_r_proto" in
12035 case "$endprotoent_r_proto" in
12036 ''|0) try='int endprotoent_r(struct protoent_data*);'
12037 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
12039 case "$endprotoent_r_proto" in
12040 ''|0) try='void endprotoent_r(struct protoent_data*);'
12041 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
12043 case "$endprotoent_r_proto" in
12044 ''|0) d_endprotoent_r=undef
12045 endprotoent_r_proto=0
12046 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
12047 * ) case "$endprotoent_r_proto" in
12048 REENTRANT_PROTO*) ;;
12049 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
12051 echo "Prototype: $try" ;;
12054 *) case "$usethreads" in
12055 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
12057 d_endprotoent_r=undef
12058 endprotoent_r_proto=0
12062 *) endprotoent_r_proto=0
12066 : see if endpwent exists
12067 set endpwent d_endpwent
12070 : see if this is a pwd.h system
12076 xxx=`./findhdr pwd.h`
12077 $cppstdin $cppflags $cppminus < $xxx >$$.h
12079 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
12087 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
12095 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
12103 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
12111 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
12119 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
12127 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
12135 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
12147 set d_pwquota; eval $setvar
12148 set d_pwage; eval $setvar
12149 set d_pwchange; eval $setvar
12150 set d_pwclass; eval $setvar
12151 set d_pwexpire; eval $setvar
12152 set d_pwcomment; eval $setvar
12153 set d_pwgecos; eval $setvar
12154 set d_pwpasswd; eval $setvar
12158 : see if endpwent_r exists
12159 set endpwent_r d_endpwent_r
12161 case "$d_endpwent_r" in
12163 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12164 case "$d_endpwent_r_proto:$usethreads" in
12165 ":define") d_endpwent_r_proto=define
12166 set d_endpwent_r_proto endpwent_r $hdrs
12170 case "$d_endpwent_r_proto" in
12172 case "$endpwent_r_proto" in
12173 ''|0) try='int endpwent_r(FILE**);'
12174 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
12176 case "$endpwent_r_proto" in
12177 ''|0) try='void endpwent_r(FILE**);'
12178 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
12180 case "$endpwent_r_proto" in
12181 ''|0) d_endpwent_r=undef
12183 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
12184 * ) case "$endpwent_r_proto" in
12185 REENTRANT_PROTO*) ;;
12186 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
12188 echo "Prototype: $try" ;;
12191 *) case "$usethreads" in
12192 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
12199 *) endpwent_r_proto=0
12203 : see if endservent exists
12204 set endservent d_endsent
12207 : see if endservent_r exists
12208 set endservent_r d_endservent_r
12210 case "$d_endservent_r" in
12212 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12213 case "$d_endservent_r_proto:$usethreads" in
12214 ":define") d_endservent_r_proto=define
12215 set d_endservent_r_proto endservent_r $hdrs
12219 case "$d_endservent_r_proto" in
12221 case "$endservent_r_proto" in
12222 ''|0) try='int endservent_r(struct servent_data*);'
12223 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
12225 case "$endservent_r_proto" in
12226 ''|0) try='void endservent_r(struct servent_data*);'
12227 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
12229 case "$endservent_r_proto" in
12230 ''|0) d_endservent_r=undef
12231 endservent_r_proto=0
12232 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
12233 * ) case "$endservent_r_proto" in
12234 REENTRANT_PROTO*) ;;
12235 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
12237 echo "Prototype: $try" ;;
12240 *) case "$usethreads" in
12241 define) echo "endservent_r has no prototype, not using it." >&4 ;;
12243 d_endservent_r=undef
12244 endservent_r_proto=0
12248 *) endservent_r_proto=0
12252 : Locate the flags for 'open()'
12255 #include <sys/types.h>
12260 #include <sys/file.h>
12262 #$i_stdlib I_STDLIB
12264 #include <stdlib.h>
12275 : check sys/file.h first to get FREAD on Sun
12276 if $test `./findhdr sys/file.h` && \
12277 set try -DI_SYS_FILE && eval $compile; then
12279 echo "<sys/file.h> defines the O_* constants..." >&4
12280 if $run ./try; then
12281 echo "and you have the 3 argument form of open()." >&4
12284 echo "but not the 3 argument form of open(). Oh, well." >&4
12287 elif $test `./findhdr fcntl.h` && \
12288 set try -DI_FCNTL && eval $compile; then
12290 echo "<fcntl.h> defines the O_* constants..." >&4
12291 if $run ./try; then
12292 echo "and you have the 3 argument form of open()." >&4
12295 echo "but not the 3 argument form of open(). Oh, well." >&4
12300 echo "I can't find the O_* constant definitions! You got problems." >&4
12306 : script used to emit important warnings
12309 if test \$# -gt 0; then
12314 echo "*** WARNING:" >&4
12315 sed -e 's/^/*** /' <msg >&4
12317 cat msg >>config.msg
12318 echo " " >>config.msg
12324 : see which of string.h or strings.h is needed
12326 strings=`./findhdr string.h`
12327 if $test "$strings" && $test -r "$strings"; then
12328 echo "Using <string.h> instead of <strings.h>." >&4
12332 strings=`./findhdr strings.h`
12333 if $test "$strings" && $test -r "$strings"; then
12334 echo "Using <strings.h> instead of <string.h>." >&4
12336 ./warn "No string header found -- You'll surely have problems."
12341 case "$i_string" in
12342 "$undef") strings=`./findhdr strings.h`;;
12343 *) strings=`./findhdr string.h`;;
12346 : see if this is a sys/file.h system
12351 : do we need to include sys/file.h ?
12355 if $h_sysfile; then
12357 echo "We'll be including <sys/file.h>." >&4
12360 echo "We won't be including <sys/file.h>." >&4
12370 : see if fcntl.h is there
12375 : see if we can include fcntl.h
12381 echo "We'll be including <fcntl.h>." >&4
12384 if $h_sysfile; then
12385 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
12387 echo "We won't be including <fcntl.h>." >&4
12399 : see if fork exists
12403 : see if pipe exists
12407 : check for non-blocking I/O stuff
12408 case "$h_sysfile" in
12409 true) echo "#include <sys/file.h>" > head.c;;
12412 true) echo "#include <fcntl.h>" > head.c;;
12413 *) echo "#include <sys/fcntl.h>" > head.c;;
12418 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12419 case "$o_nonblock" in
12421 $cat head.c > try.c
12422 $cat >>try.c <<EOCP
12424 #$i_stdlib I_STDLIB
12426 #include <stdlib.h>
12434 printf("O_NONBLOCK\n");
12438 printf("O_NDELAY\n");
12442 printf("FNDELAY\n");
12449 if eval $compile_ok; then
12450 o_nonblock=`$run ./try`
12451 case "$o_nonblock" in
12452 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12453 *) echo "Seems like we can use $o_nonblock.";;
12456 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12459 *) echo "Using $hint value $o_nonblock.";;
12464 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12467 case "$d_fork:$d_pipe" in
12469 $cat head.c > try.c
12470 $cat >>try.c <<EOCP
12472 #include <sys/types.h>
12473 #include <signal.h>
12475 #$i_stdlib I_STDLIB
12477 #include <stdlib.h>
12483 #define MY_O_NONBLOCK $o_nonblock
12484 #ifndef errno /* XXX need better Configure test */
12487 #$i_unistd I_UNISTD
12489 #include <unistd.h>
12491 #$i_string I_STRING
12493 #include <string.h>
12495 #include <strings.h>
12497 $signal_t blech(int x) { exit(3); }
12499 $cat >> try.c <<'EOCP'
12507 pipe(pd); /* Down: child -> parent */
12508 pipe(pu); /* Up: parent -> child */
12511 close(pd[1]); /* Parent reads from pd[0] */
12512 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12514 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12519 signal(SIGALRM, blech);
12521 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12523 sprintf(string, "%d\n", ret);
12524 write(2, string, strlen(string));
12527 if (errno == EAGAIN) {
12528 printf("EAGAIN\n");
12533 if (errno == EWOULDBLOCK)
12534 printf("EWOULDBLOCK\n");
12537 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12538 sleep(2); /* Give it time to close our pipe */
12540 ret = read(pd[0], buf, 1); /* Should read EOF */
12542 sprintf(string, "%d\n", ret);
12543 write(4, string, strlen(string));
12547 close(pd[0]); /* We write to pd[1] */
12548 close(pu[1]); /* We read from pu[0] */
12549 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12550 close(pd[1]); /* Pipe pd is now fully closed! */
12551 exit(0); /* Bye bye, thank you for playing! */
12555 if eval $compile_ok; then
12556 echo "$startsh" >mtry
12557 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12559 ./mtry >/dev/null 2>&1
12561 0) eagain=`$cat try.out`;;
12562 1) echo "Could not perform non-blocking setting!";;
12563 2) echo "I did a successful read() for something that was not there!";;
12564 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12565 4) echo "Could not find F_SETFL!";;
12566 *) echo "Something terribly wrong happened during testing.";;
12568 rd_nodata=`$cat try.ret`
12569 echo "A read() system call with no data present returns $rd_nodata."
12570 case "$rd_nodata" in
12573 echo "(That's peculiar, fixing that to be -1.)"
12579 echo "Forcing errno EAGAIN on read() with no data available."
12583 echo "Your read() sets errno to $eagain when no data is available."
12586 status=`$cat try.err`
12588 0) echo "And it correctly returns 0 to signal EOF.";;
12589 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12590 *) echo "However, your read() returns '$status' on EOF??";;
12593 if test "$status" = "$rd_nodata"; then
12594 echo "WARNING: you can't distinguish between EOF and no data!"
12598 echo "I can't compile the test program--assuming errno EAGAIN will do."
12602 *) echo "Can't figure out how to test this--assuming errno EAGAIN will do."
12611 echo "Using $hint value $eagain."
12612 echo "Your read() returns $rd_nodata when no data is present."
12613 case "$d_eofnblk" in
12614 "$define") echo "And you can see EOF because read() returns 0.";;
12615 "$undef") echo "But you can't see EOF status from read() returned value.";;
12617 echo "(Assuming you can't see EOF status from read anyway.)"
12623 $rm_try head.c mtry
12625 : see if _ptr and _cnt from stdio act std
12628 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12629 echo "(Looks like you have stdio.h from BSD.)"
12630 case "$stdio_ptr" in
12631 '') stdio_ptr='((fp)->_p)'
12634 *) ptr_lval=$d_stdio_ptr_lval;;
12636 case "$stdio_cnt" in
12637 '') stdio_cnt='((fp)->_r)'
12640 *) cnt_lval=$d_stdio_cnt_lval;;
12642 case "$stdio_base" in
12643 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12645 case "$stdio_bufsiz" in
12646 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12648 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12649 echo "(Looks like you have stdio.h from Linux.)"
12650 case "$stdio_ptr" in
12651 '') stdio_ptr='((fp)->_IO_read_ptr)'
12654 *) ptr_lval=$d_stdio_ptr_lval;;
12656 case "$stdio_cnt" in
12657 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12660 *) cnt_lval=$d_stdio_cnt_lval;;
12662 case "$stdio_base" in
12663 '') stdio_base='((fp)->_IO_read_base)';;
12665 case "$stdio_bufsiz" in
12666 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12669 case "$stdio_ptr" in
12670 '') stdio_ptr='((fp)->_ptr)'
12673 *) ptr_lval=$d_stdio_ptr_lval;;
12675 case "$stdio_cnt" in
12676 '') stdio_cnt='((fp)->_cnt)'
12679 *) cnt_lval=$d_stdio_cnt_lval;;
12681 case "$stdio_base" in
12682 '') stdio_base='((fp)->_base)';;
12684 case "$stdio_bufsiz" in
12685 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12689 : test whether _ptr and _cnt really work
12690 echo "Checking how std your stdio is..." >&4
12693 #$i_stdlib I_STDLIB
12695 #include <stdlib.h>
12697 #define FILE_ptr(fp) $stdio_ptr
12698 #define FILE_cnt(fp) $stdio_cnt
12700 FILE *fp = fopen("try.c", "r");
12703 18 <= FILE_cnt(fp) &&
12704 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12712 if eval $compile && $to try.c; then
12713 if $run ./try; then
12714 echo "Your stdio acts pretty std."
12717 echo "Your stdio isn't very std."
12720 echo "Your stdio doesn't appear very std."
12724 # glibc 2.2.90 and above apparently change stdio streams so Perl's
12725 # direct buffer manipulation no longer works. The Configure tests
12726 # should be changed to correctly detect this, but until then,
12727 # the following check should at least let perl compile and run.
12728 # (This quick fix should be updated before 5.8.1.)
12729 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
12730 # A. Dougherty, June 3, 2002.
12731 case "$d_gnulibc" in
12733 case "$gnulibc_version" in
12737 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12746 : Can _ptr be used as an lvalue?
12747 case "$d_stdstdio$ptr_lval" in
12748 $define$define) val=$define ;;
12751 set d_stdio_ptr_lval
12754 : Can _cnt be used as an lvalue?
12755 case "$d_stdstdio$cnt_lval" in
12756 $define$define) val=$define ;;
12759 set d_stdio_cnt_lval
12763 : test whether setting _ptr sets _cnt as a side effect
12764 d_stdio_ptr_lval_sets_cnt="$undef"
12765 d_stdio_ptr_lval_nochange_cnt="$undef"
12766 case "$d_stdio_ptr_lval$d_stdstdio" in
12768 echo "Checking to see what happens if we set the stdio ptr..." >&4
12771 /* Can we scream? */
12772 /* Eat dust sed :-) */
12773 /* In the buffer space, no one can hear you scream. */
12774 #$i_stdlib I_STDLIB
12776 #include <stdlib.h>
12778 #define FILE_ptr(fp) $stdio_ptr
12779 #define FILE_cnt(fp) $stdio_cnt
12780 #include <sys/types.h>
12782 FILE *fp = fopen("try.c", "r");
12787 puts("Fail even to read");
12790 c = getc(fp); /* Read away the first # */
12792 puts("Fail even to read");
12796 18 <= FILE_cnt(fp) &&
12797 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12799 puts("Fail even to read");
12802 ptr = (char*) FILE_ptr(fp);
12803 cnt = (size_t)FILE_cnt(fp);
12805 FILE_ptr(fp) += 42;
12807 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12808 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12811 if (FILE_cnt(fp) <= 20) {
12812 printf ("Fail (<20 chars to test)");
12815 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12816 puts("Fail compare");
12819 if (cnt == FILE_cnt(fp)) {
12820 puts("Pass_unchanged");
12823 if (FILE_cnt(fp) == (cnt - 42)) {
12824 puts("Pass_changed");
12827 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12833 if eval $compile && $to try.c; then
12834 case `$run ./try` in
12836 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12837 d_stdio_ptr_lval_sets_cnt="$define" ;;
12839 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12840 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12842 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12844 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12847 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12853 : see if _base is also standard
12855 case "$d_stdstdio" in
12859 #$i_stdlib I_STDLIB
12861 #include <stdlib.h>
12863 #define FILE_base(fp) $stdio_base
12864 #define FILE_bufsiz(fp) $stdio_bufsiz
12866 FILE *fp = fopen("try.c", "r");
12869 19 <= FILE_bufsiz(fp) &&
12870 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12877 if eval $compile && $to try.c; then
12878 if $run ./try; then
12879 echo "And its _base field acts std."
12882 echo "But its _base field isn't std."
12885 echo "However, it seems to be lacking the _base field."
12893 : see if fast_stdio exists
12895 case "$d_stdstdio:$d_stdio_ptr_lval" in
12897 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12899 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12910 : see if fchdir exists
12911 set fchdir d_fchdir
12914 : see if fchmod exists
12915 set fchmod d_fchmod
12918 : see if fchown exists
12919 set fchown d_fchown
12922 : see if this is an fcntl system
12926 : See if fcntl-based locking works.
12929 #$i_stdlib I_STDLIB
12931 #include <stdlib.h>
12933 #include <unistd.h>
12935 #include <signal.h>
12936 $signal_t blech(int x) { exit(3); }
12938 #if defined(F_SETLK) && defined(F_SETLKW)
12939 struct flock flock;
12941 fd = open("try.c", O_RDONLY);
12942 flock.l_type = F_RDLCK;
12943 flock.l_whence = SEEK_SET;
12944 flock.l_start = flock.l_len = 0;
12945 signal(SIGALRM, blech);
12947 retval = fcntl(fd, F_SETLK, &flock);
12949 (retval < 0 ? exit(2) : exit(0));
12955 echo "Checking if fcntl-based file locking works... "
12959 if eval $compile_ok; then
12960 if $run ./try; then
12961 echo "Yes, it seems to work."
12964 echo "Nope, it didn't work."
12969 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12970 *** This is (almost) impossible.
12971 *** If your NFS lock daemons are not feeling well, something like
12972 *** this may happen, please investigate. Cannot continue, aborting.
12980 echo "I'm unable to compile the test program, so I'll assume not."
12985 echo "Nope, since you don't even have fcntl()."
12988 set d_fcntl_can_lock
12992 : check for fd_set items
12995 Checking to see how well your C compiler handles fd_set and friends ...
12998 #$i_stdlib I_STDLIB
13000 #include <stdlib.h>
13002 #$i_systime I_SYS_TIME
13003 #$i_sysselct I_SYS_SELECT
13004 #$d_socket HAS_SOCKET
13005 #include <sys/types.h>
13007 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
13010 #include <sys/time.h>
13012 #ifdef I_SYS_SELECT
13013 #include <sys/select.h>
13022 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
13030 if eval $compile; then
13031 d_fds_bits="$define"
13033 echo "Well, your system knows about the normal fd_set typedef..." >&4
13034 if $run ./try; then
13035 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
13036 d_fd_macros="$define"
13039 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
13041 d_fd_macros="$undef"
13045 Hmm, your compiler has some difficulty with fd_set. Checking further...
13048 if eval $compile; then
13049 d_fds_bits="$undef"
13051 echo "Well, your system has some sort of fd_set available..." >&4
13052 if $run ./try; then
13053 echo "and you have the normal fd_set macros." >&4
13054 d_fd_macros="$define"
13057 but not the normal fd_set macros! Gross! More work for me...
13059 d_fd_macros="$undef"
13062 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
13064 d_fds_bits="$undef"
13065 d_fd_macros="$undef"
13070 : see if fgetpos exists
13071 set fgetpos d_fgetpos
13074 : see if finite exists
13075 set finite d_finite
13078 : see if finitel exists
13079 set finitel d_finitel
13082 : see if flock exists
13086 : see if prototype for flock is available
13088 set d_flockproto flock $i_sysfile sys/file.h
13091 : see if fp_class exists
13092 set fp_class d_fp_class
13095 : see if pathconf exists
13096 set pathconf d_pathconf
13099 : see if fpathconf exists
13100 set fpathconf d_fpathconf
13103 : see if fpclass exists
13104 set fpclass d_fpclass
13107 : see if fpclassify exists
13108 set fpclassify d_fpclassify
13111 : see if fpclassl exists
13112 set fpclassl d_fpclassl
13115 : check for fpos64_t
13117 echo "Checking to see if you have fpos64_t..." >&4
13120 int main() { fpos64_t x = 7; }
13123 if eval $compile; then
13125 echo "You have fpos64_t."
13128 echo "You do not have fpos64_t."
13129 case "$fpossize" in
13130 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
13137 : see if frexpl exists
13138 set frexpl d_frexpl
13141 : see if this is a sys/param system
13142 set sys/param.h i_sysparam
13145 : see if this is a sys/mount.h system
13146 set sys/mount.h i_sysmount
13149 : Check for fs_data_s
13151 echo "Checking to see if your system supports struct fs_data..." >&4
13152 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
13154 case "$d_fs_data_s" in
13155 "$define") echo "Yes, it does." ;;
13156 *) echo "No, it doesn't." ;;
13159 : see if fseeko exists
13160 set fseeko d_fseeko
13162 case "$longsize" in
13163 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
13166 : see if fsetpos exists
13167 set fsetpos d_fsetpos
13170 : see if fstatfs exists
13171 set fstatfs d_fstatfs
13174 : see if statvfs exists
13175 set statvfs d_statvfs
13178 : see if fstatvfs exists
13179 set fstatvfs d_fstatvfs
13183 : see if fsync exists
13187 : see if ftello exists
13188 set ftello d_ftello
13190 case "$longsize" in
13191 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
13194 : check for a working futimes
13197 echo "Checking if you have a working futimes()" >&4
13200 #include <sys/time.h>
13207 fd = open ("try.c", O_RDWR);
13208 if (-1 == fd) exit (1);
13209 rv = futimes (fd, NULL);
13210 exit (rv == -1 ? errno : 0);
13214 if eval $compile; then
13218 0) echo "Yes, you have" >&4
13219 d_futimes="$define"
13221 *) echo "No, you have futimes, but it isn't working ($rc) (probably harmless)" >&4
13225 echo "No, it does not (probably harmless)" >&4
13229 : see if getcwd exists
13230 set getcwd d_getcwd
13233 : see if getespwnam exists
13234 set getespwnam d_getespwnam
13237 : see if getfsstat exists
13238 set getfsstat d_getfsstat
13241 : see if getgrent exists
13242 set getgrent d_getgrent
13245 : see if getgrent_r exists
13246 set getgrent_r d_getgrent_r
13248 case "$d_getgrent_r" in
13250 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13251 case "$d_getgrent_r_proto:$usethreads" in
13252 ":define") d_getgrent_r_proto=define
13253 set d_getgrent_r_proto getgrent_r $hdrs
13257 case "$d_getgrent_r_proto" in
13259 case "$getgrent_r_proto" in
13260 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
13261 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
13263 case "$getgrent_r_proto" in
13264 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
13265 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
13267 case "$getgrent_r_proto" in
13268 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
13269 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
13271 case "$getgrent_r_proto" in
13272 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
13273 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
13275 case "$getgrent_r_proto" in
13276 ''|0) try='int getgrent_r(struct group*, char*, int);'
13277 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
13279 case "$getgrent_r_proto" in
13280 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
13281 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
13283 case "$getgrent_r_proto" in
13284 ''|0) d_getgrent_r=undef
13286 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
13287 * ) case "$getgrent_r_proto" in
13288 REENTRANT_PROTO*) ;;
13289 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
13291 echo "Prototype: $try" ;;
13294 *) case "$usethreads" in
13295 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
13302 *) getgrent_r_proto=0
13306 : see if getgrgid_r exists
13307 set getgrgid_r d_getgrgid_r
13309 case "$d_getgrgid_r" in
13311 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13312 case "$d_getgrgid_r_proto:$usethreads" in
13313 ":define") d_getgrgid_r_proto=define
13314 set d_getgrgid_r_proto getgrgid_r $hdrs
13318 case "$d_getgrgid_r_proto" in
13320 case "$getgrgid_r_proto" in
13321 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
13322 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
13324 case "$getgrgid_r_proto" in
13325 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
13326 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
13328 case "$getgrgid_r_proto" in
13329 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
13330 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
13332 case "$getgrgid_r_proto" in
13333 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
13334 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
13336 case "$getgrgid_r_proto" in
13337 ''|0) d_getgrgid_r=undef
13339 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
13340 * ) case "$getgrgid_r_proto" in
13341 REENTRANT_PROTO*) ;;
13342 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
13344 echo "Prototype: $try" ;;
13347 *) case "$usethreads" in
13348 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
13355 *) getgrgid_r_proto=0
13359 : see if getgrnam_r exists
13360 set getgrnam_r d_getgrnam_r
13362 case "$d_getgrnam_r" in
13364 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
13365 case "$d_getgrnam_r_proto:$usethreads" in
13366 ":define") d_getgrnam_r_proto=define
13367 set d_getgrnam_r_proto getgrnam_r $hdrs
13371 case "$d_getgrnam_r_proto" in
13373 case "$getgrnam_r_proto" in
13374 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
13375 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
13377 case "$getgrnam_r_proto" in
13378 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
13379 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
13381 case "$getgrnam_r_proto" in
13382 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
13383 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
13385 case "$getgrnam_r_proto" in
13386 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
13387 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
13389 case "$getgrnam_r_proto" in
13390 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
13391 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
13393 case "$getgrnam_r_proto" in
13394 ''|0) d_getgrnam_r=undef
13396 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
13397 * ) case "$getgrnam_r_proto" in
13398 REENTRANT_PROTO*) ;;
13399 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13401 echo "Prototype: $try" ;;
13404 *) case "$usethreads" in
13405 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13412 *) getgrnam_r_proto=0
13416 : see if gethostbyaddr exists
13417 set gethostbyaddr d_gethbyaddr
13420 : see if gethostbyname exists
13421 set gethostbyname d_gethbyname
13424 : see if gethostent exists
13425 set gethostent d_gethent
13428 : see how we will look up host name
13431 if set gethostname val -f d_gethname; eval $csym; $val; then
13432 echo 'gethostname() found.' >&4
13433 d_gethname="$define"
13436 if set uname val -f d_uname; eval $csym; $val; then
13439 uname() was found, but you're running xenix, and older versions of xenix
13440 have a broken uname(). If you don't really know whether your xenix is old
13441 enough to have a broken system call, use the default answer.
13446 "$define") dflt=n;;
13448 rp='Is your uname() broken?'
13451 n*) d_uname="$define"; call=uname;;
13454 echo 'uname() found.' >&4
13461 case "$d_gethname" in
13462 '') d_gethname="$undef";;
13465 '') d_uname="$undef";;
13467 case "$d_uname$d_gethname" in
13472 Every now and then someone has a $call() that lies about the hostname
13473 but can't be fixed for political or economic reasons. If you wish, I can
13474 pretend $call() isn't there and maybe compute hostname at run-time
13475 thanks to the '$phostname' command.
13478 rp="Shall I ignore $call() from now on?"
13481 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13484 case "$phostname" in
13485 '') aphostname='';;
13486 *) case "$aphostname" in
13488 *) set X $phostname
13492 file=`./loc $file $file $pth`
13493 aphostname=`echo $file $*`
13498 case "$d_uname$d_gethname" in
13501 case "$phostname" in
13503 echo "There will be no way for $package to get your hostname." >&4;;
13505 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13509 case "$d_phostname" in
13510 '') d_phostname="$undef";;
13513 : see if gethostbyaddr_r exists
13514 set gethostbyaddr_r d_gethostbyaddr_r
13516 case "$d_gethostbyaddr_r" in
13518 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13519 case "$d_gethostbyaddr_r_proto:$usethreads" in
13520 ":define") d_gethostbyaddr_r_proto=define
13521 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13525 case "$d_gethostbyaddr_r_proto" in
13527 case "$gethostbyaddr_r_proto" in
13528 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13529 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13531 case "$gethostbyaddr_r_proto" in
13532 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13533 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13535 case "$gethostbyaddr_r_proto" in
13536 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13537 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13539 case "$gethostbyaddr_r_proto" in
13540 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13541 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13543 case "$gethostbyaddr_r_proto" in
13544 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13545 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13547 case "$gethostbyaddr_r_proto" in
13548 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13549 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13551 case "$gethostbyaddr_r_proto" in
13552 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13553 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13555 case "$gethostbyaddr_r_proto" in
13556 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13557 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13559 case "$gethostbyaddr_r_proto" in
13560 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13561 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13563 case "$gethostbyaddr_r_proto" in
13564 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13565 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13567 case "$gethostbyaddr_r_proto" in
13568 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13569 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13571 case "$gethostbyaddr_r_proto" in
13572 ''|0) d_gethostbyaddr_r=undef
13573 gethostbyaddr_r_proto=0
13574 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13575 * ) case "$gethostbyaddr_r_proto" in
13576 REENTRANT_PROTO*) ;;
13577 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13579 echo "Prototype: $try" ;;
13582 *) case "$usethreads" in
13583 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13585 d_gethostbyaddr_r=undef
13586 gethostbyaddr_r_proto=0
13590 *) gethostbyaddr_r_proto=0
13594 : see if gethostbyname_r exists
13595 set gethostbyname_r d_gethostbyname_r
13597 case "$d_gethostbyname_r" in
13599 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13600 case "$d_gethostbyname_r_proto:$usethreads" in
13601 ":define") d_gethostbyname_r_proto=define
13602 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13606 case "$d_gethostbyname_r_proto" in
13608 case "$gethostbyname_r_proto" in
13609 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13610 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13612 case "$gethostbyname_r_proto" in
13613 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13614 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13616 case "$gethostbyname_r_proto" in
13617 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13618 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13620 case "$gethostbyname_r_proto" in
13621 ''|0) d_gethostbyname_r=undef
13622 gethostbyname_r_proto=0
13623 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13624 * ) case "$gethostbyname_r_proto" in
13625 REENTRANT_PROTO*) ;;
13626 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13628 echo "Prototype: $try" ;;
13631 *) case "$usethreads" in
13632 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13634 d_gethostbyname_r=undef
13635 gethostbyname_r_proto=0
13639 *) gethostbyname_r_proto=0
13643 : see if gethostent_r exists
13644 set gethostent_r d_gethostent_r
13646 case "$d_gethostent_r" in
13648 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13649 case "$d_gethostent_r_proto:$usethreads" in
13650 ":define") d_gethostent_r_proto=define
13651 set d_gethostent_r_proto gethostent_r $hdrs
13655 case "$d_gethostent_r_proto" in
13657 case "$gethostent_r_proto" in
13658 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13659 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13661 case "$gethostent_r_proto" in
13662 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13663 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13665 case "$gethostent_r_proto" in
13666 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13667 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13669 case "$gethostent_r_proto" in
13670 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13671 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13673 case "$gethostent_r_proto" in
13674 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13675 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13677 case "$gethostent_r_proto" in
13678 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13679 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13681 case "$gethostent_r_proto" in
13682 ''|0) d_gethostent_r=undef
13683 gethostent_r_proto=0
13684 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13685 * ) case "$gethostent_r_proto" in
13686 REENTRANT_PROTO*) ;;
13687 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13689 echo "Prototype: $try" ;;
13692 *) case "$usethreads" in
13693 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13695 d_gethostent_r=undef
13696 gethostent_r_proto=0
13700 *) gethostent_r_proto=0
13704 : see if prototypes for various gethostxxx netdb.h functions are available
13706 set d_gethostprotos gethostent $i_netdb netdb.h
13709 : see if getitimer exists
13710 set getitimer d_getitimer
13713 : see if getlogin exists
13714 set getlogin d_getlogin
13717 : see if getlogin_r exists
13718 set getlogin_r d_getlogin_r
13720 case "$d_getlogin_r" in
13722 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13723 case "$d_getlogin_r_proto:$usethreads" in
13724 ":define") d_getlogin_r_proto=define
13725 set d_getlogin_r_proto getlogin_r $hdrs
13729 case "$d_getlogin_r_proto" in
13731 case "$getlogin_r_proto" in
13732 ''|0) try='int getlogin_r(char*, size_t);'
13733 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13735 case "$getlogin_r_proto" in
13736 ''|0) try='int getlogin_r(char*, int);'
13737 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13739 case "$getlogin_r_proto" in
13740 ''|0) try='char* getlogin_r(char*, size_t);'
13741 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13743 case "$getlogin_r_proto" in
13744 ''|0) try='char* getlogin_r(char*, int);'
13745 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13747 case "$getlogin_r_proto" in
13748 ''|0) d_getlogin_r=undef
13750 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13751 * ) case "$getlogin_r_proto" in
13752 REENTRANT_PROTO*) ;;
13753 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13755 echo "Prototype: $try" ;;
13758 *) case "$usethreads" in
13759 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13766 *) getlogin_r_proto=0
13770 : see if getmnt exists
13771 set getmnt d_getmnt
13774 : see if getmntent exists
13775 set getmntent d_getmntent
13778 : see if getnetbyaddr exists
13779 set getnetbyaddr d_getnbyaddr
13782 : see if getnetbyname exists
13783 set getnetbyname d_getnbyname
13786 : see if getnetent exists
13787 set getnetent d_getnent
13790 : see if getnetbyaddr_r exists
13791 set getnetbyaddr_r d_getnetbyaddr_r
13793 case "$d_getnetbyaddr_r" in
13795 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13796 case "$d_getnetbyaddr_r_proto:$usethreads" in
13797 ":define") d_getnetbyaddr_r_proto=define
13798 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13802 case "$d_getnetbyaddr_r_proto" in
13804 case "$getnetbyaddr_r_proto" in
13805 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13806 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13808 case "$getnetbyaddr_r_proto" in
13809 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13810 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13812 case "$getnetbyaddr_r_proto" in
13813 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13814 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13816 case "$getnetbyaddr_r_proto" in
13817 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13818 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13820 case "$getnetbyaddr_r_proto" in
13821 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13822 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13824 case "$getnetbyaddr_r_proto" in
13825 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13826 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13828 case "$getnetbyaddr_r_proto" in
13829 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13830 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13832 case "$getnetbyaddr_r_proto" in
13833 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13834 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13836 case "$getnetbyaddr_r_proto" in
13837 ''|0) d_getnetbyaddr_r=undef
13838 getnetbyaddr_r_proto=0
13839 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13840 * ) case "$getnetbyaddr_r_proto" in
13841 REENTRANT_PROTO*) ;;
13842 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13844 echo "Prototype: $try" ;;
13847 *) case "$usethreads" in
13848 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13850 d_getnetbyaddr_r=undef
13851 getnetbyaddr_r_proto=0
13855 *) getnetbyaddr_r_proto=0
13859 : see if getnetbyname_r exists
13860 set getnetbyname_r d_getnetbyname_r
13862 case "$d_getnetbyname_r" in
13864 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13865 case "$d_getnetbyname_r_proto:$usethreads" in
13866 ":define") d_getnetbyname_r_proto=define
13867 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13871 case "$d_getnetbyname_r_proto" in
13873 case "$getnetbyname_r_proto" in
13874 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13875 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13877 case "$getnetbyname_r_proto" in
13878 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13879 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13881 case "$getnetbyname_r_proto" in
13882 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13883 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13885 case "$getnetbyname_r_proto" in
13886 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13887 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13889 case "$getnetbyname_r_proto" in
13890 ''|0) d_getnetbyname_r=undef
13891 getnetbyname_r_proto=0
13892 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13893 * ) case "$getnetbyname_r_proto" in
13894 REENTRANT_PROTO*) ;;
13895 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13897 echo "Prototype: $try" ;;
13900 *) case "$usethreads" in
13901 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13903 d_getnetbyname_r=undef
13904 getnetbyname_r_proto=0
13908 *) getnetbyname_r_proto=0
13912 : see if getnetent_r exists
13913 set getnetent_r d_getnetent_r
13915 case "$d_getnetent_r" in
13917 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13918 case "$d_getnetent_r_proto:$usethreads" in
13919 ":define") d_getnetent_r_proto=define
13920 set d_getnetent_r_proto getnetent_r $hdrs
13924 case "$d_getnetent_r_proto" in
13926 case "$getnetent_r_proto" in
13927 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13928 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13930 case "$getnetent_r_proto" in
13931 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13932 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13934 case "$getnetent_r_proto" in
13935 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13936 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13938 case "$getnetent_r_proto" in
13939 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13940 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13942 case "$getnetent_r_proto" in
13943 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13944 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13946 case "$getnetent_r_proto" in
13947 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13948 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13950 case "$getnetent_r_proto" in
13951 ''|0) d_getnetent_r=undef
13952 getnetent_r_proto=0
13953 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13954 * ) case "$getnetent_r_proto" in
13955 REENTRANT_PROTO*) ;;
13956 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13958 echo "Prototype: $try" ;;
13961 *) case "$usethreads" in
13962 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13964 d_getnetent_r=undef
13965 getnetent_r_proto=0
13969 *) getnetent_r_proto=0
13973 : see if prototypes for various getnetxxx netdb.h functions are available
13975 set d_getnetprotos getnetent $i_netdb netdb.h
13978 : see if getpagesize exists
13979 set getpagesize d_getpagsz
13982 : Optional checks for getprotobyname and getprotobynumber
13984 : see if getprotobyname exists
13985 set getprotobyname d_getpbyname
13988 : see if getprotobynumber exists
13989 set getprotobynumber d_getpbynumber
13992 : see if getprotoent exists
13993 set getprotoent d_getpent
13996 : see if getpgid exists
13997 set getpgid d_getpgid
14000 : see if getpgrp2 exists
14001 set getpgrp2 d_getpgrp2
14004 : see if getppid exists
14005 set getppid d_getppid
14008 : see if getpriority exists
14009 set getpriority d_getprior
14012 : see if getprotobyname_r exists
14013 set getprotobyname_r d_getprotobyname_r
14015 case "$d_getprotobyname_r" in
14017 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14018 case "$d_getprotobyname_r_proto:$usethreads" in
14019 ":define") d_getprotobyname_r_proto=define
14020 set d_getprotobyname_r_proto getprotobyname_r $hdrs
14024 case "$d_getprotobyname_r_proto" in
14026 case "$getprotobyname_r_proto" in
14027 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
14028 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
14030 case "$getprotobyname_r_proto" in
14031 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
14032 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
14034 case "$getprotobyname_r_proto" in
14035 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
14036 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
14038 case "$getprotobyname_r_proto" in
14039 ''|0) d_getprotobyname_r=undef
14040 getprotobyname_r_proto=0
14041 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
14042 * ) case "$getprotobyname_r_proto" in
14043 REENTRANT_PROTO*) ;;
14044 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
14046 echo "Prototype: $try" ;;
14049 *) case "$usethreads" in
14050 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
14052 d_getprotobyname_r=undef
14053 getprotobyname_r_proto=0
14057 *) getprotobyname_r_proto=0
14061 : see if getprotobynumber_r exists
14062 set getprotobynumber_r d_getprotobynumber_r
14064 case "$d_getprotobynumber_r" in
14066 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14067 case "$d_getprotobynumber_r_proto:$usethreads" in
14068 ":define") d_getprotobynumber_r_proto=define
14069 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
14073 case "$d_getprotobynumber_r_proto" in
14075 case "$getprotobynumber_r_proto" in
14076 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
14077 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
14079 case "$getprotobynumber_r_proto" in
14080 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
14081 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
14083 case "$getprotobynumber_r_proto" in
14084 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
14085 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
14087 case "$getprotobynumber_r_proto" in
14088 ''|0) d_getprotobynumber_r=undef
14089 getprotobynumber_r_proto=0
14090 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
14091 * ) case "$getprotobynumber_r_proto" in
14092 REENTRANT_PROTO*) ;;
14093 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
14095 echo "Prototype: $try" ;;
14098 *) case "$usethreads" in
14099 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
14101 d_getprotobynumber_r=undef
14102 getprotobynumber_r_proto=0
14106 *) getprotobynumber_r_proto=0
14110 : see if getprotoent_r exists
14111 set getprotoent_r d_getprotoent_r
14113 case "$d_getprotoent_r" in
14115 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14116 case "$d_getprotoent_r_proto:$usethreads" in
14117 ":define") d_getprotoent_r_proto=define
14118 set d_getprotoent_r_proto getprotoent_r $hdrs
14122 case "$d_getprotoent_r_proto" in
14124 case "$getprotoent_r_proto" in
14125 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
14126 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
14128 case "$getprotoent_r_proto" in
14129 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
14130 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
14132 case "$getprotoent_r_proto" in
14133 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
14134 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
14136 case "$getprotoent_r_proto" in
14137 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
14138 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
14140 case "$getprotoent_r_proto" in
14141 ''|0) d_getprotoent_r=undef
14142 getprotoent_r_proto=0
14143 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
14144 * ) case "$getprotoent_r_proto" in
14145 REENTRANT_PROTO*) ;;
14146 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
14148 echo "Prototype: $try" ;;
14151 *) case "$usethreads" in
14152 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
14154 d_getprotoent_r=undef
14155 getprotoent_r_proto=0
14159 *) getprotoent_r_proto=0
14163 : see if prototypes for various getprotoxxx netdb.h functions are available
14165 set d_getprotoprotos getprotoent $i_netdb netdb.h
14168 : see if getprpwnam exists
14169 set getprpwnam d_getprpwnam
14172 : see if getpwent exists
14173 set getpwent d_getpwent
14176 : see if getpwent_r exists
14177 set getpwent_r d_getpwent_r
14179 case "$d_getpwent_r" in
14181 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14182 case "$d_getpwent_r_proto:$usethreads" in
14183 ":define") d_getpwent_r_proto=define
14184 set d_getpwent_r_proto getpwent_r $hdrs
14188 case "$d_getpwent_r_proto" in
14190 case "$getpwent_r_proto" in
14191 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
14192 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
14194 case "$getpwent_r_proto" in
14195 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
14196 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
14198 case "$getpwent_r_proto" in
14199 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
14200 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
14202 case "$getpwent_r_proto" in
14203 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
14204 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
14206 case "$getpwent_r_proto" in
14207 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
14208 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
14210 case "$getpwent_r_proto" in
14211 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
14212 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
14214 case "$getpwent_r_proto" in
14215 ''|0) d_getpwent_r=undef
14217 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
14218 * ) case "$getpwent_r_proto" in
14219 REENTRANT_PROTO*) ;;
14220 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
14222 echo "Prototype: $try" ;;
14225 *) case "$usethreads" in
14226 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
14233 *) getpwent_r_proto=0
14237 : see if getpwnam_r exists
14238 set getpwnam_r d_getpwnam_r
14240 case "$d_getpwnam_r" in
14242 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14243 case "$d_getpwnam_r_proto:$usethreads" in
14244 ":define") d_getpwnam_r_proto=define
14245 set d_getpwnam_r_proto getpwnam_r $hdrs
14249 case "$d_getpwnam_r_proto" in
14251 case "$getpwnam_r_proto" in
14252 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
14253 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
14255 case "$getpwnam_r_proto" in
14256 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
14257 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
14259 case "$getpwnam_r_proto" in
14260 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
14261 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
14263 case "$getpwnam_r_proto" in
14264 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
14265 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
14267 case "$getpwnam_r_proto" in
14268 ''|0) d_getpwnam_r=undef
14270 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
14271 * ) case "$getpwnam_r_proto" in
14272 REENTRANT_PROTO*) ;;
14273 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
14275 echo "Prototype: $try" ;;
14278 *) case "$usethreads" in
14279 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
14286 *) getpwnam_r_proto=0
14290 : see if getpwuid_r exists
14291 set getpwuid_r d_getpwuid_r
14293 case "$d_getpwuid_r" in
14295 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14296 case "$d_getpwuid_r_proto:$usethreads" in
14297 ":define") d_getpwuid_r_proto=define
14298 set d_getpwuid_r_proto getpwuid_r $hdrs
14302 case "$d_getpwuid_r_proto" in
14304 case "$getpwuid_r_proto" in
14305 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
14306 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
14308 case "$getpwuid_r_proto" in
14309 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
14310 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
14312 case "$getpwuid_r_proto" in
14313 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
14314 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
14316 case "$getpwuid_r_proto" in
14317 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
14318 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
14320 case "$getpwuid_r_proto" in
14321 ''|0) d_getpwuid_r=undef
14323 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
14324 * ) case "$getpwuid_r_proto" in
14325 REENTRANT_PROTO*) ;;
14326 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
14328 echo "Prototype: $try" ;;
14331 *) case "$usethreads" in
14332 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
14339 *) getpwuid_r_proto=0
14343 : Optional checks for getsbyname and getsbyport
14345 : see if getservbyname exists
14346 set getservbyname d_getsbyname
14349 : see if getservbyport exists
14350 set getservbyport d_getsbyport
14353 : see if getservent exists
14354 set getservent d_getsent
14357 : see if getservbyname_r exists
14358 set getservbyname_r d_getservbyname_r
14360 case "$d_getservbyname_r" in
14362 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14363 case "$d_getservbyname_r_proto:$usethreads" in
14364 ":define") d_getservbyname_r_proto=define
14365 set d_getservbyname_r_proto getservbyname_r $hdrs
14369 case "$d_getservbyname_r_proto" in
14371 case "$getservbyname_r_proto" in
14372 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
14373 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
14375 case "$getservbyname_r_proto" in
14376 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
14377 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
14379 case "$getservbyname_r_proto" in
14380 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
14381 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
14383 case "$getservbyname_r_proto" in
14384 ''|0) d_getservbyname_r=undef
14385 getservbyname_r_proto=0
14386 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
14387 * ) case "$getservbyname_r_proto" in
14388 REENTRANT_PROTO*) ;;
14389 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
14391 echo "Prototype: $try" ;;
14394 *) case "$usethreads" in
14395 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
14397 d_getservbyname_r=undef
14398 getservbyname_r_proto=0
14402 *) getservbyname_r_proto=0
14406 : see if getservbyport_r exists
14407 set getservbyport_r d_getservbyport_r
14409 case "$d_getservbyport_r" in
14411 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14412 case "$d_getservbyport_r_proto:$usethreads" in
14413 ":define") d_getservbyport_r_proto=define
14414 set d_getservbyport_r_proto getservbyport_r $hdrs
14418 case "$d_getservbyport_r_proto" in
14420 case "$getservbyport_r_proto" in
14421 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14422 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14424 case "$getservbyport_r_proto" in
14425 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14426 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14428 case "$getservbyport_r_proto" in
14429 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14430 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14432 case "$getservbyport_r_proto" in
14433 ''|0) d_getservbyport_r=undef
14434 getservbyport_r_proto=0
14435 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14436 * ) case "$getservbyport_r_proto" in
14437 REENTRANT_PROTO*) ;;
14438 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14440 echo "Prototype: $try" ;;
14443 *) case "$usethreads" in
14444 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14446 d_getservbyport_r=undef
14447 getservbyport_r_proto=0
14451 *) getservbyport_r_proto=0
14455 : see if getservent_r exists
14456 set getservent_r d_getservent_r
14458 case "$d_getservent_r" in
14460 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14461 case "$d_getservent_r_proto:$usethreads" in
14462 ":define") d_getservent_r_proto=define
14463 set d_getservent_r_proto getservent_r $hdrs
14467 case "$d_getservent_r_proto" in
14469 case "$getservent_r_proto" in
14470 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14471 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14473 case "$getservent_r_proto" in
14474 ''|0) try='int getservent_r(struct servent*, char*, int);'
14475 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14477 case "$getservent_r_proto" in
14478 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14479 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14481 case "$getservent_r_proto" in
14482 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14483 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14485 case "$getservent_r_proto" in
14486 ''|0) d_getservent_r=undef
14487 getservent_r_proto=0
14488 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14489 * ) case "$getservent_r_proto" in
14490 REENTRANT_PROTO*) ;;
14491 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14493 echo "Prototype: $try" ;;
14496 *) case "$usethreads" in
14497 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14499 d_getservent_r=undef
14500 getservent_r_proto=0
14504 *) getservent_r_proto=0
14508 : see if prototypes for various getservxxx netdb.h functions are available
14510 set d_getservprotos getservent $i_netdb netdb.h
14513 : see if getspnam exists
14514 set getspnam d_getspnam
14517 : see if this is a shadow.h system
14518 set shadow.h i_shadow
14521 : see if getspnam_r exists
14522 set getspnam_r d_getspnam_r
14524 case "$d_getspnam_r" in
14526 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14527 case "$d_getspnam_r_proto:$usethreads" in
14528 ":define") d_getspnam_r_proto=define
14529 set d_getspnam_r_proto getspnam_r $hdrs
14533 case "$d_getspnam_r_proto" in
14535 case "$getspnam_r_proto" in
14536 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14537 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14539 case "$getspnam_r_proto" in
14540 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14541 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14543 case "$getspnam_r_proto" in
14544 ''|0) d_getspnam_r=undef
14546 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14547 * ) case "$getspnam_r_proto" in
14548 REENTRANT_PROTO*) ;;
14549 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14551 echo "Prototype: $try" ;;
14554 *) case "$usethreads" in
14555 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14562 *) getspnam_r_proto=0
14566 : see if gettimeofday or ftime exists
14567 set gettimeofday d_gettimeod
14569 case "$d_gettimeod" in
14575 val="$undef"; set d_ftime; eval $setvar
14578 case "$d_gettimeod$d_ftime" in
14581 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14585 : see if gmtime_r exists
14586 set gmtime_r d_gmtime_r
14588 case "$d_gmtime_r" in
14590 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14591 case "$d_gmtime_r_proto:$usethreads" in
14592 ":define") d_gmtime_r_proto=define
14593 set d_gmtime_r_proto gmtime_r $hdrs
14597 case "$d_gmtime_r_proto" in
14599 case "$gmtime_r_proto" in
14600 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14601 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14603 case "$gmtime_r_proto" in
14604 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14605 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14607 case "$gmtime_r_proto" in
14608 ''|0) d_gmtime_r=undef
14610 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14611 * ) case "$gmtime_r_proto" in
14612 REENTRANT_PROTO*) ;;
14613 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14615 echo "Prototype: $try" ;;
14618 *) case "$usethreads" in
14619 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14626 *) gmtime_r_proto=0
14630 : see if hasmntopt exists
14631 set hasmntopt d_hasmntopt
14634 : see if this is a netinet/in.h or sys/in.h system
14635 set netinet/in.h i_niin sys/in.h i_sysin
14638 : see if arpa/inet.h has to be included
14639 set arpa/inet.h i_arpainet
14642 : see if htonl --and friends-- exists
14647 : Maybe they are macros.
14650 $cat >htonl.c <<EOM
14652 #include <sys/types.h>
14653 #$i_niin I_NETINET_IN
14655 #$i_arpainet I_ARPA_INET
14656 #ifdef I_NETINET_IN
14657 #include <netinet/in.h>
14660 #include <sys/in.h>
14663 #include <arpa/inet.h>
14666 printf("Defined as a macro.");
14669 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14670 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14672 echo "But it seems to be defined as a macro." >&4
14680 : see if ilogbl exists
14681 set ilogbl d_ilogbl
14686 if set index val -f; eval $csym; $val; then
14687 if set strchr val -f d_strchr; eval $csym; $val; then
14688 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14691 echo "strchr() found." >&4
14695 echo "index() found." >&4
14700 echo "index() found." >&4
14703 if set strchr val -f d_strchr; eval $csym; $val; then
14706 echo "strchr() found." >&4
14708 echo "No index() or strchr() found!" >&4
14713 set d_strchr; eval $setvar
14715 set d_index; eval $setvar
14717 : check whether inet_aton exists
14718 set inet_aton d_inetaton
14723 $cat >isascii.c <<EOCP
14726 #$i_stdlib I_STDLIB
14728 #include <stdlib.h>
14739 if eval $compile; then
14740 echo "isascii() found." >&4
14743 echo "isascii() NOT found." >&4
14750 : see if isfinite exists
14751 set isfinite d_isfinite
14754 : see if isinf exists
14758 : see if isnan exists
14762 : see if isnanl exists
14763 set isnanl d_isnanl
14766 : see if killpg exists
14767 set killpg d_killpg
14770 : see if lchown exists
14772 $cat > try.c <<'EOCP'
14773 /* System header to define __stub macros and hopefully few prototypes,
14774 which can conflict with char lchown(); below. */
14775 #include <assert.h>
14776 /* Override any gcc2 internal prototype to avoid an error. */
14777 /* We use char because int might match the return type of a gcc2
14778 builtin and then its argument prototype would still apply. */
14781 /* The GNU C library defines this for functions which it implements
14782 to always fail with ENOSYS. Some functions are actually named
14783 something starting with __ and the normal name is an alias. */
14784 #if defined (__stub_lchown) || defined (__stub___lchown)
14792 if eval $compile; then
14793 $echo "lchown() found." >&4
14796 $echo "lchown() NOT found." >&4
14802 : See if number of significant digits in a double precision number is known
14804 $cat >ldbl_dig.c <<EOM
14805 #$i_limits I_LIMITS
14808 #include <limits.h>
14814 printf("Contains LDBL_DIG");
14817 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14818 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14819 echo "LDBL_DIG found." >&4
14822 echo "LDBL_DIG NOT found." >&4
14829 : see if this is a math.h system
14833 : check to see if math.h defines _LIB_VERSION
14834 d_libm_lib_version="$undef"
14838 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14840 #include <unistd.h>
14842 int main (int argc, char *argv[])
14844 printf ("%d\n", _LIB_VERSION);
14849 if eval $compile; then
14851 echo "Yes, it does ($foo)" >&4
14852 d_libm_lib_version="$define"
14854 echo "No, it does not (probably harmless)" >&4
14861 : see if link exists
14865 : see if localtime_r exists
14866 set localtime_r d_localtime_r
14868 case "$d_localtime_r" in
14870 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14871 case "$d_localtime_r_proto:$usethreads" in
14872 ":define") d_localtime_r_proto=define
14873 set d_localtime_r_proto localtime_r $hdrs
14877 case "$d_localtime_r_proto" in
14879 case "$localtime_r_proto" in
14880 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14881 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14883 case "$localtime_r_proto" in
14884 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14885 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14887 case "$localtime_r_proto" in
14888 ''|0) d_localtime_r=undef
14889 localtime_r_proto=0
14890 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14891 * ) case "$localtime_r_proto" in
14892 REENTRANT_PROTO*) ;;
14893 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14895 echo "Prototype: $try" ;;
14898 *) case "$usethreads" in
14899 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14901 d_localtime_r=undef
14902 localtime_r_proto=0
14906 *) localtime_r_proto=0
14910 : see if localtime_r calls tzset
14911 case "$localtime_r_proto" in
14914 /* Does our libc's localtime_r call tzset ?
14915 * return 0 if so, 1 otherwise.
14917 #include <sys/types.h>
14918 #include <unistd.h>
14920 #include <string.h>
14921 #include <malloc.h>
14924 time_t t = time(0L);
14925 char w_tz[]="TZ" "=GMT+5",
14926 e_tz[]="TZ" "=GMT-5",
14927 *tz_e = (char*)malloc(16),
14928 *tz_w = (char*)malloc(16);
14929 struct tm tm_e, tm_w;
14930 memset(&tm_e,'\0',sizeof(struct tm));
14931 memset(&tm_w,'\0',sizeof(struct tm));
14936 localtime_r(&t, &tm_e);
14939 localtime_r(&t, &tm_w);
14941 if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
14947 if eval $compile; then
14948 if $run ./try; then
14949 d_localtime_r_needs_tzset=undef;
14951 d_localtime_r_needs_tzset=define;
14954 d_localtime_r_needs_tzset=undef;
14958 d_localtime_r_needs_tzset=undef;
14963 : see if localeconv exists
14964 set localeconv d_locconv
14967 : see if lockf exists
14971 : see if prototype for lseek is available
14973 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14976 : see if lstat exists
14980 : see if madvise exists
14981 set madvise d_madvise
14984 : see if malloc_size exists
14985 set malloc_size d_malloc_size
14988 : see if malloc_size_good exists
14989 set malloc_good_size d_malloc_good_size
14992 : see if mblen exists
14996 : see if mbstowcs exists
14997 set mbstowcs d_mbstowcs
15000 : see if mbtowc exists
15001 set mbtowc d_mbtowc
15004 : see if memchr exists
15005 set memchr d_memchr
15008 : see if memcmp exists
15009 set memcmp d_memcmp
15012 : see if memcpy exists
15013 set memcpy d_memcpy
15016 : see if memmove exists
15017 set memmove d_memmove
15020 : see if memset exists
15021 set memset d_memset
15024 : see if mkdir exists
15028 : see if mkdtemp exists
15029 set mkdtemp d_mkdtemp
15032 : see if mkfifo exists
15033 set mkfifo d_mkfifo
15036 : see if mkstemp exists
15037 set mkstemp d_mkstemp
15040 : see if mkstemps exists
15041 set mkstemps d_mkstemps
15044 : see if mktime exists
15045 set mktime d_mktime
15048 : see if this is a sys/mman.h system
15049 set sys/mman.h i_sysmman
15052 : see if mmap exists
15055 : see what shmat returns
15056 : default to something harmless
15058 case "$i_sysmman$d_mmap" in
15060 $cat >mmap.c <<'END'
15061 #include <sys/mman.h>
15064 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
15069 echo "and it returns ($mmaptype)." >&4
15075 : see if sqrtl exists
15079 : see if scalbnl exists
15080 set scalbnl d_scalbnl
15083 : see if modfl exists
15087 : see if prototype for modfl is available
15089 set d_modflproto modfl $i_math math.h
15092 d_modfl_pow32_bug="$undef"
15094 case "$d_longdbl$d_modfl" in
15097 Checking to see whether your modfl() is okay for large values...
15103 if $test "X$d_modflproto" != "X$define"; then
15104 $cat >>try.c <<EOCP
15105 /* Sigh. many current glibcs provide the function, but do not prototype it. */
15106 long double modfl (long double, long double *);
15109 $cat >>try.c <<EOCP
15111 long double nv = 4294967303.15;
15117 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
15121 case "$osname:$gccversion" in
15122 aix:) saveccflags="$ccflags"
15123 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
15126 if eval $compile; then
15129 *" 4294967303.150000 1.150000 4294967302.000000")
15130 echo >&4 "Your modfl() is broken for large values."
15131 d_modfl_pow32_bug="$define"
15133 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
15137 *" 4294967303.150000 0.150000 4294967303.000000")
15138 echo >&4 "Your modfl() seems okay for large values."
15140 *) echo >&4 "I don't understand your modfl() at all."
15146 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
15149 case "$osname:$gccversion" in
15150 aix:) ccflags="$saveccflags" ;; # restore
15155 if $test "$uselongdouble" = "$define"; then
15157 if $test "$d_sqrtl" != "$define"; then
15158 message="$message sqrtl"
15160 if $test "$d_modfl" != "$define"; then
15161 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
15162 echo "You have both aintl and copysignl, so I can emulate modfl."
15164 message="$message modfl"
15167 if $test "$d_frexpl" != "$define"; then
15168 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
15169 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
15171 message="$message frexpl"
15175 if $test "$message" != ""; then
15178 *** You requested the use of long doubles but you do not seem to have
15179 *** the following mathematical functions needed for long double support:
15181 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
15182 *** Cannot continue, aborting.
15190 : see if mprotect exists
15191 set mprotect d_mprotect
15194 : see if msgctl exists
15195 set msgctl d_msgctl
15198 : see if msgget exists
15199 set msgget d_msgget
15202 : see if msgsnd exists
15203 set msgsnd d_msgsnd
15206 : see if msgrcv exists
15207 set msgrcv d_msgrcv
15210 : see how much of the 'msg*(2)' library is present.
15213 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
15214 *"$undef"*) h_msg=false;;
15218 case "`ipcs 2>&1`" in
15219 "SVID messages"*"not configured"*)
15220 echo "Your $osname does not have the msg*(2) configured." >&4
15223 set msgctl d_msgctl
15225 set msgget d_msgget
15227 set msgsnd d_msgsnd
15229 set msgrcv d_msgrcv
15235 : we could also check for sys/ipc.h ...
15236 if $h_msg && $test `./findhdr sys/msg.h`; then
15237 echo "You have the full msg*(2) library." >&4
15240 echo "You don't have the full msg*(2) library." >&4
15246 : Check for msghdr_s
15248 echo "Checking to see if your system supports struct msghdr..." >&4
15249 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
15251 case "$d_msghdr_s" in
15252 "$define") echo "Yes, it does." ;;
15253 *) echo "No, it doesn't." ;;
15257 : see if msync exists
15261 : see if munmap exists
15262 set munmap d_munmap
15265 : see if nice exists
15269 : see if this is a langinfo.h system
15270 set langinfo.h i_langinfo
15273 : see if nl_langinfo exists
15274 set nl_langinfo d_nl_langinfo
15277 : check for volatile keyword
15279 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
15280 $cat >try.c <<'EOCP'
15283 typedef struct _goo_struct goo_struct;
15284 goo_struct * volatile goo = ((goo_struct *)0);
15285 struct _goo_struct {
15290 typedef unsigned short foo_t;
15291 char *volatile foo;
15293 volatile foo_t blech;
15297 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
15299 echo "Yup, it does."
15302 echo "Nope, it doesn't."
15308 : Check basic sizes
15310 $echo "Choosing the C types to be used for Perl's internal types..." >&4
15312 case "$use64bitint:$d_quad:$quadtype" in
15315 uvtype="$uquadtype"
15320 uvtype="unsigned long"
15326 case "$uselongdouble:$d_longdbl" in
15328 nvtype="long double"
15329 nvsize=$longdblsize
15336 $echo "(IV will be "$ivtype", $ivsize bytes)"
15337 $echo "(UV will be "$uvtype", $uvsize bytes)"
15338 $echo "(NV will be "$nvtype", $nvsize bytes)"
15341 #$i_inttypes I_INTTYPES
15343 #include <inttypes.h>
15348 int8_t i = INT8_MAX;
15349 uint8_t u = UINT8_MAX;
15350 printf("int8_t\n");
15353 int16_t i = INT16_MAX;
15354 uint16_t i = UINT16_MAX;
15355 printf("int16_t\n");
15358 int32_t i = INT32_MAX;
15359 uint32_t u = UINT32_MAX;
15360 printf("int32_t\n");
15365 i8type="signed char"
15366 u8type="unsigned char"
15371 '') case "$shortsize" in
15373 u16type="unsigned short"
15381 '') set try -DINT16
15382 if eval $compile; then
15383 case "`$run ./try`" in
15395 '') if $test $shortsize -ge 2; then
15397 u16type="unsigned short"
15405 '') case "$longsize" in
15407 u32type="unsigned long"
15411 *) case "$intsize" in
15413 u32type="unsigned int"
15423 '') set try -DINT32
15424 if eval $compile; then
15425 case "`$run ./try`" in
15437 '') if $test $intsize -ge 4; then
15439 u32type="unsigned int"
15447 '') case "$d_quad:$quadtype" in
15449 i64type="$quadtype"
15450 u64type="$uquadtype"
15458 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15459 : volatile so that the compiler has to store it out to memory.
15460 if test X"$d_volatile" = X"$define"; then
15465 #$i_stdlib I_STDLIB
15467 #include <stdlib.h>
15469 #include <sys/types.h>
15470 #include <signal.h>
15472 $volatile int bletched = 0;
15473 $signal_t blech(int s) { bletched = 1; }
15478 int n = 8 * $uvsize;
15481 signal(SIGFPE, blech);
15484 for (i = 0; i < n; i++) {
15485 u = u << 1 | ($uvtype)1;
15487 if (($uvtype)d != u)
15491 d = ($nvtype)(u - 1);
15492 if (($uvtype)d != (u - 1))
15499 printf("%d\n", ((i == n) ? -n : i));
15505 d_nv_preserves_uv="$undef"
15506 if eval $compile; then
15507 nv_preserves_uv_bits="`$run ./try`"
15509 case "$nv_preserves_uv_bits" in
15511 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15512 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15513 d_nv_preserves_uv="$define"
15515 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15516 d_nv_preserves_uv="$undef" ;;
15517 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15518 nv_preserves_uv_bits="0" ;;
15522 $echo "Checking to find the largest integer value your NVs can hold..." >&4
15523 : volatile so that the compiler has to store it out to memory.
15524 if test X"$d_volatile" = X"$define"; then
15530 typedef $nvtype NV;
15537 while(count < 256) {
15538 $volatile NV up = value + 1.0;
15539 $volatile NV negated = -value;
15540 $volatile NV down = negated - 1.0;
15541 $volatile NV got_up = up - value;
15542 int up_good = got_up == 1.0;
15543 int got_down = down - negated;
15544 int down_good = got_down == -1.0;
15546 if (down_good != up_good) {
15548 "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
15549 up_good, (double) got_up, down_good, (double) got_down,
15550 count, (double) value);
15557 fputs("256.0", stdout);
15560 fputs("2.0", stdout);
15566 fputs("*", stdout);
15572 fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
15573 count, (double) value);
15579 nv_overflows_integers_at='0'
15580 if eval $compile; then
15586 The largest integer your NVs can preserve is equal to $xxx
15588 nv_overflows_integers_at="$xxx"
15591 Cannot determine the largest integer value your NVs can hold, unexpected output
15598 Cannot determine the largest integer value your NVs can hold
15605 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15606 : volatile so that the compiler has to store it out to memory.
15607 if test X"$d_volatile" = X"$define"; then
15612 #$i_stdlib I_STDLIB
15614 #include <stdlib.h>
15616 #$i_string I_STRING
15618 # include <string.h>
15620 # include <strings.h>
15622 #include <sys/types.h>
15623 #include <signal.h>
15625 $volatile int bletched = 0;
15626 $signal_t blech(int s) { bletched = 1; }
15629 int checkit($nvtype d, char *where) {
15630 unsigned char *p = (char *)&d;
15631 unsigned char *end = p + sizeof(d);
15641 printf("No - %s: 0x", where);
15643 printf ("%02X", *p++);
15648 int main(int argc, char **argv) {
15651 fail += checkit(d, "0.0");
15653 /* The compiler shouldn't be assuming that bletched is 0 */
15656 fail += checkit(d, "bleched");
15659 signal(SIGFPE, blech);
15662 /* Paranoia - the compiler should have no way of knowing that ANSI says
15663 that argv[argc] will always be NULL. Actually, if it did assume this it
15664 would be buggy, as this is C and main() can be called from elsewhere in
15666 d = argv[argc] ? 1 : 0;
15669 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15672 fail += checkit(d, "ternary");
15674 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15677 printf("No - memset doesn't give 0.0\n");
15678 /* This might just blow up: */
15679 printf("(gives %g)\n", d);
15685 printf("No - something bleched\n");
15690 printf("No - %d fail(s)\n", fail);
15699 d_nv_zero_is_allbits_zero="$undef"
15700 if eval $compile; then
15706 0.0 is represented as all bits zero in memory
15708 d_nv_zero_is_allbits_zero="$define"
15711 0.0 is not represented as all bits zero in memory
15713 d_nv_zero_is_allbits_zero="$undef"
15718 0.0 is not represented as all bits zero in memory
15720 d_nv_zero_is_allbits_zero="$undef"
15726 : check for off64_t
15728 echo "Checking to see if you have off64_t..." >&4
15730 #include <sys/types.h>
15731 #include <unistd.h>
15732 int main() { off64_t x = 7; }
15735 if eval $compile; then
15737 echo "You have off64_t."
15740 echo "You do not have off64_t."
15741 case "$lseeksize" in
15742 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15749 : how to create joinable pthreads
15750 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15752 echo "Checking what constant to use for creating joinable pthreads..." >&4
15753 $cat >try.c <<'EOCP'
15754 #include <pthread.h>
15756 int detachstate = JOINABLE;
15759 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15760 if eval $compile; then
15761 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15762 val="$undef" # Yes, undef.
15763 set d_old_pthread_create_joinable
15766 set old_pthread_create_joinable
15769 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15770 if eval $compile; then
15771 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15773 set d_old_pthread_create_joinable
15775 val=PTHREAD_CREATE_UNDETACHED
15776 set old_pthread_create_joinable
15779 set try -DJOINABLE=__UNDETACHED
15780 if eval $compile; then
15781 echo "You seem to use __UNDETACHED." >&4
15783 set d_old_pthread_create_joinable
15786 set old_pthread_create_joinable
15789 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15791 set d_old_pthread_create_joinable
15794 set old_pthread_create_joinable
15801 d_old_pthread_create_joinable="$undef"
15802 old_pthread_create_joinable=""
15805 : see if pause exists
15809 : see if poll exists
15813 : see if readlink exists
15814 set readlink d_readlink
15817 : Check if exe is symlink to abs path of executing program
15821 case "$d_readlink" in
15823 if $issymlink /proc/self/exe ; then
15824 $ls -l /proc/self/exe > reflect
15825 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15826 echo "You have Linux-like /proc/self/exe."
15827 procselfexe='"/proc/self/exe"'
15831 if $issymlink /proc/curproc/file ; then
15832 $ls -l /proc/curproc/file > reflect
15833 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15834 echo "You have BSD-like /proc/curproc/file."
15835 procselfexe='"/proc/curproc/file"'
15845 : backward compatibility for d_hvfork
15846 if test X$d_hvfork != X; then
15847 d_vfork="$d_hvfork"
15850 : see if there is a vfork
15855 d_pseudofork=$undef
15857 : Ok, but do we want to use it. vfork is reportedly unreliable in
15858 : perl on Solaris 2.x, and probably elsewhere.
15862 case "$usevfork" in
15868 Perl can only use a vfork() that doesn't suffer from strict
15869 restrictions on calling functions or modifying global data in
15870 the child. For example, glibc-2.1 contains such a vfork()
15871 that is unsuitable. If your system provides a proper fork()
15872 call, chances are that you do NOT want perl to use vfork().
15875 rp="Do you still want to use vfork()?"
15880 echo "Ok, we won't use vfork()."
15889 $define) usevfork='true';;
15890 *) usevfork='false';;
15893 : see whether the pthread_atfork exists
15895 #include <pthread.h>
15898 #ifdef PTHREAD_ATFORK
15899 pthread_atfork(NULL,NULL,NULL);
15904 : see if pthread_atfork exists
15905 set try -DPTHREAD_ATFORK
15906 if eval $compile; then
15911 case "$usethreads" in
15914 $define) echo 'pthread_atfork found.' >&4 ;;
15915 *) echo 'pthread_atfork NOT found.' >&4 ;;
15918 set d_pthread_atfork
15921 : see if pthread_attr_setscope exists
15922 set pthread_attr_setscope d_pthread_attr_setscope
15925 : see whether the various POSIXish _yields exist
15927 #include <pthread.h>
15933 #ifdef PTHREAD_YIELD
15936 #ifdef PTHREAD_YIELD_NULL
15937 pthread_yield(NULL);
15943 : see if sched_yield exists
15944 set try -DSCHED_YIELD
15945 if eval $compile; then
15947 sched_yield='sched_yield()'
15951 case "$usethreads" in
15954 $define) echo 'sched_yield() found.' >&4 ;;
15955 *) echo 'sched_yield() NOT found.' >&4 ;;
15961 : see if pthread_yield exists
15962 set try -DPTHREAD_YIELD
15963 if eval $compile; then
15965 case "$sched_yield" in
15966 '') sched_yield='pthread_yield()' ;;
15969 set try -DPTHREAD_YIELD_NULL
15970 if eval $compile; then
15972 case "$sched_yield" in
15973 '') sched_yield='pthread_yield(NULL)' ;;
15979 case "$usethreads" in
15982 $define) echo 'pthread_yield() found.' >&4 ;;
15983 *) echo 'pthread_yield() NOT found.' >&4 ;;
15987 set d_pthread_yield
15989 case "$sched_yield" in
15990 '') sched_yield=undef ;;
15994 : see if random_r exists
15995 set random_r d_random_r
15997 case "$d_random_r" in
15999 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16000 case "$d_random_r_proto:$usethreads" in
16001 ":define") d_random_r_proto=define
16002 set d_random_r_proto random_r $hdrs
16006 case "$d_random_r_proto" in
16008 case "$random_r_proto" in
16009 ''|0) try='int random_r(int*, struct random_data*);'
16010 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
16012 case "$random_r_proto" in
16013 ''|0) try='int random_r(long*, struct random_data*);'
16014 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
16016 case "$random_r_proto" in
16017 ''|0) try='int random_r(struct random_data*, int32_t*);'
16018 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
16020 case "$random_r_proto" in
16021 ''|0) d_random_r=undef
16023 echo "Disabling random_r, cannot determine prototype." >&4 ;;
16024 * ) case "$random_r_proto" in
16025 REENTRANT_PROTO*) ;;
16026 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
16028 echo "Prototype: $try" ;;
16031 *) case "$usethreads" in
16032 define) echo "random_r has no prototype, not using it." >&4 ;;
16039 *) random_r_proto=0
16043 : see if readdir and friends exist
16044 set readdir d_readdir
16046 set seekdir d_seekdir
16048 set telldir d_telldir
16050 set rewinddir d_rewinddir
16053 : see if readdir64_r exists
16054 set readdir64_r d_readdir64_r
16056 case "$d_readdir64_r" in
16058 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16059 case "$d_readdir64_r_proto:$usethreads" in
16060 ":define") d_readdir64_r_proto=define
16061 set d_readdir64_r_proto readdir64_r $hdrs
16065 case "$d_readdir64_r_proto" in
16067 case "$readdir64_r_proto" in
16068 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
16069 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
16071 case "$readdir64_r_proto" in
16072 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
16073 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
16075 case "$readdir64_r_proto" in
16076 ''|0) d_readdir64_r=undef
16077 readdir64_r_proto=0
16078 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
16079 * ) case "$readdir64_r_proto" in
16080 REENTRANT_PROTO*) ;;
16081 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
16083 echo "Prototype: $try" ;;
16086 *) case "$usethreads" in
16087 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
16089 d_readdir64_r=undef
16090 readdir64_r_proto=0
16094 *) readdir64_r_proto=0
16098 : see if readdir_r exists
16099 set readdir_r d_readdir_r
16101 case "$d_readdir_r" in
16103 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
16104 case "$d_readdir_r_proto:$usethreads" in
16105 ":define") d_readdir_r_proto=define
16106 set d_readdir_r_proto readdir_r $hdrs
16110 case "$d_readdir_r_proto" in
16112 case "$readdir_r_proto" in
16113 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
16114 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
16116 case "$readdir_r_proto" in
16117 ''|0) try='int readdir_r(DIR*, struct dirent*);'
16118 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
16120 case "$readdir_r_proto" in
16121 ''|0) d_readdir_r=undef
16123 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
16124 * ) case "$readdir_r_proto" in
16125 REENTRANT_PROTO*) ;;
16126 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
16128 echo "Prototype: $try" ;;
16131 *) case "$usethreads" in
16132 define) echo "readdir_r has no prototype, not using it." >&4 ;;
16139 *) readdir_r_proto=0
16143 : see if readv exists
16147 : see if recvmsg exists
16148 set recvmsg d_recvmsg
16151 : see if rename exists
16152 set rename d_rename
16155 : see if rmdir exists
16159 : see if memory.h is available.
16164 : See if it conflicts with string.h
16170 $cppstdin $cppflags $cppminus < $strings > mem.h
16171 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
16173 echo "We won't be including <memory.h>."
16183 : can bcopy handle overlapping blocks?
16186 case "$d_memmove" in
16187 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
16188 *) case "$d_bcopy" in
16190 echo "Checking to see if bcopy() can do overlapping copies..." >&4
16192 #$i_memory I_MEMORY
16193 #$i_stdlib I_STDLIB
16194 #$i_string I_STRING
16195 #$i_unistd I_UNISTD
16197 $cat >>try.c <<'EOCP'
16200 # include <memory.h>
16203 # include <stdlib.h>
16206 # include <string.h>
16208 # include <strings.h>
16211 # include <unistd.h> /* Needed for NetBSD */
16215 char buf[128], abc[128];
16221 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16222 try to store the string in read-only memory. */
16223 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
16225 for (align = 7; align >= 0; align--) {
16226 for (len = 36; len; len--) {
16228 bcopy(abc, b, len);
16229 for (off = 1; off <= len; off++) {
16230 bcopy(b, b+off, len);
16231 bcopy(b+off, b, len);
16232 if (bcmp(b, abc, len))
16241 if eval $compile_ok; then
16242 if $run ./try 2>/dev/null; then
16243 echo "Yes, it can."
16246 echo "It can't, sorry."
16249 echo "(I can't compile the test program, so we'll assume not...)"
16259 : can memcpy handle overlapping blocks?
16262 case "$d_memmove" in
16263 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
16264 *) case "$d_memcpy" in
16266 echo "Checking to see if memcpy() can do overlapping copies..." >&4
16268 #$i_memory I_MEMORY
16269 #$i_stdlib I_STDLIB
16270 #$i_string I_STRING
16271 #$i_unistd I_UNISTD
16273 $cat >>try.c <<'EOCP'
16276 # include <memory.h>
16279 # include <stdlib.h>
16282 # include <string.h>
16284 # include <strings.h>
16287 # include <unistd.h> /* Needed for NetBSD */
16291 char buf[128], abc[128];
16297 /* Copy "abcde..." string to char abc[] so that gcc doesn't
16298 try to store the string in read-only memory. */
16299 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
16301 for (align = 7; align >= 0; align--) {
16302 for (len = 36; len; len--) {
16304 memcpy(b, abc, len);
16305 for (off = 1; off <= len; off++) {
16306 memcpy(b+off, b, len);
16307 memcpy(b, b+off, len);
16308 if (memcmp(b, abc, len))
16317 if eval $compile_ok; then
16318 if $run ./try 2>/dev/null; then
16319 echo "Yes, it can."
16322 echo "It can't, sorry."
16325 echo "(I can't compile the test program, so we'll assume not...)"
16335 : can memcmp be trusted to compare relative magnitude?
16337 case "$d_memcmp" in
16340 echo "Checking if your memcmp() can compare relative magnitude..." >&4
16342 #$i_memory I_MEMORY
16343 #$i_stdlib I_STDLIB
16344 #$i_string I_STRING
16345 #$i_unistd I_UNISTD
16347 $cat >>try.c <<'EOCP'
16350 # include <memory.h>
16353 # include <stdlib.h>
16356 # include <string.h>
16358 # include <strings.h>
16361 # include <unistd.h> /* Needed for NetBSD */
16367 if ((a < b) && memcmp(&a, &b, 1) < 0)
16373 if eval $compile_ok; then
16374 if $run ./try 2>/dev/null; then
16375 echo "Yes, it can."
16378 echo "No, it can't (it uses signed chars)."
16381 echo "(I can't compile the test program, so we'll assume not...)"
16389 : see if prototype for sbrk is available
16391 set d_sbrkproto sbrk $i_unistd unistd.h
16394 : see if select exists
16395 set select d_select
16398 : see if semctl exists
16399 set semctl d_semctl
16402 : see if semget exists
16403 set semget d_semget
16406 : see if semop exists
16410 : see how much of the 'sem*(2)' library is present.
16413 case "$d_semctl$d_semget$d_semop" in
16414 *"$undef"*) h_sem=false;;
16418 case "`ipcs 2>&1`" in
16419 "SVID messages"*"not configured"*)
16420 echo "Your $osname does not have the sem*(2) configured." >&4
16423 set semctl d_semctl
16425 set semget d_semget
16433 : we could also check for sys/ipc.h ...
16434 if $h_sem && $test `./findhdr sys/sem.h`; then
16435 echo "You have the full sem*(2) library." >&4
16438 echo "You don't have the full sem*(2) library." >&4
16444 : see whether sys/sem.h defines union semun
16446 $cat > try.c <<'END'
16447 #include <sys/types.h>
16448 #include <sys/ipc.h>
16449 #include <sys/sem.h>
16450 int main () { union semun semun; semun.buf = 0; }
16453 if eval $compile; then
16454 echo "You have union semun in <sys/sem.h>." >&4
16457 echo "You do not have union semun in <sys/sem.h>." >&4
16464 : see how to do semctl IPC_STAT
16468 $cat > tryh.h <<END
16471 # define S_IRUSR S_IREAD
16472 # define S_IWUSR S_IWRITE
16473 # define S_IXUSR S_IEXEC
16475 # define S_IRUSR 0400
16476 # define S_IWUSR 0200
16477 # define S_IXUSR 0100
16479 # define S_IRGRP (S_IRUSR>>3)
16480 # define S_IWGRP (S_IWUSR>>3)
16481 # define S_IXGRP (S_IXUSR>>3)
16482 # define S_IROTH (S_IRUSR>>6)
16483 # define S_IWOTH (S_IWUSR>>6)
16484 # define S_IXOTH (S_IXUSR>>6)
16487 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
16488 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
16489 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
16492 : see whether semctl IPC_STAT can use union semun
16493 case "$d_semctl_semun" in
16497 #include <sys/types.h>
16498 #include <sys/ipc.h>
16499 #include <sys/sem.h>
16500 #include <sys/stat.h>
16507 #$d_union_semun HAS_UNION_SEMUN
16510 #ifndef HAS_UNION_SEMUN
16513 struct semid_ds *buf;
16514 unsigned short *array;
16520 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16521 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16523 struct semid_ds argbuf;
16526 st = semctl(sem, 0, IPC_STAT, arg);
16530 # endif /* IPC_STAT */
16531 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16533 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16534 # endif /* IPC_RMID */
16535 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16537 #endif /* IPC_PRIVATE && ... */
16538 printf("semget failed: errno = %d\n", errno);
16543 if eval $compile; then
16546 semun) val="$define" ;;
16554 case "$d_semctl_semun" in
16556 echo "You can use union semun for semctl IPC_STAT." >&4
16559 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16564 : see whether semctl IPC_STAT can use struct semid_ds pointer
16565 case "$d_semctl_semid_ds" in
16568 $cat > try.c <<'END'
16569 #include <sys/types.h>
16570 #include <sys/ipc.h>
16571 #include <sys/sem.h>
16572 #include <sys/stat.h>
16580 struct semid_ds arg;
16583 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16584 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16587 st = semctl(sem, 0, IPC_STAT, &arg);
16589 printf("semid_ds\n");
16591 # endif /* IPC_STAT */
16592 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16594 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16595 # endif /* IPC_RMID */
16596 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16598 #endif /* IPC_PRIVATE && ... */
16599 printf("semget failed: errno = %d\n", errno);
16605 if eval $compile; then
16608 semid_ds) val="$define" ;;
16612 set d_semctl_semid_ds
16616 case "$d_semctl_semid_ds" in
16618 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16620 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16626 # We do not have the full sem*(2) library, so assume we can not
16632 set d_semctl_semid_ds
16638 : see if sendmsg exists
16639 set sendmsg d_sendmsg
16642 : see if setegid exists
16643 set setegid d_setegid
16646 : see if seteuid exists
16647 set seteuid d_seteuid
16650 : see if setgrent exists
16651 set setgrent d_setgrent
16654 : see if setgrent_r exists
16655 set setgrent_r d_setgrent_r
16657 case "$d_setgrent_r" in
16659 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16660 case "$d_setgrent_r_proto:$usethreads" in
16661 ":define") d_setgrent_r_proto=define
16662 set d_setgrent_r_proto setgrent_r $hdrs
16666 case "$d_setgrent_r_proto" in
16668 case "$setgrent_r_proto" in
16669 ''|0) try='int setgrent_r(FILE**);'
16670 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16672 case "$setgrent_r_proto" in
16673 ''|0) try='void setgrent_r(FILE**);'
16674 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16676 case "$setgrent_r_proto" in
16677 ''|0) d_setgrent_r=undef
16679 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16680 * ) case "$setgrent_r_proto" in
16681 REENTRANT_PROTO*) ;;
16682 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16684 echo "Prototype: $try" ;;
16687 *) case "$usethreads" in
16688 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16695 *) setgrent_r_proto=0
16699 : see if sethostent exists
16700 set sethostent d_sethent
16703 : see if sethostent_r exists
16704 set sethostent_r d_sethostent_r
16706 case "$d_sethostent_r" in
16708 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16709 case "$d_sethostent_r_proto:$usethreads" in
16710 ":define") d_sethostent_r_proto=define
16711 set d_sethostent_r_proto sethostent_r $hdrs
16715 case "$d_sethostent_r_proto" in
16717 case "$sethostent_r_proto" in
16718 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16719 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16721 case "$sethostent_r_proto" in
16722 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16723 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16725 case "$sethostent_r_proto" in
16726 ''|0) d_sethostent_r=undef
16727 sethostent_r_proto=0
16728 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16729 * ) case "$sethostent_r_proto" in
16730 REENTRANT_PROTO*) ;;
16731 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16733 echo "Prototype: $try" ;;
16736 *) case "$usethreads" in
16737 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16739 d_sethostent_r=undef
16740 sethostent_r_proto=0
16744 *) sethostent_r_proto=0
16748 : see if setitimer exists
16749 set setitimer d_setitimer
16752 : see if setlinebuf exists
16753 set setlinebuf d_setlinebuf
16756 : see if setlocale exists
16757 set setlocale d_setlocale
16760 : see if locale.h is available
16761 set locale.h i_locale
16764 : see if setlocale_r exists
16765 set setlocale_r d_setlocale_r
16767 case "$d_setlocale_r" in
16769 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16770 case "$d_setlocale_r_proto:$usethreads" in
16771 ":define") d_setlocale_r_proto=define
16772 set d_setlocale_r_proto setlocale_r $hdrs
16776 case "$d_setlocale_r_proto" in
16778 case "$setlocale_r_proto" in
16779 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16780 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16782 case "$setlocale_r_proto" in
16783 ''|0) d_setlocale_r=undef
16784 setlocale_r_proto=0
16785 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16786 * ) case "$setlocale_r_proto" in
16787 REENTRANT_PROTO*) ;;
16788 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16790 echo "Prototype: $try" ;;
16793 *) case "$usethreads" in
16794 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16796 d_setlocale_r=undef
16797 setlocale_r_proto=0
16801 *) setlocale_r_proto=0
16805 : see if setnetent exists
16806 set setnetent d_setnent
16809 : see if setnetent_r exists
16810 set setnetent_r d_setnetent_r
16812 case "$d_setnetent_r" in
16814 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16815 case "$d_setnetent_r_proto:$usethreads" in
16816 ":define") d_setnetent_r_proto=define
16817 set d_setnetent_r_proto setnetent_r $hdrs
16821 case "$d_setnetent_r_proto" in
16823 case "$setnetent_r_proto" in
16824 ''|0) try='int setnetent_r(int, struct netent_data*);'
16825 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16827 case "$setnetent_r_proto" in
16828 ''|0) try='void setnetent_r(int, struct netent_data*);'
16829 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16831 case "$setnetent_r_proto" in
16832 ''|0) d_setnetent_r=undef
16833 setnetent_r_proto=0
16834 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16835 * ) case "$setnetent_r_proto" in
16836 REENTRANT_PROTO*) ;;
16837 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16839 echo "Prototype: $try" ;;
16842 *) case "$usethreads" in
16843 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16845 d_setnetent_r=undef
16846 setnetent_r_proto=0
16850 *) setnetent_r_proto=0
16854 : see if setprotoent exists
16855 set setprotoent d_setpent
16858 : see if setpgid exists
16859 set setpgid d_setpgid
16862 : see if setpgrp2 exists
16863 set setpgrp2 d_setpgrp2
16866 : see if setpriority exists
16867 set setpriority d_setprior
16870 : see if setproctitle exists
16871 set setproctitle d_setproctitle
16874 : see if setprotoent_r exists
16875 set setprotoent_r d_setprotoent_r
16877 case "$d_setprotoent_r" in
16879 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16880 case "$d_setprotoent_r_proto:$usethreads" in
16881 ":define") d_setprotoent_r_proto=define
16882 set d_setprotoent_r_proto setprotoent_r $hdrs
16886 case "$d_setprotoent_r_proto" in
16888 case "$setprotoent_r_proto" in
16889 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16890 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16892 case "$setprotoent_r_proto" in
16893 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16894 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16896 case "$setprotoent_r_proto" in
16897 ''|0) d_setprotoent_r=undef
16898 setprotoent_r_proto=0
16899 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16900 * ) case "$setprotoent_r_proto" in
16901 REENTRANT_PROTO*) ;;
16902 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16904 echo "Prototype: $try" ;;
16907 *) case "$usethreads" in
16908 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16910 d_setprotoent_r=undef
16911 setprotoent_r_proto=0
16915 *) setprotoent_r_proto=0
16919 : see if setpwent exists
16920 set setpwent d_setpwent
16923 : see if setpwent_r exists
16924 set setpwent_r d_setpwent_r
16926 case "$d_setpwent_r" in
16928 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16929 case "$d_setpwent_r_proto:$usethreads" in
16930 ":define") d_setpwent_r_proto=define
16931 set d_setpwent_r_proto setpwent_r $hdrs
16935 case "$d_setpwent_r_proto" in
16937 case "$setpwent_r_proto" in
16938 ''|0) try='int setpwent_r(FILE**);'
16939 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16941 case "$setpwent_r_proto" in
16942 ''|0) try='void setpwent_r(FILE**);'
16943 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16945 case "$setpwent_r_proto" in
16946 ''|0) d_setpwent_r=undef
16948 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16949 * ) case "$setpwent_r_proto" in
16950 REENTRANT_PROTO*) ;;
16951 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16953 echo "Prototype: $try" ;;
16956 *) case "$usethreads" in
16957 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16964 *) setpwent_r_proto=0
16968 : see if setregid exists
16969 set setregid d_setregid
16971 set setresgid d_setresgid
16974 : see if setreuid exists
16975 set setreuid d_setreuid
16977 set setresuid d_setresuid
16980 : see if setrgid exists
16981 set setrgid d_setrgid
16984 : see if setruid exists
16985 set setruid d_setruid
16988 : see if setservent exists
16989 set setservent d_setsent
16992 : see if setservent_r exists
16993 set setservent_r d_setservent_r
16995 case "$d_setservent_r" in
16997 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16998 case "$d_setservent_r_proto:$usethreads" in
16999 ":define") d_setservent_r_proto=define
17000 set d_setservent_r_proto setservent_r $hdrs
17004 case "$d_setservent_r_proto" in
17006 case "$setservent_r_proto" in
17007 ''|0) try='int setservent_r(int, struct servent_data*);'
17008 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
17010 case "$setservent_r_proto" in
17011 ''|0) try='void setservent_r(int, struct servent_data*);'
17012 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
17014 case "$setservent_r_proto" in
17015 ''|0) d_setservent_r=undef
17016 setservent_r_proto=0
17017 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
17018 * ) case "$setservent_r_proto" in
17019 REENTRANT_PROTO*) ;;
17020 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
17022 echo "Prototype: $try" ;;
17025 *) case "$usethreads" in
17026 define) echo "setservent_r has no prototype, not using it." >&4 ;;
17028 d_setservent_r=undef
17029 setservent_r_proto=0
17033 *) setservent_r_proto=0
17037 : see if setsid exists
17038 set setsid d_setsid
17041 : see if setvbuf exists
17042 set setvbuf d_setvbuf
17045 : see if sfio.h is available
17049 : see if sfio library is available
17060 : Ok, but do we want to use it.
17064 true|$define|[yY]*) dflt='y';;
17067 echo "$package can use the sfio library, but it is experimental."
17068 case "$useperlio" in
17070 echo "For sfio also the PerlIO abstraction layer is needed."
17071 echo "Earlier you said you wouldn't want that."
17074 rp="You seem to have sfio available, do you want to try using it?"
17077 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
17078 useperlio="$define"
17081 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
17086 *) case "$usesfio" in
17087 true|$define|[yY]*)
17088 echo "Sorry, cannot find sfio on this machine." >&4
17089 echo "Ignoring your setting of usesfio=$usesfio." >&4
17098 $define) usesfio='true';;
17099 *) usesfio='false';;
17103 *) : Remove sfio from list of libraries to use
17106 echo "Removing unneeded -lsfio from library list" >&4
17107 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
17110 echo "libs = $libs" >&4
17117 : see if shmctl exists
17118 set shmctl d_shmctl
17121 : see if shmget exists
17122 set shmget d_shmget
17125 : see if shmat exists
17128 : see what shmat returns
17131 $cat >shmat.c <<'END'
17132 #include <sys/shm.h>
17135 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
17140 echo "and it returns ($shmattype)." >&4
17141 : see if a prototype for shmat is available
17142 xxx=`./findhdr sys/shm.h`
17143 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
17144 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
17155 set d_shmatprototype
17158 : see if shmdt exists
17162 : see how much of the 'shm*(2)' library is present.
17165 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
17166 *"$undef"*) h_shm=false;;
17170 case "`ipcs 2>&1`" in
17171 "SVID shared memory"*"not configured"*)
17172 echo "Your $osname does not have the shm*(2) configured." >&4
17175 set shmctl d_shmctl
17177 set shmget d_shmget
17187 : we could also check for sys/ipc.h ...
17188 if $h_shm && $test `./findhdr sys/shm.h`; then
17189 echo "You have the full shm*(2) library." >&4
17192 echo "You don't have the full shm*(2) library." >&4
17198 : see if we have sigaction
17200 if set sigaction val -f d_sigaction; eval $csym; $val; then
17201 echo 'sigaction() found.' >&4
17204 #include <sys/types.h>
17205 #include <signal.h>
17206 #$i_stdlib I_STDLIB
17208 #include <stdlib.h>
17212 struct sigaction act, oact;
17214 oact.sa_handler = 0;
17215 /* so that act and oact are used */
17216 exit(act.sa_flags == 0 && oact.sa_handler == 0);
17220 if eval $compile_ok; then
17223 echo "But you don't seem to have a useable struct sigaction." >&4
17227 echo 'sigaction NOT found.' >&4
17230 set d_sigaction; eval $setvar
17233 : see if this is a sunmath.h system
17234 set sunmath.h i_sunmath
17237 : see if signbit exists
17238 $echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
17241 #$i_sunmath I_SUNMATH
17245 #ifdef I_SUNMATH /* Solaris special math library */
17246 # include <sunmath.h>
17249 int main(int argc, char **argv)
17253 if ((signbit(x) == 0) && (signbit(y) != 0))
17261 if eval $compile; then
17262 if $run ./try; then
17266 $echo "Signbit seems to be available, but doesn't work as I expected."
17267 $echo "I won't use it." >&4
17278 : see if sigprocmask exists
17279 set sigprocmask d_sigprocmask
17282 : see if sigsetjmp exists
17284 case "$d_sigsetjmp" in
17287 #include <setjmp.h>
17288 #$i_stdlib I_STDLIB
17290 #include <stdlib.h>
17296 if (sigsetjmp(env,1))
17299 siglongjmp(env, 1);
17304 if eval $compile; then
17305 if $run ./try >/dev/null 2>&1; then
17306 echo "POSIX sigsetjmp found." >&4
17310 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
17316 echo "sigsetjmp not found." >&4
17320 *) val="$d_sigsetjmp"
17321 case "$d_sigsetjmp" in
17322 $define) echo "POSIX sigsetjmp found." >&4;;
17323 $undef) echo "sigsetjmp not found." >&4;;
17331 : see if snprintf exists
17332 set snprintf d_snprintf
17335 : see if vsnprintf exists
17336 set vsnprintf d_vsnprintf
17339 case "$d_snprintf-$d_vsnprintf" in
17342 Checking whether your snprintf() and vsnprintf() work okay...
17344 $cat >try.c <<'EOCP'
17345 /* v?snprintf testing logic courtesy of Russ Allbery.
17346 * According to C99:
17347 * - if the buffer is too short it still must be \0-terminated
17348 * - if the buffer is too short the potentially required length
17349 * must be returned and not -1
17350 * - if the buffer is NULL the potentially required length
17351 * must be returned and not -1 or core dump
17354 #include <stdarg.h>
17358 int test (char *format, ...)
17363 va_start (args, format);
17364 count = vsnprintf (buf, sizeof buf, format, args);
17371 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
17372 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
17376 if eval $compile; then
17379 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
17381 Your snprintf() and snprintf() don't seem to be working okay.
17383 d_snprintf="$undef"
17384 d_vsnprintf="$undef"
17388 echo "(I can't seem to compile the test program--assuming they don't)"
17389 d_snprintf="$undef"
17390 d_vsnprintf="$undef"
17396 : see if sockatmark exists
17397 set sockatmark d_sockatmark
17400 : see if prototype for sockatmark is available
17402 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
17405 : see if socks5_init exists
17406 set socks5_init d_socks5_init
17409 : see if sprintf returns the length of the string in the buffer as per ANSI
17410 $echo "Checking whether sprintf returns the length of the string..." >&4
17413 #$i_stdlib I_STDLIB
17415 #include <stdlib.h>
17417 #$i_string I_STRING
17419 # include <string.h>
17421 # include <strings.h>
17430 int check (size_t expect, int test) {
17431 size_t got = strlen(buffer);
17435 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
17440 int main(int argc, char **argv) {
17443 check(sprintf(buffer, ""), ++test);
17444 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
17445 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
17452 d_sprintf_returns_strlen="$undef"
17453 if eval $compile; then
17457 sprintf returns the length of the string (as ANSI says it should)
17459 d_sprintf_returns_strlen="$define"
17462 sprintf does not return the length of the string (how old is this system?)
17464 d_sprintf_returns_strlen="$undef"
17470 : see if srand48_r exists
17471 set srand48_r d_srand48_r
17473 case "$d_srand48_r" in
17475 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17476 case "$d_srand48_r_proto:$usethreads" in
17477 ":define") d_srand48_r_proto=define
17478 set d_srand48_r_proto srand48_r $hdrs
17482 case "$d_srand48_r_proto" in
17484 case "$srand48_r_proto" in
17485 ''|0) try='int srand48_r(long, struct drand48_data*);'
17486 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
17488 case "$srand48_r_proto" in
17489 ''|0) d_srand48_r=undef
17491 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
17492 * ) case "$srand48_r_proto" in
17493 REENTRANT_PROTO*) ;;
17494 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
17496 echo "Prototype: $try" ;;
17499 *) case "$usethreads" in
17500 define) echo "srand48_r has no prototype, not using it." >&4 ;;
17507 *) srand48_r_proto=0
17511 : see if srandom_r exists
17512 set srandom_r d_srandom_r
17514 case "$d_srandom_r" in
17516 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
17517 case "$d_srandom_r_proto:$usethreads" in
17518 ":define") d_srandom_r_proto=define
17519 set d_srandom_r_proto srandom_r $hdrs
17523 case "$d_srandom_r_proto" in
17525 case "$srandom_r_proto" in
17526 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
17527 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
17529 case "$srandom_r_proto" in
17530 ''|0) d_srandom_r=undef
17532 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
17533 * ) case "$srandom_r_proto" in
17534 REENTRANT_PROTO*) ;;
17535 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
17537 echo "Prototype: $try" ;;
17540 *) case "$usethreads" in
17541 define) echo "srandom_r has no prototype, not using it." >&4 ;;
17548 *) srandom_r_proto=0
17552 : see if prototype for setresgid is available
17554 set d_sresgproto setresgid $i_unistd unistd.h
17557 : see if prototype for setresuid is available
17559 set d_sresuproto setresuid $i_unistd unistd.h
17562 : see if sys/stat.h is available
17563 set sys/stat.h i_sysstat
17566 : see if stat knows about block sizes
17568 echo "Checking to see if your struct stat has st_blocks field..." >&4
17569 set d_statblks stat st_blocks $i_sysstat sys/stat.h
17572 : see if this is a sys/vfs.h system
17573 set sys/vfs.h i_sysvfs
17576 : see if this is a sys/statfs.h system
17577 set sys/statfs.h i_sysstatfs
17580 : Check for statfs_s
17582 echo "Checking to see if your system supports struct statfs..." >&4
17583 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
17585 case "$d_statfs_s" in
17586 "$define") echo "Yes, it does." ;;
17587 *) echo "No, it doesn't." ;;
17591 : see if struct statfs knows about f_flags
17592 case "$d_statfs_s" in
17595 echo "Checking to see if your struct statfs has f_flags field..." >&4
17596 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
17600 set d_statfs_f_flags
17604 case "$d_statfs_f_flags" in
17605 "$define") echo "Yes, it does." ;;
17606 *) echo "No, it doesn't." ;;
17609 : Check stream access
17611 Checking how to access stdio streams by file descriptor number...
17613 case "$stdio_stream_array" in
17614 '') $cat >try.c <<EOCP
17617 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17621 for s in _iob __iob __sF
17623 set try -DSTDIO_STREAM_ARRAY=$s
17624 if eval $compile; then
17625 case "`$run ./try`" in
17626 yes) stdio_stream_array=$s; break ;;
17632 case "$stdio_stream_array" in
17634 I can't figure out how to access stdio streams by file descriptor number.
17636 d_stdio_stream_array="$undef"
17639 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17641 d_stdio_stream_array="$define"
17645 : see if strcoll exists
17646 set strcoll d_strcoll
17649 : check for structure copying
17651 echo "Checking to see if your C compiler can copy structs..." >&4
17652 $cat >try.c <<'EOCP'
17662 if $cc -c try.c >/dev/null 2>&1 ; then
17664 echo "Yup, it can."
17667 echo "Nope, it can't."
17673 : see if strerror and/or sys_errlist[] exist
17675 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17676 if set strerror val -f d_strerror; eval $csym; $val; then
17677 echo 'strerror() found.' >&4
17678 d_strerror="$define"
17679 d_strerrm='strerror(e)'
17680 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17681 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17682 d_syserrlst="$define"
17684 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17685 d_syserrlst="$undef"
17687 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17688 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17689 echo 'strerror() found in string header.' >&4
17690 d_strerror="$define"
17691 d_strerrm='strerror(e)'
17692 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17693 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17694 d_syserrlst="$define"
17696 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17697 d_syserrlst="$undef"
17699 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17700 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17701 d_strerror="$undef"
17702 d_syserrlst="$define"
17703 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17705 echo 'strerror() and sys_errlist[] NOT found.' >&4
17706 d_strerror="$undef"
17707 d_syserrlst="$undef"
17708 d_strerrm='"unknown"'
17712 : see if strerror_r exists
17713 set strerror_r d_strerror_r
17715 case "$d_strerror_r" in
17717 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17718 case "$d_strerror_r_proto:$usethreads" in
17719 ":define") d_strerror_r_proto=define
17720 set d_strerror_r_proto strerror_r $hdrs
17724 case "$d_strerror_r_proto" in
17726 case "$strerror_r_proto" in
17727 ''|0) try='int strerror_r(int, char*, size_t);'
17728 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17730 case "$strerror_r_proto" in
17731 ''|0) try='int strerror_r(int, char*, int);'
17732 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17734 case "$strerror_r_proto" in
17735 ''|0) try='char* strerror_r(int, char*, size_t);'
17736 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17738 case "$strerror_r_proto" in
17739 ''|0) d_strerror_r=undef
17741 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17742 * ) case "$strerror_r_proto" in
17743 REENTRANT_PROTO*) ;;
17744 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17746 echo "Prototype: $try" ;;
17749 *) case "$usethreads" in
17750 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17757 *) strerror_r_proto=0
17761 : see if strftime exists
17762 set strftime d_strftime
17765 : see if strlcat exists
17766 set strlcat d_strlcat
17769 : see if strlcpy exists
17770 set strlcpy d_strlcpy
17773 : see if strtod exists
17774 set strtod d_strtod
17777 : see if strtol exists
17778 set strtol d_strtol
17781 : see if strtold exists
17782 set strtold d_strtold
17785 : see if strtoll exists
17786 set strtoll d_strtoll
17789 case "$d_longlong-$d_strtoll" in
17792 Checking whether your strtoll() works okay...
17794 $cat >try.c <<'EOCP'
17797 #define strtoll __strtoll
17800 #define strtoll _strtoll
17803 extern long long int strtoll(char *s, char **, int);
17804 static int bad = 0;
17805 int check(char *s, long long ell, int een) {
17808 gll = strtoll(s, 0, 10);
17809 if (!((gll == ell) && (errno == een)))
17813 check(" 1", 1LL, 0);
17814 check(" 0", 0LL, 0);
17815 check("-1", -1LL, 0);
17816 check("-9223372036854775808", -9223372036854775808LL, 0);
17817 check("-9223372036854775808", -9223372036854775808LL, 0);
17818 check(" 9223372036854775807", 9223372036854775807LL, 0);
17819 check("-9223372036854775808", -9223372036854775808LL, 0);
17820 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17821 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17827 if eval $compile; then
17830 ok) echo "Your strtoll() seems to be working okay." ;;
17832 Your strtoll() doesn't seem to be working okay.
17838 echo "(I can't seem to compile the test program--assuming it doesn't)"
17844 : see if strtoq exists
17845 set strtoq d_strtoq
17848 : see if strtoul exists
17849 set strtoul d_strtoul
17852 case "$d_strtoul" in
17855 Checking whether your strtoul() works okay...
17857 $cat >try.c <<'EOCP'
17860 extern unsigned long int strtoul(char *s, char **, int);
17861 static int bad = 0;
17862 void check(char *s, unsigned long eul, int een) {
17865 gul = strtoul(s, 0, 10);
17866 if (!((gul == eul) && (errno == een)))
17870 check(" 1", 1L, 0);
17871 check(" 0", 0L, 0);
17873 case "$longsize" in
17875 $cat >>try.c <<'EOCP'
17876 check("18446744073709551615", 18446744073709551615UL, 0);
17877 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17878 #if 0 /* strtoul() for /^-/ strings is undefined. */
17879 check("-1", 18446744073709551615UL, 0);
17880 check("-18446744073709551614", 2, 0);
17881 check("-18446744073709551615", 1, 0);
17882 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17883 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17888 $cat >>try.c <<'EOCP'
17889 check("4294967295", 4294967295UL, 0);
17890 check("4294967296", 4294967295UL, ERANGE);
17891 #if 0 /* strtoul() for /^-/ strings is undefined. */
17892 check("-1", 4294967295UL, 0);
17893 check("-4294967294", 2, 0);
17894 check("-4294967295", 1, 0);
17895 check("-4294967296", 4294967295UL, ERANGE);
17896 check("-4294967297", 4294967295UL, ERANGE);
17901 : Should we write these tests to be more portable by sprintf-ing
17902 : ~0 and then manipulating that char string as input for strtol?
17905 $cat >>try.c <<'EOCP'
17912 if eval $compile; then
17913 case "`$run ./try`" in
17914 ok) echo "Your strtoul() seems to be working okay." ;;
17916 Your strtoul() doesn't seem to be working okay.
17922 echo "(I can't seem to compile the test program--assuming it doesn't)"
17928 : see if strtoull exists
17929 set strtoull d_strtoull
17932 case "$d_longlong-$d_strtoull" in
17935 Checking whether your strtoull() works okay...
17937 $cat >try.c <<'EOCP'
17940 #define strtoull __strtoull
17943 extern unsigned long long int strtoull(char *s, char **, int);
17944 static int bad = 0;
17945 int check(char *s, long long eull, int een) {
17948 gull = strtoull(s, 0, 10);
17949 if (!((gull == eull) && (errno == een)))
17953 check(" 1", 1LL, 0);
17954 check(" 0", 0LL, 0);
17955 check("18446744073709551615", 18446744073709551615ULL, 0);
17956 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17957 #if 0 /* strtoull() for /^-/ strings is undefined. */
17958 check("-1", 18446744073709551615ULL, 0);
17959 check("-18446744073709551614", 2LL, 0);
17960 check("-18446744073709551615", 1LL, 0);
17961 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17962 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17969 if eval $compile; then
17970 case "`$run ./try`" in
17971 ok) echo "Your strtoull() seems to be working okay." ;;
17973 Your strtoull() doesn't seem to be working okay.
17975 d_strtoull="$undef"
17979 echo "(I can't seem to compile the test program--assuming it doesn't)"
17980 d_strtoull="$undef"
17985 : see if strtouq exists
17986 set strtouq d_strtouq
17989 case "$d_strtouq" in
17992 Checking whether your strtouq() works okay...
17994 $cat >try.c <<'EOCP'
17997 extern unsigned long long int strtouq(char *s, char **, int);
17998 static int bad = 0;
17999 void check(char *s, unsigned long long eull, int een) {
18000 unsigned long long gull;
18002 gull = strtouq(s, 0, 10);
18003 if (!((gull == eull) && (errno == een)))
18007 check(" 1", 1LL, 0);
18008 check(" 0", 0LL, 0);
18009 check("18446744073709551615", 18446744073709551615ULL, 0);
18010 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
18011 #if 0 /* strtouq() for /^-/ strings is undefined. */
18012 check("-1", 18446744073709551615ULL, 0);
18013 check("-18446744073709551614", 2LL, 0);
18014 check("-18446744073709551615", 1LL, 0);
18015 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
18016 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
18024 if eval $compile; then
18025 case "`$run ./try`" in
18026 ok) echo "Your strtouq() seems to be working okay." ;;
18028 Your strtouq() doesn't seem to be working okay.
18034 echo "(I can't seem to compile the test program--assuming it doesn't)"
18040 : see if strxfrm exists
18041 set strxfrm d_strxfrm
18044 : see if symlink exists
18045 set symlink d_symlink
18048 : see if syscall exists
18049 set syscall d_syscall
18052 : see if prototype for syscall is available
18054 set d_syscallproto syscall $i_unistd unistd.h
18057 : see if sysconf exists
18058 set sysconf d_sysconf
18061 : see if system exists
18062 set system d_system
18065 : see if tcgetpgrp exists
18066 set tcgetpgrp d_tcgetpgrp
18069 : see if tcsetpgrp exists
18070 set tcsetpgrp d_tcsetpgrp
18073 : see if prototype for telldir is available
18075 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
18078 : see if time exists
18080 if test "X$d_time" = X -o X"$timetype" = X; then
18081 if set time val -f d_time; eval $csym; $val; then
18082 echo 'time() found.' >&4
18084 rp="What is the type returned by time() on this system?"
18085 set time_t timetype long stdio.h sys/types.h
18088 echo 'time() not found, hope that will do.' >&4
18096 : see if this is a sys/times.h system
18097 set sys/times.h i_systimes
18100 : see if times exists
18102 if set times val -f d_times; eval $csym; $val; then
18103 echo 'times() found.' >&4
18106 case "$i_systimes" in
18107 "$define") inc='sys/times.h';;
18109 rp="What is the type returned by times() on this system?"
18110 set clock_t clocktype long stdio.h sys/types.h $inc
18113 echo 'times() NOT found, hope that will do.' >&4
18118 : see if tmpnam_r exists
18119 set tmpnam_r d_tmpnam_r
18121 case "$d_tmpnam_r" in
18123 hdrs="$i_systypes sys/types.h define stdio.h "
18124 case "$d_tmpnam_r_proto:$usethreads" in
18125 ":define") d_tmpnam_r_proto=define
18126 set d_tmpnam_r_proto tmpnam_r $hdrs
18130 case "$d_tmpnam_r_proto" in
18132 case "$tmpnam_r_proto" in
18133 ''|0) try='char* tmpnam_r(char*);'
18134 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
18136 case "$tmpnam_r_proto" in
18137 ''|0) d_tmpnam_r=undef
18139 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
18140 * ) case "$tmpnam_r_proto" in
18141 REENTRANT_PROTO*) ;;
18142 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
18144 echo "Prototype: $try" ;;
18147 *) case "$usethreads" in
18148 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
18155 *) tmpnam_r_proto=0
18159 : see if truncate exists
18160 set truncate d_truncate
18163 : see if ttyname_r exists
18164 set ttyname_r d_ttyname_r
18166 case "$d_ttyname_r" in
18168 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
18169 case "$d_ttyname_r_proto:$usethreads" in
18170 ":define") d_ttyname_r_proto=define
18171 set d_ttyname_r_proto ttyname_r $hdrs
18175 case "$d_ttyname_r_proto" in
18177 case "$ttyname_r_proto" in
18178 ''|0) try='int ttyname_r(int, char*, size_t);'
18179 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
18181 case "$ttyname_r_proto" in
18182 ''|0) try='int ttyname_r(int, char*, int);'
18183 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
18185 case "$ttyname_r_proto" in
18186 ''|0) try='char* ttyname_r(int, char*, int);'
18187 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
18189 case "$ttyname_r_proto" in
18190 ''|0) d_ttyname_r=undef
18192 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
18193 * ) case "$ttyname_r_proto" in
18194 REENTRANT_PROTO*) ;;
18195 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
18197 echo "Prototype: $try" ;;
18200 *) case "$usethreads" in
18201 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
18208 *) ttyname_r_proto=0
18212 : see if tzname[] exists
18214 if set tzname val -a d_tzname; eval $csym; $val; then
18216 echo 'tzname[] found.' >&4
18219 echo 'tzname[] NOT found.' >&4
18224 : Check if is a multiplatform env
18226 next|rhapsody|darwin) multiarch="$define" ;;
18228 case "$multiarch" in
18229 ''|[nN]*) multiarch="$undef" ;;
18232 : check for ordering of bytes in a UV
18234 case "$usecrosscompile$multiarch" in
18237 You seem to be either cross-compiling or doing a multiarchitecture build,
18238 skipping the byteorder check.
18244 case "$byteorder" in
18247 In the following, larger digits indicate more significance. A big-endian
18248 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
18249 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
18250 machines may have weird orders like 3412. A Cray will report 87654321,
18251 an Alpha will report 12345678. If the test program works the default is
18253 I'm now running the test program...
18257 #$i_stdlib I_STDLIB
18259 #include <stdlib.h>
18261 #include <sys/types.h>
18262 typedef $uvtype UV;
18272 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
18274 u.l = (UV)0x04030201;
18275 for (i = 0; i < $uvsize; i++)
18276 printf("%c", u.c[i]+'0');
18283 if eval $compile && $run ./try > /dev/null; then
18286 [1-4][1-4][1-4][1-4]|12345678|87654321)
18287 echo "(The test program ran ok.)"
18288 echo "byteorder=$dflt"
18291 ????|????????) echo "(The test program ran ok.)" ;;
18292 *) echo "(The test program didn't run right for some reason.)" ;;
18297 (I can't seem to compile the test program. Guessing big-endian...)
18300 case "$xxx_prompt" in
18302 rp="What is the order of bytes in $uvtype?"
18315 : Checking 32bit aligndness
18318 Checking to see whether you can access character data unalignedly...
18320 case "$d_u32align" in
18321 '') $cat >try.c <<EOCP
18323 #$i_stdlib I_STDLIB
18325 #include <stdlib.h>
18327 #define U32 $u32type
18328 #define BYTEORDER 0x$byteorder
18330 #include <signal.h>
18332 $signal_t bletch(int s) { exit(4); }
18335 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
18340 if (sizeof(U32) != 4) {
18341 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
18348 signal(SIGBUS, bletch);
18360 for (i = 0; i < 4; i++) {
18361 up = (U32*)(buf + i);
18362 if (! ((*up == 1 << (8*i)) || /* big-endian */
18363 (*up == 1 << (8*(3-i))) /* little-endian */
18367 printf("read failed (%x)\n", *up);
18373 for (i = 0; i < 4; i++) {
18374 up = (U32*)(buf + i);
18376 if (*up != 0xBeef) {
18377 printf("write failed (%x)\n", *up);
18391 if eval $compile_ok; then
18392 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
18393 $run ./try 2>&1 >/dev/null
18396 You can access character data pretty unalignedly.
18398 d_u32align="$undef"
18401 It seems that you must access character data in an aligned manner.
18403 d_u32align="$define"
18407 rp='Can you access character data at unaligned addresses?'
18411 [yY]*) d_u32align="$undef" ;;
18412 *) d_u32align="$define" ;;
18419 : see if ualarm exists
18420 set ualarm d_ualarm
18423 : see if umask exists
18427 : see if unordered exists
18428 set unordered d_unordered
18431 : see if unsetenv exists
18432 set unsetenv d_unsetenv
18435 : see if usleep exists
18436 set usleep d_usleep
18439 : see if prototype for usleep is available
18441 set d_usleepproto usleep $i_unistd unistd.h
18444 : see if ustat exists
18448 : see if closedir exists
18449 set closedir d_closedir
18452 case "$d_closedir" in
18455 echo "Checking whether closedir() returns a status..." >&4
18457 #$i_dirent I_DIRENT /**/
18458 #$i_sysdir I_SYS_DIR /**/
18459 #$i_sysndir I_SYS_NDIR /**/
18460 #$i_systypes I_SYS_TYPES /**/
18462 #if defined(I_SYS_TYPES)
18463 #include <sys/types.h>
18465 #if defined(I_DIRENT)
18466 #include <dirent.h>
18467 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
18468 #include <sys/dir.h>
18472 #include <sys/ndir.h>
18476 #include <ndir.h> /* may be wrong in the future */
18478 #include <sys/dir.h>
18483 int main() { return closedir(opendir(".")); }
18486 if eval $compile_ok; then
18487 if $run ./try > /dev/null 2>&1 ; then
18488 echo "Yes, it does."
18491 echo "No, it doesn't."
18495 echo "(I can't seem to compile the test program--assuming it doesn't)"
18503 set d_void_closedir
18507 : see if there is a wait4
18511 : see if waitpid exists
18512 set waitpid d_waitpid
18515 : see if wcstombs exists
18516 set wcstombs d_wcstombs
18519 : see if wctomb exists
18520 set wctomb d_wctomb
18523 : see if writev exists
18524 set writev d_writev
18527 : preserve RCS keywords in files with variable substitution, grrr
18532 Revision='$Revision'
18534 : check for alignment requirements
18536 case "$usecrosscompile$multiarch" in
18539 You seem to be either cross-compiling or doing a multiarchitecture build,
18540 skipping the memory alignment check.
18543 case "$alignbytes" in
18544 '') alignbytes=8 ;;
18548 case "$alignbytes" in
18549 '') echo "Checking alignment constraints..." >&4
18550 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18551 $cat >try.c <<'EOCP'
18552 typedef long double NV;
18555 $cat >try.c <<'EOCP'
18559 $cat >>try.c <<'EOCP'
18567 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18572 if eval $compile_ok; then
18576 echo "(I can't seem to compile the test program...)"
18579 *) dflt="$alignbytes"
18582 rp="Doubles must be aligned on a how-many-byte boundary?"
18590 : set the base revision
18593 : how do we concatenate cpp tokens here?
18595 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18596 $cat >cpp_stuff.c <<'EOCP'
18597 #define RCAT(a,b)a/**/b
18598 #define ACAT(a,b)a ## b
18602 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18603 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18604 echo "Oh! Smells like ANSI's been here." >&4
18605 echo "We can catify or stringify, separately or together!"
18607 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18608 echo "Ah, yes! The good old days!" >&4
18609 echo "However, in the good old days we don't know how to stringify and"
18610 echo "catify at the same time."
18614 Hmm, I don't seem to be able to concatenate tokens with your cpp.
18615 You're going to have to edit the values of CAT[2-5] in config.h...
18617 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18621 : see if this is a db.h system
18627 : Check db version.
18629 echo "Checking Berkeley DB version ..." >&4
18635 #include <sys/types.h>
18637 #$i_stdlib I_STDLIB
18639 #include <stdlib.h>
18642 int main(int argc, char *argv[])
18644 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18645 int Major, Minor, Patch ;
18646 unsigned long Version ;
18647 (void)db_version(&Major, &Minor, &Patch) ;
18649 printf("%d %d %d %d %d %d\n",
18650 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18651 Major, Minor, Patch);
18654 printf("You have Berkeley DB Version 2 or greater.\n");
18656 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18657 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18658 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18659 Major, Minor, Patch) ;
18661 /* check that db.h & libdb are compatible */
18662 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18663 printf("db.h and libdb are incompatible.\n") ;
18667 printf("db.h and libdb are compatible.\n") ;
18669 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18670 + DB_VERSION_PATCH ;
18672 /* needs to be >= 2.3.4 */
18673 if (Version < 2003004) {
18674 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18675 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18681 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18686 printf("You have Berkeley DB Version 1.\n");
18687 exit(0); /* DB version < 2: the coast is clear. */
18689 exit(1); /* <db.h> not Berkeley DB? */
18695 if eval $compile_ok && $run ./try; then
18696 echo 'Looks OK.' >&4
18698 db_version_major=$1
18699 db_version_minor=$2
18700 db_version_patch=$3
18702 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18706 : Remove db from list of libraries to use
18707 echo "Removing unusable -ldb from library list" >&4
18708 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18711 echo "libs = $libs" >&4
18721 : Check the return type needed for hash
18723 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18729 #include <sys/types.h>
18732 #ifndef DB_VERSION_MAJOR
18733 u_int32_t hash_cb (ptr, size)
18741 info.hash = hash_cb;
18745 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18746 if $contains warning try.out >>/dev/null 2>&1 ; then
18749 db_hashtype='u_int32_t'
18752 : XXX Maybe we should just give up here.
18753 db_hashtype=u_int32_t
18755 echo "Help: I can't seem to compile the db test program." >&4
18756 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18759 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18761 *) db_hashtype=u_int32_t
18766 : Check the return type needed for prefix
18768 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18774 #include <sys/types.h>
18777 #ifndef DB_VERSION_MAJOR
18778 size_t prefix_cb (key1, key2)
18786 info.prefix = prefix_cb;
18790 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18791 if $contains warning try.out >>/dev/null 2>&1 ; then
18792 db_prefixtype='int'
18794 db_prefixtype='size_t'
18797 db_prefixtype='size_t'
18798 : XXX Maybe we should just give up here.
18800 echo "Help: I can't seem to compile the db test program." >&4
18801 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18804 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18806 *) db_prefixtype='size_t'
18810 : How can we generate normalized random numbers ?
18812 echo "Looking for a random number function..." >&4
18813 case "$randfunc" in
18815 if set drand48 val -f; eval $csym; $val; then
18817 echo "Good, found drand48()." >&4
18818 elif set random val -f; eval $csym; $val; then
18820 echo "OK, found random()." >&4
18823 echo "Yick, looks like I have to use rand()." >&4
18834 *-Dmy_rand=*|*-Dmy_srand=*)
18835 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18836 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18837 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18838 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18842 while $test "$cont"; do
18843 rp="Use which function to generate random numbers?"
18845 if $test "$ans" = "$dflt"; then
18851 if set $ans val -f; eval $csym; $val; then
18855 rp="I cannot find function $ans. Use that name anyway?"
18864 case "$randfunc" in
18866 drand01="drand48()"
18872 case "$randbits" in
18874 echo "Checking to see how many bits your $randfunc() function produces..." >&4
18876 #$i_unistd I_UNISTD
18877 #$i_stdlib I_STDLIB
18880 # include <unistd.h>
18883 # include <stdlib.h>
18888 register unsigned long tmp;
18889 register unsigned long max = 0L;
18891 for (i = 1000; i; i--) {
18892 tmp = (unsigned long) $randfunc();
18893 if (tmp > max) max = tmp;
18895 for (i = 0; max; i++)
18901 if eval $compile_ok; then
18905 echo "(I can't seem to compile the test program...)"
18912 rp="How many bits does your $randfunc() function produce?"
18916 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18917 seedfunc="s$randfunc"
18918 randseedtype=unsigned
18922 rp="How many bits does your $randfunc() function produce?"
18925 seedfunc="s$randfunc"
18926 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18927 if set $seedfunc val -f; eval $csym; $val; then
18928 echo "(Using $seedfunc() to seed random generator)"
18930 echo "(Warning: no $seedfunc() to seed random generator)"
18933 randseedtype=unsigned
18940 : Determine if this is an EBCDIC system
18942 echo "Determining whether or not we are on an EBCDIC system..." >&4
18943 $cat >try.c <<'EOM'
18946 if ('M'==0xd4) return 0;
18953 if eval $compile_ok; then
18954 if $run ./try; then
18955 echo "You seem to speak EBCDIC." >&4
18958 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18961 echo "I'm unable to compile the test program." >&4
18962 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18968 : Check how to flush
18971 Checking how to flush all pending stdio output...
18973 # I only know how to find the first 32 possibly open files on SunOS.
18974 # See also hints/sunos_4_1.sh and util.c --AD
18976 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18978 $cat >>try.c <<EOCP
18980 #$i_stdlib I_STDLIB
18982 #include <stdlib.h>
18984 #$i_unistd I_UNISTD
18986 # include <unistd.h>
18988 #$d_sysconf HAS_SYSCONF
18989 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18990 #ifdef HAS_STDIO_STREAM_ARRAY
18991 # define STDIO_STREAM_ARRAY $stdio_stream_array
18996 p = fopen("try.out", "w");
19000 # ifdef TRY_FPRINTF
19004 #ifdef TRY_FFLUSH_NULL
19007 #ifdef TRY_FFLUSH_ALL
19009 long open_max = -1;
19010 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
19011 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
19013 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
19014 open_max = sysconf(_SC_OPEN_MAX);
19017 open_max = FOPEN_MAX;
19020 open_max = OPEN_MAX;
19029 # ifdef HAS_STDIO_STREAM_ARRAY
19030 if (open_max > 0) {
19032 for (i = 0; i < open_max; i++)
19033 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
19034 STDIO_STREAM_ARRAY[i]._file < open_max &&
19035 STDIO_STREAM_ARRAY[i]._flag)
19036 fflush(&STDIO_STREAM_ARRAY[i]);
19044 : first we have to find out how _not_ to flush
19046 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
19048 set try -DTRY_FPUTC
19049 if eval $compile; then
19050 $run ./try 2>/dev/null
19053 if $test ! -s try.out -a "X$code" = X42; then
19059 set try -DTRY_FPRINTF
19060 if eval $compile; then
19061 $run ./try 2>/dev/null
19064 if $test ! -s try.out -a "X$code" = X42; then
19065 output=-DTRY_FPRINTF
19071 : check for fflush NULL behaviour
19072 case "$fflushNULL" in
19073 '') set try -DTRY_FFLUSH_NULL $output
19074 if eval $compile; then
19075 $run ./try 2>/dev/null
19078 if $test -s try.out -a "X$code" = X42; then
19079 fflushNULL="`$cat try.out`"
19081 if $test "X$code" != X42; then
19083 (If this test failed, don't worry, we'll try another method shortly.)
19089 case "$fflushNULL" in
19091 Your fflush(NULL) works okay for output streams.
19092 Let's see if it clobbers input pipes...
19094 # As of mid-March 2000 all versions of Solaris appear to have a stdio
19095 # bug that improperly flushes the input end of pipes. So we avoid the
19096 # autoflush on fork/system/exec support for now. :-(
19097 $cat >tryp.c <<EOCP
19100 main(int argc, char **argv)
19106 while ((i = getc(stdin)) != -1
19107 && (*bp++ = i) != '\n'
19108 && bp < &buf[1024])
19111 fprintf(stdout, "%s", buf);
19119 fflushNULL="$define"
19121 if eval $compile; then
19123 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19124 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19126 fflush(NULL) seems to behave okay with input streams.
19128 fflushNULL="$define"
19131 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
19133 fflushNULL="$undef"
19136 $rm -f core tryp.c tryp.core core.tryp.*
19139 Your fflush(NULL) isn't working (contrary to ANSI C).
19141 fflushNULL="$undef"
19144 Cannot figure out whether your fflush(NULL) works or not.
19145 I'm assuming it doesn't (contrary to ANSI C).
19147 fflushNULL="$undef"
19151 $define|true|[yY]*)
19152 fflushNULL="$define"
19155 fflushNULL="$undef"
19158 : check explicit looping only if NULL did not work, and if the pipe
19159 : bug does not show up on an explicit flush too
19160 case "$fflushNULL" in
19162 $cat >tryp.c <<EOCP
19165 main(int argc, char **argv)
19171 while ((i = getc(stdin)) != -1
19172 && (*bp++ = i) != '\n'
19173 && bp < &buf[1024])
19176 fprintf(stdout, "%s", buf);
19185 if eval $compile; then
19187 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
19188 if cmp tryp.c tryp.out >/dev/null 2>&1; then
19190 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
19192 : now check for fflushall behaviour
19193 case "$fflushall" in
19194 '') set try -DTRY_FFLUSH_ALL $output
19195 if eval $compile; then
19197 (Now testing the other method--but note that this also may fail.)
19199 $run ./try 2>/dev/null
19202 if $test -s try.out -a "X$code" = X42; then
19203 fflushall="`$cat try.out`"
19207 case "$fflushall" in
19209 Whew. Flushing explicitly all the stdio streams works.
19211 fflushall="$define"
19214 Sigh. Flushing explicitly all the stdio streams doesn't work.
19219 Cannot figure out whether flushing stdio streams explicitly works or not.
19220 I'm assuming it doesn't.
19226 "$define"|true|[yY]*)
19227 fflushall="$define"
19235 All is futile. Even fflush(stdin) clobbers input pipes!
19242 $rm -f core tryp.c tryp.core core.tryp.*
19244 *) fflushall="$undef"
19248 case "$fflushNULL$fflushall" in
19251 OK, I give up. I cannot figure out how to flush pending stdio output.
19252 We won't be flushing handles at all before fork/exec/popen.
19258 : Store the full pathname to the ar program for use in the C program
19259 : Respect a hint or command line value for full_ar.
19264 : Store the full pathname to the sed program for use in the C program
19267 : see what type gids are declared as in the kernel
19269 echo "Looking for the type for group ids returned by getgid()."
19270 set gid_t gidtype xxx stdio.h sys/types.h
19274 xxx=`./findhdr sys/user.h`
19275 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
19277 unsigned) dflt="$1 $2" ;;
19281 *) dflt="$gidtype";;
19284 gid_t) echo "gid_t found." ;;
19285 *) rp="What is the type for group ids returned by getgid()?"
19291 : Check the size of GID
19294 *_t) zzz="$gidtype" ;;
19297 echo "Checking the size of $zzz..." >&4
19299 #include <sys/types.h>
19301 #$i_stdlib I_STDLIB
19303 #include <stdlib.h>
19306 printf("%d\n", (int)sizeof($gidtype));
19311 if eval $compile_ok; then
19315 echo "(I can't execute the test program--guessing $gidsize.)" >&4
19318 echo "Your $zzz is $gidsize bytes long."
19323 echo "(I can't compile the test program--guessing $gidsize.)" >&4
19327 : Check if GID is signed
19330 *_t) zzz="$gidtype" ;;
19333 echo "Checking the sign of $zzz..." >&4
19335 #include <sys/types.h>
19346 if eval $compile; then
19350 echo "(I can't execute the test program--guessing unsigned.)" >&4
19354 1) echo "Your $zzz is unsigned." ;;
19355 -1) echo "Your $zzz is signed." ;;
19361 echo "(I can't compile the test program--guessing unsigned.)" >&4
19365 : Check 64bit sizes
19368 if $test X"$quadtype" != X; then
19370 echo "Checking how to print 64-bit integers..." >&4
19372 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
19373 $cat >try.c <<'EOCP'
19374 #include <sys/types.h>
19377 int q = 12345678901;
19378 printf("%ld\n", q);
19382 if eval $compile; then
19386 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
19387 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
19388 echo "We will use %d."
19394 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
19395 $cat >try.c <<'EOCP'
19396 #include <sys/types.h>
19399 long q = 12345678901;
19400 printf("%ld\n", q);
19404 if eval $compile; then
19408 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
19409 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
19410 echo "We will use %ld."
19416 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
19417 $cat >try.c <<'EOCP'
19418 #include <sys/types.h>
19419 #include <inttypes.h>
19422 int64_t q = 12345678901;
19423 printf("%" PRId64 "\n", q);
19427 if eval $compile; then
19431 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
19432 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
19433 echo "We will use the C9X style."
19439 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19441 #include <sys/types.h>
19444 $quadtype q = 12345678901;
19445 printf("%Ld\n", q);
19449 if eval $compile; then
19453 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
19454 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
19455 echo "We will use %Ld."
19461 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
19462 $cat >try.c <<'EOCP'
19463 #include <sys/types.h>
19466 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
19467 printf("%lld\n", q);
19471 if eval $compile; then
19475 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
19476 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
19477 echo "We will use the %lld style."
19483 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
19485 #include <sys/types.h>
19488 $quadtype q = 12345678901;
19489 printf("%qd\n", q);
19493 if eval $compile; then
19497 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
19498 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
19499 echo "We will use %qd."
19505 if $test X"$sPRId64" = X; then
19506 echo "Cannot figure out how to print 64-bit integers." >&4
19513 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
19514 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
19516 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
19517 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
19521 : Check format strings for internal types
19523 $echo "Checking the format strings to be used for Perl's internal types..." >&4
19525 if $test X"$ivsize" = X8; then
19526 ivdformat="$sPRId64"
19527 uvuformat="$sPRIu64"
19528 uvoformat="$sPRIo64"
19529 uvxformat="$sPRIx64"
19530 uvXUformat="$sPRIXU64"
19532 if $test X"$ivsize" = X"$longsize"; then
19539 if $test X"$ivsize" = X"$intsize"; then
19547 if $test X"$ivsize" = X"$shortsize"; then
19558 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19559 nveformat="$sPRIeldbl"
19560 nvfformat="$sPRIfldbl"
19561 nvgformat="$sPRIgldbl"
19562 nvEUformat="$sPRIEUldbl"
19563 nvFUformat="$sPRIFUldbl"
19564 nvGUformat="$sPRIGUldbl"
19574 case "$ivdformat" in
19575 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19580 : Check format string for GID
19583 $echo "Checking the format string to be used for gids..." >&4
19586 -1) if $test X"$gidsize" = X"$ivsize"; then
19587 gidformat="$ivdformat"
19589 if $test X"$gidsize" = X"$longsize"; then
19592 if $test X"$gidsize" = X"$intsize"; then
19595 if $test X"$gidsize" = X"$shortsize"; then
19602 *) if $test X"$gidsize" = X"$uvsize"; then
19603 gidformat="$uvuformat"
19605 if $test X"$gidsize" = X"$longsize"; then
19608 if $test X"$gidsize" = X"$intsize"; then
19611 if $test X"$gidsize" = X"$shortsize"; then
19620 : see if getgroups exists
19621 set getgroups d_getgrps
19624 : see if setgroups exists
19625 set setgroups d_setgrps
19628 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19630 case "$d_getgrps$d_setgrps" in
19632 case "$groupstype" in
19633 '') dflt="$gidtype" ;;
19634 *) dflt="$groupstype" ;;
19637 What type of pointer is the second argument to getgroups() and setgroups()?
19638 Usually this is the same as group ids, $gidtype, but not always.
19641 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19645 *) groupstype="$gidtype";;
19648 : MAD = Misc Attribute Definition
19650 if $test $patchlevel -lt 9; then
19651 : MAD is not available in 5.8.x or earlier.
19655 $define|true|[yY]*) dflt='y' ;;
19660 Would you like to build with Misc Attribute Decoration? This is development
19661 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19662 overhead on the interpreter.
19664 If this doesn't make any sense to you, just accept the default '$dflt'.
19666 rp='Build Perl with MAD?'
19671 madlyh='madly.h madly.act madly.tab'
19673 madlyobj="madly$_o" ;;
19682 : check whether make sets MAKE
19684 echo "Checking if your $make program sets \$(MAKE)..." >&4
19685 case "$make_set_make" in
19687 $sed 's/^X //' > testmake.mak << 'EOF'
19689 X @echo 'maketemp="$(MAKE)"'
19691 case "`$make -f testmake.mak 2>/dev/null`" in
19692 *maketemp=*) make_set_make='#' ;;
19693 *) make_set_make="MAKE=$make" ;;
19695 $rm -f testmake.mak
19698 case "$make_set_make" in
19699 '#') echo "Yup, it does.";;
19700 *) echo "Nope, it doesn't.";;
19703 : see what type is used for mode_t
19704 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19705 set mode_t modetype int stdio.h sys/types.h
19708 : see if we need va_copy
19710 case "$i_stdarg" in
19713 #include <stdarg.h>
19715 #$i_stdlib I_STDLIB
19717 #include <stdlib.h>
19719 #include <signal.h>
19722 ivfprintf(FILE *f, const char *fmt, va_list *valp)
19724 return vfprintf(f, fmt, *valp);
19728 myvfprintf(FILE *f, const char *fmt, va_list val)
19730 return ivfprintf(f, fmt, &val);
19734 myprintf(char *fmt, ...)
19737 va_start(val, fmt);
19738 return myvfprintf(stdout, fmt, val);
19742 main(int ac, char **av)
19744 signal(SIGSEGV, exit);
19746 myprintf("%s%cs all right, then\n", "that", '\'');
19751 if eval $compile && $run ./try 2>&1 >/dev/null; then
19752 case "`$run ./try`" in
19753 "that's all right, then")
19759 yes) echo "It seems that you don't need va_copy()." >&4
19760 need_va_copy="$undef"
19762 *) echo "It seems that va_copy() or similar will be needed." >&4
19763 need_va_copy="$define"
19768 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19772 : see what type is used for size_t
19773 rp="What is the type used for the length parameter for string functions?"
19774 set size_t sizetype 'unsigned int' stdio.h sys/types.h
19777 : check for type of arguments to gethostbyaddr.
19778 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19779 case "$d_gethbyaddr" in
19783 Checking to see what type of arguments are accepted by gethostbyaddr().
19785 hdrs="$define sys/types.h
19786 $d_socket sys/socket.h
19787 $i_niin netinet/in.h
19789 $i_unistd unistd.h"
19790 : The first arg can 'char *' or 'void *'
19791 : The second arg is some of integral type
19792 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19793 for yyy in size_t long int; do
19794 case "$netdb_host_type" in
19795 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19796 if ./protochk "$try" $hdrs; then
19797 echo "Your system accepts $xxx for the first arg."
19798 echo "...and $yyy for the second arg."
19799 netdb_host_type="$xxx"
19800 netdb_hlen_type="$yyy"
19806 : In case none of those worked, prompt the user.
19807 case "$netdb_host_type" in
19808 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19811 netdb_host_type=$ans
19812 rp='What is the type for the 2nd argument to gethostbyaddr?'
19815 netdb_hlen_type=$ans
19819 *) : no gethostbyaddr, so pick harmless defaults
19820 netdb_host_type='char *'
19821 netdb_hlen_type="$sizetype"
19824 # Remove the "const" if needed. -- but then we'll have a
19826 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19829 : check for type of argument to gethostbyname.
19830 if test "X$netdb_name_type" = X ; then
19831 case "$d_gethbyname" in
19835 Checking to see what type of argument is accepted by gethostbyname().
19837 hdrs="$define sys/types.h
19838 $d_socket sys/socket.h
19839 $i_niin netinet/in.h
19841 $i_unistd unistd.h"
19842 for xxx in "const char *" "char *"; do
19843 case "$netdb_name_type" in
19844 '') try="extern struct hostent *gethostbyname($xxx);"
19845 if ./protochk "$try" $hdrs; then
19846 echo "Your system accepts $xxx."
19847 netdb_name_type="$xxx"
19852 : In case none of those worked, prompt the user.
19853 case "$netdb_name_type" in
19854 '') rp='What is the type for the 1st argument to gethostbyname?'
19857 netdb_name_type=$ans
19861 *) : no gethostbyname, so pick harmless default
19862 netdb_name_type='char *'
19867 : check for type of 1st argument to getnetbyaddr.
19868 if test "X$netdb_net_type" = X ; then
19869 case "$d_getnbyaddr" in
19873 Checking to see what type of 1st argument is accepted by getnetbyaddr().
19875 hdrs="$define sys/types.h
19876 $d_socket sys/socket.h
19877 $i_niin netinet/in.h
19879 $i_unistd unistd.h"
19880 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19881 case "$netdb_net_type" in
19882 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19883 if ./protochk "$try" $hdrs; then
19884 echo "Your system accepts $xxx."
19885 netdb_net_type="$xxx"
19890 : In case none of those worked, prompt the user.
19891 case "$netdb_net_type" in
19892 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19895 netdb_net_type=$ans
19899 *) : no getnetbyaddr, so pick harmless default
19900 netdb_net_type='long'
19904 : locate the preferred pager for this system
19911 [a-zA-Z]:/*) dflt=$pg;;
19915 [a-zA-Z]:/*) dflt=$more;;
19919 [a-zA-Z]:/*) dflt=$less;;
19922 '') dflt=/usr/ucb/more;;
19926 : Instruct ./getfile to trust the hinted or previous pager value,
19927 : even if it does not begin with a slash. For example, on os2,
19928 : pager might be cmd /c more. See comments in UU/getfile.
19933 rp='What pager is used on your system?'
19937 : see what type pids are declared as in the kernel
19938 rp="What is the type of process ids on this system?"
19939 set pid_t pidtype int stdio.h sys/types.h
19942 : see if ar generates random libraries by itself
19944 echo "Checking how to generate random libraries on your machine..." >&4
19945 echo 'int bar1() { return bar2(); }' > bar1.c
19946 echo 'int bar2() { return 2; }' > bar2.c
19948 #$i_stdlib I_STDLIB
19950 #include <stdlib.h>
19952 int main() { printf("%d\n", bar1()); exit(0); }
19954 $cc $ccflags -c bar1.c >/dev/null 2>&1
19955 $cc $ccflags -c bar2.c >/dev/null 2>&1
19956 $cc $ccflags -c foo.c >/dev/null 2>&1
19957 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19958 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19959 $run ./foobar >/dev/null 2>&1; then
19960 echo "$ar appears to generate random libraries itself."
19962 if [ "X$ranlib" = "X" ]; then
19965 elif $ar s bar$_a >/dev/null 2>&1 &&
19966 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19967 $run ./foobar >/dev/null 2>&1; then
19968 echo "a table of contents needs to be added with '$ar s'."
19971 elif $ar ts bar$_a >/dev/null 2>&1 &&
19972 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19973 $run ./foobar >/dev/null 2>&1; then
19974 echo "a table of contents needs to be added with '$ar ts'."
19981 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19982 $test -f $ranlib || ranlib=''
19985 if $test -n "$ranlib"; then
19986 echo "your system has '$ranlib'; we'll use that."
19989 echo "your system doesn't seem to support random libraries"
19990 echo "so we'll use lorder and tsort to order the libraries."
19997 : check for type of arguments to select.
19998 case "$selecttype" in
19999 '') case "$d_select" in
20003 Checking to see what type of arguments are accepted by select().
20005 hdrs="$define sys/types.h
20006 $i_systime sys/time.h
20007 $i_sysselct sys/select.h
20008 $d_socket sys/socket.h"
20009 : The first arg can be int, unsigned, or size_t
20010 : The last arg may or may not be 'const'
20012 : void pointer has been seen but using that
20013 : breaks the selectminbits test
20014 for xxx in 'fd_set *' 'int *'; do
20015 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
20016 for tmo in 'struct timeval *' 'const struct timeval *'; do
20018 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
20019 if ./protochk "$try" $hdrs; then
20020 echo "Your system accepts $xxx."
20029 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
20030 case "$d_fd_set" in
20031 $define) dflt="fd_set *" ;;
20040 *) : no select, so pick a harmless default
20047 : check for the select 'width'
20048 case "$selectminbits" in
20049 '') safebits=`expr $ptrsize \* 8`
20050 case "$d_select" in
20054 Checking to see on how many bits at a time your select() operates...
20057 #include <sys/types.h>
20059 #$i_systime I_SYS_TIME
20060 #$i_systimek I_SYS_TIME_KERNEL
20065 # ifdef I_SYS_TIME_KERNEL
20068 # include <sys/time.h>
20069 # ifdef I_SYS_TIME_KERNEL
20073 #$i_sysselct I_SYS_SELECT
20074 #ifdef I_SYS_SELECT
20075 #include <sys/select.h>
20077 #$d_socket HAS_SOCKET
20079 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
20082 #$i_stdlib I_STDLIB
20084 #include <stdlib.h>
20087 #define S sizeof(*(b))
20089 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
20090 #define NBITS (NBYTES * 8)
20092 char *s = (char *)malloc(NBYTES);
20101 fp = fopen("try.c", "r");
20107 b = ($selecttype)s;
20108 for (i = 0; i < NBITS; i++)
20112 select(fd + 1, b, 0, 0, &t);
20113 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
20115 printf("%d\n", i + 1);
20120 if eval $compile_ok; then
20121 selectminbits=`$run ./try`
20122 case "$selectminbits" in
20124 Cannot figure out on how many bits at a time your select() operates.
20125 I'll play safe and guess it is $safebits bits.
20127 selectminbits=$safebits
20128 bits="$safebits bits"
20131 *) bits="$selectminbits bits" ;;
20133 echo "Your select() operates on $bits at a time." >&4
20135 rp='What is the minimum number of bits your select() operates on?'
20136 case "$byteorder" in
20137 12345678) dflt=64 ;;
20143 selectminbits="$val"
20147 *) : no select, so pick a harmless default
20148 selectminbits=$safebits
20154 : Trace out the files included by signal.h, then look for SIGxxx names.
20155 if [ "X$fieldn" = X ]; then
20156 : Just make some guesses. We check them later.
20157 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
20159 xxx=`echo '#include <signal.h>' |
20160 $cppstdin $cppminus $cppflags 2>/dev/null |
20161 $grep '^[ ]*#.*include' |
20162 $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
20163 $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
20166 for xx in $xxx /dev/null ; do
20167 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
20169 case "$xxxfiles" in
20170 '') xxxfiles=`./findhdr signal.h` ;;
20173 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
20174 print substr($2, 4, 20)
20176 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
20177 print substr($3, 4, 20)
20179 : Append some common names just in case the awk scan failed.
20180 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
20181 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
20182 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
20183 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
20184 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
20186 : generate a few handy files for later
20187 $cat > signal.c <<EOCP
20188 #include <sys/types.h>
20189 #include <signal.h>
20190 #$i_stdlib I_STDLIB
20192 #include <stdlib.h>
20197 /* Strange style to avoid deeply-nested #if/#else/#endif */
20200 # define NSIG (_NSIG)
20206 # define NSIG (SIGMAX+1)
20212 # define NSIG (SIG_MAX+1)
20218 # define NSIG (_SIG_MAX+1)
20224 # define NSIG (MAXSIG+1)
20230 # define NSIG (MAX_SIG+1)
20235 # ifdef SIGARRAYSIZE
20236 # define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
20242 # define NSIG (_sys_nsig) /* Solaris 2.5 */
20246 /* Default to some arbitrary number that's big enough to get most
20247 of the common signals.
20253 printf("NSIG %d\n", NSIG);
20259 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
20261 printf "#ifdef SIG"; printf $1; printf "\n"
20262 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
20263 printf $1; printf ");\n"
20267 printf "#endif /* JUST_NSIG */\n";
20268 printf "exit(0);\n}\n";
20271 $cat >signal.awk <<'EOP'
20272 BEGIN { ndups = 0 }
20273 $1 ~ /^NSIG$/ { nsig = $2 }
20274 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
20275 if ($2 > maxsig) { maxsig = $2 }
20276 if (sig_name[$2]) {
20277 dup_name[ndups] = $1
20278 dup_num[ndups] = $2
20290 printf("NSIG %d\n", nsig);
20291 for (n = 1; n < nsig; n++) {
20293 printf("%s %d\n", sig_name[n], sig_num[n])
20296 printf("NUM%d %d\n", n, n)
20299 for (n = 0; n < ndups; n++) {
20300 printf("%s %d\n", dup_name[n], dup_num[n])
20304 $cat >signal_cmd <<EOS
20306 if $test -s signal.lst; then
20307 echo "Using your existing signal.lst file"
20312 $cat >>signal_cmd <<'EOS'
20315 if eval $compile_ok; then
20316 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) |\
20317 $uniq | $awk -f signal.awk >signal.lst
20319 echo "(I can't seem be able to compile the whole test program)" >&4
20320 echo "(I'll try it in little pieces.)" >&4
20321 set signal -DJUST_NSIG
20322 if eval $compile_ok; then
20323 $run ./signal$_exe > signal.nsg
20326 echo "I can't seem to figure out how many signals you have." >&4
20327 echo "Guessing 50." >&4
20328 echo 'NSIG 50' > signal.nsg
20330 : Now look at all the signal names, one at a time.
20331 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
20332 $cat > signal.c <<EOCP
20333 #include <sys/types.h>
20334 #include <signal.h>
20337 printf("$xx %d\n", SIG${xx});
20342 if eval $compile; then
20343 echo "SIG${xx} found."
20344 $run ./signal$_exe >> signal.ls1
20346 echo "SIG${xx} NOT found."
20349 if $test -s signal.ls1; then
20350 $cat signal.nsg signal.ls1 |
20351 $sort -n | $uniq | $awk -f signal.awk >signal.lst
20355 if $test -s signal.lst; then
20358 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
20359 echo 'kill -l' >signal
20360 set X `csh -f <signal`
20364 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
20366 echo $@ | $tr ' ' $trnl | \
20367 $awk '{ printf "%s %d\n", $1, ++s; }
20368 END { printf "NSIG %d\n", ++s }' >signal.lst
20370 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
20372 chmod a+x signal_cmd
20373 $eunicefix signal_cmd
20375 : generate list of signal names
20377 case "$sig_name_init" in
20379 *) case "$sig_num_init" in
20380 ''|*,*) doinit=yes ;;
20385 echo "Generating a list of signal names and numbers..." >&4
20387 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
20388 sig_name=`$awk 'BEGIN { printf "ZERO " }
20389 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
20390 sig_num=`$awk 'BEGIN { printf "0 " }
20391 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
20392 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
20393 !/^NSIG/ { printf "\"%s\", ", $1 }
20394 END { printf "0\n" }' signal.lst`
20395 sig_num_init=`$awk 'BEGIN { printf "0, " }
20396 !/^NSIG/ { printf "%d, ", $2}
20397 END { printf "0\n"}' signal.lst`
20400 echo "The following $sig_count signals are available:"
20402 echo $sig_name | $awk \
20403 'BEGIN { linelen = 0 }
20405 for (i = 1; i <= NF; i++) {
20406 name = "SIG" $i " "
20407 linelen = linelen + length(name)
20408 if (linelen > 70) {
20410 linelen = length(name)
20416 sig_size=`echo $sig_name | awk '{print NF}'`
20417 $rm -f signal signal.c signal.awk signal.lst signal_cmd
20419 : Check size of size
20421 case "$sizetype" in
20422 *_t) zzz="$sizetype" ;;
20423 *) zzz="filesize" ;;
20425 echo "Checking the size of $zzz..." >&4
20427 #include <sys/types.h>
20429 #$i_stdlib I_STDLIB
20431 #include <stdlib.h>
20434 printf("%d\n", (int)sizeof($sizetype));
20439 if eval $compile_ok; then
20443 echo "(I can't execute the test program--guessing $sizesize.)" >&4
20446 echo "Your $zzz size is $sizesize bytes."
20451 echo "(I can't compile the test program--guessing $sizesize.)" >&4
20455 : check for socklen_t
20457 echo "Checking to see if you have socklen_t..." >&4
20459 #include <sys/types.h>
20460 #$d_socket HAS_SOCKET
20462 #include <sys/socket.h>
20464 int main() { socklen_t x = 16; }
20467 if eval $compile; then
20469 echo "You have socklen_t."
20472 echo "You do not have socklen_t."
20473 case "$sizetype" in
20474 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
20481 : see if this is a socks.h system
20482 set socks.h i_socks
20485 : check for type of the size argument to socket calls
20486 case "$d_socket" in
20490 Checking to see what type is the last argument of accept().
20493 case "$d_socklen_t" in
20494 "$define") yyy="$yyy socklen_t"
20496 yyy="$yyy $sizetype int long unsigned"
20497 for xxx in $yyy; do
20498 case "$socksizetype" in
20499 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
20500 case "$usesocks" in
20502 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
20503 echo "Your system accepts '$xxx *' for the last argument of accept()."
20504 socksizetype="$xxx"
20507 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
20508 echo "Your system accepts '$xxx *' for the last argument of accept()."
20509 socksizetype="$xxx"
20516 : In case none of those worked, prompt the user.
20517 case "$socksizetype" in
20518 '') rp='What is the type for socket address structure sizes?'
20525 *) : no sockets, so pick relatively harmless default
20530 : see what type is used for signed size_t
20531 set ssize_t ssizetype int stdio.h sys/types.h
20536 #$i_stdlib I_STDLIB
20538 #include <stdlib.h>
20540 #include <sys/types.h>
20541 #define Size_t $sizetype
20542 #define SSize_t $dflt
20545 if (sizeof(Size_t) == sizeof(SSize_t))
20547 else if (sizeof(Size_t) == sizeof(int))
20556 if eval $compile_ok && $run ./try > /dev/null; then
20557 ssizetype=`$run ./try`
20558 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20561 Help! I can't compile and run the ssize_t test program: please enlighten me!
20562 (This is probably a misconfiguration in your system or libraries, and
20563 you really ought to fix it. Still, I'll try anyway.)
20565 I need a type that is the same size as $sizetype, but is guaranteed to
20566 be signed. Common values are ssize_t, int and long.
20569 rp="What signed type is the same size as $sizetype?"
20575 : see what type of char stdio uses.
20577 echo '#include <stdio.h>' > stdio.c
20578 $cppstdin $cppminus < stdio.c > stdioh
20579 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20580 echo "Your stdio uses unsigned chars." >&4
20581 stdchar="unsigned char"
20583 echo "Your stdio uses signed chars." >&4
20586 $rm -f stdio.* stdioh
20588 : see what type uids are declared as in the kernel
20590 echo "Looking for the type for user ids returned by getuid()."
20591 set uid_t uidtype xxx stdio.h sys/types.h
20595 xxx=`./findhdr sys/user.h`
20596 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20598 unsigned) dflt="$1 $2" ;;
20602 *) dflt="$uidtype";;
20605 uid_t) echo "uid_t found." ;;
20606 *) rp="What is the type for user ids returned by getuid()?"
20612 : Check size of UID
20615 *_t) zzz="$uidtype" ;;
20618 echo "Checking the size of $zzz..." >&4
20620 #include <sys/types.h>
20622 #$i_stdlib I_STDLIB
20624 #include <stdlib.h>
20627 printf("%d\n", (int)sizeof($uidtype));
20632 if eval $compile_ok; then
20636 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20639 echo "Your $zzz is $uidsize bytes long."
20644 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20647 : Check if UID is signed
20650 *_t) zzz="$uidtype" ;;
20653 echo "Checking the sign of $zzz..." >&4
20655 #include <sys/types.h>
20666 if eval $compile; then
20670 echo "(I can't execute the test program--guessing unsigned.)" >&4
20674 1) echo "Your $zzz is unsigned." ;;
20675 -1) echo "Your $zzz is signed." ;;
20681 echo "(I can't compile the test program--guessing unsigned.)" >&4
20685 : Check format string for UID
20687 $echo "Checking the format string to be used for uids..." >&4
20690 -1) if $test X"$uidsize" = X"$ivsize"; then
20691 uidformat="$ivdformat"
20693 if $test X"$uidsize" = X"$longsize"; then
20696 if $test X"$uidsize" = X"$intsize"; then
20699 if $test X"$uidsize" = X"$shortsize"; then
20706 *) if $test X"$uidsize" = X"$uvsize"; then
20707 uidformat="$uvuformat"
20709 if $test X"$uidsize" = X"$longsize"; then
20712 if $test X"$uidsize" = X"$intsize"; then
20715 if $test X"$uidsize" = X"$shortsize"; then
20724 : Check if site customization support was requested
20725 case "$usesitecustomize" in
20726 $define|true|[Yy]*)
20727 usesitecustomize="$define"
20730 usesitecustomize="$undef"
20734 : determine compiler compiler
20743 if $test -f "$byacc$_exe"; then
20745 comp="byacc or $comp"
20747 if $test -f "$bison$_exe"; then
20748 comp="$comp or bison -y"
20750 rp="Which compiler compiler ($comp) shall I use?"
20759 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20765 : see if this is a assert.h system
20766 set assert.h i_assert
20769 : see if this is a fp.h system
20773 : see if this is a fp_class.h system
20774 set fp_class.h i_fp_class
20777 : see if gdbm.h is available
20782 : see if gdbm_open exists
20783 set gdbm_open d_gdbm_open
20785 case "$d_gdbm_open" in
20788 echo "We won't be including <gdbm.h>"
20797 : see if this is a ieeefp.h system
20798 case "$i_ieeefp" in
20799 '' ) set ieeefp.h i_ieeefp
20804 : see if this is a libutil.h system
20805 set libutil.h i_libutil
20808 : see if mach cthreads are available
20809 if test "X$usethreads" = "X$define"; then
20810 set mach/cthreads.h i_machcthr
20813 i_machcthr="$undef"
20816 : see if this is a mntent.h system
20817 set mntent.h i_mntent
20820 : see if ndbm.h is available
20826 # Some Linux distributions such as RedHat 7.1 put the
20827 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20828 if $test -f /usr/include/gdbm/ndbm.h; then
20829 echo '<gdbm/ndbm.h> found.'
20830 ccflags="$ccflags -I/usr/include/gdbm"
20831 cppflags="$cppflags -I/usr/include/gdbm"
20839 : see if dbm_open exists
20840 set dbm_open d_dbm_open
20842 case "$d_dbm_open" in
20845 echo "We won't be including <ndbm.h>"
20854 : see if net/errno.h is available
20856 set net/errno.h val
20859 : Unfortunately, it causes problems on some systems. Arrgh.
20862 cat > try.c <<'EOM'
20865 #include <net/errno.h>
20871 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20872 echo "We'll be including <net/errno.h>." >&4
20874 echo "We won't be including <net/errno.h>." >&4
20883 : see if netinet/tcp.h is available
20884 set netinet/tcp.h i_netinettcp
20887 : see if this is a poll.h system
20891 : see if this is a prot.h system
20895 : Preprocessor symbols
20897 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20898 $cat <<'EOSH' > Cppsym.know
20899 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20900 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20901 alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20902 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20903 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20904 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20905 bull c cadmus clipper CMU COFF COMPILER_VERSION
20906 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20907 CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20908 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20909 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20911 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20912 H3050R H3050RX hbullx20 hcx host_mips
20913 hp200 hp300 hp700 HP700 hp800 hp9000
20914 hp9000s200 hp9000s300 hp9000s400 hp9000s500
20915 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20916 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20917 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20918 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20919 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20920 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20921 LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20922 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20923 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20924 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20925 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20926 MATH_HAS_NO_SIDE_EFFECTS
20927 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20928 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20929 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20930 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20931 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20932 NetBSD news1500 news1700 news1800 news1900 news3700
20933 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20934 ns32016 ns32332 ns32k nsc32000
20935 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20936 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20937 pc532 pdp11 PGC PIC plexus PORTAR posix
20938 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20939 POSIX_C_SOURCE POSIX_SOURCE POWER
20940 PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
20941 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20942 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20943 sony sony_news sonyrisc sparc sparclite spectrum
20944 stardent stdc STDC_EXT stratos sun sun3 sun386
20945 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20946 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20947 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20948 sysV68 sysV88 Tek4132 Tek4300 titan
20949 TM3200 TM5400 TM5600
20950 tower tower32 tower32_200 tower32_600 tower32_700
20951 tower32_800 tower32_850 tss
20952 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20953 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20954 unix UNIX95 UNIX99 unixpc unos
20955 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20956 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20957 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20959 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20960 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20961 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20964 # Maybe put other stuff here too.
20965 cat <<EOSH >>Cppsym.know
20968 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20969 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20970 $cat Cppsym.know > Cppsym.c
20971 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20972 $rm -f Cppsym.a Cppsym.b Cppsym.c
20973 cat <<EOSH > Cppsym
20975 if $test \$# -gt 0; then
20976 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20977 if $test -s Cppsym.got; then
20984 $tr " " "$trnl" | ./Cppsym.try
20990 cat <<EOSH > Cppsym.try
20992 cat <<'EOCP' > try.c
20995 #define STRINGIFY(a) "a"
20997 #if cpp_stuff == 42
20998 #define StGiFy(a) #a
20999 #define STRINGIFY(a) StGiFy(a)
21001 #if $cpp_stuff != 1 && $cpp_stuff != 42
21002 # include "Bletch: How does this C preprocessor stringify macros?"
21008 cat <<'EOSH' >> Cppsym.try
21010 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
21011 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
21012 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
21013 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
21015 echo 'return 0;}' >> try.c
21017 cat <<EOSH >> Cppsym.try
21019 case "$osname-$gccversion" in
21020 irix-) ccflags="\$ccflags -woff 1178" ;;
21021 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
21023 $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
21025 chmod +x Cppsym.try
21026 $eunicefix Cppsym.try
21027 ./Cppsym < Cppsym.know > Cppsym.true
21028 : Add in any linux cpp "predefined macros":
21029 case "$osname::$gccversion" in
21032 rm -f $tHdrH'.h' $tHdrH
21034 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
21035 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
21036 if [ -s $tHdrH'_cppsym.real' ]; then
21037 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
21040 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
21043 : now check the C compiler for additional symbols
21044 postprocess_cc_v=''
21046 aix) postprocess_cc_v="|$tr , ' '" ;;
21053 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
21056 -D*) echo "\$i" | $sed 's/^-D//';;
21057 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
21062 postprocess_cc_v=''
21065 ./ccsym > ccsym1.raw
21066 if $test -s ccsym1.raw; then
21067 $sort ccsym1.raw | $uniq >ccsym.raw
21069 mv ccsym1.raw ccsym.raw
21072 $awk '/\=/ { print $0; next }
21073 { print $0"=1" }' ccsym.raw >ccsym.list
21074 $comm -13 Cppsym.true ccsym.list >ccsym.own
21075 $comm -12 Cppsym.true ccsym.list >ccsym.com
21076 $comm -23 Cppsym.true ccsym.list >ccsym.cpp
21078 if $test -z ccsym.raw; then
21079 echo "Your C compiler doesn't seem to define any symbols!" >&4
21081 echo "However, your C preprocessor defines the following symbols:"
21084 cppsymbols=`$cat Cppsym.true`
21085 cppsymbols=`echo $cppsymbols`
21086 cppccsymbols="$cppsymbols"
21088 if $test -s ccsym.com; then
21089 echo "Your C compiler and pre-processor define these symbols:"
21090 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
21093 cppccsymbols=`$cat ccsym.com`
21094 cppccsymbols=`echo $cppccsymbols`
21095 $test "$silent" || sleep 1
21097 if $test -s ccsym.cpp; then
21098 $test "$also" && echo " "
21099 echo "Your C pre-processor ${also}defines the following symbols:"
21100 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
21102 cppsymbols=`$cat ccsym.cpp`
21103 cppsymbols=`echo $cppsymbols`
21104 $test "$silent" || sleep 1
21106 if $test -s ccsym.own; then
21107 $test "$also" && echo " "
21108 echo "Your C compiler ${also}defines the following cpp symbols:"
21109 $sed -e 's/\(..*\)=1/\1/' ccsym.own
21110 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
21111 ccsymbols=`$cat ccsym.own`
21112 ccsymbols=`echo $ccsymbols`
21113 $test "$silent" || sleep 1
21117 : see if this is a termio system
21121 if $test `./findhdr termios.h`; then
21122 set tcsetattr i_termios
21128 "$define") echo "You have POSIX termios.h... good!" >&4;;
21129 *) if ./Cppsym pyr; then
21130 case "`/bin/universe`" in
21131 ucb) if $test `./findhdr sgtty.h`; then
21133 echo "<sgtty.h> found." >&4
21135 echo "System is pyramid with BSD universe."
21136 ./warn "<sgtty.h> not found--you could have problems."
21138 *) if $test `./findhdr termio.h`; then
21140 echo "<termio.h> found." >&4
21142 echo "System is pyramid with USG universe."
21143 ./warn "<termio.h> not found--you could have problems."
21147 if $test `./findhdr termio.h`; then
21148 echo "<termio.h> found." >&4
21150 elif $test `./findhdr sgtty.h`; then
21151 echo "<sgtty.h> found." >&4
21154 ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
21157 if $test `./findhdr sgtty.h`; then
21158 echo "<sgtty.h> found." >&4
21160 elif $test `./findhdr termio.h`; then
21161 echo "<termio.h> found." >&4
21164 ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
21168 set i_termio; eval $setvar
21169 val=$val2; set i_sgtty; eval $setvar
21170 val=$val3; set i_termios; eval $setvar
21172 : see if stddef is available
21173 set stddef.h i_stddef
21176 : see if sys/access.h is available
21177 set sys/access.h i_sysaccess
21180 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
21181 set sys/filio.h i_sysfilio
21184 if $test `./findhdr sys/ioctl.h`; then
21186 echo '<sys/ioctl.h> found.' >&4
21189 if $test $i_sysfilio = "$define"; then
21190 echo '<sys/ioctl.h> NOT found.' >&4
21192 $test $i_sgtty = "$define" && xxx="sgtty.h"
21193 $test $i_termio = "$define" && xxx="termio.h"
21194 $test $i_termios = "$define" && xxx="termios.h"
21195 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
21201 : see if socket ioctl defs are in sys/sockio.h
21203 xxx=`./findhdr sys/sockio.h`
21204 if $test "$xxx"; then
21205 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
21207 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
21210 echo "No socket ioctls found in <sys/sockio.h>." >&4
21215 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
21221 : see if this is a syslog.h system
21222 set syslog.h i_syslog
21225 : see if this is a sys/mode.h system
21226 set sys/mode.h i_sysmode
21229 : see if there is a sys/poll.h file
21230 set sys/poll.h i_syspoll
21233 : see if sys/resource.h has to be included
21234 set sys/resource.h i_sysresrc
21237 : see if sys/security.h is available
21238 set sys/security.h i_syssecrt
21241 : see if this is a sys/statvfs.h system
21242 set sys/statvfs.h i_sysstatvfs
21245 : see if this is a sys/un.h system
21246 set sys/un.h i_sysun
21249 : see if this is a sys/utsname.h system
21250 set sys/utsname.h i_sysutsname
21253 : see if this is a syswait system
21254 set sys/wait.h i_syswait
21257 : see if this is a ustat.h system
21258 set ustat.h i_ustat
21261 : see if this is an utime system
21262 set utime.h i_utime
21265 : see if this is a values.h system
21266 set values.h i_values
21269 : see if this is a vfork system
21272 set vfork.h i_vfork
21282 echo "Looking for extensions..." >&4
21283 : If we are using the old config.sh, known_extensions may contain
21284 : old or inaccurate or duplicate values.
21285 known_extensions=''
21286 nonxs_extensions=''
21287 : We do not use find because it might not be available.
21288 : We do not just use MANIFEST because the user may have dropped
21289 : some additional extensions into the source tree and expect them
21292 : Function to recursively find available extensions, ignoring DynaLoader
21293 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
21297 DynaLoader|dynaload) ;;
21299 if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
21300 known_extensions="$known_extensions $1$xxx";
21301 elif $test -f $xxx/Makefile.PL; then
21302 nonxs_extensions="$nonxs_extensions $1$xxx";
21304 if $test -d $xxx -a $# -lt 10; then
21307 eval $find_extensions;
21319 eval $find_extensions
21320 # Special case: Add in modules that nest beyond the first level.
21321 # Currently threads/shared and Hash/Util/FieldHash, since they are
21322 # not picked up by the recursive find above (and adding in general
21323 # recursive finding breaks SDBM_File/sdbm).
21324 # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
21325 known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
21326 set X $known_extensions
21328 known_extensions="$*"
21329 set X $nonxs_extensions
21331 nonxs_extensions="$*"
21334 : Now see which are supported on this system.
21336 for xxx in $known_extensions ; do
21340 $define) avail_ext="$avail_ext $xxx" ;;
21343 GDBM_File|gdbm_fil)
21345 $define) avail_ext="$avail_ext $xxx" ;;
21348 I18N/Langinfo|i18n_lan)
21349 case "$i_langinfo$d_nl_langinfo" in
21350 $define$define) avail_ext="$avail_ext $xxx" ;;
21354 : XXX Do we need a useipcsysv variable here
21355 case "${d_msg}${d_sem}${d_shm}" in
21356 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
21359 NDBM_File|ndbm_fil)
21362 case "$osname-$use64bitint" in
21365 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
21368 *) avail_ext="$avail_ext $xxx" ;;
21373 ODBM_File|odbm_fil)
21374 case "${i_dbm}${i_rpcsvcdbm}" in
21376 case "$d_cplusplus" in
21377 define) ;; # delete as a function name will not work
21378 *) case "$osname-$use64bitint" in
21381 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
21384 *) avail_ext="$avail_ext $xxx" ;;
21392 case "$useopcode" in
21393 true|define|y) avail_ext="$avail_ext $xxx" ;;
21397 case "$useposix" in
21398 true|define|y) avail_ext="$avail_ext $xxx" ;;
21402 case "$d_socket" in
21405 beos) ;; # not unless BONE
21406 *) avail_ext="$avail_ext $xxx" ;;
21411 Sys/Syslog|sys/syslog)
21412 : XXX syslog requires socket
21413 case "$d_socket" in
21414 true|$define|y) avail_ext="$avail_ext $xxx" ;;
21418 case "$usethreads" in
21420 case "$use5005threads" in
21421 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
21425 threads|threads/shared)
21426 # threads and threads::shared are special cases.
21427 # To stop people from asking "Perl 5.8.0 was supposed
21428 # to have this new fancy threads implementation but my
21429 # perl doesn't have it" and from people trying to
21430 # (re)install the threads module using CPAN.pm and
21431 # CPAN.pm then offering to reinstall Perl 5.8.0,
21432 # the threads.pm and threads/shared.pm will always be
21433 # there, croaking informatively ("you need to rebuild
21434 # all of Perl with threads, sorry") when threads haven't
21435 # been compiled in.
21437 avail_ext="$avail_ext $xxx"
21441 cygwin) avail_ext="$avail_ext $xxx" ;;
21444 XS/APItest|xs/apitest)
21445 # This is just for testing. Skip it unless we have dynamic loading.
21448 $define) avail_ext="$avail_ext $xxx" ;;
21451 XS/Typemap|xs/typemap)
21452 # This is just for testing. Skip it unless we have dynamic loading.
21454 $define) avail_ext="$avail_ext $xxx" ;;
21457 *) avail_ext="$avail_ext $xxx"
21466 case "$onlyextensions" in
21468 *) keepextensions=''
21469 echo "You have requested that only certains extensions be included..." >&4
21470 for i in $onlyextensions; do
21471 case " $avail_ext " in
21473 echo "Keeping extension $i."
21474 keepextensions="$keepextensions $i"
21476 *) echo "Ignoring extension $i." ;;
21479 avail_ext="$keepextensions"
21483 case "$noextensions" in
21485 *) keepextensions=''
21486 echo "You have requested that certain extensions be ignored..." >&4
21487 for i in $avail_ext; do
21488 case " $noextensions " in
21489 *" $i "*) echo "Ignoring extension $i." ;;
21490 *) echo "Keeping extension $i.";
21491 keepextensions="$keepextensions $i"
21495 avail_ext="$keepextensions"
21499 : Now see which nonxs extensions are supported on this system.
21500 : For now assume all are.
21502 for xxx in $nonxs_extensions ; do
21504 *) nonxs_ext="$nonxs_ext $xxx"
21516 A number of extensions are supplied with $package. You may choose to
21517 compile these extensions for dynamic loading (the default), compile
21518 them into the $package executable (static loading), or not include
21519 them at all. Answer "none" to include no extensions.
21520 Note that DynaLoader is always built and need not be mentioned here.
21523 case "$dynamic_ext" in
21525 : Exclude those listed in static_ext
21527 for xxx in $avail_ext; do
21528 case " $static_ext " in
21530 *) dflt="$dflt $xxx" ;;
21537 *) dflt="$dynamic_ext"
21538 # Perhaps we are reusing an old out-of-date config.sh.
21541 if test X"$dynamic_ext" != X"$avail_ext"; then
21543 NOTICE: Your previous config.sh list may be incorrect.
21544 The extensions now available to you are
21546 but the default list from your previous config.sh is
21558 rp="What extensions do you wish to load dynamically?"
21561 none) dynamic_ext=' ' ;;
21562 *) dynamic_ext="$ans" ;;
21565 case "$static_ext" in
21567 : Exclude those already listed in dynamic linking
21569 for xxx in $avail_ext; do
21570 case " $dynamic_ext " in
21572 *) dflt="$dflt $xxx" ;;
21579 *) dflt="$static_ext"
21586 rp="What extensions do you wish to load statically?"
21589 none) static_ext=' ' ;;
21590 *) static_ext="$ans" ;;
21595 A number of extensions are supplied with $package. Answer "none"
21596 to include no extensions.
21597 Note that DynaLoader is always built and need not be mentioned here.
21600 case "$static_ext" in
21601 '') dflt="$avail_ext" ;;
21602 *) dflt="$static_ext"
21603 # Perhaps we are reusing an old out-of-date config.sh.
21606 if test X"$static_ext" != X"$avail_ext"; then
21608 NOTICE: Your previous config.sh list may be incorrect.
21609 The extensions now available to you are
21611 but the default list from your previous config.sh is
21620 : Exclude those that are not xs extensions
21624 rp="What extensions do you wish to include?"
21627 none) static_ext=' ' ;;
21628 *) static_ext="$ans" ;;
21633 # Encode is a special case. If we are building Encode as a static
21634 # extension, we need to explicitly list its subextensions as well.
21635 # For other nested extensions, this is handled automatically by
21636 # the appropriate Makefile.PL.
21637 case " $static_ext " in
21638 *" Encode "*) # Add the subextensions of Encode
21640 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21641 static_ext="$static_ext Encode/$xxx"
21647 set X $dynamic_ext $static_ext $nonxs_ext
21651 # Sanity check: We require an extension suitable for use with
21652 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21653 # should show up as failures in the test suite, but it's helpful to
21654 # catch them now.) The 'extensions' list is normally sorted
21655 # alphabetically, so we need to accept either
21656 # DB_File ... Fcntl ... IO ....
21657 # or something like
21658 # Fcntl ... NDBM_File ... IO ....
21659 case " $extensions" in
21660 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
21661 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21662 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21663 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21664 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21668 : Remove libraries needed only for extensions
21669 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21670 : The exception is SunOS 4.x, which needs them.
21671 case "${osname}X${osvers}" in
21675 *) case "$usedl" in
21676 $define|true|[yY]*)
21677 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21681 *) perllibs="$libs"
21687 : Remove build directory name from cppstdin so it can be used from
21688 : either the present location or the final installed location.
21690 : Get out of the UU directory to get correct path name.
21692 case "$cppstdin" in
21694 echo "Stripping down cppstdin path name"
21700 : end of configuration questions
21702 echo "End of configuration questions."
21705 : back to where it started
21706 if test -d ../UU; then
21710 : configuration may be unconditionally patched via a 'config.arch' file
21711 if $test -f config.arch; then
21712 echo "I see a config.arch file, loading it." >&4
21716 : configuration may be patched via a 'config.over' file
21717 if $test -f config.over; then
21720 rp='I see a config.over file. Do you wish to load it?'
21723 n*) echo "OK, I'll ignore it.";;
21725 echo "Configuration override changes have been loaded."
21730 : in case they want portability, strip down executable paths
21731 case "$d_portable" in
21734 echo "Stripping down executable paths..." >&4
21735 for file in $loclist $trylist; do
21737 eval $file=`basename $temp`
21742 : create config.sh file
21744 echo "Creating config.sh..." >&4
21745 $spitshell <<EOT >config.sh
21748 # This file was produced by running the Configure script. It holds all the
21749 # definitions figured out by Configure. Should you modify one of these values,
21750 # do not forget to propagate your changes by running "Configure -der". You may
21751 # instead choose to run each of the .SH files by yourself, or "Configure -S".
21754 # Package name : $package
21755 # Source directory : $src
21756 # Configuration time: $cf_time
21757 # Configured by : $cf_by
21758 # Target system : $myuname
21761 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21762 $spitshell <<EOT >>config.sh
21771 Revision='$Revision'
21779 alignbytes='$alignbytes'
21780 ansi2knr='$ansi2knr'
21781 aphostname='$aphostname'
21782 api_revision='$api_revision'
21783 api_subversion='$api_subversion'
21784 api_version='$api_version'
21785 api_versionstring='$api_versionstring'
21788 archlibexp='$archlibexp'
21789 archname64='$archname64'
21790 archname='$archname'
21791 archobjs='$archobjs'
21792 asctime_r_proto='$asctime_r_proto'
21800 byteorder='$byteorder'
21802 castflags='$castflags'
21805 cccdlflags='$cccdlflags'
21806 ccdlflags='$ccdlflags'
21808 ccflags_uselargefiles='$ccflags_uselargefiles'
21810 ccsymbols='$ccsymbols'
21811 ccversion='$ccversion'
21813 cf_email='$cf_email'
21818 clocktype='$clocktype'
21820 compress='$compress'
21821 contains='$contains'
21825 cpp_stuff='$cpp_stuff'
21826 cppccsymbols='$cppccsymbols'
21827 cppflags='$cppflags'
21829 cppminus='$cppminus'
21831 cppstdin='$cppstdin'
21832 cppsymbols='$cppsymbols'
21833 crypt_r_proto='$crypt_r_proto'
21834 cryptlib='$cryptlib'
21836 ctermid_r_proto='$ctermid_r_proto'
21837 ctime_r_proto='$ctime_r_proto'
21838 d_Gconvert='$d_Gconvert'
21839 d_PRIEUldbl='$d_PRIEUldbl'
21840 d_PRIFUldbl='$d_PRIFUldbl'
21841 d_PRIGUldbl='$d_PRIGUldbl'
21842 d_PRIXU64='$d_PRIXU64'
21843 d_PRId64='$d_PRId64'
21844 d_PRIeldbl='$d_PRIeldbl'
21845 d_PRIfldbl='$d_PRIfldbl'
21846 d_PRIgldbl='$d_PRIgldbl'
21847 d_PRIi64='$d_PRIi64'
21848 d_PRIo64='$d_PRIo64'
21849 d_PRIu64='$d_PRIu64'
21850 d_PRIx64='$d_PRIx64'
21851 d_SCNfldbl='$d_SCNfldbl'
21852 d__fwalk='$d__fwalk'
21853 d_access='$d_access'
21854 d_accessx='$d_accessx'
21857 d_archlib='$d_archlib'
21858 d_asctime_r='$d_asctime_r'
21861 d_attribute_format='$d_attribute_format'
21862 d_attribute_malloc='$d_attribute_malloc'
21863 d_attribute_nonnull='$d_attribute_nonnull'
21864 d_attribute_noreturn='$d_attribute_noreturn'
21865 d_attribute_pure='$d_attribute_pure'
21866 d_attribute_unused='$d_attribute_unused'
21867 d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21871 d_bsdgetpgrp='$d_bsdgetpgrp'
21872 d_bsdsetpgrp='$d_bsdsetpgrp'
21873 d_builtin_choose_expr='$d_builtin_choose_expr'
21874 d_builtin_expect='$d_builtin_expect'
21876 d_c99_variadic_macros='$d_c99_variadic_macros'
21877 d_casti32='$d_casti32'
21878 d_castneg='$d_castneg'
21879 d_charvspr='$d_charvspr'
21881 d_chroot='$d_chroot'
21882 d_chsize='$d_chsize'
21884 d_clearenv='$d_clearenv'
21885 d_closedir='$d_closedir'
21886 d_cmsghdr_s='$d_cmsghdr_s'
21888 d_copysignl='$d_copysignl'
21889 d_cplusplus='$d_cplusplus'
21891 d_crypt_r='$d_crypt_r'
21893 d_ctermid='$d_ctermid'
21894 d_ctermid_r='$d_ctermid_r'
21895 d_ctime_r='$d_ctime_r'
21896 d_cuserid='$d_cuserid'
21897 d_dbl_dig='$d_dbl_dig'
21898 d_dbminitproto='$d_dbminitproto'
21899 d_difftime='$d_difftime'
21900 d_dir_dd_fd='$d_dir_dd_fd'
21902 d_dirnamlen='$d_dirnamlen'
21903 d_dlerror='$d_dlerror'
21904 d_dlopen='$d_dlopen'
21905 d_dlsymun='$d_dlsymun'
21906 d_dosuid='$d_dosuid'
21907 d_drand48_r='$d_drand48_r'
21908 d_drand48proto='$d_drand48proto'
21910 d_eaccess='$d_eaccess'
21911 d_endgrent='$d_endgrent'
21912 d_endgrent_r='$d_endgrent_r'
21913 d_endhent='$d_endhent'
21914 d_endhostent_r='$d_endhostent_r'
21915 d_endnent='$d_endnent'
21916 d_endnetent_r='$d_endnetent_r'
21917 d_endpent='$d_endpent'
21918 d_endprotoent_r='$d_endprotoent_r'
21919 d_endpwent='$d_endpwent'
21920 d_endpwent_r='$d_endpwent_r'
21921 d_endsent='$d_endsent'
21922 d_endservent_r='$d_endservent_r'
21923 d_eofnblk='$d_eofnblk'
21924 d_eunice='$d_eunice'
21925 d_faststdio='$d_faststdio'
21926 d_fchdir='$d_fchdir'
21927 d_fchmod='$d_fchmod'
21928 d_fchown='$d_fchown'
21930 d_fcntl_can_lock='$d_fcntl_can_lock'
21931 d_fd_macros='$d_fd_macros'
21932 d_fd_set='$d_fd_set'
21933 d_fds_bits='$d_fds_bits'
21934 d_fgetpos='$d_fgetpos'
21935 d_finite='$d_finite'
21936 d_finitel='$d_finitel'
21937 d_flexfnam='$d_flexfnam'
21939 d_flockproto='$d_flockproto'
21941 d_fp_class='$d_fp_class'
21942 d_fpathconf='$d_fpathconf'
21943 d_fpclass='$d_fpclass'
21944 d_fpclassify='$d_fpclassify'
21945 d_fpclassl='$d_fpclassl'
21946 d_fpos64_t='$d_fpos64_t'
21947 d_frexpl='$d_frexpl'
21948 d_fs_data_s='$d_fs_data_s'
21949 d_fseeko='$d_fseeko'
21950 d_fsetpos='$d_fsetpos'
21951 d_fstatfs='$d_fstatfs'
21952 d_fstatvfs='$d_fstatvfs'
21954 d_ftello='$d_ftello'
21956 d_futimes='$d_futimes'
21957 d_getcwd='$d_getcwd'
21958 d_getespwnam='$d_getespwnam'
21959 d_getfsstat='$d_getfsstat'
21960 d_getgrent='$d_getgrent'
21961 d_getgrent_r='$d_getgrent_r'
21962 d_getgrgid_r='$d_getgrgid_r'
21963 d_getgrnam_r='$d_getgrnam_r'
21964 d_getgrps='$d_getgrps'
21965 d_gethbyaddr='$d_gethbyaddr'
21966 d_gethbyname='$d_gethbyname'
21967 d_gethent='$d_gethent'
21968 d_gethname='$d_gethname'
21969 d_gethostbyaddr_r='$d_gethostbyaddr_r'
21970 d_gethostbyname_r='$d_gethostbyname_r'
21971 d_gethostent_r='$d_gethostent_r'
21972 d_gethostprotos='$d_gethostprotos'
21973 d_getitimer='$d_getitimer'
21974 d_getlogin='$d_getlogin'
21975 d_getlogin_r='$d_getlogin_r'
21976 d_getmnt='$d_getmnt'
21977 d_getmntent='$d_getmntent'
21978 d_getnbyaddr='$d_getnbyaddr'
21979 d_getnbyname='$d_getnbyname'
21980 d_getnent='$d_getnent'
21981 d_getnetbyaddr_r='$d_getnetbyaddr_r'
21982 d_getnetbyname_r='$d_getnetbyname_r'
21983 d_getnetent_r='$d_getnetent_r'
21984 d_getnetprotos='$d_getnetprotos'
21985 d_getpagsz='$d_getpagsz'
21986 d_getpbyname='$d_getpbyname'
21987 d_getpbynumber='$d_getpbynumber'
21988 d_getpent='$d_getpent'
21989 d_getpgid='$d_getpgid'
21990 d_getpgrp2='$d_getpgrp2'
21991 d_getpgrp='$d_getpgrp'
21992 d_getppid='$d_getppid'
21993 d_getprior='$d_getprior'
21994 d_getprotobyname_r='$d_getprotobyname_r'
21995 d_getprotobynumber_r='$d_getprotobynumber_r'
21996 d_getprotoent_r='$d_getprotoent_r'
21997 d_getprotoprotos='$d_getprotoprotos'
21998 d_getprpwnam='$d_getprpwnam'
21999 d_getpwent='$d_getpwent'
22000 d_getpwent_r='$d_getpwent_r'
22001 d_getpwnam_r='$d_getpwnam_r'
22002 d_getpwuid_r='$d_getpwuid_r'
22003 d_getsbyname='$d_getsbyname'
22004 d_getsbyport='$d_getsbyport'
22005 d_getsent='$d_getsent'
22006 d_getservbyname_r='$d_getservbyname_r'
22007 d_getservbyport_r='$d_getservbyport_r'
22008 d_getservent_r='$d_getservent_r'
22009 d_getservprotos='$d_getservprotos'
22010 d_getspnam='$d_getspnam'
22011 d_getspnam_r='$d_getspnam_r'
22012 d_gettimeod='$d_gettimeod'
22013 d_gmtime_r='$d_gmtime_r'
22014 d_gnulibc='$d_gnulibc'
22015 d_grpasswd='$d_grpasswd'
22016 d_hasmntopt='$d_hasmntopt'
22018 d_ilogbl='$d_ilogbl'
22019 d_inc_version_list='$d_inc_version_list'
22021 d_inetaton='$d_inetaton'
22022 d_int64_t='$d_int64_t'
22023 d_isascii='$d_isascii'
22024 d_isfinite='$d_isfinite'
22027 d_isnanl='$d_isnanl'
22028 d_killpg='$d_killpg'
22029 d_lchown='$d_lchown'
22030 d_ldbl_dig='$d_ldbl_dig'
22031 d_libm_lib_version='$d_libm_lib_version'
22033 d_localtime_r='$d_localtime_r'
22034 d_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
22035 d_locconv='$d_locconv'
22037 d_longdbl='$d_longdbl'
22038 d_longlong='$d_longlong'
22039 d_lseekproto='$d_lseekproto'
22041 d_madvise='$d_madvise'
22042 d_malloc_good_size='$d_malloc_good_size'
22043 d_malloc_size='$d_malloc_size'
22045 d_mbstowcs='$d_mbstowcs'
22046 d_mbtowc='$d_mbtowc'
22047 d_memchr='$d_memchr'
22048 d_memcmp='$d_memcmp'
22049 d_memcpy='$d_memcpy'
22050 d_memmove='$d_memmove'
22051 d_memset='$d_memset'
22053 d_mkdtemp='$d_mkdtemp'
22054 d_mkfifo='$d_mkfifo'
22055 d_mkstemp='$d_mkstemp'
22056 d_mkstemps='$d_mkstemps'
22057 d_mktime='$d_mktime'
22060 d_modfl_pow32_bug='$d_modfl_pow32_bug'
22061 d_modflproto='$d_modflproto'
22062 d_mprotect='$d_mprotect'
22064 d_msg_ctrunc='$d_msg_ctrunc'
22065 d_msg_dontroute='$d_msg_dontroute'
22066 d_msg_oob='$d_msg_oob'
22067 d_msg_peek='$d_msg_peek'
22068 d_msg_proxy='$d_msg_proxy'
22069 d_msgctl='$d_msgctl'
22070 d_msgget='$d_msgget'
22071 d_msghdr_s='$d_msghdr_s'
22072 d_msgrcv='$d_msgrcv'
22073 d_msgsnd='$d_msgsnd'
22075 d_munmap='$d_munmap'
22076 d_mymalloc='$d_mymalloc'
22078 d_nl_langinfo='$d_nl_langinfo'
22079 d_nv_preserves_uv='$d_nv_preserves_uv'
22080 d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
22081 d_off64_t='$d_off64_t'
22082 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
22083 d_oldpthreads='$d_oldpthreads'
22084 d_oldsock='$d_oldsock'
22086 d_pathconf='$d_pathconf'
22088 d_perl_otherlibdirs='$d_perl_otherlibdirs'
22089 d_phostname='$d_phostname'
22092 d_portable='$d_portable'
22093 d_printf_format_null='$d_printf_format_null'
22094 d_procselfexe='$d_procselfexe'
22095 d_pseudofork='$d_pseudofork'
22096 d_pthread_atfork='$d_pthread_atfork'
22097 d_pthread_attr_setscope='$d_pthread_attr_setscope'
22098 d_pthread_yield='$d_pthread_yield'
22100 d_pwchange='$d_pwchange'
22101 d_pwclass='$d_pwclass'
22102 d_pwcomment='$d_pwcomment'
22103 d_pwexpire='$d_pwexpire'
22104 d_pwgecos='$d_pwgecos'
22105 d_pwpasswd='$d_pwpasswd'
22106 d_pwquota='$d_pwquota'
22109 d_random_r='$d_random_r'
22110 d_readdir64_r='$d_readdir64_r'
22111 d_readdir='$d_readdir'
22112 d_readdir_r='$d_readdir_r'
22113 d_readlink='$d_readlink'
22115 d_recvmsg='$d_recvmsg'
22116 d_rename='$d_rename'
22117 d_rewinddir='$d_rewinddir'
22119 d_safebcpy='$d_safebcpy'
22120 d_safemcpy='$d_safemcpy'
22121 d_sanemcmp='$d_sanemcmp'
22122 d_sbrkproto='$d_sbrkproto'
22123 d_scalbnl='$d_scalbnl'
22124 d_sched_yield='$d_sched_yield'
22125 d_scm_rights='$d_scm_rights'
22126 d_seekdir='$d_seekdir'
22127 d_select='$d_select'
22129 d_semctl='$d_semctl'
22130 d_semctl_semid_ds='$d_semctl_semid_ds'
22131 d_semctl_semun='$d_semctl_semun'
22132 d_semget='$d_semget'
22134 d_sendmsg='$d_sendmsg'
22135 d_setegid='$d_setegid'
22136 d_seteuid='$d_seteuid'
22137 d_setgrent='$d_setgrent'
22138 d_setgrent_r='$d_setgrent_r'
22139 d_setgrps='$d_setgrps'
22140 d_sethent='$d_sethent'
22141 d_sethostent_r='$d_sethostent_r'
22142 d_setitimer='$d_setitimer'
22143 d_setlinebuf='$d_setlinebuf'
22144 d_setlocale='$d_setlocale'
22145 d_setlocale_r='$d_setlocale_r'
22146 d_setnent='$d_setnent'
22147 d_setnetent_r='$d_setnetent_r'
22148 d_setpent='$d_setpent'
22149 d_setpgid='$d_setpgid'
22150 d_setpgrp2='$d_setpgrp2'
22151 d_setpgrp='$d_setpgrp'
22152 d_setprior='$d_setprior'
22153 d_setproctitle='$d_setproctitle'
22154 d_setprotoent_r='$d_setprotoent_r'
22155 d_setpwent='$d_setpwent'
22156 d_setpwent_r='$d_setpwent_r'
22157 d_setregid='$d_setregid'
22158 d_setresgid='$d_setresgid'
22159 d_setresuid='$d_setresuid'
22160 d_setreuid='$d_setreuid'
22161 d_setrgid='$d_setrgid'
22162 d_setruid='$d_setruid'
22163 d_setsent='$d_setsent'
22164 d_setservent_r='$d_setservent_r'
22165 d_setsid='$d_setsid'
22166 d_setvbuf='$d_setvbuf'
22170 d_shmatprototype='$d_shmatprototype'
22171 d_shmctl='$d_shmctl'
22173 d_shmget='$d_shmget'
22174 d_sigaction='$d_sigaction'
22175 d_signbit='$d_signbit'
22176 d_sigprocmask='$d_sigprocmask'
22177 d_sigsetjmp='$d_sigsetjmp'
22178 d_sitearch='$d_sitearch'
22179 d_snprintf='$d_snprintf'
22180 d_sockatmark='$d_sockatmark'
22181 d_sockatmarkproto='$d_sockatmarkproto'
22182 d_socket='$d_socket'
22183 d_socklen_t='$d_socklen_t'
22184 d_sockpair='$d_sockpair'
22185 d_socks5_init='$d_socks5_init'
22186 d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
22188 d_srand48_r='$d_srand48_r'
22189 d_srandom_r='$d_srandom_r'
22190 d_sresgproto='$d_sresgproto'
22191 d_sresuproto='$d_sresuproto'
22192 d_statblks='$d_statblks'
22193 d_statfs_f_flags='$d_statfs_f_flags'
22194 d_statfs_s='$d_statfs_s'
22195 d_statvfs='$d_statvfs'
22196 d_stdio_cnt_lval='$d_stdio_cnt_lval'
22197 d_stdio_ptr_lval='$d_stdio_ptr_lval'
22198 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
22199 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
22200 d_stdio_stream_array='$d_stdio_stream_array'
22201 d_stdiobase='$d_stdiobase'
22202 d_stdstdio='$d_stdstdio'
22203 d_strchr='$d_strchr'
22204 d_strcoll='$d_strcoll'
22205 d_strctcpy='$d_strctcpy'
22206 d_strerrm='$d_strerrm'
22207 d_strerror='$d_strerror'
22208 d_strerror_r='$d_strerror_r'
22209 d_strftime='$d_strftime'
22210 d_strlcat='$d_strlcat'
22211 d_strlcpy='$d_strlcpy'
22212 d_strtod='$d_strtod'
22213 d_strtol='$d_strtol'
22214 d_strtold='$d_strtold'
22215 d_strtoll='$d_strtoll'
22216 d_strtoq='$d_strtoq'
22217 d_strtoul='$d_strtoul'
22218 d_strtoull='$d_strtoull'
22219 d_strtouq='$d_strtouq'
22220 d_strxfrm='$d_strxfrm'
22221 d_suidsafe='$d_suidsafe'
22222 d_symlink='$d_symlink'
22223 d_syscall='$d_syscall'
22224 d_syscallproto='$d_syscallproto'
22225 d_sysconf='$d_sysconf'
22226 d_sysernlst='$d_sysernlst'
22227 d_syserrlst='$d_syserrlst'
22228 d_system='$d_system'
22229 d_tcgetpgrp='$d_tcgetpgrp'
22230 d_tcsetpgrp='$d_tcsetpgrp'
22231 d_telldir='$d_telldir'
22232 d_telldirproto='$d_telldirproto'
22235 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
22236 d_tm_tm_zone='$d_tm_tm_zone'
22237 d_tmpnam_r='$d_tmpnam_r'
22238 d_truncate='$d_truncate'
22239 d_ttyname_r='$d_ttyname_r'
22240 d_tzname='$d_tzname'
22241 d_u32align='$d_u32align'
22242 d_ualarm='$d_ualarm'
22245 d_union_semun='$d_union_semun'
22246 d_unordered='$d_unordered'
22247 d_unsetenv='$d_unsetenv'
22248 d_usleep='$d_usleep'
22249 d_usleepproto='$d_usleepproto'
22251 d_vendorarch='$d_vendorarch'
22252 d_vendorbin='$d_vendorbin'
22253 d_vendorlib='$d_vendorlib'
22254 d_vendorscript='$d_vendorscript'
22256 d_void_closedir='$d_void_closedir'
22257 d_voidsig='$d_voidsig'
22258 d_voidtty='$d_voidtty'
22259 d_volatile='$d_volatile'
22260 d_vprintf='$d_vprintf'
22261 d_vsnprintf='$d_vsnprintf'
22263 d_waitpid='$d_waitpid'
22264 d_wcstombs='$d_wcstombs'
22265 d_wctomb='$d_wctomb'
22266 d_writev='$d_writev'
22269 db_hashtype='$db_hashtype'
22270 db_prefixtype='$db_prefixtype'
22271 db_version_major='$db_version_major'
22272 db_version_minor='$db_version_minor'
22273 db_version_patch='$db_version_patch'
22274 defvoidused='$defvoidused'
22275 direntrytype='$direntrytype'
22278 doublesize='$doublesize'
22280 drand48_r_proto='$drand48_r_proto'
22282 dynamic_ext='$dynamic_ext'
22288 endgrent_r_proto='$endgrent_r_proto'
22289 endhostent_r_proto='$endhostent_r_proto'
22290 endnetent_r_proto='$endnetent_r_proto'
22291 endprotoent_r_proto='$endprotoent_r_proto'
22292 endpwent_r_proto='$endpwent_r_proto'
22293 endservent_r_proto='$endservent_r_proto'
22294 eunicefix='$eunicefix'
22297 extensions='$extensions'
22299 fflushNULL='$fflushNULL'
22300 fflushall='$fflushall'
22302 firstmakefile='$firstmakefile'
22304 fpossize='$fpossize'
22305 fpostype='$fpostype'
22306 freetype='$freetype'
22309 full_csh='$full_csh'
22310 full_sed='$full_sed'
22311 gccansipedantic='$gccansipedantic'
22312 gccosandvers='$gccosandvers'
22313 gccversion='$gccversion'
22314 getgrent_r_proto='$getgrent_r_proto'
22315 getgrgid_r_proto='$getgrgid_r_proto'
22316 getgrnam_r_proto='$getgrnam_r_proto'
22317 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
22318 gethostbyname_r_proto='$gethostbyname_r_proto'
22319 gethostent_r_proto='$gethostent_r_proto'
22320 getlogin_r_proto='$getlogin_r_proto'
22321 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
22322 getnetbyname_r_proto='$getnetbyname_r_proto'
22323 getnetent_r_proto='$getnetent_r_proto'
22324 getprotobyname_r_proto='$getprotobyname_r_proto'
22325 getprotobynumber_r_proto='$getprotobynumber_r_proto'
22326 getprotoent_r_proto='$getprotoent_r_proto'
22327 getpwent_r_proto='$getpwent_r_proto'
22328 getpwnam_r_proto='$getpwnam_r_proto'
22329 getpwuid_r_proto='$getpwuid_r_proto'
22330 getservbyname_r_proto='$getservbyname_r_proto'
22331 getservbyport_r_proto='$getservbyport_r_proto'
22332 getservent_r_proto='$getservent_r_proto'
22333 getspnam_r_proto='$getspnam_r_proto'
22334 gidformat='$gidformat'
22340 gmtime_r_proto='$gmtime_r_proto'
22341 gnulibc_version='$gnulibc_version'
22343 groupcat='$groupcat'
22344 groupstype='$groupstype'
22347 h_sysfile='$h_sysfile'
22350 html1dir='$html1dir'
22351 html1direxp='$html1direxp'
22352 html3dir='$html3dir'
22353 html3direxp='$html3direxp'
22362 i_arpainet='$i_arpainet'
22363 i_assert='$i_assert'
22364 i_bsdioctl='$i_bsdioctl'
22368 i_dirent='$i_dirent'
22374 i_fp_class='$i_fp_class'
22377 i_ieeefp='$i_ieeefp'
22378 i_inttypes='$i_inttypes'
22379 i_langinfo='$i_langinfo'
22380 i_libutil='$i_libutil'
22381 i_limits='$i_limits'
22382 i_locale='$i_locale'
22383 i_machcthr='$i_machcthr'
22384 i_malloc='$i_malloc'
22385 i_mallocmalloc='$i_mallocmalloc'
22387 i_memory='$i_memory'
22388 i_mntent='$i_mntent'
22391 i_neterrno='$i_neterrno'
22392 i_netinettcp='$i_netinettcp'
22396 i_pthread='$i_pthread'
22398 i_rpcsvcdbm='$i_rpcsvcdbm'
22401 i_shadow='$i_shadow'
22403 i_stdarg='$i_stdarg'
22404 i_stddef='$i_stddef'
22405 i_stdlib='$i_stdlib'
22406 i_string='$i_string'
22407 i_sunmath='$i_sunmath'
22408 i_sysaccess='$i_sysaccess'
22409 i_sysdir='$i_sysdir'
22410 i_sysfile='$i_sysfile'
22411 i_sysfilio='$i_sysfilio'
22413 i_sysioctl='$i_sysioctl'
22414 i_syslog='$i_syslog'
22415 i_sysmman='$i_sysmman'
22416 i_sysmode='$i_sysmode'
22417 i_sysmount='$i_sysmount'
22418 i_sysndir='$i_sysndir'
22419 i_sysparam='$i_sysparam'
22420 i_syspoll='$i_syspoll'
22421 i_sysresrc='$i_sysresrc'
22422 i_syssecrt='$i_syssecrt'
22423 i_sysselct='$i_sysselct'
22424 i_syssockio='$i_syssockio'
22425 i_sysstat='$i_sysstat'
22426 i_sysstatfs='$i_sysstatfs'
22427 i_sysstatvfs='$i_sysstatvfs'
22428 i_systime='$i_systime'
22429 i_systimek='$i_systimek'
22430 i_systimes='$i_systimes'
22431 i_systypes='$i_systypes'
22432 i_sysuio='$i_sysuio'
22434 i_sysutsname='$i_sysutsname'
22435 i_sysvfs='$i_sysvfs'
22436 i_syswait='$i_syswait'
22437 i_termio='$i_termio'
22438 i_termios='$i_termios'
22440 i_unistd='$i_unistd'
22443 i_values='$i_values'
22444 i_varargs='$i_varargs'
22445 i_varhdr='$i_varhdr'
22447 ignore_versioned_solibs='$ignore_versioned_solibs'
22448 inc_version_list='$inc_version_list'
22449 inc_version_list_init='$inc_version_list_init'
22452 initialinstalllocation='$initialinstalllocation'
22453 installarchlib='$installarchlib'
22454 installbin='$installbin'
22455 installhtml1dir='$installhtml1dir'
22456 installhtml3dir='$installhtml3dir'
22457 installman1dir='$installman1dir'
22458 installman3dir='$installman3dir'
22459 installprefix='$installprefix'
22460 installprefixexp='$installprefixexp'
22461 installprivlib='$installprivlib'
22462 installscript='$installscript'
22463 installsitearch='$installsitearch'
22464 installsitebin='$installsitebin'
22465 installsitehtml1dir='$installsitehtml1dir'
22466 installsitehtml3dir='$installsitehtml3dir'
22467 installsitelib='$installsitelib'
22468 installsiteman1dir='$installsiteman1dir'
22469 installsiteman3dir='$installsiteman3dir'
22470 installsitescript='$installsitescript'
22471 installstyle='$installstyle'
22472 installusrbinperl='$installusrbinperl'
22473 installvendorarch='$installvendorarch'
22474 installvendorbin='$installvendorbin'
22475 installvendorhtml1dir='$installvendorhtml1dir'
22476 installvendorhtml3dir='$installvendorhtml3dir'
22477 installvendorlib='$installvendorlib'
22478 installvendorman1dir='$installvendorman1dir'
22479 installvendorman3dir='$installvendorman3dir'
22480 installvendorscript='$installvendorscript'
22482 issymlink='$issymlink'
22483 ivdformat='$ivdformat'
22486 known_extensions='$known_extensions'
22489 lddlflags='$lddlflags'
22491 ldflags_uselargefiles='$ldflags_uselargefiles'
22492 ldlibpthname='$ldlibpthname'
22499 libsdirs='$libsdirs'
22500 libsfiles='$libsfiles'
22501 libsfound='$libsfound'
22502 libspath='$libspath'
22503 libswanted='$libswanted'
22504 libswanted_uselargefiles='$libswanted_uselargefiles'
22510 localtime_r_proto='$localtime_r_proto'
22511 locincpth='$locincpth'
22512 loclibpth='$loclibpth'
22513 longdblsize='$longdblsize'
22514 longlongsize='$longlongsize'
22515 longsize='$longsize'
22519 lseeksize='$lseeksize'
22520 lseektype='$lseektype'
22523 madlyobj='$madlyobj'
22524 madlysrc='$madlysrc'
22528 make_set_make='$make_set_make'
22529 mallocobj='$mallocobj'
22530 mallocsrc='$mallocsrc'
22531 malloctype='$malloctype'
22533 man1direxp='$man1direxp'
22536 man3direxp='$man3direxp'
22538 mips_type='$mips_type'
22539 mistrustnm='$mistrustnm'
22541 mmaptype='$mmaptype'
22542 modetype='$modetype'
22544 multiarch='$multiarch'
22546 myarchname='$myarchname'
22547 mydomain='$mydomain'
22548 myhostname='$myhostname'
22551 need_va_copy='$need_va_copy'
22552 netdb_hlen_type='$netdb_hlen_type'
22553 netdb_host_type='$netdb_host_type'
22554 netdb_name_type='$netdb_name_type'
22555 netdb_net_type='$netdb_net_type'
22558 nm_so_opt='$nm_so_opt'
22559 nonxs_ext='$nonxs_ext'
22561 nvEUformat='$nvEUformat'
22562 nvFUformat='$nvFUformat'
22563 nvGUformat='$nvGUformat'
22564 nv_overflows_integers_at='$nv_overflows_integers_at'
22565 nv_preserves_uv_bits='$nv_preserves_uv_bits'
22566 nveformat='$nveformat'
22567 nvfformat='$nvfformat'
22568 nvgformat='$nvgformat'
22571 o_nonblock='$o_nonblock'
22573 old_pthread_create_joinable='$old_pthread_create_joinable'
22574 optimize='$optimize'
22575 orderlib='$orderlib'
22578 otherlibdirs='$otherlibdirs'
22582 patchlevel='$patchlevel'
22583 path_sep='$path_sep'
22586 perl_patchlevel='$perl_patchlevel'
22587 perladmin='$perladmin'
22588 perllibs='$perllibs'
22589 perlpath='$perlpath'
22591 phostname='$phostname'
22597 prefixexp='$prefixexp'
22599 privlibexp='$privlibexp'
22600 procselfexe='$procselfexe'
22601 prototype='$prototype'
22603 quadkind='$quadkind'
22604 quadtype='$quadtype'
22605 randbits='$randbits'
22606 randfunc='$randfunc'
22607 random_r_proto='$random_r_proto'
22608 randseedtype='$randseedtype'
22610 rd_nodata='$rd_nodata'
22611 readdir64_r_proto='$readdir64_r_proto'
22612 readdir_r_proto='$readdir_r_proto'
22613 revision='$revision'
22619 sPRIEUldbl='$sPRIEUldbl'
22620 sPRIFUldbl='$sPRIFUldbl'
22621 sPRIGUldbl='$sPRIGUldbl'
22622 sPRIXU64='$sPRIXU64'
22624 sPRIeldbl='$sPRIeldbl'
22625 sPRIfldbl='$sPRIfldbl'
22626 sPRIgldbl='$sPRIgldbl'
22631 sSCNfldbl='$sSCNfldbl'
22632 sched_yield='$sched_yield'
22633 scriptdir='$scriptdir'
22634 scriptdirexp='$scriptdirexp'
22636 seedfunc='$seedfunc'
22637 selectminbits='$selectminbits'
22638 selecttype='$selecttype'
22639 sendmail='$sendmail'
22640 setgrent_r_proto='$setgrent_r_proto'
22641 sethostent_r_proto='$sethostent_r_proto'
22642 setlocale_r_proto='$setlocale_r_proto'
22643 setnetent_r_proto='$setnetent_r_proto'
22644 setprotoent_r_proto='$setprotoent_r_proto'
22645 setpwent_r_proto='$setpwent_r_proto'
22646 setservent_r_proto='$setservent_r_proto'
22649 sharpbang='$sharpbang'
22650 shmattype='$shmattype'
22651 shortsize='$shortsize'
22654 sig_count='$sig_count'
22655 sig_name='$sig_name'
22656 sig_name_init='$sig_name_init'
22658 sig_num_init='$sig_num_init'
22659 sig_size='$sig_size'
22660 signal_t='$signal_t'
22661 sitearch='$sitearch'
22662 sitearchexp='$sitearchexp'
22664 sitebinexp='$sitebinexp'
22665 sitehtml1dir='$sitehtml1dir'
22666 sitehtml1direxp='$sitehtml1direxp'
22667 sitehtml3dir='$sitehtml3dir'
22668 sitehtml3direxp='$sitehtml3direxp'
22670 sitelib_stem='$sitelib_stem'
22671 sitelibexp='$sitelibexp'
22672 siteman1dir='$siteman1dir'
22673 siteman1direxp='$siteman1direxp'
22674 siteman3dir='$siteman3dir'
22675 siteman3direxp='$siteman3direxp'
22676 siteprefix='$siteprefix'
22677 siteprefixexp='$siteprefixexp'
22678 sitescript='$sitescript'
22679 sitescriptexp='$sitescriptexp'
22680 sizesize='$sizesize'
22681 sizetype='$sizetype'
22685 sockethdr='$sockethdr'
22686 socketlib='$socketlib'
22687 socksizetype='$socksizetype'
22689 spackage='$spackage'
22690 spitshell='$spitshell'
22691 srand48_r_proto='$srand48_r_proto'
22692 srandom_r_proto='$srandom_r_proto'
22694 ssizetype='$ssizetype'
22695 startperl='$startperl'
22697 static_ext='$static_ext'
22699 stdio_base='$stdio_base'
22700 stdio_bufsiz='$stdio_bufsiz'
22701 stdio_cnt='$stdio_cnt'
22702 stdio_filbuf='$stdio_filbuf'
22703 stdio_ptr='$stdio_ptr'
22704 stdio_stream_array='$stdio_stream_array'
22705 strerror_r_proto='$strerror_r_proto'
22708 subversion='$subversion'
22712 targetarch='$targetarch'
22716 timeincl='$timeincl'
22717 timetype='$timetype'
22718 tmpnam_r_proto='$tmpnam_r_proto'
22724 ttyname_r_proto='$ttyname_r_proto'
22733 uidformat='$uidformat'
22739 uquadtype='$uquadtype'
22740 use5005threads='$use5005threads'
22741 use64bitall='$use64bitall'
22742 use64bitint='$use64bitint'
22743 usecrosscompile='$usecrosscompile'
22745 usedtrace='$usedtrace'
22746 usefaststdio='$usefaststdio'
22747 useithreads='$useithreads'
22748 uselargefiles='$uselargefiles'
22749 uselongdouble='$uselongdouble'
22750 usemallocwrap='$usemallocwrap'
22751 usemorebits='$usemorebits'
22752 usemultiplicity='$usemultiplicity'
22753 usemymalloc='$usemymalloc'
22755 useopcode='$useopcode'
22756 useperlio='$useperlio'
22757 useposix='$useposix'
22758 usereentrant='$usereentrant'
22759 userelocatableinc='$userelocatableinc'
22761 useshrplib='$useshrplib'
22762 usesitecustomize='$usesitecustomize'
22763 usesocks='$usesocks'
22764 usethreads='$usethreads'
22765 usevendorprefix='$usevendorprefix'
22766 usevfork='$usevfork'
22769 uvXUformat='$uvXUformat'
22770 uvoformat='$uvoformat'
22773 uvuformat='$uvuformat'
22774 uvxformat='$uvxformat'
22775 vendorarch='$vendorarch'
22776 vendorarchexp='$vendorarchexp'
22777 vendorbin='$vendorbin'
22778 vendorbinexp='$vendorbinexp'
22779 vendorhtml1dir='$vendorhtml1dir'
22780 vendorhtml1direxp='$vendorhtml1direxp'
22781 vendorhtml3dir='$vendorhtml3dir'
22782 vendorhtml3direxp='$vendorhtml3direxp'
22783 vendorlib='$vendorlib'
22784 vendorlib_stem='$vendorlib_stem'
22785 vendorlibexp='$vendorlibexp'
22786 vendorman1dir='$vendorman1dir'
22787 vendorman1direxp='$vendorman1direxp'
22788 vendorman3dir='$vendorman3dir'
22789 vendorman3direxp='$vendorman3direxp'
22790 vendorprefix='$vendorprefix'
22791 vendorprefixexp='$vendorprefixexp'
22792 vendorscript='$vendorscript'
22793 vendorscriptexp='$vendorscriptexp'
22795 version_patchlevel_string='$version_patchlevel_string'
22796 versiononly='$versiononly'
22798 voidflags='$voidflags'
22801 yaccflags='$yaccflags'
22806 : Add in command line options if available
22807 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22809 : add special variables
22810 $test -f $src/patchlevel.h && \
22811 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22812 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22813 echo "PERL_CONFIG_SH=true" >>config.sh
22815 : propagate old symbols
22816 if $test -f UU/config.sh; then
22817 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22818 $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
22819 config.sh config.sh UU/oldconfig.sh |\
22820 $sort | $uniq -u >UU/oldsyms
22821 set X `cat UU/oldsyms`
22827 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22829 echo ": Variables propagated from previous config.sh file." >>config.sh
22830 for sym in `cat UU/oldsyms`; do
22831 echo " Propagating $hint variable "'$'"$sym..."
22832 eval 'tmp="$'"${sym}"'"'
22834 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22840 : Finish up by extracting the .SH files
22844 echo "Extraction done."
22854 If you'd like to make any changes to the config.sh file before I begin
22855 to configure things, do it as a shell escape now (e.g. !vi config.sh).
22858 rp="Press return or use a shell escape to edit config.sh:"
22863 *) : in case they cannot read
22864 sh 1>&4 -c "$ans";;
22869 : if this fails, just run all the .SH files by hand
22878 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22885 Now you need to generate make dependencies by running "$make depend".
22886 You might prefer to run it in background: "$make depend > makedepend.out &"
22887 It can take a while, so you might not want to run it right now.
22892 rp="Run $make depend now?"
22896 $make depend && echo "Now you must run '$make'."
22899 echo "You must run '$make depend' then '$make'."
22902 elif test -f [Mm]akefile; then
22904 echo "Now you must run a $make."
22906 echo "Configure done."
22909 if $test -f Policy.sh; then
22912 If you compile $package on a different machine or from a different object
22913 directory, copy the Policy.sh file from this object directory to the
22914 new one before you run Configure -- this will help you with most of
22915 the policy defaults.
22919 if $test -f config.msg; then
22920 echo "Hmm. I also noted the following information while running:"
22922 $cat config.msg >&4
22925 $rm -f kit*isdone ark*isdone